Merge pull request #3678 from mono/seq-read
authorRodrigo Kumpera <kumpera@users.noreply.github.com>
Wed, 16 Nov 2016 18:15:41 +0000 (10:15 -0800)
committerGitHub <noreply@github.com>
Wed, 16 Nov 2016 18:15:41 +0000 (10:15 -0800)
[IO] Implement FileOptions.SequentialScan for Mac/BSD

1546 files changed:
.gitmodules
Makefile.am
acceptance-tests/SUBMODULES.json
acceptance-tests/ms-test-suite.mk
acceptance-tests/profiler-stress.mk
acceptance-tests/profiler-stress/runner.cs
configure.ac
data/config.in
data/net_1_1/machine.config
data/net_2_0/machine.config
data/net_4_0/machine.config
data/net_4_5/machine.config
eglib/src/Makefile.am
eglib/src/gfile-unix.c
eglib/src/glib.h
eglib/src/gmisc-win32-uwp.c [new file with mode: 0644]
eglib/src/gmisc-win32.c
eglib/src/gmodule-win32-internals.h [new file with mode: 0644]
eglib/src/gmodule-win32-uwp.c [new file with mode: 0644]
eglib/src/gmodule-win32.c
eglib/src/goutput.c
eglib/src/gunicode-win32-uwp.c [new file with mode: 0644]
eglib/src/gunicode-win32.c [new file with mode: 0644]
eglib/src/gunicode.c
eglib/winconfig.h
external/bockbuild [new submodule]
external/boringssl [new submodule]
external/cecil
external/corefx [new submodule]
external/ikvm
external/linker [new submodule]
external/nunit-lite
man/caspol.1
man/cccheck.1
man/ccrewrite.1
man/certmgr.1
man/crlupdate.1
man/csharp.1
man/disco.1
man/mcs.1
man/mkbundle.1
man/mono.1
man/mprof-report.1
mcs/build/Makefile
mcs/build/config-default.make
mcs/build/executable.make
mcs/build/library.make
mcs/build/nunit-summary.xsl [deleted file]
mcs/build/platforms/win32.make
mcs/build/profiles/mobile_static.make
mcs/build/profiles/monotouch_runtime.make
mcs/build/profiles/monotouch_watch.make
mcs/build/profiles/monotouch_watch_runtime.make
mcs/build/profiles/xammac.make
mcs/build/profiles/xammac_net_4_5.make
mcs/build/rules.make
mcs/build/tests.make
mcs/class/Accessibility/Accessibility-net_4_x.csproj
mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_4_x.csproj
mcs/class/Cscompmgd/Cscompmgd-net_4_x.csproj
mcs/class/CustomMarshalers/CustomMarshalers-net_4_x.csproj
mcs/class/Facades/Microsoft.Win32.Primitives/Facades_Microsoft.Win32.Primitives-net_4_x.csproj
mcs/class/Facades/Microsoft.Win32.Registry.AccessControl/Facades_Microsoft.Win32.Registry.AccessControl-net_4_x.csproj
mcs/class/Facades/Microsoft.Win32.Registry/Facades_Microsoft.Win32.Registry-net_4_x.csproj
mcs/class/Facades/System.AppContext/Facades_System.AppContext-net_4_x.csproj
mcs/class/Facades/System.Collections.Concurrent/Facades_System.Collections.Concurrent-net_4_x.csproj
mcs/class/Facades/System.Collections.NonGeneric/Facades_System.Collections.NonGeneric-net_4_x.csproj
mcs/class/Facades/System.Collections.Specialized/Facades_System.Collections.Specialized-net_4_x.csproj
mcs/class/Facades/System.Collections/Facades_System.Collections-net_4_x.csproj
mcs/class/Facades/System.ComponentModel.Annotations/Facades_System.ComponentModel.Annotations-net_4_x.csproj
mcs/class/Facades/System.ComponentModel.EventBasedAsync/Facades_System.ComponentModel.EventBasedAsync-net_4_x.csproj
mcs/class/Facades/System.ComponentModel.Primitives/Facades_System.ComponentModel.Primitives-net_4_x.csproj
mcs/class/Facades/System.ComponentModel.TypeConverter/Facades_System.ComponentModel.TypeConverter-net_4_x.csproj
mcs/class/Facades/System.ComponentModel/Facades_System.ComponentModel-net_4_x.csproj
mcs/class/Facades/System.Console/Facades_System.Console-net_4_x.csproj
mcs/class/Facades/System.Data.Common/Facades_System.Data.Common-net_4_x.csproj
mcs/class/Facades/System.Data.SqlClient/Facades_System.Data.SqlClient-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Contracts/Facades_System.Diagnostics.Contracts-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Debug/Facades_System.Diagnostics.Debug-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.FileVersionInfo/Facades_System.Diagnostics.FileVersionInfo-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Process/Facades_System.Diagnostics.Process-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.StackTrace/Facades_System.Diagnostics.StackTrace-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.TextWriterTraceListener/Facades_System.Diagnostics.TextWriterTraceListener-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Tools/Facades_System.Diagnostics.Tools-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.TraceEvent/Facades_System.Diagnostics.TraceEvent-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.TraceSource/Facades_System.Diagnostics.TraceSource-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs [deleted file]
mcs/class/Facades/System.Diagnostics.Tracing/Facades_System.Diagnostics.Tracing-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing.dll.sources
mcs/class/Facades/System.Diagnostics.Tracing/TypeForwarders.cs
mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives-net_4_x.csproj [new file with mode: 0644]
mcs/class/Facades/System.Dynamic.Runtime/Facades_System.Dynamic.Runtime-net_4_x.csproj
mcs/class/Facades/System.Globalization.Calendars/Facades_System.Globalization.Calendars-net_4_x.csproj
mcs/class/Facades/System.Globalization.Extensions/Facades_System.Globalization.Extensions-net_4_x.csproj
mcs/class/Facades/System.Globalization/Facades_System.Globalization-net_4_x.csproj
mcs/class/Facades/System.IO.Compression.ZipFile/Facades_System.IO.Compression.ZipFile-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem.AccessControl/Facades_System.IO.FileSystem.AccessControl-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem.DriveInfo/Facades_System.IO.FileSystem.DriveInfo-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem.Primitives/Facades_System.IO.FileSystem.Primitives-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem.Watcher/Facades_System.IO.FileSystem.Watcher-net_4_x.csproj
mcs/class/Facades/System.IO.FileSystem/Facades_System.IO.FileSystem-net_4_x.csproj
mcs/class/Facades/System.IO.IsolatedStorage/Facades_System.IO.IsolatedStorage-net_4_x.csproj
mcs/class/Facades/System.IO.MemoryMappedFiles/Facades_System.IO.MemoryMappedFiles-net_4_x.csproj
mcs/class/Facades/System.IO.Pipes/Facades_System.IO.Pipes-net_4_x.csproj
mcs/class/Facades/System.IO.UnmanagedMemoryStream/Facades_System.IO.UnmanagedMemoryStream-net_4_x.csproj
mcs/class/Facades/System.IO/Facades_System.IO-net_4_x.csproj
mcs/class/Facades/System.Linq.Expressions/Facades_System.Linq.Expressions-net_4_x.csproj
mcs/class/Facades/System.Linq.Parallel/Facades_System.Linq.Parallel-net_4_x.csproj
mcs/class/Facades/System.Linq.Queryable/Facades_System.Linq.Queryable-net_4_x.csproj
mcs/class/Facades/System.Linq/Facades_System.Linq-net_4_x.csproj
mcs/class/Facades/System.Net.AuthenticationManager/Facades_System.Net.AuthenticationManager-net_4_x.csproj
mcs/class/Facades/System.Net.Cache/Facades_System.Net.Cache-net_4_x.csproj
mcs/class/Facades/System.Net.HttpListener/Facades_System.Net.HttpListener-net_4_x.csproj
mcs/class/Facades/System.Net.Mail/Facades_System.Net.Mail-net_4_x.csproj
mcs/class/Facades/System.Net.NameResolution/Facades_System.Net.NameResolution-net_4_x.csproj
mcs/class/Facades/System.Net.NetworkInformation/Facades_System.Net.NetworkInformation-net_4_x.csproj
mcs/class/Facades/System.Net.Primitives/Facades_System.Net.Primitives-net_4_x.csproj
mcs/class/Facades/System.Net.Requests/Facades_System.Net.Requests-net_4_x.csproj
mcs/class/Facades/System.Net.Security/Facades_System.Net.Security-net_4_x.csproj
mcs/class/Facades/System.Net.ServicePoint/Facades_System.Net.ServicePoint-net_4_x.csproj
mcs/class/Facades/System.Net.Sockets/Facades_System.Net.Sockets-net_4_x.csproj
mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs [deleted file]
mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs [deleted file]
mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs [deleted file]
mcs/class/Facades/System.Net.Sockets/System.Net.Sockets.dll.sources
mcs/class/Facades/System.Net.Sockets/TypeForwarders.cs
mcs/class/Facades/System.Net.Utilities/Facades_System.Net.Utilities-net_4_x.csproj
mcs/class/Facades/System.Net.WebHeaderCollection/Facades_System.Net.WebHeaderCollection-net_4_x.csproj
mcs/class/Facades/System.Net.WebSockets.Client/Facades_System.Net.WebSockets.Client-net_4_x.csproj
mcs/class/Facades/System.Net.WebSockets/Facades_System.Net.WebSockets-net_4_x.csproj
mcs/class/Facades/System.ObjectModel/Facades_System.ObjectModel-net_4_x.csproj
mcs/class/Facades/System.Reflection.Emit.ILGeneration/Facades_System.Reflection.Emit.ILGeneration-net_4_x.csproj
mcs/class/Facades/System.Reflection.Emit.Lightweight/Facades_System.Reflection.Emit.Lightweight-net_4_x.csproj
mcs/class/Facades/System.Reflection.Emit/Facades_System.Reflection.Emit-net_4_x.csproj
mcs/class/Facades/System.Reflection.Extensions/Facades_System.Reflection.Extensions-net_4_x.csproj
mcs/class/Facades/System.Reflection.Primitives/Facades_System.Reflection.Primitives-net_4_x.csproj
mcs/class/Facades/System.Reflection.TypeExtensions/Facades_System.Reflection.TypeExtensions-net_4_x.csproj
mcs/class/Facades/System.Reflection/Facades_System.Reflection-net_4_x.csproj
mcs/class/Facades/System.Resources.ReaderWriter/Facades_System.Resources.ReaderWriter-net_4_x.csproj
mcs/class/Facades/System.Resources.ResourceManager/Facades_System.Resources.ResourceManager-net_4_x.csproj
mcs/class/Facades/System.Runtime.CompilerServices.VisualC/Facades_System.Runtime.CompilerServices.VisualC-net_4_x.csproj
mcs/class/Facades/System.Runtime.Extensions/Facades_System.Runtime.Extensions-net_4_x.csproj
mcs/class/Facades/System.Runtime.Handles/Facades_System.Runtime.Handles-net_4_x.csproj
mcs/class/Facades/System.Runtime.InteropServices.WindowsRuntime/Facades_System.Runtime.InteropServices.WindowsRuntime-net_4_x.csproj
mcs/class/Facades/System.Runtime.InteropServices/Facades_System.Runtime.InteropServices-net_4_x.csproj
mcs/class/Facades/System.Runtime.Numerics/Facades_System.Runtime.Numerics-net_4_x.csproj
mcs/class/Facades/System.Runtime.Serialization.Json/Facades_System.Runtime.Serialization.Json-net_4_x.csproj
mcs/class/Facades/System.Runtime.Serialization.Primitives/Facades_System.Runtime.Serialization.Primitives-net_4_x.csproj
mcs/class/Facades/System.Runtime.Serialization.Xml/Facades_System.Runtime.Serialization.Xml-net_4_x.csproj
mcs/class/Facades/System.Runtime/Facades_System.Runtime-net_4_x.csproj
mcs/class/Facades/System.Security.AccessControl/Facades_System.Security.AccessControl-net_4_x.csproj
mcs/class/Facades/System.Security.Claims/Facades_System.Security.Claims-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.DeriveBytes/Facades_System.Security.Cryptography.DeriveBytes-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encoding/Facades_System.Security.Cryptography.Encoding-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encryption.Aes/Facades_System.Security.Cryptography.Encryption.Aes-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman/Facades_System.Security.Cryptography.Encryption.ECDiffieHellman-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encryption.ECDsa/Facades_System.Security.Cryptography.Encryption.ECDsa-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Encryption/Facades_System.Security.Cryptography.Encryption-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Hashing.Algorithms/Facades_System.Security.Cryptography.Hashing.Algorithms-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Hashing/Facades_System.Security.Cryptography.Hashing-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.Primitives/Facades_System.Security.Cryptography.Primitives-net_4_x.csproj [new file with mode: 0644]
mcs/class/Facades/System.Security.Cryptography.ProtectedData/Facades_System.Security.Cryptography.ProtectedData-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.RSA/Facades_System.Security.Cryptography.RSA-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Facades_System.Security.Cryptography.RandomNumberGenerator-net_4_x.csproj
mcs/class/Facades/System.Security.Cryptography.X509Certificates/Facades_System.Security.Cryptography.X509Certificates-net_4_x.csproj
mcs/class/Facades/System.Security.Principal.Windows/Facades_System.Security.Principal.Windows-net_4_x.csproj
mcs/class/Facades/System.Security.Principal/Facades_System.Security.Principal-net_4_x.csproj
mcs/class/Facades/System.Security.SecureString/Facades_System.Security.SecureString-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.Duplex/Facades_System.ServiceModel.Duplex-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.Http/Facades_System.ServiceModel.Http-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.NetTcp/Facades_System.ServiceModel.NetTcp-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.Primitives/Facades_System.ServiceModel.Primitives-net_4_x.csproj
mcs/class/Facades/System.ServiceModel.Security/Facades_System.ServiceModel.Security-net_4_x.csproj
mcs/class/Facades/System.ServiceProcess.ServiceController/Facades_System.ServiceProcess.ServiceController-net_4_x.csproj
mcs/class/Facades/System.Text.Encoding.CodePages/Facades_System.Text.Encoding.CodePages-net_4_x.csproj [new file with mode: 0644]
mcs/class/Facades/System.Text.Encoding.Extensions/Facades_System.Text.Encoding.Extensions-net_4_x.csproj
mcs/class/Facades/System.Text.Encoding/Facades_System.Text.Encoding-net_4_x.csproj
mcs/class/Facades/System.Text.RegularExpressions/Facades_System.Text.RegularExpressions-net_4_x.csproj
mcs/class/Facades/System.Threading.AccessControl/Facades_System.Threading.AccessControl-net_4_x.csproj
mcs/class/Facades/System.Threading.Overlapped/Facades_System.Threading.Overlapped-net_4_x.csproj
mcs/class/Facades/System.Threading.Tasks.Parallel/Facades_System.Threading.Tasks.Parallel-net_4_x.csproj
mcs/class/Facades/System.Threading.Tasks/Facades_System.Threading.Tasks-net_4_x.csproj
mcs/class/Facades/System.Threading.Thread/Facades_System.Threading.Thread-net_4_x.csproj
mcs/class/Facades/System.Threading.ThreadPool/Facades_System.Threading.ThreadPool-net_4_x.csproj
mcs/class/Facades/System.Threading.Timer/Facades_System.Threading.Timer-net_4_x.csproj
mcs/class/Facades/System.Threading/Facades_System.Threading-net_4_x.csproj
mcs/class/Facades/System.Xml.ReaderWriter/Facades_System.Xml.ReaderWriter-net_4_x.csproj
mcs/class/Facades/System.Xml.XDocument/Facades_System.Xml.XDocument-net_4_x.csproj
mcs/class/Facades/System.Xml.XPath.XDocument/Facades_System.Xml.XPath.XDocument-net_4_x.csproj
mcs/class/Facades/System.Xml.XPath/Facades_System.Xml.XPath-net_4_x.csproj
mcs/class/Facades/System.Xml.XmlDocument/Facades_System.Xml.XmlDocument-net_4_x.csproj
mcs/class/Facades/System.Xml.XmlSerializer/Facades_System.Xml.XmlSerializer-net_4_x.csproj
mcs/class/Facades/System.Xml.Xsl.Primitives/Facades_System.Xml.Xsl.Primitives-net_4_x.csproj
mcs/class/I18N/CJK/I18N.CJK-net_4_x.csproj
mcs/class/I18N/Common/I18N-net_4_x.csproj
mcs/class/I18N/MidEast/I18N.MidEast-net_4_x.csproj
mcs/class/I18N/Other/I18N.Other-net_4_x.csproj
mcs/class/I18N/Rare/I18N.Rare-net_4_x.csproj
mcs/class/I18N/West/I18N.West-net_4_x.csproj
mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_4_x.csproj
mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2DataReader.cs
mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_x.csproj
mcs/class/Makefile
mcs/class/Microsoft.Build.Engine/.gitignore
mcs/class/Microsoft.Build.Engine/Makefile
mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_4_x.csproj
mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/PredefinedPropertyFunctionsTest.cs
mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs
mcs/class/Microsoft.Build.Engine/Test/various/Properties.cs
mcs/class/Microsoft.Build.Framework/.gitignore [new file with mode: 0644]
mcs/class/Microsoft.Build.Framework/Makefile
mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_x.csproj
mcs/class/Microsoft.Build.Tasks/.gitignore
mcs/class/Microsoft.Build.Tasks/Makefile
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_x.csproj
mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs
mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs
mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/WriteLinesToFileTest.cs
mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-4.0 [deleted file]
mcs/class/Microsoft.Build.Utilities/.gitignore [new file with mode: 0644]
mcs/class/Microsoft.Build.Utilities/Makefile
mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_x.csproj
mcs/class/Microsoft.Build/.gitignore
mcs/class/Microsoft.Build/Makefile
mcs/class/Microsoft.Build/Microsoft.Build-net_4_x.csproj
mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildNodeManager.cs
mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources
mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectItemTest.cs
mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/BuildSubmissionTest.cs
mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_x.csproj
mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_x.csproj
mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure-net_4_x.csproj
mcs/class/Mono.Btls.Interface/Makefile [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface-net_4_x.csproj [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface.dll.sources [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsObject.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsProvider.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Chain.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Error.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Format.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Lookup.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Name.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Purpose.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Store.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreCtx.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreManager.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreType.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509TrustKind.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509VerifyFlags.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509VerifyParam.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/VersionInfo.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/Properties/AssemblyInfo.cs [new file with mode: 0644]
mcs/class/Mono.Btls.Interface/README.md [new file with mode: 0644]
mcs/class/Mono.C5/Mono.C5-net_4_x.csproj
mcs/class/Mono.CSharp/Mono.CSharp-net_4_x.csproj
mcs/class/Mono.Cairo/Mono.Cairo-net_4_x.csproj
mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_x.csproj
mcs/class/Mono.CodeContracts/Mono.CodeContracts-net_4_x.csproj
mcs/class/Mono.CodeContracts/Mono.CodeContracts_test.dll.sources
mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_x.csproj
mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs
mcs/class/Mono.CompilerServices.SymbolWriter/SourceMethodBuilder.cs
mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_4_x.csproj
mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteConvert.cs
mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_test.dll.sources
mcs/class/Mono.Data.Sqlite/Test/Bug27864.cs
mcs/class/Mono.Data.Sqlite/Test/SqliteTests.cs [new file with mode: 0644]
mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_4_x.csproj
mcs/class/Mono.Debugger.Soft/Makefile
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_4_x.csproj
mcs/class/Mono.Debugger.Soft/Test/TypeLoadClass.cs [new file with mode: 0644]
mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mcs/class/Mono.Http/Mono.Http-net_4_x.csproj
mcs/class/Mono.Management/Mono.Management-net_4_x.csproj
mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_4_x.csproj
mcs/class/Mono.Messaging/Mono.Messaging-net_4_x.csproj
mcs/class/Mono.Options/Mono.Options-net_4_x.csproj
mcs/class/Mono.Parallel/Mono.Parallel-net_4_x.csproj
mcs/class/Mono.Parallel/Mono.Parallel_test.dll.sources
mcs/class/Mono.Posix/Mono.Posix-net_4_x.csproj
mcs/class/Mono.Posix/Mono.Posix_test.dll.sources
mcs/class/Mono.Posix/Test/Mono.Unix.Native/RealTimeSignumTests.cs
mcs/class/Mono.Posix/Test/Mono.Unix.Native/SocketTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix.Native/StdlibTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix/UnixEndPointTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix/UnixGroupTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix/UnixListenerTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix/UnixMarshalTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix/UnixPathTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs
mcs/class/Mono.Posix/Test/Mono.Unix/UnixUserTest.cs
mcs/class/Mono.Reactive.Testing/Makefile
mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_4_x.csproj
mcs/class/Mono.Security/Mono.Security-net_4_x.csproj
mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs
mcs/class/Mono.Security/Mono.Security.X509/X509StoreManager.cs
mcs/class/Mono.Security/Mono.Security.X509/X509Stores.cs
mcs/class/Mono.Security/Test/tools/sockethell/Makefile
mcs/class/Mono.Simd/Mono.Simd-net_4_x.csproj
mcs/class/Mono.Tasklets/Mono.Tasklets-net_4_x.csproj
mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_4_x.csproj
mcs/class/Mono.XBuild.Tasks/.gitignore [new file with mode: 0644]
mcs/class/Mono.XBuild.Tasks/Makefile
mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_4_x.csproj
mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks_test.dll.sources
mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_4_x.csproj
mcs/class/PEAPI/PEAPI-net_4_x.csproj
mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_4_x.csproj
mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_4_x.csproj
mcs/class/SMDiagnostics/SMDiagnostics-net_4_x.csproj
mcs/class/System.ComponentModel.Composition.4.5/System.ComponentModel.Composition-net_4_x.csproj
mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_4_x.csproj
mcs/class/System.Configuration.Install/System.Configuration.Install-net_4_x.csproj
mcs/class/System.Configuration/Makefile
mcs/class/System.Configuration/System.Configuration-net_4_x.csproj
mcs/class/System.Configuration/Test/App.config [deleted file]
mcs/class/System.Configuration/Test/System.Configuration/AppSettingsSectionTest.cs
mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs
mcs/class/System.Configuration/Test/System.Configuration/ConfigurationSaveTest.cs
mcs/class/System.Configuration/Test/Util/TestUtil.cs
mcs/class/System.Configuration/Test/test-config-file [new file with mode: 0644]
mcs/class/System.Configuration/net_4_x_System.Configuration_test.dll.config [deleted file]
mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs
mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafePipeHandle.cs
mcs/class/System.Core/System.Core-net_4_x.csproj
mcs/class/System.Core/System.Core-plaincore-net_4_x.csproj
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedFile.cs
mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedView.cs
mcs/class/System.Core/System.IO.Pipes/AnonymousPipeClientStream.cs
mcs/class/System.Core/System.IO.Pipes/NamedPipeClientStream.cs
mcs/class/System.Core/System.IO.Pipes/NamedPipeServerStream.cs
mcs/class/System.Core/System.Security.Cryptography.X509Certificates/RSACertificateExtensions.cs
mcs/class/System.Core/System.Security.Cryptography/CngAlgorithm.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngAlgorithmGroup.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngExportPolicies.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngKeyCreationOptions.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngKeyCreationParameters.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngKeyOpenOptions.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngKeyUsages.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngProperty.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngPropertyCollection.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngPropertyOptions.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngProvider.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngUIPolicy.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/CngUIProtectionLevels.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/ECDiffieHellmanKeyDerivationFunction.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/ECKeyXmlFormat.cs [deleted file]
mcs/class/System.Core/System.Security.Cryptography/IncrementalHash.cs [deleted file]
mcs/class/System.Core/Test/System.IO.MemoryMappedFiles/MemoryMappedFileTest.cs
mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs
mcs/class/System.Core/common_System.Core.dll.sources
mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_4_x.csproj
mcs/class/System.Data.Entity/System.Data.Entity-net_4_x.csproj
mcs/class/System.Data.Linq/System.Data.Linq-net_4_x.csproj
mcs/class/System.Data.Linq/build/.gitignore [new file with mode: 0644]
mcs/class/System.Data.Linq/build/DbLinq.Sqlite_test_mono_strict.dll.sources
mcs/class/System.Data.Linq/build/Makefile
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DataContext.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DynamicLinqTest.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteCommand_Test.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteQuery_Test.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Linq_101_Samples/Advanced.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_Complex.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_GroupBy.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_AnyCountFirst.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_DateTimeFunctions.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_EntitySet.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/StoredProcTest.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Table.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/TestBase.cs
mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/WriteTest.cs
mcs/class/System.Data.OracleClient/README.tests
mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_4_x.csproj
mcs/class/System.Data.OracleClient/System.Data.OracleClient_test_default.dll.config.example [deleted file]
mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.Oci/OciDefineHandleTest.cs
mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/GHTDB.ORACLE.sql
mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/ConnectedDataProvider.cs
mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleConnection/IDBConnection_For_Oracle.cs
mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/readme.txt
mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleLobTest.cs
mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs
mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_4_x.csproj
mcs/class/System.Data.Services/System.Data.Services-net_4_x.csproj
mcs/class/System.Data/Makefile
mcs/class/System.Data/System.Data-net_4_x.csproj
mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopy.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
mcs/class/System.Data/System.Data.SqlClient/SqlCommand.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
mcs/class/System.Data/System.Data.SqlClient/SqlConnection.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.SqlClient/SqlDependency.cs
mcs/class/System.Data/System.Data.SqlClient/SqlException.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
mcs/class/System.Data/System.Data.SqlClient/SqlParameter.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs
mcs/class/System.Data/Test/System.Data.SqlClient/SqlBulkCopyTest.cs
mcs/class/System.Data/Test/System.Data.SqlClient/SqlCommandBuilderTest.cs
mcs/class/System.Data/Test/System.Data.SqlClient/SqlCommandTest.cs
mcs/class/System.Data/Test/System.Data.SqlClient/SqlConnectionTest.cs
mcs/class/System.Data/Test/System.Data.SqlClient/SqlDataAdapterTest.cs
mcs/class/System.Data/Test/System.Data.SqlClient/SqlParameterTest.cs
mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs
mcs/class/System.Data/Test/System.Data/ConstraintTest.cs
mcs/class/System.Data/Test/System.Data/DataRelationCollectionTest.cs
mcs/class/System.Data/Test/System.Data/DataRelationTest.cs
mcs/class/System.Data/Test/System.Data/TypedDataSetGeneratorTest.cs
mcs/class/System.Data/Test/System.Data/UniqueConstraintTest.cs
mcs/class/System.Data/Test/test-config-file [new file with mode: 0644]
mcs/class/System.Data/app_test_mobile_static.config [deleted file]
mcs/class/System.Data/app_test_net_4_x.config [deleted file]
mcs/class/System.Data/monotouch_watch_System.Data.dll.exclude.sources [new file with mode: 0644]
mcs/class/System.Data/monotouch_watch_System.Data.dll.sources
mcs/class/System.Deployment/System.Deployment-net_4_x.csproj
mcs/class/System.Design/System.Design-net_4_x.csproj
mcs/class/System.Design/System.Design-plaindesign-net_4_x.csproj
mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_x.csproj
mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_x.csproj
mcs/class/System.Drawing.Design/System.Drawing.Design-net_4_x.csproj
mcs/class/System.Drawing/System.Drawing-net_4_x.csproj
mcs/class/System.Drawing/System.Drawing_test.dll.sources
mcs/class/System.Drawing/Test/DrawingTest/Test/Graphics.cs
mcs/class/System.Dynamic/System.Dynamic-net_4_x.csproj
mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_4_x.csproj
mcs/class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem-net_4_x.csproj
mcs/class/System.IO.Compression/System.IO.Compression-net_4_x.csproj
mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_x.csproj
mcs/class/System.IdentityModel/Assembly/AssemblyInfo.cs
mcs/class/System.IdentityModel/Makefile
mcs/class/System.IdentityModel/System.IdentityModel-net_4_x.csproj
mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/BinarySecretSecurityToken.cs [new file with mode: 0644]
mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/InternalEncryptedKeyIdentifierClause.cs [new file with mode: 0644]
mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/WrappedKeySecurityToken.cs [new file with mode: 0644]
mcs/class/System.IdentityModel/System.ServiceModel.Security/BinarySecretKeyIdentifierClause.cs [new file with mode: 0644]
mcs/class/System.IdentityModel/System.ServiceModel.Security/KeyNameIdentifierClause.cs [new file with mode: 0644]
mcs/class/System.IdentityModel/System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs [new file with mode: 0644]
mcs/class/System.IdentityModel/net_4_x_System.IdentityModel.dll.sources
mcs/class/System.Json.Microsoft/System.Json.Microsoft-net_4_x.csproj
mcs/class/System.Json/System.Json-net_4_x.csproj
mcs/class/System.Management/System.Management-net_4_x.csproj
mcs/class/System.Messaging/System.Messaging-net_4_x.csproj
mcs/class/System.Net.Http.Formatting/System.Net.Http.Formatting-net_4_x.csproj
mcs/class/System.Net.Http.WebRequest/System.Net.Http.WebRequest-net_4_x.csproj
mcs/class/System.Net.Http/HttpClientEx.cs
mcs/class/System.Net.Http/System.Net.Http-net_4_x.csproj
mcs/class/System.Net.Http/System.Net.Http.Headers/ContentRangeHeaderValue.cs
mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentRangeHeaderValueTest.cs
mcs/class/System.Net/System.Net-net_4_x.csproj
mcs/class/System.Numerics.Vectors/System.Numerics.Vectors-net_4_x.csproj
mcs/class/System.Numerics/System.Numerics-net_4_x.csproj
mcs/class/System.Reactive.Core/System.Reactive.Core-net_4_x.csproj
mcs/class/System.Reactive.Debugger/System.Reactive.Debugger-net_4_x.csproj
mcs/class/System.Reactive.Experimental/System.Reactive.Experimental-net_4_x.csproj
mcs/class/System.Reactive.Interfaces/System.Reactive.Interfaces-net_4_x.csproj
mcs/class/System.Reactive.Linq/System.Reactive.Linq-net_4_x.csproj
mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases-net_4_x.csproj
mcs/class/System.Reactive.PlatformServices/System.Reactive.PlatformServices-net_4_x.csproj
mcs/class/System.Reactive.Providers/System.Reactive.Providers-net_4_x.csproj
mcs/class/System.Reactive.Runtime.Remoting/System.Reactive.Runtime.Remoting-net_4_x.csproj
mcs/class/System.Reactive.Windows.Forms/System.Reactive.Windows.Forms-net_4_x.csproj
mcs/class/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading-net_4_x.csproj
mcs/class/System.Reflection.Context/System.Reflection.Context-net_4_x.csproj [new file with mode: 0644]
mcs/class/System.Runtime.Caching/System.Runtime.Caching-net_4_x.csproj
mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-net_4_x.csproj
mcs/class/System.Runtime.InteropServices.RuntimeInformation/System.Runtime.InteropServices.RuntimeInformation-net_4_x.csproj [new file with mode: 0644]
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_4_x.csproj
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc.Win32/IpcChannel.cs
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc.Win32/NamedPipeHelper.cs
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Ipc.Win32/NamedPipeListener.cs
mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources
mcs/class/System.Runtime.Remoting/Test/HttpBugTests.cs
mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs
mcs/class/System.Runtime.Remoting/Test/RemotingServicesTest.cs
mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_4_x.csproj
mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_4_x.csproj
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/CollectionSerialization.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractExporterTest2.cs
mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractImporterTest2.cs
mcs/class/System.Security/Makefile
mcs/class/System.Security/System.Security-net_4_x.csproj
mcs/class/System.ServiceModel.Activation/System.ServiceModel.Activation-net_4_x.csproj
mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-net_4_x.csproj
mcs/class/System.ServiceModel.Internals/System.ServiceModel.Internals-net_4_x.csproj
mcs/class/System.ServiceModel.Routing/System.ServiceModel.Routing-net_4_x.csproj
mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_4_x.csproj
mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Web/WebOperationContextTest.cs
mcs/class/System.ServiceModel/Assembly/AssemblyInfo.cs
mcs/class/System.ServiceModel/System.ServiceModel-net_4_x.csproj
mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_4_x.csproj
mcs/class/System.ServiceModel/System.ServiceModel.Channels.NetTcp/TcpChannelListener.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageFault.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs
mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/BinarySecretSecurityToken.cs [deleted file]
mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/InternalEncryptedKeyIdentifierClause.cs [deleted file]
mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/WrappedKeySecurityToken.cs [deleted file]
mcs/class/System.ServiceModel/System.ServiceModel.Security/BinarySecretKeyIdentifierClause.cs [deleted file]
mcs/class/System.ServiceModel/System.ServiceModel.Security/KeyNameIdentifierClause.cs [deleted file]
mcs/class/System.ServiceModel/System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs [deleted file]
mcs/class/System.ServiceModel/System.ServiceModel.dll.sources
mcs/class/System.ServiceModel/System.ServiceModel_test.dll.sources
mcs/class/System.ServiceModel/Test/MetadataTests/BindingTestAssertions.cs
mcs/class/System.ServiceModel/Test/MetadataTests/ExportTests.cs
mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests.cs
mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests_LoadMetadata.cs
mcs/class/System.ServiceModel/Test/MetadataTests/MiscImportTests.cs
mcs/class/System.ServiceModel/Test/System.ServiceModel.Channels/MessageEncoderTest.cs
mcs/class/System.ServiceModel/Test/System.ServiceModel.Channels/MessageFaultTest.cs
mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/DispatchOperationTest.cs
mcs/class/System.ServiceModel/xammac_net_4_5_System.ServiceModel.dll.sources
mcs/class/System.ServiceProcess/System.ServiceProcess-net_4_x.csproj
mcs/class/System.ServiceProcess/System.ServiceProcess/Win32ServiceController.cs
mcs/class/System.ServiceProcess/System.ServiceProcess_test.dll.sources
mcs/class/System.ServiceProcess/Test/System.ServiceProcess/ServiceControllerTest.cs
mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow-net_4_x.csproj
mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/DataflowBlockTest.cs
mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs
mcs/class/System.Transactions/System.Transactions-net_4_x.csproj
mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_4_x.csproj
mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_4_x.csproj
mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_4_x.csproj
mcs/class/System.Web.DynamicData/System.Web.DynamicData_test.dll.sources
mcs/class/System.Web.DynamicData/Test/Common/Mocks.cs [deleted file]
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicControlTest.cs
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataRouteHandlerTest.cs
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicDataRouteTest.cs
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/DynamicValidatorTest.cs
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateUserControlTest.cs
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaModelTest.cs
mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaTableTest.cs
mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_4_x.csproj
mcs/class/System.Web.Extensions/System.Web.Extensions-net_4_x.csproj
mcs/class/System.Web.Http.SelfHost/System.Web.Http.SelfHost-net_4_x.csproj
mcs/class/System.Web.Http.WebHost/System.Web.Http.WebHost-net_4_x.csproj
mcs/class/System.Web.Http/System.Web.Http-net_4_x.csproj
mcs/class/System.Web.Mobile/System.Web.Mobile-net_4_x.csproj
mcs/class/System.Web.Mvc3/System.Web.Mvc3-net_4_x.csproj
mcs/class/System.Web.Razor/System.Web.Razor-net_4_x.csproj
mcs/class/System.Web.RegularExpressions/System.Web.RegularExpressions-net_4_x.csproj
mcs/class/System.Web.Routing/System.Web.Routing-net_4_x.csproj
mcs/class/System.Web.Services/System.Web.Services-net_4_x.csproj
mcs/class/System.Web.WebPages.Deployment/System.Web.WebPages.Deployment-net_4_x.csproj
mcs/class/System.Web.WebPages.Razor/System.Web.WebPages.Razor-net_4_x.csproj
mcs/class/System.Web.WebPages/System.Web.WebPages-net_4_x.csproj
mcs/class/System.Web/System.Web-net_4_x.csproj
mcs/class/System.Web/System.Web-plainweb-net_4_x.csproj
mcs/class/System.Web/System.Web.dll.sources
mcs/class/System.Web/System.Web_standalone_test.dll.sources
mcs/class/System.Web/System.Web_test.dll.sources
mcs/class/System.Web/Test/System.Web.Hosting/HostingEnvironmentTest.cs
mcs/class/System.Web/Test/System.Web.UI.WebControls.Adapters/HideDisabledControlAdapterTest.cs [changed mode: 0644->0755]
mcs/class/System.Web/Test/System.Web.UI.WebControls.Adapters/MenuAdapterTest.cs [changed mode: 0644->0755]
mcs/class/System.Web/Test/System.Web.UI.WebControls.Adapters/WebControlAdapterTest.cs [changed mode: 0644->0755]
mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs [changed mode: 0644->0755]
mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs
mcs/class/System.Web/Test/System.Web/HttpRuntimeTest.cs
mcs/class/System.Web/Test/System.Web/XmlSiteMapProviderTest.cs
mcs/class/System.Windows.Forms.DataVisualization/System.Windows.Forms.DataVisualization-net_4_x.csproj
mcs/class/System.Windows.Forms/System.Windows.Forms-net_4_x.csproj
mcs/class/System.Windows.Forms/System.Windows.Forms.dll.sources
mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs
mcs/class/System.Windows.Forms/System.Windows.Forms_test.dll.sources
mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeFileRefGetValueTests.cs
mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerialisedGetValueTypeNameTests.cs
mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerializedGetValueTests.cs
mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeTest.cs
mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeWriteBehavior.cs
mcs/class/System.Windows.Forms/Test/System.Windows.Forms/ApplicationTest.cs
mcs/class/System.Windows.Forms/Test/System.Windows.Forms/ListViewTest.cs
mcs/class/System.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs
mcs/class/System.Windows/System.Windows-net_4_x.csproj
mcs/class/System.Workflow.Activities/System.Workflow.Activities-net_4_x.csproj
mcs/class/System.Workflow.ComponentModel/System.Workflow.ComponentModel-net_4_x.csproj
mcs/class/System.Workflow.Runtime/System.Workflow.Runtime-net_4_x.csproj
mcs/class/System.XML/System.Xml-bare-net_4_x.csproj
mcs/class/System.XML/System.Xml-net_4_x.csproj
mcs/class/System.XML/System.Xml.Serialization/TypeData.cs
mcs/class/System.XML/System.Xml.Serialization/XmlCustomFormatter.cs
mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs
mcs/class/System.XML/Test/System.Xml.Serialization/DeserializeTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization/XmlCodeExporterTests.cs
mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTestClasses.cs
mcs/class/System.XML/Test/System.Xml.Serialization/XmlSerializerTests.cs
mcs/class/System.XML/Test/System.Xml/XmlSecureResolverTests.cs
mcs/class/System.Xaml/System.Xaml-net_4_x.csproj
mcs/class/System.Xml.Linq/System.Xml.Linq-net_4_x.csproj
mcs/class/System.Xml.Linq/System.Xml.Linq_test.dll.sources
mcs/class/System.Xml.Linq/Test/System.Xml.Linq/XElementTest.cs
mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs
mcs/class/System.Xml.Serialization/System.Xml.Serialization-net_4_x.csproj
mcs/class/System/Assembly/AssemblyInfo.cs
mcs/class/System/Makefile
mcs/class/System/Mono.Btls/MonoBtlsBio.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsContext.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsError.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsException.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsKey.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsObject.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsPkcs12.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsProvider.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsSsl.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsSslCtx.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsSslError.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsStream.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsUtils.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Chain.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Error.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Exception.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509FileType.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Format.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509LookupAndroid.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509LookupMono.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509LookupMonoCollection.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509LookupType.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Name.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509NameEntryType.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Purpose.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Revoked.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509Store.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509StoreCtx.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509StoreManager.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509StoreType.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509TrustKind.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509VerifyFlags.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/MonoBtlsX509VerifyParam.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/X509CertificateImplBtls.cs [new file with mode: 0644]
mcs/class/System/Mono.Btls/X509ChainImplBtls.cs [new file with mode: 0644]
mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
mcs/class/System/Mono.Net.Security/LegacySslStream.cs
mcs/class/System/Mono.Net.Security/MobileTlsContext.cs
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.Droid.cs
mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs
mcs/class/System/Mono.Net.Security/MonoTlsStream.cs
mcs/class/System/ReferenceSources/AutoWebProxyScriptEngine.cs
mcs/class/System/ReferenceSources/CAPI.cs
mcs/class/System/ReferenceSources/HttpApi.cs
mcs/class/System/ReferenceSources/Logging.cs
mcs/class/System/ReferenceSources/SecureStringHelper.cs [new file with mode: 0644]
mcs/class/System/ReferenceSources/SettingsSectionInternal.cs
mcs/class/System/System-bare-net_4_x.csproj
mcs/class/System/System-net_4_x.csproj
mcs/class/System/System-secxml-net_4_x.csproj
mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs
mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs
mcs/class/System/System.Configuration/AppSettingsReader.cs
mcs/class/System/System.Configuration/ConfigHelper.cs
mcs/class/System/System.Configuration/ConfigXmlDocument.cs
mcs/class/System/System.Configuration/ConfigurationSettings.cs
mcs/class/System/System.Configuration/NameValueFileSectionHandler.cs
mcs/class/System/System.Configuration/SingleTagSectionHandler.cs
mcs/class/System/System.Diagnostics/EventLog.cs
mcs/class/System/System.Diagnostics/PerformanceCounter.cs
mcs/class/System/System.Diagnostics/Process.cs
mcs/class/System/System.Diagnostics/Win32EventLog.cs
mcs/class/System/System.IO/FileSystemWatcher.cs
mcs/class/System/System.IO/FileSystemWatcher_mobile.cs
mcs/class/System/System.Net.Configuration/ConnectionManagementHandler.cs
mcs/class/System/System.Net.Configuration/WebRequestModuleHandler.cs
mcs/class/System/System.Net.NetworkInformation/IPGlobalProperties.cs
mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs
mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
mcs/class/System/System.Net.NetworkInformation/Ping.cs
mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs
mcs/class/System/System.Net.Security/SslStream.cs
mcs/class/System/System.Net.Security/SslStream.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/SendPacketsElement.cs [deleted file]
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs
mcs/class/System/System.Net.Sockets/SocketAsyncOperation.cs [deleted file]
mcs/class/System/System.Net.Sockets/SocketReceiveFromResult.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/SocketReceiveMessageFromResult.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/SocketTaskExtensions.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/TcpClient.cs [deleted file]
mcs/class/System/System.Net.Sockets/TcpListener.cs [deleted file]
mcs/class/System/System.Net.Sockets/TcpListener.platformnotsupported.cs
mcs/class/System/System.Net.Sockets/UdpClient.cs [deleted file]
mcs/class/System/System.Net.Sockets/UdpClient.platformnotsupported.cs
mcs/class/System/System.Net/AuthenticationManager.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/Dns.cs
mcs/class/System/System.Net/FtpWebRequest.cs
mcs/class/System/System.Net/HttpListener.platformnotsupported.cs
mcs/class/System/System.Net/HttpListenerContext.platformnotsupported.cs
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/System.Net/HttpWebRequest.cs
mcs/class/System/System.Net/HttpWebRequest.platformnotsupported.cs
mcs/class/System/System.Net/HttpWebResponse.cs
mcs/class/System/System.Net/NetworkCredential.cs [deleted file]
mcs/class/System/System.Net/ResponseStream.cs
mcs/class/System/System.Net/ServicePoint.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/ServicePointManager.cs
mcs/class/System/System.Net/ServicePointManager.platformnotsupported.cs [new file with mode: 0644]
mcs/class/System/System.Net/WebConnection.cs
mcs/class/System/System.Security.AccessControl/SemaphoreSecurity.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/OSX509Certificates.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2Impl.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2ImplMono.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509ChainPolicy.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Helper2.cs
mcs/class/System/System.dll.sources
mcs/class/System/System/AndroidPlatform.cs
mcs/class/System/System/MonoExeLocator.cs [deleted file]
mcs/class/System/System/MonoToolsLocator.cs [new file with mode: 0755]
mcs/class/System/System_test.dll.sources
mcs/class/System/Test/System.CodeDom.Compiler/CodeGeneratorGenerateFromCompileUnitTest.cs
mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs
mcs/class/System/Test/System.Diagnostics/SourceSwitchTest.cs
mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs
mcs/class/System/Test/System.IO.Compression/DeflateStreamTest.cs
mcs/class/System/Test/System.Net.Sockets/SocketAsyncEventArgsTest.cs
mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
mcs/class/System/Test/System.Net.Sockets/UdpClientTest.cs
mcs/class/System/Test/System.Net/FtpWebRequestTest.cs
mcs/class/System/Test/System.Net/NetworkCredentialTest.cs
mcs/class/System/Test/System.Net/ServicePointManagerTest.cs
mcs/class/System/Test/System.Net/ServicePointTest.cs
mcs/class/System/Test/System.Net/WebClientTest.cs
mcs/class/System/Test/System.Security.Cryptography.X509Certificates/PkitsTest.cs
mcs/class/System/Test/System/UriTest3.cs
mcs/class/System/Test/compressed.bin [new file with mode: 0644]
mcs/class/System/Test/test-config-file
mcs/class/System/Test/test-config-file-net-2.0 [deleted file]
mcs/class/System/mobile_System.dll.sources
mcs/class/System/monodroid_System.dll.sources
mcs/class/System/monotouch_watch_System.dll.exclude.sources
mcs/class/System/monotouch_watch_System.dll.sources
mcs/class/System/monotouch_watch_runtime_System.dll.exclude.sources [new file with mode: 0644]
mcs/class/System/monotouch_watch_runtime_System.dll.sources
mcs/class/SystemWebTestShim/SystemWebTestShim-net_4_x.csproj
mcs/class/WebMatrix.Data/WebMatrix.Data-net_4_x.csproj
mcs/class/WebMatrix.Data/WebMatrix.Data_test.dll.sources
mcs/class/WindowsBase/System.IO.Packaging/Package.cs [changed mode: 0644->0755]
mcs/class/WindowsBase/Test/System.Windows/RectTest.cs
mcs/class/WindowsBase/WindowsBase-net_4_x.csproj
mcs/class/WindowsBase/WindowsBase.dll.sources
mcs/class/WindowsBase/WindowsBase_test.dll.sources
mcs/class/WindowsBase/ZipSharp/IOFunctions.cs
mcs/class/WindowsBase/ZipSharp/NativeUnzip.cs
mcs/class/WindowsBase/ZipSharp/NativeVersion.cs [new file with mode: 0755]
mcs/class/WindowsBase/ZipSharp/NativeZip.cs
mcs/class/WindowsBase/ZipSharp/UnzipArchive.cs
mcs/class/WindowsBase/ZipSharp/UnzipFileInfo.cs
mcs/class/WindowsBase/ZipSharp/UnzipReadStream.cs
mcs/class/WindowsBase/ZipSharp/ZipArchive.cs
mcs/class/WindowsBase/ZipSharp/ZipFileInfo.cs
mcs/class/WindowsBase/ZipSharp/ZipStream.cs
mcs/class/aot-compiler/Makefile
mcs/class/corlib/Assembly/AssemblyInfo.cs
mcs/class/corlib/CommonCrypto/SecRandom.cs
mcs/class/corlib/Makefile
mcs/class/corlib/Mono/Runtime.cs
mcs/class/corlib/ReferenceSources/SharedStatics.cs [deleted file]
mcs/class/corlib/ReferenceSources/Type.cs
mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs [deleted file]
mcs/class/corlib/System.Diagnostics.Tracing/EventCounter.cs [new file with mode: 0644]
mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs
mcs/class/corlib/System.Globalization/CultureInfo.cs
mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ConstructorOnTypeBuilderInst.cs
mcs/class/corlib/System.Reflection.Emit/DerivedTypes.cs
mcs/class/corlib/System.Reflection.Emit/EventOnTypeBuilderInst.cs
mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs
mcs/class/corlib/System.Reflection.Emit/FieldOnTypeBuilderInst.cs
mcs/class/corlib/System.Reflection.Emit/GenericTypeParameterBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
mcs/class/corlib/System.Reflection.Emit/MethodOnTypeBuilderInst.cs
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
mcs/class/corlib/System.Reflection.Emit/PropertyOnTypeBuilderInst.cs
mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
mcs/class/corlib/System.Reflection.Emit/TypeBuilderInstantiation.cs [new file with mode: 0644]
mcs/class/corlib/System.Reflection/MonoGenericClass.cs [deleted file]
mcs/class/corlib/System.Reflection/MonoGenericMethod.cs [deleted file]
mcs/class/corlib/System.Runtime.CompilerServices/ConditionalWeakTable.cs
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/UnsafeNativeMethods.cs [new file with mode: 0644]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
mcs/class/corlib/System.Runtime.Remoting/RemotingConfiguration.cs
mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
mcs/class/corlib/System.Security.Cryptography/CryptoConfig.cs
mcs/class/corlib/System.Security.Cryptography/CryptoConfig.fullaot.cs
mcs/class/corlib/System.Security.Cryptography/IncrementalHash.cs [new file with mode: 0644]
mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs
mcs/class/corlib/System.Threading/Thread.cs
mcs/class/corlib/System/AppDomain.cs
mcs/class/corlib/System/Environment.cs
mcs/class/corlib/Test/Mono/DataConvertTest.cs
mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentDictionaryTests.cs
mcs/class/corlib/Test/System.Collections.Concurrent/PartitionerTests.cs
mcs/class/corlib/Test/System.IO.IsolatedStorage/IsolatedStorageFileStreamTest.cs
mcs/class/corlib/Test/System.Reflection.Emit/ModuleBuilderTest.cs
mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs
mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs
mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest.cs
mcs/class/corlib/Test/System.Runtime.InteropServices/MarshalTest.cs
mcs/class/corlib/Test/System.Security.AccessControl/RawSecurityDescriptorTest.cs
mcs/class/corlib/Test/System.Security.Cryptography/SignatureDescriptionTest.cs
mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs
mcs/class/corlib/Test/System.Text/Latin1EncodingTest.cs
mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskCompletionSourceTests.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskSchedulerTest.cs
mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs
mcs/class/corlib/Test/System.Threading/ThreadLocalTests.cs
mcs/class/corlib/Test/System/SingleTest.cs
mcs/class/corlib/Test/System/TypeTest.cs
mcs/class/corlib/corefx/SR.cs [new file with mode: 0644]
mcs/class/corlib/corlib-net_4_x.csproj
mcs/class/corlib/corlib.dll.sources
mcs/class/corlib/corlib_test.dll.sources
mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs
mcs/class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj [new file with mode: 0644]
mcs/class/monodoc/Test/Monodoc.Generators/RawGeneratorTests.cs
mcs/class/monodoc/Test/Monodoc/HelpSourceTests.cs
mcs/class/monodoc/Test/Monodoc/SettingsTest.cs
mcs/class/monodoc/monodoc-net_4_x.csproj
mcs/class/monodoc/monodoc_test.dll.sources
mcs/class/referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
mcs/class/referencesource/System/compmod/system/codedom/CodeNamespace.cs
mcs/class/referencesource/System/compmod/system/codedom/CodePropertyReferenceExpression.cs
mcs/class/referencesource/System/compmod/system/componentmodel/LicFileLicenseProvider.cs
mcs/class/referencesource/System/compmod/system/componentmodel/ReflectEventDescriptor.cs
mcs/class/referencesource/System/compmod/system/componentmodel/ReflectPropertyDescriptor.cs
mcs/class/referencesource/System/compmod/system/componentmodel/TypeConverter.cs
mcs/class/referencesource/System/compmod/system/componentmodel/TypeDescriptor.cs
mcs/class/referencesource/System/compmod/system/diagnostics/TraceInternal.cs
mcs/class/referencesource/System/net/System/Net/IPAddress.cs
mcs/class/referencesource/System/net/System/Net/Internal.cs
mcs/class/referencesource/System/net/System/Net/NetworkCredential.cs
mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs
mcs/class/referencesource/System/net/System/Net/Sockets/TCPListener.cs
mcs/class/referencesource/System/net/System/Net/WebRequest.cs
mcs/class/referencesource/System/net/System/Net/connectionpool.cs
mcs/class/referencesource/System/net/System/Net/cookiecontainer.cs
mcs/class/referencesource/System/net/System/Net/filewebrequest.cs
mcs/class/referencesource/System/net/System/Net/mail/MimeBasePart.cs
mcs/class/referencesource/System/net/System/Net/webclient.cs
mcs/class/referencesource/System/net/System/Net/webproxy.cs
mcs/class/referencesource/System/net/System/UriExt.cs
mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs
mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs
mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexParser.cs
mcs/class/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs
mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs
mcs/class/referencesource/System/sys/system/threading/semaphore.cs
mcs/class/referencesource/mscorlib/system/globalization/compareinfo.cs
mcs/class/referencesource/mscorlib/system/runtime/interopservices/attributes.cs
mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs
mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs
mcs/class/referencesource/mscorlib/system/security/cryptography/rc2cryptoserviceprovider.cs
mcs/class/referencesource/mscorlib/system/security/cryptography/rfc2898derivebytes.cs
mcs/class/referencesource/mscorlib/system/security/cryptography/rsacryptoserviceprovider.cs
mcs/class/referencesource/mscorlib/system/sharedstatics.cs
mcs/class/referencesource/mscorlib/system/string.cs
mcs/class/test-helpers/NunitHelpers.cs [new file with mode: 0644]
mcs/class/test-helpers/SocketResponder.cs
mcs/errors/cs0031-9.cs [new file with mode: 0644]
mcs/errors/cs1691-2.cs [deleted file]
mcs/errors/cs1691-3.cs [deleted file]
mcs/errors/cs1691-4.cs [deleted file]
mcs/errors/cs1691.cs [deleted file]
mcs/errors/cs1744-3.cs [new file with mode: 0644]
mcs/errors/cs1904.cs [deleted file]
mcs/errors/cs8101.cs [new file with mode: 0644]
mcs/ilasm/ilasm-net_4_x.csproj
mcs/mcs/constant.cs
mcs/mcs/context.cs
mcs/mcs/cs-tokenizer.cs
mcs/mcs/ecore.cs
mcs/mcs/ikvm.cs
mcs/mcs/iterators.cs
mcs/mcs/location.cs
mcs/mcs/mcs-net_4_x.csproj
mcs/mcs/namespace.cs
mcs/mcs/report.cs
mcs/mcs/settings.cs
mcs/mcs/statement.cs
mcs/nunit24/ClientUtilities/util/nunit.util-net_4_x.csproj
mcs/nunit24/ConsoleRunner/nunit-console-exe/Class1.cs
mcs/nunit24/ConsoleRunner/nunit-console-exe/nunit-console-net_4_x.csproj
mcs/nunit24/ConsoleRunner/nunit-console/nunit-console-runner-net_4_x.csproj
mcs/nunit24/NUnitCore/core/nunit.core-net_4_x.csproj
mcs/nunit24/NUnitCore/interfaces/nunit.core.interfaces-net_4_x.csproj
mcs/nunit24/NUnitExtensions/core/nunit.core.extensions-net_4_x.csproj
mcs/nunit24/NUnitExtensions/framework/nunit.framework.extensions-net_4_x.csproj
mcs/nunit24/NUnitFramework/framework/NUnit.Framework-net_4_x.csproj
mcs/nunit24/NUnitFramework/framework/TestFixtureAttribute.cs
mcs/nunit24/NUnitMocks/mocks/nunit.mocks-net_4_x.csproj
mcs/tests/gtest-optional-40.cs [new file with mode: 0644]
mcs/tests/test-debug-11-ref.xml
mcs/tests/test-debug-21-ref.xml
mcs/tests/test-debug-28-ref.xml
mcs/tests/test-debug-31-ref.xml [new file with mode: 0644]
mcs/tests/test-debug-31.cs [new file with mode: 0644]
mcs/tests/test-debug-32-ref.xml [new file with mode: 0644]
mcs/tests/test-debug-32.cs [new file with mode: 0644]
mcs/tests/test-interpolation-05.cs
mcs/tests/test-named-10.cs [new file with mode: 0644]
mcs/tests/ver-il-net_4_x.xml
mcs/tools/Makefile
mcs/tools/al/al-net_4_x.csproj
mcs/tools/browsercaps-updater/browsercaps-updater-net_4_x.csproj
mcs/tools/btls/AssemblyInfo.cs [new file with mode: 0644]
mcs/tools/btls/Makefile [new file with mode: 0644]
mcs/tools/btls/btls-cert-sync-net_4_x.csproj [new file with mode: 0644]
mcs/tools/btls/btls-cert-sync.cs [new file with mode: 0644]
mcs/tools/btls/btls-cert-sync.exe.sources [new file with mode: 0644]
mcs/tools/cccheck/cccheck-net_4_x.csproj
mcs/tools/ccrewrite/ccrewrite-net_4_x.csproj
mcs/tools/cil-stringreplacer/cil-stringreplacer-net_4_x.csproj
mcs/tools/cil-strip/mono-cil-strip-net_4_x.csproj
mcs/tools/commoncryptogenerator/CommonCryptorGenerator.cs
mcs/tools/commoncryptogenerator/commoncryptogenerator-net_4_x.csproj
mcs/tools/commoncryptogenerator/generator.cs
mcs/tools/compiler-tester/compiler-tester-net_4_x.csproj
mcs/tools/corcompare/mono-api-info-net_4_x.csproj
mcs/tools/corcompare/mono-api-info.csproj
mcs/tools/csharp/csharp-net_4_x.csproj
mcs/tools/csharp/repl.cs
mcs/tools/culevel/culevel-net_4_x.csproj
mcs/tools/disco/disco-net_4_x.csproj
mcs/tools/dtd2rng/dtd2rng-net_4_x.csproj
mcs/tools/dtd2xsd/dtd2xsd-net_4_x.csproj
mcs/tools/gacutil/gacutil-net_4_x.csproj
mcs/tools/genxs/genxs-net_4_x.csproj
mcs/tools/ictool/ictool-net_4_x.csproj
mcs/tools/ikdasm/ikdasm-net_4_x.csproj
mcs/tools/installutil/installutil-net_4_x.csproj
mcs/tools/installvst/installvst-net_4_x.csproj
mcs/tools/lc/lc-net_4_x.csproj
mcs/tools/linker-analyzer/linkeranalyzer-net_4_x.csproj
mcs/tools/linker/AUTHORS [deleted file]
mcs/tools/linker/Descriptors/mscorlib.xml
mcs/tools/linker/MIT.X11 [deleted file]
mcs/tools/linker/Mono.Linker.Steps/BaseStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/BlacklistStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/CleanStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/IStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/LoadReferencesStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/OutputStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/RegenerateGuidStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/ResolveStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs [deleted file]
mcs/tools/linker/Mono.Linker.csproj [deleted file]
mcs/tools/linker/Mono.Linker/Annotations.cs [deleted file]
mcs/tools/linker/Mono.Linker/AssemblyAction.cs [deleted file]
mcs/tools/linker/Mono.Linker/AssemblyInfo.cs [deleted file]
mcs/tools/linker/Mono.Linker/AssemblyResolver.cs [deleted file]
mcs/tools/linker/Mono.Linker/Driver.cs [deleted file]
mcs/tools/linker/Mono.Linker/I18nAssemblies.cs [deleted file]
mcs/tools/linker/Mono.Linker/IXApiVisitor.cs [deleted file]
mcs/tools/linker/Mono.Linker/LinkContext.cs [deleted file]
mcs/tools/linker/Mono.Linker/MethodAction.cs [deleted file]
mcs/tools/linker/Mono.Linker/Pipeline.cs [deleted file]
mcs/tools/linker/Mono.Linker/TypePreserve.cs [deleted file]
mcs/tools/linker/Mono.Linker/XApiReader.cs [deleted file]
mcs/tools/linker/README [deleted file]
mcs/tools/linker/Tests/Libs/nunit-console-runner.dll [deleted file]
mcs/tools/linker/Tests/Libs/nunit-console.exe [deleted file]
mcs/tools/linker/Tests/Libs/nunit-console.exe.config [deleted file]
mcs/tools/linker/Tests/Libs/nunit.core.dll [deleted file]
mcs/tools/linker/Tests/Libs/nunit.framework.dll [deleted file]
mcs/tools/linker/Tests/Libs/nunit.util.dll [deleted file]
mcs/tools/linker/Tests/Makefile [deleted file]
mcs/tools/linker/Tests/Mono.Linker.Tests.csproj [deleted file]
mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractLinkingTestFixture.cs [deleted file]
mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractTestFixture.cs [deleted file]
mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyInfo.cs [deleted file]
mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyLinkingTestFixture.cs [deleted file]
mcs/tools/linker/Tests/Mono.Linker.Tests/IntegrationTestFixture.cs [deleted file]
mcs/tools/linker/Tests/Mono.Linker.Tests/XmlLinkingTestFixture.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.exe [deleted file]
mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.exe [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Generics/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Generics/desc.xml [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Interface/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Interface/desc.xml [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.exe [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/NestedNested/desc.xml [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/desc.xml [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/desc.xml [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/desc.xml [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Simple/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.exe [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/desc.xml [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.exe [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.cs [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.dll [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Makefile [deleted file]
mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/desc.xml [deleted file]
mcs/tools/linker/Tests/TestCases/config.make [deleted file]
mcs/tools/linker/configure [deleted file]
mcs/tools/linker/monolinker-net_4_x.csproj
mcs/tools/linker/monolinker.exe.sources
mcs/tools/linker/monolinker.in [deleted file]
mcs/tools/linker/profiler/Makefile [deleted file]
mcs/tools/linker/profiler/link.c [deleted file]
mcs/tools/linker/standalone.make [deleted file]
mcs/tools/macpack/macpack-net_4_x.csproj
mcs/tools/mconfig/mconfig-net_4_x.csproj
mcs/tools/mdbrebase/mdbrebase-net_4_x.csproj
mcs/tools/mdoc/Makefile
mcs/tools/mdoc/mdoc-net_4_x.csproj
mcs/tools/mkbundle/Makefile
mcs/tools/mkbundle/mkbundle-net_4_x.csproj
mcs/tools/mkbundle/mkbundle.cs
mcs/tools/mod/mod-net_4_x.csproj
mcs/tools/mono-api-html/Makefile
mcs/tools/mono-api-html/mono-api-html-net_4_x.csproj
mcs/tools/mono-configuration-crypto/cli/mono-configuration-crypto-net_4_x.csproj
mcs/tools/mono-configuration-crypto/lib/Mono.Configuration.Crypto-net_4_x.csproj
mcs/tools/mono-service/mono-service-net_4_x.csproj
mcs/tools/mono-shlib-cop/mono-shlib-cop-net_4_x.csproj
mcs/tools/mono-symbolicate/Makefile
mcs/tools/mono-symbolicate/mono-symbolicate-net_4_x.csproj
mcs/tools/mono-xmltool/mono-xmltool-net_4_x.csproj
mcs/tools/mono-xsd/xsd-net_4_x.csproj
mcs/tools/monop/monop-net_4_x.csproj
mcs/tools/nunit-lite/NUnitLite/BabysitterSupport.cs [new file with mode: 0644]
mcs/tools/nunit-lite/NUnitLite/nunitlite.dll.sources
mcs/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config [deleted file]
mcs/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl [new file with mode: 0644]
mcs/tools/nunitreport/nunitreport-net_4_x.csproj
mcs/tools/pdb2mdb/pdb2mdb-net_4_x.csproj
mcs/tools/resgen/resgen-net_4_x.csproj
mcs/tools/security/cert-sync.cs
mcs/tools/sgen/sgen-net_4_x.csproj
mcs/tools/soapsuds/soapsuds-net_4_x.csproj
mcs/tools/sqlmetal/sqlmetal-net_4_x.csproj
mcs/tools/sqlsharp/Makefile
mcs/tools/sqlsharp/sqlsharp-net_4_x.csproj
mcs/tools/svcutil/svcutil-net_4_x.csproj
mcs/tools/tuner/Makefile [deleted file]
mcs/tools/tuner/Mono.Tuner-net_4_x.csproj [deleted file]
mcs/tools/tuner/Mono.Tuner.csproj [deleted file]
mcs/tools/tuner/Mono.Tuner.dll.sources [deleted file]
mcs/tools/tuner/Mono.Tuner/AdjustVisibility.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/CecilRocks.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/CheckVisibility.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/CustomizeActions.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/Dispatcher.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/Extensions.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/FilterAttributes.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/FixModuleFlags.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/InjectSecurityAttributes.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/MarkNSObjectsBase.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/MoonlightA11yApiMarker.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/MoonlightA11yAssemblyStep.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/MoonlightA11yDescriptorGenerator.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/MoonlightA11yProcessor.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/MoonlightA11yUsageInspectionStep.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/MoonlightAssemblyStep.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/PreserveCrypto.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/PreserveHttps.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/PreserveSoapHttpClients.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/PrintStatus.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/PrintTypeMap.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/Profile.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/RemoveAttributesBase.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/RemoveResources.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/RemoveSecurity.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/RemoveSerialization.cs [deleted file]
mcs/tools/tuner/Mono.Tuner/TunerAnnotations.cs [deleted file]
mcs/tools/tuner/MonoMac.Tuner/ApplyPreserveAttribute.cs [deleted file]
mcs/tools/tuner/MonoMac.Tuner/Extensions.cs [deleted file]
mcs/tools/tuner/MonoMac.Tuner/MarkNSObjects.cs [deleted file]
mcs/tools/tuner/MonoMac.Tuner/MethodMapInjection.cs [deleted file]
mcs/tools/tuner/MonoMac.Tuner/MonoMac.xml [deleted file]
mcs/tools/tuner/MonoMac.Tuner/MonoMacProfile.cs [deleted file]
mcs/tools/tuner/MonoMac.Tuner/RemoveSelectors.cs [deleted file]
mcs/tools/wsdl/wsdl-net_4_x.csproj
mcs/tools/xbuild/Makefile
mcs/tools/xbuild/data/xbuild.exe.config_test.in [new file with mode: 0644]
mcs/tools/xbuild/xbuild_test.make
mono/Makefile.am
mono/btls/.gitignore [new file with mode: 0644]
mono/btls/CMakeLists.txt [new file with mode: 0644]
mono/btls/Makefile.am [new file with mode: 0644]
mono/btls/btls-bio.c [new file with mode: 0644]
mono/btls/btls-bio.h [new file with mode: 0644]
mono/btls/btls-error.c [new file with mode: 0644]
mono/btls/btls-error.h [new file with mode: 0644]
mono/btls/btls-key.c [new file with mode: 0644]
mono/btls/btls-key.h [new file with mode: 0644]
mono/btls/btls-pkcs12.c [new file with mode: 0644]
mono/btls/btls-pkcs12.h [new file with mode: 0644]
mono/btls/btls-ssl-ctx.c [new file with mode: 0644]
mono/btls/btls-ssl-ctx.h [new file with mode: 0644]
mono/btls/btls-ssl.c [new file with mode: 0644]
mono/btls/btls-ssl.h [new file with mode: 0644]
mono/btls/btls-time64.c [new file with mode: 0644]
mono/btls/btls-util.c [new file with mode: 0644]
mono/btls/btls-util.h [new file with mode: 0644]
mono/btls/btls-x509-chain.c [new file with mode: 0644]
mono/btls/btls-x509-chain.h [new file with mode: 0644]
mono/btls/btls-x509-crl.c [new file with mode: 0644]
mono/btls/btls-x509-crl.h [new file with mode: 0644]
mono/btls/btls-x509-lookup-mono.c [new file with mode: 0644]
mono/btls/btls-x509-lookup-mono.h [new file with mode: 0644]
mono/btls/btls-x509-lookup.c [new file with mode: 0644]
mono/btls/btls-x509-lookup.h [new file with mode: 0644]
mono/btls/btls-x509-name.c [new file with mode: 0644]
mono/btls/btls-x509-name.h [new file with mode: 0644]
mono/btls/btls-x509-revoked.c [new file with mode: 0644]
mono/btls/btls-x509-revoked.h [new file with mode: 0644]
mono/btls/btls-x509-store-ctx.c [new file with mode: 0644]
mono/btls/btls-x509-store-ctx.h [new file with mode: 0644]
mono/btls/btls-x509-store.c [new file with mode: 0644]
mono/btls/btls-x509-store.h [new file with mode: 0644]
mono/btls/btls-x509-verify-param.c [new file with mode: 0644]
mono/btls/btls-x509-verify-param.h [new file with mode: 0644]
mono/btls/btls-x509.c [new file with mode: 0644]
mono/btls/btls-x509.h [new file with mode: 0644]
mono/btls/create-object-library.sh [new file with mode: 0755]
mono/dis/get.c
mono/io-layer/Makefile.am
mono/io-layer/access.h [deleted file]
mono/io-layer/context.c [deleted file]
mono/io-layer/context.h [deleted file]
mono/io-layer/error.c
mono/io-layer/io-layer.h
mono/io-layer/io.c
mono/io-layer/locking.c
mono/io-layer/posix.c
mono/io-layer/process-private.h [deleted file]
mono/io-layer/processes.c [deleted file]
mono/io-layer/processes.h [deleted file]
mono/io-layer/sockets.c
mono/io-layer/timefuncs-private.h [deleted file]
mono/io-layer/timefuncs.c
mono/io-layer/timefuncs.h
mono/io-layer/uglify.h
mono/io-layer/wait.c
mono/io-layer/wait.h
mono/io-layer/wapi-private.h
mono/io-layer/wapi-remap.h
mono/io-layer/wapi.c
mono/io-layer/wapi.h
mono/metadata/Makefile.am
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/assembly.h
mono/metadata/attach.c
mono/metadata/boehm-gc.c
mono/metadata/class-accessors.c [new file with mode: 0644]
mono/metadata/class-inlines.h [new file with mode: 0644]
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/cominterop.c
mono/metadata/console-win32-internals.h [new file with mode: 0644]
mono/metadata/console-win32-uwp.c [new file with mode: 0644]
mono/metadata/console-win32.c
mono/metadata/coree-internals.h [new file with mode: 0644]
mono/metadata/coree-windows-uwp.c [new file with mode: 0644]
mono/metadata/coree.c
mono/metadata/custom-attrs-internals.h
mono/metadata/custom-attrs.c
mono/metadata/debug-mono-symfile.c
mono/metadata/domain-internals.h
mono/metadata/domain.c
mono/metadata/dynamic-image.c
mono/metadata/exception.c
mono/metadata/file-io-internals.h [new file with mode: 0644]
mono/metadata/file-io-windows-internals.h [new file with mode: 0644]
mono/metadata/file-io-windows-uwp.c [new file with mode: 0644]
mono/metadata/file-io-windows.c [new file with mode: 0644]
mono/metadata/file-io.c
mono/metadata/file-mmap-posix.c
mono/metadata/file-mmap-windows.c
mono/metadata/gc-internals.h
mono/metadata/gc.c
mono/metadata/handle.c
mono/metadata/icall-def.h
mono/metadata/icall-internals.h [new file with mode: 0644]
mono/metadata/icall-windows-internals.h [new file with mode: 0644]
mono/metadata/icall-windows-uwp.c [new file with mode: 0644]
mono/metadata/icall-windows.c [new file with mode: 0644]
mono/metadata/icall.c
mono/metadata/image.c
mono/metadata/loader.c
mono/metadata/loader.h
mono/metadata/lock-tracer.c
mono/metadata/marshal-internals.h [new file with mode: 0644]
mono/metadata/marshal-windows-internals.h [new file with mode: 0644]
mono/metadata/marshal-windows-uwp.c [new file with mode: 0644]
mono/metadata/marshal-windows.c [new file with mode: 0644]
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/mempool-internals.h
mono/metadata/mempool.c
mono/metadata/metadata-internals.h
mono/metadata/metadata-verify.c
mono/metadata/metadata.c
mono/metadata/metadata.h
mono/metadata/mono-config-dirs.c
mono/metadata/mono-config-dirs.h
mono/metadata/mono-config.c
mono/metadata/mono-endian.c
mono/metadata/mono-security-windows-internals.h [new file with mode: 0644]
mono/metadata/mono-security-windows-uwp.c [new file with mode: 0644]
mono/metadata/mono-security-windows.c [new file with mode: 0644]
mono/metadata/mono-security.c
mono/metadata/null-gc.c
mono/metadata/object-internals.h
mono/metadata/object-offsets.h
mono/metadata/object.c
mono/metadata/process.c [deleted file]
mono/metadata/process.h [deleted file]
mono/metadata/profiler.c
mono/metadata/property-bag.c [new file with mode: 0644]
mono/metadata/property-bag.h [new file with mode: 0644]
mono/metadata/reflection-internals.h
mono/metadata/reflection.c
mono/metadata/reflection.h
mono/metadata/remoting.c
mono/metadata/security-core-clr.c
mono/metadata/seq-points-data.c
mono/metadata/sgen-client-mono.h
mono/metadata/sgen-mono.c
mono/metadata/sgen-new-bridge.c
mono/metadata/sgen-os-coop.c [deleted file]
mono/metadata/sgen-os-mach.c [deleted file]
mono/metadata/sgen-os-posix.c [deleted file]
mono/metadata/sgen-os-win32.c [deleted file]
mono/metadata/sgen-stw.c
mono/metadata/sgen-tarjan-bridge.c
mono/metadata/socket-io-windows-internals.h [new file with mode: 0644]
mono/metadata/socket-io-windows.c [new file with mode: 0644]
mono/metadata/socket-io.c
mono/metadata/socket-io.h
mono/metadata/sre-encode.c
mono/metadata/sre-internals.h
mono/metadata/sre-save.c
mono/metadata/sre.c
mono/metadata/threadpool-ms.c
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/metadata/verify.c
mono/metadata/verify.h
mono/metadata/w32event-unix.c
mono/metadata/w32handle-namespace.c
mono/metadata/w32handle-namespace.h
mono/metadata/w32handle.c [new file with mode: 0644]
mono/metadata/w32handle.h [new file with mode: 0644]
mono/metadata/w32mutex-unix.c
mono/metadata/w32process-internals.h [new file with mode: 0644]
mono/metadata/w32process-unix-bsd.c [new file with mode: 0644]
mono/metadata/w32process-unix-default.c [new file with mode: 0644]
mono/metadata/w32process-unix-haiku.c [new file with mode: 0644]
mono/metadata/w32process-unix-internals.h [new file with mode: 0644]
mono/metadata/w32process-unix-osx.c [new file with mode: 0644]
mono/metadata/w32process-unix.c [new file with mode: 0644]
mono/metadata/w32process-win32-internals.h [new file with mode: 0644]
mono/metadata/w32process-win32-uwp.c [new file with mode: 0644]
mono/metadata/w32process-win32.c [new file with mode: 0644]
mono/metadata/w32process.c [new file with mode: 0644]
mono/metadata/w32process.h [new file with mode: 0644]
mono/metadata/w32semaphore-unix.c
mono/metadata/w32semaphore-win32.c
mono/mini/Makefile.am.in
mono/mini/abcremoval.c
mono/mini/alias-analysis.c
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/branch-opts.c
mono/mini/cpu-ppc64.md
mono/mini/debugger-agent.c
mono/mini/decompose.c
mono/mini/driver.c
mono/mini/dwarfwriter.c
mono/mini/exceptions-amd64.c
mono/mini/exceptions-arm64.c
mono/mini/exceptions-ppc.c
mono/mini/exceptions-x86.c
mono/mini/generics.cs
mono/mini/graph.c
mono/mini/gshared.cs
mono/mini/image-writer.c
mono/mini/jit-icalls.c
mono/mini/linear-scan.c
mono/mini/liveness.c
mono/mini/local-propagation.c
mono/mini/main.c
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h
mono/mini/mini-arm.c
mono/mini/mini-arm.h
mono/mini/mini-arm64.c
mono/mini/mini-arm64.h
mono/mini/mini-codegen.c
mono/mini/mini-darwin.c
mono/mini/mini-exceptions.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-llvm-cpp.cpp
mono/mini/mini-llvm.c
mono/mini/mini-mips.c
mono/mini/mini-mips.h
mono/mini/mini-posix.c
mono/mini/mini-ppc.h
mono/mini/mini-runtime.c
mono/mini/mini-s390x.c
mono/mini/mini-trampolines.c
mono/mini/mini-windows-uwp.c [new file with mode: 0644]
mono/mini/mini-windows.c
mono/mini/mini-windows.h [new file with mode: 0644]
mono/mini/mini.c
mono/mini/mini.h
mono/mini/patch-info.h
mono/mini/ssa.c
mono/mini/trace.c
mono/mini/tramp-amd64.c
mono/profiler/Makefile.am
mono/profiler/decode.c [deleted file]
mono/profiler/mono-profiler-log.c [new file with mode: 0644]
mono/profiler/mono-profiler-log.h [new file with mode: 0644]
mono/profiler/mprof-report.c [new file with mode: 0644]
mono/profiler/proflog.c [deleted file]
mono/profiler/proflog.h [deleted file]
mono/profiler/utils.c [deleted file]
mono/profiler/utils.h [deleted file]
mono/sgen/gc-internal-agnostic.h
mono/sgen/sgen-alloc.c
mono/sgen/sgen-debug.c
mono/sgen/sgen-gc.c
mono/sgen/sgen-gc.h
mono/sgen/sgen-internal.c
mono/sgen/sgen-layout-stats.c
mono/sgen/sgen-memory-governor.c
mono/tests/Makefile.am
mono/tests/TestingReferenceAssembly.cs [new file with mode: 0644]
mono/tests/TestingReferenceReferenceAssembly.cs [new file with mode: 0644]
mono/tests/appdomain-threadpool-unload.cs [new file with mode: 0644]
mono/tests/bug-45841-fpstack-exceptions.il [new file with mode: 0644]
mono/tests/custom-attr-errors.cs
mono/tests/generic-stack-traces.2.cs
mono/tests/libtest.c
mono/tests/pinvoke-utf8.cs [new file with mode: 0644]
mono/tests/pinvoke2.cs
mono/tests/pinvoke3.cs
mono/tests/reference-loader.cs [new file with mode: 0644]
mono/tests/sgen-new-threads-collect.cs [new file with mode: 0644]
mono/tests/thread-native-exit.cs
mono/tests/thread-suspend-selfsuspended.cs [new file with mode: 0644]
mono/tests/thread-suspend-suspended.cs [new file with mode: 0644]
mono/unit-tests/test-conc-hashtable.c
mono/utils/Makefile.am
mono/utils/atomic.c
mono/utils/checked-build.h
mono/utils/lock-free-alloc.h
mono/utils/mach-support-amd64.c
mono/utils/mach-support-arm.c
mono/utils/mach-support-arm64.c
mono/utils/mach-support-unknown.c
mono/utils/mach-support-x86.c
mono/utils/mach-support.h
mono/utils/mono-codeman.c
mono/utils/mono-compiler.h
mono/utils/mono-context.c
mono/utils/mono-context.h
mono/utils/mono-dl-windows-internals.h [new file with mode: 0644]
mono/utils/mono-dl-windows-uwp.c [new file with mode: 0644]
mono/utils/mono-dl-windows.c
mono/utils/mono-error-internals.h
mono/utils/mono-error.c
mono/utils/mono-error.h
mono/utils/mono-io-portability.c
mono/utils/mono-log-common.c
mono/utils/mono-log-windows.c
mono/utils/mono-logger-internals.h
mono/utils/mono-logger.c
mono/utils/mono-mmap-internals.h
mono/utils/mono-mmap-windows-internals.h [new file with mode: 0644]
mono/utils/mono-mmap-windows-uwp.c [new file with mode: 0644]
mono/utils/mono-mmap-windows.c [new file with mode: 0644]
mono/utils/mono-mmap.c
mono/utils/mono-mmap.h
mono/utils/mono-os-semaphore.h
mono/utils/mono-proclib-windows-internals.h [new file with mode: 0644]
mono/utils/mono-proclib-windows-uwp.c [new file with mode: 0644]
mono/utils/mono-proclib-windows.c [new file with mode: 0644]
mono/utils/mono-proclib.c
mono/utils/mono-publib.h
mono/utils/mono-rand-windows-internals.h [new file with mode: 0644]
mono/utils/mono-rand-windows-uwp.c [new file with mode: 0644]
mono/utils/mono-rand-windows.c [new file with mode: 0644]
mono/utils/mono-rand.c
mono/utils/mono-sigcontext.h
mono/utils/mono-threads-coop.c
mono/utils/mono-threads-debug.h [new file with mode: 0644]
mono/utils/mono-threads-mach-abort-syscall.c [deleted file]
mono/utils/mono-threads-mach.c
mono/utils/mono-threads-posix-abort-syscall.c [deleted file]
mono/utils/mono-threads-posix-signals.c
mono/utils/mono-threads-posix-signals.h [deleted file]
mono/utils/mono-threads-posix.c
mono/utils/mono-threads-state-machine.c
mono/utils/mono-threads-windows-abort-syscall.c [deleted file]
mono/utils/mono-threads-windows.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h
mono/utils/networking-missing.c
mono/utils/os-event-unix.c [new file with mode: 0644]
mono/utils/os-event-win32.c [new file with mode: 0644]
mono/utils/os-event.h [new file with mode: 0644]
mono/utils/w32handle.c [deleted file]
mono/utils/w32handle.h [deleted file]
mono/utils/win64.asm
msvc/eglib.vcxproj
msvc/eglib.vcxproj.filters
msvc/libmono-static.vcxproj
msvc/libmono-static.vcxproj.filters
msvc/libmonoruntime.vcxproj
msvc/libmonoruntime.vcxproj.filters
msvc/libmonoutils.vcxproj
msvc/libmonoutils.vcxproj.filters
msvc/monoposixhelper.def
msvc/monoposixhelper.vcxproj
msvc/monoposixhelper.vcxproj.filters
msvc/pedump.vcxproj
msvc/pedump.vcxproj.filters
msvc/scripts/csproj.tmpl
msvc/scripts/order.xml
net_4_x.sln
packaging/MacSDK/__init__.py [new file with mode: 0644]
packaging/MacSDK/fsharp.py [new file with mode: 0644]
packaging/MacSDK/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch [new file with mode: 0644]
packaging/MacSDK/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch [new file with mode: 0644]
packaging/MacSDK/gtkrc [new file with mode: 0644]
packaging/MacSDK/ironlangs.py [new file with mode: 0644]
packaging/MacSDK/libgdiplus.py [new file with mode: 0644]
packaging/MacSDK/mono-basic.py [new file with mode: 0644]
packaging/MacSDK/mono-llvm.py [new file with mode: 0644]
packaging/MacSDK/mono.py [new file with mode: 0644]
packaging/MacSDK/msbuild.py [new file with mode: 0644]
packaging/MacSDK/nuget.py [new file with mode: 0644]
packaging/MacSDK/packaging/Info.plist [new file with mode: 0644]
packaging/MacSDK/packaging/Info_sdk.plist [new file with mode: 0644]
packaging/MacSDK/packaging/mdk_blacklist.sh [new file with mode: 0755]
packaging/MacSDK/packaging/resources/License.rtf [new file with mode: 0644]
packaging/MacSDK/packaging/resources/ReadMe.rtf [new file with mode: 0644]
packaging/MacSDK/packaging/resources/Welcome.rtf [new file with mode: 0644]
packaging/MacSDK/packaging/resources/distribution.xml [new file with mode: 0644]
packaging/MacSDK/packaging/resources/postinstall [new file with mode: 0755]
packaging/MacSDK/packaging/resources/version.plist [new file with mode: 0644]
packaging/MacSDK/packaging/resources/whitelist.txt [new file with mode: 0644]
packaging/MacSDK/packaging/uninstallMono.sh [new file with mode: 0755]
packaging/MacSDK/patches/find-unused-patches.sh [new file with mode: 0755]
packaging/MacSDK/patches/mcs-pkgconfig.patch [new file with mode: 0644]
packaging/MacSDK/pcl-reference-assemblies.py [new file with mode: 0644]
packaging/MacSDK/profile.py [new file with mode: 0755]
packaging/MacSDK/sqlite.py [new file with mode: 0644]
packaging/MacSDK/xamarin-gtk-theme.py [new file with mode: 0644]
packaging/MacSDK/xsp.py [new file with mode: 0644]
packaging/MacSDKRelease/mono-extensions.py [new file with mode: 0644]
packaging/MacSDKRelease/packaging [new symlink]
packaging/MacSDKRelease/profile.py [new file with mode: 0755]
runtime/Makefile.am
scripts/.gitignore
scripts/Makefile.am
scripts/ci/run-jenkins.sh
scripts/ci/run-test-default.sh
scripts/ci/run-test-profiler-stress-tests.sh
scripts/mono-package-runtime [changed mode: 0644->0755]
support/zlib-helper.c
tools/monograph/monograph.c
tools/offsets-tool/Makefile
tools/offsets-tool/MonoAotOffsetsDumper.cs
winconfig.h

index d084d3948e49230f088e7e875dd49c409901a7b9..20d831d7e4a2c43ca89426e015f01a2a5b2de344 100644 (file)
        path = external/cecil-legacy
        url = git://github.com/mono/cecil.git
        branch = mono-legacy-0.9.5
+[submodule "external/boringssl"]
+       path = external/boringssl
+       url = git://github.com/mono/boringssl.git
+       branch = mono
+[submodule "external/corefx"]
+       path = external/corefx
+       url = git://github.com/mono/corefx.git
+[submodule "external/bockbuild"]
+       path = external/bockbuild
+       url = git://github.com/mono/bockbuild.git
+[submodule "external/linker"]
+       path = external/linker
+       url = git://github.com/mono/linker.git
index aaffb9842ba9dbe36090cead00afe0d1ebe1232d..74707da14109c704302a1f7eab547e79082b812e 100644 (file)
@@ -49,6 +49,9 @@ dist-hook:
 # Disable this for now because it is very slow and causes wrench to timeout:
 #      test ! -d $(GIT_DIR) || ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
 
+mac-sdk-package:
+       external/bockbuild/bb MacSDK --package
+
 pkgconfigdir = $(libdir)/pkgconfig
 noinst_DATA = mono-uninstalled.pc
 DISTCLEANFILES= mono-uninstalled.pc
index 01faee39c981b1215ef68e84e38aa97446d09c14..9df7b8a5811328aafe3a0a58c0def29cf80ec5bb 100644 (file)
@@ -18,7 +18,7 @@
   {
     "name": "ms-test-suite", 
     "url": "git@github.com:xamarin/ms-test-suite.git", 
-    "rev": "eb7cd709549bffe170653a50805f1593d66ea81e", 
+    "rev": "55b6637eb1de61c743323ec82db1e0cadfee5b32", 
     "remote-branch": "origin/master", 
     "branch": "master", 
     "directory": "ms-test-suite"
@@ -31,4 +31,4 @@
     "branch": "master", 
     "directory": "benchmarker"
   }
-]
+]
\ No newline at end of file
index bd85bd494bd3b5e960de1e90ffc6c07330dbeb88..1516dc61db68079b727791a9af45918375955c7a 100644 (file)
@@ -1,10 +1,13 @@
-check-ms-test-suite:
+check-ms-test-suite: $(CLASS)/nunitlite.dll
        @if $(MAKE) validate-ms-test-suite RESET_VERSIONS=1; then \
-               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug -t:library -warn:1 -r:nunit.framework" && \
-               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-console.exe -nologo -exclude=MonoBug,BadTest" NUNIT_XML_RESULT=$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml || EXIT_CODE=1; \
+               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance build MCS="$(MCS) -debug -t:library -warn:1 -r:$(CLASS)/nunitlite.dll" && \
+               $(MAKE) -C $(MSTESTSUITE_PATH)/conformance run NUNIT-CONSOLE="$(RUNTIME) $(CLASS)/nunit-lite-console.exe -exclude=MonoBug,BadTest -format:nunit2" NUNIT_XML_RESULT="-result:$(abs_top_builddir)/acceptance-tests/TestResult-ms-test-suite-conformance.xml" || EXIT_CODE=1; \
                $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup build MCS="$(MCS) -debug -warn:1" && \
                $(MAKE) -C $(MSTESTSUITE_PATH)/systemruntimebringup run MONO="$(RUNTIME)" || EXIT_CODE=1; \
                exit $$EXIT_CODE; \
        else \
                echo "*** [ms-test-suite] Getting the repository failed, you probably don't have access to this Xamarin-internal resource. Skipping."; \
        fi
+
+$(CLASS)/nunitlite.dll:
+       $(MAKE) -C $(mcs_topdir)/tools/nunit-lite
index 9188b174a9541f5f966e56dd03835705cdb59f23..ff67772a1d47d4ca21296d27cbb66dfcd8162743 100644 (file)
@@ -4,7 +4,8 @@ SYS_REFS = \
        System.Data.dll \
        System.Runtime.Serialization.dll \
        System.Xml.dll \
-       System.Xml.Linq.dll
+       System.Xml.Linq.dll \
+       Mono.Posix.dll
 
 check-profiler-stress:
        @$(MAKE) validate-benchmarker RESET_VERSIONS=1
index b2638c1273a7e4deee08ec2047618bec48d669db..5ef4ab02a2eb198eeb669e3a1fed781af3376828 100644 (file)
@@ -1,7 +1,14 @@
 using System;
+using System.Collections.Generic;
 using System.Diagnostics;
+using System.Globalization;
 using System.IO;
 using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Xml;
+using Mono.Unix.Native;
 using Newtonsoft.Json;
 
 // Shut up CLS compliance warnings from Json.NET.
@@ -10,7 +17,8 @@ using Newtonsoft.Json;
 namespace Mono.Profiling.Tests.Stress {
 
        // https://github.com/xamarin/benchmarker/blob/master/tools/libdbmodel/Benchmark.cs
-       class Benchmark {
+       sealed class Benchmark {
+
                public string Name { get; set; }
                public string TestDirectory { get; set; }
                public bool OnlyExplicit { get; set; }
@@ -24,8 +32,24 @@ namespace Mono.Profiling.Tests.Stress {
                }
        }
 
+       sealed class TestResult {
+
+               public Benchmark Benchmark { get; set; }
+               public ProcessStartInfo StartInfo { get; set; }
+               public Stopwatch Stopwatch { get; set; } = new Stopwatch ();
+               public int? ExitCode { get; set; }
+               public StringBuilder StandardOutput { get; set; } = new StringBuilder ();
+               public StringBuilder StandardError { get; set; } = new StringBuilder ();
+       }
+
        static class Program {
 
+               static readonly TimeSpan _timeout = TimeSpan.FromHours (6);
+
+               static string FilterInvalidXmlChars (string text) {
+                       return Regex.Replace (text, @"[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]", string.Empty);
+               }
+
                static int Main ()
                {
                        var depDir = Path.Combine ("..", "external", "benchmarker");
@@ -44,8 +68,7 @@ namespace Mono.Profiling.Tests.Stress {
                        var rand = new Random ();
                        var cpus = Environment.ProcessorCount;
 
-                       var successes = 0;
-                       var failures = 0;
+                       var results = new List<TestResult> (benchmarks.Length);
 
                        var sw = Stopwatch.StartNew ();
 
@@ -66,6 +89,8 @@ namespace Mono.Profiling.Tests.Stress {
                                        WorkingDirectory = Path.Combine (testDir, bench.TestDirectory),
                                        FileName = monoPath,
                                        Arguments = $"--debug --profile=log:{profOptions} " + string.Join (" ", bench.CommandLine),
+                                       RedirectStandardOutput = true,
+                                       RedirectStandardError = true,
                                };
 
                                info.EnvironmentVariables.Clear ();
@@ -77,32 +102,177 @@ namespace Mono.Profiling.Tests.Stress {
                                Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] {progress} Running {bench.Name} with profiler options: {profOptions}");
                                Console.ResetColor ();
 
-                               var sw2 = Stopwatch.StartNew ();
+                               var result = new TestResult {
+                                       Benchmark = bench,
+                                       StartInfo = info,
+                               };
+
+                               using (var proc = new Process ()) {
+                                       proc.StartInfo = info;
+
+                                       proc.OutputDataReceived += (sender, args) => {
+                                               if (args.Data != null)
+                                                       result.StandardOutput.AppendLine (args.Data);
+                                       };
+
+                                       proc.ErrorDataReceived += (sender, args) => {
+                                               if (args.Data != null)
+                                                       result.StandardError.AppendLine (args.Data);
+                                       };
+
+                                       result.Stopwatch.Start ();
 
-                               using (var proc = Process.Start (info)) {
-                                       proc.WaitForExit ();
-                                       sw2.Stop ();
+                                       proc.Start ();
 
-                                       Console.WriteLine ();
+                                       proc.BeginOutputReadLine ();
+                                       proc.BeginErrorReadLine ();
 
-                                       if (proc.ExitCode != 0)
-                                               failures++;
-                                       else
-                                               successes++;
+                                       if (!proc.WaitForExit ((int) _timeout.TotalMilliseconds)) {
+                                               // Force a thread dump.
+                                               Syscall.kill (proc.Id, Signum.SIGQUIT);
+                                               Thread.Sleep (1000);
 
-                                       Console.ForegroundColor = proc.ExitCode != 0 ? ConsoleColor.Red : ConsoleColor.Green;
-                                       Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] {progress} {bench.Name} took {sw2.Elapsed.ToString ("G")} and exited with code: {proc.ExitCode}");
+                                               try {
+                                                       proc.Kill ();
+                                               } catch (Exception) {
+                                               }
+                                       } else
+                                               result.ExitCode = proc.ExitCode;
+
+                                       result.Stopwatch.Stop ();
+                               }
+
+                               var resultStr = result.ExitCode == null ? "timed out" : $"exited with code: {result.ExitCode}";
+
+                               Console.ForegroundColor = result.ExitCode != 0 ? ConsoleColor.Red : ConsoleColor.Green;
+                               Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] {progress} {bench.Name} took {result.Stopwatch.Elapsed.ToString ("G")} and {resultStr}");
+                               Console.ResetColor ();
+
+                               if (result.ExitCode != 0) {
+                                       Console.ForegroundColor = ConsoleColor.Red;
+                                       Console.WriteLine ("===== stdout =====");
                                        Console.ResetColor ();
+
+                                       Console.WriteLine (result.StandardOutput.ToString ());
+
+                                       Console.ForegroundColor = ConsoleColor.Red;
+                                       Console.WriteLine ("===== stderr =====");
+                                       Console.ResetColor ();
+
+                                       Console.WriteLine (result.StandardError.ToString ());
                                }
+
+                               results.Add (result);
                        }
 
                        sw.Stop ();
 
-                       Console.ForegroundColor = failures != 0 ? ConsoleColor.Red : ConsoleColor.Green;
-                       Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] Finished with {successes}/{benchmarks.Length} passing tests");
+                       var successes = results.Count (r => r.ExitCode == 0);
+                       var failures = results.Count (r => r.ExitCode != null && r.ExitCode != 0);
+                       var timeouts = results.Count (r => r.ExitCode == null);
+
+                       var settings = new XmlWriterSettings {
+                               NewLineOnAttributes = true,
+                               Indent = true,
+                       };
+
+                       using (var writer = XmlWriter.Create ("TestResult-profiler-stress.xml", settings)) {
+                               writer.WriteStartDocument ();
+                               writer.WriteComment ("This file represents the results of running a test suite");
+
+                               writer.WriteStartElement ("test-results");
+                               writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
+                               writer.WriteAttributeString ("total", results.Count.ToString ());
+                               writer.WriteAttributeString ("failures", failures.ToString ());
+                               writer.WriteAttributeString ("not-run", "0");
+                               writer.WriteAttributeString ("date", DateTime.Now.ToString ("yyyy-MM-dd"));
+                               writer.WriteAttributeString ("time", DateTime.Now.ToString ("HH:mm:ss"));
+
+                               writer.WriteStartElement ("environment");
+                               writer.WriteAttributeString ("nunit-version", "2.4.8.0");
+                               writer.WriteAttributeString ("clr-version", Environment.Version.ToString ());
+                               writer.WriteAttributeString ("os-version", Environment.OSVersion.ToString ());
+                               writer.WriteAttributeString ("platform", Environment.OSVersion.Platform.ToString ());
+                               writer.WriteAttributeString ("cwd", Environment.CurrentDirectory);
+                               writer.WriteAttributeString ("machine-name", Environment.MachineName);
+                               writer.WriteAttributeString ("user", Environment.UserName);
+                               writer.WriteAttributeString ("user-domain", Environment.UserDomainName);
+                               writer.WriteEndElement ();
+
+                               writer.WriteStartElement ("culture-info");
+                               writer.WriteAttributeString ("current-culture", CultureInfo.CurrentCulture.Name);
+                               writer.WriteAttributeString ("current-uiculture", CultureInfo.CurrentUICulture.Name);
+                               writer.WriteEndElement ();
+
+                               writer.WriteStartElement ("test-suite");
+                               writer.WriteAttributeString ("name", "profiler-stress-tests.dummy");
+                               writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
+                               writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
+                               writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
+                               writer.WriteStartElement ("results");
+
+                               writer.WriteStartElement ("test-suite");
+                               writer.WriteAttributeString ("name", "MonoTests");
+                               writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
+                               writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
+                               writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
+                               writer.WriteStartElement ("results");
+
+                               writer.WriteStartElement ("test-suite");
+                               writer.WriteAttributeString ("name", "profiler-stress");
+                               writer.WriteAttributeString ("success", (failures + timeouts == 0).ToString ());
+                               writer.WriteAttributeString ("time", ((int) sw.Elapsed.TotalSeconds).ToString ());
+                               writer.WriteAttributeString ("asserts", (failures + timeouts).ToString ());
+                               writer.WriteStartElement ("results");
+
+                               foreach (var result in results) {
+                                       var timeoutStr = result.ExitCode == null ? "_timeout" : string.Empty;
+
+                                       writer.WriteStartElement ("test-case");
+                                       writer.WriteAttributeString ("name", $"MonoTests.profiler-stress.{result.Benchmark.Name}{timeoutStr}");
+                                       writer.WriteAttributeString ("executed", "True");
+                                       writer.WriteAttributeString ("success", (result.ExitCode == 0).ToString ());
+                                       writer.WriteAttributeString ("time", ((int) result.Stopwatch.Elapsed.TotalSeconds).ToString ());
+                                       writer.WriteAttributeString ("asserts", result.ExitCode == 0 ? "0" : "1");
+
+                                       if (result.ExitCode != 0) {
+                                               writer.WriteStartElement ("failure");
+
+                                               writer.WriteStartElement ("message");
+                                               writer.WriteCData (FilterInvalidXmlChars (result.StandardOutput.ToString ()));
+                                               writer.WriteEndElement ();
+
+                                               writer.WriteStartElement ("stack-trace");
+                                               writer.WriteCData (FilterInvalidXmlChars (result.StandardError.ToString ()));
+                                               writer.WriteEndElement ();
+
+                                               writer.WriteEndElement ();
+                                       }
+
+                                       writer.WriteEndElement ();
+                               }
+
+                               writer.WriteEndElement ();
+                               writer.WriteEndElement ();
+
+                               writer.WriteEndElement ();
+                               writer.WriteEndElement ();
+
+                               writer.WriteEndElement ();
+                               writer.WriteEndElement ();
+
+                               writer.WriteEndElement ();
+
+                               writer.WriteEndDocument ();
+                       }
+
+                       var failureStr = failures + timeouts != 0 ? $" ({failures} failures, {timeouts} timeouts)" : string.Empty;
+
+                       Console.ForegroundColor = failures + timeouts != 0 ? ConsoleColor.Red : ConsoleColor.Green;
+                       Console.WriteLine ($"[{sw.Elapsed.ToString ("G")}] Finished with {successes}/{results.Count} passing tests{failureStr}");
                        Console.ResetColor ();
 
-                       return failures;
+                       return failures + timeouts;
                }
        }
 }
index 0946284c263312177f477509f9048670d0f1751f..45dbacccdb6ffb8c8e349b76df8ce4f2040cf579 100644 (file)
@@ -68,7 +68,11 @@ AC_SUBST(libmono_cflags)
 AC_SUBST(libmono_ldflags)
 
 # Variable to have relocatable .pc files (lib, or lib64)
-reloc_libdir=`basename ${libdir}`
+# realpath isn't always available, and requires that all but the tip of the provided
+# path exists. Fall back to the old behaviour, but realpath allows depth >1
+# e.g. Debian puts Mono in /usr/bin and libs in /usr/lib/x86_64-linux-gnu/ which is
+# too deep for the old method to work
+reloc_libdir=`realpath --relative-to=${prefix} ${libdir} 2> /dev/null || basename ${libdir}`
 AC_SUBST(reloc_libdir)
 
 # Set to yes if Unix sockets cannot be created in an anonymous namespace
@@ -113,6 +117,7 @@ case "$host" in
                libgc_threads=win32
                with_sigaltstack=no
                with_tls=pthread
+               with_sgen_default_concurrent=yes
                LN_S=cp
                # This forces libgc to use the DllMain based thread registration code on win32
                libgc_configure_args="$libgc_configure_args --enable-win32-dllmain=yes"
@@ -128,6 +133,7 @@ case "$host" in
                libgc_threads=pthreads
                with_sigaltstack=no
                use_sigposix=yes
+               with_sgen_default_concurrent=yes
                ;;
        *-*-kfreebsd*-gnu)
                CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -DTHREAD_LOCAL_ALLOC -pthread"
@@ -138,6 +144,7 @@ case "$host" in
                need_link_unlink=yes
                with_sigaltstack=no
                use_sigposix=yes
+               with_sgen_default_concurrent=yes
                ;;
        *-*-*freebsd*)
                if test "x$PTHREAD_CFLAGS" = "x"; then
@@ -161,6 +168,7 @@ case "$host" in
                libgc_threads=pthreads
                use_sigposix=yes
                has_dtrace=yes
+               with_sgen_default_concurrent=yes
                ;;
        *-*-*openbsd*)
                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_REENTRANT -DUSE_MMAP"
@@ -175,6 +183,7 @@ case "$host" in
                libgc_threads=pthreads
                with_sigaltstack=no
                use_sigposix=yes
+               with_sgen_default_concurrent=yes
                ;;
        *-*-linux-android*)
                platform_android=yes
@@ -238,6 +247,7 @@ case "$host" in
                        disable_munmap=yes
                        ;;
                esac
+               with_sgen_default_concurrent=yes
                ;;
        *-*-nacl*)
                CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
@@ -310,8 +320,10 @@ case "$host" in
                                CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
                                CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_CPPFLAGS"
                                CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
+                               with_sgen_default_concurrent=yes
                                ;;
                        x*64-*-darwin*)
+                               with_sgen_default_concurrent=yes
                                ;;
                        arm*-darwin*)
                                has_dtrace=no
@@ -538,9 +550,6 @@ if test x"$GCC" = xyes; then
                # We rely on signed overflow to behave
                CFLAGS="$CFLAGS -fwrapv"
 
-               # We rely on zero length arrays in structs
-               CFLAGS="$CFLAGS -Wno-zero-length-array"
-
                CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
                if test x"$disable_visibility_hidden" = xno; then
                   # Don't export any symbols by default
@@ -567,6 +576,8 @@ if test x"$GCC" = xyes; then
                   # https://bugzilla.samba.org/show_bug.cgi?id=8118
                   WARN="$WARN -Qunused-arguments"
                   WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand"
+                  # We rely on zero length arrays in structs
+                  WARN="$WARN -Wno-zero-length-array"
                fi
 else
        # The Sun Forte compiler complains about inline functions that access static variables
@@ -752,7 +763,7 @@ DISABLED_FEATURES=none
 # Set the build profiles and options before things which use them
 #
 
-AC_ARG_WITH(profile4_x,      [  --with-profile4=yes,no          If you want to install the 4.x FX (defaults to yes)],                 [], [with_profile4_x=default])
+AC_ARG_WITH(profile4_x,      [  --with-profile4_x=yes,no        If you want to install the 4.x FX (defaults to yes)],                 [], [with_profile4_x=default])
 AC_ARG_WITH(monodroid,       [  --with-monodroid=yes,no         If you want to build the MonoDroid assemblies (defaults to no)],      [], [with_monodroid=default])
 AC_ARG_WITH(monotouch,       [  --with-monotouch=yes,no         If you want to build the Xamarin.iOS assemblies (defaults to no)],    [], [with_monotouch=default])
 AC_ARG_WITH(monotouch_watch, [  --with-monotouch_watch=yes,no   If you want to build the Xamarin.WatchOS assemblies (defaults to no)],[], [with_monotouch_watch=default])
@@ -769,7 +780,7 @@ dnl
 TEST_PROFILE=default
 enable_llvm_default=no
 
-INVARIANT_AOT_OPTIONS=nimt-trampolines=900,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=2800
+INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4000
 
 if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
    DISABLE_MCS_DOCS_default=yes
@@ -1162,20 +1173,6 @@ AC_COMPILE_IFELSE([
    AC_MSG_RESULT(no)
 ])
 
-AC_MSG_CHECKING(for deprecated __attribute__)
-AC_TRY_COMPILE([
-     int doit (void) __attribute__ ((deprecated));
-     int doit (void) { return 0; }
-], [
-       return 0;
-], [
-   have_deprecated=yes
-   AC_MSG_RESULT(yes)
-], [
-   have_deprecated=no
-   AC_MSG_RESULT(no)
-])
-
 dnl
 dnl Boehm GC configuration
 dnl
@@ -2672,12 +2669,6 @@ fi
 
 AC_ARG_ENABLE(bcl-opt, [  --disable-bcl-opt    BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
 
-AC_ARG_ENABLE(perf-events, [  --enable-perf-events Enable using `perf` for profiling on Linux], test_perf_events=$enableval, test_perf_events=no)
-if test "x$test_perf_events" = "xyes"; then
-       AC_DEFINE(ENABLE_PERF_EVENTS, 1, [Enable using `perf` for profiling on Linux])
-       AC_SUBST(ENABLE_PERF_EVENTS)
-fi
-
 AC_MSG_CHECKING([if big-arrays are to be enabled])
 AC_ARG_ENABLE(big-arrays,  [  --enable-big-arrays      Enable the allocation and indexing of arrays greater than Int32.MaxValue], enable_big_arrays=$enableval, enable_big_arrays=no)
 if test "x$enable_big_arrays" = "xyes" ; then
@@ -3935,9 +3926,11 @@ dnl **************
 dnl ***  Btls  ***
 dnl **************
 
-AC_ARG_ENABLE(btls, [  --disable-blts             Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
+AC_ARG_ENABLE(btls, [  --disable-btls             Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
 AC_ARG_WITH(btls_android_ndk, [  --with-btls-android-ndk        Android NDK for BoringTls])
 
+AC_ARG_ENABLE(dynamic-btls, [ --enable-dynamic-btls Place the BTLS provider into a separate shared library/archive.], enable_dynamic_btls=$enableval, enable_dynamic_btls=no)
+
 AM_CONDITIONAL(BTLS, test x$enable_btls = xyes)
 
 btls_android=no
@@ -3957,7 +3950,11 @@ if test "x$enable_btls" = "xyes"; then
        case "$BTLS_PLATFORM" in
        i386)
                btls_arch=i386
-               btls_cflags="-m32 -arch i386"
+               btls_cflags="-m32"
+               case $host_os in
+                       darwin*)
+                               btls_cflags="$btls_cflags -arch i386"
+               esac
                ;;
        x86_64)
                btls_arch=x86_64
@@ -4245,6 +4242,7 @@ llvm/Makefile
 scripts/mono-find-provides
 scripts/mono-find-requires
 mono/Makefile
+mono/btls/Makefile
 mono/utils/Makefile
 mono/metadata/Makefile
 mono/dis/Makefile
@@ -4410,6 +4408,13 @@ fi
       echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
     fi
 
+    if test "x$enable_btls" = "xyes"; then
+      echo "HAVE_BTLS=1" >> $srcdir/$mcsdir/build/config.make
+      if test "x$enable_dynamic_btls" = "xyes"; then
+        echo "HAVE_DYNAMIC_BTLS=1" >> $srcdir/$mcsdir/build/config.make
+      fi
+    fi
+
   fi
 
 )
index b4b7243ecfd001bb60aeb9b0979840a8cd170c28..be83151429311d44e1c6d5aaa5c82df050a1aa74 100644 (file)
@@ -11,6 +11,7 @@
        <dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
        <dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
        <dllmap dll="MonoPosixHelper" target="$mono_libdir/libMonoPosixHelper@libsuffix@" os="!windows" />
+       <dllmap dll="libmono-btls-shared" target="$mono_libdir/libmono-btls-shared@libsuffix@" os="!windows" />
        <dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
        <dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
        <dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
index 2e346ad3a88796d3edda11ca11b8ab43c96a227c..2dfec5f02035f14e40680df0e734e240e1563c44 100644 (file)
@@ -74,9 +74,6 @@
                        <add prefix="https" type="System.Net.HttpRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                        <add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                </webRequestModules>
-               <settings>
-                       <ipv6 enabled="false"/>
-               </settings>
        </system.net>
        <system.web>
                <httpHandlers>
index c6d1b2c0fa37b35bddf2a83acacd5ba879e38278..2f8090f028844be1164b5fc55788231b305a42ad 100644 (file)
                        <add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                        <add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                </webRequestModules>
-               <settings>
-                       <ipv6 enabled="false"/>
-               </settings>
        </system.net>
        
        <system.runtime.remoting>
index b98a4d3e0072addc1580372fa666ec045a5e0568..30bc2105f3afba38b6ccfc3e99991b770ea41f30 100644 (file)
                        <add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                        <add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                </webRequestModules>
-               <settings>
-                       <ipv6 enabled="false"/>
-               </settings>
        </system.net>
        
        <system.runtime.remoting>
index 8f7e56a4facce6876d87fe6238a4dbe43bed3575..df27ec4003ef4d05ecda25d5590c4139d6be7ff3 100644 (file)
                        <add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                        <add prefix="ftp" type="System.Net.FtpRequestCreator, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
                </webRequestModules>
-               <settings>
-                       <ipv6 enabled="false"/>
-               </settings>
        </system.net>
        
        <system.runtime.remoting>
index 1527ba26d30452bb70aa7403d6cbc1281ad5ec78..f89138ba851b49bb5ad317571536be5f3af3d632 100644 (file)
@@ -5,7 +5,7 @@ AM_CFLAGS = $(WERROR_CFLAGS)
 win_files  = \
        eglib-config.hw \
        gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \
-       gmodule-win32.c gtimer-win32.c
+       gmodule-win32.c gtimer-win32.c gunicode-win32.c
 
 unix_files = \
        gdate-unix.c  gdir-unix.c  gfile-unix.c  gmisc-unix.c   \
index 4e17a089b5444b040cb92ed2562f4df52d365eb6..9c34d8756930f4fa7e898995c1d02329843f1be9 100644 (file)
@@ -78,3 +78,11 @@ g_file_test (const gchar *filename, GFileTest test)
        }
        return FALSE;
 }
+
+gchar *
+g_mkdtemp (char *tmp_template)
+{
+       char *template_copy = g_strdup (tmp_template);
+
+       return mkdtemp (template_copy);
+}
index 1bc8506310edfa9ea570c94ccbed620266ead00c..8ceec487041d6bb7c3a2a72d3f8e85cfd2ecaa78 100644 (file)
@@ -887,11 +887,7 @@ gboolean   g_file_test (const gchar *filename, GFileTest test);
 #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
diff --git a/eglib/src/gmisc-win32-uwp.c b/eglib/src/gmisc-win32-uwp.c
new file mode 100644 (file)
index 0000000..cdf5896
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * gmisc-win32-uwp.c: UWP misc support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include <assert.h>
+
+gchar*
+g_win32_getlocale(void)
+{
+       gunichar2 buf[19];
+       gint ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO639LANGNAME, buf, 9);
+       assert (ccBuf <= 9);
+       if (ccBuf != 0) {
+               buf[ccBuf - 1] = L'-';
+               ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
+               assert (ccBuf <= 9);
+       }
+
+       // Check for GetLocaleInfoEx failure.
+       if (ccBuf == 0)
+               buf[0] = L'\0';
+
+       return u16to8 (buf);
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_gmisc_win32_uwp_quiet_lnk4221(void) {}
+#endif
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
index f9fdb668f2d89d842c411e7af76d9d4a410ccfb9..4aac0ef69460fe70c432dfb78f8fcfd2bd931f5a 100644 (file)
@@ -101,27 +101,6 @@ g_win32_getlocale(void)
        ccBuf += GetLocaleInfoA(lcid, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
        return g_strdup (buf);
 }
-
-#else /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
-
-gchar*
-g_win32_getlocale(void)
-{
-       gunichar2 buf[19];
-       gint ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO639LANGNAME, buf, 9);
-       assert (ccBuf <= 9);
-       if (ccBuf != 0) {
-               buf[ccBuf - 1] = L'-';
-               ccBuf = GetLocaleInfoEx (LOCALE_NAME_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9);
-               assert (ccBuf <= 9);
-       }
-
-       // Check for GetLocaleInfoEx failure.
-       if (ccBuf == 0)
-               buf[0] = L'\0';
-
-       return u16to8 (buf);
-}
 #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 gboolean
@@ -142,20 +121,35 @@ g_path_is_absolute (const char *filename)
        return FALSE;
 }
 
-const gchar *
-g_get_home_dir (void)
-{
-       gchar *home_dir = NULL;
-
 #if _MSC_VER && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static gchar*
+g_get_known_folder_path (void)
+{
+       gchar *folder_path = NULL;
        PWSTR profile_path = NULL;
        HRESULT hr = SHGetKnownFolderPath (&FOLDERID_Profile, KF_FLAG_DEFAULT, NULL, &profile_path);
        if (SUCCEEDED(hr)) {
-               home_dir = u16to8 (profile_path);
+               folder_path = u16to8 (profile_path);
                CoTaskMemFree (profile_path);
        }
+
+       return folder_path;
+}
+
+#else
+
+static inline gchar *
+g_get_known_folder_path (void)
+{
+       return NULL;
+}
 #endif
 
+const gchar *
+g_get_home_dir (void)
+{
+       gchar *home_dir = g_get_known_folder_path ();
+
        if (!home_dir) {
                home_dir = (gchar *) g_getenv ("USERPROFILE");
        }
diff --git a/eglib/src/gmodule-win32-internals.h b/eglib/src/gmodule-win32-internals.h
new file mode 100644 (file)
index 0000000..d18e27f
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __G_MODULE_WINDOWS_INTERNALS_H__
+#define __G_MODULE_WINDOWS_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef G_OS_WIN32
+#include <gmodule.h>
+
+gpointer
+w32_find_symbol (const gchar *symbol_name);
+#endif /* G_OS_WIN32 */
+#endif /* __G_MODULE_WINDOWS_INTERNALS_H__ */
diff --git a/eglib/src/gmodule-win32-uwp.c b/eglib/src/gmodule-win32-uwp.c
new file mode 100644 (file)
index 0000000..5117e3b
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * gmodule-win32-uwp.c: UWP gmodule support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include <gmodule-win32-internals.h>
+
+gpointer
+w32_find_symbol (const gchar *symbol_name)
+{
+       g_unsupported_api ("EnumProcessModules");
+       SetLastError (ERROR_NOT_SUPPORTED);
+       return NULL;
+}
+
+const gchar *
+g_module_error (void)
+{
+       gchar *ret = NULL;
+       TCHAR buf [1024];
+       DWORD code = GetLastError ();
+
+       if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
+               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS (buf) - 1, NULL) )
+               buf[0] = TEXT('\0');
+
+       ret = u16to8 (buf);
+       return ret;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_gmodule_win32_uwp_quiet_lnk4221(void) {}
+#endif
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
index d1dca5303eb7d174fa98c154a35901844105dd5b..72eaca32fb7d96ea29316af51ba14c61c793a570 100644 (file)
@@ -30,9 +30,9 @@
  */
 #include <config.h>
 #include <glib.h>
-#include <gmodule.h>
 #include <windows.h>
 #include <psapi.h>
+#include <gmodule-win32-internals.h>
 
 #define LIBSUFFIX ".dll"
 #define LIBPREFIX ""
@@ -70,7 +70,7 @@ g_module_open (const gchar *file, GModuleFlags flags)
 }
 
 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
-static gpointer
+gpointer
 w32_find_symbol (const gchar *symbol_name)
 {
        HMODULE *modules;
@@ -116,16 +116,6 @@ w32_find_symbol (const gchar *symbol_name)
        g_free (modules);
        return NULL;
 }
-
-#else /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
-
-static gpointer
-w32_find_symbol (const gchar *symbol_name)
-{
-       g_unsupported_api ("EnumProcessModules");
-       SetLastError (ERROR_NOT_SUPPORTED);
-       return NULL;
-}
 #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 gboolean
@@ -164,34 +154,6 @@ g_module_error (void)
 
        return ret;
 }
-
-#elif G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)   /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
-
-const gchar *
-g_module_error (void)
-{
-       gchar* ret = NULL;
-       TCHAR buf[1024];
-       DWORD code = GetLastError ();
-
-       if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
-               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS(buf) - 1, NULL) )
-               buf[0] = TEXT('\0');
-
-       ret = u16to8 (buf);
-       return ret;
-}
-
-#else
-
-const gchar *
-g_module_error (void)
-{
-       g_unsupported_api ("FormatMessage");
-       SetLastError (ERROR_NOT_SUPPORTED);
-       return NULL;
-}
-
 #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 gboolean
index ef80cff034748e559dea3055bc3bfb175dc3eb76..2dcf8746e08a90a3d3f506d7a19849b93db60295 100644 (file)
@@ -47,8 +47,10 @@ g_print (const gchar *format, ...)
        va_list args;
 
        va_start (args, format);
-       if (g_vasprintf (&msg, format, args) < 0)
+       if (g_vasprintf (&msg, format, args) < 0) {
+               va_end (args);
                return;
+       }
        va_end (args);
 
        if (!stdout_handler)
@@ -65,8 +67,10 @@ g_printerr (const gchar *format, ...)
        va_list args;
 
        va_start (args, format);
-       if (g_vasprintf (&msg, format, args) < 0)
+       if (g_vasprintf (&msg, format, args) < 0) {
+               va_end (args);
                return;
+       }
        va_end (args);
 
        if (!stderr_handler)
diff --git a/eglib/src/gunicode-win32-uwp.c b/eglib/src/gunicode-win32-uwp.c
new file mode 100644 (file)
index 0000000..ef36ffc
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * gunicode-win32-uwp.c: UWP unicode support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#define CODESET 1
+#include <windows.h>
+
+extern const char *my_charset;
+static gboolean is_utf8;
+
+gboolean
+g_get_charset (G_CONST_RETURN char **charset)
+{
+       if (my_charset == NULL) {
+               static char buf [14];
+               CPINFOEXA cp_info;
+
+               GetCPInfoExA (CP_ACP, 0, &cp_info);
+               sprintf (buf, "CP%u", cp_info.CodePage);
+               my_charset = buf;
+               is_utf8 = FALSE;
+       }
+       
+       if (charset != NULL)
+               *charset = my_charset;
+
+       return is_utf8;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_gunicode_win32_uwp_quiet_lnk4221(void) {}
+#endif
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/eglib/src/gunicode-win32.c b/eglib/src/gunicode-win32.c
new file mode 100644 (file)
index 0000000..a35cfcd
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * gunicode-win32.c: Windows unicode support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+#define CODESET 1
+#include <windows.h>
+
+extern const char *my_charset;
+static gboolean is_utf8;
+
+gboolean
+g_get_charset (G_CONST_RETURN char **charset)
+{
+       if (my_charset == NULL) {
+               static char buf [14];
+               sprintf (buf, "CP%u", GetACP ());
+               my_charset = buf;
+               is_utf8 = FALSE;
+       }
+       
+       if (charset != NULL)
+               *charset = my_charset;
+
+       return is_utf8;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_mono_gunicode_win32_quiet_lnk4221(void) {}
+#endif
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
index f979f429ff7d4306c3b4a826c2c45712d2f37af4..c1280f9b8bf287517374552620b1b3e2f87fff4d 100644 (file)
 #include <unicode-data.h>
 #include <errno.h>
 
-#if defined(_MSC_VER) || defined(G_OS_WIN32)
-/* FIXME */
-#  define CODESET 1
-#  include <windows.h>
-#else
+#ifndef G_OS_WIN32
 #    ifdef HAVE_LOCALCHARSET_H
 #       include <localcharset.h>
 #    endif
 #endif
 
-static const char *my_charset;
-static gboolean is_utf8;
+const char *my_charset;
 
 /*
  * Character set conversion
@@ -205,31 +200,8 @@ g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gs
        return res;
 }
 
-#ifdef G_OS_WIN32
-extern WINBASEAPI UINT WINAPI GetACP(void);
-gboolean
-g_get_charset (G_CONST_RETURN char **charset)
-{
-       if (my_charset == NULL) {
-               static char buf [14];
-#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
-               CPINFOEXA cp_info;
-               GetCPInfoExA (CP_ACP, 0, &cp_info);
-               sprintf (buf, "CP%u", cp_info.CodePage);
-#else
-               sprintf (buf, "CP%u", GetACP ());
-#endif
-               my_charset = buf;
-               is_utf8 = FALSE;
-       }
-       
-       if (charset != NULL)
-               *charset = my_charset;
-
-       return is_utf8;
-}
-
-#else /* G_OS_WIN32 */
+#ifndef G_OS_WIN32
+static gboolean is_utf8;
 
 gboolean
 g_get_charset (G_CONST_RETURN char **charset)
index 3a64e217ef0c7a82c260e789a8ece0c13d41cc5d..238250bba05455b75186c920c11dc70efd3d983d 100755 (executable)
 #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
        #define HAVE_CLASSIC_WINAPI_SUPPORT 0
        #define HAVE_UWP_WINAPI_SUPPORT 1
+#ifndef HAVE_EXTERN_DEFINED_WINAPI_SUPPORT
+       #error Unsupported WINAPI family
+#endif
 #else
        #define HAVE_CLASSIC_WINAPI_SUPPORT 0
        #define HAVE_UWP_WINAPI_SUPPORT 0
+#ifndef HAVE_EXTERN_DEFINED_WINAPI_SUPPORT
+       #error Unsupported WINAPI family
+#endif
 #endif
 
 #endif
diff --git a/external/bockbuild b/external/bockbuild
new file mode 160000 (submodule)
index 0000000..f42561e
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit f42561e9ff8e60483897bb54e2191344556de94e
diff --git a/external/boringssl b/external/boringssl
new file mode 160000 (submodule)
index 0000000..c06ac6b
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit c06ac6b33d3e7442ad878488b9d1100127eff998
index f38c0f5d99b6e44fa906d14e1146fa65a3806cd3..3f37ebd52b49e1a9ab3bfbc5881b6da01c134c0d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f38c0f5d99b6e44fa906d14e1146fa65a3806cd3
+Subproject commit 3f37ebd52b49e1a9ab3bfbc5881b6da01c134c0d
diff --git a/external/corefx b/external/corefx
new file mode 160000 (submodule)
index 0000000..b1aa1d9
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit b1aa1d92ca33d0cb8ffbac9b6ff73b284db6bbf1
index 9f44f259bf5059df6c8019948ea75313bd09a9fb..367864ef810859ae3ce652864233b35f2dd5fdbe 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 9f44f259bf5059df6c8019948ea75313bd09a9fb
+Subproject commit 367864ef810859ae3ce652864233b35f2dd5fdbe
diff --git a/external/linker b/external/linker
new file mode 160000 (submodule)
index 0000000..e4d9784
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit e4d9784ac37b9ebf4757175c92bc7a3ec9fd867a
index 4bc79a6da1f0ee538560b7e4d0caff46d3c86e4f..670081afaf2a5662ec6471a7e2603c7ca6e8edbc 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4bc79a6da1f0ee538560b7e4d0caff46d3c86e4f
+Subproject commit 670081afaf2a5662ec6471a7e2603c7ca6e8edbc
index fe705601b4c7939cecdcb05c6abcebffd6b7e93d..853df717c7575cfdd2cebbf8d495cfdc8286afb6 100644 (file)
@@ -11,7 +11,7 @@ caspol \- Command line tool to modify Code Access Security policies.
 .PP
 .B caspol [options] [policy level] [actions] [parameters] ... 
 .SH DESCRIPTION
-This tools allow to list and modify the different policy levels (user, 
+This tool allows to list and modify the different policy levels (user, 
 machine and enterprise).
 .SH OPTIONS
 .TP
@@ -20,7 +20,7 @@ Do not ask confirmation to change the policy level.
 .TP
 .I -f[orce]
 Caspol.exe is a managed tool. Changing the security policies could affect
-it's ability to work properly. This option permit changes that could 
+it's ability to work properly. This option permits changes that could 
 disallow caspol.exe from working properly.
 .TP
 .I -? | /? | -h[elp]
@@ -90,7 +90,7 @@ Remove the specified named permission set from the policy level
 .TP
 .I -af | -addfulltrust assemblyname
 Add the specified assembly to the fully trusted assembly list in the 
-policy level. If a policy use some custom security permissions then the
+policy level. If a policy uses some custom security permissions then the
 assembly containing the custom permissions must be in the fully trusted
 list. Note that this requirement is recursive (all assemblies required 
 by the specified assembly must also be in the list). The assembly must be
@@ -148,33 +148,33 @@ Use the option to load a custom condition into the policy. The class that
 will deserialize the XML policy must be in a fully trusted assembly.
 .TP
 .I -hash algo [-hex hash | -file assemblyname]
-This condition specify a specific hash that an assembly must generate
+This condition specifies a specific hash that an assembly must generate
 (from itself) to be satisfied. Any change to the assembly will require the
 policy to be updated (as the hash value will have changed).
 .TP
 .I -pub [-cert certificate | -file signedfile | -hex rawdata]
-This condition specify a X.509 Authenticode(r) certificate that must have 
+This condition specifies a X.509 Authenticode(r) certificate that must have 
 signed an assembly in order to be satisfied. The certificate can be referenced
 as a file (binary DER), a signed file (containing the certificate) or with
 the hexadecimal value of the certificate. Note that files outside the 
 policy must also be protected against tempering.
 .TP
 .I -strong -file filename [name | -noname] [version | -noversion]
-This condition specify a specific StrongName that must have signed an
+This condition specifies a specific StrongName that must have signed an
 assembly to be satisfied. Use -noname if the assembly name isn't known
 (or important) and -version if the version isn't known (or important) in
 the resolution.
 .TP
 .I -site hostname
-This condition specify the site from where the assembly must come from to 
+This condition specifies the site from where the assembly must come from to 
 be satisfied.
 .TP
 .I -url URL
-This condition specify the URL from where the assembly must come from to 
+This condition specifies the URL from where the assembly must come from to 
 be satisfied.
 .TP
 .I -zone zonename
-This condition specify the zone from where the assembly must come from to 
+This condition specifies the zone from where the assembly must come from to 
 be satisfied. Existing zones are MyComputer, Internet, Intranet, Trusted 
 and Untrusted.
 
@@ -204,7 +204,7 @@ It is possible to chain several commands with the tool, like:
 .TP
 This will list all machine level code groups, then remove the code group
 labeled 1.6, list again all code groups (missing 1.6), reset the policy
-and finally showing all code groups (where 1.6 is back).
+and finally show all code groups (where 1.6 is back).
 
 .SH KNOWN ISSUES
 .TP
index aead19a58d084fbb76a15eebba1fef9a6367a76a..3614f4ae4ec8d1173f8940122cd2984e7e3db6c2 100644 (file)
@@ -11,7 +11,7 @@ cccheck \- Perform static code contracts verification for CLR assemblies.
 .PP
 .B cccheck --assembly=<assembly> [options]
 .SH DESCRIPTION
-Perform static code contracts verification to find bugs and inconsistences
+Perform static code contracts verification to find bugs and inconsistencies
 between code and specification. This includes non-null, integer analyses. 
 .PP
 The assembly must have been built with the symbol CONTRACTS_FULL defined,
index 22f242b2fb49563d2ed058e459c7af35ac64e4ec..a3907ed699a6efaf99b1e604de7a6ae4c0de9b37 100644 (file)
@@ -1,6 +1,6 @@
 .\" 
 .\" ccrewrite manual page.
-.\" Copyright (C) 2010 Novell, Inc (http://www.novell.com)
+.\" Copyright (C) 2010 Chris Bacon.
 .\" Author:
 .\"   Chris Bacon <chrisbacon76@gmail.com>
 .\"
@@ -28,7 +28,7 @@ specified assembly.
 .TP
 .I "--assembly <assembly-name>"
 The assembly to rewrite. If no --output option is specified, then this file
-overwritten with the rewritten version.
+is overwritten with the rewritten version.
 .TP
 .I "--debug"
 Use debug information if available to improve the usefulness of contract
@@ -38,7 +38,7 @@ failure messages.
 Show help for ccrewrite, listing configuration options.
 .TP
 .I "--level <level> (default=4)"
-Set the which contract types are present in rewritten assembly:
+Set which contract types are present in rewritten assembly:
 0 = No contracts;
 1 = Release requires;
 2 = Requires;
index b80ffd0457f9fad271952beb31a7389830f52319..92bfa164b96340f38e80ec070b04222ebeacf264 100644 (file)
@@ -15,7 +15,7 @@ certmgr \- Mono Certificate Manager (CLI version)
 or
 .B certmgr -ssl [options] url
 .SH DESCRIPTION
-This tool allow to list, add, remove or extract certificates, certificate 
+This tool allows to list, add, remove or extract certificates, certificate 
 revocation lists (CRL) or certificate trust lists (CTL) to/from a 
 certificate store. Certificate stores are used to build and validate 
 certificate chains for Authenticode(r) code signing validation and SSL 
@@ -23,7 +23,7 @@ server certificates.
 .SH STORES
 The 
 .I store
-represents the certificate store to use.   It can be one of the
+represents the certificate store to use. It can be one of the
 following:
 .TP
 .I "My"
@@ -46,7 +46,7 @@ This is for untrusted roots
 List the certificates, CTL or CTL in the specified store.
 .TP
 .I "-add"
-Add a certificate, CRL or CTL to specified store. If filename it's a pkcs12 
+Add a certificate, CRL or CTL to specified store. If filename is a pkcs12 
 or pfx file, and it contains a private key, it will be imported to local key
 pair container.
 .TP
@@ -64,25 +64,25 @@ Copy a certificate, CRL or CTL from a store to a file.
 Download and add the certificates from a SSL session. You'll be asked to 
 confirm the addition of every certificate received from the server. Note 
 that SSL/TLS protocols do not requires a server to send the root certificate.
-This action assume an certificate (-c) object type and will import the 
+This action assumes a certificate (-c) object type and will import the 
 certificates in appropriate stores (i.e. server certificate in the 
-OtherPeople store, the root certificate in the Trust store, any other 
+OtherPeople store, the root certificate in the Trust store and any other 
 intermediate certificates in the IntermediateCA store).
 .TP
 .I "-importKey"
 Allows importing a private key from a pkcs12 file into a local key pair
-store. (Usefull when you already have the key's corresponding certificate
+store. (Useful when you already have the key's corresponding certificate
 installed at the specific store.)
 
 .SH OBJECT TYPES
 .TP
 .I "-c", "-cert", "-certificate"
-Add, Delete or Put certificates. That is the specified file must/will contains
+Add, Delete or Put certificates. That is the specified file must/will contain
 X.509 certificates in DER binary encoding.
 .TP
 .I "-crl"
 Add, Delete or Put certificate revocation lists (CRL). That is the specified 
-file must/will contains X.509 CRL in DER binary encoding.
+file must/will contain X.509 CRL in DER binary encoding.
 .TP
 .I "-ctl"
 Add, Delete or Put certificate trust lists (CRL). UNSUPPORTED.
@@ -96,7 +96,7 @@ Use the machine's certificate stores (instead of the default user's stores).
 More details displayed on the console.
 .TP
 .I "-p password"
-Use the specify password when accessing a pkcs12 file.
+Use the specified password when accessing a pkcs12 file.
 .TP
 .I "-help", "-h", "-?", "/?"
 Display help about this tool.
@@ -113,7 +113,7 @@ For example the trusted root certificates for a user would be kept under
 .TP
 Certificates files are kept in DER (binary) format (extension .cer).
 .TP
-The filenames either starts with
+The filenames either start with
 .I tbp 
 (thumbprint) or
 .I ski
index 8e20437b1aaacb0ac2ad2afcee8b09188955dea4..b60c6f708b83ded5d39917eb52fb26f1fd48504a 100644 (file)
@@ -42,7 +42,7 @@ associated with certificates present in user store.
 .B mono crlupdate.exe -f -m
 Force the download of every CRL associated with certificates present in
 the machine store. Note that the user running this needs read/write 
-access to the machine store or not update will occur.
+access to the machine store or update will not occur.
 
 .SH AUTHOR
 Written by Sebastien Pouliot
index 9379658e62e5ec4615a6f61f890f06f56bd458fd..a0f9e6f4f6acd62c6df19b1a0a84aadca07e306c 100644 (file)
@@ -224,7 +224,7 @@ versions uses the standard Gtk# key bindings.
 .PP
 The command set is similar to many other applications (cursor keys)
 and incorporates some of the Emacs commands for editing as well as a
-history mechanism to 
+history mechanism too.
 .PP
 .PP
 The following keyboard input is supported:
@@ -247,7 +247,7 @@ line in the history.
 .TP
 .I Down Arrow Key, Control-n
 Moves forward in the history, replaces the current line with the next
-lien in the history.
+line in the history.
 .TP
 .I Return
 Executes the current line if the statement or expression is complete,
index e8e319ccc65b980a5e568bf1ef2e4e58d95ebbc2..c2f2cfddbd8ba9afaec38a0acfd059e6aaba7a3c 100644 (file)
@@ -29,7 +29,7 @@ option is specified), and saves them to disk.
 The following options are available:
 .TP
 .I "-nologo"
-Supress the startup logo.
+Suppress the startup logo.
 .TP
 .I "-nosave"
 Do not save the discovered documents to disk. The default is to save the documents.
index 377c445cb095c3479199002d4a1461bc3bdaf7d1..644b85a6e4f123c8987dae19825eeb2f34778196 100644 (file)
--- a/man/mcs.1
+++ b/man/mcs.1
@@ -238,6 +238,9 @@ Names the output file to be generated.
 .I \-\-parse
 Used for benchmarking.  The compiler will only parse its input files.
 .TP
+.I \-pathmap:K=V[,Kn=Vn]
+Sets a mapping for source path names used in generated output.
+.TP
 .I \-pkg:package1[,packageN]
 Reference assemblies for the given packages.
 .Sp
index 305cfcc7f7224d787f72e728310c6a0e66c49d43..3d067eb27ef9892b7d979a57b40f1d4fa17c4814 100644 (file)
@@ -24,7 +24,8 @@ dependencies referenced, use the "--deps" command line option.
 There are two modes of operation, one uses an existing Mono binary or
 a server-hosted list of binaries and is enabled when you use either
 the 
-.B --cross
+.B --cross,
+.B --sdk
 or the
 .B --runtime
 command line options.   
@@ -119,10 +120,19 @@ are using (1.0 or 2.0)
 When passed, DIR will be set for the MONO_CFG_DIR environment variable
 .TP
 .I "--cross target"
-Creates a bundle for the specified target platform.   The target
-must be a directory in ~/.mono/targets/ that contains a "mono"
-binary.   You can fetch various targets using the --fetch-target
-command line option.
+Use this to request mkbundle generate a cross-compiled binary.  It
+Creates a bundle for the specified target platform.  The target must
+be a directory in ~/.mono/targets/ that contains an SDK installation
+as produced by the mono-package-runtime tool.  You can get a list of
+the precompiled versions of the runtime using --list-targets and you
+can fetch a specific target using the --fetch-target command line
+option.
+.Sp
+This flag is mutually exclusive with 
+.I --sdk
+which is used to specify an absolute path to resolve the Mono runtime
+from and the --runtime option which is used to manually construct the
+cross-platform package.
 .TP
 .I "--deps"
 This option will bundle all of the referenced assemblies for the
@@ -203,7 +213,26 @@ executed.
 Additionally, users of your binary can still configure their own
 options by setting the 
 .I MONO_ENV_OPTIONS
-environment variable.   
+environment variable.
+.TP
+.I "--sdk SDK_PATH"
+Use this flag to specify a path from which mkbundle will resolve the
+Mono SDK from.   The SDK path should be the prefix path that you used
+to configure a Mono installation.   And would typically contain files
+lik
+.I SDK_PATH/bin/mono
+,
+.I SDK_PATH/lib/mono/4.5
+and so on.
+.Sp
+When this flag is specified,
+.I mkbundle
+will resolve the runtime, the framework libraries, unmanaged resources
+and configuration files from the files located in this directory.
+.Sp
+This flag is mutually exlusive with 
+.I --cross
+.
 .TP
 .I "--target-server SERVER"
 By default the mkbundle tool will download from a Mono server the
index c4589ea70c7243f74525d5669f342c983f24f39b..08a93ac91823901085ca08edf8daa9d6b08b2363 100644 (file)
@@ -332,6 +332,12 @@ Currently this merely ensures that you are running either the
 \fBMONO_ENV_OPTIONS\fR environment variable to force all of your child
 processes to use one particular kind of GC with the Mono runtime.
 .TP
+\fB--gc-debug=[options]\fR
+Command line equivalent of the \fBMONO_GC_DEBUG\fR environment variable.
+.TP
+\fB--gc-params=[options]\fR
+Command line equivalent of the \fBMONO_GC_PARAMS\fR environment variable.
+.TP
 \fB--arch=32\fR, \fB--arch=64\fR
 (Mac OS X only): Selects the bitness of the Mono binary used, if
 available. If the binary used is already for the selected bitness, nothing
index c4fd545dd104c5413ea6a5bcb627a25bccf6fec1..f19a02aa14ea8679cda72518cc466f57ee5a4ad8 100644 (file)
@@ -92,7 +92,7 @@ provided by the Mono runtime and write them to a file named
 \f[I]output.mlpd\f[].
 When no option is specified, it is equivalent to using:
 .PP
-\f[B]--profile=log:calls,alloc,output=output.mlpd,maxframes=8,calldepth=100\f[]
+\f[B]--profile=log:calls,alloc,output=output.mlpd,maxframes=32,calldepth=100\f[]
 .PP
 The following options can be used to modify this default behaviour.
 Each option is separated from the next by a \f[B],\f[] character,
@@ -139,41 +139,16 @@ garbage collections
 to the control port
 .RE
 .IP \[bu] 2
-\f[I]sample[=TYPE[/FREQ]]\f[]: collect statistical samples of the
+\f[I]sample[=FREQ]\f[]: collect statistical samples of the
 program behaviour.
 The default is to collect a 100 times per second (100 Hz) the
 instruction pointer.
-This is equivalent to the value \[lq]cycles/100\[rq].
+This is equivalent to the value \[lq]100\[rq].
 A value of zero for \f[I]FREQ\f[] effectively disables sampling.
-On some systems, like with recent Linux kernels, it is possible to
-cause the sampling to happen for other events provided by the
-performance counters of the cpu.
-In this case, \f[I]TYPE\f[] can be one of:
-.RS 2
-.IP \[bu] 2
-\f[I]cycles\f[]: processor cycles
-.IP \[bu] 2
-\f[I]instr\f[]: executed instructions
-.IP \[bu] 2
-\f[I]cacherefs\f[]: cache references
-.IP \[bu] 2
-\f[I]cachemiss\f[]: cache misses
-.IP \[bu] 2
-\f[I]branches\f[]: executed branches
-.IP \[bu] 2
-\f[I]branchmiss\f[]: mispredicted branches
-.RE
-.IP \[bu] 2
-\f[I]time=TIMER\f[]: use the TIMER timestamp mode.
-TIMER can have the following values:
-.RS 2
-.IP \[bu] 2
-\f[I]fast\f[]: a usually faster but possibly more inaccurate timer
-.RE
 .IP \[bu] 2
 \f[I]maxframes=NUM\f[]: when a stack trace needs to be performed,
 collect \f[I]NUM\f[] frames at the most.
-The default is 8.
+The default is 32.
 .IP \[bu] 2
 \f[I]maxsamples=NUM\f[]: stop allocating reusable sample events
 once \f[I]NUM\f[] events have been allocated (a value of zero for
@@ -234,16 +209,15 @@ The following commands are available:
 \f[I]heapshot\f[]: perform a heapshot as soon as possible
 .RE
 .IP \[bu] 2
-\f[I]counters\f[]: sample counters values every 1 second. This allow
-a really lightweight way to have insight in some of the runtime key
-metrics. Counters displayed in non verbose mode are : Methods from AOT,
-Methods JITted using mono JIT, Methods JITted using LLVM, Total time
-spent JITting (sec), User Time, System Time, Total Time, Working Set,
-Private Bytes, Virtual Bytes, Page Faults and CPU Load Average (1min,
-5min and 15min).
+\f[I]nocounters\f[]: disables sampling of runtime and performance
+counters, which is normally done every 1 second.
 .IP \[bu] 2
 \f[I]coverage\f[]: collect code coverage data. This implies enabling
 the \f[I]calls\f[] option.
+.IP \[bu] 2
+\f[I]onlycoverage\f[]: can only be used with \f[I]coverage\f[]. This
+disables most other events so that the profiler mostly only collects
+coverage data.
 .RE
 .SS Analyzing the profile data
 .PP
@@ -274,10 +248,6 @@ with the \f[I]--maxframes=NUM\f[] option:
 The stack trace info will be available if method enter/leave events
 have been recorded or if stack trace collection wasn't explicitly
 disabled with the \f[I]maxframes=0\f[] profiler option.
-Note that the profiler will collect up to 8 frames by default at
-specific events when the \f[I]nocalls\f[] option is used, so in
-that case, if more stack frames are required in mprof-report, a
-bigger value for maxframes when profiling must be used, too.
 .PP
 The \f[I]--traces\f[] option also controls the reverse reference
 feature in the heapshot report: for each class it reports how many
@@ -487,15 +457,6 @@ option: especially if the managed heap is big, since every object
 needs to be inspected.
 The \f[I]MODE\f[] parameter of the \f[I]heapshot\f[] option can be
 used to reduce the frequency of the heap shots.
-.IP "\f[I]Reduce the timestamp overhead\f[]" 4
-.Sp
-On many operating systems or architectures what actually slows down
-profiling is the function provided by the system to get timestamp
-information.
-The \f[I]time=fast\f[] profiler option can be usually used to speed
-up this operation, but, depending on the system, time accounting
-may have some level of approximation (though statistically the data
-should be still fairly valuable).
 .SS Dealing with the size of the data files
 .PP
 When collecting a lot of information about a profiled program, huge
index f33fcccf2d7635f498496404d5ed0dbadd8f1d56..14ad0cbd10c74283e2d25bc4cb1682d77c5dcb90 100644 (file)
@@ -41,7 +41,6 @@ DISTFILES = \
        executable.make                 \
        gensources.sh                   \
        library.make                    \
-       nunit-summary.xsl               \
        rules.make                      \
        tests.make                      \
        $(COMMON_SRCS:%=common/%)       \
index 145665799ccaaccd74e1c7a9617f8f1d725da98b..9e4fcf64a306bda16b94c324ae81371f7e951156 100644 (file)
@@ -10,7 +10,7 @@
 CODEPAGE = 65001
 
 RUNTIME_FLAGS = 
-TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-console.exe
+TEST_HARNESS = $(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-lite-console.exe
 MCS_FLAGS = 
 MBAS_FLAGS = $(PLATFORM_DEBUG_FLAGS)
 LIBRARY_FLAGS = /noconfig
index afcad223f8e969f9261f2d7c631a2b624beefbc7..8acb0f5df619f789fd717207654d9178d6d9d178 100644 (file)
@@ -42,7 +42,9 @@ executable_CLEAN_FILES += $(build_lib) $(build_lib).so $(build_lib).mdb $(build_
 
 makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag
 
+ifndef NO_BUILD
 all-local: $(the_lib) $(PROGRAM_config)
+endif
 
 install-local: all-local
 test-local: all-local
index e0c16f48e90558609352e080ed67c54f4e64b43e..e604beb8f75e5cdcf411a963970d3423f2f377c6 100644 (file)
@@ -316,8 +316,6 @@ endif
 library_CLEAN_FILES += $(PROFILE)_aot.log
 
 ifdef PLATFORM_AOT_SUFFIX
-Q_AOT=$(if $(V),,@echo "AOT     [$(PROFILE)] $(notdir $(@))";)
-
 $(the_lib)$(PLATFORM_AOT_SUFFIX): $(the_lib)
        $(Q_AOT) MONO_PATH='$(the_libdir_base)' > $(PROFILE)_$(LIBRARY_NAME)_aot.log 2>&1 $(RUNTIME) $(AOT_BUILD_FLAGS) --debug $(the_lib)
 
diff --git a/mcs/build/nunit-summary.xsl b/mcs/build/nunit-summary.xsl
deleted file mode 100644 (file)
index 70972ad..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output method='text'/>
-
-<xsl:template match="/">
-       <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="test-results">
-<xsl:text>Tests run: </xsl:text>
-<xsl:value-of select="@total"/>
-<xsl:text>, Failures: </xsl:text>
-<xsl:value-of select="@failures"/>
-<xsl:text>, Not run: </xsl:text>
-<xsl:value-of select="@not-run"/>
-<xsl:text>, Time: </xsl:text>
-<xsl:value-of select="test-suite/@time"/>
-<xsl:text> seconds
-</xsl:text>
-<xsl:text>
-</xsl:text>
-
-<xsl:if test="//test-suite[failure]"><xsl:text>Test Fixture SetUp Failures:
-</xsl:text></xsl:if>
-<xsl:apply-templates select="//test-suite[failure]"/>
-<xsl:if test="//test-case[failure]"><xsl:text>Test Case Failures:
-</xsl:text></xsl:if>
-<xsl:apply-templates select="//test-case[failure]"/>
-<xsl:if test="//test-case[@executed='False']"><xsl:text>Tests not run:
-</xsl:text></xsl:if>
-<xsl:apply-templates select="//test-case[@executed='False']"/>
-<xsl:text disable-output-escaping='yes'>&#xD;&#xA;</xsl:text>
-</xsl:template>
-
-<xsl:template match="test-case|test-suite">
-       <xsl:value-of select="position()"/><xsl:text>) </xsl:text>
-       <xsl:value-of select="@name"/>
-       <xsl:text> : </xsl:text>
-       <xsl:value-of select="child::node()/message"/>
-<xsl:text disable-output-escaping='yes'>&#xD;&#xA;</xsl:text>
-       <xsl:if test="failure">
-               <xsl:value-of select="failure/stack-trace"/>
-<xsl:text>
-</xsl:text>
-       </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
index bed99f53387d0a7b9860fcb5334478d926a22769..4f34c924f03258a9d7c7f0618f0b33c317e31826 100644 (file)
@@ -7,7 +7,7 @@ PLATFORM_DEBUG_FLAGS = /debug+ /debug:full
 PLATFORM_MCS_FLAGS = /nologo
 PLATFORM_RUNTIME = 
 PLATFORM_CORLIB = mscorlib.dll
-PLATFORM_TEST_HARNESS_EXCLUDES =
+PLATFORM_TEST_HARNESS_EXCLUDES = NotOnWindows,
 
 EXTERNAL_MCS = mcs
 EXTERNAL_MBAS = vbc.exe
index d9ff3b67dc9334f4b6727536b33ef219a08db150..bf52c7e791e9ec240a2e4790565f926dc450828a 100644 (file)
@@ -32,7 +32,6 @@ PROFILE_MCS_FLAGS = \
        $(PLATFORM_DEBUG_FLAGS)
 
 FRAMEWORK_VERSION = 2.1
-NUNIT_LITE = yes
 
 # the tuner takes care of the install
 NO_INSTALL = yes
index e4370cf4f985b188dc80ed333347e114bf4e24c1..ff9e0fd4536182d689f8530b5b40639e5983bfe3 100644 (file)
@@ -31,7 +31,8 @@ PROFILE_MCS_FLAGS = \
        -nowarn:1699 \
        -nostdlib \
        $(DEFAULT_REFERENCES) \
-       $(PLATFORM_DEBUG_FLAGS)
+       $(PLATFORM_DEBUG_FLAGS) \
+       $(MONOTOUCH_MCS_FLAGS)
 
 FRAMEWORK_VERSION = 2.1
 
@@ -39,3 +40,5 @@ FRAMEWORK_VERSION = 2.1
 NO_INSTALL = yes
 MOBILE_STATIC = yes
 MOBILE_PROFILE = yes
+
+PROFILE_DISABLE_BTLS=1
index 02c934b62e6ae89fb558f05a9bd942c4ecbfcc99..4bba2f421ac849b4f0869f32b72a1b4d57f51e3c 100644 (file)
@@ -8,3 +8,4 @@ NO_THREAD_ABORT=1
 NO_THREAD_SUSPEND_RESUME=1
 NO_MULTIPLE_APPDOMAINS=1
 NO_PROCESS_START=1
+NO_MONO_SECURITY=1
index cb6bf304b99fdfe255e5cc5ac78e0c8703090751..e826c7e7e31e1b734fbd5625532536f3184d787a 100644 (file)
@@ -9,3 +9,4 @@ NO_THREAD_SUSPEND_RESUME=1
 # The binding generator (bwatch) still needs to execute processes,
 # so we need a System.dll that can do that.
 #NO_PROCESS_START=1
+NO_MONO_SECURITY=1
index 50e8214884dfd91c975de9c1071304447aba3db5..ab1aa6fa0716e6afd0799f5764958fda7cde1e06 100644 (file)
@@ -28,10 +28,13 @@ PROFILE_MCS_FLAGS = \
        -nowarn:1699 \
        -nostdlib \
        $(DEFAULT_REFERENCES) \
-       $(PLATFORM_DEBUG_FLAGS)
+       $(PLATFORM_DEBUG_FLAGS) \
+       $(XAMMAC_MCS_FLAGS)
 
 FRAMEWORK_VERSION = 2.1
 NO_TEST = yes
 NO_INSTALL = yes
 MOBILE_DYNAMIC = yes
 MOBILE_PROFILE = yes
+
+PROFILE_DISABLE_BTLS=1
index 83bfc92fcb26b3dba7f4dac44c22de4506cb0e31..b9881fe64def8d8c9b90731784504d8780795474 100644 (file)
@@ -1,11 +1,14 @@
 include $(topdir)/build/profiles/net_4_x.make
+
 PROFILE_MCS_FLAGS += \
        -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
        -d:NO_SYSTEM_DRAWING_DEPENDENCY \
        -d:NO_WINFORMS_DEPENDENCY \
        -d:NO_SYSTEM_WEB_DEPENDENCY \
        -d:XAMMAC_4_5 \
-       -d:XAMARIN_MODERN
+       -d:XAMARIN_MODERN \
+       $(XAMMAC_MCS_FLAGS)
+
 XAMMAC_4_5=1
 NO_WINDOWS_BASE=1
 NO_SYSTEM_WEB_DEPENDENCY=1
@@ -15,3 +18,5 @@ NO_SYSTEM_DRAWING_DEPENDENCY=1
 NO_SYSTEM_SERVICEMODEL_ACTIVATION_DEPENDENCY=1
 NO_SYSTEM_DESIGN_DEPENDENCY=1
 NO_SYSTEM_DIRECTORY_SERVICES_DEPENDENCY=1
+
+PROFILE_DISABLE_BTLS=1
index ac3a476dfb1055fa46cad6cca78fddf90391d007..18e2739bb8686c2a0825af71c4b00c80fac53a49 100644 (file)
@@ -23,6 +23,7 @@ VERSION = 0.93
 Q=$(if $(V),,@)
 # echo -e "\\t" does not work on some systems, so use 5 spaces
 Q_MCS=$(if $(V),,@echo "MCS     [$(intermediate)$(PROFILE)] $(notdir $(@))";)
+Q_AOT=$(if $(V),,@echo "AOT     [$(intermediate)$(PROFILE)] $(notdir $(@))";)
 
 ifndef BUILD_TOOLS_PROFILE
 BUILD_TOOLS_PROFILE = build
@@ -116,22 +117,6 @@ endif
 
 include $(topdir)/build/profiles/$(PROFILE).make
 
-# If the profile is using nunit-lite, use it
-ifdef NUNIT_LITE
-TEST_HARNESS=$(topdir)/class/lib/$(PROFILE)/nunit-lite-console.exe
-endif
-
-# Make sure propagates
-export TEST_HARNESS
-
-# If the profile is using nunit-lite, use it
-ifdef NUNIT_LITE
-TEST_HARNESS=$(topdir)/class/lib/$(PROFILE)/nunit-lite-console.exe
-endif
-
-# Make sure propagates
-export TEST_HARNESS
-
 ifdef BCL_OPTIMIZE
 PROFILE_MCS_FLAGS += -optimize
 endif
@@ -179,7 +164,6 @@ STD_TARGETS = test run-test run-test-ondotnet clean install uninstall doc-update
 $(STD_TARGETS): %: do-%
 
 ifdef PLATFORM_AOT_SUFFIX
-AOT_PROFILE_ASSEMBLIES = $(shell cd $(topdir)/class/lib/$(PROFILE)/ && find . | grep -E '(dll|exe)$$' | grep -v -E 'bare|plaincore|secxml|Facades' | sed 's:\./::g' | tr '\n' ' ')
 
 do-all-aot:
        $(MAKE) do-all TOP_LEVEL_DO=do-all
@@ -190,18 +174,16 @@ do-all-aot:
 # be able to evaluate the .dylibs to make
 ifneq ("$(wildcard $(topdir)/class/lib/$(PROFILE))","")
 
-AOT_PROFILE_ASSEMBLIES_CMD = cd $(topdir)/class/lib/$(PROFILE)/ && find . | grep -E '(dll|exe)$$' | grep -v -E 'bare|plaincore|secxml|Facades|ilasm' | sed 's:\./::g' | tr '\n' ' '
-AOT_PROFILE_ASSEMBLIES_CMD_SAFE = $(AOT_PROFILE_ASSEMBLIES_CMD) || true
-AOT_PROFILE_ASSEMBLIES = $(shell $(AOT_PROFILE_ASSEMBLIES_CMD_SAFE))
+AOT_PROFILE_ASSEMBLIES := $(sort $(patsubst .//%,%,$(filter-out %bare% %plaincore% %secxml% %Facades% %ilasm%,$(filter %.dll %.exe,$(wildcard $(topdir)/class/lib/$(PROFILE)/*)))))
 
 # This can run in parallel
 .PHONY: aot-all-profile
-aot-all-profile: $(patsubst %,$(topdir)/class/lib/$(PROFILE)/%$(PLATFORM_AOT_SUFFIX),$(AOT_PROFILE_ASSEMBLIES))
+aot-all-profile: $(patsubst %,%$(PLATFORM_AOT_SUFFIX),$(AOT_PROFILE_ASSEMBLIES))
 
-$(topdir)/class/lib/$(PROFILE)/%$(PLATFORM_AOT_SUFFIX): $(topdir)/class/lib/$(PROFILE)/%
-       @ mkdir -p $(topdir)/class/lib/$(PROFILE)/$*_bitcode_tmp
-       @echo "AOT     [$(PROFILE)] AOT $* " && cd $(topdir)/class/lib/$(PROFILE)/ && MONO_PATH="." $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$*_bitcode_tmp $* >> $(PROFILE)-aot.log
-       @ rm -rf $(topdir)/class/lib/$(PROFILE)/$*_bitcode_tmp
+%$(PLATFORM_AOT_SUFFIX): %
+       @ mkdir -p $*_bitcode_tmp
+       $(Q_AOT) MONO_PATH="$(dir $*)" $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$*_bitcode_tmp --verbose $* > $@.aot-log
+       @ rm -rf $*_bitcode_tmp
 
 endif #ifneq ("$(wildcard $(topdir)/class/lib/$(PROFILE))","")
 
index 749b5a0faf4edbd8d29eb176582e397ec64db32c..d9f6a95ff72b5d1653e3a0f809d994029c3ee5cf 100644 (file)
@@ -19,11 +19,7 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
 ## Unit test support
 ifndef NO_TEST
 
-ifdef NUNIT_LITE
 test_nunit_lib = nunitlite.dll
-else
-test_nunit_lib = nunit.framework.dll nunit.core.dll nunit.util.dll nunit.mocks.dll
-endif
 
 TEST_LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/%.dll,$(TEST_LIB_REFS))
 
@@ -58,19 +54,11 @@ ifndef NO_TEST
 $(test_nunit_dep): $(topdir)/build/deps/nunit-$(PROFILE).stamp
        @if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi
 
-ifdef NUNIT_LITE
 $(topdir)/build/deps/nunit-$(PROFILE).stamp:
 ifndef PARENT_PROFILE
        cd ${topdir}/tools/nunit-lite && $(MAKE)
 endif
        echo "stamp" >$@
-else
-$(topdir)/build/deps/nunit-$(PROFILE).stamp:
-ifndef PARENT_PROFILE
-       cd ${topdir}/nunit24 && $(MAKE)
-endif
-       echo "stamp" >$@
-endif
 
 tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
 endif
@@ -90,52 +78,18 @@ run-test-ondotnet-local: run-test-ondotnet-lib
 TEST_HARNESS_EXCLUDES = -exclude=$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotWorking,ValueAdd,CAS,InetAccess
 TEST_HARNESS_EXCLUDES_ONDOTNET = /exclude:$(PLATFORM_TEST_HARNESS_EXCLUDES)$(PROFILE_TEST_HARNESS_EXCLUDES)NotDotNet,CAS
 
-ifdef NUNIT_LITE
 NOSHADOW_FLAG =
-NUNIT_XML_FLAG = -format:nunit2 -result:
-OUTPUT_FILE_FLAG=-out
-else
-OUTPUT_FILE_FLAG=-output
-NOSHADOW_FLAG = -noshadow
-NUNIT_XML_FLAG = -xml=
-endif
-
-ifdef NUNIT_LITE
-NOSHADOW_FLAG =
-NUNIT_XML_FLAG = -format:nunit2 -result:
-OUTPUT_FILE_FLAG=-out
-else
-OUTPUT_FILE_FLAG=-output
-NOSHADOW_FLAG = -noshadow
-NUNIT_XML_FLAG = -xml=
-endif
-
-ifdef TEST_HARNESS_VERBOSE
-TEST_HARNESS_OUTPUT = -labels
-TEST_HARNESS_OUTPUT_ONDOTNET = -labels
-TEST_HARNESS_POSTPROC = :
-TEST_HARNESS_POSTPROC_ONDOTNET = :
-else
-TEST_HARNESS_OUTPUT = $(OUTPUT_FILE_FLAG)=TestResult-$(PROFILE).log
-TEST_HARNESS_OUTPUT_ONDOTNET = $(OUTPUT_FILE_FLAG)=TestResult-ondotnet-$(PROFILE).log
-TEST_HARNESS_POSTPROC = (echo ''; cat TestResult-$(PROFILE).log) | sed '1,/^Tests run: /d'; xsltproc $(topdir)/build/nunit-summary.xsl TestResult-$(PROFILE).xml >> TestResult-$(PROFILE).log
-TEST_HARNESS_POSTPROC_ONDOTNET = (echo ''; cat TestResult-ondotnet-$(PROFILE).log) | sed '1,/^Tests run: /d'; xsltproc $(topdir)/build/nunit-summary.xsl TestResult-ondotnet-$(PROFILE).xml >> TestResult-ondotnet-$(PROFILE).log
-endif
 
 ifdef FIXTURE
-ifdef NUNIT_LITE
 FIXTURE_ARG = -test=MonoTests.$(FIXTURE)
-else
-FIXTURE_ARG = -fixture=MonoTests.$(FIXTURE)
-endif
 endif
 
 ifdef TESTNAME
-ifdef NUNIT_LITE
 TESTNAME_ARG = -test=MonoTests.$(TESTNAME)
-else
-TESTNAME_ARG = -run=MonoTests.$(TESTNAME)
 endif
+
+ifdef TEST_HARNESS_VERBOSE
+LABELS_ARG = -labels
 endif
 
 ifdef ALWAYS_AOT
@@ -147,19 +101,30 @@ test-local-aot-compile: $(topdir)/build/deps/nunit-$(PROFILE).stamp
 
 endif # ALWAYS_AOT
 
+NUNITLITE_CONFIG_FILE=$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)nunit-lite-console.exe.config
+
+patch-nunitlite-appconfig:
+       cp -f $(topdir)/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl $(NUNITLITE_CONFIG_FILE)
+ifdef TEST_NUNITLITE_APP_CONFIG_GLOBAL
+       sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_GLOBAL__/r $(TEST_NUNITLITE_APP_CONFIG_GLOBAL)" $(NUNITLITE_CONFIG_FILE)
+endif
+ifdef TEST_NUNITLITE_APP_CONFIG_RUNTIME
+       sed -i -e "/__INSERT_CUSTOM_APP_CONFIG_RUNTIME__/r $(TEST_NUNITLITE_APP_CONFIG_RUNTIME)" $(NUNITLITE_CONFIG_FILE)
+endif
+
 ## FIXME: i18n problem in the 'sed' command below
-run-test-lib: test-local test-local-aot-compile
+run-test-lib: test-local test-local-aot-compile patch-nunitlite-appconfig
        ok=:; \
-       PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) $(NUNIT_XML_FLAG)TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
+       PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(AOT_RUN_FLAGS) $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
        if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
-       $(TEST_HARNESS_POSTPROC) ; $$ok
+       $$ok
 
 ## Instructs compiler to compile to target .net execution, it can be usefull in rare cases when runtime detection is not possible
 run-test-ondotnet-lib: LOCAL_TEST_COMPILER_ONDOTNET_FLAGS:=-d:RUN_ONDOTNET
 run-test-ondotnet-lib: test-local
        ok=:; \
-       $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS) $(TEST_HARNESS_EXCLUDES_ONDOTNET) $(TEST_HARNESS_OUTPUT_ONDOTNET) $(NUNIT_XML_FLAG)=TestResult-ondotnet-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG) || ok=false; \
-       $(TEST_HARNESS_POSTPROC_ONDOTNET) ; $$ok
+       $(TEST_HARNESS) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS) $(TEST_HARNESS_EXCLUDES_ONDOTNET) $(LABELS_ARG) -format:nunit2 -result:TestResult-ondotnet-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG) || ok=false; \
+       $$ok
 
 
 endif # test_assemblies
@@ -194,3 +159,4 @@ $(test_makefrag): $(test_response)
 
 endif
 
+.PHONY: patch-nunitlite-appconfig
index 50cdfcf6868455e673ebabebbce2a6bd2463a192..6c2d3e78933177af0d432f38c23d704a831480b4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2539a5b4b18c3ab5907432eedf73d113a3b8b53d..49b15881e839cab6fa8b19408236f3537905b209 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2c40504aa6351c064685cbf3d0d647b459cbb9cd..4170af9dbc75aa3ecde29b204ecda5a56b64dad7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index bf2bc3fb53392e1f95933a009cfc1a73be4c197e..9aa53511751087a1ff89825377feccb99978f4c1 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index ef4329f1ed1651b063c7f75433942c7f959ce4a0..d42d2f56aceb3fe7f040738faffd02922d11908b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1bca67282f6da67a9c265b87180d2efbb76f547e..a595068c811769babbad596ace775d60fda0cda4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -54,7 +55,9 @@
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="RegistryAclExtensions.cs" />\r
     <Compile Include="TypeForwarders.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
index 5189fe3c1ad9dd1b256172b9821afac1c19b2e51..96fdc26a70b2259eb17cdd7a338d21473f68cffa 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3980a552ddc2b8aad35c6f6b533ca7f019923a42..a1905271772d135403e2954b823faa25072bc7c5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index eee52ccc352be132c97668daafbb3fbd176c2ea5..45a6552cf0f829a07df1c24ec823d4aa2805f3b3 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a7e0139702fdfc1c2599e014ec02f09cb20f2c67..00b42fe684edb27eb45129ea4ed3f28020ed906d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 44e2fc91c581000f5af83d4984d4b4d716973e38..cecbabf92374825b92445c53dce1b76be5ccc42d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c3eb239218a40ec2208cdeb378f65f310e98a374..847b7db67153187d2b5f3a51508c08f27c577146 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a0d3c1b52b02f21e168a7871db5f31aaccc61e61..2b0e3d7a0f30b760615c21f5a7b4a5a68797544c 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index cbeca4b58869d333c35ad5c78d317c77197cde0e..cb34e0aa7978f4e4990df8ed2ce09c62d85eea3f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 65e0f7e3271c205df13572d6cb203facb29c5da2..c6931fd8deb2d6abb1e0fd349788face494dd397 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index aea55676326c0896383a095f4852dc473700df10..4124bc5e6fd11fe432cb0df78badbf06a5f2e804 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a1a92d79df8d9f62075d6b1b450c79195c3e54b7..5dcdc33d6fe44ca99870b389712e393ab3684ee8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c42832bf3a4d159a9ea9693cae7237c78bb1ca87..92f6b22bf9aa674b39eff137cfb9d54279312183 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 493303cc15ec906a14e54fd18a2a621dca26c829..6644d0f7dc5c5f32a6fb9792bce69ba4b817d619 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -55,6 +56,9 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="DbColumn.cs" />\r
+    <Compile Include="DbDataReaderExtensions.Facade.cs" />\r
+    <Compile Include="IDbColumnSchemaGenerator.cs" />\r
     <Compile Include="TypeForwarders.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
       <Project>{EC439BB8-FFED-4A32-A05D-2FA3A70CAD64}</Project>\r
       <Name>System.Data-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../../System.XML/System.Xml-net_4_x.csproj">\r
+      <Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
+      <Name>System.Xml-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index 3427bb006e938667d4256e9f89bd02b1f0edb79b..293f05c3ee9b4585d3b4a89cab17d5e905c462fa 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 72f03e89c83d80eb417a326407f379f37fd6dc70..e0a1c56c40135b7e6a378f1cf84851813f85aa53 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 5de4c3cd3b7d68d8a5bb956c5c51402433673693..66611591bff0db877014215b974941200ae48684 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e8db26624c340b0cfba90efec96e360f6e42b63f..2ddf7e98eb2e61df75968869bd74d42dc2b709ea 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 210e44530fa073ab5bed443ad33164754fe40355..daa2f78a5ea628532d0429e35aa8cf24d549cb6b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9d1c6f14752dc35a0aa108f1e177babe420c7c13..bd145c9ef3a49c7cfbfb812c18491788ba52d056 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -54,7 +55,9 @@
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="StackFrameExtensions.cs" />\r
     <Compile Include="TypeForwarders.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
index fb2f1485d876758afc65cc09e5a0fe04af71134c..5508fbdf3c55c6bc81bacbc25209a6b7af7ef1f3 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 5d1e6d7135dd47eb1965187f8dca67af1d32e018..a3cfde6c2e1d0dd0f96f9f8f9b099e240f2e4cfb 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f31a1fc6a5541755ec858f3e0752eede938708f8..00aa1cf01c5438357d17733fd2f5dacae02537a3 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7003052edfdd6c45faa21a9a8a8f64e3a26510cc..d8d91f90f017b2526cc02046382ee356f145c8a5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs b/mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs
deleted file mode 100644 (file)
index 7fedc40..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// EventCounter.cs
-//
-// 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.
-//
-
-namespace System.Diagnostics.Tracing
-{
-       public class EventCounter
-       {
-               public EventCounter (string name, EventSource eventSource)
-               {
-               }
-
-               public void WriteMetric (float value)
-               {
-               }
-       }
-}
\ No newline at end of file
index 73d08a19bd1819928c7ae99f008a6d699c23233a..14b559585dd00979f180f0341dde767e5b0f0749 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 5c8ab29d77aeb95e7a9fcceeec94fccc04ccecdb..2e4028199f1e1cd52121eef23153f59452851a6c 100644 (file)
@@ -44,3 +44,7 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventTask))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventWrittenEventArgs))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.NonEventAttribute))]
+
+#if NETSTANDARD
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventCounter))]
+#endif
diff --git a/mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives-net_4_x.csproj b/mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives-net_4_x.csproj
new file mode 100644 (file)
index 0000000..2dcbe57
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\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>{1AFDB281-5FB8-48A9-8694-7F515D835862}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <NoWarn>1699,1616,1699</NoWarn>\r
+    <OutputPath>./../../../class/lib/net_4_x/Facades</OutputPath>\r
+    <IntermediateOutputPath>obj-Facades</IntermediateOutputPath>\r
+    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
+    <NoStdLib>True</NoStdLib>\r
+    \r
+    <NoConfig>True</NoConfig>\r
+    \r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>\r
+    </RootNamespace>\r
+    <AssemblyName>System.Drawing.Primitives</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>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <NoWarn>1699,1616,1699</NoWarn>\r
+    <Optimize>false</Optimize>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</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,1616,1699</NoWarn>\r
+    <Optimize>true</Optimize>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</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="AssemblyInfo.cs" />\r
+    <Compile Include="TypeForwarders.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="../../System.Drawing/System.Drawing-net_4_x.csproj">\r
+      <Project>{584A5E46-2958-4CB2-8DF9-188B420D0BB0}</Project>\r
+      <Name>System.Drawing-net_4_x</Name>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Folder Include="Properties\" />\r
+  </ItemGroup>\r
+</Project>\r
+
index 076b4d9bfa0ac93bb6e08f71c0df53ec3147817f..a2700a7220645f3e64a375b1575ccea2f0f94ef1 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d0aa63ef3cf82da9c7fbdbdead442cc5046b8624..d213697785c1891055288a0924d1fce6a761f3a9 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 662128772641f3cae697a1b0e728c7a50f989730..b7d9e785a5d485a737b7d55be5c89369aa443dc8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="GlobalizationExtensions.cs" />\r
+    <Compile Include="SR.cs" />\r
+    <Compile Include="StringNormalizationExtensions.cs" />\r
     <Compile Include="TypeForwarders.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
index d3117287fbca38b224d4bbde00967369ca809b1d..cc423937805497e2be25f638c22ea620ae841bb1 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 4423a9dc9a4a3e09e7c691b45227bd865b208534..12fa724778888c8e4cdab7cd86dd43477f8a45b0 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0f9d44c9cd40cfedd6a28e42d52331d02236ab24..f4091941d7ec1b698811c5da684188dfc0666ed6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -54,7 +55,9 @@
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="FileSystemAclExtensions.cs" />\r
     <Compile Include="TypeForwarders.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
index 5edbbbb80347b137bb83e2bfa0bb985e0f6b4778..04dd9296063812c09422178eba8cfb49161e2072 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 98c67e82710ef515ea18f601007b1f30b55739b6..aa4e67663420a015422c5d26a7a75b7c3c1210f5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 75fe3913f4ea3c52cf87189bce48b0eb0dcbf514..034d4b0622f4ed595ff1129f9999eadd147b4e7e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 34784bd92b7419b5f5f20fe63b98f17b4c193629..d7a1c1a302e5018cdc31a7f31855d1659cf5121e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 866e14f1a16e3734c92652ccfdecc6c8452b1038..5b536287b3ce943cf6ff61a5e3a659814707e713 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3e44aef460638d8aab34147679adde227599c33f..837abbb60c26aa930cfd0a3a632e9e3cda475517 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 71c4350a6e7c20e1867e6b1c32d3e493203dce84..36b10921a0430aaa0c0ae108a386abf44fb54423 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c65751b53886e1c32a582901ec424f35bcb32a40..d29a8e64ae8346ecc0dd9e7b0b04e61d7afb3a22 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index da00e74eff75fba850356d516f3af781c8ae6393..405420df34294708b5bd9b8e0e15deb4c2f57c9a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e7c6951666baa12a800cd06d961ab12adff0494b..00be9add982011140299632de9f58ce97f6c9b64 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index de83417856b9f6a86c74409a9e3593229836fee9..f2713341989018b68dc127339b547970069f10b1 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3aa8b75ec1f4a81648903dd966e7597d03515777..22ea547e6680c6d2e4efce49e8e53e33a41bf779 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9c29c3428fd68336d93598fd0569b8380e8e362d..40bcaee9233eca10e425d5024ad89a6a52c15b70 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index b14fcb89dc591150f40b0a66591ab7577805e667..f65bf881df02b1d0afc8b4aee89e925e11545ef9 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 5ff7c8612a0e4c6dcaa84b6cac0aec52ae9b4db7..4ae4bfd23f1d88fba1ec492b2fec697577223d35 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9c59776987caa43f66a7f1c1c3aee48e8ef81b1c..d28fccfab73c8ac4859c3bd8b0b5cc1ff04d41c9 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f38a0d52aa5f3b3fd1a258a33a0d841b853fdbf9..2185b99006bb59201e437ce1445cacbf53682d7f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 35e6e9a6d32a27560d162550ad17fe3b9fd8f17b..be4d1f8bf9920c91ca7ad3804b214b93f1f6f41d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 042d7ace4fc259801e1e0d1e056b62d2e27945e5..92978cdf378c151c9d4df0f17bf3345daa460273 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index aa3200543918b9cb6a55550d132bb9d3b2c2f53c..d9946d004caa6070dabc97be00a9ffca80e4e75c 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9d81ac997087f150a62f9d42bccfac4d5b726cfe..f4df4890d27c6e95c73ca291b36884cc55fe3b56 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 346a8c821b9f9c189769e64550ad854b165d39d7..7a122c3ba3b8d1988c0a22403a67d20ddf2dcfb0 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index db14b8d3b4ab3e27cfb1afbaf89bc9ceda6bb7d8..39768cc784dc3efa8ff04397466b2ed5469127d4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index ca762d98f2d89af49aca3509a01130414874deb1..29de027958f0b48a0138fe24c7d79cc36597036a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs b/mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs
deleted file mode 100644 (file)
index 2add0e6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// SocketReceiveFromResult.cs
-//
-// 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.
-//
-
-namespace System.Net.Sockets
-{
-       public struct SocketReceiveFromResult
-       {
-               public int ReceivedBytes;
-               public EndPoint RemoteEndPoint;
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs b/mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs
deleted file mode 100644 (file)
index ab5ed10..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// SocketReceiveMessageFromResult.cs
-//
-// 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.
-//
-
-namespace System.Net.Sockets
-{
-       public struct SocketReceiveMessageFromResult
-       {
-               public int ReceivedBytes;
-               public SocketFlags SocketFlags;
-               public EndPoint RemoteEndPoint;
-               public IPPacketInformation PacketInformation;
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs b/mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs
deleted file mode 100644 (file)
index c0665fc..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace System.Net.Sockets
-{
-    public static class SocketTaskExtensions
-    {
-        public static Task<Socket> AcceptAsync(this Socket socket)
-        {
-            return Task<Socket>.Factory.FromAsync(
-                (callback, state) => ((Socket)state).BeginAccept(callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
-                state: socket);
-        }
-
-        public static Task<Socket> AcceptAsync(this Socket socket, Socket acceptSocket)
-        {
-            const int ReceiveSize = 0;
-            return Task<Socket>.Factory.FromAsync(
-                (socketForAccept, receiveSize, callback, state) => ((Socket)state).BeginAccept(socketForAccept, receiveSize, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
-                acceptSocket,
-                ReceiveSize,
-                state: socket);
-        }
-
-        public static Task ConnectAsync(this Socket socket, EndPoint remoteEP)
-        {
-            return Task.Factory.FromAsync(
-                (targetEndPoint, callback, state) => ((Socket)state).BeginConnect(targetEndPoint, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
-                remoteEP,
-                state: socket);
-        }
-
-        public static Task ConnectAsync(this Socket socket, IPAddress address, int port)
-        {
-            return Task.Factory.FromAsync(
-                (targetAddress, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddress, targetPort, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
-                address,
-                port,
-                state: socket);
-        }
-
-        public static Task ConnectAsync(this Socket socket, IPAddress[] addresses, int port)
-        {
-            return Task.Factory.FromAsync(
-                (targetAddresses, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddresses, targetPort, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
-                addresses,
-                port,
-                state: socket);
-        }
-
-        public static Task ConnectAsync(this Socket socket, string host, int port)
-        {
-            return Task.Factory.FromAsync(
-                (targetHost, targetPort, callback, state) => ((Socket)state).BeginConnect(targetHost, targetPort, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
-                host,
-                port,
-                state: socket);
-        }
-
-        public static Task<int> ReceiveAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffer, flags, callback, state) => ((Socket)state).BeginReceive(
-                                                              targetBuffer.Array,
-                                                              targetBuffer.Offset,
-                                                              targetBuffer.Count,
-                                                              flags,
-                                                              callback,
-                                                              state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
-                buffer,
-                socketFlags,
-                state: socket);
-        }
-
-        public static Task<int> ReceiveAsync(
-            this Socket socket,
-            IList<ArraySegment<byte>> buffers,
-            SocketFlags socketFlags)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffers, flags, callback, state) => ((Socket)state).BeginReceive(targetBuffers, flags, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
-                buffers,
-                socketFlags,
-                state: socket);
-        }
-
-        public static Task<SocketReceiveFromResult> ReceiveFromAsync(
-            this Socket socket,
-            ArraySegment<byte> buffer,
-            SocketFlags socketFlags,
-            EndPoint remoteEndPoint)
-        {
-            object[] packedArguments = new object[] { socket, remoteEndPoint };
-
-            return Task<SocketReceiveFromResult>.Factory.FromAsync(
-                (targetBuffer, flags, callback, state) =>
-                {
-                    var arguments = (object[])state;
-                    var s = (Socket)arguments[0];
-                    var e = (EndPoint)arguments[1];
-
-                    IAsyncResult result = s.BeginReceiveFrom(
-                        targetBuffer.Array,
-                        targetBuffer.Offset,
-                        targetBuffer.Count,
-                        flags,
-                        ref e,
-                        callback,
-                        state);
-
-                    arguments[1] = e;
-                    return result;
-                },
-                asyncResult =>
-                {
-                    var arguments = (object[])asyncResult.AsyncState;
-                    var s = (Socket)arguments[0];
-                    var e = (EndPoint)arguments[1];
-
-                    int bytesReceived = s.EndReceiveFrom(asyncResult, ref e);
-
-                    return new SocketReceiveFromResult()
-                    {
-                        ReceivedBytes = bytesReceived,
-                        RemoteEndPoint = e
-                    };
-                },
-                buffer,
-                socketFlags,
-                state: packedArguments);
-        }
-
-        public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(
-            this Socket socket,
-            ArraySegment<byte> buffer,
-            SocketFlags socketFlags,
-            EndPoint remoteEndPoint)
-        {
-            object[] packedArguments = new object[] { socket, socketFlags, remoteEndPoint };
-
-            return Task<SocketReceiveMessageFromResult>.Factory.FromAsync(
-                (targetBuffer, callback, state) =>
-                {
-                    var arguments = (object[])state;
-                    var s = (Socket)arguments[0];
-                    var f = (SocketFlags)arguments[1];
-                    var e = (EndPoint)arguments[2];
-
-                    IAsyncResult result = s.BeginReceiveMessageFrom(
-                        targetBuffer.Array,
-                        targetBuffer.Offset,
-                        targetBuffer.Count,
-                        f,
-                        ref e,
-                        callback,
-                        state);
-
-                    arguments[2] = e;
-                    return result;
-                },
-                asyncResult =>
-                {
-                    var arguments = (object[])asyncResult.AsyncState;
-                    var s = (Socket)arguments[0];
-                    var f = (SocketFlags)arguments[1];
-                    var e = (EndPoint)arguments[2];
-                    IPPacketInformation ipPacket;
-
-                    int bytesReceived = s.EndReceiveMessageFrom(
-                        asyncResult,
-                        ref f,
-                        ref e,
-                        out ipPacket);
-
-                    return new SocketReceiveMessageFromResult()
-                    {
-                        PacketInformation = ipPacket,
-                        ReceivedBytes = bytesReceived,
-                        RemoteEndPoint = e,
-                        SocketFlags = f
-                    };
-                },
-                buffer,
-                state: packedArguments);
-        }
-
-        public static Task<int> SendAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffer, flags, callback, state) => ((Socket)state).BeginSend(
-                                                              targetBuffer.Array,
-                                                              targetBuffer.Offset,
-                                                              targetBuffer.Count,
-                                                              flags,
-                                                              callback,
-                                                              state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
-                buffer,
-                socketFlags,
-                state: socket);
-        }
-
-        public static Task<int> SendAsync(
-            this Socket socket,
-            IList<ArraySegment<byte>> buffers,
-            SocketFlags socketFlags)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffers, flags, callback, state) => ((Socket)state).BeginSend(targetBuffers, flags, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
-                buffers,
-                socketFlags,
-                state: socket);
-        }
-
-        public static Task<int> SendToAsync(
-            this Socket socket,
-            ArraySegment<byte> buffer,
-            SocketFlags socketFlags,
-            EndPoint remoteEP)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffer, flags, endPoint, callback, state) => ((Socket)state).BeginSendTo(
-                                                                        targetBuffer.Array,
-                                                                        targetBuffer.Offset,
-                                                                        targetBuffer.Count,
-                                                                        flags,
-                                                                        endPoint,
-                                                                        callback,
-                                                                        state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndSendTo(asyncResult),
-                buffer,
-                socketFlags,
-                remoteEP,
-                state: socket);
-        }
-    }
-}
\ No newline at end of file
index a4cab35a66bc194d0b4d44ce6aba3335088ac771..719628dc7c61ac7d0444434320134bf5305b7f73 100644 (file)
@@ -1,5 +1,2 @@
 TypeForwarders.cs
 AssemblyInfo.cs
-SocketReceiveFromResult.cs
-SocketReceiveMessageFromResult.cs
-SocketTaskExtensions.cs
index b27fc8622edeb847c80c6c19bac7d981af2942e5..27258a0831aaea109cbb2b1420fa396ee1cc6147 100644 (file)
@@ -46,4 +46,8 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.UdpClient))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.UdpReceiveResult))]
 
-
+#if NETSTANDARD
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketReceiveFromResult))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketReceiveMessageFromResult))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketTaskExtensions))]
+#endif
index 1372878cd18e26f69a40c9b714ab02246bad444f..547a249ed6b5f9e6ce5f6c7f3d4193cb8713e0a2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3a298830e16696ccb3f84527a9d06e4359c8e1f5..235fccd7523278f65cd4d5b7ba1412decff16c2a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 11199656414794790d3704a3de44e000cb6f5678..9c8cdc598c166650b0b2cddb23d03ede1975f567 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0103faa7236152f7c62878f87d936f7d827eadf0..434cb97e887c4ef4ccefef57c6db68c7b0a1b25a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e1230f83e0f2c966e13a586da2ea81e0def0128d..f09b67456af2a160db77550b3c34c10d52697d29 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3f6502b6e7a2a0b44463be2802fa3f28cba52435..5c638d1138dbcc0c8ac61ef1df02b04e3e491c57 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 28c20187cf4de525314baba44a38b3038b95b352..94414cdca10d7e905cf445ee8269c95e07ff4379 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -55,6 +56,7 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="DynamicMethod.cs" />\r
     <Compile Include="TypeForwarders.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
index e407d0fd9c7825ed41de42d80017ed782c091421..2414792a1bc61fbe9f88a906213e81dd3e540215 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 5a41690bc62c94b1d919e03c4bdd86bd62659cd3..c0fd89780ec8f608f29574874cb54b6b19593df8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9b883b5f9d788d085bd3b52391f97219fa8d1639..bb0034319643e4df5719ebeba902580eef6250eb 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2030414734b675bdfeb4fbb1663f37b26627f3c8..08fbc861da352571d3d293779d556bc6ec070a23 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -55,6 +56,9 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="Requires.cs" />\r
+    <Compile Include="SR.cs" />\r
+    <Compile Include="TypeExtensions.CoreCLR.cs" />\r
     <Compile Include="TypeForwarders.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
index 98be695bc274eb11047cf63ab7f9861d1b9b23d7..a7cea643721db6f89a1aeac92f21c893fdca99f3 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index eaafdd2b4b60df04720d5c3cc0219f3a3f57d62e..9ecbd892aa52b6d0de04b7a689c5c49985f464ef 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e40ceea68096b110e6bb3d8161e0332df38c6979..2c33abedf3b38d1383a4e92f731936285300451f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f3b9b2dadbd3ad659e09c6be1c2d81b126e38473..d8689a5402b44cce6ffa273b3adafcd0de7e61b5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f00748c40fa8d979c416ac6c6e50035daaa7aa4e..48177dcea8d87bf2feb34ffa26842b5f2026678a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d29f79f2d6c8e204bf6c5573ec3f0ad87e7056aa..3de001c94a3cb43ad38ea0b614101d8a35ea68fd 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0dddc7ef0a7454024c3cbf7b414273c5251f14cc..a5e8e4802fe78f76437c0ae27c25ecbe42909c77 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7011c5559d7f022611bd5624ed2e031b8bde1fa9..04c6b684710b09620895846d4e81075d918bbbdb 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a82e8d24fb4044a30ef7abf9fd234442fef0677c..c6a5d2f2032e268f77ef453aabcd3211fb38e954 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 18a14af836bc321c47cad65d8369c6108487e2a9..6d1e37cfb6ed0ae8470bc05a9a85dd7b8aa654f9 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 71204dcabbd6d8c4fedbfefd37151f115e604e24..da81f5d106c1d3a06dbc0b39f38bdbe026eef4f2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -55,6 +56,7 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="ISerializationSurrogateProvider.cs" />\r
     <Compile Include="TypeForwarders.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
index 058a3e642197a0027dbc590b7f7898153ed7bc0c..6fd12c8ca4b8c78dce367ed2a79a465368514e07 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -55,6 +56,8 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="DataContractSerializerExtensions.cs" />\r
+    <Compile Include="NotImplemented.cs" />\r
     <Compile Include="TypeForwarders.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
       <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="../../System.Runtime.Serialization/System.Runtime.Serialization-net_4_x.csproj">\r
       <Project>{D845AD9D-3CCB-49CB-9543-028678E94938}</Project>\r
       <Name>System.Runtime.Serialization-net_4_x</Name>\r
       <Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
       <Name>System.Xml-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../System.Runtime.Serialization.Primitives/Facades_System.Runtime.Serialization.Primitives-net_4_x.csproj">\r
+      <Project>{49BB9015-6989-4BD0-AF82-9184BE637D57}</Project>\r
+      <Name>Facades_System.Runtime.Serialization.Primitives-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index d88f7bba8c654ad01ac494b7162266ef99e0b6b1..d31e708ecff2553f6799b9adf887c8736777813f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 546f03f9c7cae8fb50b05f134b3d4842b75d270a..dbd68e93933b6bb824f84172b320dcc9a2febc78 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 341cad800eeca907e8e10c79816f45aa604b1aa0..c99535c6ea5293481042840973fe655734af2273 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3c274abb796468105212f8566dee5b779a2f9265..b95c6d9cc632f8d7045cbce8d833f6bcf7550064 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 20640b091c8888c9489aa5ad2cf58a93ff690333..fb417c923d5c49813a96d36f6e7e7bf876295e84 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a523ca9926323bed1c24e3effba3d27267e8b100..3d5217932ea9bf5bf700df83d590e675ee4eb086 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 268dc0f5926ea92f5d2e498cf743b6f5c5f15a00..71acd0d43f6ce28088072ce02608ffed2acfe1c9 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1608821c77b2d9b41022fc531da38740b488857f..66c5636cbdd9160fb8351bd30c9b78cf770a2b53 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c331d66a40ad313a1e43c98144bd36f3646541be..935d24713c578390559eb377d78876fcb03fd594 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 098c162409a25d264746403cf24419c03911e7d7..7a47f7f2c8d606f38ca65d3b4da6ceb6a95cc2f7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9865a1540f82d5bc5d30bbc1f357e09a704d6e67..85ec31d33c03bea3ba88d355bc5bbf5d315a4fe4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/Facades/System.Security.Cryptography.Primitives/Facades_System.Security.Cryptography.Primitives-net_4_x.csproj b/mcs/class/Facades/System.Security.Cryptography.Primitives/Facades_System.Security.Cryptography.Primitives-net_4_x.csproj
new file mode 100644 (file)
index 0000000..861c826
--- /dev/null
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\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>{62880D99-1C4C-4D38-A8FE-57EF2C9E2150}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <NoWarn>1699,1616,1699</NoWarn>\r
+    <OutputPath>./../../../class/lib/net_4_x/Facades</OutputPath>\r
+    <IntermediateOutputPath>obj-Facades</IntermediateOutputPath>\r
+    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
+    <NoStdLib>True</NoStdLib>\r
+    \r
+    <NoConfig>True</NoConfig>\r
+    \r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>\r
+    </RootNamespace>\r
+    <AssemblyName>System.Security.Cryptography.Primitives</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>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <NoWarn>1699,1616,1699</NoWarn>\r
+    <Optimize>false</Optimize>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</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,1616,1699</NoWarn>\r
+    <Optimize>true</Optimize>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</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="AssemblyInfo.cs" />\r
+    <Compile Include="TypeForwarders.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
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Folder Include="Properties\" />\r
+  </ItemGroup>\r
+</Project>\r
+
index 53e18fa4825430406654467d66ebad8c7e6b10c5..71bbfb4497af5a038cad7f2e75a7556ce0bb54fe 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1f6584376e92e39c2beeef060ba893551b9d8a57..d6fee2805006df4e073cbe74189c2f7dcf4bfc6f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3b0e5112389c7a70d1472def7c0607361b91e6f2..996edbfafdc27e648163c31feb0dad3da16c032d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0a126a61c73191792605cae1074dc858ae86c585..aa8360ca4c583eb12e6f0ad0540351691b8492a8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
       <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
       <Name>System-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../../System.Core/System.Core-net_4_x.csproj">\r
+      <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
+      <Name>System.Core-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index 18aa2ae6185a6f3555e3adb5d3cbe0dce8787f23..b405e5d8b5f089ada8c4049b145c2b7bde707105 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 53c26f634d146ebf9a68534fe703b1392394c8f0..d0d85ae5e386308b4d8c608ae0838c0e0e9cafc2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7e2fc1e0a8656368b91f77aa3c19870a3f1e256d..dfa35af23b9f078d91b0c0adc0916f0928b42dc6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -55,6 +56,7 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="SecureStringMarshal.cs" />\r
     <Compile Include="TypeForwarders.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
index 3a098dcdfc2955aef7c0233e4f6cb3677e850e3a..36cda8836d3eb12e1166120fde3e5bee51a282b2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d830d0e08438a3f08c2fcf4a49b25eab9970c16e..001b5b3e4dd2ee6e769108e0d235189f236ec172 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0b25b6be19eae86a64166ae03e541be4605577e3..c11821d4869759c887e49693aba9435ad7b66ef8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1508ff5d41a0377da44a29f08a847320b0e0020a..87d9672136f91d156c1e34f8f8971864baa2e757 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\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="../../System.ServiceModel/System.ServiceModel-net_4_x.csproj">\r
       <Project>{FE596C31-BDA2-4850-8F79-F8F4DF70F44A}</Project>\r
       <Name>System.ServiceModel-net_4_x</Name>\r
       <Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
       <Name>System.Xml-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../../System.IdentityModel/System.IdentityModel-net_4_x.csproj">\r
+      <Project>{FA718FA9-32C2-4BAC-BAAB-DB3A7A326D4C}</Project>\r
+      <Name>System.IdentityModel-net_4_x</Name>\r
+    </ProjectReference>\r
+    <ProjectReference Include="../System.Security.Cryptography.X509Certificates/Facades_System.Security.Cryptography.X509Certificates-net_4_x.csproj">\r
+      <Project>{C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}</Project>\r
+      <Name>Facades_System.Security.Cryptography.X509Certificates-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index 05cafee86eb8ba471b1c6bdae82d8aeb0ab39ddf..5650c020eec97a4018a5d064ddb91b001f24af75 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 4eedc26e62d9278328420893a73a086f1eb276c8..414a299a75aa5791d5e0ee825ac58ee139eca783 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="ServiceController_mobile.cs" />\r
+    <Compile Include="ServiceControllerStatus_mobile.cs" />\r
+    <Compile Include="ServiceStartMode_mobile.cs" />\r
+    <Compile Include="ServiceType_mobile.cs" />\r
+    <Compile Include="TimeoutException_mobile.cs" />\r
     <Compile Include="TypeForwarders.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
diff --git a/mcs/class/Facades/System.Text.Encoding.CodePages/Facades_System.Text.Encoding.CodePages-net_4_x.csproj b/mcs/class/Facades/System.Text.Encoding.CodePages/Facades_System.Text.Encoding.CodePages-net_4_x.csproj
new file mode 100644 (file)
index 0000000..c9170bc
--- /dev/null
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\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>{DF49AC88-C6F2-43B1-8560-3B74542BD874}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <NoWarn>1699,1616,1699</NoWarn>\r
+    <OutputPath>./../../../class/lib/net_4_x/Facades</OutputPath>\r
+    <IntermediateOutputPath>obj-Facades</IntermediateOutputPath>\r
+    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
+    <NoStdLib>True</NoStdLib>\r
+    \r
+    <NoConfig>True</NoConfig>\r
+    \r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>\r
+    </RootNamespace>\r
+    <AssemblyName>System.Text.Encoding.CodePages</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>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <NoWarn>1699,1616,1699</NoWarn>\r
+    <Optimize>false</Optimize>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</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,1616,1699</NoWarn>\r
+    <Optimize>true</Optimize>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</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="AssemblyInfo.cs" />\r
+    <Compile Include="CodePagesEncodingProvider.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
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Folder Include="Properties\" />\r
+  </ItemGroup>\r
+</Project>\r
+
index c478e7918cc0bd00a5c685aa9c30498d09920245..325ec1b29b57f5a24d8d76705963a537783bf573 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 5c8474d8caad113ca876be256d22aec472740b39..e7b870a1e248c514ee26dcf2b421d6b0566a81c0 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3128965240d2d2d6bd1f35d26360020cc2070ba0..e0e59c2333fc39446ada8d660edc4ec124d31ed5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2a7daad7c162cfa1c8b571bfc765b8df962fe590..322a7111685308d12bd57968625f9d9ae3e75478 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -54,7 +55,9 @@
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="ThreadingAclExtensions.cs" />\r
     <Compile Include="TypeForwarders.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
index 00de778e120b2fa500fd917abe1d97fd470f7d31..2b41fcc9c4c76fd4010044e9edf7baaab4bf242a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -14,7 +15,7 @@
     <NoStdLib>True</NoStdLib>\r
     \r
     <NoConfig>True</NoConfig>\r
-    \r
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
     <AppDesignerFolder>Properties</AppDesignerFolder>\r
     <RootNamespace>\r
     </RootNamespace>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="ClrThreadPoolBoundHandle.cs" />\r
+    <Compile Include="ClrThreadPoolBoundHandleOverlapped.cs" />\r
+    <Compile Include="ClrThreadPoolPreAllocatedOverlapped.cs" />\r
+    <Compile Include="DeferredDisposableLifetime.cs" />\r
+    <Compile Include="HResults.cs" />\r
+    <Compile Include="SR.cs" />\r
     <Compile Include="TypeForwarders.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
index 70915d9a5db74507e4e1ad50ba48451568b9604c..0a2521ced3bfa25d9e8788997ffacec595efdd3c 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3052af6fdcda1c56f16b62edf9910f37515451f8..7d9cfea31b01c4df93b7881cd74ffaecf4c4d410 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 58a1e3e48a417a439a086bcf394eca62ab7543d5..be99c95e703daeb51af81ef0bc232287bbadf14a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 081c415cfe00443197dcaa8ff6ec74964e36e379..1b49810afb6af14fcd869d1c54b6a0bbadb1f04e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a0450e1ff2dfaa1fc408b1fcea24bdd6d8407002..eff86d643a0517d00145d52578611f790d7a0047 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0b49733d39b11782b4f2fd48e757bd1605962f4c..3fd99d910efbcbaa32b0dbe76b7efbb6bd68c8bc 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index b607038b511e0fe542bebe205afaaa179cee4e49..3913f87471c38918d09f9476f94cc448fc7e536f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 6dfebc018ae02420221c9c095442e0c1c33a5d99..93396e1f4deaf82999de42ba16abc05f1d5aae7a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 6fe69f7e13d2aeae84d4380ff3b5524f378cf38b..9415690d83a602e979d12b3a19d195fec6b80ec0 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -55,7 +56,8 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
-    <Compile Include="TypeForwarders.cs" />\r  </ItemGroup>\r
+    <Compile Include="TypeForwarders.cs" />\r
+    <Compile Include="XDocumentExtensions.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
       <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
       <Name>System-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../../System.XML/System.Xml-net_4_x.csproj">\r
+      <Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
+      <Name>System.Xml-net_4_x</Name>\r
+    </ProjectReference>\r
     <ProjectReference Include="../../System.Xml.Linq/System.Xml.Linq-net_4_x.csproj">\r
       <Project>{526286D5-38D9-4579-B001-471440D57752}</Project>\r
       <Name>System.Xml.Linq-net_4_x</Name>\r
index fcddfd588d8195554f4d748308c03f20950e2cf1..142dadf2e09ff684b19725da59771ff3b6c24e01 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index adc60f7e829ec651563d4bf04398919481e86a1c..1b44a72f297141d071aa09f75e2b374ab413acb9 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c4df512148f9c4e53aacb716b68e6919ea28aea0..f7a9166192585803e76e73fc1b28e1cab6473623 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3e95b77fbd1dcc6768e8932cd82530805f5aa20b..92e86ad195c8ae6be61c3fe11a8a0656a4d8dad8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1616,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c6c9d3a44bbdbdd5d6c99d427b5324e5189a971c..eee63365fff6f05a7bfc9ee5d189ac686f22f15b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;DISABLE_UNSAFE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;DISABLE_UNSAFE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>DISABLE_UNSAFE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>DISABLE_UNSAFE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 75ff7a5aac9dd7024ece9f556a05afada47ca3d9..5aa9618abbcbcadff36fa76b46b470da31e92f19 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;DISABLE_UNSAFE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;DISABLE_UNSAFE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>DISABLE_UNSAFE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>DISABLE_UNSAFE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1afa51aef32e08d5690f8dc840d75402083ec000..3cca6e37a6d2a137472748e9d9ef9e5e05677f75 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 824b31774d50af80a8d219eab82d3afd32429f82..4053be10d18cb08af1c8dccc70ac2bd581ed8fa7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index abde280e27d6cde0c6e9ad52bd88b3bd5f04aca2..bc50dbf9f698ca94ffd3051003b8f8ab1a8f7fed 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 95900687116613c4d2697c497dc7e03c1e6fa99c..3ea76be294c91e8833cf8e7e138b20cc90ccea1b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1479ae7ddb88a683c3f18a83ee9faca50f18f7a9..c911a981b714b8674a268da389c10fc669efb26b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a5761603e4d5b5a93b95a041108ea08e76a32a6f..0c22a91db06397e9d339d05bc43f82790e7eb8b8 100644 (file)
@@ -462,14 +462,16 @@ namespace IBM.Data.DB2
                        for(int i = 0; i < columnInfo.Length; i++)\r
                        {\r
                                short sqlRet;\r
-                               short strlen;\r
-                               int numericAttribute;\r
-\r
-                               sqlRet = DB2CLIWrapper.SQLColAttribute(hwndStmt, (short)(i + 1), (short)DB2Constants.SQL_DESC_BASE_COLUMN_NAME, sb, (short)sb.Capacity, out strlen, out numericAttribute);\r
+                               short strlen = 0;\r
+                               int numericAttribute = 0;\r
+                               \r
+                               sb.Clear();\r
+                               sqlRet = DB2CLIWrapper.SQLColAttribute(hwndStmt, (short)(i + 1), (short)DB2Constants.SQL_DESC_COLUMN_NAME, sb, (short)sb.Capacity, out strlen, out numericAttribute);\r
                                DB2ClientUtils.DB2CheckReturn(sqlRet, DB2Constants.SQL_HANDLE_STMT, hwndStmt, "GetSchemaTable");\r
                                columnInfo[i].Colname = sb.ToString();\r
                                columnsNames[columnInfo[i].Colname.ToUpper()] = i;\r
-\r
+                               \r
+                               strlen = 0;\r
                                sqlRet = DB2CLIWrapper.SQLColAttribute(hwndStmt, (short)(i + 1), (short)DB2Constants.SQL_DESC_CONCISE_TYPE, sb, (short)sb.Capacity, out strlen, out columnInfo[i].Sqltype);\r
                                DB2ClientUtils.DB2CheckReturn(sqlRet, DB2Constants.SQL_HANDLE_STMT, hwndStmt, "GetSchemaTable");\r
 \r
index 6f7047f15c02021fe96fad22b955d68d35ebe3f8..c1f6ac9253dbbf42c2ec47ca11c3658867390065 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e9c0a1621512da713432a917ee93e659d16bd5d0..714033a4eb11f7da0e3cfc9e8e6a781df19840a3 100644 (file)
@@ -78,12 +78,13 @@ xammac_dirs := \
        $(mobile_dynamic_dirs)
 
 monodroid_dirs := \
-       $(mobile_dynamic_dirs)
+       $(mobile_dynamic_dirs) \
+       Mono.Btls.Interface
 
 monotouch_dirs := \
        $(mobile_static_dirs)
 
-monotouch_watch_dirs := $(monotouch_dirs)
+monotouch_watch_dirs := $(filter-out Mono.Security Mono.Data.Tds,$(monotouch_dirs))
 monotouch_tv_dirs   := $(monotouch_dirs)
 
 monotouch_runtime_dirs := \
@@ -94,7 +95,7 @@ monotouch_runtime_dirs := \
        System.XML \
        Mono.CSharp
 
-monotouch_watch_runtime_dirs := $(monotouch_runtime_dirs)
+monotouch_watch_runtime_dirs := $(filter-out Mono.Security Mono.Data.Tds,$(monotouch_runtime_dirs))
 monotouch_tv_runtime_dirs := $(monotouch_runtime_dirs)
 
 xammac_4_5_dirs := \
@@ -236,6 +237,7 @@ net_4_x_dirs := \
 net_4_x_parallel_dirs := \
        PEAPI                           \
        I18N                            \
+       Mono.Btls.Interface             \
        Mono.Http                       \
        Mono.Cairo                      \
        Mono.Cecil                      \
@@ -342,6 +344,7 @@ DISTFILES = \
        MicrosoftAjaxLibrary/License.htm        \
        test-helpers/NetworkHelpers.cs  \
        test-helpers/SocketResponder.cs \
+       lib/$(monolite_dir)/basic.exe   \
        $(monolite_files)
 
 .PHONY: all-local $(STD_TARGETS:=-local)
@@ -374,11 +377,13 @@ $(monolite_files): | lib/$(monolite_dir)/Facades
 $(monolite_files): lib/$(monolite_dir)/%: lib/build/%
        cp -p $< $@
 
+lib/$(monolite_dir)/basic.exe:
+       cp -p lib/basic/basic.exe lib/$(monolite_dir)
+
 $(build_files:%=lib/build/%):
        cd $(topdir) && $(MAKE) profile-do--build--all NO_DIR_CHECK=1 SKIP_AOT=1
 
-dist-monolite: $(monolite_files)
-       cp -p lib/basic/basic.exe lib/$(monolite_dir)
+dist-monolite: $(monolite_files) lib/$(monolite_dir)/basic.exe
 
 dist-default: dist-monolite
 
index bfa54497303dd9f053607961cff2b346d3bd9914..887bc47e19e6fedb2d06eb6df82549e2057181ff 100644 (file)
@@ -1 +1,2 @@
 /Test/resources/*.proj
+Test/test-config-file-*
index 9aed81206542d94d4976f0974107b89d405a8e89..9acd2e184d4f86e78a2d743390492616e53a54b8 100644 (file)
@@ -12,6 +12,7 @@ LIB_MCS_FLAGS =
 
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = $(XBUILD_FRAMEWORK) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Xml
+TEST_NUNITLITE_APP_CONFIG_RUNTIME=Test/test-config-file-$(PROFILE)
 
 EXTRA_DISTFILES = \
        Test/resources/TestTasks.cs             \
index f663120bf798730223c944db359caa7873771dc5..82af83b15232988b1fd1d50b1b18e80d2bc09536 100644 (file)
@@ -226,6 +226,14 @@ namespace Microsoft.Build.BuildEngine {
                public void SetMetadata (string metadataName,
                                         string metadataValue,
                                         bool treatMetadataValueAsLiteral)
+               {
+                       SetMetadata (metadataName, metadataValue, treatMetadataValueAsLiteral, false);
+               }
+
+               void SetMetadata (string metadataName,
+                                        string metadataValue,
+                                        bool treatMetadataValueAsLiteral,
+                                        bool fromDynamicItem)
                {
                        if (metadataName == null)
                                throw new ArgumentNullException ("metadataName");
@@ -251,9 +259,11 @@ namespace Microsoft.Build.BuildEngine {
                        } else if (HasParentItem) {
                                if (parent_item.child_items.Count > 1)
                                        SplitParentItem ();
-                               parent_item.SetMetadata (metadataName, metadataValue, treatMetadataValueAsLiteral);
+                               parent_item.SetMetadata (metadataName, metadataValue, treatMetadataValueAsLiteral, fromDynamicItem);
                        }
-                       if (FromXml || HasParentItem) {
+
+                       // We don't want to reevalute the project for dynamic items
+                       if (!fromDynamicItem && !IsDynamic && (FromXml || HasParentItem)) {
                                parent_item_group.ParentProject.MarkProjectAsDirty ();
                                parent_item_group.ParentProject.NeedToReevaluate ();
                        }
@@ -374,7 +384,7 @@ namespace Microsoft.Build.BuildEngine {
                                        continue;
                                
                                foreach (string name in evaluatedMetadata.Keys) {
-                                       item.SetMetadata (name, (string)evaluatedMetadata [name]);
+                                       item.SetMetadata (name, (string)evaluatedMetadata [name], false, IsDynamic);
                                }
 
                                AddAndRemoveMetadata (project, item);
index 652aab45f53431245fbb367815ea1c81734aee21..561ece2a3d31bed76f62e44120dc40827a8d46b8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1a4e4317421d460b5a13cc638b1514cddf5db232..2398184df6d706fb5fc9aefc0d9bfb3f4c8c4666 100644 (file)
@@ -24,6 +24,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 using System;
+using System.IO;
 using Microsoft.Build.BuildEngine;
 using NUnit.Framework;
 
@@ -61,6 +62,11 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
                                </Project>
                        ";
 
+                       if (Path.DirectorySeparatorChar == '\\') {
+                               documentString = documentString.Replace ("/home", "c:/home");
+                               documentString = documentString.Replace ("/tmp", "c:/tmp");
+                       }
+
                        var engine = new Engine (Consts.BinPath);
                        var project = engine.CreateNewProject ();
                        project.LoadXml (documentString);
index 6c7919e6ae7db4d7c36cc02ad79cc4ceebc10ab3..8f2aa2e7b28daf2b2f4f41ae052bae1b3097e233 100644 (file)
@@ -40,6 +40,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
        [TestFixture]
        public class TargetTest {
                
+               static bool isMono = Type.GetType ("Mono.Runtime", false) != null;
                Engine                  engine;
                Project                 project;
                
@@ -351,16 +352,16 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 
                bool Build (string projectXml, ILogger logger)
                {
-                       if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
+                       if (!isMono) {
                                var reader = new StringReader (projectXml);
                                var xml = XmlReader.Create (reader);
-                               return BuildOnWindows (xml, logger);
+                               return BuildOnDotNet (xml, logger);
                        } else {
-                               return BuildOnLinux (projectXml, logger);
+                               return BuildOnMono (projectXml, logger);
                        }
                }
 
-               bool BuildOnWindows (XmlReader reader, ILogger logger)
+               bool BuildOnDotNet (XmlReader reader, ILogger logger)
                {
                        var type = Type.GetType ("Microsoft.Build.Evaluation.ProjectCollection, Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
 
@@ -376,7 +377,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
                        return ret;
                }
 
-               bool BuildOnLinux (string projectXml, ILogger logger)
+               bool BuildOnMono (string projectXml, ILogger logger)
                {
                        var engine = new Engine (Consts.BinPath);
                        var project = engine.CreateNewProject ();
@@ -697,6 +698,33 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
                                </Project>", "D");
                }
 
+               [Test]
+               public void ItemGroupInsideTarget_UpdateMetadata ()
+               {
+                       ItemGroupInsideTarget (
+                               @"<Project ToolsVersion=""4.0"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+                                       <ItemGroup>
+                                               <ProjectReference Include='xyz'/>
+                                       </ItemGroup>
+
+                                       <Target Name='Main' DependsOnTargets='CreateBar'>
+                                               <Message Text='Before: $(Bar)'/>
+                                               <ItemGroup>
+                                                       <ProjectReference>
+                                                               <AdditionalProperties>A=b</AdditionalProperties>
+                                                       </ProjectReference>
+                                               </ItemGroup>
+                                               <Message Text='After: $(Bar)'/>
+                                       </Target>
+
+                                       <Target Name='CreateBar'>
+                                               <PropertyGroup>
+                                                       <Bar>Bar01</Bar>
+                                               </PropertyGroup>
+                                       </Target>
+                               </Project>", 2, "Before: Bar01", "After: Bar01");
+               }
+
                [Test]
                public void ItemGroupInsideTarget_Batching ()
                {
index 54f1c8a94cc2c935c49a573869ba9799aa6568df..144a6d72ea2e134bcfd4cdd96369be9b377fc66c 100644 (file)
@@ -129,6 +129,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
                }
 
                [Test]
+               [SetCulture ("en-us")]
                public void AllowedFrameworkMembers ()
                {
                        string documentString = @"
@@ -202,6 +203,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
                }
 
                [Test]
+               [SetCulture ("en-us")]
                public void MSBuildPropertyFunctions ()
                {
                        string documentString = @"
diff --git a/mcs/class/Microsoft.Build.Framework/.gitignore b/mcs/class/Microsoft.Build.Framework/.gitignore
new file mode 100644 (file)
index 0000000..c8cb717
--- /dev/null
@@ -0,0 +1 @@
+Test/test-config-file-*
index f31f5a5835ea5f0b8f33c7bdfc059a0490a3e8e9..edd7cc2e8eb7477e19cadd28edf7e759084d932b 100644 (file)
@@ -10,6 +10,8 @@ LIBRARY = Microsoft.Build.Framework.dll
 LIB_REFS = $(PARENT_PROFILE)System
 LIB_MCS_FLAGS =
 
+TEST_NUNITLITE_APP_CONFIG_RUNTIME=Test/test-config-file-$(PROFILE)
+
 EXTRA_DISTFILES = \
        Mono.XBuild.Framework/AssemblyLoadInfo.cs
 
index ad57c7d514e57e4c05ea4c58c2535ef61eb95b60..d79f429e9a55c79ccb2e4dd507260c64ad827f04 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index bfa54497303dd9f053607961cff2b346d3bd9914..887bc47e19e6fedb2d06eb6df82549e2057181ff 100644 (file)
@@ -1 +1,2 @@
 /Test/resources/*.proj
+Test/test-config-file-*
index d451c754e74471c627da9bbd3e6ffd86fd871a90..a919129b083e53916526a0ea1316dc6f313f5771 100644 (file)
@@ -15,6 +15,8 @@ LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = $(PARENT_PROFILE)System.Xml $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(XBUILD_TASKS) $(XBUILD_UTILITIES) $(PARENT_PROFILE)System.Core
 
+TEST_NUNITLITE_APP_CONFIG_RUNTIME=Test/test-config-file-$(PROFILE)
+
 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
 TEST_LIB_REFS += Microsoft.Build
 endif
@@ -23,8 +25,7 @@ EXTRA_DISTFILES = \
        Test/resources/test.cs \
        Test/resources/Sample.cs \
        Test/resources/Sample.vb \
-       Test/resources/junk.txt \
-       Test/test-config-file*
+       Test/resources/junk.txt
 
 Test/resources/test.dll: Test/resources/test.cs
        $(CSCOMPILE) -target:library /out:$@ $<
index d051dbefb947465da844bc655be2a7017172f4dd..3e09d9948ddde8321df983181125d8285081e1f4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 43917b03e340b8917fac8248808ced3b00b13c5c..19649dadf86b904503eeaa8835d2a4dcca5fa1c9 100755 (executable)
@@ -158,11 +158,11 @@ namespace MonoTests.Microsoft.Build.Tasks
                        Assert.AreEqual(files.Length, include.Count, id + "2");
 
                        for (int i = 0; i < files.Length; i++) {
-                               Assert.AreEqual (files [i], include [i].FinalItemSpec, id + "3, file #" + i);
+                               Assert.AreEqual (files [i], include [i].FinalItemSpec.Replace ("\\", "/"), id + "3, file #" + i);
                                Assert.IsTrue (include[i].HasMetadata ("TargetPath"), id + "4, file #" + i + ", TargetPath metadata missing");
                                Assert.AreEqual (assignedFiles [i], include[i].GetMetadata("TargetPath"), id + "5, file #" + i);
                                Assert.IsTrue (include [i].HasMetadata ("Child"), id + "6, file #" + i + ", Child metadata missing");
-                               Assert.AreEqual ("C" + files [i], include [i].GetMetadata ("Child"), id + "7, file #" + i + ", Child metadata value incorrect");
+                               Assert.AreEqual ("C" + files [i], include [i].GetMetadata ("Child").Replace ("\\", "/"), id + "7, file #" + i + ", Child metadata value incorrect");
                        }
                }
 
index ad7ca03ba5a6ebb9b3fcb611f695492d0a673a3e..dab6adaf7a3aac4ff02f42ee0c16ca3f43590a5f 100644 (file)
@@ -301,7 +301,11 @@ namespace MonoTests.Microsoft.Build.Tasks {
                                Assert.Fail ("Build failed");
                        }
                        Assert.IsTrue (File.Exists (target_file), "A2");
-                       Assert.AreEqual (FileAttributes.Normal, File.GetAttributes (target_file), "A3");                                        
+                       if (Environment.OSVersion.Platform == PlatformID.Unix)
+                               Assert.AreEqual (FileAttributes.Normal, File.GetAttributes (target_file), "A3");
+                       else
+                               // On Windows the Archive attribute will be set, not the Normal attribute.
+                               Assert.AreEqual (FileAttributes.Archive, File.GetAttributes (target_file), "A3");
                }
 
                [Test]
@@ -349,7 +353,12 @@ namespace MonoTests.Microsoft.Build.Tasks {
                                Assert.Fail ("Build failed " + sb.ToString ());
                        }
                        Assert.IsTrue (File.Exists (target_file), "A2");
-                       Assert.AreEqual (FileAttributes.Normal, File.GetAttributes (target_file), "A3");                                        
+                       var target_file_attrs = File.GetAttributes (target_file);
+                       if (Environment.OSVersion.Platform == PlatformID.Unix)
+                               Assert.AreEqual (FileAttributes.Normal, File.GetAttributes (target_file), "A3");
+                       else
+                               // On Windows the Archive attribute will be set, not the Normal attribute.
+                               Assert.AreEqual (FileAttributes.Archive, File.GetAttributes (target_file), "A3");
                }
 
                [Test]
index 3342c003e8bf890d8df77900cb32aee9f6d3eb0f..41c8d8e4f103a7bebdd6737de846e8f57b4654c4 100755 (executable)
@@ -115,6 +115,9 @@ namespace MonoTests.Microsoft.Build.Tasks {
                [Test]
                public void TestLineWithEscapedQuote ()
                {
+                       if (Environment.OSVersion.Platform != PlatformID.Unix) {
+                               Assert.Ignore ("Throws \"Illegal characters in path\" on Windows since \" is not a legal Windows path character");
+                       }
                        string[] lines = new string[] { "%22abc test%22 123 %22def%22" };
                        CreateProjectAndCheck (full_filepath, lines, false, true, delegate () {
                                CheckFileExists (full_filepath, true);
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-4.0 b/mcs/class/Microsoft.Build.Tasks/Test/test-config-file-net-4.0
deleted file mode 100644 (file)
index 3c78f3b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version ="1.0"?>
-<configuration>
-    <runtime>
-        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-            <dependentAssembly>
-                <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
-                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/>
-            </dependentAssembly>
-            <dependentAssembly>
-                <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
-                <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/>
-            </dependentAssembly>
-        </assemblyBinding>
-    </runtime>
-</configuration>
diff --git a/mcs/class/Microsoft.Build.Utilities/.gitignore b/mcs/class/Microsoft.Build.Utilities/.gitignore
new file mode 100644 (file)
index 0000000..c8cb717
--- /dev/null
@@ -0,0 +1 @@
+Test/test-config-file-*
index 10ef6780d4af6caf04ee40b279df2c40a3915ad6..2c644346e2c34c2c75740bf4afe1b75e8a88ec8c 100644 (file)
@@ -15,6 +15,7 @@ TEST_RESX_RESOURCES = Test/Microsoft.Build.Utilities/Strings.resources
 
 TEST_LIB_REFS = $(XBUILD_ENGINE) $(XBUILD_FRAMEWORK) $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core
 TEST_MCS_FLAGS = $(TEST_RESX_RESOURCES:%=-resource:%)
+TEST_NUNITLITE_APP_CONFIG_RUNTIME=Test/test-config-file-$(PROFILE)
 
 include $(XBUILD_DIR)/xbuild_test.make
 include ../../build/library.make
index 1e5e1913b4342c0b271bca55f4a260bff1a4288f..bc6b36a67abdfdbc2ad97a9e95adf70dd1ef71d2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index bc686cf9c839b693f7644e676abd2e75019cdb96..07547b0fc205a26531398ebc34e43439b95ec841 100644 (file)
@@ -6,3 +6,4 @@ bin/
 Microsoft.Build.Internal/ExpressionParser.cs
 Microsoft.Build.Internal/y.output
 Test/FunctionalTestProject*.csproj
+Test/test-config-file-*
index 933782ff268b64d48a5d746d2223c93ffee7d39c..47e9cf9ad41454df2b1fd684577509b0d82cc6b6 100644 (file)
@@ -10,9 +10,10 @@ LIBRARY = Microsoft.Build.dll
 LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Core $(PARENT_PROFILE)System.Xml Microsoft.Build.Engine Microsoft.Build.Framework
 LIB_MCS_FLAGS = \
        /d:MICROSOFT_BUILD_DLL
-       
+
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
 TEST_LIB_REFS = $(XBUILD_UTILITIES)
+TEST_NUNITLITE_APP_CONFIG_RUNTIME=Test/test-config-file-$(PROFILE)
 
 EXTRA_DISTFILES = \
        Microsoft.Build.Internal/ExpressionParser.jay   \
index 24dd6dd3751303edd192404062260cb9e7a61500..372afa7f5c578c8a1da9b1088db303b208f25318 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MICROSOFT_BUILD_DLL</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;MICROSOFT_BUILD_DLL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MICROSOFT_BUILD_DLL</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;MICROSOFT_BUILD_DLL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 322006a4e849fadd25b24ad978fb62530d9fe27e..135734fb03064cb7c699bdb5d5281abc22897e7f 100644 (file)
@@ -80,6 +80,9 @@ namespace Microsoft.Build.Internal
                                        if (!queued_builds.TryDequeue (out build))
                                                continue;
                                        StartOneBuild (build);
+                               } catch (ThreadAbortException) {
+                                       // do nothing
+                                       break;
                                } catch (Exception ex) {
                                        // FIXME: I guess INodeLogger should be used instead.
                                        Console.Error.WriteLine ("Uncaught build node exception occured");
index 7b65749c86afd94b360d4eb80d6e619590998359..28c4af1277abbcb7a31cdd66a5310bc2b315498b 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 FunctionalTest.cs
 Microsoft.Build.Construction/ProjectItemElementTest.cs
 Microsoft.Build.Construction/ProjectRootElementTest.cs
index 61973b7ceb48f80a4f2b7c64eac02b7f11934e25..f3b3524ba81277d944e710e63f7c0760c31786ba 100644 (file)
@@ -90,7 +90,7 @@ namespace MonoTests.Microsoft.Build.Evaluation
                {
                        string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
   <ItemGroup>
-    <Foo Include='Test/ProjectItemTestTemporary/parent/dir*/a*.cs;Test/ProjectItemTestTemporary/x.cs' />
+    <Foo Include='" + "Test/ProjectItemTestTemporary/parent/dir*/a*.cs;Test/ProjectItemTestTemporary/x.cs".Replace ('/', Path.DirectorySeparatorChar) + @"' />
   </ItemGroup>
 </Project>";
                        try {
@@ -106,7 +106,7 @@ namespace MonoTests.Microsoft.Build.Evaluation
                {
                        string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
   <ItemGroup>
-    <Foo Include='Test/ProjectItemTestTemporary/parent/**/a*.cs;Test/ProjectItemTestTemporary/x.cs' />
+    <Foo Include='" + "Test/ProjectItemTestTemporary/parent/**/a*.cs;Test/ProjectItemTestTemporary/x.cs".Replace ('/', Path.DirectorySeparatorChar) + @"' />
   </ItemGroup>
 </Project>";
                        try {
@@ -127,23 +127,23 @@ namespace MonoTests.Microsoft.Build.Evaluation
                        // sort is needed because they are only sorted by ItemType.
                        var items = proj.Items.OrderBy (p => p.EvaluatedInclude).ToArray ();
                        Assert.AreEqual (5, items.Length, "#1");
-                       Assert.AreEqual (string.Format ("Test/ProjectItemTestTemporary/parent/dir1{0}a.cs", Path.DirectorySeparatorChar), items [0].EvaluatedInclude, "#2");
+                       Assert.AreEqual ("Test/ProjectItemTestTemporary/parent/dir1/a.cs", items [0].EvaluatedInclude.Replace (Path.DirectorySeparatorChar, '/'), "#2");
                        Assert.AreEqual ("a", items [0].GetMetadataValue ("Filename"), "#3");
                        if (hasRecursiveDir)
                                Assert.AreEqual ("dir1" + sep, items [0].GetMetadataValue ("RecursiveDir"), "#3.2");
-                       Assert.AreEqual (string.Format ("Test/ProjectItemTestTemporary/parent/dir1{0}a1.cs", Path.DirectorySeparatorChar), items [1].EvaluatedInclude, "#4");
+                       Assert.AreEqual ("Test/ProjectItemTestTemporary/parent/dir1/a1.cs", items [1].EvaluatedInclude.Replace (Path.DirectorySeparatorChar, '/'), "#4");
                        Assert.AreEqual ("a1", items [1].GetMetadataValue ("Filename"), "#5");
                        if (hasRecursiveDir)
                                Assert.AreEqual ("dir1" + sep, items [1].GetMetadataValue ("RecursiveDir"), "#5.2");
-                       Assert.AreEqual (string.Format ("Test/ProjectItemTestTemporary/parent/dir2{0}a.cs", Path.DirectorySeparatorChar), items [2].EvaluatedInclude, "#6");
+                       Assert.AreEqual ("Test/ProjectItemTestTemporary/parent/dir2/a.cs", items [2].EvaluatedInclude.Replace (Path.DirectorySeparatorChar, '/'), "#6");
                        Assert.AreEqual ("a", items [2].GetMetadataValue ("Filename"), "#7");
                        if (hasRecursiveDir)
                                Assert.AreEqual ("dir2" + sep, items [2].GetMetadataValue ("RecursiveDir"), "#7.2");
-                       Assert.AreEqual (string.Format ("Test/ProjectItemTestTemporary/parent/dir2{0}a2.cs", Path.DirectorySeparatorChar), items [3].EvaluatedInclude, "#8");
+                       Assert.AreEqual ("Test/ProjectItemTestTemporary/parent/dir2/a2.cs", items [3].EvaluatedInclude.Replace (Path.DirectorySeparatorChar, '/'), "#8");
                        Assert.AreEqual ("a2", items [3].GetMetadataValue ("Filename"), "#9");
                        if (hasRecursiveDir)
                                Assert.AreEqual ("dir2" + sep, items [3].GetMetadataValue ("RecursiveDir"), "#9.2");
-                       Assert.AreEqual ("Test/ProjectItemTestTemporary/x.cs", items [4].EvaluatedInclude, "#10");
+                       Assert.AreEqual ("Test/ProjectItemTestTemporary/x.cs", items [4].EvaluatedInclude.Replace (Path.DirectorySeparatorChar, '/'), "#10");
                        for (int i = 0; i < items.Length; i++)
                                Assert.AreEqual (xitem, items [i].Xml, "#11:" + i);
                }
index 9723191bf164f6643724dcc990d59e609bf35003..f14bcd864ac75839762a8220b18f9fb9090fc187 100644 (file)
@@ -108,7 +108,8 @@ namespace MonoTests.Microsoft.Build.Execution
                        Assert.IsTrue (sub.BuildResult.OverallResult == BuildResultCode.Success, "#1");
                        DateTime endBuildDone = DateTime.Now;
                        Assert.IsTrue (endBuildDone - beforeExec >= TimeSpan.FromSeconds (1), "#2");
-                       Assert.IsTrue (endBuildDone > waitDone, "#3");
+                       Assert.IsTrue (waitDone >= beforeExec, "#3");
+                       Assert.IsTrue (endBuildDone >= waitDone, "#4");
                }
                
                [Test]
index 4b2bc7d98a77bfc48a27217a80408c71ab94ffbe..74a38e30ef22d225913d48b85867e4d95abe92be 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 8fe58e637bdc6d3f943942127a89a8afa7c899d0..076bf42e56dd59700858ea4026fbfe59f2eaf104 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e68b8bf4ab61403e253de8e4cd805fcebe1ee00b..8bfd05df65c2c6e9274a96fb1aa67a94a99d953f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/Mono.Btls.Interface/Makefile b/mcs/class/Mono.Btls.Interface/Makefile
new file mode 100644 (file)
index 0000000..aa5b54c
--- /dev/null
@@ -0,0 +1,19 @@
+thisdir = class/Mono.Btls.Interface
+SUBDIRS = 
+include ../../build/rules.make
+
+LIBRARY = Mono.Btls.Interface.dll
+LIB_REFS = System Mono.Security
+LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP
+
+ifndef HAVE_BTLS
+NO_INSTALL = yes
+NO_SIGN_ASSEMBLY = yes
+NO_TEST = yes
+NO_BUILD = yes
+endif
+
+include ../../build/library.make
+
+$(the_lib): ../Mono.Security/Makefile
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface-net_4_x.csproj b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface-net_4_x.csproj
new file mode 100644 (file)
index 0000000..b141a55
--- /dev/null
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\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>{BF32D586-8FBB-4A2A-A734-AA17CDAB283F}</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.Btls.Interface</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;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;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=".\Properties\AssemblyInfo.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsObject.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsProvider.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509Chain.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509Error.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509Format.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509Lookup.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509Name.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509Purpose.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509Store.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509StoreCtx.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509StoreManager.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509StoreType.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509TrustKind.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509VerifyFlags.cs" />\r
+    <Compile Include="Mono.Btls.Interface\BtlsX509VerifyParam.cs" />\r
+    <Compile Include="Mono.Btls.Interface\VersionInfo.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
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface.dll.sources b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface.dll.sources
new file mode 100644 (file)
index 0000000..710e06d
--- /dev/null
@@ -0,0 +1,22 @@
+./Properties/AssemblyInfo.cs
+../../build/common/Consts.cs
+../../build/common/Locale.cs
+../../build/common/MonoTODOAttribute.cs
+
+Mono.Btls.Interface/BtlsObject.cs
+Mono.Btls.Interface/BtlsProvider.cs
+Mono.Btls.Interface/BtlsX509.cs
+Mono.Btls.Interface/BtlsX509Chain.cs
+Mono.Btls.Interface/BtlsX509Error.cs
+Mono.Btls.Interface/BtlsX509Format.cs
+Mono.Btls.Interface/BtlsX509Lookup.cs
+Mono.Btls.Interface/BtlsX509Name.cs
+Mono.Btls.Interface/BtlsX509Purpose.cs
+Mono.Btls.Interface/BtlsX509Store.cs
+Mono.Btls.Interface/BtlsX509StoreCtx.cs
+Mono.Btls.Interface/BtlsX509StoreManager.cs
+Mono.Btls.Interface/BtlsX509StoreType.cs
+Mono.Btls.Interface/BtlsX509TrustKind.cs
+Mono.Btls.Interface/BtlsX509VerifyFlags.cs
+Mono.Btls.Interface/BtlsX509VerifyParam.cs
+Mono.Btls.Interface/VersionInfo.cs
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsObject.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsObject.cs
new file mode 100644 (file)
index 0000000..b2e607c
--- /dev/null
@@ -0,0 +1,73 @@
+//
+// BtlsObject.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       public abstract class BtlsObject : IDisposable
+       {
+               MonoBtlsObject instance;
+
+               internal MonoBtlsObject Instance {
+                       get {
+                               if (!IsValid)
+                                       throw new ObjectDisposedException (GetType ().Name);
+                               return instance;
+                       }
+               }
+
+               internal BtlsObject (MonoBtlsObject instance)
+               {
+                       this.instance = instance;
+               }
+
+               public bool IsValid {
+                       get { return instance != null && instance.IsValid; }
+               }
+
+               protected void Dispose (bool disposing)
+               {
+                       if (disposing) {
+                               if (instance != null) {
+                                       instance.Dispose ();
+                                       instance = null;
+                               }
+                       }
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               ~BtlsObject ()
+               {
+                       Dispose (false);
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsProvider.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsProvider.cs
new file mode 100644 (file)
index 0000000..0959dd0
--- /dev/null
@@ -0,0 +1,107 @@
+//
+// BtlsProvider.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Security.Interface;
+using System.Security.Cryptography.X509Certificates;
+using MNS = Mono.Net.Security;
+
+namespace Mono.Btls.Interface
+{
+       public static class BtlsProvider
+       {
+               public static bool IsSupported ()
+               {
+                       return MNS.MonoTlsProviderFactory.IsBtlsSupported ();
+               }
+
+               public static MonoTlsProvider GetProvider ()
+               {
+                       return new MonoBtlsProvider ();
+               }
+
+               public static BtlsX509 CreateNative (byte[] data, BtlsX509Format format)
+               {
+                       var x509 = MonoBtlsX509.LoadFromData (data, (MonoBtlsX509Format)format);
+                       return new BtlsX509 (x509);
+               }
+
+               public static X509Certificate CreateCertificate (byte[] data, BtlsX509Format format, bool disallowFallback = false)
+               {
+                       return MonoBtlsProvider.CreateCertificate (data, (MonoBtlsX509Format)format, disallowFallback);
+               }
+
+               public static X509Certificate2 CreateCertificate2 (byte[] data, BtlsX509Format format, bool disallowFallback = false)
+               {
+                       return MonoBtlsProvider.CreateCertificate2 (data, (MonoBtlsX509Format)format, disallowFallback);
+               }
+
+               public static X509Certificate2 CreateCertificate2 (byte[] data, string password, bool disallowFallback = false)
+               {
+                       return MonoBtlsProvider.CreateCertificate2 (data, password, disallowFallback);
+               }
+
+               public static BtlsX509Chain CreateNativeChain ()
+               {
+                       return new BtlsX509Chain (new MonoBtlsX509Chain ());
+               }
+
+               public static BtlsX509Store CreateNativeStore ()
+               {
+                       return new BtlsX509Store (new MonoBtlsX509Store ());
+               }
+
+               public static BtlsX509StoreCtx CreateNativeStoreCtx ()
+               {
+                       return new BtlsX509StoreCtx (new MonoBtlsX509StoreCtx ());
+               }
+
+               public static X509Chain CreateChain ()
+               {
+                       return MonoBtlsProvider.CreateChain ();
+               }
+
+               public static string GetSystemStoreLocation ()
+               {
+                       return MonoBtlsProvider.GetSystemStoreLocation ();
+               }
+
+               public static BtlsX509VerifyParam GetVerifyParam_SslClient ()
+               {
+                       return new BtlsX509VerifyParam (MonoBtlsX509VerifyParam.GetSslClient ());
+               }
+
+               public static BtlsX509VerifyParam GetVerifyParam_SslServer ()
+               {
+                       return new BtlsX509VerifyParam (MonoBtlsX509VerifyParam.GetSslServer ());
+               }
+
+               public static X509Chain GetManagedChain (BtlsX509Chain chain)
+               {
+                       return MonoBtlsProvider.GetManagedChain (chain.Instance);
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509.cs
new file mode 100644 (file)
index 0000000..abcdafb
--- /dev/null
@@ -0,0 +1,132 @@
+//
+// BtlsX509.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.IO;
+using System.Security.Cryptography;
+
+namespace Mono.Btls.Interface
+{
+       public class BtlsX509 : BtlsObject
+       {
+               new internal MonoBtlsX509 Instance {
+                       get { return (MonoBtlsX509)base.Instance; }
+               }
+
+               internal BtlsX509 (MonoBtlsX509 x509)
+                       : base (x509)
+               {
+               }
+
+               public BtlsX509Name GetSubjectName ()
+               {
+                       return new BtlsX509Name (Instance.GetSubjectName ());
+               }
+
+               public BtlsX509Name GetIssuerName ()
+               {
+                       return new BtlsX509Name (Instance.GetIssuerName ());
+               }
+
+               public string GetSubjectNameString ()
+               {
+                       return Instance.GetSubjectNameString ();
+               }
+
+               public string GetIssuerNameString ()
+               {
+                       return Instance.GetIssuerNameString ();
+               }
+
+               public byte[] GetRawData (BtlsX509Format format)
+               {
+                       return Instance.GetRawData ((MonoBtlsX509Format)format);
+               }
+
+               public byte[] GetCertHash ()
+               {
+                       return Instance.GetCertHash ();
+               }
+
+               public DateTime GetNotBefore ()
+               {
+                       return Instance.GetNotBefore ();
+               }
+
+               public DateTime GetNotAfter ()
+               {
+                       return Instance.GetNotAfter ();
+               }
+
+               public byte[] GetPublicKeyData ()
+               {
+                       return Instance.GetPublicKeyData ();
+               }
+
+               public byte[] GetSerialNumber (bool mono_style)
+               {
+                       return Instance.GetSerialNumber (mono_style);
+               }
+
+               public int GetVersion ()
+               {
+                       return Instance.GetVersion ();
+               }
+
+               public Oid GetSignatureAlgorithm ()
+               {
+                       return Instance.GetSignatureAlgorithm ();
+               }
+
+               public AsnEncodedData GetPublicKeyAsn1 ()
+               {
+                       return Instance.GetPublicKeyAsn1 ();
+               }
+
+               public AsnEncodedData GetPublicKeyParameters ()
+               {
+                       return Instance.GetPublicKeyParameters (); 
+               }
+
+               public long GetSubjectNameHash ()
+               {
+                       using (var name = GetSubjectName ())
+                               return name.GetHash ();
+               }
+
+               public void Print (Stream stream)
+               {
+                       using (var bio = MonoBtlsBio.CreateMonoStream (stream))
+                               Instance.Print (bio);
+               }
+
+               public void ExportAsPEM (Stream stream, bool includeHumanReadableForm)
+               {
+                       using (var bio = MonoBtlsBio.CreateMonoStream (stream))
+                               Instance.ExportAsPEM (bio, includeHumanReadableForm);
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Chain.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Chain.cs
new file mode 100644 (file)
index 0000000..38e9ec5
--- /dev/null
@@ -0,0 +1,58 @@
+//
+// BtlsX509Chain.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       public class BtlsX509Chain : BtlsObject
+       {
+               new internal MonoBtlsX509Chain Instance {
+                       get { return (MonoBtlsX509Chain)base.Instance; }
+               }
+
+               internal BtlsX509Chain (MonoBtlsX509Chain chain)
+                       : base (chain)
+               {
+               }
+
+               public int Count {
+                       get { return Instance.Count; }
+               }
+
+               public BtlsX509 this[int index] {
+                       get {
+                               var x509 = Instance.GetCertificate (index);
+                               return new BtlsX509 (x509.Copy ());
+                       }
+               }
+
+               public void Add (BtlsX509 x509)
+               {
+                       Instance.AddCertificate (x509.Instance);
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Error.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Error.cs
new file mode 100644 (file)
index 0000000..089b4f2
--- /dev/null
@@ -0,0 +1,110 @@
+//
+// BtlsX509Error.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       // Keep in sync with NativeBoringX509Error
+       public enum BtlsX509Error
+       {
+               OK = 0,
+               /* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */
+
+               UNABLE_TO_GET_ISSUER_CERT = 2,
+               UNABLE_TO_GET_CRL = 3,
+               UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4,
+               UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5,
+               UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6,
+               CERT_SIGNATURE_FAILURE = 7,
+               CRL_SIGNATURE_FAILURE = 8,
+               CERT_NOT_YET_VALID = 9,
+               CERT_HAS_EXPIRED = 10,
+               CRL_NOT_YET_VALID = 11,
+               CRL_HAS_EXPIRED = 12,
+               ERROR_IN_CERT_NOT_BEFORE_FIELD = 13,
+               ERROR_IN_CERT_NOT_AFTER_FIELD = 14,
+               ERROR_IN_CRL_LAST_UPDATE_FIELD = 15,
+               ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16,
+               OUT_OF_MEM = 17,
+               DEPTH_ZERO_SELF_SIGNED_CERT = 18,
+               SELF_SIGNED_CERT_IN_CHAIN = 19,
+               UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20,
+               UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21,
+               CERT_CHAIN_TOO_LONG = 22,
+               CERT_REVOKED = 23,
+               INVALID_CA = 24,
+               PATH_LENGTH_EXCEEDED = 25,
+               INVALID_PURPOSE = 26,
+               CERT_UNTRUSTED = 27,
+               CERT_REJECTED = 28,
+               /* These are 'informational' when looking for issuer cert */
+               SUBJECT_ISSUER_MISMATCH = 29,
+               AKID_SKID_MISMATCH = 30,
+               AKID_ISSUER_SERIAL_MISMATCH = 31,
+               KEYUSAGE_NO_CERTSIGN = 32,
+
+               UNABLE_TO_GET_CRL_ISSUER = 33,
+               UNHANDLED_CRITICAL_EXTENSION = 34,
+               KEYUSAGE_NO_CRL_SIGN = 35,
+               UNHANDLED_CRITICAL_CRL_EXTENSION = 36,
+               INVALID_NON_CA = 37,
+               PROXY_PATH_LENGTH_EXCEEDED = 38,
+               KEYUSAGE_NO_DIGITAL_SIGNATURE = 39,
+               PROXY_CERTIFICATES_NOT_ALLOWED = 40,
+
+               INVALID_EXTENSION = 41,
+               INVALID_POLICY_EXTENSION = 42,
+               NO_EXPLICIT_POLICY = 43,
+               DIFFERENT_CRL_SCOPE = 44,
+               UNSUPPORTED_EXTENSION_FEATURE = 45,
+
+               UNNESTED_RESOURCE = 46,
+
+               PERMITTED_VIOLATION = 47,
+               EXCLUDED_VIOLATION = 48,
+               SUBTREE_MINMAX = 49,
+               UNSUPPORTED_CONSTRAINT_TYPE = 51,
+               UNSUPPORTED_CONSTRAINT_SYNTAX = 52,
+               UNSUPPORTED_NAME_SYNTAX = 53,
+               CRL_PATH_VALIDATION_ERROR = 54,
+
+               /* Suite B mode algorithm violation */
+               SUITE_B_INVALID_VERSION = 56,
+               SUITE_B_INVALID_ALGORITHM = 57,
+               SUITE_B_INVALID_CURVE = 58,
+               SUITE_B_INVALID_SIGNATURE_ALGORITHM = 59,
+               SUITE_B_LOS_NOT_ALLOWED = 60,
+               SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 = 61,
+
+               /* Host, email and IP check errors */
+               HOSTNAME_MISMATCH = 62,
+               EMAIL_MISMATCH = 63,
+               IP_ADDRESS_MISMATCH = 64,
+
+               /* The application is not happy */
+               APPLICATION_VERIFICATION = 50
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Format.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Format.cs
new file mode 100644 (file)
index 0000000..6ff63ce
--- /dev/null
@@ -0,0 +1,37 @@
+//
+// BtlsX509Format.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       // Keep in sync with NativeBoringX509Format
+       public enum BtlsX509Format
+       {
+               DER = 1,
+               PEM = 2
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Lookup.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Lookup.cs
new file mode 100644 (file)
index 0000000..836088f
--- /dev/null
@@ -0,0 +1,72 @@
+//
+// BtlsX509Lookup.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.IO;
+using System.Security.Cryptography;
+
+namespace Mono.Btls.Interface
+{
+       public class BtlsX509Lookup : BtlsObject
+       {
+               new internal MonoBtlsX509Lookup Instance {
+                       get { return (MonoBtlsX509Lookup)base.Instance; }
+               }
+
+               internal BtlsX509Lookup (MonoBtlsX509Lookup lookup)
+                       : base (lookup)
+               {
+               }
+
+               public void Initialize ()
+               {
+                       Instance.Initialize ();
+               }
+
+               public void Shutdown ()
+               {
+                       Instance.Shutdown ();
+               }
+
+               public BtlsX509 LookupBySubject (BtlsX509Name name)
+               {
+                       var x509 = Instance.LookupBySubject (name.Instance);
+                       if (x509 == null)
+                               return null;
+
+                       return new BtlsX509 (x509);
+               }
+
+               public void LoadFile (string file, BtlsX509Format type)
+               {
+                       Instance.LoadFile (file, (MonoBtlsX509FileType)type);
+               }
+
+               public void AddDirectory (string dir, BtlsX509Format type)
+               {
+                       Instance.AddDirectory (dir, (MonoBtlsX509FileType)type);
+               }
+       }
+}
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Name.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Name.cs
new file mode 100644 (file)
index 0000000..69ca5a9
--- /dev/null
@@ -0,0 +1,62 @@
+//
+// BtlsX509Name.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       public class BtlsX509Name : BtlsObject
+       {
+               new internal MonoBtlsX509Name Instance {
+                       get { return (MonoBtlsX509Name)base.Instance; }
+               }
+
+               internal BtlsX509Name (MonoBtlsX509Name name)
+                       : base (name)
+               {
+               }
+
+               public string GetString ()
+               {
+                       return Instance.GetString ();
+               }
+
+               public byte[] GetRawData (bool use_canon_enc)
+               {
+                       return Instance.GetRawData (use_canon_enc);
+               }
+
+               public long GetHash ()
+               {
+                       return Instance.GetHash ();
+               }
+
+               public long GetHashOld ()
+               {
+                       return Instance.GetHashOld ();
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Purpose.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Purpose.cs
new file mode 100644 (file)
index 0000000..ac906df
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// BtlsX509Purpose.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       // Keep in sync with NativeBoringX509Purpose
+       public enum BtlsX509Purpose
+       {
+               SSL_CLIENT = 1,
+               SSL_SERVER = 2,
+               NS_SSL_SERVER = 3,
+               SMIME_SIGN = 4,
+               SMIME_ENCRYPT = 5,
+               CRL_SIGN = 6,
+               ANY = 7,
+               OCSP_HELPER = 8,
+               TIMESTAMP_SIGN = 9,
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Store.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509Store.cs
new file mode 100644 (file)
index 0000000..7b8f03f
--- /dev/null
@@ -0,0 +1,91 @@
+//
+// BtlsX509Store.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.Security.Cryptography.X509Certificates;
+
+namespace Mono.Btls.Interface
+{
+       public class BtlsX509Store : BtlsObject
+       {
+               new internal MonoBtlsX509Store Instance {
+                       get { return (MonoBtlsX509Store)base.Instance; }
+               }
+
+               internal BtlsX509Store (MonoBtlsX509Store store)
+                       : base (store)
+               {
+               }
+
+               public void LoadLocations (string file, string path)
+               {
+                       Instance.LoadLocations (file, path);
+               }
+
+               public void AddTrustedRoots ()
+               {
+                       Instance.AddTrustedRoots ();
+               }
+
+               public void AddCertificate (BtlsX509 x509)
+               {
+                       Instance.AddCertificate (x509.Instance);
+               }
+
+               public int GetCount ()
+               {
+                       return Instance.GetCount ();
+               }
+
+               public void AddLookup (X509CertificateCollection certificates, BtlsX509TrustKind trust)
+               {
+                       Instance.AddCollection (certificates, (MonoBtlsX509TrustKind)trust);
+               }
+
+               static MonoBtlsX509FileType GetFileType (BtlsX509Format format)
+               {
+                       switch (format) {
+                       case BtlsX509Format.DER:
+                               return MonoBtlsX509FileType.ASN1;
+                       case BtlsX509Format.PEM:
+                               return MonoBtlsX509FileType.PEM;
+                       default:
+                               throw new NotSupportedException ();
+                       }
+               }
+
+               public void AddDirectoryLookup (string dir, BtlsX509Format format)
+               {
+                       Instance.AddDirectoryLookup (dir, GetFileType (format));
+               }
+
+               public void AddFileLookup (string file, BtlsX509Format format)
+               {
+                       Instance.AddFileLookup (file, GetFileType (format));
+               }
+
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreCtx.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreCtx.cs
new file mode 100644 (file)
index 0000000..97d4a06
--- /dev/null
@@ -0,0 +1,71 @@
+//
+// BtlsX509StoreCtx.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       public class BtlsX509StoreCtx : BtlsObject
+       {
+               new internal MonoBtlsX509StoreCtx Instance {
+                       get { return (MonoBtlsX509StoreCtx)base.Instance; }
+               }
+
+               internal BtlsX509StoreCtx (MonoBtlsX509StoreCtx ctx)
+                       : base (ctx)
+               {
+               }
+
+               public void Initialize (BtlsX509Store store, BtlsX509Chain chain)
+               {
+                       Instance.Initialize (store.Instance, chain.Instance);
+               }
+
+               public void SetVerifyParam (BtlsX509VerifyParam param)
+               {
+                       Instance.SetVerifyParam (param.Instance);
+               }
+
+               public int Verify ()
+               {
+                       return Instance.Verify ();
+               }
+
+               public BtlsX509Error GetError ()
+               {
+                       return (BtlsX509Error)Instance.GetError ();
+               }
+
+               public Exception GetException ()
+               {
+                       return Instance.GetException ();
+               }
+
+               public BtlsX509Chain GetChain ()
+               {
+                       return new BtlsX509Chain (Instance.GetChain ());
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreManager.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreManager.cs
new file mode 100644 (file)
index 0000000..1989ff4
--- /dev/null
@@ -0,0 +1,44 @@
+//
+// BtlsX509StoreManager.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.IO;
+using System.Security.Cryptography;
+
+namespace Mono.Btls.Interface
+{
+       public static class BtlsX509StoreManager
+       {
+               public static bool HasStore (BtlsX509StoreType type)
+               {
+                       return MonoBtlsX509StoreManager.HasStore ((MonoBtlsX509StoreType)type);
+               }
+
+               public static string GetStorePath (BtlsX509StoreType type)
+               {
+                       return MonoBtlsX509StoreManager.GetStorePath ((MonoBtlsX509StoreType)type);
+               }
+       }
+}
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreType.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509StoreType.cs
new file mode 100644 (file)
index 0000000..acdfb98
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// BtlsX509StoreType.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.IO;
+using System.Security.Cryptography;
+
+namespace Mono.Btls.Interface
+{
+       // Keep in sync with MonoBtlsX509StoreType
+       public enum BtlsX509StoreType
+       {
+               Custom,
+               MachineTrustedRoots,
+               MachineIntermediateCA,
+               MachineUntrusted,
+               UserTrustedRoots,
+               UserIntermediateCA,
+               UserUntrusted
+       }
+}
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509TrustKind.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509TrustKind.cs
new file mode 100644 (file)
index 0000000..9338ec6
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// BtlsX509TrustKind.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       // Keep in sync with MonoBtlsX509TrustKind
+       [Flags]
+       public enum BtlsX509TrustKind
+       {
+               DEFAULT         = 0,
+               TRUST_CLIENT    = 1,
+               TRUST_SERVER    = 2,
+               TRUST_ALL       = 4,
+               REJECT_CLIENT   = 32,
+               REJECT_SERVER   = 64,
+               REJECT_ALL      = 128
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509VerifyFlags.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509VerifyFlags.cs
new file mode 100644 (file)
index 0000000..02640c8
--- /dev/null
@@ -0,0 +1,38 @@
+//
+// BtlsX509VerifyFlags.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       // Keep in sync with NativeBoringX509VerifyFlags
+       public enum BtlsX509VerifyFlags
+       {
+               DEFAULT = 0,
+               CRL_CHECK = 1,
+               CRL_CHECK_ALL = 2,
+               X509_STRIC = 4
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509VerifyParam.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509VerifyParam.cs
new file mode 100644 (file)
index 0000000..8d4e5eb
--- /dev/null
@@ -0,0 +1,91 @@
+//
+// BtlsX509VerifyParam.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       public class BtlsX509VerifyParam : BtlsObject
+       {
+               new internal MonoBtlsX509VerifyParam Instance {
+                       get { return (MonoBtlsX509VerifyParam)base.Instance; }
+               }
+
+               internal BtlsX509VerifyParam (MonoBtlsX509VerifyParam param)
+                       : base (param)
+               {
+               }
+
+               public BtlsX509VerifyParam Copy ()
+               {
+                       return new BtlsX509VerifyParam (Instance.Copy ());
+               }
+
+               public void SetName (string name)
+               {
+                       Instance.SetName (name);
+               }
+
+               public void SetHost (string name)
+               {
+                       Instance.SetHost (name);
+               }
+
+               public void AddHost (string name)
+               {
+                       Instance.AddHost (name);
+               }
+
+               public BtlsX509VerifyFlags GetFlags ()
+               {
+                       return (BtlsX509VerifyFlags)Instance.GetFlags ();
+               }
+
+               public void SetFlags (BtlsX509VerifyFlags flags)
+               {
+                       Instance.SetFlags ((ulong)flags);
+               }
+
+               public void SetPurpose (BtlsX509Purpose purpose)
+               {
+                       Instance.SetPurpose ((MonoBtlsX509Purpose)purpose);
+               }
+
+               public int GetDepth ()
+               {
+                       return Instance.GetDepth ();
+               }
+
+               public void SetDepth (int depth)
+               {
+                       Instance.SetDepth (depth);
+               }
+
+               public void SetTime (DateTime time)
+               {
+                       Instance.SetTime (time);
+               }
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/VersionInfo.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/VersionInfo.cs
new file mode 100644 (file)
index 0000000..726c4ba
--- /dev/null
@@ -0,0 +1,34 @@
+//
+// VersionInfo.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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 Mono.Btls.Interface
+{
+       public static class VersionInfo
+       {
+               public const string Version = "1.0.0";
+       }
+}
+
diff --git a/mcs/class/Mono.Btls.Interface/Properties/AssemblyInfo.cs b/mcs/class/Mono.Btls.Interface/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..5ff0bcb
--- /dev/null
@@ -0,0 +1,47 @@
+//
+// AssemblyInfo.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.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) 2016 Xamarin")]
+[assembly: AssemblyDescription ("Mono.Btls.Interface")]
+[assembly: AssemblyProduct ("MONO CLI")]
+[assembly: AssemblyTitle ("Mono.Btls.Interface")]
+[assembly: CLSCompliant (true)]
+[assembly: ComVisible (false)]
+[assembly: NeutralResourcesLanguage ("en-US")]
+
diff --git a/mcs/class/Mono.Btls.Interface/README.md b/mcs/class/Mono.Btls.Interface/README.md
new file mode 100644 (file)
index 0000000..81e169c
--- /dev/null
@@ -0,0 +1,9 @@
+Mono.Btls.Interface
+===================
+
+The purpose of this assembly is to allow test suites such as xamarin/web-tests
+(https://github.com/xamarin/web-tests/tree/stable) to test parts of BTLS without
+making System.dll internals visible.
+
+It should not be considered a stable and maintained API for third parties.
+
index 1f86305857f2d743b5a753a20afa9bad286bde69..a262391989b81b504b2ab4a0f1843ceeee11fd51 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,169,219,414,1030,3001,3005,3006</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,169,219,414,1030,3001,3005,3006</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 36c99153b4962d85f4f9e3620e29543ed07348e4..38b09b4f05f5cea62cb0244624e5378bef98f429 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_FEATURE_THREAD_ABORT</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;MONO_FEATURE_THREAD_ABORT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_FEATURE_THREAD_ABORT</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;MONO_FEATURE_THREAD_ABORT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 51868debb9ffd59aa543ab0c2aa416e90a5278ae..23f16885730d463b2573cfdd8dc0936c8ecd49ea 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c4aee220b49858a4c6b34793604d5c0f575932a9..80b7d1aec757556dcd1e0568cadb755890a814a1 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -33,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CECIL</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CECIL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -41,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CECIL</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CECIL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
-    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\AssemblyInfo.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\MdbReader.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\MdbWriter.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.CompilerServices.SymbolWriter\MonoSymbolFile.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.CompilerServices.SymbolWriter\MonoSymbolTable.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.CompilerServices.SymbolWriter\MonoSymbolWriter.cs" />\r
-    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.CompilerServices.SymbolWriter\SymbolWriterImpl.cs" />\r  </ItemGroup>\r
+    <Compile Include="..\..\..\external\cecil\ProjectInfo.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.CompilerServices.SymbolWriter\*.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
       <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
       <Name>System-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
-      <Name>Mono.Cecil-net_4_x</Name>\r
-    </ProjectReference>\r
+    <Reference Include="./../../class/lib/net_4_x/Mono.Cecil.dll">\r
+      <SpecificVersion>False</SpecificVersion>\r
+      <HintPath>./../../class/lib/net_4_x/Mono.Cecil.dll</HintPath>\r
+      <Private>False</Private>\r
+    </Reference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index e2169fc9aeb7aadfad157975d8e8201a44ad1ff9..a497f4b62ff89d124fd7089982132c0082e2a6bb 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -7,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{9BE8D62B-471D-4538-8287-691B4ECE3209}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699</NoWarn>\r
+    <NoWarn>1699,618</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
     <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699</NoWarn>\r
+    <NoWarn>1699,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</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</NoWarn>\r
+    <NoWarn>1699,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
       <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
       <Name>System.Core-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
-      <Name>Mono.Cecil-net_4_x</Name>\r
-    </ProjectReference>\r
+    <Reference Include="./../../class/lib/net_4_x/Mono.Cecil.dll">\r
+      <SpecificVersion>False</SpecificVersion>\r
+      <HintPath>./../../class/lib/net_4_x/Mono.Cecil.dll</HintPath>\r
+      <Private>False</Private>\r
+    </Reference>\r
     <ProjectReference Include="../Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_x.csproj">\r
       <Project>{CF14D34A-F69B-47FB-A99C-D25C77198F30}</Project>\r
       <Name>Mono.Cecil.Mdb-net_4_x</Name>\r
index 984809180a1ea283051576f8071c219b890182a5..9e77c38bdf12f6e1000da5833db06f75588354cc 100644 (file)
@@ -1,2 +1,3 @@
+../../test-helpers/NunitHelpers.cs
 RewriteAndLoad.cs
 TestCCRewrite.cs
index 0b59fa3d3c91b2a45090c2f6ec514b969f00d954..7009825f298fa2e0caa78acb06527202ef39cf31 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 4d142314b9efb96d53d59d4ab4b061ccf22d780d..acd269f5c4e3dcec29a7524fc9fecfa536c17d41 100644 (file)
@@ -682,6 +682,7 @@ namespace Mono.CompilerServices.SymbolWriter
                byte[] hash;
                bool creating;
                bool auto_generated;
+               readonly string sourceFile;
 
                public static int Size {
                        get { return 8; }
@@ -696,11 +697,17 @@ namespace Mono.CompilerServices.SymbolWriter
                        creating = true;
                }
 
-               public SourceFileEntry (MonoSymbolFile file, string file_name, byte[] guid, byte[] checksum)
-                       : this (file, file_name)
+               public SourceFileEntry (MonoSymbolFile file, string sourceFile, byte [] guid, byte [] checksum)
+                       : this (file, sourceFile, sourceFile, guid, checksum)
+               {
+               }
+
+               public SourceFileEntry (MonoSymbolFile file, string fileName, string sourceFile, byte[] guid, byte[] checksum)
+                       : this (file, fileName)
                {
                        this.guid = guid;
                        this.hash = checksum;
+                       this.sourceFile = sourceFile;
                }
 
                public byte[] Checksum {
@@ -719,7 +726,7 @@ namespace Mono.CompilerServices.SymbolWriter
 
                        if (hash == null) {
                                try {
-                                   using (FileStream fs = new FileStream (file_name, FileMode.Open, FileAccess.Read)) {
+                                   using (FileStream fs = new FileStream (sourceFile, FileMode.Open, FileAccess.Read)) {
                                        MD5 md5 = MD5.Create ();
                                        hash = md5.ComputeHash (fs);
                                    }
@@ -749,7 +756,7 @@ namespace Mono.CompilerServices.SymbolWriter
                        int old_pos = (int) reader.BaseStream.Position;
                        reader.BaseStream.Position = DataOffset;
 
-                       file_name = reader.ReadString ();
+                       sourceFile = file_name = reader.ReadString ();
                        guid = reader.ReadBytes (16);
                        hash = reader.ReadBytes (16);
                        auto_generated = reader.ReadByte () == 1;
@@ -778,7 +785,7 @@ namespace Mono.CompilerServices.SymbolWriter
                public bool CheckChecksum ()
                {
                        try {
-                               using (FileStream fs = new FileStream (file_name, FileMode.Open)) {
+                               using (FileStream fs = new FileStream (sourceFile, FileMode.Open)) {
                                        MD5 md5 = MD5.Create ();
                                        byte[] data = md5.ComputeHash (fs);
                                        for (int i = 0; i < 16; i++)
index 89763f52ec9185327ba7f17d63a6ffc14e349b6e..816fb68dc5fc3bcbc9fb8669317cfd8e68fb3166 100644 (file)
@@ -187,13 +187,54 @@ namespace Mono.CompilerServices.SymbolWriter
                public void DefineMethod (MonoSymbolFile file, int token)
                {
                        var blocks = Blocks;
+                       if (blocks.Length > 0) {
+                               //
+                               // When index is provided by user it can be inserted in
+                               // any order but mdb format does not store its value. It
+                               // uses stored order as the index instead.
+                               //
+                               var sorted = new List<CodeBlockEntry> (blocks.Length);
+                               int max_index = 0;
+                               for (int i = 0; i < blocks.Length; ++i) {
+                                       max_index = System.Math.Max (max_index, blocks [i].Index);
+                               }
+
+                               for (int i = 0; i < max_index; ++i) {
+                                       var scope_index = i + 1;
+
+                                       //
+                                       // Common fast path
+                                       //
+                                       if (i < blocks.Length && blocks [i].Index == scope_index) {
+                                               sorted.Add (blocks [i]);
+                                               continue;
+                                       }
+
+                                       bool found = false;
+                                       for (int ii = 0; ii < blocks.Length; ++ii) {
+                                               if (blocks [ii].Index == scope_index) {
+                                                       sorted.Add (blocks [ii]);
+                                                       found = true;
+                                                       break;
+                                               }
+                                       }
+
+                                       if (found)
+                                               continue;
+
+                                       //
+                                       // Ideally this should never happen but with current design we can
+                                       // generate scope index for unreachable code before reachable code
+                                       //
+                                       sorted.Add (new CodeBlockEntry (scope_index, -1, CodeBlockEntry.Type.CompilerGenerated, 0));
+                               }
 
-                       //
-                       // When index is provided by user it can be inserted in
-                       // any order but mdb format does not store its value. It
-                       // uses store order instead as the index.
-                       //
-                       Array.Sort (blocks, (x, y) => x.Index.CompareTo (y.Index));
+                               blocks = sorted.ToArray ();
+                               //for (int i = 0; i < blocks.Length; ++i) {
+                               //      if (blocks [i].Index - 1 != i)
+                               //                      throw new ArgumentException ("CodeBlocks cannot be converted to mdb format");
+                               //}
+                       }
 
                        var entry = new MethodEntry (
                                file, _comp_unit.Entry, token, ScopeVariables,
index 7a1ee0ced12a4d53865db6a531fc8e46ddc87f7b..68b8199972c39cc9aefc7b17e324330983d236be 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SQLITE_STANDARD</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;SQLITE_STANDARD</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SQLITE_STANDARD</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;SQLITE_STANDARD</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7f35914d241f72792d3667671bf8add783dd3dca..45b2db176875cbf3a4dc9fc0811ae180b64a71d3 100644 (file)
@@ -221,7 +221,7 @@ namespace Mono.Data.Sqlite
         case SQLiteDateFormats.UnixEpoch:\r
           return ((long)(dateValue.Subtract(UnixEpoch).Ticks / TimeSpan.TicksPerSecond)).ToString();\r
         default:\r
-          return dateValue.ToString(_datetimeFormats[7], CultureInfo.InvariantCulture);\r
+          return dateValue.ToString(_datetimeFormats[5], CultureInfo.InvariantCulture);\r
       }\r
     }\r
 \r
index 0a02896ef8ddaa01b2ebec83459d4cfeadc88807..643c40a86da80e8ac3d3afd94d1d04c4cf43d7f2 100644 (file)
@@ -6,4 +6,4 @@ SqliteExceptionUnitTests.cs
 SqliteParameterUnitTests.cs
 SqliteFunctionTests.cs
 Bug27864.cs
-
+SqliteTests.cs
index d64d3055b999b36e07e8ba66aeed04a5aba275c0..b381e1fde72bbdc7d29dd4ffdb482cb863bd5a9c 100644 (file)
@@ -9,7 +9,6 @@
 // Copyright 2015 Xamarin Inc.
 //
 
-#if MONOTOUCH
 using System;
 using System.Data;
 using System.IO;
@@ -96,13 +95,14 @@ namespace MonoTests.Mono.Data.Sqlite {
                                        }
                                }
                        } catch (SqliteException ex) {
+#if MONOTOUCH
                                // Expected Exception from iOS 8.2 (broken) to 9.0 (fixed)
                                if (BCL.Tests.TestRuntime.CheckSystemVersion (8,2) && !BCL.Tests.TestRuntime.CheckSystemVersion (9,0)) 
                                        Assert.That (ex.Message.Contains ("no such column: com.Name"));
                                else
-                                       throw new AssertionException ("Unexpected Sqlite Error", ex); // This should not happen
+                                       throw;
+#endif
                        }
                }
        }
 }
-#endif
\ No newline at end of file
diff --git a/mcs/class/Mono.Data.Sqlite/Test/SqliteTests.cs b/mcs/class/Mono.Data.Sqlite/Test/SqliteTests.cs
new file mode 100644 (file)
index 0000000..1533945
--- /dev/null
@@ -0,0 +1,102 @@
+//
+// SqliteTests.cs
+//
+// 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.Data;
+using System.IO;
+using System.Text;
+using Mono.Data.Sqlite;
+using NUnit.Framework;
+
+namespace MonoTests.Mono.Data.Sqlite
+{
+       [TestFixture]
+       public class SqliteTests
+       {
+               string _databasePath;
+
+               [SetUp]
+               public void Setup ()
+               {
+                       var dataFolder = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "SqlTest");
+
+                       _databasePath = Path.Combine (dataFolder, "database.db");
+
+                       if (!Directory.Exists (dataFolder)) {
+                               Directory.CreateDirectory (dataFolder);
+                       }
+
+                       File.Delete (_databasePath);
+               }
+
+               [TearDown]
+               public void TearDown ()
+               {
+                       try {
+                               File.Delete (_databasePath);
+                       } catch {
+                       }
+               }
+
+               [Test]
+               public void DateTimeConvert ()
+               {
+                       var dateTime = new DateTime (2016, 9, 15, 12, 1, 53);
+                       var guid = Guid.NewGuid ();
+
+                       using (var connection = new SqliteConnection ("Data Source=" + _databasePath)) {
+                               connection.Open ();
+
+                               var sqlCreate = "CREATE TABLE TestTable (ID uniqueidentifier PRIMARY KEY, Modified datetime)";
+                               using (var cmd = new SqliteCommand (sqlCreate, connection)) {
+                                       cmd.ExecuteNonQuery ();
+                               }
+
+                               var sqlInsert = "INSERT INTO TestTable (ID, Modified) VALUES (@id, @mod)";
+                               using (var cmd = new SqliteCommand (sqlInsert, connection)) {
+                                       cmd.Parameters.Add (new SqliteParameter ("@id", guid));
+                                       cmd.Parameters.Add (new SqliteParameter ("@mod", dateTime));
+                                       cmd.ExecuteNonQuery ();
+                               }
+                       }
+
+                       using (var connection = new SqliteConnection ("Data Source=" + _databasePath)) {
+                               connection.Open ();
+
+                               var sqlSelect = "SELECT * from TestTable";
+                               using (var cmd = new SqliteCommand (sqlSelect, connection))
+                               using (var reader = cmd.ExecuteReader ()) {
+                                       while (reader.Read ()) {
+                                               Assert.AreEqual (guid, reader.GetGuid (0), "#1");
+                                               Assert.AreEqual (dateTime, reader.GetDateTime (1), "#2");
+                                       }
+                               }
+                       }
+               }
+       }
+}
index a1b59026c1d47d9fb1fb80625a395623579d1e80..bbd4da09f77dddfd312f823c24184f808948ba9d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1f20c1f89c63b6dceeb793a7241f8a2d4a6d34c2..e2fa98dcebe04e7629af935ed7847e9df90bfd16 100644 (file)
@@ -16,7 +16,8 @@ VALID_TEST_PROFILE := $(filter net_4_x, $(PROFILE))
 ifdef VALID_TEST_PROFILE
 
 TEST_HELPERS_SOURCES = \
-       ../test-helpers/NetworkHelpers.cs
+       ../test-helpers/NetworkHelpers.cs \
+       Test/TypeLoadClass.cs
 
 test-local: dtest-app.exe dtest-excfilter.exe
 
index 51d78f17c2fbf656c1dbb7b1a121a458e6ad6bfb..5d1f3e7554654c2f96bea87b6881d6b4be780e82 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -33,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_DATACONVERTER_STATIC_METHODS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;MONO_DATACONVERTER_STATIC_METHODS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -41,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_DATACONVERTER_STATIC_METHODS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;MONO_DATACONVERTER_STATIC_METHODS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -91,6 +92,7 @@
     <Compile Include="Mono.Debugger.Soft\InvocationException.cs" />\r
     <Compile Include="Mono.Debugger.Soft\InvokeOptions.cs" />\r
     <Compile Include="Mono.Debugger.Soft\ITargetProcess.cs" />\r
+    <Compile Include="Mono.Debugger.Soft\LocalScope.cs" />\r
     <Compile Include="Mono.Debugger.Soft\LocalVariable.cs" />\r
     <Compile Include="Mono.Debugger.Soft\Location.cs" />\r
     <Compile Include="Mono.Debugger.Soft\MethodBodyMirror.cs" />\r
       <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
       <Name>System-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
-      <Name>Mono.Cecil-net_4_x</Name>\r
-    </ProjectReference>\r
+    <Reference Include="./../../class/lib/net_4_x/Mono.Cecil.dll">\r
+      <SpecificVersion>False</SpecificVersion>\r
+      <HintPath>./../../class/lib/net_4_x/Mono.Cecil.dll</HintPath>\r
+      <Private>False</Private>\r
+    </Reference>\r
     <ProjectReference Include="../System.Core/System.Core-net_4_x.csproj">\r
       <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
       <Name>System.Core-net_4_x</Name>\r
diff --git a/mcs/class/Mono.Debugger.Soft/Test/TypeLoadClass.cs b/mcs/class/Mono.Debugger.Soft/Test/TypeLoadClass.cs
new file mode 100644 (file)
index 0000000..dfe4c3e
--- /dev/null
@@ -0,0 +1,11 @@
+
+class TypeLoadClass
+{
+       static TypeLoadClass ()
+       {
+       }
+}
+
+class TypeLoadClass2
+{
+}
\ No newline at end of file
index cc2ab66960fa5f3ed36e6e70c52278f6a27d6fac..ac3b91b9247f3973b753be0dfeb035ab3aead757 100644 (file)
@@ -430,6 +430,7 @@ public class Tests : TestsBase, ITest2
                ss_recursive2 (1);
                ss_recursive_chaotic ();
                ss_fp_clobber ();
+               ss_no_frames ();
        }
 
        [MethodImplAttribute (MethodImplOptions.NoInlining)]
@@ -679,6 +680,25 @@ public class Tests : TestsBase, ITest2
        public static void ss_fp_clobber_2 (double d) {
        }
 
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static void ss_no_frames () {
+               Action a = ss_no_frames_2;
+               var ar = a.BeginInvoke (null, null);
+               ar.AsyncWaitHandle.WaitOne ();
+               // Avoid waiting every time this runs
+               if (static_i == 56)
+                       Thread.Sleep (200);
+               ss_no_frames_3 ();
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static void ss_no_frames_2 () {
+       }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       public static void ss_no_frames_3 () {
+       }
+
        [MethodImplAttribute (MethodImplOptions.NoInlining)]
        public static bool is_even (int i) {
                return i % 2 == 0;
@@ -1589,12 +1609,6 @@ public class Tests : TestsBase, ITest2
        }
 }
 
-class TypeLoadClass {
-}
-
-class TypeLoadClass2 {
-}
-
 public class SentinelClass : MarshalByRefObject {
 }
 
@@ -1620,6 +1634,25 @@ public class Foo
        public ProcessStartInfo info;
 }
 
+class LocalReflectClass
+{
+       public static void RunMe ()
+       {
+               var reflectMe = new someClass ();
+               var temp = reflectMe; // Breakpoint location
+               reflectMe.someMethod ();
+       }
+
+       class someClass : ContextBoundObject
+       {
+               public object someField;
+
+               public void someMethod ()
+               {
+               }
+       }
+}
+
 // Class used for line number info testing, don't change its layout
 public class LineNumbers
 {
@@ -1643,22 +1676,5 @@ public class LineNumbers
        }
 }
 
-class LocalReflectClass
-{
-       public static void RunMe ()
-       {
-               var reflectMe = new someClass ();
-               reflectMe.someMethod ();
-       }
-
-       class someClass : ContextBoundObject
-       {
-               public object someField;
-
-               public void someMethod ()
-               {
-               }
-       }
-}
 
 
index 505ab2abdbed718b6c4b74e583045da1a0fc4ab2..c07fdd26d21034e41c42c6851a344608afae0b7f 100644 (file)
@@ -558,7 +558,11 @@ public class DebuggerTests
                MethodMirror m = entry_point.DeclaringType.Assembly.GetType ("LocalReflectClass").GetMethod ("RunMe");
 
                Assert.IsNotNull (m);
-               //Console.WriteLine ("X: " + name + " " + m.ILOffsets.Count + " " + m.Locations.Count);
+
+//             foreach (var x in m.Locations) {
+//                     Console.WriteLine (x);
+//             }
+
                var offset = -1;
                int method_base_linum = m.Locations [0].LineNumber;
                foreach (var location in m.Locations)
@@ -586,7 +590,11 @@ public class DebuggerTests
                e = single_step (e.Thread);
 
                var frame = e.Thread.GetFrames ()[0];
-               Value variable = frame.GetValue (frame.Method.GetLocal ("reflectMe"));
+
+               Assert.IsNotNull (frame);
+               var field = frame.Method.GetLocal ("reflectMe");
+               Assert.IsNotNull (field);
+               Value variable = frame.GetValue (field);
 
                ObjectMirror thisObj = (ObjectMirror)variable;
                TypeMirror thisType = thisObj.Type;
@@ -898,6 +906,28 @@ public class DebuggerTests
                req.Disable ();
        }
 
+       [Test]
+       public void SingleSteppingNoFrames () {
+               //
+               // Test what happens when starting a single step operation on a thread
+               // with no managed frames
+               //
+               // Run a delegate on a tp thread
+               var e = run_until ("ss_no_frames_2");
+
+               var this_type = e.Thread.GetFrames ()[0].Method.DeclaringType;
+               this_type.SetValue (this_type.GetField ("static_i"), vm.CreateValue (56));
+
+               var thread = e.Thread;
+               var e2 = run_until ("ss_no_frames_3");
+               // The tp thread should be idle now
+               step_req = vm.CreateStepRequest (thread);
+               step_req.Depth = StepDepth.Over;
+               AssertThrows<Exception> (delegate {
+                       step_req.Enable ();
+                       });
+       }
+
        [Test]
        public void MethodEntryExit () {
                run_until ("single_stepping");
@@ -3593,6 +3623,8 @@ public class DebuggerTests
                        return;
 
                string srcfile = (e as BreakpointEvent).Method.DeclaringType.GetSourceFiles (true)[0];
+               srcfile = srcfile.Replace ("dtest-app.cs", "TypeLoadClass.cs");
+               Assert.IsTrue (srcfile.Contains ("TypeLoadClass.cs"));
 
                var req = vm.CreateTypeLoadRequest ();
                req.SourceFileFilter = new string [] { srcfile.ToUpper () };
index 781affa962a70637a5b24e3271886ad1ec55044f..e99fba0cfa4cc6e8665d84ae867b5fe14d815265 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9aa0a5dffaf85f310ce84f3c8828737d2dc8699a..2cd63b068243800bf740413c2b2d74a98a1f080d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 40771592cda08379045b3013d8644da60516962d..3f75b4c374739e16afdf6f807737a91f8f359cda 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 8b83f6323907e479ef4c20d46a86603b246a5c8b..35d36d22cc04bfa8d2a4441c77d1d4744a57d005 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d8f8685ff498a07648df1afe0ae3ba96eb694e45..6269cc1d4c3fd0292b6dad0640f438fa1c0c811e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f5de89dfdd4753428e3242c3e3ddbd21c02f9cf3..f6ff6cfff287631136bb5930dbb631a26aa09968 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;INSIDE_MONO_PARALLEL</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;INSIDE_MONO_PARALLEL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;INSIDE_MONO_PARALLEL</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;INSIDE_MONO_PARALLEL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1eb8276dbde5a7eae4bf842def1b68edff5afaea..c187abfe371c2a2309625f06d481169d4f1a32b7 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 Mono.Collections.Concurrent/CollectionStressTestHelper.cs
 Mono.Collections.Concurrent/ConcurrentSkipListTests.cs
 Mono.Threading/ParallelTestHelper.cs
index 51e6db7e1d820b7e97deff2aa6f6370cd2ec5978..c0606e3fecdbd38e00e86531fec860a174ac67bb 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,618,612</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,618,612</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a2f290f8656ed6bd2f002f6c1d1f468e9007ea15..55773333f78b9a554cc45b94c2698868d4f26fdf 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 Mono.Unix/ReadlinkTest.cs
 Mono.Unix/StdioFileStreamTest.cs
 Mono.Unix/UnixEncodingTest.cs
index f68fe53b8ce70b896dbb603a9530042fddae1885..892f087e48f9b00aa3dbefa0b306c454c522fe91 100644 (file)
@@ -8,9 +8,7 @@
 //
 
 using NUnit.Framework;
-#if !MONODROID
-using NUnit.Framework.SyntaxHelpers;
-#endif
+
 using System;
 using System.Text;
 using System.Threading;
@@ -21,7 +19,7 @@ using Mono.Unix.Native;
 namespace MonoTests.Mono.Unix.Native {
 
        [TestFixture]
-       [Category ("NotOnMac")]
+       [Category ("NotOnMac"), Category ("NotOnWindows")]
        public class RealTimeSignumTest 
        {
                [Test]
index 3ec10f916cebc48da8f46d660c50e2baf61dd1fd..31c4549dd6e2a3e8a269eafd6b4c6e7d880a4c3c 100644 (file)
@@ -20,7 +20,7 @@ using NUnit.Framework;
 
 namespace MonoTests.Mono.Unix.Native
 {
-       [TestFixture, Category ("NotDotNet")]
+       [TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
        public class SocketTest {
 
                string TempFolder;
index 1b7b77d5aca4704f5ff51304098543516268bfb2..aa0c06b76c61b87b2f76f222457d2069badf59ac 100644 (file)
@@ -17,7 +17,7 @@ using Mono.Unix.Native;
 
 namespace MonoTests.Mono.Unix.Native {
 
-       [TestFixture]
+       [TestFixture, Category ("NotOnWindows")]
        public class StdlibTest
        {
                private class SignalTest {
index 608127b568c81272027312ca22a7629841e02e3a..2f286d49b8193765c9f2cbd57c432e7b0c0e857d 100644 (file)
@@ -18,7 +18,7 @@ using NUnit.Framework;
 
 namespace MonoTests.Mono.Unix
 {
-       [TestFixture, Category ("NotDotNet")]
+       [TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
        public class ReadlinkTest {
 
                static string[] Targets = {
@@ -173,7 +173,7 @@ namespace MonoTests.Mono.Unix
                                        long r = Syscall.readlink (link, buf);
                                        if (r < 0)
                                                UnixMarshal.ThrowExceptionForLastError ();
-                                       Assert.GreaterOrEqual (buf.Length, r);
+                                       AssertHelper.GreaterOrEqual (buf.Length, r);
                                        if (r == buf.Length)
                                                buf = new byte[checked (buf.Length * 2)];
                                        else
@@ -199,7 +199,7 @@ namespace MonoTests.Mono.Unix
                                        long r = Syscall.readlinkat (TempFD, "link", buf);
                                        if (r < 0)
                                                UnixMarshal.ThrowExceptionForLastError ();
-                                       Assert.GreaterOrEqual (buf.Length, r);
+                                       AssertHelper.GreaterOrEqual (buf.Length, r);
                                        if (r == buf.Length)
                                                buf = new byte[checked (buf.Length * 2)];
                                        else
@@ -226,7 +226,7 @@ namespace MonoTests.Mono.Unix
                                        if (r < 0)
                                                UnixMarshal.ThrowExceptionForLastError ();
                                        Assert.AreEqual (r, sb.Length);
-                                       Assert.GreaterOrEqual (sb.Capacity, r);
+                                       AssertHelper.GreaterOrEqual (sb.Capacity, r);
                                        if (r == sb.Capacity)
                                                checked { sb.Capacity *= 2; }
                                        else
@@ -255,7 +255,7 @@ namespace MonoTests.Mono.Unix
                                        if (r < 0)
                                                UnixMarshal.ThrowExceptionForLastError ();
                                        Assert.AreEqual (r, sb.Length);
-                                       Assert.GreaterOrEqual (sb.Capacity, r);
+                                       AssertHelper.GreaterOrEqual (sb.Capacity, r);
                                        if (r == sb.Capacity)
                                                checked { sb.Capacity *= 2; }
                                        else
index 21e5b791636f6aa6da1e6b9b3a9ce0091155cadd..837fe4ec26309bc7fb336de4165c57cc263700e5 100644 (file)
@@ -17,7 +17,7 @@ using Mono.Unix;
 
 namespace MonoTests.Mono.Unix {
 
-    [TestFixture]
+    [TestFixture, Category ("NotOnWindows")]
     public class UnixEndPointTest {
 
         // Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=35004
index 81e775e64b0d517b962928b2b4bd04301390aabf..da6bbe083723479f7d3e4bcb9a1ac199d2f6fe4c 100644 (file)
@@ -21,7 +21,7 @@ using Syscall = Mono.Unix.Native.Syscall;
 
 namespace MonoTests.Mono.Unix {
 
-       [TestFixture, Category ("NotDotNet")]
+       [TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
        public class UnixGroupTest
        {
                [Test]
index b2312b5590fe9751ff1a8c42f15d92a2779aa50e..ad2d3089a42918407f930f779c260b40774e3cb3 100644 (file)
@@ -14,7 +14,7 @@ using Mono.Unix;
 
 namespace MonoTests.Mono.Unix {
 
-    [TestFixture]
+    [TestFixture, Category ("NotOnWindows")]
     public class UnixListenerTest {
 
         // test that a socket file is created and deleted by the UnixListener
index e27a5dd246c68ef04c4f602b6fda95195e4f69aa..8ae50b98c977fa9af5531e7dbae9227c8d8586cd 100644 (file)
@@ -28,7 +28,7 @@ namespace MonoTests.Mono.Unix {
                }
        }
 
-       [TestFixture]
+       [TestFixture, Category ("NotOnWindows")]
        public class UnixMarshalTest {
 #if false
                public static void Main ()
index c21348748dcbace4ecaa98b58e0591dfa6012e5a..6c10225dfe72a0876dd329f2c97b98121c00f9ce 100644 (file)
@@ -16,7 +16,7 @@ using Mono.Unix;
 namespace MonoTests.Mono.Unix
 {
 
-       [TestFixture, Category ("NotDotNet")]
+       [TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
        public class UnixPathTest {
 
                private static readonly char DSC = UnixPath.DirectorySeparatorChar;
index 9abc27094c9d0fe4c8fb8610e8b767386a4e0e8e..5dc422d5a344aba7e90b92009d455925ed63dd0d 100644 (file)
@@ -8,21 +8,17 @@
 //
 
 using NUnit.Framework;
-#if !MONODROID
-using NUnit.Framework.SyntaxHelpers;
-#endif
+
 using System;
 using System.Text;
 using System.Threading;
 using Mono.Unix;
 using Mono.Unix.Android;
 using Mono.Unix.Native;
-#if !MONODROID
-namespace NUnit.Framework.SyntaxHelpers { class Dummy {} }
-#endif
+
 namespace MonoTests.Mono.Unix {
 
-       [TestFixture]
+       [TestFixture, Category ("NotOnWindows")]
        public class UnixSignalTest {
 
                // helper method to create a thread waiting on a UnixSignal
index 30f0450637ca6e68faa464296628120ee4abfd73..68a36c935c67f09a1217056961986a3762a9be67 100644 (file)
@@ -21,7 +21,7 @@ using Syscall = Mono.Unix.Native.Syscall;
 
 namespace MonoTests.Mono.Unix {
 
-       [TestFixture, Category ("NotDotNet")]
+       [TestFixture, Category ("NotDotNet"), Category ("NotOnWindows")]
        public class UnixUserTest
        {
                [Test]
index ae7afa670cb5380ad33e9656aace557e13adde50..aa931ee9db789b334cb89012a555eff52bc07c37 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS =
 include ../../build/rules.make
 
 LIBRARY = Mono.Reactive.Testing.dll
-LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.PlatformServices System.Reactive.Providers System.Reactive.Runtime.Remoting System.Reactive.Experimental System.Reactive.Windows.Forms System.Reactive.Windows.Threading System.Reactive.Observable.Aliases System.Windows.Forms WindowsBase nunit.framework
+LIB_REFS = System System.Core System.Reactive.Interfaces System.Reactive.Core System.Reactive.Linq System.Reactive.PlatformServices System.Reactive.Providers System.Reactive.Runtime.Remoting System.Reactive.Experimental System.Reactive.Windows.Forms System.Reactive.Windows.Threading System.Reactive.Observable.Aliases System.Windows.Forms WindowsBase nunitlite
 LIB_MCS_FLAGS = \
                @more_build_args \
                -d:NUNIT -d:MONO -d:DESKTOPCLR
index 6eb3f05da224a9b1b444b7156f27f34b432d7c08..f1d5e78befe533293c1d0fd220be30bc5e6173b7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 70678d2f0ca39e3d36eefc4f9dcf8c88446b46f3..9c02550eca2719a40bbc41ddc41a2e60f87efb07 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1030,3009</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1030,3009</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f92ad900e84de0dc65e7169d767c6164d76139da..89f9aaed0748d2760ef74c49be8c6763426889de 100644 (file)
@@ -72,7 +72,7 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
 
                private void GetClientCertificate ()
                {
-#warning "Client certificate selection is unfinished"
+// TODO: Client certificate selection is unfinished
                        ClientContext context = (ClientContext)this.Context;
 
                        // note: the server may ask for mutual authentication 
index b3831248d425de52dae3104c78ee4362e4ca1334..f741f95a7daf8097d8900daa2f32cd2c480bdb7a 100644 (file)
@@ -73,7 +73,7 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
                        // Check server prf against client prf
                        if (!Compare (clientHash, serverHash))
                        {
-#warning Review that selected alert is correct
+// TODO: Review that selected alert is correct
                                throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid ServerFinished message received.");
                        }
                }
index cb96ce12e4626fcb93c168b0d84a461f2b3a5a57..e74c7be0dd9773ce6f048fadc031d3178e8cc40e 100644 (file)
@@ -38,6 +38,8 @@ using System.Security.Cryptography;
 using Mono.Security.Cryptography;
 using Mono.Security.X509.Extensions;
 
+using SSCX = System.Security.Cryptography.X509Certificates;
+
 namespace Mono.Security.X509 {
 
 #if INSIDE_CORLIB
@@ -51,12 +53,14 @@ namespace Mono.Security.X509 {
                private X509CertificateCollection _certificates;
                private ArrayList _crls;
                private bool _crl;
+               private bool _newFormat;
                private string _name;
 
-               internal X509Store (string path, bool crl
+               internal X509Store (string path, bool crl, bool newFormat)
                {
                        _storePath = path;
                        _crl = crl;
+                       _newFormat = newFormat;
                }
 
                // properties
@@ -126,6 +130,11 @@ namespace Mono.Security.X509 {
                {
                        CheckStore (_storePath, true);
 
+                       if (_newFormat) {
+                               ImportNewFormat (certificate);
+                               return;
+                       }
+
                        string filename = Path.Combine (_storePath, GetUniqueName (certificate));
                        if (!File.Exists (filename)) {
                                filename = Path.Combine (_storePath, GetUniqueNameWithSerial (certificate));
@@ -165,6 +174,9 @@ namespace Mono.Security.X509 {
                {
                        CheckStore (_storePath, true);
 
+                       if (_newFormat)
+                               throw new NotSupportedException ();
+
                        string filename = Path.Combine (_storePath, GetUniqueName (crl));
                        if (!File.Exists (filename)) {
                                using (FileStream fs = File.Create (filename)) {
@@ -177,6 +189,11 @@ namespace Mono.Security.X509 {
 
                public void Remove (X509Certificate certificate) 
                {
+                       if (_newFormat) {
+                               RemoveNewFormat (certificate);
+                               return;
+                       }
+
                        string filename = Path.Combine (_storePath, GetUniqueNameWithSerial (certificate));
                        if (File.Exists (filename)) {
                                File.Delete (filename);
@@ -192,6 +209,9 @@ namespace Mono.Security.X509 {
 
                public void Remove (X509Crl crl) 
                {
+                       if (_newFormat)
+                               throw new NotSupportedException ();
+
                        string filename = Path.Combine (_storePath, GetUniqueName (crl));
                        if (File.Exists (filename)) {
                                File.Delete (filename);
@@ -199,6 +219,41 @@ namespace Mono.Security.X509 {
                        }
                }
 
+               // new format
+
+               void ImportNewFormat (X509Certificate certificate)
+               {
+#if INSIDE_CORLIB
+                       throw new NotSupportedException ();
+#else
+                       using (var sscxCert = new SSCX.X509Certificate (certificate.RawData)) {
+                               var hash = SSCX.X509Helper2.GetSubjectNameHash (sscxCert);
+                               var filename = Path.Combine (_storePath, string.Format ("{0:x8}.0", hash));
+                               if (!File.Exists (filename)) {
+                                       using (FileStream fs = File.Create (filename))
+                                               SSCX.X509Helper2.ExportAsPEM (sscxCert, fs, true);
+                                       ClearCertificates ();
+                               }
+                       }
+#endif
+               }
+
+               void RemoveNewFormat (X509Certificate certificate)
+               {
+#if INSIDE_CORLIB
+                       throw new NotSupportedException ();
+#else
+                       using (var sscxCert = new SSCX.X509Certificate (certificate.RawData)) {
+                               var hash = SSCX.X509Helper2.GetSubjectNameHash (sscxCert);
+                               var filename = Path.Combine (_storePath, string.Format ("{0:x8}.0", hash));
+                               if (File.Exists (filename)) {
+                                       File.Delete (filename);
+                                       ClearCertificates ();
+                               }
+                       }
+#endif
+               }
+
                // private stuff
 
                private string GetUniqueNameWithSerial (X509Certificate certificate)
index db735834acd4ca39c0310cca71612eeadac7a7c9..7f31713b1b226e6aed757774cbd181afb28c159a 100644 (file)
@@ -45,8 +45,12 @@ namespace Mono.Security.X509 {
 
                static private string _userPath;
                static private string _localMachinePath;
+               static private string _newUserPath;
+               static private string _newLocalMachinePath;
                static private X509Stores _userStore;
                static private X509Stores _machineStore;
+               static private X509Stores _newUserStore;
+               static private X509Stores _newMachineStore;
 
                private X509StoreManager ()
                {
@@ -55,10 +59,10 @@ namespace Mono.Security.X509 {
                internal static string CurrentUserPath {
                        get {
                                if (_userPath == null) {
-                                       _userPath = Path.Combine(
-                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
+                                       _userPath = Path.Combine (
+                                                       Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
                                                        ".mono");
-                                       _userPath = Path.Combine(_userPath, "certs");
+                                       _userPath = Path.Combine (_userPath, "certs");
                                }
                                return _userPath;
                        }
@@ -76,10 +80,34 @@ namespace Mono.Security.X509 {
                        }
                }
 
+               internal static string NewCurrentUserPath {
+                       get {
+                               if (_newUserPath == null) {
+                                       _newUserPath = Path.Combine (
+                                                       Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData),
+                                                       ".mono");
+                                       _newUserPath = Path.Combine (_newUserPath, "new-certs");
+                               }
+                               return _newUserPath;
+                       }
+               }
+
+               internal static string NewLocalMachinePath {
+                       get {
+                               if (_newLocalMachinePath == null) {
+                                       _newLocalMachinePath = Path.Combine (
+                                               Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData),
+                                               ".mono");
+                                       _newLocalMachinePath = Path.Combine (_newLocalMachinePath, "new-certs");
+                               }
+                               return _newLocalMachinePath;
+                       }
+               }
+
                static public X509Stores CurrentUser {
                        get { 
                                if (_userStore == null)
-                                       _userStore = new X509Stores(CurrentUserPath);
+                                       _userStore = new X509Stores (CurrentUserPath, false);
                                
                                return _userStore;
                        }
@@ -88,12 +116,30 @@ namespace Mono.Security.X509 {
                static public X509Stores LocalMachine {
                        get {
                                if (_machineStore == null) 
-                                       _machineStore = new X509Stores (LocalMachinePath);
+                                       _machineStore = new X509Stores (LocalMachinePath, false);
 
                                return _machineStore;
                        }
                }
 
+               static public X509Stores NewCurrentUser {
+                       get {
+                               if (_newUserStore == null)
+                                       _newUserStore = new X509Stores (NewCurrentUserPath, true);
+
+                               return _newUserStore;
+                       }
+               }
+
+               static public X509Stores NewLocalMachine {
+                       get {
+                               if (_newMachineStore == null)
+                                       _newMachineStore = new X509Stores (NewLocalMachinePath, true);
+
+                               return _newMachineStore;
+                       }
+               }
+
                // Merged stores collections
                // we need to look at both the user and the machine (entreprise)
                // certificates/CRLs when building/validating a chain
index bfe7451b5dee1c229ac4ff2ae990ff92a60af0b8..071faa70dddefdf8aa7c6f8f7b33f2f80dad92e4 100644 (file)
@@ -44,15 +44,17 @@ namespace Mono.Security.X509 {
        class X509Stores {
 
                private string _storePath;
+               private bool _newFormat;
                private X509Store _personal;
                private X509Store _other;
                private X509Store _intermediate;
                private X509Store _trusted;
                private X509Store _untrusted;
 
-               internal X509Stores (string path
+               internal X509Stores (string path, bool newFormat)
                {
                        _storePath = path;
+                       _newFormat = newFormat;
                }
 
                // properties
@@ -61,7 +63,7 @@ namespace Mono.Security.X509 {
                        get { 
                                if (_personal == null) {
                                        string path = Path.Combine (_storePath, Names.Personal);
-                                       _personal = new X509Store (path, false);
+                                       _personal = new X509Store (path, false, false);
                                }
                                return _personal; 
                        }
@@ -71,7 +73,7 @@ namespace Mono.Security.X509 {
                        get { 
                                if (_other == null) {
                                        string path = Path.Combine (_storePath, Names.OtherPeople);
-                                       _other = new X509Store (path, false);
+                                       _other = new X509Store (path, false, false);
                                }
                                return _other; 
                        }
@@ -81,7 +83,7 @@ namespace Mono.Security.X509 {
                        get { 
                                if (_intermediate == null) {
                                        string path = Path.Combine (_storePath, Names.IntermediateCA);
-                                       _intermediate = new X509Store (path, true);
+                                       _intermediate = new X509Store (path, true, _newFormat);
                                }
                                return _intermediate; 
                        }
@@ -91,7 +93,7 @@ namespace Mono.Security.X509 {
                        get { 
                                if (_trusted == null) {
                                        string path = Path.Combine (_storePath, Names.TrustedRoot);
-                                       _trusted = new X509Store (path, true);
+                                       _trusted = new X509Store (path, true, _newFormat);
                                }
                                return _trusted; 
                        }
@@ -101,7 +103,7 @@ namespace Mono.Security.X509 {
                        get { 
                                if (_untrusted == null) {
                                        string path = Path.Combine (_storePath, Names.Untrusted);
-                                       _untrusted = new X509Store (path, false);
+                                       _untrusted = new X509Store (path, false, _newFormat);
                                }
                                return _untrusted; 
                        }
@@ -138,7 +140,7 @@ namespace Mono.Security.X509 {
                        if (!create && !Directory.Exists (path))
                                return null;
 
-                       return new X509Store (path, true);
+                       return new X509Store (path, true, false);
                }
 
                // names
@@ -151,7 +153,7 @@ namespace Mono.Security.X509 {
                        public const string IntermediateCA = "CA";
                        public const string TrustedRoot = "Trust";
                        public const string Untrusted = "Disallowed";
-                       
+
                        public Names () {}
                }
        }
index 0ad21f2c4362fb069ea223c73805ebcfc041e0e6..6557bccc3e565b4202e2633eb30aa84b50b263cc 100644 (file)
@@ -2,7 +2,7 @@ thisdir = class/Mono.Security/Test/tools/sockethell
 SUBDIRS = 
 include ../../../../../build/rules.make
 
-LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Security.dll -r:../../../../lib/net_4_x/nunit.framework.dll
+LOCAL_MCS_FLAGS = -r:System.dll -r:Mono.Security.dll -r:../../../../lib/net_4_x/nunitlite.dll
 
 all-local install-local uninstall-local:
 
index 6c2e89d188014cbb752cd53ab70afa79703f3ab0..e904d162f830610e267282a3cc9649c9d7f021cc 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2549142742184addc6e9678cd7f24e1ca9575fa4..61e1e3e6ace92929580a173f1eb78afc3049e354 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7184cb7c2e5fcdb2f8d140c0e8cf06e22714adcb..5c5e3ef046a9f4a1fbbdae59e1345380fb86aa56 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/Mono.XBuild.Tasks/.gitignore b/mcs/class/Mono.XBuild.Tasks/.gitignore
new file mode 100644 (file)
index 0000000..c8cb717
--- /dev/null
@@ -0,0 +1 @@
+Test/test-config-file-*
index 8d50c7ad6294d7f8c10c527a4b39005e1c272e01..11f7b791c432538d4dfaff4ee48fd22745c6fe20 100644 (file)
@@ -10,6 +10,8 @@ LIBRARY = Mono.XBuild.Tasks.dll
 LIB_REFS = $(PARENT_PROFILE)System $(PARENT_PROFILE)System.Xml
 LIB_MCS_FLAGS =
 
+TEST_NUNITLITE_APP_CONFIG_RUNTIME=Test/test-config-file-$(PROFILE)
+
 include $(XBUILD_DIR)/xbuild_test.make
 
 include ../../build/library.make
index 88bcc5bf2e1db6c177a74ae2a768f039d4ea15b7..88fb6132b1e49dccfd0ff4d13c9526ee254f471e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0dbb1260ba9b06120690e6ce8b91397243621c1c..902f1ac16296e1358a959ce77aca605e4cbe1ade 100644 (file)
@@ -1 +1,2 @@
+../../test-helpers/NunitHelpers.cs
 Mono.XBuild.Tasks/PcFileCacheTest.cs
index 90e5b13419f317c41238330a6020a81ca03f0e0d..85023f8c15f1c6018c15ed8ad27ab440b258a8d9 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,612</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,612</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index dd4b88112dd7d1bac281c6ff8fd7c9c6d6a275e9..512068a6a1bd2a3ac612f6c6cf8733c008a0f157 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,414,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,414,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 21fe03503f4fba1d875c8834f261957f834cef81..e5d478024a1ab1578dbb3d56bd98b64ef16895e5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e062f5481634cc77b9baf72a0bfdbcad31debe1f..a479277657a59484fe8fa73d2cf940384e9cfef1 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d20c1ba9eb9fa5fa8ce54dd469a5be393197e23c..9172432afe18bea81497ea8196107fcd5d5905e2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 598f507463cecd04fba5626b8c97d39b2e052aa2..2ba8941c832636c91cbd2eb6472a3bbbd66c0106 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,219,414</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CLR40;USE_ECMA_KEY;FEATURE_REFLECTIONCONTEXT;FEATURE_REFLECTIONFILEIO;FEATURE_SERIALIZATION;FEATURE_SLIMLOCK</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CLR40;USE_ECMA_KEY;FEATURE_REFLECTIONCONTEXT;FEATURE_REFLECTIONFILEIO;FEATURE_SERIALIZATION;FEATURE_SLIMLOCK</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,219,414</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CLR40;USE_ECMA_KEY;FEATURE_REFLECTIONCONTEXT;FEATURE_REFLECTIONFILEIO;FEATURE_SERIALIZATION;FEATURE_SLIMLOCK</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CLR40;USE_ECMA_KEY;FEATURE_REFLECTIONCONTEXT;FEATURE_REFLECTIONFILEIO;FEATURE_SERIALIZATION;FEATURE_SLIMLOCK</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 69eacf9c62079cd72bb359dc9ff3a731ee6b72c7..92b24b992ee80ee0b6f5f6a70a3517f547d6bb99 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,414</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,414</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d830e4f80397d064a3b6f160b934ee9328036c69..2e929fdbe321bec5fd34ec06808d20130a2e6b02 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7cdf1b26842530f14994900c373c071a139c4e9c..e6f48050a99ed2acf322ac2d6d3ce25cb37d1eab 100644 (file)
@@ -10,6 +10,7 @@ LIB_REFS = secxml/System bare/System.Xml System.Security
 LIB_MCS_FLAGS = -nowarn:618
 TEST_MCS_FLAGS =
 TEST_LIB_REFS = System.Xml System
+TEST_NUNITLITE_APP_CONFIG_GLOBAL=Test/test-config-file
 
 include ../../build/library.make
 
@@ -20,6 +21,9 @@ configuration_library_deps = \
 
 $(build_lib): $(configuration_library_deps)
 
+test-local:
+       cp Test/appSettings.config $(dir $(NUNITLITE_CONFIG_FILE))/Test-appSettings.config
+
 .NOTPARALLEL: $(configuration_library_deps)
 
 $(secxml_libdir)/System.dll:
index 61bfe7fa885569ab3c0bfd7be709fa77954791c2..0bfbadd5ea387f6de3a6ce8e04a1dd8ddc4fc1de 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Configuration/Test/App.config b/mcs/class/System.Configuration/Test/App.config
deleted file mode 100644 (file)
index d07b4f8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?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>
index 83e87e21b6a4deb891818d1ec5744fb290ba6d44..f0445810330c81bf312037684e889cf54e50d30a 100644 (file)
@@ -65,9 +65,9 @@ namespace MonoTests.System.Configuration
                {
                        Directory.SetCurrentDirectory (tempFolder);
 
-                       var currentAssembly = Assembly.GetExecutingAssembly ().Location;
+                       var currentAssembly = TestUtil.ThisApplicationPath;
                        var config = ConfigurationManager.OpenExeConfiguration (currentAssembly);
-                       Assert.AreEqual ("Test/appSettings.config", config.AppSettings.File, "#A01");
+                       Assert.AreEqual ("Test-appSettings.config", config.AppSettings.File, "#A01");
                        Assert.AreEqual ("foo", ConfigurationSettings.AppSettings["TestKey1"], "#A02");
                        Assert.AreEqual ("bar", ConfigurationSettings.AppSettings["TestKey2"], "#A03");
                }
index 7efff1dddffcf879f53a0a534b24cded54d0a213..0b5b3cde0dc1117329452266bc424283f5e90573 100644 (file)
@@ -257,10 +257,9 @@ namespace MonoTests.System.Configuration {
                [Test]
                public void exePath_UserLevelNone ()
                {
-                       string basedir = AppDomain.CurrentDomain.BaseDirectory;
-                       string name = TestUtil.ThisDllName;
+                       string name = TestUtil.ThisApplicationPath;
                        SysConfig config = ConfigurationManager.OpenExeConfiguration (name);
-                       Assert.AreEqual (Path.Combine (basedir, name + ".config"), config.FilePath);
+                       Assert.AreEqual (TestUtil.ThisApplicationPath + ".config", config.FilePath);
                }
 
                [Test]
@@ -615,11 +614,6 @@ namespace MonoTests.System.Configuration {
                [Test]
                public void TestConnectionStringRetrieval ()
                {
-                       var currentAssembly = Assembly.GetExecutingAssembly().Location;
-                       Assert.IsTrue (File.Exists (currentAssembly + ".config"),
-                                      String.Format ("This test cannot succeed without the .config file being in the same place as the assembly ({0})",
-                                                     currentAssembly));
-
                        var connStringObj = ConfigurationManager.ConnectionStrings ["test-connstring"];
                        Assert.IsNotNull (connStringObj);
                        var connString = connStringObj.ConnectionString;
index 4d0e369b414a45eebbdad975446df6e8e7c584f7..2bb7723f7a0dc37d6d8e8f64c455b583a10ce16f 100644 (file)
@@ -37,7 +37,6 @@ using SysConfig = System.Configuration.Configuration;
 
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 namespace MonoTests.System.Configuration {
        using Util;
index 6faeba67a14b2212d74a2b3643828c129d7678ee..497a8a8081da1ee056ebed31b4bb34427ee2c5b3 100644 (file)
@@ -64,17 +64,16 @@ namespace MonoTests.System.Configuration.Util {
                        }
                }
 
-               public static string ThisDllName {
+               public static string ThisApplicationPath {
                        get {
-                               var asm = Assembly.GetCallingAssembly ();
-                               return Path.GetFileName (asm.Location);
+                               var asm = Assembly.GetEntryAssembly ();
+                               return asm.Location;
                        }
                }
 
                public static string ThisConfigFileName {
                        get {
-                               var asm = Assembly.GetCallingAssembly ();
-                               var exe = Path.GetFileName (asm.Location);
+                               var exe = Path.GetFileName (ThisApplicationPath);
                                return exe + ".config";
                        }
                }
diff --git a/mcs/class/System.Configuration/Test/test-config-file b/mcs/class/System.Configuration/Test/test-config-file
new file mode 100644 (file)
index 0000000..5920c6c
--- /dev/null
@@ -0,0 +1,5 @@
+       <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" />
diff --git a/mcs/class/System.Configuration/net_4_x_System.Configuration_test.dll.config b/mcs/class/System.Configuration/net_4_x_System.Configuration_test.dll.config
deleted file mode 100644 (file)
index d07b4f8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?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>
index f165f3f62796abe4f1b545373fa8790efda7696f..e48161a358af4bccd8f1119cab6092ebebe55df3 100644 (file)
@@ -44,6 +44,10 @@ namespace Microsoft.Win32.SafeHandles
                        Initialize ((ulong)size);
                }
 
+               internal void Flush () {
+                       MemoryMapImpl.Flush (this.mmap_handle);
+               }
+
                protected override bool ReleaseHandle () {
                        if (this.handle != (IntPtr) (-1))
                                return MemoryMapImpl.Unmap (this.mmap_handle);
index e2e8aaeba0c3fb58714b37f5cf13f816bf618d68..0c5768009b5b299ad165eca954ad455a1c04867e 100644 (file)
@@ -46,12 +46,8 @@ namespace Microsoft.Win32.SafeHandles
 
                protected override bool ReleaseHandle ()
                {
-                       try {
-                               Marshal.FreeHGlobal (handle);
-                               return true;
-                       } catch (ArgumentException) {
-                               return false;
-                       }
+                       MonoIOError error;
+                       return MonoIO.Close (handle, out error);
                }
        }
 }
index 2f65fc4c3bec1a546f3eb5e5eac62f4bef381221..00322d47801c24fe02ab1c1b23e5b947f569e9e7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1720</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1720</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -48,6 +49,7 @@
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="..\..\build\common\SR.cs" />\r
     <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\BinaryOperationBinder.cs" />\r
     <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\BindingRestrictions.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Runtime\CompilerServices\ExecutionScope.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\Aes.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\AesManaged.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\BCryptNative.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngAlgorithm.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngAlgorithmGroup.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngKey.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngKeyBlobFormat.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngKeyCreationParameters.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngProperty.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngProvider.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngUIPolicy.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECDiffieHellman.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECDiffieHellmanPublicKey.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECDsa.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECDsaCng.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECKeyXmlFormat.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\NCryptNative.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\RsaCng.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\threading\ReaderWriterLockSlim\LockRecursionException.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\threading\ReaderWriterLockSlim\ReaderWriterLockSlim.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\threading\Tasks\TaskExtensions.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafeMemoryMappedFileHandle.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafeMemoryMappedViewHandle.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptHandle.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptKeyHandle.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptProviderHandle.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptSecretHandle.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafePipeHandle.cs" />\r
     <Compile Include="ReferenceSources\Error.cs" />\r
     <Compile Include="ReferenceSources\SR.cs" />\r
     <Compile Include="System.IO.Pipes\PipeTransmissionMode.cs" />\r
     <Compile Include="System.IO.Pipes\PipeUnix.cs" />\r
     <Compile Include="System.IO.Pipes\PipeWin32.cs" />\r
+    <Compile Include="System.Security.Cryptography.X509Certificates\ECDsaCertificateExtensions.cs" />\r
+    <Compile Include="System.Security.Cryptography.X509Certificates\RSACertificateExtensions.cs" />\r
+    <Compile Include="System.Security.Cryptography\AesCng.cs" />\r
     <Compile Include="System.Security.Cryptography\AesCryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\AesTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography\CngAlgorithm.cs" />\r
-    <Compile Include="System.Security.Cryptography\CngAlgorithmGroup.cs" />\r
+    <Compile Include="System.Security.Cryptography\ECCurve.cs" />\r
+    <Compile Include="System.Security.Cryptography\ECParameters.cs" />\r
+    <Compile Include="System.Security.Cryptography\ECPoint.cs" />\r
     <Compile Include="System.Security.Cryptography\MD5Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA1Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA256Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA384CryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA512Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA512CryptoServiceProvider.cs" />\r
+    <Compile Include="System.Security.Cryptography\TripleDESCng.cs" />\r
     <Compile Include="System\Util.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
index 110a22b1b29efd2295f370df532da13da5bba1ee..4ee13c996168fce7f282e77c01c78637b85da4c8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1720</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1720</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -48,6 +49,7 @@
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
     <Compile Include="..\..\build\common\SR.cs" />\r
     <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\BinaryOperationBinder.cs" />\r
     <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\BindingRestrictions.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Runtime\CompilerServices\ExecutionScope.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\Aes.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\AesManaged.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\BCryptNative.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngAlgorithm.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngAlgorithmGroup.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngKey.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngKeyBlobFormat.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngKeyCreationParameters.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngProperty.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngProvider.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\CngUIPolicy.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECDiffieHellman.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECDiffieHellmanPublicKey.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECDsa.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECDsaCng.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\ECKeyXmlFormat.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\NCryptNative.cs" />\r
+    <Compile Include="..\referencesource\System.Core\System\Security\Cryptography\RsaCng.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\threading\ReaderWriterLockSlim\LockRecursionException.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\threading\ReaderWriterLockSlim\ReaderWriterLockSlim.cs" />\r
     <Compile Include="..\referencesource\System.Core\System\threading\Tasks\TaskExtensions.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafeMemoryMappedFileHandle.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafeMemoryMappedViewHandle.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptHandle.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptKeyHandle.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptProviderHandle.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptSecretHandle.cs" />\r
     <Compile Include="Microsoft.Win32.SafeHandles\SafePipeHandle.cs" />\r
     <Compile Include="ReferenceSources\Error.cs" />\r
     <Compile Include="ReferenceSources\SR.cs" />\r
     <Compile Include="System.IO.Pipes\PipeTransmissionMode.cs" />\r
     <Compile Include="System.IO.Pipes\PipeUnix.cs" />\r
     <Compile Include="System.IO.Pipes\PipeWin32.cs" />\r
+    <Compile Include="System.Security.Cryptography.X509Certificates\ECDsaCertificateExtensions.cs" />\r
+    <Compile Include="System.Security.Cryptography.X509Certificates\RSACertificateExtensions.cs" />\r
+    <Compile Include="System.Security.Cryptography\AesCng.cs" />\r
     <Compile Include="System.Security.Cryptography\AesCryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\AesTransform.cs" />\r
-    <Compile Include="System.Security.Cryptography\CngAlgorithm.cs" />\r
-    <Compile Include="System.Security.Cryptography\CngAlgorithmGroup.cs" />\r
+    <Compile Include="System.Security.Cryptography\ECCurve.cs" />\r
+    <Compile Include="System.Security.Cryptography\ECParameters.cs" />\r
+    <Compile Include="System.Security.Cryptography\ECPoint.cs" />\r
     <Compile Include="System.Security.Cryptography\MD5Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA1Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA256Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA384CryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA512Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA512CryptoServiceProvider.cs" />\r
+    <Compile Include="System.Security.Cryptography\TripleDESCng.cs" />\r
     <Compile Include="System\Util.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
index fbc55fd73b5e62c356363f97aeb51b14fe2dbdc8..7a3cce164f61e2feffc9b46fcd751d1c75626e91 100644 (file)
@@ -70,7 +70,7 @@ namespace System.IO.MemoryMappedFiles
                        case 1:
                                return new ArgumentException ("A positive capacity must be specified for a Memory Mapped File backed by an empty file.");
                        case 2:
-                               return new ArgumentOutOfRangeException ("The capacity may not be smaller than the file size.");
+                               return new ArgumentOutOfRangeException ("capacity", "The capacity may not be smaller than the file size.");
                        case 3:
                                return new FileNotFoundException (path);
                        case 4:
@@ -85,6 +85,10 @@ namespace System.IO.MemoryMappedFiles
                                return new ArgumentException ("Invalid FileMode value.");
                        case 9:
                                return new IOException ("Could not map file");
+                       case 10:
+                               return new UnauthorizedAccessException ("Access to the path is denied.");
+                       case 11:
+                               return new ArgumentOutOfRangeException ("capacity", "The capacity cannot be greater than the size of the system's logical address space.");
                        default:
                                return new IOException ("Failed with unknown error code " + error);
                        }
@@ -140,7 +144,7 @@ namespace System.IO.MemoryMappedFiles
                        if (mode == FileMode.Append)
                                throw new ArgumentException ("mode");
 
-                       IntPtr handle = MemoryMapImpl.OpenFile (path, mode, null, out capacity, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.DelayAllocatePages);
+                       IntPtr handle = MemoryMapImpl.OpenFile (path, mode, null, out capacity, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None);
 
                        return new MemoryMappedFile () {
                                handle = handle,
@@ -172,7 +176,7 @@ namespace System.IO.MemoryMappedFiles
                        if (capacity < 0)
                                throw new ArgumentOutOfRangeException ("capacity");
 
-                       IntPtr handle = MemoryMapImpl.OpenFile (path, mode, mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
+                       IntPtr handle = MemoryMapImpl.OpenFile (path, mode, mapName, out capacity, access, MemoryMappedFileOptions.None);
                        
                        return new MemoryMappedFile () {
                                handle = handle,
@@ -193,7 +197,7 @@ namespace System.IO.MemoryMappedFiles
                        if ((!MonoUtil.IsUnix && capacity == 0 && fileStream.Length == 0) || (capacity > fileStream.Length))
                                throw new ArgumentException ("capacity");
 
-                       IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.SafeFileHandle.DangerousGetHandle (), mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
+                       IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.SafeFileHandle.DangerousGetHandle (), mapName, out capacity, access, MemoryMappedFileOptions.None);
                        
                        MemoryMapImpl.ConfigureHandleInheritability (handle, inheritability);
                                
@@ -220,7 +224,7 @@ namespace System.IO.MemoryMappedFiles
                        if ((!MonoUtil.IsUnix && capacity == 0 && fileStream.Length == 0) || (capacity > fileStream.Length))
                                throw new ArgumentException ("capacity");
 
-                       IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.SafeFileHandle.DangerousGetHandle (), mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
+                       IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.SafeFileHandle.DangerousGetHandle (), mapName, out capacity, access, MemoryMappedFileOptions.None);
                        
                        MemoryMapImpl.ConfigureHandleInheritability (handle, inheritability);
                                
@@ -258,13 +262,13 @@ namespace System.IO.MemoryMappedFiles
                [MonoLimitation ("Named mappings scope is process local")]
                public static MemoryMappedFile CreateNew (string mapName, long capacity)
                {
-                       return CreateNew (mapName, capacity, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.DelayAllocatePages, null, HandleInheritability.None);
+                       return CreateNew (mapName, capacity, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None, null, HandleInheritability.None);
                }
 
                [MonoLimitation ("Named mappings scope is process local")]
                public static MemoryMappedFile CreateNew (string mapName, long capacity, MemoryMappedFileAccess access) 
                {
-                       return CreateNew (mapName, capacity, access, MemoryMappedFileOptions.DelayAllocatePages, null, HandleInheritability.None);
+                       return CreateNew (mapName, capacity, access, MemoryMappedFileOptions.None, null, HandleInheritability.None);
                }
 
                [MonoLimitation ("Named mappings scope is process local; options is ignored")]
@@ -290,7 +294,7 @@ namespace System.IO.MemoryMappedFiles
                [MonoLimitation ("Named mappings scope is process local")]
                public static MemoryMappedFile CreateOrOpen (string mapName, long capacity, MemoryMappedFileAccess access)
                {
-                       return CreateOrOpen (mapName, capacity, access, MemoryMappedFileOptions.DelayAllocatePages, null, HandleInheritability.None);
+                       return CreateOrOpen (mapName, capacity, access, MemoryMappedFileOptions.None, null, HandleInheritability.None);
                }
 
                [MonoLimitation ("Named mappings scope is process local")]
index 9362f00b1626a3e4aab06a5dc47f34d51358a6e0..b0be2e4f1885c20f28947b8de734b76d478a96d8 100644 (file)
@@ -92,7 +92,7 @@ namespace System.IO.MemoryMappedFiles
 
                public void Flush (IntPtr capacity)
                {
-                       MemoryMapImpl.Flush (m_viewHandle.DangerousGetHandle ());
+                       m_viewHandle.Flush ();
                }
                
                protected virtual void Dispose (bool disposing)
index 23bf26f7482bb7654e1e5043f8381c937000f460..a4818f76049ea471ba429953552c602269a8a6b3 100644 (file)
@@ -77,8 +77,8 @@ namespace System.IO.Pipes
                        throw new NotImplementedException ();
 #else
                        InitializeHandle (safePipeHandle, false, false);
-#endif
                        IsConnected = true;
+#endif
                }
 
                ~AnonymousPipeClientStream ()
index a823217957dcd384dd2f14db6d07cdbc1b06fa3d..a27c4dc0b4d3697f8aca9edf8f2cad7bf8d10499 100644 (file)
@@ -120,8 +120,10 @@ namespace System.IO.Pipes
                ~NamedPipeClientStream () {
                        Dispose (false);
                }
-               
+
+#if !MOBILE
                INamedPipeClient impl;
+#endif
 
                public void Connect ()
                {
@@ -172,7 +174,11 @@ namespace System.IO.Pipes
                public int NumberOfServerInstances {
                        get {
                                CheckPipePropertyOperations ();
+#if MOBILE
+                               throw new NotImplementedException ();
+#else
                                return impl.NumberOfServerInstances;
+#endif
                        }
                }
        }
index e402a8a2620193f7b966b300ddb7cb2f219a431f..d4d02ade208f4f415a2a1d817ac3c6598b103895 100644 (file)
@@ -97,11 +97,12 @@ namespace System.IO.Pipes
                public NamedPipeServerStream (string pipeName, PipeDirection direction, int maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, int inBufferSize, int outBufferSize, PipeSecurity pipeSecurity, HandleInheritability inheritability, PipeAccessRights additionalAccessRights)
                        : base (direction, transmissionMode, outBufferSize)
                {
-                       var rights = ToAccessRights (direction) | additionalAccessRights;
-                       // FIXME: reject some rights declarations (for ACL).
 #if MOBILE
                        throw new NotImplementedException ();
 #else
+                       var rights = ToAccessRights (direction) | additionalAccessRights;
+                       // FIXME: reject some rights declarations (for ACL).
+
                        if (IsWindows)
                                impl = new Win32NamedPipeServer (this, pipeName, maxNumberOfServerInstances, transmissionMode,
                                                                 rights, options, inBufferSize, outBufferSize,
index 0e322e4b109a266a47bfa122883c76f917019494..81c303bd09135b7184ab1f67e1af9c63e1dcde17 100644 (file)
@@ -30,16 +30,18 @@ namespace System.Security.Cryptography.X509Certificates
 {
        public static class RSACertificateExtensions
        {
-               [MonoTODO]
                public static RSA GetRSAPrivateKey(this X509Certificate2 certificate)
                {
-                       throw new NotImplementedException ();
+                       if (certificate == null)
+                               throw new ArgumentNullException("certificate");
+                       return certificate.PrivateKey as RSA;
                }
 
-               [MonoTODO]
                public static RSA GetRSAPublicKey(this X509Certificate2 certificate)
                {
-                       throw new NotImplementedException ();
+                       if (certificate == null)
+                               throw new ArgumentNullException("certificate");
+                       return certificate.PublicKey.Key as RSA;
                }
        }
 }
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithm.cs b/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithm.cs
deleted file mode 100644 (file)
index ea87b30..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// System.Security.Cryptography.CngAlgorithm
-//
-// Authors:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2008 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;
-
-namespace System.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Serializable]
-       public sealed class CngAlgorithm : IEquatable<CngAlgorithm> {
-
-               private string m_algorithm;
-
-               public CngAlgorithm (string algorithm)
-               {
-                       if (algorithm == null)
-                               throw new ArgumentNullException ("algorithm");
-                       if (algorithm.Length == 0)
-                               throw new ArgumentException ("algorithm");
-
-                       m_algorithm = algorithm;
-               }
-
-               public string Algorithm {
-                       get { return m_algorithm; }
-               }
-
-               public bool Equals (CngAlgorithm other)
-               {
-                       if (other == null)
-                               return false;
-                       return m_algorithm == other.m_algorithm;
-               }
-
-               public override bool Equals (object obj)
-               {
-                       return Equals (obj as CngAlgorithm);
-               }
-
-               public override int GetHashCode ()
-               {
-                       return m_algorithm.GetHashCode ();
-               }
-
-               public override string ToString ()
-               {
-                       return m_algorithm;
-               }
-
-               // static
-
-               static CngAlgorithm dh256;
-               static CngAlgorithm dh384;
-               static CngAlgorithm dh521;
-               static CngAlgorithm dsa256;
-               static CngAlgorithm dsa384;
-               static CngAlgorithm dsa521;
-               static CngAlgorithm md5;
-               static CngAlgorithm sha1;
-               static CngAlgorithm sha256;
-               static CngAlgorithm sha384;
-               static CngAlgorithm sha512;
-
-               public static CngAlgorithm ECDiffieHellmanP256 {
-                       get {
-                               if (dh256 == null)
-                                       dh256 = new CngAlgorithm ("ECDH_P256");
-                               return dh256;
-                       }
-               }
-
-               public static CngAlgorithm ECDiffieHellmanP384 {
-                       get {
-                               if (dh384 == null)
-                                       dh384 = new CngAlgorithm ("ECDH_P384");
-                               return dh384;
-                       }
-               }
-
-               public static CngAlgorithm ECDiffieHellmanP521 {
-                       get {
-                               if (dh521 == null)
-                                       dh521 = new CngAlgorithm ("ECDH_P521");
-                               return dh521;
-                       }
-               }
-
-               public static CngAlgorithm ECDsaP256 {
-                       get {
-                               if (dsa256 == null)
-                                       dsa256 = new CngAlgorithm ("ECDSA_P256");
-                               return dsa256;
-                       }
-               }
-
-               public static CngAlgorithm ECDsaP384 {
-                       get {
-                               if (dsa384 == null)
-                                       dsa384 = new CngAlgorithm ("ECDSA_P384");
-                               return dsa384;
-                       }
-               }
-
-               public static CngAlgorithm ECDsaP521 {
-                       get {
-                               if (dsa521 == null)
-                                       dsa521 = new CngAlgorithm ("ECDSA_P521");
-                               return dsa521;
-                       }
-               }
-
-               public static CngAlgorithm MD5 {
-                       get {
-                               if (md5 == null)
-                                       md5 = new CngAlgorithm ("MD5");
-                               return md5;
-                       }
-               }
-
-               public static CngAlgorithm Sha1 {
-                       get {
-                               if (sha1 == null)
-                                       sha1 = new CngAlgorithm ("SHA1");
-                               return sha1;
-                       }
-               }
-
-               public static CngAlgorithm Sha256 {
-                       get {
-                               if (sha256 == null)
-                                       sha256 = new CngAlgorithm ("SHA256");
-                               return sha256;
-                       }
-               }
-
-               public static CngAlgorithm Sha384 {
-                       get {
-                               if (sha384 == null)
-                                       sha384 = new CngAlgorithm ("SHA384");
-                               return sha384;
-                       }
-               }
-
-               public static CngAlgorithm Sha512 {
-                       get {
-                               if (sha512 == null)
-                                       sha512 = new CngAlgorithm ("SHA512");
-                               return sha512;
-                       }
-               }
-
-               public static bool operator == (CngAlgorithm left, CngAlgorithm right)
-               {
-                       if ((object)left == null)
-                               return ((object)right == null);
-                       return left.Equals (right);
-               }
-
-               public static bool operator != (CngAlgorithm left, CngAlgorithm right)
-               {
-                       if ((object)left == null)
-                               return ((object)right != null);
-                       return !left.Equals (right);
-               }
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithmGroup.cs b/mcs/class/System.Core/System.Security.Cryptography/CngAlgorithmGroup.cs
deleted file mode 100644 (file)
index fa43965..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// System.Security.Cryptography.CngAlgorithmGroup
-//
-// Authors:
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2008 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;
-
-namespace System.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Serializable]
-       public sealed class CngAlgorithmGroup : IEquatable<CngAlgorithmGroup> {
-
-               private string m_algorithmGroup;
-
-               public CngAlgorithmGroup (string algorithmGroup)
-               {
-                       if (algorithmGroup == null)
-                               throw new ArgumentNullException ("algorithmGroup");
-                       if (algorithmGroup.Length == 0)
-                               throw new ArgumentException ("algorithmGroup");
-
-                       m_algorithmGroup = algorithmGroup;
-               }
-
-               public string AlgorithmGroup {
-                       get { return m_algorithmGroup; }
-               }
-
-               public bool Equals (CngAlgorithmGroup other)
-               {
-                       if (other == null)
-                               return false;
-                       return m_algorithmGroup == other.m_algorithmGroup;
-               }
-
-               public override bool Equals (object obj)
-               {
-                       return Equals (obj as CngAlgorithmGroup);
-               }
-
-               public override int GetHashCode ()
-               {
-                       return m_algorithmGroup.GetHashCode ();
-               }
-
-               public override string ToString ()
-               {
-                       return m_algorithmGroup;
-               }
-
-               // static
-
-               private static CngAlgorithmGroup dh;
-               private static CngAlgorithmGroup dsa;
-               private static CngAlgorithmGroup ecdh;
-               private static CngAlgorithmGroup ecdsa;
-               private static CngAlgorithmGroup rsa;
-
-               public static CngAlgorithmGroup DiffieHellman {
-                       get {
-                               if (dh == null)
-                                       dh = new CngAlgorithmGroup ("DH");
-                               return dh;
-                       }
-               }
-
-               public static CngAlgorithmGroup Dsa {
-                       get {
-                               if (dsa == null)
-                                       dsa = new CngAlgorithmGroup ("DSA");
-                               return dsa;
-                       }
-               }
-
-               public static CngAlgorithmGroup ECDiffieHellman {
-                       get {
-                               if (ecdh == null)
-                                       ecdh = new CngAlgorithmGroup ("ECDH");
-                               return ecdh;
-                       }
-               }
-
-               public static CngAlgorithmGroup ECDsa {
-                       get {
-                               if (ecdsa == null)
-                                       ecdsa = new CngAlgorithmGroup ("ECDSA");
-                               return ecdsa;
-                       }
-               }
-
-               public static CngAlgorithmGroup Rsa {
-                       get {
-                               if (rsa == null)
-                                       rsa = new CngAlgorithmGroup ("RSA");
-                               return rsa;
-                       }
-               }
-
-               public static bool operator == (CngAlgorithmGroup left, CngAlgorithmGroup right)
-               {
-                       if ((object)left == null)
-                               return ((object)right == null);
-                       return left.Equals (right);
-               }
-
-               public static bool operator != (CngAlgorithmGroup left, CngAlgorithmGroup right)
-               {
-                       if ((object)left == null)
-                               return ((object)right != null);
-                       return !left.Equals (right);
-               }
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngExportPolicies.cs b/mcs/class/System.Core/System.Security.Cryptography/CngExportPolicies.cs
deleted file mode 100644 (file)
index 90a1aa5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.Cryptography.CngExportPolicies
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Flags]
-       public enum CngExportPolicies {
-               None,
-               AllowExport,
-               AllowPlaintextExport,
-               AllowArchiving,
-               AllowPlaintextArchiving
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngKeyCreationOptions.cs b/mcs/class/System.Core/System.Security.Cryptography/CngKeyCreationOptions.cs
deleted file mode 100644 (file)
index da28e7b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Security.Cryptography.CngKeyCreationOptions
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Flags]
-       public enum CngKeyCreationOptions {
-               None                 = 0x00,
-               MachineKey           = 0x20,
-               OverwriteExistingKey = 0x80
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngKeyCreationParameters.cs b/mcs/class/System.Core/System.Security.Cryptography/CngKeyCreationParameters.cs
deleted file mode 100644 (file)
index 8963324..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Security.Cryptography.CngKeyCreationParameters
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       public class CngKeyCreationParameters {
-               private Nullable<CngExportPolicies> exportPolicy;
-               private CngKeyCreationOptions keyCreationOptions;
-               private Nullable<CngKeyUsages> keyUsage;
-               private CngPropertyCollection parameters;
-               private IntPtr parentWindowHandle;
-               private CngProvider provider;
-               private CngUIPolicy uiPolicy;
-
-               public CngKeyCreationParameters ()
-               {
-                       parameters = new CngPropertyCollection ();
-                       provider = CngProvider.MicrosoftSoftwareKeyStorageProvider;
-               }
-
-               public Nullable<CngExportPolicies> ExportPolicy
-               {
-                       get { return exportPolicy; }
-                       set { exportPolicy = value; }
-               }
-
-               public CngKeyCreationOptions KeyCreationOptions
-               {
-                       get { return keyCreationOptions; }
-                       set { keyCreationOptions = value; }
-               }
-
-               public Nullable<CngKeyUsages> KeyUsage
-               {
-                       get { return keyUsage; }
-                       set { keyUsage = value; }
-               }
-
-               public CngPropertyCollection Parameters
-               {
-                       get { return parameters; }
-               }
-
-               public IntPtr ParentWindowHandle
-               {
-                       get { return parentWindowHandle; }
-                       set { parentWindowHandle = value; }
-               }
-
-               public CngProvider Provider
-               {
-                       get { return provider; }
-                       set {
-                               if (value == null)
-                                       throw new ArgumentNullException ("value");
-                               provider = value;
-                       }
-               }
-
-               public CngUIPolicy UIPolicy
-               {
-                       get { return uiPolicy; }
-                       set { uiPolicy = value; }
-               }
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngKeyOpenOptions.cs b/mcs/class/System.Core/System.Security.Cryptography/CngKeyOpenOptions.cs
deleted file mode 100644 (file)
index dcc3289..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Security.Cryptography.CngKeyOpenOptions
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Flags]
-       public enum CngKeyOpenOptions {
-               None       = 0x00,
-               UserKey    = 0x00,
-               MachineKey = 0x20,
-               Silent     = 0x40
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngKeyUsages.cs b/mcs/class/System.Core/System.Security.Cryptography/CngKeyUsages.cs
deleted file mode 100644 (file)
index 35f1d43..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.Cryptography.CngKeyUsages
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Flags]
-       public enum CngKeyUsages {
-               None,
-               Decryption,
-               Signing,
-               KeyAgreement,
-               AllUsages = 0xffffff
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngProperty.cs b/mcs/class/System.Core/System.Security.Cryptography/CngProperty.cs
deleted file mode 100644 (file)
index f0948bb..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// System.Security.Cryptography.CngProperty
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       public struct CngProperty : IEquatable<CngProperty> {
-               private string name;
-               private byte[] val;
-               private CngPropertyOptions opts;
-
-               public CngProperty(string name, byte[] value, CngPropertyOptions options)
-               {
-                       if (name == null)
-                               throw new ArgumentNullException("name");
-
-                       this.name = name;
-                       this.val = (value != null) ? (byte[]) value.Clone () : null;
-                       this.opts = options;
-               }
-
-               public string Name {
-                       get { return name; }
-               }
-
-               public CngPropertyOptions Options {
-                       get { return opts; }
-               }
-
-               public byte[] GetValue ()
-               {
-                       if (val == null)
-                               return null;
-                       return (byte[]) val.Clone ();
-               }
-
-               public bool Equals (CngProperty other)
-               {
-                       if (this.name != other.name || this.opts != other.opts)
-                               return false;
-                       if (this.val == null && other.val == null)
-                               return true;
-                       if (this.val == null || other.val == null)
-                               return false;
-                       if (this.val.Length != other.val.Length)
-                               return false;
-
-                       for (int i=0; i<val.Length; i++) {
-                               if (this.val[i] != other.val[i])
-                                       return false;
-                       }
-                       return true;
-               }
-
-               public override bool Equals (object obj)
-               {
-                       if (obj == null)
-                               return false;
-                       if (!(obj is CngProperty))
-                               return false;
-                       return Equals ((CngProperty) obj);
-               }
-
-               public override int GetHashCode ()
-               {
-                       int ret = name.GetHashCode () ^ opts.GetHashCode ();
-                       if (val == null)
-                               return ret;
-
-                       for (int i=0; i<val.Length; i++) {
-                               // Handle each 4 bytes of byte array as a little-endian
-                               // integer and XOR it with the resulting hash code value
-                               ret ^= val[i] << 8*(i % 4);
-                       }
-                       return ret;
-               }
-
-               // static
-
-               public static bool operator == (CngProperty left, CngProperty right)
-               {
-                       return left.Equals (right);
-               }
-
-               public static bool operator != (CngProperty left, CngProperty right)
-               {
-                       return !left.Equals (right);
-               }
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngPropertyCollection.cs b/mcs/class/System.Core/System.Security.Cryptography/CngPropertyCollection.cs
deleted file mode 100644 (file)
index afc5269..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Security.Cryptography.CngPropertyCollection
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.ObjectModel;
-
-namespace System.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       public sealed class CngPropertyCollection : Collection<CngProperty> {
-               public CngPropertyCollection ()
-               {
-               }
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngPropertyOptions.cs b/mcs/class/System.Core/System.Security.Cryptography/CngPropertyOptions.cs
deleted file mode 100644 (file)
index 336d26a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Security.Cryptography.CngPropertyOptions
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Flags]
-       public enum CngPropertyOptions {
-               None           = 0x00 << 24,
-               CustomProperty = 0x40 << 24,
-               Persist        = 0x80 << 24
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngProvider.cs b/mcs/class/System.Core/System.Security.Cryptography/CngProvider.cs
deleted file mode 100644 (file)
index 8c868a7..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// System.Security.Cryptography.CngProvider
-//
-// Authors:
-//      Sebastien Pouliot  <sebastien@ximian.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Serializable]
-       public sealed class CngProvider : IEquatable<CngProvider> {
-
-               private string m_Provider;
-
-               public CngProvider (string provider)
-               {
-                       if (provider == null)
-                               throw new ArgumentNullException ("provider");
-                       if (provider.Length == 0)
-                               throw new ArgumentException ("provider");
-
-                       m_Provider = provider;
-               }
-
-               public string Provider {
-                       get { return m_Provider; }
-               }
-
-               public bool Equals (CngProvider other)
-               {
-                       if (other == null)
-                               return false;
-                       return m_Provider == other.m_Provider;
-               }
-
-               public override bool Equals (object obj)
-               {
-                       return Equals (obj as CngProvider);
-               }
-
-               public override int GetHashCode ()
-               {
-                       return m_Provider.GetHashCode ();
-               }
-
-               public override string ToString ()
-               {
-                       return m_Provider;
-               }
-
-               // static
-
-               private static CngProvider microsoftSmartCardKeyStorageProvider;
-               private static CngProvider microsoftSoftwareKeyStorageProvider;
-
-               public static CngProvider MicrosoftSmartCardKeyStorageProvider {
-                       get {
-                               if (microsoftSmartCardKeyStorageProvider == null)
-                                       microsoftSmartCardKeyStorageProvider = new CngProvider ("Microsoft Smart Card Key Storage Provider");
-                               return microsoftSmartCardKeyStorageProvider;
-                       }
-               }
-
-               public static CngProvider MicrosoftSoftwareKeyStorageProvider {
-                       get {
-                               if (microsoftSoftwareKeyStorageProvider == null)
-                                       microsoftSoftwareKeyStorageProvider = new CngProvider ("Microsoft Software Key Storage Provider");
-                               return microsoftSoftwareKeyStorageProvider;
-                       }
-               }
-
-               public static bool operator == (CngProvider left, CngProvider right)
-               {
-                       if ((object)left == null)
-                               return ((object)right == null);
-                       return left.Equals (right);
-               }
-
-               public static bool operator != (CngProvider left, CngProvider right)
-               {
-                       if ((object)left == null)
-                               return ((object)right != null);
-                       return !left.Equals (right);
-               }
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngUIPolicy.cs b/mcs/class/System.Core/System.Security.Cryptography/CngUIPolicy.cs
deleted file mode 100644 (file)
index 4e0c36c..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// System.Security.Cryptography.CngUIPolicy
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       public sealed class CngUIPolicy {
-               private CngUIProtectionLevels level;
-               private string name;
-               private string desc;
-               private string context;
-               private string title;
-
-               public CngUIPolicy (CngUIProtectionLevels protectionLevel)
-                       : this (protectionLevel, null)
-               {
-               }
-
-               public CngUIPolicy (CngUIProtectionLevels protectionLevel,
-                                   string friendlyName)
-                       : this (protectionLevel, friendlyName, null)
-               {
-               }
-
-               public CngUIPolicy (CngUIProtectionLevels protectionLevel,
-                                   string friendlyName,
-                                   string description)
-                       : this (protectionLevel, friendlyName, description, null)
-               {
-               }
-
-               public CngUIPolicy (CngUIProtectionLevels protectionLevel,
-                                   string friendlyName,
-                                   string description,
-                                   string useContext)
-                       : this (protectionLevel, friendlyName, description, useContext, null)
-               {
-               }
-
-               public CngUIPolicy (CngUIProtectionLevels protectionLevel,
-                                   string friendlyName,
-                                   string description,
-                                   string useContext,
-                                   string creationTitle)
-               {
-                       level = protectionLevel;
-                       name = friendlyName;
-                       desc = description;
-                       context = useContext;
-                       title = creationTitle;
-               }
-
-               public CngUIProtectionLevels ProtectionLevel {
-                       get { return level; }
-               }
-
-               public string FriendlyName {
-                       get { return name; }
-               }
-
-               public string Description {
-                       get { return desc; }
-               }
-
-               public string UseContext {
-                       get { return context; }
-               }
-
-               public string CreationTitle {
-                       get { return title; }
-               }
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/CngUIProtectionLevels.cs b/mcs/class/System.Core/System.Security.Cryptography/CngUIProtectionLevels.cs
deleted file mode 100644 (file)
index 22f4178..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Security.Cryptography.CngUIProtectionLevels
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       // note: CNG stands for "Cryptography API: Next Generation"
-
-       [Flags]
-       public enum CngUIProtectionLevels {
-               None,
-               ProtectKey,
-               ForceHighProtection
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/ECDiffieHellmanKeyDerivationFunction.cs b/mcs/class/System.Core/System.Security.Cryptography/ECDiffieHellmanKeyDerivationFunction.cs
deleted file mode 100644 (file)
index a2a9880..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Security.Cryptography.ECDiffieHellmanKeyDerivationFunction
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       public enum ECDiffieHellmanKeyDerivationFunction {
-               Hash,
-               Hmac,
-               Tls
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/ECKeyXmlFormat.cs b/mcs/class/System.Core/System.Security.Cryptography/ECKeyXmlFormat.cs
deleted file mode 100644 (file)
index 3ed2910..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Security.Cryptography.ECKeyXmlFormat
-//
-// Copyright (C) 2011 Juho Vähä-Herttua
-//
-// 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.Security.Cryptography {
-
-       public enum ECKeyXmlFormat {
-               Rfc4050
-       }
-}
diff --git a/mcs/class/System.Core/System.Security.Cryptography/IncrementalHash.cs b/mcs/class/System.Core/System.Security.Cryptography/IncrementalHash.cs
deleted file mode 100644 (file)
index 14c895e..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// IncrementalHash.cs
-//
-// 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.
-//
-
-#if NETSTANDARD
-
-namespace System.Security.Cryptography
-{
-    public sealed class IncrementalHash : IDisposable
-    {
-        private IncrementalHash () { }
-        public HashAlgorithmName AlgorithmName { get { throw new NotImplementedException (); } }
-        public void AppendData (byte[] data) { }
-        public void AppendData (byte[] data, int offset, int count) { }
-        public static IncrementalHash CreateHash (HashAlgorithmName hashAlgorithm) { throw new NotImplementedException (); }
-        public static IncrementalHash CreateHMAC (HashAlgorithmName hashAlgorithm, byte[] key) { throw new NotImplementedException (); }
-        public void Dispose () { }
-        public byte[] GetHashAndReset () { throw new NotImplementedException (); }
-    }
-}
-
-#endif
\ No newline at end of file
index 27191c37ed2b7b121d2f1926471d459add1d013f..9c273b84a596e848680054d9889147050a6b2530 100644 (file)
@@ -56,16 +56,28 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                        return "test-" + named_index++;
                }
 
-
+               static string baseTempDir = Path.Combine (Path.GetTempPath (), typeof (MemoryMappedFileTest).FullName);
                static string tempDir = Path.Combine (Path.GetTempPath (), typeof (MemoryMappedFileTest).FullName);
 
                string fname;
 
-               [SetUp]
-               protected void SetUp () {
-                       if (Directory.Exists (tempDir))
-                               Directory.Delete (tempDir, true);
+               [TestFixtureSetUp]
+               public void FixtureSetUp ()
+               {
+                       try {
+                               // Try to cleanup from any previous NUnit run.
+                               Directory.Delete (baseTempDir, true);
+                       } catch (Exception) {
+                       }
+               }
 
+               [SetUp]
+               public void SetUp ()
+               {
+                       int i = 0;
+                       do {
+                               tempDir = Path.Combine (baseTempDir, (++i).ToString());
+                       } while (Directory.Exists (tempDir));
                        Directory.CreateDirectory (tempDir);
 
                        fname = Path.Combine (tempDir, "basic.txt");
@@ -77,9 +89,14 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                }
 
                [TearDown]
-               protected void TearDown () {
-                       if (Directory.Exists (tempDir))
+               public void TearDown ()
+               {
+                       try {
+                               // This throws an exception under MS.NET and Mono on Windows,
+                               // since the directory contains open files.
                                Directory.Delete (tempDir, true);
+                       } catch (Exception) {
+                       }
                }
 
                [Test]
@@ -102,26 +119,16 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                public void CreateNew ()
                {
                        // This must succeed
-                       MemoryMappedFile.CreateNew (Path.Combine (tempDir, "createNew.test"), 8192);
-               }
-
-               [Test]
-               [ExpectedException (typeof (IOException))]
-               public void CreateNew_OnExistingFile ()
-               {
-                       // This must succeed
-                       MemoryMappedFile.CreateNew (Path.Combine (tempDir, "createNew.test"), 8192);
-                       
-                       // This should fail, the file exists
-                       MemoryMappedFile.CreateNew (Path.Combine (tempDir, "createNew.test"), 8192);
+                       MemoryMappedFile.CreateNew (MkNamedMapping (), 8192);
                }
 
                // Call this twice, it should always work
                [Test]
                public void CreateOrOpen_Multiple ()
                {
-                       MemoryMappedFile.CreateOrOpen (Path.Combine (tempDir, "createOrOpen.test"), 8192);
-                       MemoryMappedFile.CreateOrOpen (Path.Combine (tempDir, "createOrOpen.test"), 8192);
+                       var name = MkNamedMapping ();
+                       MemoryMappedFile.CreateOrOpen (name, 8192);
+                       MemoryMappedFile.CreateOrOpen (name, 8192);
                }
 
                [Test]
@@ -134,7 +141,7 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                        // We are requesting fewer bytes to map.
                        MemoryMappedFile.CreateFromFile (f, FileMode.Open, "myMap", 4192);
                }
-       
+
                [Test]
                public void CreateFromFile_Null () {
                        AssertThrows<ArgumentNullException> (delegate () {
@@ -252,6 +259,9 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                [Test]
                public void NamedMappingToInvalidFile ()
                {
+                       if (Environment.OSVersion.Platform != PlatformID.Unix) {
+                               Assert.Ignore ("Backslashes in mapping names are disallowed on .NET and Mono on Windows");
+                       }
                        var fileName = Path.Combine (tempDir, "temp_file_123");
                if (File.Exists (fileName))
                    File.Delete (fileName);
@@ -352,7 +362,7 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                }
 
                [Test]
-               [ExpectedException(typeof(IOException))]
+               [ExpectedException(typeof(UnauthorizedAccessException))]
                public void CreateViewStreamWithOffsetPastFileEnd ()
                {
                        string f = Path.Combine (tempDir, "8192-file");
@@ -365,7 +375,7 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                }
 
                [Test]
-               [ExpectedException(typeof(IOException))]
+               [ExpectedException(typeof(UnauthorizedAccessException))]
                public void CreateViewStreamWithOffsetPastFileEnd2 ()
                {
                        string f = Path.Combine (tempDir, "8192-file");
@@ -394,7 +404,7 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
 
                        MemoryMappedViewStream stream = mappedFile.CreateViewStream (pageSize * 2, 0, MemoryMappedFileAccess.ReadWrite);
 #if !MONOTOUCH
-                       Assert.AreEqual (stream.Capacity, Environment.SystemPageSize);
+                       Assert.AreEqual (Environment.SystemPageSize, stream.Capacity);
 #endif
                        stream.Write (new byte [pageSize], 0, pageSize);
                }
@@ -407,9 +417,39 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
                        File.WriteAllBytes (f, new byte [size]);
 
                        FileStream file = File.OpenRead (f);
-                       MemoryMappedFile.CreateFromFile (file, null, size, MemoryMappedFileAccess.ReadExecute, null, 0, false);
+                       MemoryMappedFile.CreateFromFile (file, null, size, MemoryMappedFileAccess.Read, null, 0, false);
                }
-       }
-}
 
+               [Test]
+               [ExpectedException(typeof(ArgumentOutOfRangeException))]
+               public void CreateNewLargerThanLogicalAddressSpace ()
+               {
+                       if (IntPtr.Size != 4) {
+                               Assert.Ignore ("Only applies to 32-bit systems");
+                       }
+                       MemoryMappedFile.CreateNew (MkNamedMapping (), (long) uint.MaxValue + 1);
+               }
 
+               [Test]
+               [ExpectedException(typeof(ArgumentOutOfRangeException))]
+               public void CreateOrOpenLargerThanLogicalAddressSpace ()
+               {
+                       if (IntPtr.Size != 4) {
+                               Assert.Ignore ("Only applies to 32-bit systems");
+                       }
+                       MemoryMappedFile.CreateOrOpen (MkNamedMapping (), (long) uint.MaxValue + 1);
+               }
+
+               [Test]
+               public void NamedMappingWithDelayAllocatePages ()
+               {
+                       var name = MkNamedMapping ();
+                       using (var m0 = MemoryMappedFile.CreateNew(name, 4096, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.DelayAllocatePages, HandleInheritability.None)) {
+                               using (MemoryMappedViewAccessor v0 = m0.CreateViewAccessor ()) {
+                                       Assert.AreEqual (0, v0.ReadInt32 (0));
+                               }
+                       }
+               }
+
+       }
+}
index a9389f9b49710d088c2f7baf64b566d424566a2c..ceef4c02157565a3e3ce4f4f0e0ef046e8ffd06f 100644 (file)
@@ -34,12 +34,9 @@ using System.Text;
 using System.Threading;
 using NUnit.Framework;
 using System.Linq;
-using NUnit.Framework.SyntaxHelpers;
 using NUnit.Framework.Constraints;
 using System.Diagnostics;
 
-namespace NUnit.Framework.SyntaxHelpers { class Dummy {} }
-
 namespace MonoTests.System.Linq
 {
        [TestFixture]
index 6e36c961e353774dd0f024fb71287f0911d7f8aa..52dad5c3c18ca9ddbcb78697c3f48b87e206a1be 100644 (file)
@@ -232,4 +232,3 @@ ReferenceSources/Strings.cs
 System.Security.Cryptography/ECCurve.cs
 System.Security.Cryptography/ECPoint.cs
 System.Security.Cryptography/ECParameters.cs
-System.Security.Cryptography/IncrementalHash.cs
index 8d845d576bfdb841b95a8725dad1639f3457a468..e47575986e7e9f076c13226d6cb355c71402a0ab 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 25275651f16facb771430c017c4c282435c06060..cc05f509439d1aafb03e8e11a557530ce857ab08 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 02e0b4aba48b76bfea5950cb7ce2047824976016..1a9d4ea388bea975c998dbc941705964b4de32b6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_STRICT;MONO_DEPLOY</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;MONO_STRICT;MONO_DEPLOY</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_STRICT;MONO_DEPLOY</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;MONO_STRICT;MONO_DEPLOY</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Data.Linq/build/.gitignore b/mcs/class/System.Data.Linq/build/.gitignore
new file mode 100644 (file)
index 0000000..f2cf7dc
--- /dev/null
@@ -0,0 +1,2 @@
+Northwind.db3
+
index 1079699a00fdf4e7c0e9fc00b93647933827697f..22f797c60f45de74c02e24453283aa7be8030900 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 ../examples/DbLinq.SQLite.Example/nwind/Northwind.cs
 ../src/DbLinq.Sqlite/Test/DirectDataContext.cs
 ../src/DbLinq.Sqlite/Test/TestBase_mono.cs
index bf28637588ce4107b9df01ff7077386fc17122d2..71e2154664a5940fe59b458727be871ecb24e5ab 100644 (file)
@@ -25,15 +25,14 @@ sqlite_tests_dep = \
 
 $(sqlite_tests): $(sqlite_tests_dep)
        $(TEST_COMPILE) -target:library -out:$@ \
-               -r:System.Data.dll -r:$(the_assembly) -r:Mono.Data.Sqlite $(test_nunit_ref) \
+               -r:$(topdir)/class/lib/$(PROFILE)/System.Data.dll -r:$(the_assembly) -r:$(topdir)/class/lib/$(PROFILE)/Mono.Data.Sqlite.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Xml.dll $(test_nunit_ref) \
                $(TEST_MCS_FLAGS) -d:MONO_STRICT -d:SQLITE \
                @$< $(TEST_SOURCES_WITH_SPACES)
 
 test-sqlite: $(sqlite_tests)
 
 RUN_TEST_COMMAND = \
-       MONO_REGISTRY_PATH="$(HOME)/.mono/registry" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(1) -noshadow $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) -xml=TestResult-$(1:.dll=)-$(PROFILE).xml -out:TestResult-$(1:.dll=)-$(PROFILE).out $(FIXTURE_ARG) $(TESTNAME_ARG) ; \
-       xsltproc $(topdir)/build/nunit-summary.xsl TestResult-$(1)-$(PROFILE).xml > TestResult-$(1:.dll=)-$(PROFILE).log
+       MONO_REGISTRY_PATH="$(HOME)/.mono/registry" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) $(1) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(TEST_HARNESS_OUTPUT) -labels -format:nunit2 -result=TestResult-$(1:.dll=)-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG) ;
 
 run-test-sqlite:
        $(call RUN_TEST_COMMAND,$(sqlite_tests))
index c9bea8ea40c594e715c35af32ad3789c10603f76..f2b6d3ede66e1a19fd2a1812c53784df489fce70 100644 (file)
@@ -71,7 +71,7 @@ using MsNorthwind;
             \r
 \r
             Assert.IsNotNull(dbCommand.CommandText);\r
-            Assert.Greater(dbCommand.Parameters.Count, 0);\r
+            AssertHelper.Greater(dbCommand.Parameters.Count, 0);\r
         }\r
     }\r
 }\r
index 5ea0dbc7d761f83e6eac880c174482a1c55ce012..9bd6aac50f90e6faa0e01157d6969f38d354f2a9 100644 (file)
@@ -186,7 +186,7 @@ using nwind;
             Northwind db = CreateDB();\r
             Expression<Func<Customer, bool>> predicate = c => c.City == "Paris";\r
             int count = db.Customers.Count(predicate);\r
-            Assert.Greater(count, 0); // Some databases have more than 1 customer in Paris\r
+            AssertHelper.Greater(count, 0); // Some databases have more than 1 customer in Paris\r
         }\r
 \r
         /// <summary>\r
index 87bf3d8cdeee9b5e7347f7df43ca47a0d2ec07cc..b8a1c728d8eea9ff9dcbaf6a9787ab24d910c074 100644 (file)
@@ -68,7 +68,7 @@ using nwind;
         {\r
             Northwind db = CreateDB();\r
             int result = db.ExecuteCommand("SELECT count(*) FROM \"Products\"");\r
-            Assert.Greater(result, 0, "Expecting some rows in Products table, got:" + result);\r
+            AssertHelper.Greater(result, 0, "Expecting some rows in Products table, got:" + result);\r
         }\r
 \r
         /// <summary>\r
@@ -85,7 +85,7 @@ using nwind;
             Northwind db = CreateDB();\r
             int result = db.ExecuteCommand("SELECT count(*) FROM [Products] WHERE [ProductID]>{0}", 3);\r
             //long iResult = base.ExecuteScalar(sql);\r
-            Assert.Greater(result, 0, "Expecting some rows in Products table, got:" + result);\r
+            AssertHelper.Greater(result, 0, "Expecting some rows in Products table, got:" + result);\r
         }\r
 \r
     }\r
index ea375055d7eff42f3f25fbcd002a30e9d7d6f16d..fac3d615da592c19bc60a65c3790046525a07c6a 100644 (file)
@@ -67,7 +67,7 @@ using nwind;
             string beforecountry = character.Country;\r
             character.Country = "Burmuda";\r
 \r
-            Assert.Greater(db.GetChangeSet().Updates.Count, 0);\r
+            AssertHelper.Greater(db.GetChangeSet().Updates.Count, 0);\r
             db.SubmitChanges();\r
 \r
             var character2 = db.Customers.First(c=>c.CustomerID==character.CustomerID);\r
index e420e84f6bbbf621550f8192920040ce02954382..dd976666e05742c322045241a451dc14c98f2613 100644 (file)
@@ -159,7 +159,7 @@ using nwind;
 \r
             var q3 = q1.Union(q2);\r
 \r
-            Assert.Greater(q1.Count(), 0);\r
+            AssertHelper.Greater(q1.Count(), 0);\r
             Assert.IsTrue(q1.Count() + q2.Count() >= q3.Count());\r
 \r
         }\r
index 1f443c32ac66030d295c8a83b74bbbef11f0b92b..efde50c3dcce75b227dda8bd8c37988e1da97f34 100644 (file)
@@ -234,7 +234,7 @@ namespace nwind
             var q = from p in db.Products select p;\r
             List<Product> products = q.ToList();\r
             int productCount = products.Count;\r
-            Assert.Greater(productCount, 0, "Expected some products, got none");\r
+            AssertHelper.Greater(productCount, 0, "Expected some products, got none");\r
         }\r
 \r
 #if !DEBUG && SQLITE\r
@@ -443,7 +443,7 @@ namespace nwind
                     select p;\r
 \r
             int count = q.Count();\r
-            Assert.Less(count, db.Customers.Count());\r
+            AssertHelper.Less(count, db.Customers.Count());\r
         }\r
 \r
         [Test]\r
@@ -455,7 +455,7 @@ namespace nwind
                     select p;\r
 \r
             int count = q.Count();\r
-            Assert.Less(count, db.Customers.Count());\r
+            AssertHelper.Less(count, db.Customers.Count());\r
         }\r
 \r
         [Test]\r
@@ -496,7 +496,7 @@ namespace nwind
         }\r
 \r
         [Test]\r
-        [ExpectedException(ExceptionType=typeof(InvalidOperationException), ExpectedMessage="Data context options cannot be modified after results have been returned from a query.")]\r
+        [ExpectedException(typeof(InvalidOperationException), ExpectedMessage="Data context options cannot be modified after results have been returned from a query.")]\r
         public void C13_Changing_ObjectTrackingEnabled2False()\r
         {\r
             Northwind db = CreateDB();\r
@@ -507,7 +507,7 @@ namespace nwind
         }\r
 \r
         [Test]\r
-        [ExpectedException(ExceptionType = typeof(InvalidOperationException), ExpectedMessage = "Data context options cannot be modified after results have been returned from a query.")]\r
+        [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Data context options cannot be modified after results have been returned from a query.")]\r
         public void C14_Changing_DeferredLoadingEnabled2False()\r
         {\r
             Northwind db = CreateDB();\r
@@ -518,7 +518,7 @@ namespace nwind
         }\r
 \r
         [Test]\r
-        [ExpectedException(ExceptionType = typeof(InvalidOperationException), ExpectedMessage = "Object tracking is not enabled for the current data context instance.")]\r
+        [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Object tracking is not enabled for the current data context instance.")]\r
         public void C15_SubmitChanges_DeferredLoadingEnabled_False()\r
         {\r
             Northwind db = CreateDB();\r
@@ -572,7 +572,7 @@ namespace nwind
                         .Join(db.GetTable<EmployeeTerritory>(), t => t.TerritoryID, l => l.TerritoryID, (t, l) => l)\r
                         .Join(db.GetTable<Employee>().Where(e => e.EmployeeID > 0), l => l.EmployeeID, e => e.EmployeeID, (l, e) => e);\r
             var employeeCount = q.Count();\r
-            Assert.Greater(employeeCount, 0, "Expected any employees, got count=" + employeeCount);\r
+            AssertHelper.Greater(employeeCount, 0, "Expected any employees, got count=" + employeeCount);\r
         }\r
 \r
         /// <summary>\r
@@ -839,7 +839,7 @@ namespace nwind
 \r
             var q = from p in db.Products where p.ProductName == "Chai" select p.ProductID;\r
             var productID = q.First();\r
-            Assert.Greater(productID, 0, "Expected penID>0, got " + productID);\r
+            AssertHelper.Greater(productID, 0, "Expected penID>0, got " + productID);\r
         }\r
 \r
 \r
@@ -880,7 +880,7 @@ namespace nwind
 \r
             var q = from p in db.Products where p.ProductName == "Chai" select p.ProductID;\r
             var productID = q.Last();\r
-            Assert.Greater(productID, 0, "Expected penID>0, got " + productID);\r
+            AssertHelper.Greater(productID, 0, "Expected penID>0, got " + productID);\r
         }\r
 \r
 #if !DEBUG && (POSTGRES || (MSSQL && !L2SQL))\r
@@ -902,11 +902,11 @@ namespace nwind
                 {\r
                     //int compareNames = prevProductName.CompareTo(p.ProductName);\r
                     int compareNames = string.Compare(prevProductName, p.ProductName, stringComparisonType);\r
-                    Assert.Less(compareNames, 0, "When ordering by names, expected " + prevProductName + " to come after " + p.ProductName);\r
+                    AssertHelper.Less(compareNames, 0, "When ordering by names, expected " + prevProductName + " to come after " + p.ProductName);\r
                 }\r
                 prevProductName = p.ProductName;\r
             }\r
-            //Assert.Greater(productID,0,"Expected penID>0, got "+productID);\r
+            //AssertHelper.Greater(productID,0,"Expected penID>0, got "+productID);\r
         }\r
 \r
         [Test]\r
@@ -915,7 +915,7 @@ namespace nwind
             Northwind db = CreateDB();\r
             //var q = from p in db.Products where "Chai"==p.ProductName select p.Order;\r
             //List<Order> penOrders = q.ToList();\r
-            //Assert.Greater(penOrders.Count,0,"Expected some orders for product 'Chai'");\r
+            //AssertHelper.Greater(penOrders.Count,0,"Expected some orders for product 'Chai'");\r
 \r
             var q =\r
                 from o in db.Orders\r
@@ -929,7 +929,7 @@ namespace nwind
                 Assert.IsNotNull(co.c.City, "Expected non-null customer city");\r
                 Assert.IsNotNull(co.o, "Expected non-null order");\r
             }\r
-            Assert.Greater(list1.Count, 0, "Expected some orders for London customers");\r
+            AssertHelper.Greater(list1.Count, 0, "Expected some orders for London customers");\r
         }\r
 \r
         [Test]\r
@@ -947,7 +947,7 @@ namespace nwind
                 Assert.IsNotNull(co.c, "Expected non-null customer");\r
                 Assert.IsNotNull(co.o, "Expected non-null order");\r
             }\r
-            Assert.Greater(list1.Count, 0, "Expected some orders for London customers");\r
+            AssertHelper.Greater(list1.Count, 0, "Expected some orders for London customers");\r
         }\r
 \r
         [Test]\r
@@ -962,7 +962,7 @@ namespace nwind
                 where c.City == "London"\r
                 select new { c, o };\r
 \r
-            Assert.Greater(q.ToList().Count, 0, "Expected some orders for London customers");\r
+            AssertHelper.Greater(q.ToList().Count, 0, "Expected some orders for London customers");\r
         }\r
 \r
         [Test]\r
@@ -987,7 +987,7 @@ namespace nwind
 #else\r
             int expectedCount = 2; //Oracle, Mysql: 'Toilet Paper' and 'iPod'\r
 #endif\r
-            Assert.Greater(prods.Count, expectedCount, "Expected couple of products with letter 'p'");\r
+            AssertHelper.Greater(prods.Count, expectedCount, "Expected couple of products with letter 'p'");\r
         }\r
 \r
         [Test]\r
@@ -1002,11 +1002,11 @@ namespace nwind
             ).Take(5);\r
             //var q = db.Products.Where( p=>p.ProductName.Contains("p")).Take(5);\r
             List<Product> prods = q.ToList();\r
-            Assert.Greater(prods.Count, 2, "Expected couple of products with letter 'p'");\r
+            AssertHelper.Greater(prods.Count, 2, "Expected couple of products with letter 'p'");\r
 \r
             var prodID0 = prods[0].ProductID;\r
             var prodID1 = prods[1].ProductID;\r
-            Assert.Greater(prodID0, prodID1, "Sorting is broken");\r
+            AssertHelper.Greater(prodID0, prodID1, "Sorting is broken");\r
         }\r
 \r
         [Test]\r
index 8d8c325cbec773aba06c7b293d75553ace8c292b..fe7a675318132bfcbb66b452cc5e859e594b00b1 100644 (file)
@@ -136,7 +136,7 @@ using Id = System.Int32;
         {\r
             var q = from p in db.Products select p;\r
             int productCount = q.Count();\r
-            Assert.Greater(productCount, 0, "Expected non-zero product count");\r
+            AssertHelper.Greater(productCount, 0, "Expected non-zero product count");\r
         }\r
 \r
         [Test]\r
@@ -144,7 +144,7 @@ using Id = System.Int32;
         {\r
             var q = from p in db.Products select p.ProductID;\r
             int productCount = q.Count();\r
-            Assert.Greater(productCount, 0, "Expected non-zero product count");\r
+            AssertHelper.Greater(productCount, 0, "Expected non-zero product count");\r
             Console.WriteLine();\r
         }\r
         [Test]\r
@@ -152,7 +152,7 @@ using Id = System.Int32;
         {\r
             var q = from p in db.Products select p.ProductID;\r
             int productCount = q.Count(i => i < 3);\r
-            Assert.Greater(productCount, 0, "Expected non-zero product count");\r
+            AssertHelper.Greater(productCount, 0, "Expected non-zero product count");\r
             Assert.IsTrue(productCount < 4, "Expected product count < 3");\r
         }\r
 \r
@@ -161,7 +161,7 @@ using Id = System.Int32;
         {\r
             var q = from p in db.Products select p.ProductID;\r
             var maxID = q.Max();\r
-            Assert.Greater(maxID, 0, "Expected non-zero product count");\r
+            AssertHelper.Greater(maxID, 0, "Expected non-zero product count");\r
         }\r
 \r
         [Test]\r
@@ -169,7 +169,7 @@ using Id = System.Int32;
         {\r
             var q = from p in db.Products select p.ProductID;\r
             var minID = q.Min();\r
-            Assert.Greater(minID, 0, "Expected non-zero product count");\r
+            AssertHelper.Greater(minID, 0, "Expected non-zero product count");\r
         }\r
 \r
 #if !ORACLE // picrap: this test causes an internal buffer overflow when marshaling with oracle win32 driver\r
@@ -179,7 +179,7 @@ using Id = System.Int32;
         {\r
             var q = from p in db.Products select p.ProductID;\r
             double avg = q.Average();\r
-            Assert.Greater(avg, 0, "Expected non-zero productID average");\r
+            AssertHelper.Greater(avg, 0, "Expected non-zero productID average");\r
         }\r
 \r
 #endif\r
@@ -268,7 +268,7 @@ using Id = System.Int32;
             var q4 = from p in db.Products select p.ProductName + p.ProductID;\r
             //var q4 = from p in db.Products select p.ProductID;\r
             var q5 = q4.ToList();\r
-            Assert.Greater(q5.Count, 2, "Expected to see some concat strings");\r
+            AssertHelper.Greater(q5.Count, 2, "Expected to see some concat strings");\r
             foreach (string s0 in q5)\r
             {\r
                 bool startWithLetter = Char.IsLetter(s0[0]);\r
@@ -288,7 +288,7 @@ using Id = System.Int32;
                      select p.ProductName+p.ProductID;\r
             //var q4 = from p in db.Products select p.ProductID;\r
             //var q5 = q4.ToList();\r
-            Assert.Greater( q4.Count(), 2, "Expected to see some concat strings");\r
+            AssertHelper.Greater( q4.Count(), 2, "Expected to see some concat strings");\r
             foreach(string s0 in q4)\r
             {\r
                 bool startWithLetter = Char.IsLetter(s0[0]);\r
@@ -312,8 +312,8 @@ using Id = System.Int32;
                                           CustomerID = c.CustomerID\r
                                       });\r
             var list = q.ToList();\r
-            Assert.Greater(list.Count(), 0, "Expected list");\r
-            //Assert.Greater(list.Count(), 0, "Expected list");\r
+            AssertHelper.Greater(list.Count(), 0, "Expected list");\r
+            //AssertHelper.Greater(list.Count(), 0, "Expected list");\r
             Assert.Ignore("test passed but: theoretically constructions of entity types are not allowed");\r
         }\r
 \r
@@ -331,8 +331,8 @@ using Id = System.Int32;
             //this OrderBy clause messes up the SQL statement\r
             var q2 = q.OrderBy(c => c.CustomerID);\r
             var list = q2.ToList();\r
-            Assert.Greater(list.Count(), 0, "Expected list");\r
-            //Assert.Greater(list.Count(), 0, "Expected list");\r
+            AssertHelper.Greater(list.Count(), 0, "Expected list");\r
+            //AssertHelper.Greater(list.Count(), 0, "Expected list");\r
         }\r
 \r
 \r
@@ -344,7 +344,7 @@ using Id = System.Int32;
                     orderby c.ContactName ?? ""\r
                     select c;\r
             var list = q.ToList();\r
-            Assert.Greater(list.Count(), 0, "Expected list");\r
+            AssertHelper.Greater(list.Count(), 0, "Expected list");\r
         }\r
 \r
         [Test(Description = "Non-dynamic version of DL5_NestedObjectSelect")]\r
index 4d87952ed79e63e09cf587601e842cb2db2a6728..9ff4496ee8bbb3dd413af5a111b6ac3d835a8087 100644 (file)
@@ -231,10 +231,10 @@ using nwind;
                      select new { g.Key, OrderCount = g.Count() };\r
 \r
             var lst = q2.ToList();\r
-            Assert.Greater(lst.Count, 0, "Expected some grouped order results");\r
+            AssertHelper.Greater(lst.Count, 0, "Expected some grouped order results");\r
             var result0 = lst[0];\r
             Assert.IsTrue(result0.Key != null, "Key must be non-null");\r
-            Assert.Greater(result0.OrderCount, 0, "Count must be > 0");\r
+            AssertHelper.Greater(result0.OrderCount, 0, "Count must be > 0");\r
             //select new { g.Key , SumPerCustomer = g.Sum(o2=>o2.OrderID) };\r
         }\r
 \r
@@ -252,10 +252,10 @@ using nwind;
                      select new { g.Key, OrderCount = g.Count() };\r
 \r
             var lst = q2.ToList();\r
-            Assert.Greater(lst.Count, 0, "Expected some grouped order results");\r
+            AssertHelper.Greater(lst.Count, 0, "Expected some grouped order results");\r
             var result0 = lst[0];\r
             Assert.IsTrue(result0.Key != null, "Key must be non-null");\r
-            Assert.Greater(result0.OrderCount, 0, "Count must be > 0");\r
+            AssertHelper.Greater(result0.OrderCount, 0, "Count must be > 0");\r
             //select new { g.Key , SumPerCustomer = g.Sum(o2=>o2.OrderID) };\r
         }\r
 \r
@@ -272,12 +272,12 @@ using nwind;
                      //where g.Count()>1\r
                      select new { g.Key, OrderSum = g.Sum(o => o.OrderID) };\r
             var lst = q2.ToList();\r
-            Assert.Greater(lst.Count, 0, "Expected some grouped order results");\r
+            AssertHelper.Greater(lst.Count, 0, "Expected some grouped order results");\r
             foreach (var result in lst)\r
             {\r
                 Console.WriteLine("  Result: custID=" + result.Key + " sum=" + result.OrderSum);\r
                 Assert.IsTrue(result.Key != null, "Key must be non-null");\r
-                Assert.Greater(result.OrderSum, 0, "OrderSum must be > 0");\r
+                AssertHelper.Greater(result.OrderSum, 0, "OrderSum must be > 0");\r
             }\r
             //select new { g.Key , SumPerCustomer = g.Sum(o2=>o2.OrderID) };\r
         }\r
index 0c58ea44d4cbefd5efec0dffd7a9f2b588702477..48e0020e30fc8e9cb3334fc7167ff4e0619e0773 100644 (file)
@@ -331,7 +331,7 @@ using nwind;
             decimal[] d = new decimal[] { 1, 4, 5, 6, 10248, 10255 };\r
             var q = db.OrderDetails.Where(o => d.Contains(o.OrderID));\r
 \r
-            Assert.Greater(q.Count(), 0);\r
+            AssertHelper.Greater(q.Count(), 0);\r
         }\r
 \r
 \r
index 3d1981a405db66e0839c904a66b8ae41945fdf60..dabe2f12a7819a833252d38b3ec60a713d51995a 100644 (file)
@@ -265,7 +265,7 @@ using DbLinq.Data.Linq;
 \r
 \r
             var list = query.ToList();\r
-            Assert.Greater(list.Count, 0);\r
+            AssertHelper.Greater(list.Count, 0);\r
         }\r
 \r
 #if !DEBUG && SQLITE\r
@@ -299,7 +299,7 @@ using DbLinq.Data.Linq;
 \r
 \r
             var list = query.ToList();\r
-            Assert.Greater(list.Count, 0);\r
+            AssertHelper.Greater(list.Count, 0);\r
         }\r
 \r
 \r
@@ -334,7 +334,7 @@ using DbLinq.Data.Linq;
 \r
 \r
             var list = query.ToList();\r
-            Assert.Greater(list.Count, 0);\r
+            AssertHelper.Greater(list.Count, 0);\r
         }\r
 \r
 #if !DEBUG && (SQLITE || MSSQL)\r
@@ -354,7 +354,7 @@ using DbLinq.Data.Linq;
             \r
 \r
             var list = query.ToList();\r
-            Assert.Greater(list.Count, 0);\r
+            AssertHelper.Greater(list.Count, 0);\r
         }\r
 \r
 #if !DEBUG && SQLITE\r
@@ -388,7 +388,7 @@ using DbLinq.Data.Linq;
 \r
 \r
             var list = query.ToList();\r
-            Assert.Greater(list.Count, 0);\r
+            AssertHelper.Greater(list.Count, 0);\r
         }\r
 \r
 #if !DEBUG && SQLITE\r
@@ -410,7 +410,7 @@ using DbLinq.Data.Linq;
 \r
             var list = query.ToList();\r
 \r
-            Assert.Greater(list.Count, 0);\r
+            AssertHelper.Greater(list.Count, 0);\r
         }\r
 \r
 #if !DEBUG && POSTGRES\r
@@ -443,7 +443,7 @@ using DbLinq.Data.Linq;
 \r
                 var list = query.ToList();\r
 \r
-                Assert.Greater(list.Count, 0);\r
+                AssertHelper.Greater(list.Count, 0);\r
             }\r
             finally\r
             {\r
@@ -481,7 +481,7 @@ using DbLinq.Data.Linq;
 \r
                 var list = query.ToList();\r
 \r
-                Assert.Greater(list.Count, 0);\r
+                AssertHelper.Greater(list.Count, 0);\r
             }\r
             finally\r
             {\r
index 40503fed4f534d09174c598ac28f34299f5234b4..16a0b0a7ba0b478dd10b0d763fce6ab91634f70a 100644 (file)
@@ -53,7 +53,7 @@ using nwind;
         {\r
             var db = CreateDB();\r
             var customer = db.Customers.First();\r
-            Assert.Greater(customer.Orders.Count, 0);\r
+            AssertHelper.Greater(customer.Orders.Count, 0);\r
         }\r
 \r
 #if !DEBUG && (SQLITE || (MSSQL && !L2SQL))\r
@@ -65,7 +65,7 @@ using nwind;
             var db = CreateDB();\r
             var results = (from c in db.Customers select c.Orders).ToList();\r
 \r
-            Assert.Greater(results.Count, 0);\r
+            AssertHelper.Greater(results.Count, 0);\r
         }\r
 \r
         [Test]\r
@@ -98,7 +98,7 @@ using nwind;
             var db = CreateDB();\r
             var customer = db.Customers.First();\r
 \r
-            Assert.Greater(customer.Orders.Count, 0, "#1");\r
+            AssertHelper.Greater(customer.Orders.Count, 0, "#1");\r
             Assert.IsTrue(customer.Orders.HasLoadedOrAssignedValues, "#2");\r
             customer.Orders.SetSource(System.Linq.Enumerable.Empty<Order>());\r
         }\r
@@ -136,7 +136,7 @@ using nwind;
             int ordersCount = (from cust in db.Customers\r
                                select cust.Orders.Count).First();\r
 \r
-            Assert.Greater(ordersCount, 0);\r
+            AssertHelper.Greater(ordersCount, 0);\r
 \r
             var customer2 = db.Customers.First();\r
             customer2.Orders.SetSource(System.Linq.Enumerable.Empty<Order>());\r
@@ -154,11 +154,11 @@ using nwind;
             var c = db.Customers.First();\r
 \r
             int beforeCount = c.Orders.Count;\r
-            Assert.Greater(beforeCount, 0);\r
+            AssertHelper.Greater(beforeCount, 0);\r
             c.Orders.Clear();\r
             Assert.AreEqual(c.Orders.Count, 0);\r
             c.Orders.AddRange(db.Orders);\r
-            Assert.Greater(c.Orders.Count, beforeCount);\r
+            AssertHelper.Greater(c.Orders.Count, beforeCount);\r
             db.Refresh(RefreshMode.OverwriteCurrentValues, c.Orders);\r
 \r
             Assert.AreEqual(c.Orders.Count, beforeCount);\r
@@ -174,13 +174,13 @@ using nwind;
             var c = db.Customers.First();\r
 \r
             int beforeCount = c.Orders.Count;\r
-            Assert.Greater(beforeCount, 0);\r
+            AssertHelper.Greater(beforeCount, 0);\r
             c.Orders.Clear();\r
             Assert.AreEqual(c.Orders.Count, 0);\r
             c.Orders.AddRange(db.Orders);\r
 \r
             int middleCount = c.Orders.Count;\r
-            Assert.Greater(c.Orders.Count, beforeCount);\r
+            AssertHelper.Greater(c.Orders.Count, beforeCount);\r
 \r
             db.Refresh(RefreshMode.KeepCurrentValues, c.Orders);\r
             Assert.AreEqual(c.Orders.Count, middleCount);\r
@@ -233,7 +233,7 @@ using nwind;
         {\r
             var db = CreateDB();\r
             var customer = db.Customers.Where(c => c.Orders.Count > 0).First();\r
-            Assert.Greater(customer.Orders.Count, 0);\r
+            AssertHelper.Greater(customer.Orders.Count, 0);\r
             bool ok;\r
             System.ComponentModel.ListChangedEventArgs args = null;\r
             customer.Orders.ListChanged += delegate(object sender, System.ComponentModel.ListChangedEventArgs a) \r
index f792f8e585fb0e173c1d07d5553c36dfbc050535..e32291198abae2c9f7e5920020984dceb129f7a0 100644 (file)
@@ -86,10 +86,10 @@ using nwind;
             foreach (var c in q)\r
             {\r
                 Assert.IsNotNull(c.CustomerID);\r
-                Assert.Greater(c.OrderCount, -1);\r
+                AssertHelper.Greater(c.OrderCount, -1);\r
                 count++;\r
             }\r
-            Assert.Greater(count, 0);\r
+            AssertHelper.Greater(count, 0);\r
         }\r
 \r
         [Test]\r
@@ -103,10 +103,10 @@ using nwind;
             foreach (var v in q)\r
             {\r
                 Assert.IsNotNull(v.c.CustomerID);\r
-                Assert.Greater(v.OrderCount, -1);\r
+                AssertHelper.Greater(v.OrderCount, -1);\r
                 count++;\r
             }\r
-            Assert.Greater(count, 0);\r
+            AssertHelper.Greater(count, 0);\r
         }\r
 \r
         [Test]\r
@@ -121,7 +121,7 @@ using nwind;
                 Assert.IsTrue(c.CustomerID!=null, "Non-null customerID required");\r
                 count++;\r
             }\r
-            Assert.Greater(count, 0);\r
+            AssertHelper.Greater(count, 0);\r
         }\r
 #endif\r
     }\r
index 3aa1c9e1b6f1484b396c8124c6b95cc4e8c97d3d..08ed664f1b3c16cfeab659b9a61fe7cdd0ffc967 100644 (file)
@@ -161,7 +161,7 @@ using nwind;
             var customer = new Customer();\r
             db.Customers.Attach(customer, originalCustomer);\r
 \r
-            Assert.Greater(db.Customers.GetModifiedMembers(customer).Count(), 0);\r
+            AssertHelper.Greater(db.Customers.GetModifiedMembers(customer).Count(), 0);\r
         }\r
 \r
 #if !DEBUG && (SQLITE || POSTGRES || (MSSQL && !L2SQL))\r
index e593fc37c6e51b376f15d4f6086362102fd64966..ba0734df607a65de5db2347ea94a8a5abcac2fcb 100644 (file)
@@ -33,7 +33,7 @@ using NUnit.Framework;
 \r
 using nwind;\r
 \r
-#if MONO_STRICT && !MONO\r
+#if MONO_STRICT\r
 using System.Diagnostics;\r
 public static class Profiler\r
 {\r
index a30b2cff6a41dd2dac870107118fdb4dfee07e77..11fe0098a2a8b3e20d57fe91c44beb1da793ab69 100644 (file)
@@ -165,7 +165,7 @@ using Id = System.Int32;
             newProd.QuantityPerUnit = "33 1/2";\r
             db.Products.InsertOnSubmit(newProd);\r
             db.SubmitChanges();\r
-            Assert.Greater(newProd.ProductID, 0, "After insertion, ProductID should be non-zero");\r
+            AssertHelper.Greater(newProd.ProductID, 0, "After insertion, ProductID should be non-zero");\r
             //Assert.IsFalse(newProd.IsModified, "After insertion, Product.IsModified should be false");\r
             return (int)newProd.ProductID; //this test cab be used from delete tests\r
         }\r
@@ -180,7 +180,7 @@ using Id = System.Int32;
         public void G2_DeleteTest()\r
         {\r
             int insertedID = insertProduct_priv();\r
-            Assert.Greater(insertedID, 0, "DeleteTest cannot operate if row was not inserted");\r
+            AssertHelper.Greater(insertedID, 0, "DeleteTest cannot operate if row was not inserted");\r
 \r
             Northwind db = CreateDB();\r
 \r
@@ -200,7 +200,7 @@ using Id = System.Int32;
         public void G3_DeleteTest()\r
         {\r
             int insertedID = insertProduct_priv();\r
-            Assert.Greater(insertedID, 0, "DeleteTest cannot operate if row was not inserted");\r
+            AssertHelper.Greater(insertedID, 0, "DeleteTest cannot operate if row was not inserted");\r
 \r
             Northwind db = CreateDB();\r
 \r
index 431634ee37c844608af0fe6e97d360b27ff6f537..a3ef05590f275059b6e8f1a6bba5bc79a7d30f79 100644 (file)
@@ -1,10 +1,8 @@
 Some tests located require a connection to Oracle database to execute.
-To configure a connection, copy System.Data.OracleClient_test_default.dll.config.example
-to System.Data.OracleClient_test_default.dll.config and fill in the ConnectionString with appropriate Data Source.
+To configure a connection, set the MONO_TESTS_ORACLE_CONNECTION_STRING environment variable to a connection string like the following:
 
-If no System.Data.OracleClient_test_default.dll.config is present, those tests will be ignored.
+Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host ip>)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=<sid>)));uid=<user name>;pwd=<password>;
 
-To test .Net 2.0 profile, copy System.Data.OracleClient_test_default.dll.config
-to System.Data.OracleClient_test_net_2_0.dll.config and launch tests with PROFILE=net_2_0 .
+If the environment variable is not present, those tests will be ignored.
 
 Scripts for populating the database are located in Test/System.Data.OracleClient.jvm (for their usage, consult Test/System.Data.OracleClient.jvm/readme.txt).
index e569ce44aadc5670c18fb99983c1862d418eb8d4..092f11382bb2942f726449daee6ae36f53b4c3b2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test_default.dll.config.example b/mcs/class/System.Data.OracleClient/System.Data.OracleClient_test_default.dll.config.example
deleted file mode 100644 (file)
index 03703a7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<configuration>
-       <appSettings>
-               <add key="ConnectionString" value="Data Source=;User ID=GHTDB;Password=GHTDB;" />
-       </appSettings>
-</configuration>
index 43e77ef1b220a4deaae4290a89729a76531ca3da..02c12ee3c947ee04bfb31a152a8935cbe4a60dd7 100644 (file)
@@ -51,7 +51,7 @@ namespace MonoTests.System.Data.OracleClient {
                 [TestFixtureSetUp]
                 public void FixtureSetUp ()
                 {
-                        connection_string = ConfigurationSettings.AppSettings.Get ("ConnectionString");
+                        connection_string = Environment.GetEnvironmentVariable ("MONO_TESTS_ORACLE_CONNECTION_STRING");
                         if(connection_string == null)
                                 Assert.Ignore ("Please consult README.tests.");
                 }
index a5feb72a00ba44d3ede3845b4f7b683384e90a99..70421c51a8dd6d1a7cc846e81d6261735282e75c 100755 (executable)
@@ -47,6 +47,7 @@ CREATE USER "GHTDB"
     TEMPORARY TABLESPACE "TEMP" ;
 
 GRANT CONNECT, RESOURCE, CREATE TABLE  TO "GHTDB";
+ALTER USER GHTDB quota unlimited on USERS;
 
 CREATE OR REPLACE  PACKAGE "GHTDB"."GHTPKG"  AS
        TYPE RCT1 IS REF CURSOR;
@@ -923,6 +924,7 @@ CREATE USER "GHTDB_EX"
     TEMPORARY TABLESPACE "TEMP" ;
 
 GRANT CONNECT, RESOURCE TO "GHTDB_EX";
+ALTER USER GHTDB_EX quota unlimited on USERS;
 
 CREATE OR REPLACE PACKAGE GHTDB_EX.GHTPKG
 AS
index 3fd8b632a9f0416ac6fb84124c0afd96e1ffb30f..ebe3de47ce51b12b707fbe72d145f116ce7b7c6e 100644 (file)
@@ -72,7 +72,7 @@ namespace MonoTests.System.Data.Utils {
 
                public static string ConnectionString {
                        get {
-                                string connection_string = Sys.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
+                                string connection_string = Environment.GetEnvironmentVariable ("MONO_TESTS_ORACLE_CONNECTION_STRING");
                                 if(connection_string == null)
                                         NUnit.Framework.Assert.Ignore ("Please consult README.tests.");
                                 return connection_string;
index 9c638e8252de6902084d8ce007233976202dc9cc..f544c35100675c0157f984d2ac1bea9a378339bd 100644 (file)
@@ -39,14 +39,7 @@ namespace MonoTests.System.Data.OracleClient
                [SetUp]
                public void SetUp()
                {
-                       try
-                       {
-                               _ConnectionString = MonoTests.System.Data.Utils.ConnectedDataProvider.ConnectionString;
-                       }
-                       catch(Exception ex)
-                       {
-                               EndCase(ex);
-                       }
+                       _ConnectionString = MonoTests.System.Data.Utils.ConnectedDataProvider.ConnectionString;
                }
 
                [TearDown]
index a9164fb27a7f7566484a53606e6e303833a2f451..9c36355d57f43f429d509dbe5cd36e21265c878e 100755 (executable)
@@ -1,15 +1,6 @@
 To run unit test the following should be prepared:
 
-1. Test\System.Data.OracleClient.J2EE.config should contain an ConnectionString setting, i.e.:
-
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
-<appSettings>
-    <add key="ConnectionString" value="User ID=ghtdb;Password=ghtdb;Data Source=xp050" />
-  </appSettings>
-</configuration>
-
-2. A target db should be prepared with the relevant structure, following are the instruction for each supported database.
+A target db should be prepared with the relevant structure, following are the instruction for each supported database.
 
 in order to create the testing database, on ORACLE, run:
 Run the scripts with a user wich have administrator permissions. (by default user:system, password:mainsoft).
index 6b758dea47fae69022ab79245b4e2e6eeb3644f7..0dfd37e6402f0cfd2cb50d42dbe5413f641088b8 100644 (file)
@@ -48,7 +48,7 @@ namespace MonoTests.System.Data.OracleClient {
                 [TestFixtureSetUp]
                 public void FixtureSetUp ()
                 {
-                        connection_string = ConfigurationSettings.AppSettings.Get ("ConnectionString");
+                        connection_string = Environment.GetEnvironmentVariable ("MONO_TESTS_ORACLE_CONNECTION_STRING");
                         if(connection_string == null)
                                 Assert.Ignore ("Please consult README.tests.");
                 }
index d625b6bf129ac25230f1c2e35a9d80002b624b14..29c2e9022c74553dfb14d5ebab6aa3228eaffd12 100644 (file)
@@ -52,7 +52,7 @@ namespace MonoTests.System.Data.OracleClient
                [TestFixtureSetUp]
                public void FixtureSetUp ()
                {
-                       connection_string = ConfigurationSettings.AppSettings.Get ("ConnectionString");
+                       connection_string = Environment.GetEnvironmentVariable ("MONO_TESTS_ORACLE_CONNECTION_STRING");
                }
 
                [SetUp]
index e5d64222fa84dd2641e4f4a7f659b3028e15c7fd..29a16573c7c7a53852b64c7f53ab16dedf4a3365 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 6a4ef89e6c8bf13b70136105c1fa71096935b7c4..116bd6fa73d4f4891efa67c706abaf0ef67a5bf7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index b5bd23a7cbe8cb79f73e38af70f4a38447fa87ee..0806c36fb52977bfd5104e32117ff0e1e4d07994 100644 (file)
@@ -6,17 +6,23 @@ LIBRARY = System.Data.dll
 
 LIB_REFS = System System.Xml System.Core System.Numerics
 LIB_MCS_FLAGS = \
-       -nowarn:169,219,414,649 \
+       -nowarn:219,414,649 \
        -d:PLATFORM_UNIX \
        -d:USEOFFSET \
        -d:MONO_PARTIAL_DATA_IMPORT \
        -unsafe
 
+ifdef NO_MONO_SECURITY
+MONO_DATA_TDS=
+else
+MONO_DATA_TDS=Mono.Data.Tds
+endif
+
 ifdef MOBILE_PROFILE
-LIB_REFS += Mono.Data.Tds System.Transactions
+LIB_REFS += $(MONO_DATA_TDS) System.Transactions
 LIB_MCS_FLAGS += -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION
 else
-LIB_REFS += System.EnterpriseServices Mono.Data.Tds System.Configuration System.Transactions
+LIB_REFS += System.EnterpriseServices $(MONO_DATA_TDS) System.Configuration System.Transactions
 BUILT_SOURCES = \
        gen_OdbcConnection.cs \
        gen_OleDbConnection.cs \
@@ -31,6 +37,8 @@ TXT_RESOURCE_STRINGS = ../referencesource/System.Data/system.data.txt
 TEST_LIB_REFS = System.Core Mono.Data.Sqlite
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618,169,612,219,168
 
+TEST_NUNITLITE_APP_CONFIG_GLOBAL=Test/test-config-file
+
 TEST_MONO_PATH = .
 
 EXTRA_DISTFILES = \
@@ -39,7 +47,7 @@ EXTRA_DISTFILES = \
        $(wildcard Test/System.Xml/*.xml)               \
        $(wildcard Test/System.Xml/*.xsd)               \
        $(wildcard Test/System.Data/schemas/*.xsd)              \
-       app_test_net_4_x.config                 \
+       Test/test-config-file                   \
        Test/System.Data/binserialize/*.bin     \
        SqliteTest.db   \
        referencesource.sources
@@ -85,8 +93,3 @@ gen_SqlParameterCollection.cs: ../referencesource/System.Data/System/Data/Provid
        sed -e s/PARAMETEROBJECTNAME/SqlParameter/g >$@
 
 include ../../build/library.make
-
-$(test_lib): $(test_lib).config
-
-$(test_lib).config: app_test_$(PROFILE).config
-       cp $< $@
index 552ec452530cb80208bf70b344bf1986735968df..5bb4f1f25cab109f64ef53c241349f873b26a927 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -7,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{EC439BB8-FFED-4A32-A05D-2FA3A70CAD64}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699,169,219,414,649</NoWarn>\r
+    <NoWarn>1699,219,414,649</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
     <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,169,219,414,649</NoWarn>\r
+    <NoWarn>1699,219,414,649</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT</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,169,219,414,649</NoWarn>\r
+    <NoWarn>1699,219,414,649</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;PLATFORM_UNIX;USEOFFSET;MONO_PARTIAL_DATA_IMPORT</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="Microsoft.SqlServer.Server\SqlDataRecord.cs" />\r
     <Compile Include="Microsoft.SqlServer.Server\SqlMetaData.cs" />\r
     <Compile Include="ReferenceSources\NativeOledbWrapper.cs" />\r
+    <Compile Include="ReferenceSources\PoolBlockingPeriod.cs" />\r
     <Compile Include="ReferenceSources\Res.cs" />\r
     <Compile Include="ReferenceSources\Res.missing.cs" />\r
     <Compile Include="ReferenceSources\ResCategoryAttribute.cs" />\r
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopy.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopy.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..95d6801
--- /dev/null
@@ -0,0 +1,136 @@
+//
+// SqlBulkCopy.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Data.Common;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace System.Data.SqlClient {
+       public sealed class SqlBulkCopy : IDisposable
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlBulkCopy is not supported on the current platform.";
+
+               public SqlBulkCopy (SqlConnection connection)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlBulkCopy (string connectionString)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlBulkCopy (string connectionString, SqlBulkCopyOptions copyOptions)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlBulkCopy (SqlConnection connection, SqlBulkCopyOptions copyOptions, SqlTransaction externalTransaction)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public int BatchSize {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int BulkCopyTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SqlBulkCopyColumnMappingCollection ColumnMappings  {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string DestinationTableName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool EnableStreaming {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int NotifyAfter {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void WriteToServer (DataRow [] rows)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void WriteToServer (DataTable table)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void WriteToServer (IDataReader reader)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void WriteToServer (DataTable table, DataRowState rowState)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void WriteToServer (DbDataReader reader)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task WriteToServerAsync (DbDataReader reader)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task WriteToServerAsync (DbDataReader reader, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               private void RowsCopied (long rowsCopied)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public event SqlRowsCopiedEventHandler SqlRowsCopied;
+
+               void IDisposable.Dispose ()
+               {
+               }
+       }
+}
index c6dc7712baea19fa4846ae2da30eb5529c284944..1fd5443df85192ea7e3fcffd5461c19356952b59 100644 (file)
@@ -510,40 +510,104 @@ namespace System.Data.SqlClient {
                        }
                }
 
-               [MonoTODO]
                public new Task<SqlDataReader> ExecuteReaderAsync ()
                {
-                       throw new NotImplementedException ();
+                       return ExecuteReaderAsync (CommandBehavior.Default, CancellationToken.None);
                }
 
-               [MonoTODO]
                public new Task<SqlDataReader> ExecuteReaderAsync (CancellationToken cancellationToken)
                {
-                       throw new NotImplementedException ();
+                       return ExecuteReaderAsync (behavior, CancellationToken.None);
                }
 
-               [MonoTODO]
                public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior)
                {
-                       throw new NotImplementedException ();
+                       return ExecuteReaderAsync (CommandBehavior.Default, CancellationToken.None);
                }
 
-               [MonoTODO]
                public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior, CancellationToken cancellationToken)
                {
-                       throw new NotImplementedException ();
+                       TaskCompletionSource<SqlDataReader> source = new TaskCompletionSource<SqlDataReader>();
+
+                       CancellationTokenRegistration registration = new CancellationTokenRegistration();
+                       if (cancellationToken.CanBeCanceled) {
+                               if (cancellationToken.IsCancellationRequested) {
+                                       source.SetCanceled();
+                                       return source.Task;
+                               }
+                               registration = cancellationToken.Register(CancelIgnoreFailure);
+                       }
+
+                       Task<SqlDataReader> returnedTask = source.Task;
+                       try {
+                               // TODO: RegisterForConnectionCloseNotification(ref returnedTask);
+
+                               Task<SqlDataReader>.Factory.FromAsync(BeginExecuteReaderAsync, EndExecuteReader, behavior, null).ContinueWith((t) => {
+                                       registration.Dispose();
+                                       if (t.IsFaulted) {
+                                               Exception e = t.Exception.InnerException;
+                                               source.SetException(e);
+                                       }
+                                       else {
+                                               if (t.IsCanceled) {
+                                                       source.SetCanceled();
+                                               }
+                                               else {
+                                                       source.SetResult(t.Result);
+                                               }
+                                       }
+                               }, TaskScheduler.Default);
+                       }
+                       catch (Exception e) {
+                               source.SetException(e);
+                       }
+
+                       return returnedTask;
                }
 
-               [MonoTODO]
                public Task<XmlReader> ExecuteXmlReaderAsync ()
                {
-                       throw new NotImplementedException ();
+                       return ExecuteXmlReaderAsync (CancellationToken.None);
                }
  
-               [MonoTODO]
                public Task<XmlReader> ExecuteXmlReaderAsync (CancellationToken cancellationToken)
                {
-                       throw new NotImplementedException ();
+                       TaskCompletionSource<XmlReader> source = new TaskCompletionSource<XmlReader>();
+
+                       CancellationTokenRegistration registration = new CancellationTokenRegistration();
+                       if (cancellationToken.CanBeCanceled) {
+                               if (cancellationToken.IsCancellationRequested) {
+                                       source.SetCanceled();
+                                       return source.Task;
+                               }
+                               registration = cancellationToken.Register(CancelIgnoreFailure);
+                       }
+
+                       Task<XmlReader> returnedTask = source.Task;
+                       try {
+                               // TODO: RegisterForConnectionCloseNotification(ref returnedTask);
+
+                               Task<XmlReader>.Factory.FromAsync(BeginExecuteXmlReader, EndExecuteXmlReader, null).ContinueWith((t) => {
+                                       registration.Dispose();
+                                       if (t.IsFaulted) {
+                                               Exception e = t.Exception.InnerException;
+                                               source.SetException(e);
+                                       }
+                                       else {
+                                               if (t.IsCanceled) {
+                                                       source.SetCanceled();
+                                               }
+                                               else {
+                                                       source.SetResult(t.Result);
+                                               }
+                                       }
+                               }, TaskScheduler.Default);
+                       }
+                       catch (Exception e) {
+                               source.SetException(e);
+                       }
+
+                       return returnedTask;
                }
 
                public
@@ -846,6 +910,11 @@ namespace System.Data.SqlClient {
                        return BeginExecuteReader (callback, stateObject, CommandBehavior.Default);
                }
 
+               IAsyncResult BeginExecuteReaderAsync(CommandBehavior behavior, AsyncCallback callback, object stateObject)
+               {
+                       return BeginExecuteReader (callback, stateObject, behavior);
+               }
+
                public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject, CommandBehavior behavior)
                {
                        ValidateCommand ("BeginExecuteReader", true);
@@ -925,6 +994,9 @@ namespace System.Data.SqlClient {
 
                #endregion // Asynchronous Methods
 
+#pragma warning disable 0067
+               // TODO: Not implemented
                public event StatementCompletedEventHandler StatementCompleted;
+#pragma warning restore
        }
 }
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..491483e
--- /dev/null
@@ -0,0 +1,277 @@
+//
+// SqlCommand.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Data.Common;
+using System.Data.Sql;
+using System.Threading.Tasks;
+using System.Threading;
+using System.Xml;
+
+namespace System.Data.SqlClient {
+       public sealed class SqlCommand : DbCommand, IDbCommand, ICloneable
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlCommand is not supported on the current platform.";
+
+               public SqlCommand()
+                       : this (String.Empty, null, null)
+               {
+               }
+
+               public SqlCommand (string cmdText)
+                       : this (cmdText, null, null)
+               {
+               }
+
+               public SqlCommand (string cmdText, SqlConnection connection)
+                       : this (cmdText, connection, null)
+               {
+               }
+
+               public SqlCommand (string cmdText, SqlConnection connection, SqlTransaction transaction)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override string CommandText {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int CommandTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override CommandType CommandType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public new SqlConnection Connection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool DesignTimeVisible {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public new SqlParameterCollection Parameters {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public new SqlTransaction Transaction {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override UpdateRowSource UpdatedRowSource {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SqlNotificationRequest Notification {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool NotificationAutoEnlist {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override void Cancel ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlCommand Clone ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new SqlParameter CreateParameter ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int ExecuteNonQuery ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new SqlDataReader ExecuteReader ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new SqlDataReader ExecuteReader (CommandBehavior behavior)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new Task<SqlDataReader> ExecuteReaderAsync ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new Task<SqlDataReader> ExecuteReaderAsync (CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new Task<SqlDataReader> ExecuteReaderAsync (CommandBehavior behavior, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<XmlReader> ExecuteXmlReaderAsync ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public Task<XmlReader> ExecuteXmlReaderAsync (CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override object ExecuteScalar ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public XmlReader ExecuteXmlReader ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               object ICloneable.Clone ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+               }
+
+               public override void Prepare ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void ResetCommandTimeout ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override DbParameter CreateDbParameter ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override DbDataReader ExecuteDbDataReader (CommandBehavior behavior)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override DbConnection DbConnection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               protected override DbParameterCollection DbParameterCollection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               protected override DbTransaction DbTransaction {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public IAsyncResult BeginExecuteNonQuery ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginExecuteNonQuery (AsyncCallback callback, object stateObject)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public int EndExecuteNonQuery (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginExecuteReader ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginExecuteReader (CommandBehavior behavior)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginExecuteReader (AsyncCallback callback, object stateObject, CommandBehavior behavior)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlDataReader EndExecuteReader (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginExecuteXmlReader (AsyncCallback callback, object stateObject)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IAsyncResult BeginExecuteXmlReader ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public XmlReader EndExecuteXmlReader (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public event StatementCompletedEventHandler StatementCompleted;
+       }
+}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..155ddab
--- /dev/null
@@ -0,0 +1,158 @@
+//
+// SqlCommandBuilder.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Data;
+using System.Data.Common;
+using System.Data.SqlClient;
+
+namespace System.Data.SqlClient
+{
+       public class SqlCommandBuilder : DbCommandBuilder 
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlCommandBuilder is not supported on the current platform.";
+
+               public SqlCommandBuilder ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlCommandBuilder (SqlDataAdapter adapter)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static void DeriveParameters (SqlCommand command)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlCommand GetDeleteCommand ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlCommand GetInsertCommand ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlCommand GetUpdateCommand ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlCommand GetUpdateCommand (bool useColumnsForParameterNames)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlCommand GetDeleteCommand (bool useColumnsForParameterNames)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlCommand GetInsertCommand (bool useColumnsForParameterNames)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override string QuoteIdentifier (string unquotedIdentifier)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override string UnquoteIdentifier (string quotedIdentifier)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void ApplyParameterInfo (DbParameter parameter, DataRow datarow, StatementType statementType, bool whereClause)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override string GetParameterName (int parameterOrdinal)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override string GetParameterName (string parameterName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override string GetParameterPlaceholder (int parameterOrdinal)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void SetRowUpdatingHandler (DbDataAdapter adapter)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override DataTable GetSchemaTable (DbCommand srcCommand)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override DbCommand InitializeCommand (DbCommand command)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlDataAdapter DataAdapter {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string QuotePrefix {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string QuoteSuffix {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string CatalogSeparator {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string SchemaSeparator {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override CatalogLocation CatalogLocation {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+       }
+}
index 9af24e650543168cb7543aee345b08dafcf815a9..ff5dc821d854f550cd59f6b5ab6be1db6207fb17 100644 (file)
@@ -138,7 +138,9 @@ namespace System.Data.SqlClient
 
                [DefaultValue ("")]
                [EditorAttribute ("Microsoft.VSDesigner.Data.SQL.Design.SqlConnectionStringEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-               [RecommendedAsConfigurable (true)]
+#pragma warning disable 618 // ignore obsolete warning about RecommendedAsConfigurable to use SettingsBindableAttribute
+               [RecommendedAsConfigurable(true)]
+#pragma warning restore 618
                [RefreshProperties (RefreshProperties.All)]
                public override string ConnectionString {
                        get {
@@ -928,10 +930,22 @@ namespace System.Data.SqlClient
 
                                if (Client.Available <= 0)
                                        return -1; // Error
-                               IPEndPoint endpoint = new IPEndPoint (Dns.GetHostEntry ("localhost").AddressList [0], 0);
+
+                               IPEndPoint remoteEndpoint;
+                               switch (Client.AddressFamily) {
+                                       case AddressFamily.InterNetwork:
+                                               remoteEndpoint = new IPEndPoint(IPAddress.Any, 0);
+                                               break;
+                                       case AddressFamily.InterNetworkV6:
+                                               remoteEndpoint = new IPEndPoint(IPAddress.IPv6Any, 0);
+                                               break;
+                                       default:
+                                               return -1; // Error
+                               }
+
                                Byte [] rawrs;
 
-                               rawrs = Receive (ref endpoint);
+                               rawrs = Receive (ref remoteEndpoint);
 
                                string rs = Encoding.ASCII.GetString (rawrs);
 
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..bb35026
--- /dev/null
@@ -0,0 +1,214 @@
+//
+// SqlConnection.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Collections;
+using System.Data.Common;
+
+namespace System.Data.SqlClient
+{
+       public sealed class SqlConnection : DbConnection, IDbConnection, ICloneable
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlConnection is not supported on the current platform.";
+
+               public SqlConnection () : this (null)
+               {
+               }
+
+               public SqlConnection (string connectionString)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlConnection (string connectionString, SqlCredential cred)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override string ConnectionString {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SqlCredential Credentials {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Guid ClientConnectionId {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int ConnectionTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string Database {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string DataSource {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int PacketSize {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string ServerVersion {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override ConnectionState State {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string WorkstationId {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool FireInfoMessageEventOnUserErrors {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool StatisticsEnabled {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               protected override DbProviderFactory DbProviderFactory {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public event SqlInfoMessageEventHandler InfoMessage;
+
+               public new SqlTransaction BeginTransaction ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new SqlTransaction BeginTransaction (IsolationLevel iso)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlTransaction BeginTransaction (string transactionName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlTransaction BeginTransaction (IsolationLevel iso, string transactionName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void ChangeDatabase (string database)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public new SqlCommand CreateCommand ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+               }
+
+#if !MOBILE
+               public void EnlistDistributedTransaction (ITransaction transaction)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+#endif
+
+               object ICloneable.Clone ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override DbCommand CreateDbCommand ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Open ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override DataTable GetSchema ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override DataTable GetSchema (String collectionName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override DataTable GetSchema (String collectionName, string [] restrictionValues)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static void ChangePassword (string connectionString, string newPassword)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static void ClearAllPools ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static void ClearPool (SqlConnection connection)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void ResetStatistics ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public IDictionary RetrieveStatistics ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..395e97a
--- /dev/null
@@ -0,0 +1,363 @@
+//
+// SqlDataReader.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Collections;
+using System.Data.Common;
+using System.Data.SqlClient;
+using System.Data.SqlTypes;
+using System.Data;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System.Xml;
+
+
+namespace System.Data.SqlClient
+{
+       public class SqlDataReader : DbDataReader , IDataReader, IDisposable, IDataRecord
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlDataReader is not supported on the current platform.";
+
+               SqlDataReader () {}
+
+               protected bool IsCommandBehavior (CommandBehavior condition)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Close ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override bool GetBoolean (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override byte GetByte (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override long GetBytes (int i, long dataIndex, byte [] buffer, int bufferIndex, int length)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override char GetChar (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override long GetChars (int i, long dataIndex, char [] buffer, int bufferIndex, int length)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override string GetDataTypeName (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override DateTime GetDateTime (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual DateTimeOffset GetDateTimeOffset (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual TimeSpan GetTimeSpan (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlChars GetSqlChars (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Decimal GetDecimal (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Double GetDouble (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Type GetFieldType (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Single GetFloat (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Guid GetGuid (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override short GetInt16 (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int GetInt32 (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override long GetInt64 (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override string GetName (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int GetOrdinal (string name)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override DataTable GetSchemaTable ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlBinary GetSqlBinary (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlBoolean GetSqlBoolean (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlByte GetSqlByte (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlDateTime GetSqlDateTime (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlDecimal GetSqlDecimal (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlDouble GetSqlDouble (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlGuid GetSqlGuid (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlInt16 GetSqlInt16 (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlInt32 GetSqlInt32 (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlInt64 GetSqlInt64 (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlMoney GetSqlMoney (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlSingle GetSqlSingle (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlString GetSqlString (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlXml GetSqlXml (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual object GetSqlValue (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual int GetSqlValues (object [] values)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override string GetString (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override object GetValue (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int GetValues (object [] values)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override IEnumerator GetEnumerator ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override bool IsDBNull (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override bool NextResult ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override bool Read ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Type GetProviderSpecificFieldType (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override object GetProviderSpecificValue (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int GetProviderSpecificValues (object [] values)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual SqlBytes GetSqlBytes (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override T GetFieldValue<T> (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual XmlReader GetXmlReader (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Task<T> GetFieldValueAsync<T> (int i, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Stream GetStream (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override TextReader GetTextReader (int i)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override Task<bool> IsDBNullAsync (int i, CancellationToken cancellationToken)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int Depth {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int FieldCount {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsClosed {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override object this [int i] {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override object this [string name] {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int RecordsAffected {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool HasRows {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int VisibleFieldCount {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               protected SqlConnection Connection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+       }
+}
index 3962bf4f55c9fa193525a4f35a2e51b7d4a617d5..5cb920c0e9a0beaf226613ae01367810f81c3603 100644 (file)
@@ -65,8 +65,11 @@ namespace System.Data.SqlClient
                public bool HasChanges {
                        get { return true; }
                }
-               
+
+#pragma warning disable 0067
+               [MonoTODO]
                public event OnChangeEventHandler OnChange;
+#pragma warning restore
 
                [MonoTODO]
                public void AddCommandDependency(SqlCommand command)
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlException.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlException.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..24d102d
--- /dev/null
@@ -0,0 +1,102 @@
+//
+// SqlException.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Data.Common;
+using System.Data.SqlClient;
+using System.Runtime.Serialization;
+
+namespace System.Data.SqlClient
+{
+       public class SqlException : DbException 
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlException is not supported on the current platform.";
+
+               internal bool _doNotReconnect;
+
+               static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion, SqlInternalConnectionTds internalConnection, Exception innerException = null)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               static internal SqlException CreateException(SqlErrorCollection errorCollection, string serverVersion, Guid conId, Exception innerException = null)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               SqlException () {}
+
+               public override void GetObjectData (SerializationInfo si, StreamingContext context)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public byte Class {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public Guid ClientConnectionId {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SqlErrorCollection Errors {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int LineNumber {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string Message {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int Number {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Procedure {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string Server {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string Source {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public byte State {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+       }
+}
index f6153fb60b55074b71511c3baae109d00f466b7f..33531b7c1fff5de910f931d1aa6f872d8e67bd04 100644 (file)
@@ -361,13 +361,13 @@ namespace System.Data.SqlClient {
                }
 
                [DefaultValue (0)]
-               public byte Precision {
+               public new byte Precision {
                        get { return metaParameter.Precision; }
                        set { metaParameter.Precision = value; }
                }
 
                [DefaultValue (0)]
-               public byte Scale {
+               public new byte Scale {
                        get { return metaParameter.Scale; }
                        set { metaParameter.Scale = value; }
                }
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..79f6f95
--- /dev/null
@@ -0,0 +1,198 @@
+//
+// SqlParameter.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Data;
+using System.Data.Common;
+using System.Data.SqlTypes;
+
+namespace System.Data.SqlClient
+{
+       public class SqlParameter : DbParameter , IDbDataParameter, IDataParameter, ICloneable
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlParameter is not supported on the current platform.";
+
+               public SqlParameter ()
+                       : this (String.Empty, SqlDbType.NVarChar, 0, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, null)
+               {
+               }
+
+               public SqlParameter (string parameterName, object value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlParameter (string parameterName, SqlDbType dbType) 
+                       : this (parameterName, dbType, 0, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, null)
+               {
+               }
+
+               public SqlParameter (string parameterName, SqlDbType dbType, int size) 
+                       : this (parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, null)
+               {
+               }
+
+               public SqlParameter (string parameterName, SqlDbType dbType, int size, string sourceColumn) 
+                       : this (parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, sourceColumn, DataRowVersion.Current, null)
+               {
+               }
+
+               public SqlParameter (string parameterName, SqlDbType dbType, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value) 
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlParameter (string parameterName, SqlDbType dbType, int size, ParameterDirection direction, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, bool sourceColumnNullMapping, Object value, string xmlSchemaCollectionDatabase, string xmlSchemaCollectionOwningSchema, string xmlSchemaCollectionName)
+                       : this (parameterName, dbType, size, direction, false, precision, scale, sourceColumn, sourceVersion, value)
+               {
+               }
+
+               public override string ToString ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void ResetDbType ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void ResetSqlDbType ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override DbType DbType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override ParameterDirection Direction {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsNullable {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int Offset {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string ParameterName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public byte Precision {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public byte Scale {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int Size {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override string SourceColumn {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override DataRowVersion SourceVersion {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SqlDbType SqlDbType {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override object Value {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SqlCompareOptions CompareInfo {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int LocaleId {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public object SqlValue {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool SourceColumnNullMapping {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string XmlSchemaCollectionDatabase {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string XmlSchemaCollectionName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string XmlSchemaCollectionOwningSchema {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string UdtTypeName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string TypeName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               object ICloneable.Clone ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..cc3a6ab
--- /dev/null
@@ -0,0 +1,216 @@
+//
+// SqlParameterCollection.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Collections;
+using System.Data;
+using System.Data.Common;
+using System.Data.SqlClient;
+
+namespace System.Data.SqlClient
+{
+       public class SqlParameterCollection : DbParameterCollection , IDataParameterCollection, IList, ICollection, IEnumerable
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlParameterCollection is not supported on the current platform.";
+
+               SqlParameterCollection () {}
+
+               protected override DbParameter GetParameter (int index)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override DbParameter GetParameter (string parameterName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void SetParameter (int index, DbParameter value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void SetParameter (string parameterName, DbParameter value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int Add (object value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlParameter Add (SqlParameter value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlParameter Add (string parameterName, object value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlParameter AddWithValue (string parameterName, object value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlParameter Add (string parameterName, SqlDbType sqlDbType)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlParameter Add (string parameterName, SqlDbType sqlDbType, int size)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlParameter Add (string parameterName, SqlDbType sqlDbType, int size, string sourceColumn)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Clear ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override bool Contains (object value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override bool Contains (string value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public bool Contains (SqlParameter value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void CopyTo (Array array, int index)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override IEnumerator GetEnumerator ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int IndexOf (object value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int IndexOf (string parameterName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public int IndexOf (SqlParameter value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Insert (int index, object value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Insert (int index, SqlParameter value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Remove (object value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Remove (SqlParameter value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void RemoveAt (int index)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void RemoveAt (string parameterName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void AddRange (Array values)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void AddRange (SqlParameter [] values)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void CopyTo (SqlParameter [] array, int index)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int Count {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsFixedSize {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsReadOnly {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsSynchronized {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override object SyncRoot {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SqlParameter this [int index] {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public SqlParameter this [string parameterName] {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+       }
+}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.platformnotsupported.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..880b740
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// SqlTransaction.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Data;
+using System.Data.Common;
+using System.Data.SqlClient;
+
+namespace System.Data.SqlClient
+{
+       public class SqlTransaction : DbTransaction , IDbTransaction, IDisposable
+       {
+               const string EXCEPTION_MESSAGE = "System.Data.SqlClient.SqlTransaction is not supported on the current platform.";
+
+               SqlTransaction () {}
+
+               public override void Commit ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Rollback ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Rollback (string transactionName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Save (string savePointName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SqlConnection Connection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override IsolationLevel IsolationLevel {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               protected override DbConnection DbConnection {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+       }
+}
index 3749af5091222bf0b8dce37071dbb1a947749f3f..a8974949973e3fc8afcd95fc9b88c3a91b5f588e 100644 (file)
@@ -96,10 +96,14 @@ namespace MonoTests.System.Data.Common
                        try {
                                da.AddToBatch (new SqlCommand ());
                                Assert.Fail ("#1");
+#if FEATURE_NO_BSD_SOCKETS
+                       } catch (PlatformNotSupportedException) {
+#else
                        } catch (NotSupportedException ex) {
                                Assert.AreEqual (typeof (NotSupportedException), ex.GetType (), "#2");
                                Assert.IsNull (ex.InnerException, "#3");
                                Assert.IsNotNull (ex.Message, "#4");
+#endif
                        }
                }
 
index b65ba7abab6fdd5c63cd9118676cf9393fc4f524..4fbbbbefe4aa6eb41f5da888b4026a4a4da4b09f 100644 (file)
@@ -39,21 +39,33 @@ namespace MonoTests.System.Data.SqlClient {
                private const string testFailParamNameMessage = "We have to provide the same parameter name as in original .NET";
                
                [Test] // .ctor(SqlConnection connection)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ArgumentNullException))]
+#endif
                public void ConstructorNotNull1 ()
                {
                        new SqlBulkCopy ((SqlConnection)null);
                }
                
                [Test] // .ctor(string connectionString)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ArgumentNullException))]
+#endif
                public void ConstructorNotNull2 ()
                {
                        new SqlBulkCopy ((string)null);
                }
                
                [Test] // .ctor(SqlConnection connection)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ArgumentNullException))]
+#endif
                public void ConstructorNotNull3 ()
                {
                        try {
@@ -65,7 +77,11 @@ namespace MonoTests.System.Data.SqlClient {
                }
                
                [Test] // .ctor(string connectionString)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ArgumentNullException))]
+#endif
                public void ConstructorNotNull4 ()
                {
                        try {
@@ -77,7 +93,11 @@ namespace MonoTests.System.Data.SqlClient {
                }
                
                [Test] // .ctor(string connectionString)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ArgumentNullException))]
+#endif
                public void ConstructorNotNull5 ()
                {
                        try {
@@ -89,7 +109,11 @@ namespace MonoTests.System.Data.SqlClient {
                }
                
                [Test] // .ctor(string connectionString)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#else
                [ExpectedException (typeof(ArgumentNullException))]
+#endif
                public void ConstructorNotNull6 ()
                {
                        try {
index c2d788bd3f54d734c82e581e0f6905f6cadd77e5..49abd6064dcead039e99b1450d308127e8f71086 100644 (file)
@@ -38,6 +38,9 @@ namespace MonoTests.System.Data.Odbc
        public class SqlCommandBuilderTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CatalogLocationTest ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -47,6 +50,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CatalogLocation_Value_Invalid ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -82,6 +88,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CatalogSeparator ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -89,6 +98,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CatalogSeparator_Value_Invalid ()
                {
                        string [] separators = new string [] {
@@ -118,6 +130,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConflictOptionTest ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -127,6 +142,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ConflictOption_Value_Invalid ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -147,6 +165,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test] // QuoteIdentifier (String)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void QuoteIdentifier ()
                {
                        SqlCommandBuilder cb;
@@ -173,6 +194,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void QuoteIdentifier_PrefixSuffix_NoMatch ()
                {
                        SqlCommandBuilder cb;
@@ -211,6 +235,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test] // QuoteIdentifier (String)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void QuoteIdentifier_UnquotedIdentifier_Null ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -226,6 +253,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void QuotePrefix ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -240,6 +270,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void QuotePrefix_Value_Invalid ()
                {
                        string [] prefixes = new string [] {
@@ -268,6 +301,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void QuoteSuffix ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -282,6 +318,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void QuoteSuffix_Value_Invalid ()
                {
                        string [] suffixes = new string [] {
@@ -310,6 +349,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SchemaSeparator ()
                {
                        SqlCommandBuilder cb = new SqlCommandBuilder ();
@@ -319,6 +361,9 @@ namespace MonoTests.System.Data.Odbc
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SchemaSeparator_Value_Invalid ()
                {
                        string [] separators = new string [] {
index d02532a45d9d0804d73ed5255084fda83cfcb1b8..be36ba383c1bcf6fec1d5d15b7f04d057c365e7d 100644 (file)
@@ -42,6 +42,9 @@ namespace MonoTests.System.Data.SqlClient
                const string COMMAND_TEXT = "SELECT * FROM Authors";
 
                [Test] // SqlCommand ()
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor1 ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -61,6 +64,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlCommand (string)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor2 ()
                {
                        SqlCommand cmd = new SqlCommand (COMMAND_TEXT);
@@ -95,6 +101,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlCommand (string, SqlConnection)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor3 ()
                {
                        SqlConnection conn = new SqlConnection ();
@@ -147,6 +156,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlCommand (string, SqlConnection, SqlTransaction)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor4 ()
                {
                        SqlConnection conn = new SqlConnection ();
@@ -199,6 +211,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Clone ()
                {
                        SqlNotificationRequest notificationReq = new SqlNotificationRequest ();
@@ -237,6 +252,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CommandText ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -251,6 +269,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CommandTimeout ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -263,6 +284,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CommandTimeout_Value_Negative ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -279,6 +303,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CommandType_Value_Invalid ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -296,6 +323,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // bug #324386
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Dispose ()
                {
                        string connectionString = "Initial Catalog=a;Server=b;User ID=c;"
@@ -307,6 +337,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ExecuteNonQuery_Connection_Closed ()
                {
                        string connectionString = "Initial Catalog=a;Server=b;User ID=c;"
@@ -329,6 +362,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ExecuteNonQuery_Connection_Null ()
                {
                        SqlCommand cmd = new SqlCommand ("delete from whatever");
@@ -346,6 +382,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ExecuteReader_Connection_Closed ()
                {
                        string connectionString = "Initial Catalog=a;Server=b;User ID=c;"
@@ -368,6 +407,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ExecuteReader_Connection_Null ()
                {
                        SqlCommand cmd = new SqlCommand ("select * from whatever");
@@ -385,6 +427,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ExecuteScalar_Connection_Closed ()
                {
                        string connectionString = "Initial Catalog=a;Server=b;User ID=c;"
@@ -407,6 +452,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // bug #412584
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ExecuteScalar_Connection_Null ()
                {
                        SqlCommand cmd = new SqlCommand ("select count(*) from whatever");
@@ -425,6 +473,9 @@ namespace MonoTests.System.Data.SqlClient
 
                // FIXME: this actually doesn't match .NET behavior. It shouldn't throw NRE.
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Prepare_Connection_Null ()
                {
                        SqlCommand cmd;
@@ -477,6 +528,9 @@ namespace MonoTests.System.Data.SqlClient
                }
                
                [Test] // bug #412586
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Prepare_Connection_Closed ()
                {
                        string connectionString = "Initial Catalog=a;Server=b;User ID=c;"
@@ -527,6 +581,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ResetCommandTimeout ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -537,6 +594,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UpdatedRowSource ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -547,6 +607,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UpdatedRowSource_Value_Invalid ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -565,6 +628,9 @@ namespace MonoTests.System.Data.SqlClient
 
 
                [Test] // bug #381100
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ParameterCollectionTest ()
                {
                        SqlCommand cmd = new SqlCommand();
index 04a4b99871cc8f8af14614167cb6f3e35482eb5a..9511be24f7535375f8298d0c559a174d70452296 100644 (file)
@@ -39,6 +39,9 @@ namespace MonoTests.System.Data.SqlClient
        public class SqlConnectionTest\r
        {\r
                [Test] // SqlConnection ()\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Constructor1 ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -57,6 +60,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test] // SqlConnection (string)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Constructor2 ()\r
                {\r
                        string connectionString = "server=SQLSRV; database=Mono;";\r
@@ -89,6 +95,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Constructor2_ConnectionString_Invalid ()\r
                {\r
                        try {\r
@@ -181,6 +190,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginTransaction_Connection_Closed ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -247,6 +259,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ChangeDatabase_Connection_Closed ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -264,6 +279,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ChangePassword_ConnectionString_Empty ()\r
                {\r
                        try {\r
@@ -279,6 +297,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ChangePassword_ConnectionString_Null ()\r
                {\r
                        try {\r
@@ -293,7 +314,10 @@ namespace MonoTests.System.Data.SqlClient
                        }\r
                }\r
 \r
-               [Test]\r
+               \r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ChangePassword_NewPassword_Empty ()\r
                {\r
                        try {\r
@@ -309,6 +333,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ChangePassword_NewPassword_ExceedMaxLength ()\r
                {\r
                        try {\r
@@ -328,6 +355,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ChangePassword_NewPassword_Null ()\r
                {\r
                        try {\r
@@ -343,6 +373,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ClearPool_Connection_Null ()\r
                {\r
                        try {\r
@@ -357,6 +390,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -371,6 +407,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_Value_Invalid ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -403,6 +442,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void CreateCommand ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -424,6 +466,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Dispose ()\r
                {\r
                        SqlConnection cn = new SqlConnection ("Server=SQLSRV;Database=master;Timeout=25;Packet Size=512;Workstation ID=DUMMY");\r
@@ -443,6 +488,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void GetSchema_Connection_Closed ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -519,6 +567,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_AsynchronousProcessing ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -527,6 +578,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_ConnectTimeout ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -543,6 +597,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_ConnectTimeout_Invalid ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -600,6 +657,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_Database_Synonyms ()\r
                {\r
                        SqlConnection cn = null;\r
@@ -614,6 +674,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_DataSource_Synonyms ()\r
                {\r
                        SqlConnection cn = null;\r
@@ -640,6 +703,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_MaxPoolSize ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -649,6 +715,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_MaxPoolSize_Invalid ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -733,6 +802,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_MinPoolSize ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -742,6 +814,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_MinPoolSize_Invalid ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -799,6 +874,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_MultipleActiveResultSets ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -806,6 +884,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_MultipleActiveResultSets_Invalid ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -823,6 +904,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_NetworkLibrary_Synonyms ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -832,6 +916,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_PacketSize ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -848,6 +935,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_PacketSize_Invalid ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -901,6 +991,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_Password_Synonyms ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -909,6 +1002,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_PersistSecurityInfo_Synonyms ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -917,6 +1013,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_UserID_Synonyms ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -926,6 +1025,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_UserInstance ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -933,6 +1035,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_UserInstance_Invalid ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -950,6 +1055,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ConnectionString_OtherKeywords ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -973,6 +1081,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Open_ConnectionString_Empty ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -991,6 +1102,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Open_ConnectionString_Null ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -1009,6 +1123,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Open_ConnectionString_Whitespace ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -1027,6 +1144,9 @@ namespace MonoTests.System.Data.SqlClient
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void ServerVersion_Connection_Closed ()\r
                {\r
                        SqlConnection cn = new SqlConnection ();\r
@@ -1051,3 +1171,4 @@ namespace MonoTests.System.Data.SqlClient
                }\r
        }\r
 }\r
+\r
index 301f62bf7f22efba750f3a3ac4cc9d7c46183bd3..3a8b619baa1bb64e0c1525c50bf271ee41f3b6c0 100644 (file)
@@ -63,6 +63,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlDataAdapter (SqlCommand)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor2 ()
                {
                        SqlCommand cmd = new SqlCommand ();
@@ -109,6 +112,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlDataAdapter (string, SqlConnection)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor3 ()
                {
                        string selectCommandText = "SELECT * FROM Authors";
@@ -137,6 +143,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlDataAdapter (string, SqlConnection)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor3_SelectCommandText_Null ()
                {
                        SqlConnection selectConnection = new SqlConnection ();
@@ -165,6 +174,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlDataAdapter (string, SqlConnection)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor3_SelectConnection_Null ()
                {
                        string selectCommandText = "SELECT * FROM Authors";
@@ -192,6 +204,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlDataAdapter (string, string)]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor4 ()
                {
                        string selectCommandText = "SELECT * FROM Authors";
@@ -221,6 +236,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlDataAdapter (string, string)]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor4_SelectCommandText_Null ()
                {
                        string selectConnectionString = "server=SQLSRV;database=Mono";
@@ -250,6 +268,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // SqlDataAdapter (string, string)]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor4_SelectConnectionString_Null ()
                {
                        string selectCommandText = "SELECT * FROM Authors";
@@ -278,6 +299,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DeleteCommand ()
                {
                        SqlDataAdapter da = new SqlDataAdapter ();
@@ -293,6 +317,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Dispose ()
                {
                        SqlDataAdapter da = new SqlDataAdapter ();
@@ -311,6 +338,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InsertCommand ()
                {
                        SqlDataAdapter da = new SqlDataAdapter ();
@@ -326,6 +356,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SelectCommand ()
                {
                        SqlDataAdapter da = new SqlDataAdapter ();
@@ -369,6 +402,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void UpdateCommand ()
                {
                        SqlDataAdapter da = new SqlDataAdapter ();
index 27e6fd1bf4ad9b4a5a884af737c5581aba5d4a71..e2048cfb9baf86b0b814c3a06f73248d0559cb1a 100644 (file)
@@ -45,6 +45,9 @@ namespace MonoTests.System.Data.SqlClient
        public class SqlParameterTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor1 ()
                {
                        SqlParameter p = new SqlParameter ();
@@ -68,6 +71,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor2_Value_DateTime ()
                {
                        DateTime value = new DateTime (2004, 8, 24);
@@ -94,6 +100,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor2_Value_DBNull ()
                {
                        SqlParameter p = new SqlParameter ("address", DBNull.Value);
@@ -118,6 +127,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor2_Value_Null ()
                {
                        SqlParameter p = new SqlParameter ("address", (Object) null);
@@ -141,6 +153,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // .ctor (String, SqlDbType, Int32, ParameterDirection, Byte, Byte, String, DataRowVersion, Boolean, Object, String, String, String)
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Constructor7 ()
                {
                        SqlParameter p1 = new SqlParameter ("p1Name", SqlDbType.VarChar, 20,
@@ -167,6 +182,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CompareInfo ()
                {
                        SqlParameter parameter = new SqlParameter ();
@@ -176,6 +194,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Byte ()
                {
                        Byte value = 0x0a;
@@ -187,6 +208,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_ByteArray ()
                {
                        Byte [] value = new Byte [] { 0x0a, 0x0d };
@@ -289,6 +313,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_DateTime ()
                {
                        DateTime value;
@@ -314,6 +341,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Decimal ()
                {
                        Decimal value;
@@ -339,6 +369,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Double ()
                {
                        Double value;
@@ -364,6 +397,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Enum ()
                {
                        SqlParameter param;
@@ -380,6 +416,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Guid ()
                {
                        Guid value = Guid.NewGuid ();
@@ -391,6 +430,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Int16 ()
                {
                        Int16 value;
@@ -416,6 +458,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Int32 ()
                {
                        Int32 value;
@@ -441,6 +486,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Int64 ()
                {
                        Int64 value;
@@ -506,6 +554,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Object ()
                {
                        Object value = new Object ();
@@ -517,6 +568,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Single ()
                {
                        Single value = Single.MaxValue;
@@ -528,6 +582,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_String ()
                {
                        String value = "some text";
@@ -551,6 +608,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void LocaleId ()
                {
                        SqlParameter parameter = new SqlParameter ();
@@ -560,6 +620,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test] // bug #320196
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ParameterNullTest ()
                {
                        SqlParameter param = new SqlParameter ("param", SqlDbType.Decimal);
@@ -574,6 +637,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ParameterType ()
                {
                        SqlParameter p;
@@ -632,6 +698,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void InferType_Boolean ()
                {
                        Boolean value;
@@ -651,6 +720,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ParameterName ()
                {
                        SqlParameter p = new SqlParameter ();
@@ -676,6 +748,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ResetDbType ()
                {
                        SqlParameter p;
@@ -739,6 +814,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ResetSqlDbType ()
                {
                        //Parameter with an assigned value but no SqlDbType specified
@@ -779,6 +857,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SourceColumn ()
                {
                        SqlParameter p = new SqlParameter ();
@@ -804,6 +885,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SourceColumnNullMapping ()
                {
                        SqlParameter p = new SqlParameter ();
@@ -815,6 +899,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlDbTypeTest ()
                {
                        SqlParameter p = new SqlParameter ("zipcode", 3510);
@@ -829,6 +916,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlDbTypeTest_Value_Invalid ()
                {
                        SqlParameter p = new SqlParameter ("zipcode", 3510);
@@ -847,6 +937,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlValue ()
                {
                        SqlParameter parameter = new SqlParameter ();
@@ -970,6 +1063,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlBinary ()
                {
                        SqlParameter parameter;
@@ -995,6 +1091,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlBoolean ()
                {
                        SqlParameter parameter;
@@ -1020,6 +1119,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlByte ()
                {
                        SqlParameter parameter;
@@ -1107,6 +1209,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlDateTime ()
                {
                        SqlParameter parameter;
@@ -1132,6 +1237,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlDecimal ()
                {
                        SqlParameter parameter;
@@ -1157,6 +1265,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlDouble ()
                {
                        SqlParameter parameter;
@@ -1182,6 +1293,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlGuid ()
                {
                        SqlParameter parameter;
@@ -1207,6 +1321,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlInt16 ()
                {
                        SqlParameter parameter;
@@ -1232,6 +1349,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlInt32 ()
                {
                        SqlParameter parameter;
@@ -1257,6 +1377,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlInt64 ()
                {
                        SqlParameter parameter;
@@ -1282,6 +1405,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlMoney ()
                {
                        SqlParameter parameter;
@@ -1307,6 +1433,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlSingle ()
                {
                        SqlParameter parameter;
@@ -1332,6 +1461,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlString ()
                {
                        SqlParameter parameter;
@@ -1357,6 +1489,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SqlTypes_SqlXml ()
                {
                        SqlParameter parameter;
@@ -1386,6 +1521,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Value ()
                {
                        SqlParameter p;
@@ -1429,6 +1567,9 @@ namespace MonoTests.System.Data.SqlClient
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void XmlSchemaTest ()
                {
                        SqlParameter p1 = new SqlParameter ();
index 2fbdeb16c8ad740a5f0c178bec74bbcd05adc3e7..1357f253347fb5c49ff34958f600f70b6b374b9a 100644 (file)
@@ -34,9 +34,6 @@
 using NUnit.Framework;
 using System;
 using System.Data;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Data
 {
index 2875dc0a1090f8bfa9dafb2ce0a061c0dcce8c15..37a12abcffdbe9947dd367e41a5d3e6b6483cde1 100644 (file)
@@ -34,9 +34,6 @@
 using NUnit.Framework;
 using System;
 using System.Data;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Data
 {
index 7da3dca21f0b2db64186b45234732d8366561c5c..9ba7870e7e083ed90baebe989724d1a7c96515d0 100644 (file)
@@ -30,9 +30,6 @@
 using NUnit.Framework;
 using System;
 using System.Data;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Data
 {
index 63d75f2c410a66a8f479cc1d57059168a7be79a3..f020a208e6f65e4e0c0eb416cf1aa587e7e4de4f 100644 (file)
@@ -34,9 +34,6 @@
 using NUnit.Framework;\r
 using System;\r
 using System.Data;\r
-#if !MOBILE\r
-using NUnit.Framework.SyntaxHelpers;\r
-#endif\r
 \r
 namespace MonoTests.System.Data\r
 {\r
index 945b22a484c133f221f36a64228b248096e57777..2e2890b4ec5b303c526d81cb0062289831fd1a55 100644 (file)
@@ -40,7 +40,7 @@ using Microsoft.CSharp;
 namespace MonoTests.System.Data
 {
        [TestFixture]
-       public class TypedDataSetGeneratorTest : Assertion
+       public class TypedDataSetGeneratorTest
        {
                private ICodeGenerator gen;
                private ICodeCompiler compiler;
@@ -70,20 +70,20 @@ namespace MonoTests.System.Data
                public void TestGenerateIdName ()
                {
                
-                       AssertEquals ("#1", "a", TypedDataSetGenerator.GenerateIdName ("a", gen));
-                       AssertEquals ("#2", "_int", TypedDataSetGenerator.GenerateIdName ("int", gen));
-                       AssertEquals ("#3", "_", TypedDataSetGenerator.GenerateIdName ("_", gen));
-                       AssertEquals ("#3-2", "_", TypedDataSetGenerator.GenerateIdName ("_", gen));
-                       AssertEquals ("#4", "_1", TypedDataSetGenerator.GenerateIdName ("1", gen));
-                       AssertEquals ("#4-2", "_1", TypedDataSetGenerator.GenerateIdName ("1", gen));
-                       AssertEquals ("#5", "_1a", TypedDataSetGenerator.GenerateIdName ("1a", gen));
-                       AssertEquals ("#6", "_1_2", TypedDataSetGenerator.GenerateIdName ("1*2", gen));
-                       AssertEquals ("#7", "__", TypedDataSetGenerator.GenerateIdName ("-", gen));
-                       AssertEquals ("#8", "__", TypedDataSetGenerator.GenerateIdName ("+", gen));
-                       AssertEquals ("#9", "_", TypedDataSetGenerator.GenerateIdName ("", gen));
-                       AssertEquals ("#10", "___", TypedDataSetGenerator.GenerateIdName ("--", gen));
-                       AssertEquals ("#11", "___", TypedDataSetGenerator.GenerateIdName ("++", gen));
-                       AssertEquals ("#12", "\u3042", TypedDataSetGenerator.GenerateIdName ("\u3042", gen));
+                       Assert.AreEqual ("a", TypedDataSetGenerator.GenerateIdName ("a", gen), "#1");
+                       Assert.AreEqual ("_int", TypedDataSetGenerator.GenerateIdName ("int", gen), "#2");
+                       Assert.AreEqual ("_", TypedDataSetGenerator.GenerateIdName ("_", gen), "#3");
+                       Assert.AreEqual ("_", TypedDataSetGenerator.GenerateIdName ("_", gen), "#3-2");
+                       Assert.AreEqual ("_1", TypedDataSetGenerator.GenerateIdName ("1", gen), "#4");
+                       Assert.AreEqual ("_1", TypedDataSetGenerator.GenerateIdName ("1", gen), "#4-2");
+                       Assert.AreEqual ("_1a", TypedDataSetGenerator.GenerateIdName ("1a", gen), "#5");
+                       Assert.AreEqual ("_1_2", TypedDataSetGenerator.GenerateIdName ("1*2", gen), "#6");
+                       Assert.AreEqual ("__", TypedDataSetGenerator.GenerateIdName ("-", gen), "#7");
+                       Assert.AreEqual ("__", TypedDataSetGenerator.GenerateIdName ("+", gen), "#8");
+                       Assert.AreEqual ("_", TypedDataSetGenerator.GenerateIdName ("", gen), "#9");
+                       Assert.AreEqual ("___", TypedDataSetGenerator.GenerateIdName ("--", gen), "#10");
+                       Assert.AreEqual ("___", TypedDataSetGenerator.GenerateIdName ("++", gen), "#11");
+                       Assert.AreEqual ("\u3042", TypedDataSetGenerator.GenerateIdName ("\u3042", gen), "#12");
                }
 
                [Test]
@@ -98,7 +98,7 @@ namespace MonoTests.System.Data
                        ccu.Namespaces.Add (cns);
                        CompilerResults r = compiler.CompileAssemblyFromDom (
                                new CompilerParameters (), ccu);
-                       AssertEquals (0, r.Errors.Count);
+                       Assert.AreEqual (0, r.Errors.Count);
                }
        }
 }
index 2be7b264d09d432d6411966d0ded3330209fe21c..b1f4d2d1b7c6815e0cc5d0ffb3f2c2da69361597 100644 (file)
@@ -33,9 +33,6 @@
 using NUnit.Framework;
 using System;
 using System.Data;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Data
 {
diff --git a/mcs/class/System.Data/Test/test-config-file b/mcs/class/System.Data/Test/test-config-file
new file mode 100644 (file)
index 0000000..8135637
--- /dev/null
@@ -0,0 +1,45 @@
+       <configSections>
+               <section name="system.data_test" 
+                       type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
+               <section name="connectionStrings_test"
+                       type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
+       </configSections>
+       <system.data>
+               <DbProviderFactories>
+                       <add name="ProviderTest2.Name"
+                               invariant="ProviderTest2.InvariantName"
+                               support="FF"
+                               description="ProviderTest2.Description"
+                               type="ProviderTest2.AssemblyQualifiedName"/>
+               </DbProviderFactories>
+       </system.data>
+       <system.data_test>
+               <DbProviderFactories>
+                       <add name="ProviderTest3.Name"
+                               invariant="ProviderTest3.InvariantName"
+                               support="FF"
+                               description="ProviderTest3.Description"
+                               type="ProviderTest3.AssemblyQualifiedName"/>
+                       <clear />
+                       <add name="ProviderTest4.Name"
+                               invariant="ProviderTest4.InvariantName"
+                               support="FF"
+                               description="ProviderTest4.Description"
+                               type="ProviderTest4.AssemblyQualifiedName"/>
+                       <add name="ProviderTest5.Name"
+                               invariant="ProviderTest5.InvariantName"
+                               support="FF"
+                               description="ProviderTest5.Description"
+                               type="ProviderTest5.AssemblyQualifiedName"/>
+                       <remove invariant="ProviderTest5.InvariantName" />
+                       <add name="ProviderTest.Name"
+                               invariant="ProviderTest.InvariantName"
+                               support="FF"
+                               description="ProviderTest.Description"
+                               type="ProviderTest.AssemblyQualifiedName"/>
+               </DbProviderFactories>
+       </system.data_test>
+       <connectionStrings_test>
+               <add name="Publications" providerName="System.Data.SqlClient" 
+                       connectionString="Data Source=MyServer;Initial Catalog=pubs;integrated security=SSPI" />
+       </connectionStrings_test>
diff --git a/mcs/class/System.Data/app_test_mobile_static.config b/mcs/class/System.Data/app_test_mobile_static.config
deleted file mode 100644 (file)
index 4f31597..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-       <configSections>
-               <section name="system.data_test" 
-                       type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
-               <section name="connectionStrings_test"
-                       type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
-       </configSections>
-       <system.data>
-               <DbProviderFactories>
-                       <add name="ProviderTest2.Name"
-                               invariant="ProviderTest2.InvariantName"
-                               support="FF"
-                               description="ProviderTest2.Description"
-                               type="ProviderTest2.AssemblyQualifiedName"/>
-               </DbProviderFactories>
-       </system.data>
-       <system.data_test>
-               <DbProviderFactories>
-                       <add name="ProviderTest3.Name"
-                               invariant="ProviderTest3.InvariantName"
-                               support="FF"
-                               description="ProviderTest3.Description"
-                               type="ProviderTest3.AssemblyQualifiedName"/>
-                       <clear />
-                       <add name="ProviderTest4.Name"
-                               invariant="ProviderTest4.InvariantName"
-                               support="FF"
-                               description="ProviderTest4.Description"
-                               type="ProviderTest4.AssemblyQualifiedName"/>
-                       <add name="ProviderTest5.Name"
-                               invariant="ProviderTest5.InvariantName"
-                               support="FF"
-                               description="ProviderTest5.Description"
-                               type="ProviderTest5.AssemblyQualifiedName"/>
-                       <remove invariant="ProviderTest5.InvariantName" />
-                       <add name="ProviderTest.Name"
-                               invariant="ProviderTest.InvariantName"
-                               support="FF"
-                               description="ProviderTest.Description"
-                               type="ProviderTest.AssemblyQualifiedName"/>
-               </DbProviderFactories>
-       </system.data_test>
-       <connectionStrings_test>
-               <add name="Publications" providerName="System.Data.SqlClient" 
-                       connectionString="Data Source=MyServer;Initial Catalog=pubs;integrated security=SSPI" />
-       </connectionStrings_test>
-</configuration>
diff --git a/mcs/class/System.Data/app_test_net_4_x.config b/mcs/class/System.Data/app_test_net_4_x.config
deleted file mode 100644 (file)
index 4f31597..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-       <configSections>
-               <section name="system.data_test" 
-                       type="System.Data.Common.DbProviderFactoriesConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
-               <section name="connectionStrings_test"
-                       type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
-       </configSections>
-       <system.data>
-               <DbProviderFactories>
-                       <add name="ProviderTest2.Name"
-                               invariant="ProviderTest2.InvariantName"
-                               support="FF"
-                               description="ProviderTest2.Description"
-                               type="ProviderTest2.AssemblyQualifiedName"/>
-               </DbProviderFactories>
-       </system.data>
-       <system.data_test>
-               <DbProviderFactories>
-                       <add name="ProviderTest3.Name"
-                               invariant="ProviderTest3.InvariantName"
-                               support="FF"
-                               description="ProviderTest3.Description"
-                               type="ProviderTest3.AssemblyQualifiedName"/>
-                       <clear />
-                       <add name="ProviderTest4.Name"
-                               invariant="ProviderTest4.InvariantName"
-                               support="FF"
-                               description="ProviderTest4.Description"
-                               type="ProviderTest4.AssemblyQualifiedName"/>
-                       <add name="ProviderTest5.Name"
-                               invariant="ProviderTest5.InvariantName"
-                               support="FF"
-                               description="ProviderTest5.Description"
-                               type="ProviderTest5.AssemblyQualifiedName"/>
-                       <remove invariant="ProviderTest5.InvariantName" />
-                       <add name="ProviderTest.Name"
-                               invariant="ProviderTest.InvariantName"
-                               support="FF"
-                               description="ProviderTest.Description"
-                               type="ProviderTest.AssemblyQualifiedName"/>
-               </DbProviderFactories>
-       </system.data_test>
-       <connectionStrings_test>
-               <add name="Publications" providerName="System.Data.SqlClient" 
-                       connectionString="Data Source=MyServer;Initial Catalog=pubs;integrated security=SSPI" />
-       </connectionStrings_test>
-</configuration>
diff --git a/mcs/class/System.Data/monotouch_watch_System.Data.dll.exclude.sources b/mcs/class/System.Data/monotouch_watch_System.Data.dll.exclude.sources
new file mode 100644 (file)
index 0000000..2782624
--- /dev/null
@@ -0,0 +1,11 @@
+System.Data.SqlClient/SqlBulkCopy.cs
+System.Data.SqlClient/SqlCommand.cs
+System.Data.SqlClient/SqlCommandBuilder.cs
+System.Data.SqlClient/SqlConnection.cs
+System.Data.SqlClient/SqlDataReader.cs
+System.Data.SqlClient/SqlDecimalExtensions.cs
+System.Data.SqlClient/SqlException.cs
+System.Data.SqlClient/SqlParameter.cs
+System.Data.SqlClient/SqlParameterCollection.cs
+System.Data.SqlClient/SqlTransaction.cs
+System.Data.SqlClient/SqlXmlTextReader.cs
index bbc860b8cd783f47398a9a084950cde37d3e6221..f279aec80605393212efc69e5caf5703d0a8480c 100644 (file)
@@ -1 +1,10 @@
 #include mobile_System.Data.dll.sources
+System.Data.SqlClient/SqlBulkCopy.platformnotsupported.cs
+System.Data.SqlClient/SqlCommand.platformnotsupported.cs
+System.Data.SqlClient/SqlCommandBuilder.platformnotsupported.cs
+System.Data.SqlClient/SqlConnection.platformnotsupported.cs
+System.Data.SqlClient/SqlDataReader.platformnotsupported.cs
+System.Data.SqlClient/SqlException.platformnotsupported.cs
+System.Data.SqlClient/SqlParameter.platformnotsupported.cs
+System.Data.SqlClient/SqlParameterCollection.platformnotsupported.cs
+System.Data.SqlClient/SqlTransaction.platformnotsupported.cs
index bd40ae2f3a7c56941ed90529dd97837e421f365b..ca3f827e707e55166ec49106e6854a3f8d40b4e2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 4750c28d29fd9972de0daaeb2c9f2953b2a77d46..898766badccef0d14240cd77b6e32d3b4eff420f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 1248aef2a74f2e9efc3b889b2ace8dc482c994fe..eec7610ece0300d5774cc5a050e6c6a60198a5a6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f00cf92ef4e5efd6ec28760c9ff4d9341a24662d..6174a09878fa726cb00747d9ce8f2b5a10544f92 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 31cfc603485e3bc1bda074c53dc138df526d7e12..8ee4b099b920014dd786ec0c07c03478fc743fbb 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index cd5243850061ff0556e89678951c9837a4f8029a..a89191b814f2da54b812a595515c4175cb5b8bbb 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 00f54219c78c3923f771a72924af6a13a7a73d15..f46f7c3a73ef629983676940537673a87286abd6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_TYPECONVERTER</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_TYPECONVERTER</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 83e8ca47378f06ef7acdd6c3eb3dfa366abf4e94..4b7cf62280f8cf5ee961798a8d2ddc8f541ff3a8 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 ../../../build/common/Locale.cs
 ../System.Drawing/gdipEnums.cs    
 ../System.Drawing/gdipFunctions.cs
index 9848565605712e7fde336a7da9279d79c3dca56e..061d5e3ed70610688872b141a512f2e2fdeb3944 100644 (file)
@@ -38,9 +38,6 @@ using System.Drawing.Text;
 using System.Drawing.Imaging;\r
 using DrawingTestHelper;\r
 using System.IO;\r
-#if !MONOTOUCH\r
-using  NUnit.Framework.SyntaxHelpers;\r
-#endif\r
 \r
 namespace Test.Sys.Drawing.GraphicsFixtures {\r
        #region GraphicsFixtureProps\r
index 788104cabe5d626d6e7c3fdc72a29bf1ca6d531a..263ed4b1afb20bba0a13dad1da4d54d2b99c30b4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,414,169</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CODEPLEX_40</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CODEPLEX_40</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,414,169</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CODEPLEX_40</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CODEPLEX_40</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d0a7c52ddb6c39b21351b577a2544d7981f80b20..0bc9d350f98f38430added9f081f5a1543afff51 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,168,162</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,168,162</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 63bf1dbfbf12cd0ba5c75e5ad8f71ead09a12a7c..44bcdd9a644b601bb0c17327ef0a2ac5de5399de 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 48529c618dd8e62177cf11e211a4375d7d39ca09..2b43b04be5e04277894087e3f4f56b7f787aaada 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e834a58af15ca7366fb3e520c06c9523fa2a7495..7142a657ba0e4474d444018ce9aefa8a8430fb65 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_0</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_0</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 4c70c66dfd6b98fd9243afc32aa69c0305e8c2ee..0b98df20420097218f37b5da5b635066723fe1f5 100644 (file)
@@ -63,4 +63,5 @@ using System.Runtime.InteropServices;
 
 #if !MOBILE
 [assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
-#endif
\ No newline at end of file
+[assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=00000000000000000400000000000000")]
+#endif
index 7eea754cfa905116418953dd58a636f7fbea109f..29bb7acd6ee63617f77795f248bccf18f87da3ff 100644 (file)
@@ -2,8 +2,12 @@ thisdir = class/System.IdentityModel
 SUBDIRS = 
 include ../../build/rules.make
 
+ifndef NO_MONO_SECURITY
+MONO_SECURITY=Mono.Security
+endif
+
 LIBRARY = System.IdentityModel.dll
-LIB_REFS = System System.Xml System.Security Mono.Security System.Runtime.Serialization
+LIB_REFS = System System.Xml System.Security $(MONO_SECURITY) System.Runtime.Serialization
 LIB_MCS_FLAGS = \
                /d:NET_3_0      \
                $(OTHER_LIB_MCS_FLAGS)
index ea349ebcc43a57fd85ffff74bf19184035f5fb7f..e77c915f1ff9f818b67d0eefba0fff895fcf0d63 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_0</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_0</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="System.IdentityModel\OpenObject.cs" />\r
     <Compile Include="System.IdentityModel\SignatureVerificationFailedException.cs" />\r
     <Compile Include="System.Security.Claims\AuthenticationTypes.cs" />\r
+    <Compile Include="System.ServiceModel.Security.Tokens\BinarySecretSecurityToken.cs" />\r
+    <Compile Include="System.ServiceModel.Security.Tokens\InternalEncryptedKeyIdentifierClause.cs" />\r
+    <Compile Include="System.ServiceModel.Security.Tokens\WrappedKeySecurityToken.cs" />\r
+    <Compile Include="System.ServiceModel.Security\BinarySecretKeyIdentifierClause.cs" />\r
+    <Compile Include="System.ServiceModel.Security\KeyNameIdentifierClause.cs" />\r
+    <Compile Include="System.ServiceModel.Security\SecurityContextKeyIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security\X509CertificateValidationMode.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
       <Project>{3ED36717-A9D1-4289-8949-9B7F39766DEB}</Project>\r
       <Name>System.Security-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../System.Configuration/System.Configuration-net_4_x.csproj">\r
-      <Project>{D5CDC09C-F19A-4811-A6C8-70F51CBFB644}</Project>\r
-      <Name>System.Configuration-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
       <Project>{D845AD9D-3CCB-49CB-9543-028678E94938}</Project>\r
       <Name>System.Runtime.Serialization-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../System.Configuration/System.Configuration-net_4_x.csproj">\r
+      <Project>{D5CDC09C-F19A-4811-A6C8-70F51CBFB644}</Project>\r
+      <Name>System.Configuration-net_4_x</Name>\r
+    </ProjectReference>\r
     <ProjectReference Include="../System.Web/System.Web-net_4_x.csproj">\r
       <Project>{9DB806CB-B828-49B7-BAE2-2E52402CB4DC}</Project>\r
       <Name>System.Web-net_4_x</Name>\r
diff --git a/mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/BinarySecretSecurityToken.cs b/mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/BinarySecretSecurityToken.cs
new file mode 100644 (file)
index 0000000..464c936
--- /dev/null
@@ -0,0 +1,119 @@
+//
+// BinarySecretSecurityToken.cs
+//
+// Author:
+//     Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2006 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;
+using System.Collections.ObjectModel;
+using System.Xml;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+
+namespace System.ServiceModel.Security.Tokens
+{
+       public class BinarySecretSecurityToken : SecurityToken
+       {
+               ReadOnlyCollection<SecurityKey> keys;
+
+               string id;
+               byte [] key;
+               bool allow_crypto;
+               DateTime valid_from = DateTime.Now.ToUniversalTime ();
+
+               BinarySecretSecurityToken (string id, bool allowCrypto)
+               {
+                       this.id = id;
+                       allow_crypto = allowCrypto;
+               }
+
+               public BinarySecretSecurityToken (byte [] key)
+                       : this ("uuid:" + Guid.NewGuid ().ToString (), key)
+               {
+               }
+
+               public BinarySecretSecurityToken (string id, byte [] key)
+                       : this (id, key, false)
+               {
+               }
+
+               protected BinarySecretSecurityToken (string id, byte [] key, bool allowCrypto)
+                       : this (id, allowCrypto)
+               {
+                       if (key == null)
+                               throw new ArgumentNullException ("key");
+                       this.key = key;
+
+                       SecurityKey [] arr = new SecurityKey [] {new InMemorySymmetricSecurityKey (key)};
+                       keys = new ReadOnlyCollection<SecurityKey> (arr);
+               }
+
+               public BinarySecretSecurityToken (int keySizeInBits)
+                       : this ("uuid:" + Guid.NewGuid ().ToString (), keySizeInBits)
+               {
+               }
+
+               public BinarySecretSecurityToken (string id, int keySizeInBits)
+                       : this (id, keySizeInBits, false)
+               {
+               }
+
+               protected BinarySecretSecurityToken (string id, int keySizeInBits, bool allowCrypto)
+                       : this (id, allowCrypto)
+               {
+                       if (keySizeInBits < 0)
+                               throw new ArgumentOutOfRangeException ("keySizeInBits");
+
+                       this.key = new byte [keySizeInBits >> 3 + (keySizeInBits % 8 == 0 ? 0 : 1)];
+
+                       SecurityKey [] arr = new SecurityKey [] {new InMemorySymmetricSecurityKey (key)};
+                       keys = new ReadOnlyCollection<SecurityKey> (arr);
+               }
+
+               public override DateTime ValidFrom {
+                       get { return valid_from; }
+               }
+
+               public override DateTime ValidTo {
+                       get { return DateTime.MaxValue.AddDays (-1); }
+               }
+
+               public override string Id {
+                       get { return id; }
+               }
+
+               public int KeySize {
+                       get { return key.Length; }
+               }
+
+               public override ReadOnlyCollection<SecurityKey> SecurityKeys {
+                       get { return keys; }
+               }
+
+               public byte [] GetKeyBytes ()
+               {
+                       return (byte []) key.Clone ();
+               }
+       }
+}
diff --git a/mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/InternalEncryptedKeyIdentifierClause.cs b/mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/InternalEncryptedKeyIdentifierClause.cs
new file mode 100644 (file)
index 0000000..95e4334
--- /dev/null
@@ -0,0 +1,51 @@
+//
+// InternalEncryptedKeyIdentifierClause.cs
+//
+// Author:
+//     Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2007 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;
+using System.Collections.ObjectModel;
+using System.Security.Cryptography.Xml;
+using System.Xml;
+using System.IdentityModel.Tokens;
+
+namespace System.ServiceModel.Security.Tokens
+{
+       internal class InternalEncryptedKeyIdentifierClause : BinaryKeyIdentifierClause
+       {
+               public InternalEncryptedKeyIdentifierClause (byte [] hash)
+                       : base (null, hash, false)
+               {
+               }
+
+               public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
+               {
+                       InternalEncryptedKeyIdentifierClause kic = keyIdentifierClause as InternalEncryptedKeyIdentifierClause;
+                       if (kic == null)
+                               return false;
+                       return Matches (kic.GetRawBuffer ());
+               }
+       }
+}
diff --git a/mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/WrappedKeySecurityToken.cs b/mcs/class/System.IdentityModel/System.ServiceModel.Security.Tokens/WrappedKeySecurityToken.cs
new file mode 100644 (file)
index 0000000..d3c47f2
--- /dev/null
@@ -0,0 +1,176 @@
+//
+// WrappedKeySecurityToken.cs
+//
+// Author:
+//     Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2006 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;
+using System.Collections.ObjectModel;
+using System.Security.Cryptography;
+using System.Security.Cryptography.Xml;
+using System.Xml;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+
+namespace System.ServiceModel.Security.Tokens
+{
+       public class WrappedKeySecurityToken : SecurityToken
+       {
+               string id;
+               byte [] raw_key;
+               byte [] wrapped_key;
+               string wrap_alg;
+               SecurityToken wrap_token;
+               SecurityKeyIdentifier wrap_token_ref;
+               DateTime valid_from = DateTime.Now.ToUniversalTime ();
+               ReadOnlyCollection<SecurityKey> keys;
+               ReferenceList reference_list;
+               byte [] keyhash;
+
+               public WrappedKeySecurityToken (
+                       string id,
+                       byte [] keyToWrap,
+                       string wrappingAlgorithm,
+                       SecurityToken wrappingToken,
+                       SecurityKeyIdentifier wrappingTokenReference)
+               {
+                       if (id == null)
+                               throw new ArgumentNullException ("id");
+                       if (keyToWrap == null)
+                               throw new ArgumentNullException ("keyToWrap");
+                       if (wrappingAlgorithm == null)
+                               throw new ArgumentNullException ("wrappingAlgorithm");
+                       if (wrappingToken == null)
+                               throw new ArgumentNullException ("wrappingToken");
+
+                       raw_key = keyToWrap;
+                       this.id = id;
+                       wrap_alg = wrappingAlgorithm;
+                       wrap_token = wrappingToken;
+                       wrap_token_ref = wrappingTokenReference;
+                       Collection<SecurityKey> l = new Collection<SecurityKey> ();
+                       foreach (SecurityKey sk in wrappingToken.SecurityKeys) {
+                               if (sk.IsSupportedAlgorithm (wrappingAlgorithm)) {
+                                       wrapped_key = sk.EncryptKey (wrappingAlgorithm, keyToWrap);
+                                       l.Add (new InMemorySymmetricSecurityKey (keyToWrap));
+                                       break;
+                               }
+                       }
+                       keys = new ReadOnlyCollection<SecurityKey> (l);
+                       if (wrapped_key == null)
+                               throw new ArgumentException (String.Format ("None of the security keys in the argument token supports specified wrapping algorithm '{0}'", wrappingAlgorithm));
+               }
+
+               internal byte [] RawKey {
+                       get { return raw_key; }
+               }
+
+               // It is kind of compromised solution to output
+               // ReferenceList inside e:EncryptedKey and might disappear
+               // when non-wrapped key is represented by another token type.
+               internal ReferenceList ReferenceList {
+                       get { return reference_list; }
+                       set { reference_list = value; }
+               }
+
+               public override DateTime ValidFrom {
+                       get { return valid_from; }
+               }
+
+               public override DateTime ValidTo {
+                       get { return DateTime.MaxValue.AddDays (-1); }
+               }
+
+               public override string Id {
+                       get { return id; }
+               }
+
+               public override ReadOnlyCollection<SecurityKey> SecurityKeys {
+                       get { return keys; }
+               }
+
+               public string WrappingAlgorithm {
+                       get { return wrap_alg; }
+               }
+
+               public SecurityToken WrappingToken {
+                       get { return wrap_token; }
+               }
+
+               public SecurityKeyIdentifier WrappingTokenReference {
+                       get { return wrap_token_ref; }
+               }
+
+               public byte [] GetWrappedKey ()
+               {
+                       return (byte []) wrapped_key.Clone ();
+               }
+
+               internal void SetWrappedKey (byte [] value)
+               {
+                       wrapped_key = (byte []) value.Clone ();
+               }
+
+               [MonoTODO]
+               public override bool CanCreateKeyIdentifierClause<T> ()
+               {
+                       /*
+                       foreach (SecurityKeyIdentifierClause k in WrappingTokenReference) {
+                               Type t = k.GetType ();
+                               if (t == typeof (T) || t.IsSubclassOf (typeof (T)))
+                                       return true;
+                       }
+                       */
+                       return false;
+               }
+
+               [MonoTODO]
+               public override T CreateKeyIdentifierClause<T> ()
+               {
+                       /*
+                       foreach (SecurityKeyIdentifierClause k in WrappingTokenReference) {
+                               Type t = k.GetType ();
+                               if (t == typeof (T) || t.IsSubclassOf (typeof (T)))
+                                       return (T) k;
+                       }
+                       */
+                       throw new NotSupportedException (String.Format ("WrappedKeySecurityToken cannot create '{0}'", typeof (T)));
+               }
+
+               public override bool MatchesKeyIdentifierClause (SecurityKeyIdentifierClause keyIdentifierClause)
+               {
+                       LocalIdKeyIdentifierClause lkic = keyIdentifierClause as LocalIdKeyIdentifierClause;
+                       if (lkic != null && lkic.LocalId == Id)
+                               return true;
+
+                       InternalEncryptedKeyIdentifierClause khic = keyIdentifierClause as InternalEncryptedKeyIdentifierClause;
+                       if (keyhash == null)
+                               keyhash = SHA1.Create ().ComputeHash (wrapped_key);
+                       if (khic != null && khic.Matches (keyhash))
+                               return true;
+
+                       return false;
+               }
+       }
+}
diff --git a/mcs/class/System.IdentityModel/System.ServiceModel.Security/BinarySecretKeyIdentifierClause.cs b/mcs/class/System.IdentityModel/System.ServiceModel.Security/BinarySecretKeyIdentifierClause.cs
new file mode 100644 (file)
index 0000000..497d5c7
--- /dev/null
@@ -0,0 +1,87 @@
+//
+// BinarySecretKeyIdentifierClause.cs
+//
+// Author:
+//     Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2006 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;
+using System.Collections.Generic;
+using System.Xml;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+
+namespace System.ServiceModel.Security
+{
+       public class BinarySecretKeyIdentifierClause : BinaryKeyIdentifierClause
+       {
+               public BinarySecretKeyIdentifierClause (byte [] key)
+                       : this (key, true)
+               {
+               }
+
+               [MonoTODO ("ClauseType")]
+               public BinarySecretKeyIdentifierClause (byte [] key, bool cloneBuffer)
+                       : base ("", key, cloneBuffer)
+               {
+               }
+
+               [MonoTODO ("ClauseType")]
+               public BinarySecretKeyIdentifierClause (byte [] key, bool cloneBuffer, byte [] derivationNonce, int derivationLength)
+                       : base ("", key, cloneBuffer, derivationNonce, derivationLength)
+               {
+               }
+
+               public override bool CanCreateKey {
+                       get { return true; }
+               }
+
+               public byte [] GetKeyBytes ()
+               {
+                       return GetBuffer ();
+               }
+
+               public override SecurityKey CreateKey ()
+               {
+                       return new InMemorySymmetricSecurityKey (GetRawBuffer (), true);
+               }
+
+               public override bool Matches (SecurityKeyIdentifierClause clause)
+               {
+                       if (clause == null)
+                               throw new ArgumentNullException ("clause");
+                       BinarySecretKeyIdentifierClause other =
+                               clause as BinarySecretKeyIdentifierClause;
+                       if (other == null)
+                               return false;
+                       byte [] b1 = GetRawBuffer ();
+                       byte [] b2 = other.GetRawBuffer ();
+                       if (b1.Length != b2.Length)
+                               return false;
+                       for (int i = 0; i < b1.Length; i++)
+                               if (b1 [i] != b2 [i])
+                                       return false;
+                       return true;
+               }
+       }
+}
diff --git a/mcs/class/System.IdentityModel/System.ServiceModel.Security/KeyNameIdentifierClause.cs b/mcs/class/System.IdentityModel/System.ServiceModel.Security/KeyNameIdentifierClause.cs
new file mode 100644 (file)
index 0000000..ad7a84a
--- /dev/null
@@ -0,0 +1,69 @@
+//
+// KeyNameIdentifierClause.cs
+//
+// Author:
+//     Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2006 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;
+using System.Collections.Generic;
+using System.Xml;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+
+namespace System.ServiceModel.Security
+{
+       public class KeyNameIdentifierClause : SecurityKeyIdentifierClause
+       {
+               public KeyNameIdentifierClause (string keyName)
+                       : base (null)
+               {
+                       key_name = keyName;
+               }
+
+               string key_name;
+
+               public string KeyName {
+                       get { return key_name; }
+               }
+
+               public override bool Matches (SecurityKeyIdentifierClause clause)
+               {
+                       if (clause == null)
+                               throw new ArgumentNullException ("clause");
+                       KeyNameIdentifierClause knic =
+                               clause as KeyNameIdentifierClause;
+                       return knic != null && Matches (knic.KeyName);
+               }
+
+               public bool Matches (string keyName)
+               {
+                       return key_name == keyName;
+               }
+
+               public override string ToString ()
+               {
+                       return String.Concat ("KeyNameIdentifierClause(KeyName = '", KeyName, "')");
+               }
+       }
+}
diff --git a/mcs/class/System.IdentityModel/System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs b/mcs/class/System.IdentityModel/System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs
new file mode 100644 (file)
index 0000000..2ac33ba
--- /dev/null
@@ -0,0 +1,84 @@
+//
+// SecurityContextKeyIdentifierClause.cs
+//
+// Author:
+//     Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2006 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.IdentityModel.Selectors;
+using System.IdentityModel.Tokens;
+using System.Xml;
+
+namespace System.ServiceModel.Security
+{
+       public class SecurityContextKeyIdentifierClause : SecurityKeyIdentifierClause
+       {
+               public SecurityContextKeyIdentifierClause (UniqueId contextId)
+                       : this (contextId, new UniqueId ())
+               {
+               }
+
+               public SecurityContextKeyIdentifierClause (UniqueId contextId, UniqueId generation)
+                       : this (contextId, generation, null, 0)
+               {
+               }
+
+               public SecurityContextKeyIdentifierClause (UniqueId contextId, UniqueId generation, byte [] derivationNonce, int derivationLength)
+                       : base (null, derivationNonce, derivationLength)
+               {
+                       this.context = contextId;
+                       this.generation = generation;
+               }
+
+               UniqueId context, generation;
+
+               public UniqueId ContextId {
+                       get { return context; }
+               }
+
+               public UniqueId Generation {
+                       get { return generation; }
+               }
+
+               public override bool Matches (
+                       SecurityKeyIdentifierClause keyIdentifierClause)
+               {
+                       SecurityContextKeyIdentifierClause other =
+                               keyIdentifierClause as SecurityContextKeyIdentifierClause;
+                       return  other != null && Matches (other.context, other.generation);
+               }
+
+               public bool Matches (UniqueId contextId, UniqueId generation)
+               {
+                       return context == contextId &&
+                               this.generation == generation;
+               }
+
+               [MonoTODO]
+               public override string ToString ()
+               {
+                       return base.ToString ();
+               }
+       }
+}
index 4d705d24d5794a9bb090e62ad31cf76312c4c1e0..c6ab55fe8d704fbf8df35ef92c09de4dd3177c08 100755 (executable)
@@ -128,4 +128,10 @@ System.IdentityModel.Tokens/X509SubjectKeyIdentifierClause.cs
 System.IdentityModel.Tokens/X509ThumbprintKeyIdentifierClause.cs
 System.IdentityModel.Tokens/X509WindowsSecurityToken.cs
 System.Security.Claims/AuthenticationTypes.cs
+System.ServiceModel.Security/BinarySecretKeyIdentifierClause.cs
+System.ServiceModel.Security/KeyNameIdentifierClause.cs
+System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs
 System.ServiceModel.Security/X509CertificateValidationMode.cs
+System.ServiceModel.Security.Tokens/BinarySecretSecurityToken.cs
+System.ServiceModel.Security.Tokens/InternalEncryptedKeyIdentifierClause.cs
+System.ServiceModel.Security.Tokens/WrappedKeySecurityToken.cs
index 136d3cc0f0f60f82bbb5d4a99d7c281a053c8537..f1f3da90e103829f20b8cbd9f6641361d582bb90 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC;FEATURE_DYNAMIC</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC;FEATURE_DYNAMIC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC;FEATURE_DYNAMIC</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC;FEATURE_DYNAMIC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 5a5dadfa168d8e4a3328de5149864d95cd1a2e2e..089c3056c1abf3d797cc83f9e63030c6bcb130e7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7d9b5c4017292ec9fffd36c9d7cee45d52d3182e..b41b80068cf4f41deedf1af31748004be0db3faa 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 939068bd6f7a40d3d1d00ee3d31952ba2adbaeeb..74446b38cb8bdb4e9dfeedb838ed5300c922aae4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f987c65b4e4ef67b74ca0df3da3e416ea08872d0..48defdeb71fc94283af391573abe2b81f66842a7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 519b2833cba57777ffc6909578023f34fc0c4af8..2a8218cb70d7aed07e1c4662bf0dd30f04b07814 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 59456d6df0bb91dbaaae0de6a84b01c3e6b4ccf0..14ebd8ff85de73380a0b30f2e7c0aa41363ffeef 100644 (file)
@@ -29,7 +29,12 @@ namespace System.Net.Http {
                // but we want this to work "as expected" even if the application is not being linked
                static HttpMessageHandler GetDefaultHandler ()
                {
+#if MONOTOUCH_WATCH
+                       // There's only one valid handler type for watchOS
+                       return new NSUrlSessionHandler ();
+#else
                        return RuntimeOptions.GetHttpMessageHandler ();
+#endif
                }
        }
 #else
index e6e2d68457e26d135f2b8691238a53d4daf7357e..f4cd00da2bf9d21ad96eedb6d03a916742cf2ae6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index ee2dbe74b67855bf0c9bf4a7210aea2df3b02c46..e90cc29f822a82c5b405de37c856f78a33a1850b 100644 (file)
@@ -147,7 +147,7 @@ namespace System.Net.Http.Headers
                        if (t != Token.Type.Token)
                                return false;
 
-                       int nvalue;
+                       long nvalue;
                        if (!lexer.IsStarStringValue (t)) {
                                if (!lexer.TryGetNumericValue (t, out nvalue)) {
                                        var s = lexer.GetStringValue (t);
@@ -158,12 +158,12 @@ namespace System.Net.Http.Headers
                                        if (sep.Length != 2)
                                                return false;
 
-                                       if (!int.TryParse (sep[0], NumberStyles.None, CultureInfo.InvariantCulture, out nvalue))
+                                       if (!long.TryParse (sep[0], NumberStyles.None, CultureInfo.InvariantCulture, out nvalue))
                                                return false;
 
                                        value.From = nvalue;
 
-                                       if (!int.TryParse (sep[1], NumberStyles.None, CultureInfo.InvariantCulture, out nvalue))
+                                       if (!long.TryParse (sep[1], NumberStyles.None, CultureInfo.InvariantCulture, out nvalue))
                                                return false;
 
                                        value.To = nvalue;
index 78f2fafcc83284e5e87abfbcbfb13e4935abbd1a..a3335ea5506ffe67aafedba5773301d48b9cee77 100644 (file)
@@ -380,7 +380,9 @@ namespace System.Net.Http
                                }
                        } catch (WebException we) {
                                if (we.Status != WebExceptionStatus.RequestCanceled)
-                                       throw;
+                                       throw new HttpRequestException ("An error occurred while sending the request", we);
+                       } catch (System.IO.IOException ex) {
+                               throw new HttpRequestException ("An error occurred while sending the request", ex);
                        }
 
                        if (cancellationToken.IsCancellationRequested) {
index 62b740c33cd5b9ba2ee05a5ab7741938037be95a..7522def2d7b2999527d732a93cc3006bac2b0d24 100644 (file)
@@ -101,6 +101,12 @@ namespace MonoTests.System.Net.Http.Headers
                        Assert.IsNull (res.To, "#22");
                        Assert.IsNull (res.Length, "#23");
                        Assert.AreEqual ("by */*", res.ToString (), "#24");
+
+                       res = ContentRangeHeaderValue.Parse("bytes  199999999999999999 - 999999999999999999/ 9223372036854775807");
+                       Assert.AreEqual (199999999999999999, res.From, "#31");
+                       Assert.AreEqual (999999999999999999, res.To, "#32");
+                       Assert.AreEqual (9223372036854775807, res.Length, "#33");
+                       Assert.AreEqual ("bytes 199999999999999999-999999999999999999/9223372036854775807", res.ToString (), "#34");
                }
 
                [Test]
index ac5858d1adb7fb2e77bd7ffb1f18c9db0aedf559..d1b87a5741a7ad73d94d771abfa324ac1042b4e3 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1720</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1720</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f782c91e5cdece5a45361cd240173ebd832cb362..622801b60a8365814dcd2b087d78be391dffbe6d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -14,7 +15,7 @@
     <NoStdLib>True</NoStdLib>\r
     \r
     <NoConfig>True</NoConfig>\r
-    \r
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
     <AppDesignerFolder>Properties</AppDesignerFolder>\r
     <RootNamespace>\r
     </RootNamespace>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -50,7 +51,8 @@
   <ItemGroup>\r
     <Compile Include="..\..\build\common\Consts.cs" />\r
     <Compile Include="..\..\build\common\SR.cs" />\r
-    <Compile Include="Assembly\AssemblyInfo.cs" />\r  </ItemGroup>\r
+    <Compile Include="Assembly\AssemblyInfo.cs" />\r
+    <Compile Include="Assembly\TypeForwarders.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
       <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
       <Name>System-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../System.Numerics/System.Numerics-net_4_x.csproj">\r
+      <Project>{BD2FFDDC-BD89-4041-82F5-A696C941C7BE}</Project>\r
+      <Name>System.Numerics-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index 6fe1d3aa59a18d18af49651d7566b8caf2e1edca..7281ba9fca9f38328b07b57aa6fff6c13dde71c8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -7,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{BD2FFDDC-BD89-4041-82F5-A696C941C7BE}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699</NoWarn>\r
+    <NoWarn>1699,414</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
     <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699</NoWarn>\r
+    <NoWarn>1699,414</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</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</NoWarn>\r
+    <NoWarn>1699,414</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="..\referencesource\System.Numerics\System\Numerics\BigIntegerBuilder.cs" />\r
     <Compile Include="..\referencesource\System.Numerics\System\Numerics\BigNumber.cs" />\r
     <Compile Include="..\referencesource\System.Numerics\System\Numerics\Complex.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\HashCodeHelper.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\JITIntrinsicAttribute.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Matrix3x2.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Matrix4x4.cs" />\r
     <Compile Include="..\referencesource\System.Numerics\System\Numerics\NumericsHelpers.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Plane.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Quaternion.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Vector_Operations.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Vector2.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Vector2_Intrinsics.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Vector3.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Vector3_Intrinsics.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Vector4.cs" />\r
+    <Compile Include="..\referencesource\System.Numerics\System\Numerics\Vector4_Intrinsics.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
-    <Compile Include="ReferenceSources\Environment.cs" />\r
     <Compile Include="ReferenceSources\SR.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
index 7b3dfa248deb2b63a1acb932b86e6159e12da601..7140954c4c4c9f6d64b0e6b1600bf1ca7c323185 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0fef571313a78994b8dd281b71353315ac4602ef..a291406715980f6b0f6b7d5cedbfa1e621bbf26a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 55e768b3fa4272cb3b755836b19dbdcc238f2f88..532517ae77a9e59eedd51887c7ed04d9f817c72e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f0057b389b23ddf9bd27deccf199f90d5b71bfa8..583a3cb2ca7eb4965443e6454b7ff388673c604e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 67b2b8a8844cc12c1ecf09fdb1ff9da5ae8edbae..4967b9c1c5b14b51a08097b825942e6701a6b467 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index fcff09f9daf815ddac9f5f1b5199b28bb053b0ab..3f4b1fb89a7948dfca0f9b9c9ff3e0ea5accbc05 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 538ff9529d94ea3bd5a2ad3e223c27f652e82fa0..1aeaee173c6aff75dc3a4ff12ae79b6600db6108 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0099448bd54ccb6132e7b2184164293adc9b2ec2..49678ecfa408635cea70b94efd32c20b4e44e0b4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2802930f4d4ca978a4218700062546d9b54c76da..7268b7a376c6c433bcc17ecf88249673efcd6b98 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 6aacf0d324f2c8fdd73912eaab23c142523f3287..9b36305b41894f102020a3c696bbeddd86a4237d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2399dc270ca57124a3c099787d3a8175fd4cd871..d79683bf974d84f8e21ec5a6d1e1ebca2bde5fe2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;HAS_EDI;PREFERASYNC;PREFER_ASYNC;HAS_AWAIT;SIGNED</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Reflection.Context/System.Reflection.Context-net_4_x.csproj b/mcs/class/System.Reflection.Context/System.Reflection.Context-net_4_x.csproj
new file mode 100644 (file)
index 0000000..41317af
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\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>{50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <NoWarn>1699</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
+    \r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>\r
+    </RootNamespace>\r
+    <AssemblyName>System.Reflection.Context</AssemblyName>\r
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
+    <FileAlignment>512</FileAlignment>\r
+  </PropertyGroup>\r
+  \r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <NoWarn>1699</NoWarn>\r
+    <Optimize>false</Optimize>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</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</NoWarn>\r
+    <Optimize>true</Optimize>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</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="Assembly\AssemblyInfo.cs" />\r
+    <Compile Include="System.Reflection.Context\CustomReflectionContext.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
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Folder Include="Properties\" />\r
+  </ItemGroup>\r
+</Project>\r
+
index 3089b404bdf517604d7f302d2fc44182f6ac7e4c..52c7a97872c7bc4ff046574d9b0cc9b8eb38574a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,414</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,414</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="..\referencesource\System.Runtime.Caching\System\Caching\SafeBitVector32.cs" />\r
     <Compile Include="..\referencesource\System.Runtime.Caching\System\Caching\SafeRegistryHandle.cs" />\r
     <Compile Include="..\referencesource\System.Runtime.Caching\System\Caching\SqlChangeMonitor.cs" />\r
+    <Compile Include="..\referencesource\System.Runtime.Caching\System\Caching\SRef.cs" />\r
     <Compile Include="..\System.Web\System.Web.Configuration_2.0\NullableStringValidator.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="ReferenceSources\CacheEntryCollection.cs" />\r
     <Compile Include="ReferenceSources\CacheExpires.cs" />\r
     <Compile Include="ReferenceSources\CacheUsage.cs" />\r
-    <Compile Include="ReferenceSources\R.Designer.cs" />\r
-    <Compile Include="ReferenceSources\SRef.cs" />\r  </ItemGroup>\r
+    <Compile Include="ReferenceSources\R.Designer.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
index 480589216b314108be5f2287752892126350686b..2534e9c8a83d14576ba26d0403dd848127841151 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/class/System.Runtime.InteropServices.RuntimeInformation/System.Runtime.InteropServices.RuntimeInformation-net_4_x.csproj b/mcs/class/System.Runtime.InteropServices.RuntimeInformation/System.Runtime.InteropServices.RuntimeInformation-net_4_x.csproj
new file mode 100644 (file)
index 0000000..dda5c76
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\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>{1E1BC1A8-EAD2-496C-A6D6-8AFABD741F56}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <NoWarn>1699</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
+    \r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>\r
+    </RootNamespace>\r
+    <AssemblyName>System.Runtime.InteropServices.RuntimeInformation</AssemblyName>\r
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
+    <FileAlignment>512</FileAlignment>\r
+  </PropertyGroup>\r
+  \r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <NoWarn>1699</NoWarn>\r
+    <Optimize>false</Optimize>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</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</NoWarn>\r
+    <Optimize>true</Optimize>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</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="Assembly\AssemblyInfo.cs" />\r
+    <Compile Include="System.Runtime.InteropServices\Architecture.cs" />\r
+    <Compile Include="System.Runtime.InteropServices\OSPlatform.cs" />\r
+    <Compile Include="System.Runtime.InteropServices\RuntimeInformation.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
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Folder Include="Properties\" />\r
+  </ItemGroup>\r
+</Project>\r
+
index 5601f7c47a15cf354274bdf16b14caf1f3f81306..9a8cb2a5f9c7d30c07641f3d882218ce5284cb0c 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 883ea72ebe25f4b079ae0a684e021cede538bda7..599edd8a8039f54801a5191592799319ee077632 100644 (file)
@@ -115,7 +115,8 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
 
         public void StartListening(object data)
         {
-            serverChannel.StartListening(data);
+            if (serverChannel != null)
+                serverChannel.StartListening(data);
         }
 
         public object ChannelData
@@ -128,7 +129,8 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
 
         public void StopListening(object data)
         {
-            serverChannel.StopListening(data);
+            if (serverChannel != null)
+                serverChannel.StopListening(data);
         }
 
         public string[] GetUrlsForUri(string objectURI)
index 089cd330b62162234109a3cec01b7df9f256053b..974caaaaa8b76eae21cd74f42d81abe1c68d169c 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-
-using System;
 using System.Runtime.InteropServices;
 using System.Text;
+using System.Threading;
 
 namespace System.Runtime.Remoting.Channels.Ipc.Win32
 {
@@ -89,6 +88,7 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
         public const uint OPEN_EXISTING     = 3;
         public const uint OPEN_ALWAYS       = 4;
         public const uint TRUNCATE_EXISTING = 5;
+           public const uint FILE_FLAG_OVERLAPPED = 0x40000000;
         
         // Access flags
         public const uint GENERIC_READ = 0x80000000;
@@ -103,6 +103,7 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
         public const int ERROR_PIPE_NOT_CONNECTED = 233;
         public const int ERROR_PIPE_CONNECTED = 535;
         public const int ERROR_PIPE_LISTENING = 536;
+           public const int ERROR_IO_PENDING = 997;
 
         public const int INVALID_HANDLE_VALUE = -1;
 
@@ -121,7 +122,7 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
         [DllImport("kernel32.dll", SetLastError = true)]
         public static extern bool ConnectNamedPipe(
             IntPtr hPipe,
-            IntPtr lpOverlapped
+            [In] ref NativeOverlapped lpOverlapped
             );
 
         [DllImport("kernel32.dll", SetLastError = true)]
index 8270e3d157fd3545cdc3e798508a7dbbcb3d3a6a..7170b7e932a49d84cfe164b96ed4f50405574159 100644 (file)
@@ -27,8 +27,8 @@
 //
 
 
-using System;
 using System.Runtime.InteropServices;
+using System.Threading;
 
 namespace System.Runtime.Remoting.Channels.Ipc.Win32
 {
@@ -74,7 +74,7 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
         {
             IntPtr hPipe = NamedPipeHelper.CreateNamedPipe(
                 pipeName,
-                NamedPipeHelper.PIPE_ACCESS_DUPLEX,
+                NamedPipeHelper.PIPE_ACCESS_DUPLEX | NamedPipeHelper.FILE_FLAG_OVERLAPPED,
                 NamedPipeHelper.PIPE_TYPE_MESSAGE
                 | NamedPipeHelper.PIPE_READMODE_MESSAGE
                 | NamedPipeHelper.PIPE_WAIT,
@@ -85,27 +85,43 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
                 IntPtr.Zero
                 );
 
-            if (hPipe.ToInt32() == NamedPipeHelper.INVALID_HANDLE_VALUE) 
-            {
-                throw new NamedPipeException();
+            if (hPipe.ToInt32 () == NamedPipeHelper.INVALID_HANDLE_VALUE) {
+                throw new NamedPipeException (Marshal.GetLastWin32Error ());
             }
 
-            bool canConnect = NamedPipeHelper.ConnectNamedPipe(hPipe, IntPtr.Zero);
-            int lastError = Marshal.GetLastWin32Error();
-            if (!canConnect && lastError == NamedPipeHelper.ERROR_PIPE_CONNECTED)
-                canConnect = true;
+                       // Connect the named pipe with overlapped structure
+                       // in order to make it altertable. This way we will
+                       // wake up when someone aborts a thread waiting 
+                       // for this pipe.
+                       NativeOverlapped overlapped = new NativeOverlapped ();
+            bool canConnect = NamedPipeHelper.ConnectNamedPipe (hPipe, ref overlapped);
 
-            if (canConnect) 
-            {
-                return new NamedPipeSocket(hPipe);
-            }
-            else 
-            {
-                NamedPipeHelper.CloseHandle(hPipe);
-                throw new NamedPipeException(lastError);
-            }
+            int lastError = Marshal.GetLastWin32Error ();
+                       if (!canConnect) {
+                               if (lastError == NamedPipeHelper.ERROR_IO_PENDING) {
+                                       uint bytesTransferred = 0;
+                                       if (!GetOverlappedResultEx (hPipe, ref overlapped, out bytesTransferred, Timeout.Infinite, true)) {
+                                               lastError = Marshal.GetLastWin32Error ();
+                                               NamedPipeHelper.CloseHandle (hPipe);
+                                               throw new NamedPipeException (lastError);
+                                       }
+                                       canConnect = true;
+                               } else if (lastError == NamedPipeHelper.ERROR_PIPE_CONNECTED)
+                                       canConnect = true;
+                       }
+
+                       if (!canConnect) {
+                               NamedPipeHelper.CloseHandle (hPipe);
+                               throw new NamedPipeException (lastError);
+                       }
+
+                       return new NamedPipeSocket (hPipe);
         }
 
+               [DllImport("kernel32.dll", SetLastError = true)]
+               static extern bool GetOverlappedResultEx (IntPtr hFile, [In] ref System.Threading.NativeOverlapped lpOverlapped,
+                                                                                                 out uint lpNumberOfBytesTransferred, int dwMilliseconds, bool bAltertable);
+
     }
 }
 
index ff09e03824c327e865236b5a4b8568bdfb3bd3a6..8aae7d9e602904bd3c5b2c4e181e210051db3ffb 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 System.Runtime.Remoting.Channels.Tcp/TcpChannelTest.cs
 ServerObject.cs
 ContextsTest.cs
index 68930b0d640addd065d2408c87f3790d3fe5d006..c809f96c9401173bd5de5f7a6817026bd9291f24 100644 (file)
@@ -169,16 +169,12 @@ namespace MonoTests.Remoting.Http
                public void Main ()
                {
                        channel = new HttpChannel (0);
-                       try {
                        ChannelServices.RegisterChannel (channel);
                        MarshalByRefObject obj = (MarshalByRefObject) RemotingServices.Connect (
                                typeof (IFactorial),
                                "http://localhost:60000/MyEndPoint");
                        IFactorial cal = (IFactorial) obj;
-                       Assert.AreEqual (cal.CalculateFactorial (4), 24); 
-                       } finally {
-                       ChannelServices.UnregisterChannel (channel);
-                       }
+                       Assert.AreEqual (cal.CalculateFactorial (4), 24);
                }
                
                [TestFixtureSetUp]
index 831c69e72b54f79b0b9b454ec152261ea9864cc1..45f76791b7cf6841752a917937f876b03e70b52e 100644 (file)
@@ -78,7 +78,7 @@ namespace MonoTests.Remoting
                        IpcServerChannel chan = new IpcServerChannel (channelName, portName);
                        string[] uris = chan.GetUrlsForUri ("server.rem");
                        Assert.IsNotNull (uris);
-                       Assert.Greater (uris.Length, 0);
+                       AssertHelper.Greater (uris.Length, 0);
 
                        bool found = false;
                        foreach (string s in uris) {
@@ -101,7 +101,7 @@ namespace MonoTests.Remoting
                        IpcChannel chan = new IpcChannel (props, null, null);
                        string[] uris = chan.GetUrlsForUri ("server.rem");
                        Assert.IsNotNull (uris);
-                       Assert.Greater (uris.Length, 0);
+                       AssertHelper.Greater (uris.Length, 0);
 
                        bool found = false;
                        foreach (string s in uris) {
index f9ad75cd3ac4a05f55b984212b19982d795a576a..02c6a532c00ce24d94a757b312892a2df1920c86 100644 (file)
@@ -193,7 +193,7 @@ namespace MonoTests.Remoting
 \r
        // The main test class\r
        [TestFixture]\r
-       public class RemotingServicesTest : Assertion\r
+       public class RemotingServicesTest\r
        {\r
                private static int MarshalObjectId = 0;\r
 \r
@@ -233,13 +233,13 @@ namespace MonoTests.Remoting
                        MarshalObject objMarshal = NewMarshalObject ();\r
                        ObjRef objRef = RemotingServices.Marshal (objMarshal);\r
 \r
-                       Assert ("#A01", objRef.URI != null);\r
+                       Assert.IsNotNull (objRef.URI, "#A01");\r
 \r
                        MarshalObject objRem = (MarshalObject) RemotingServices.Unmarshal (objRef);\r
-                       AssertEquals ("#A02", objMarshal.Id, objRem.Id);\r
+                       Assert.AreEqual (objMarshal.Id, objRem.Id, "#A02");\r
 \r
                        objRem.Id = 2;\r
-                       AssertEquals ("#A03", objMarshal.Id, objRem.Id);\r
+                       Assert.AreEqual (objMarshal.Id, objRem.Id, "#A03");\r
 \r
                        // TODO: uncomment when RemotingServices.Disconnect is implemented\r
                        //RemotingServices.Disconnect(objMarshal);\r
@@ -248,7 +248,7 @@ namespace MonoTests.Remoting
 \r
                        objRef = RemotingServices.Marshal (objMarshal, objMarshal.Uri);\r
 \r
-                       Assert ("#A04", objRef.URI.EndsWith (objMarshal.Uri));\r
+                       Assert.IsTrue (objRef.URI.EndsWith (objMarshal.Uri), "#A04");\r
                        // TODO: uncomment when RemotingServices.Disconnect is implemented\r
                        //RemotingServices.Disconnect(objMarshal);\r
                }\r
@@ -261,7 +261,7 @@ namespace MonoTests.Remoting
                        ObjRef objRef = RemotingServices.Marshal (derivedObjMarshal, derivedObjMarshal.Uri, typeof (MarshalObject));\r
 \r
                        // Check that the type of the marshaled object is MarshalObject\r
-                       Assert ("#A05", objRef.TypeInfo.TypeName.StartsWith ((typeof (MarshalObject)).ToString ()));\r
+                       Assert.IsTrue (objRef.TypeInfo.TypeName.StartsWith ((typeof (MarshalObject)).ToString ()), "#A05");\r
 \r
                        // TODO: uncomment when RemotingServices.Disconnect is implemented\r
                        //RemotingServices.Disconnect(derivedObjMarshal);\r
@@ -273,11 +273,11 @@ namespace MonoTests.Remoting
                {\r
                        MarshalObject objMarshal = NewMarshalObject ();\r
 \r
-                       Assert ("#A06", RemotingServices.GetObjectUri (objMarshal) == null);\r
+                       Assert.IsNull (RemotingServices.GetObjectUri (objMarshal), "#A06");\r
 \r
                        RemotingServices.Marshal (objMarshal);\r
 \r
-                       Assert ("#A07", RemotingServices.GetObjectUri (objMarshal) != null);\r
+                       Assert.IsNotNull (RemotingServices.GetObjectUri (objMarshal), "#A07");\r
                        // TODO: uncomment when RemotingServices.Disconnect is implemented\r
                        //RemotingServices.Disconnect(objMarshal);\r
                }\r
@@ -297,7 +297,7 @@ namespace MonoTests.Remoting
                        try {\r
                                RemotingServices.Marshal (objMarshal, objMarshal.Uri);\r
                                MarshalObject objRem = (MarshalObject) RemotingServices.Connect (typeof (MarshalObject), "tcp://localhost:1236/" + objMarshal.Uri);\r
-                               Assert ("#A08", RemotingServices.IsTransparentProxy (objRem));\r
+                               Assert.IsTrue (RemotingServices.IsTransparentProxy (objRem), "#A08");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                                RemotingServices.Disconnect (objMarshal);\r
@@ -324,7 +324,7 @@ namespace MonoTests.Remoting
                                // a real object\r
                                try {\r
                                        RemotingServices.Marshal (objRem, objMarshal.Uri);\r
-                                       Fail ("#1");\r
+                                       Assert.Fail ("#1");\r
                                } catch (RemotingException e) {\r
                                }\r
                        } finally {\r
@@ -355,15 +355,15 @@ namespace MonoTests.Remoting
                                objRem.Method1 ();\r
 \r
                                // Tests RemotingServices.GetMethodBaseFromMethodMessage()\r
-                               AssertEquals ("#A09", "Method1", proxy.MthBase.Name);\r
-                               Assert ("#A09.1", !proxy.IsMethodOverloaded);\r
+                               Assert.AreEqual ("Method1", proxy.MthBase.Name, "#A09");\r
+                               Assert.IsFalse (proxy.IsMethodOverloaded, "#A09.1");\r
 \r
                                objRem.Method2 ();\r
-                               Assert ("#A09.2", proxy.IsMethodOverloaded);\r
+                               Assert.IsTrue (proxy.IsMethodOverloaded, "#A09.2");\r
 \r
                                // Tests RemotingServices.ExecuteMessage();\r
                                // If ExecuteMessage does it job well, Method1 should be called 2 times\r
-                               AssertEquals ("#A10", 2, MarshalObject.Called);\r
+                               Assert.AreEqual (2, MarshalObject.Called, "#A10");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -380,14 +380,14 @@ namespace MonoTests.Remoting
 \r
                                MarshalObject objRem = (MarshalObject) Activator.GetObject (typeof (MarshalObject), "tcp://localhost:1238/MarshalObject.rem");\r
 \r
-                               Assert ("#A10.1", RemotingServices.IsTransparentProxy (objRem));\r
+                               Assert.IsTrue (RemotingServices.IsTransparentProxy (objRem), "#A10.1");\r
 \r
                                objRem.Method1 ();\r
                                Thread.Sleep (20);\r
-                               Assert ("#A10.2", !MarshalObject.IsMethodOneWay);\r
+                               Assert.IsFalse (MarshalObject.IsMethodOneWay, "#A10.2");\r
                                objRem.Method3 ();\r
                                Thread.Sleep (20);\r
-                               Assert ("#A10.3", MarshalObject.IsMethodOneWay);\r
+                               Assert.IsTrue (MarshalObject.IsMethodOneWay, "#A10.3");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -409,7 +409,7 @@ namespace MonoTests.Remoting
 \r
                                ObjRef objRefRem = RemotingServices.GetObjRefForProxy ((MarshalByRefObject) objRem);\r
 \r
-                               Assert ("#A11", objRefRem != null);\r
+                               Assert.IsNotNull (objRefRem, "#A11");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -429,8 +429,8 @@ namespace MonoTests.Remoting
 \r
                                RealProxy rp = RemotingServices.GetRealProxy (objRem);\r
 \r
-                               Assert ("#A12", rp != null);\r
-                               AssertEquals ("#A13", "MonoTests.System.Runtime.Remoting.RemotingServicesInternal.MyProxy", rp.GetType ().ToString ());\r
+                               Assert.IsNotNull (rp, "#A12");\r
+                               Assert.AreEqual ("MonoTests.System.Runtime.Remoting.RemotingServicesInternal.MyProxy", rp.GetType ().ToString (), "#A13");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -448,7 +448,7 @@ namespace MonoTests.Remoting
                                RemotingServices.Marshal (objRem);\r
 \r
                                objRem = (MarshalObject) Activator.GetObject (typeof (MarshalObject), "tcp://localhost:1242/" + objRem.Uri);\r
-                               Assert ("#A14", objRem != null);\r
+                               Assert.IsNotNull (objRem, "#A14");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -468,7 +468,7 @@ namespace MonoTests.Remoting
                                RemotingServices.Marshal (objRem);\r
 \r
                                Type typeRem = RemotingServices.GetServerTypeForUri (RemotingServices.GetObjectUri (objRem));\r
-                               AssertEquals ("#A15", type, typeRem);\r
+                               Assert.AreEqual (type, typeRem, "#A15");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -487,12 +487,12 @@ namespace MonoTests.Remoting
 \r
                                MarshalObject objRem = (MarshalObject) Activator.GetObject (typeof (MarshalObject), "tcp://localhost:1245/MarshalObject2.rem");\r
 \r
-                               Assert ("#A16", RemotingServices.IsObjectOutOfAppDomain (objRem));\r
-                               Assert ("#A17", RemotingServices.IsObjectOutOfContext (objRem));\r
+                               Assert.IsTrue (RemotingServices.IsObjectOutOfAppDomain (objRem), "#A16");\r
+                               Assert.IsTrue (RemotingServices.IsObjectOutOfContext (objRem), "#A17");\r
 \r
                                MarshalObject objMarshal = new MarshalObject ();\r
-                               Assert ("#A18", !RemotingServices.IsObjectOutOfAppDomain (objMarshal));\r
-                               Assert ("#A19", !RemotingServices.IsObjectOutOfContext (objMarshal));\r
+                               Assert.IsFalse (RemotingServices.IsObjectOutOfAppDomain (objMarshal), "#A18");\r
+                               Assert.IsFalse (RemotingServices.IsObjectOutOfContext (objMarshal), "#A19");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -510,16 +510,16 @@ namespace MonoTests.Remoting
                                MarshalObject objRem = (MarshalObject) Activator.GetObject (typeof (MarshalObject), "tcp://localhost:1246/app/obj3.rem");\r
                                MarshalObject objRem2 = (MarshalObject) Activator.GetObject (typeof (MarshalObject), "tcp://localhost:1246/obj3.rem");\r
 \r
-                               Assert ("#AN1", RemotingServices.IsTransparentProxy (objRem));\r
-                               Assert ("#AN2", RemotingServices.IsTransparentProxy (objRem2));\r
+                               Assert.IsTrue (RemotingServices.IsTransparentProxy (objRem), "#AN1");\r
+                               Assert.IsTrue (RemotingServices.IsTransparentProxy (objRem2), "#AN2");\r
 \r
-                               AssertNotNull ("#AN3", RemotingServices.GetServerTypeForUri ("obj3.rem"));\r
-                               AssertNotNull ("#AN4", RemotingServices.GetServerTypeForUri ("/app/obj3.rem"));\r
-                               AssertNull ("#AN5", RemotingServices.GetServerTypeForUri ("//app/obj3.rem"));\r
-                               AssertNull ("#AN6", RemotingServices.GetServerTypeForUri ("app/obj3.rem"));\r
-                               AssertNull ("#AN7", RemotingServices.GetServerTypeForUri ("/whatever/obj3.rem"));\r
-                               AssertNotNull ("#AN8", RemotingServices.GetServerTypeForUri ("/obj3.rem"));\r
-                               AssertNull ("#AN9", RemotingServices.GetServerTypeForUri ("//obj3.rem"));\r
+                               Assert.IsNotNull (RemotingServices.GetServerTypeForUri ("obj3.rem"), "#AN3");\r
+                               Assert.IsNotNull (RemotingServices.GetServerTypeForUri ("/app/obj3.rem"), "#AN4");\r
+                               Assert.IsNull (RemotingServices.GetServerTypeForUri ("//app/obj3.rem"), "#AN5");\r
+                               Assert.IsNull (RemotingServices.GetServerTypeForUri ("app/obj3.rem"), "#AN6");\r
+                               Assert.IsNull (RemotingServices.GetServerTypeForUri ("/whatever/obj3.rem"), "#AN7");\r
+                               Assert.IsNotNull (RemotingServices.GetServerTypeForUri ("/obj3.rem"), "#AN8");\r
+                               Assert.IsNull (RemotingServices.GetServerTypeForUri ("//obj3.rem"), "#AN9");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -534,7 +534,7 @@ namespace MonoTests.Remoting
                                RemotingConfiguration.RegisterWellKnownServiceType (typeof (MarshalObject), "getobjectwithchanneldata.rem", WellKnownObjectMode.Singleton);\r
 \r
                                string channelData = "test";\r
-                               AssertNotNull ("#01", Activator.GetObject (typeof (MarshalObject), "tcp://localhost:1247/getobjectwithchanneldata.rem", channelData));\r
+                               Assert.IsNotNull (Activator.GetObject (typeof (MarshalObject), "tcp://localhost:1247/getobjectwithchanneldata.rem", channelData), "#01");\r
                        } finally {\r
                                ChannelServices.UnregisterChannel (chn);\r
                        }\r
@@ -548,28 +548,28 @@ namespace MonoTests.Remoting
                        RemotingConfiguration.Configure (null);\r
 \r
                        o = RemotingServices.Connect (typeof (MarshalByRefObject), "tcp://localhost:3434/ff1.rem");\r
-                       Assert ("#m1", o is DD);\r
-                       Assert ("#m2", o is A);\r
-                       Assert ("#m3", o is B);\r
-                       Assert ("#m4", !(o is CC));\r
+                       Assert.IsInstanceOfType (typeof (DD), o, "#m1");\r
+                       Assert.IsInstanceOfType (typeof (A), o, "#m2");\r
+                       Assert.IsInstanceOfType (typeof (B), o, "#m3");\r
+                       AssertHelper.IsNotInstanceOfType (typeof (CC), !(o is CC), "#m4");\r
 \r
                        o = RemotingServices.Connect (typeof (A), "tcp://localhost:3434/ff3.rem");\r
-                       Assert ("#a1", o is DD);\r
-                       Assert ("#a2", o is A);\r
-                       Assert ("#a3", o is B);\r
-                       Assert ("#a4", !(o is CC));\r
+                       Assert.IsInstanceOfType (typeof (DD), o, "#a1");\r
+                       Assert.IsInstanceOfType (typeof (A), o, "#a2");\r
+                       Assert.IsInstanceOfType (typeof (B), o, "#a3");\r
+                       AssertHelper.IsNotInstanceOfType (typeof (CC), o, "#a4");\r
 \r
                        o = RemotingServices.Connect (typeof (DD), "tcp://localhost:3434/ff4.rem");\r
-                       Assert ("#d1", o is DD);\r
-                       Assert ("#d2", o is A);\r
-                       Assert ("#d3", o is B);\r
-                       Assert ("#d4", !(o is CC));\r
+                       Assert.IsInstanceOfType (typeof (DD), o, "#d1");\r
+                       Assert.IsInstanceOfType (typeof (A), o, "#d2");\r
+                       Assert.IsInstanceOfType (typeof (B), o, "#d3");\r
+                       AssertHelper.IsNotInstanceOfType (typeof (CC), o, "#d4");\r
 \r
                        o = RemotingServices.Connect (typeof (CC), "tcp://localhost:3434/ff5.rem");\r
-                       Assert ("#c1", !(o is DD));\r
-                       Assert ("#c2", o is A);\r
-                       Assert ("#c3", o is B);\r
-                       Assert ("#c4", o is CC);\r
+                       AssertHelper.IsNotInstanceOfType (typeof (DD), o, "#c1");\r
+                       Assert.IsInstanceOfType (typeof (A), o, "#c2");\r
+                       Assert.IsInstanceOfType (typeof (B), o, "#c3");\r
+                       Assert.IsInstanceOfType (typeof (CC), o, "#c4");\r
                }\r
                // Don't add any tests that must create channels\r
                // after ConnectProxyCast (), because this test calls\r
index d5192c051b056e3b62ef93bccd3533541c3a95ce..6f52faac5a89b232d5f1801eb2223c492688f085 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f5de8b68d7f091c236651c67a4557732dffa711c..f0198c0ada57881b59b93e2896ecf3c37369b715 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,168,169,219,414</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NO_DYNAMIC_CODEGEN;NET_3_0</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NO_DYNAMIC_CODEGEN;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,168,169,219,414</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NO_DYNAMIC_CODEGEN;NET_3_0</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NO_DYNAMIC_CODEGEN;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="ReferenceSources\FxTrace.cs" />\r
     <Compile Include="ReferenceSources\JsonFormatReaderGenerator_static.cs" />\r
     <Compile Include="ReferenceSources\JsonFormatWriterGenerator_static.cs" />\r
+    <Compile Include="ReferenceSources\LocalAppContextSwitches.cs" />\r
     <Compile Include="ReferenceSources\SR.cs" />\r
     <Compile Include="ReferenceSources\SR.missing.cs" />\r
     <Compile Include="ReferenceSources\XmlDataContract_static.cs" />\r
       <Project>{5769B536-7E8E-4C2A-8671-6B256D0F620B}</Project>\r
       <Name>System.ServiceModel.Internals-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../SMDiagnostics/SMDiagnostics-net_4_x.csproj">\r
-      <Project>{8B8C3ED9-96F9-49B3-B355-9FD3D29DD3AD}</Project>\r
-      <Name>SMDiagnostics-net_4_x</Name>\r
-    </ProjectReference>\r
     <ProjectReference Include="../System.Data/System.Data-net_4_x.csproj">\r
       <Project>{EC439BB8-FFED-4A32-A05D-2FA3A70CAD64}</Project>\r
       <Name>System.Data-net_4_x</Name>\r
       <Project>{D5CDC09C-F19A-4811-A6C8-70F51CBFB644}</Project>\r
       <Name>System.Configuration-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../SMDiagnostics/SMDiagnostics-net_4_x.csproj">\r
+      <Project>{8B8C3ED9-96F9-49B3-B355-9FD3D29DD3AD}</Project>\r
+      <Name>SMDiagnostics-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index 7a3834dd93c94c871a4c0cbd973d0ea053c1a6b6..cda78a94112d9d0ccba703a3516833a184940830 100644 (file)
@@ -38,9 +38,6 @@ using System.Runtime.Serialization;
 using System.ServiceModel;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Runtime.Serialization
 {
index 6a9b66a6485cfa4b050f788b6ced91d33a28ae9c..394d7d48ad056c2ba8e5be0c6362cf86e978b8b1 100644 (file)
@@ -44,7 +44,6 @@ using System.Xml.Serialization;
 using Microsoft.CSharp;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 using QName = System.Xml.XmlQualifiedName;
 
@@ -67,7 +66,7 @@ namespace MonoTests.System.Runtime.Serialization
                        var type = exporter.Schemas.GlobalTypes [typeName];
 
                        Assert.That (type, Is.Not.Null, "#2");
-                       Assert.That (type, Is.InstanceOfType (typeof (XmlSchemaComplexType)), "#3");
+                       Assert.IsInstanceOfType (typeof (XmlSchemaComplexType), type, "#3");
 
                        var complex = (XmlSchemaComplexType)type;
                        Assert.That (complex.Annotation, Is.Null, "#4");
@@ -83,16 +82,16 @@ namespace MonoTests.System.Runtime.Serialization
                        Assert.That (list, Is.Not.Null, "#6");
                        Assert.That (list.Annotation, Is.Null, "#6a");
                        Assert.That (list.Name, Is.EqualTo ("list"), "#6b");
-                       Assert.That (list.ElementSchemaType, Is.InstanceOfType (typeof (XmlSchemaComplexType)), "#6c");
+                       Assert.IsInstanceOfType (typeof (XmlSchemaComplexType), list.ElementSchemaType, "#6c");
 
                        var listElement = (XmlSchemaComplexType)list.ElementSchemaType;
                        Assert.That (listElement.QualifiedName.Namespace, Is.EqualTo (MSArraysNamespace), "#6d");
                        Assert.That (listElement.QualifiedName.Name, Is.EqualTo ("ArrayOfint"), "#6e");
 
-                       Assert.That (listElement.Particle, Is.InstanceOfType (typeof(XmlSchemaSequence)), "#7");
+                       Assert.IsInstanceOfType (typeof(XmlSchemaSequence), listElement.Particle, "#7");
                        var listSeq = (XmlSchemaSequence)listElement.Particle;
                        Assert.That (listSeq.Items.Count, Is.EqualTo (1), "#7b");
-                       Assert.That (listSeq.Items[0], Is.InstanceOfType (typeof(XmlSchemaElement)), "#7c");
+                       Assert.IsInstanceOfType (typeof(XmlSchemaElement), listSeq.Items[0], "#7c");
                        Assert.That (listSeq.Annotation, Is.Null, "#7d");
 
                        var listSeqElement = (XmlSchemaElement)listSeq.Items[0];
@@ -103,16 +102,16 @@ namespace MonoTests.System.Runtime.Serialization
                        Assert.That (dict, Is.Not.Null, "#8");
                        Assert.That (dict.Annotation, Is.Null, "#8a");
                        Assert.That (dict.Name, Is.EqualTo ("dictionary"), "#8b");
-                       Assert.That (dict.ElementSchemaType, Is.InstanceOfType (typeof (XmlSchemaComplexType)), "#8c");
+                       Assert.IsInstanceOfType (typeof (XmlSchemaComplexType), dict.ElementSchemaType, "#8c");
                        
                        var dictElement = (XmlSchemaComplexType)dict.ElementSchemaType;
                        Assert.That (dictElement.QualifiedName.Namespace, Is.EqualTo (MSArraysNamespace), "#8d");
                        Assert.That (dictElement.QualifiedName.Name, Is.EqualTo ("ArrayOfKeyValueOfstringdouble"), "#8e");
 
-                       Assert.That (dictElement.Particle, Is.InstanceOfType (typeof(XmlSchemaSequence)), "#9");
+                       Assert.IsInstanceOfType (typeof(XmlSchemaSequence), dictElement.Particle, "#9");
                        var dictSeq = (XmlSchemaSequence)dictElement.Particle;
                        Assert.That (dictSeq.Items.Count, Is.EqualTo (1), "#9b");
-                       Assert.That (dictSeq.Items[0], Is.InstanceOfType (typeof(XmlSchemaElement)), "#9c");
+                       Assert.IsInstanceOfType (typeof(XmlSchemaElement), dictSeq.Items[0], "#9c");
                        Assert.That (dictSeq.Annotation, Is.Null, "#9d");
                        
                        var dictSeqElement = (XmlSchemaElement)dictSeq.Items[0];
@@ -124,7 +123,7 @@ namespace MonoTests.System.Runtime.Serialization
                        Assert.That (custom, Is.Not.Null, "#10");
                        Assert.That (custom.Annotation, Is.Null, "#10a");
                        Assert.That (custom.Name, Is.EqualTo ("customCollection"), "#10b");
-                       Assert.That (custom.ElementSchemaType, Is.InstanceOfType (typeof (XmlSchemaComplexType)), "#10c");
+                       Assert.IsInstanceOfType (typeof (XmlSchemaComplexType), custom.ElementSchemaType, "#10c");
                        
                        var customElement = (XmlSchemaComplexType)custom.ElementSchemaType;
                        var customEQN = customElement.QualifiedName;
@@ -132,10 +131,10 @@ namespace MonoTests.System.Runtime.Serialization
                        Assert.That (customEQN.Name.StartsWith ("XsdDataContractExporterTest2.MyCollectionOfstring", StringComparison.InvariantCultureIgnoreCase),
                                     Is.True, "#10e");
 
-                       Assert.That (customElement.Particle, Is.InstanceOfType (typeof(XmlSchemaSequence)), "#11");
+                       Assert.IsInstanceOfType (typeof(XmlSchemaSequence), customElement.Particle, "#11");
                        var customSeq = (XmlSchemaSequence)customElement.Particle;
                        Assert.That (customSeq.Items.Count, Is.EqualTo (1), "#11b");
-                       Assert.That (customSeq.Items[0], Is.InstanceOfType (typeof(XmlSchemaElement)), "#11c");
+                       Assert.IsInstanceOfType (typeof(XmlSchemaElement), customSeq.Items[0], "#11c");
                        Assert.That (customSeq.Annotation, Is.Null, "#11d");
                        
                        var customSeqElement = (XmlSchemaElement)customSeq.Items[0];
index bee52d3e4f896eb4a66a1f00b47fe8b14c7b33b4..7e86906afe3b68b833efa3f65e439a6c9ebdd379 100644 (file)
@@ -43,7 +43,6 @@ using System.Xml.Serialization;
 using Microsoft.CSharp;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 using QName = System.Xml.XmlQualifiedName;
 
index 5c009acb56608c1d391e86faea97071af7e3f33e..145f30f4b6ccd9d7acf6a9c1650b765c85b89d6e 100644 (file)
@@ -2,8 +2,13 @@ thisdir = class/System.Security
 SUBDIRS = 
 include ../../build/rules.make
 
+ifndef NO_MONO_SECURITY
+MONO_SECURITY_DLL=$(the_libdir_base)/Mono.Security.dll
+MONO_SECURITY=Mono.Security
+endif
+
 LIBRARY = System.Security.dll
-LIB_REFS = secxml/System bare/System.Xml Mono.Security
+LIB_REFS = secxml/System bare/System.Xml $(MONO_SECURITY)
 LIB_MCS_FLAGS = -nowarn:618 \
        -d:SECURITY_DEP \
        -nowarn:414
@@ -22,7 +27,7 @@ EXTRA_DISTFILES = \
 
 include ../../build/library.make
 
-$(build_lib): $(secxml_libdir)/System.dll $(the_libdir_base)/Mono.Security.dll
+$(build_lib): $(secxml_libdir)/System.dll $(MONO_SECURITY_DLL)
 
 $(secxml_libdir)/System.dll:
        (cd ../System; $(MAKE) $@)
index c272c83959de1942c83c6adbfd1dce692475b279..f32de28306fa3000f2c45302b1f2b473390be16c 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,618,414</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
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;SECURITY_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,618,414</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;SECURITY_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e959175b7337b33974be70ec92e7506991727fd4..1431413d014ba3deae0db4135b3380f6e5da2d5c 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3f021276d449fd7fe9e12d6d8b883358c8b1328c..f487f95633cfdbdd4013dfe1292769451d91c3c5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 39e5a6128f2c71bb77153b2b7cc99392b8504400..b9c5a9d97fb4d4ed5574106a79bd0508f780e1b8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 35714061b5b859fc3855c3028d79876331eceba9..b8809b9423f17e4d8fc0ab3df0d7702205def875 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 6724c3786315a574fd46d4351ab2bb65fa561edf..037fbec4ef6b76cf8df434c49e71bb1ee84154a7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5;NET_3_0</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f25171f793f2c5b909b603bc30be8f6d48af81a5..909ae4f9cf04cc9c2cd483dfbe4d5e906e94e0bc 100644 (file)
@@ -48,7 +48,7 @@ namespace MonoTests.System.ServiceModel.Web
        public class WebOperationContextTest
        {
 // MonoTouch does not support dynamic proxy code generation.
-#if !MONOTOUCH
+#if !MONOTOUCH && !MOBILE_STATIC
                [Test]
 #endif
                public void Current ()
index 4f5776d2736f6c31b7b643c8b1daf42222dee08b..f4779a1e60091bee2892b2495ba22861888213a6 100644 (file)
@@ -82,4 +82,13 @@ using System.Runtime.InteropServices;
 
 #endif
 
+#if !MOBILE
+
+[assembly: TypeForwardedTo (typeof (System.ServiceModel.Security.BinarySecretKeyIdentifierClause))]
+[assembly: TypeForwardedTo (typeof (System.ServiceModel.Security.KeyNameIdentifierClause))]
+[assembly: TypeForwardedTo (typeof (System.ServiceModel.Security.SecurityContextKeyIdentifierClause))]
+[assembly: TypeForwardedTo (typeof (System.ServiceModel.Security.X509CertificateValidationMode))]
+[assembly: TypeForwardedTo (typeof (System.ServiceModel.Security.Tokens.BinarySecretSecurityToken))]
+[assembly: TypeForwardedTo (typeof (System.ServiceModel.Security.Tokens.WrappedKeySecurityToken))]
 
+#endif
index e986534126d2fbd8661da2b2f4ffe1acc5eb2a41..9927f67bbb0eeb9767a0b1de21bb48c424ff23e2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,414,169,67,3005,436,219,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;TRACE;NET_3_0;HAS_ACTIVATION</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;TRACE;NET_3_0;HAS_ACTIVATION</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,414,169,67,3005,436,219,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;TRACE;NET_3_0;HAS_ACTIVATION</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;TRACE;NET_3_0;HAS_ACTIVATION</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="System.ServiceModel.PeerResolvers\UnregisterInfo.cs" />\r
     <Compile Include="System.ServiceModel.PeerResolvers\UpdateInfo.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\AuthenticatorCommunicationObject.cs" />\r
-    <Compile Include="System.ServiceModel.Security.Tokens\BinarySecretSecurityToken.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\ClaimTypeRequirement.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\CommunicationSecurityTokenAuthenticator.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\CommunicationSecurityTokenProvider.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\DerivedKeySecurityToken.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\IIssuanceSecurityTokenAuthenticator.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\InitiatorServiceModelSecurityTokenRequirement.cs" />\r
-    <Compile Include="System.ServiceModel.Security.Tokens\InternalEncryptedKeyIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\ISecurityContextSecurityTokenCache.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\IssuedSecurityTokenHandler.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\IssuedSecurityTokenParameters.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\TlsClientSession.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\TlsServerSession.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\UserNameSecurityTokenParameters.cs" />\r
-    <Compile Include="System.ServiceModel.Security.Tokens\WrappedKeySecurityToken.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\X509SecurityTokenParameters.cs" />\r
     <Compile Include="System.ServiceModel.Security\BasicSecurityProfileVersion.cs" />\r
-    <Compile Include="System.ServiceModel.Security\BinarySecretKeyIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security\ChannelProtectionRequirements.cs" />\r
     <Compile Include="System.ServiceModel.Security\DataProtectionSecurityStateEncoder.cs" />\r
     <Compile Include="System.ServiceModel.Security\ExpiredSecurityTokenException.cs" />\r
     <Compile Include="System.ServiceModel.Security\IssuedTokenClientCredential.cs" />\r
     <Compile Include="System.ServiceModel.Security\IssuedTokenServiceCredential.cs" />\r
     <Compile Include="System.ServiceModel.Security\KeyEntropyMode.cs" />\r
-    <Compile Include="System.ServiceModel.Security\KeyNameIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security\MessagePartSpecification.cs" />\r
     <Compile Include="System.ServiceModel.Security\MessageProtectionOrder.cs" />\r
     <Compile Include="System.ServiceModel.Security\MessageSecurityException.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecureConversationVersion.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityAccessDeniedException.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityAlgorithmSuite.cs" />\r
-    <Compile Include="System.ServiceModel.Security\SecurityContextKeyIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityCredentialsManager.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityMessageProperty.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityNegotiationException.cs" />\r
     <Compile Include="System.ServiceModel\NamedPipeTransportSecurity.cs" />\r
     <Compile Include="System.ServiceModel\NetHttpBinding.cs" />\r
     <Compile Include="System.ServiceModel\NetHttpMessageEncoding.cs" />\r
+    <Compile Include="System.ServiceModel\NetHttpsBinding.cs" />\r
     <Compile Include="System.ServiceModel\NetMsmqBinding.cs" />\r
     <Compile Include="System.ServiceModel\NetMsmqSecurity.cs" />\r
     <Compile Include="System.ServiceModel\NetNamedPipeBinding.cs" />\r
       <Project>{D845AD9D-3CCB-49CB-9543-028678E94938}</Project>\r
       <Name>System.Runtime.Serialization-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../System.IdentityModel/System.IdentityModel-net_4_x.csproj">\r
+      <Project>{FA718FA9-32C2-4BAC-BAAB-DB3A7A326D4C}</Project>\r
+      <Name>System.IdentityModel-net_4_x</Name>\r
+    </ProjectReference>\r
     <ProjectReference Include="../System.Configuration/System.Configuration-net_4_x.csproj">\r
       <Project>{D5CDC09C-F19A-4811-A6C8-70F51CBFB644}</Project>\r
       <Name>System.Configuration-net_4_x</Name>\r
       <Project>{3ED36717-A9D1-4289-8949-9B7F39766DEB}</Project>\r
       <Name>System.Security-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../System.IdentityModel/System.IdentityModel-net_4_x.csproj">\r
-      <Project>{FA718FA9-32C2-4BAC-BAAB-DB3A7A326D4C}</Project>\r
-      <Name>System.IdentityModel-net_4_x</Name>\r
-    </ProjectReference>\r
     <ProjectReference Include="../System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_x.csproj">\r
       <Project>{BBA32980-B28C-476D-AEB0-892F1B1DFB5E}</Project>\r
       <Name>System.IdentityModel.Selectors-net_4_x</Name>\r
index 4608b887c5e188ac2bf80cecbc1120f93056a827..80ad61bc32b4a06b076de59bd87c5d935feb50d0 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,414,169,67,3005,436,219,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;TRACE;NET_3_0</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;TRACE;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,414,169,67,3005,436,219,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;TRACE;NET_3_0</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;TRACE;NET_3_0</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="System.ServiceModel.PeerResolvers\UnregisterInfo.cs" />\r
     <Compile Include="System.ServiceModel.PeerResolvers\UpdateInfo.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\AuthenticatorCommunicationObject.cs" />\r
-    <Compile Include="System.ServiceModel.Security.Tokens\BinarySecretSecurityToken.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\ClaimTypeRequirement.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\CommunicationSecurityTokenAuthenticator.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\CommunicationSecurityTokenProvider.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\DerivedKeySecurityToken.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\IIssuanceSecurityTokenAuthenticator.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\InitiatorServiceModelSecurityTokenRequirement.cs" />\r
-    <Compile Include="System.ServiceModel.Security.Tokens\InternalEncryptedKeyIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\ISecurityContextSecurityTokenCache.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\IssuedSecurityTokenHandler.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\IssuedSecurityTokenParameters.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\TlsClientSession.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\TlsServerSession.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\UserNameSecurityTokenParameters.cs" />\r
-    <Compile Include="System.ServiceModel.Security.Tokens\WrappedKeySecurityToken.cs" />\r
     <Compile Include="System.ServiceModel.Security.Tokens\X509SecurityTokenParameters.cs" />\r
     <Compile Include="System.ServiceModel.Security\BasicSecurityProfileVersion.cs" />\r
-    <Compile Include="System.ServiceModel.Security\BinarySecretKeyIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security\ChannelProtectionRequirements.cs" />\r
     <Compile Include="System.ServiceModel.Security\DataProtectionSecurityStateEncoder.cs" />\r
     <Compile Include="System.ServiceModel.Security\ExpiredSecurityTokenException.cs" />\r
     <Compile Include="System.ServiceModel.Security\IssuedTokenClientCredential.cs" />\r
     <Compile Include="System.ServiceModel.Security\IssuedTokenServiceCredential.cs" />\r
     <Compile Include="System.ServiceModel.Security\KeyEntropyMode.cs" />\r
-    <Compile Include="System.ServiceModel.Security\KeyNameIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security\MessagePartSpecification.cs" />\r
     <Compile Include="System.ServiceModel.Security\MessageProtectionOrder.cs" />\r
     <Compile Include="System.ServiceModel.Security\MessageSecurityException.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecureConversationVersion.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityAccessDeniedException.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityAlgorithmSuite.cs" />\r
-    <Compile Include="System.ServiceModel.Security\SecurityContextKeyIdentifierClause.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityCredentialsManager.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityMessageProperty.cs" />\r
     <Compile Include="System.ServiceModel.Security\SecurityNegotiationException.cs" />\r
     <Compile Include="System.ServiceModel\NamedPipeTransportSecurity.cs" />\r
     <Compile Include="System.ServiceModel\NetHttpBinding.cs" />\r
     <Compile Include="System.ServiceModel\NetHttpMessageEncoding.cs" />\r
+    <Compile Include="System.ServiceModel\NetHttpsBinding.cs" />\r
     <Compile Include="System.ServiceModel\NetMsmqBinding.cs" />\r
     <Compile Include="System.ServiceModel\NetMsmqSecurity.cs" />\r
     <Compile Include="System.ServiceModel\NetNamedPipeBinding.cs" />\r
       <Project>{D845AD9D-3CCB-49CB-9543-028678E94938}</Project>\r
       <Name>System.Runtime.Serialization-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../System.IdentityModel/System.IdentityModel-net_4_x.csproj">\r
+      <Project>{FA718FA9-32C2-4BAC-BAAB-DB3A7A326D4C}</Project>\r
+      <Name>System.IdentityModel-net_4_x</Name>\r
+    </ProjectReference>\r
     <ProjectReference Include="../System.Configuration/System.Configuration-net_4_x.csproj">\r
       <Project>{D5CDC09C-F19A-4811-A6C8-70F51CBFB644}</Project>\r
       <Name>System.Configuration-net_4_x</Name>\r
       <Project>{3ED36717-A9D1-4289-8949-9B7F39766DEB}</Project>\r
       <Name>System.Security-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../System.IdentityModel/System.IdentityModel-net_4_x.csproj">\r
-      <Project>{FA718FA9-32C2-4BAC-BAAB-DB3A7A326D4C}</Project>\r
-      <Name>System.IdentityModel-net_4_x</Name>\r
-    </ProjectReference>\r
     <ProjectReference Include="../System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_x.csproj">\r
       <Project>{BBA32980-B28C-476D-AEB0-892F1B1DFB5E}</Project>\r
       <Name>System.IdentityModel.Selectors-net_4_x</Name>\r
index 9fc6f5d921734451bac785798fd3f10364832135..598ce3940299614566c568117cf2aefd46c8fb4e 100644 (file)
@@ -201,13 +201,13 @@ namespace System.ServiceModel.Channels.NetTcp
                                        if (accept_handles.Count > 0)
                                                accept_handles [0].Set ();
                                }
-                       } catch {
+                       } catch (ObjectDisposedException) {
                                /* If an accept fails, just ignore it. Maybe the remote peer disconnected already */
                        } finally {
                                if (State == CommunicationState.Opened) {
                                        try {
                                                listener.BeginAcceptTcpClient (TcpListenerAcceptedClient, listener);
-                                       } catch {
+                                       } catch (ObjectDisposedException) {
                                                /* If this fails, we must have disposed the listener */
                                        }
                                }
index e8e10533584f1277fdcfea277cf69ca0bdb89415..8527e5c313419206b5ee66e7b38885e7a449c393 100644 (file)
@@ -53,7 +53,7 @@ namespace System.ServiceModel.Channels
                {
                        FaultCode fc = null;
                        FaultReason fr = null;
-                       object details = null;
+                       string actor = null;
                        XmlDictionaryReader r = message.GetReaderAtBodyContents ();
                        r.ReadStartElement ("Fault", message.Version.Envelope.Namespace);
                        r.MoveToContent ();
@@ -66,11 +66,13 @@ namespace System.ServiceModel.Channels
                                case "faultstring":
                                        fr = new FaultReason (r.ReadElementContentAsString());
                                        break;
-                               case "detail":
-                                       return new XmlReaderDetailMessageFault (message, r, fc, fr, null, null);
                                case "faultactor":
+                                       actor = r.ReadElementContentAsString();
+                                       break;
+                               case "detail":
+                                       return new XmlReaderDetailMessageFault (message, r, fc, fr, actor, null);
                                default:
-                                       throw new NotImplementedException ();
+                                       throw new XmlException (String.Format ("Unexpected node {0} name {1}", r.NodeType, r.Name));
                                }
                                r.MoveToContent ();
                        }
@@ -79,9 +81,7 @@ namespace System.ServiceModel.Channels
                        if (fr == null)
                                throw new XmlException ("Reason is missing in the Fault message");
 
-                       if (details == null)
-                               return CreateFault (fc, fr);
-                       return CreateFault (fc, fr, details);
+                       return new SimpleMessageFault (fc, fr, false, null, null, actor, null);
                }
 
                static MessageFault CreateFault12 (Message message, int maxBufferSize)
index 65b5c8cf38ae6913b2482b54609ecc8ee45064e4..f1a7ca308c058f0ec29cfea5e1516b933687a712 100644 (file)
@@ -364,8 +364,11 @@ namespace System.ServiceModel.Dispatcher
 
                        public void Start ()
                        {
-                               if (loop_thread == null)
+                               if (loop_thread == null) {
                                        loop_thread = new Thread (new ThreadStart (Loop));
+                                       loop_thread.IsBackground = true;
+                               }
+
                                loop_thread.Start ();
                        }
 
@@ -425,8 +428,10 @@ namespace System.ServiceModel.Dispatcher
                                        Logger.Warning (String.Format ("Channel listener '{0}' is not closed. Aborting.", owner.Listener.GetType ()));
                                        owner.Listener.Abort ();
                                }
-                               if (loop_thread != null && loop_thread.IsAlive)
-                                       loop_thread.Abort ();
+                               if (loop_thread != null && loop_thread.IsAlive) {
+                                       if (!loop_thread.Join (500))
+                                               loop_thread.Abort ();
+                               }
                                loop_thread = null;
                        }
 
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/BinarySecretSecurityToken.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/BinarySecretSecurityToken.cs
deleted file mode 100644 (file)
index 464c936..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// BinarySecretSecurityToken.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2006 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;
-using System.Collections.ObjectModel;
-using System.Xml;
-using System.IdentityModel.Policy;
-using System.IdentityModel.Tokens;
-
-namespace System.ServiceModel.Security.Tokens
-{
-       public class BinarySecretSecurityToken : SecurityToken
-       {
-               ReadOnlyCollection<SecurityKey> keys;
-
-               string id;
-               byte [] key;
-               bool allow_crypto;
-               DateTime valid_from = DateTime.Now.ToUniversalTime ();
-
-               BinarySecretSecurityToken (string id, bool allowCrypto)
-               {
-                       this.id = id;
-                       allow_crypto = allowCrypto;
-               }
-
-               public BinarySecretSecurityToken (byte [] key)
-                       : this ("uuid:" + Guid.NewGuid ().ToString (), key)
-               {
-               }
-
-               public BinarySecretSecurityToken (string id, byte [] key)
-                       : this (id, key, false)
-               {
-               }
-
-               protected BinarySecretSecurityToken (string id, byte [] key, bool allowCrypto)
-                       : this (id, allowCrypto)
-               {
-                       if (key == null)
-                               throw new ArgumentNullException ("key");
-                       this.key = key;
-
-                       SecurityKey [] arr = new SecurityKey [] {new InMemorySymmetricSecurityKey (key)};
-                       keys = new ReadOnlyCollection<SecurityKey> (arr);
-               }
-
-               public BinarySecretSecurityToken (int keySizeInBits)
-                       : this ("uuid:" + Guid.NewGuid ().ToString (), keySizeInBits)
-               {
-               }
-
-               public BinarySecretSecurityToken (string id, int keySizeInBits)
-                       : this (id, keySizeInBits, false)
-               {
-               }
-
-               protected BinarySecretSecurityToken (string id, int keySizeInBits, bool allowCrypto)
-                       : this (id, allowCrypto)
-               {
-                       if (keySizeInBits < 0)
-                               throw new ArgumentOutOfRangeException ("keySizeInBits");
-
-                       this.key = new byte [keySizeInBits >> 3 + (keySizeInBits % 8 == 0 ? 0 : 1)];
-
-                       SecurityKey [] arr = new SecurityKey [] {new InMemorySymmetricSecurityKey (key)};
-                       keys = new ReadOnlyCollection<SecurityKey> (arr);
-               }
-
-               public override DateTime ValidFrom {
-                       get { return valid_from; }
-               }
-
-               public override DateTime ValidTo {
-                       get { return DateTime.MaxValue.AddDays (-1); }
-               }
-
-               public override string Id {
-                       get { return id; }
-               }
-
-               public int KeySize {
-                       get { return key.Length; }
-               }
-
-               public override ReadOnlyCollection<SecurityKey> SecurityKeys {
-                       get { return keys; }
-               }
-
-               public byte [] GetKeyBytes ()
-               {
-                       return (byte []) key.Clone ();
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/InternalEncryptedKeyIdentifierClause.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/InternalEncryptedKeyIdentifierClause.cs
deleted file mode 100644 (file)
index 95e4334..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// InternalEncryptedKeyIdentifierClause.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2007 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;
-using System.Collections.ObjectModel;
-using System.Security.Cryptography.Xml;
-using System.Xml;
-using System.IdentityModel.Tokens;
-
-namespace System.ServiceModel.Security.Tokens
-{
-       internal class InternalEncryptedKeyIdentifierClause : BinaryKeyIdentifierClause
-       {
-               public InternalEncryptedKeyIdentifierClause (byte [] hash)
-                       : base (null, hash, false)
-               {
-               }
-
-               public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
-               {
-                       InternalEncryptedKeyIdentifierClause kic = keyIdentifierClause as InternalEncryptedKeyIdentifierClause;
-                       if (kic == null)
-                               return false;
-                       return Matches (kic.GetRawBuffer ());
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/WrappedKeySecurityToken.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Security.Tokens/WrappedKeySecurityToken.cs
deleted file mode 100644 (file)
index d3c47f2..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-//
-// WrappedKeySecurityToken.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2006 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;
-using System.Collections.ObjectModel;
-using System.Security.Cryptography;
-using System.Security.Cryptography.Xml;
-using System.Xml;
-using System.IdentityModel.Policy;
-using System.IdentityModel.Tokens;
-
-namespace System.ServiceModel.Security.Tokens
-{
-       public class WrappedKeySecurityToken : SecurityToken
-       {
-               string id;
-               byte [] raw_key;
-               byte [] wrapped_key;
-               string wrap_alg;
-               SecurityToken wrap_token;
-               SecurityKeyIdentifier wrap_token_ref;
-               DateTime valid_from = DateTime.Now.ToUniversalTime ();
-               ReadOnlyCollection<SecurityKey> keys;
-               ReferenceList reference_list;
-               byte [] keyhash;
-
-               public WrappedKeySecurityToken (
-                       string id,
-                       byte [] keyToWrap,
-                       string wrappingAlgorithm,
-                       SecurityToken wrappingToken,
-                       SecurityKeyIdentifier wrappingTokenReference)
-               {
-                       if (id == null)
-                               throw new ArgumentNullException ("id");
-                       if (keyToWrap == null)
-                               throw new ArgumentNullException ("keyToWrap");
-                       if (wrappingAlgorithm == null)
-                               throw new ArgumentNullException ("wrappingAlgorithm");
-                       if (wrappingToken == null)
-                               throw new ArgumentNullException ("wrappingToken");
-
-                       raw_key = keyToWrap;
-                       this.id = id;
-                       wrap_alg = wrappingAlgorithm;
-                       wrap_token = wrappingToken;
-                       wrap_token_ref = wrappingTokenReference;
-                       Collection<SecurityKey> l = new Collection<SecurityKey> ();
-                       foreach (SecurityKey sk in wrappingToken.SecurityKeys) {
-                               if (sk.IsSupportedAlgorithm (wrappingAlgorithm)) {
-                                       wrapped_key = sk.EncryptKey (wrappingAlgorithm, keyToWrap);
-                                       l.Add (new InMemorySymmetricSecurityKey (keyToWrap));
-                                       break;
-                               }
-                       }
-                       keys = new ReadOnlyCollection<SecurityKey> (l);
-                       if (wrapped_key == null)
-                               throw new ArgumentException (String.Format ("None of the security keys in the argument token supports specified wrapping algorithm '{0}'", wrappingAlgorithm));
-               }
-
-               internal byte [] RawKey {
-                       get { return raw_key; }
-               }
-
-               // It is kind of compromised solution to output
-               // ReferenceList inside e:EncryptedKey and might disappear
-               // when non-wrapped key is represented by another token type.
-               internal ReferenceList ReferenceList {
-                       get { return reference_list; }
-                       set { reference_list = value; }
-               }
-
-               public override DateTime ValidFrom {
-                       get { return valid_from; }
-               }
-
-               public override DateTime ValidTo {
-                       get { return DateTime.MaxValue.AddDays (-1); }
-               }
-
-               public override string Id {
-                       get { return id; }
-               }
-
-               public override ReadOnlyCollection<SecurityKey> SecurityKeys {
-                       get { return keys; }
-               }
-
-               public string WrappingAlgorithm {
-                       get { return wrap_alg; }
-               }
-
-               public SecurityToken WrappingToken {
-                       get { return wrap_token; }
-               }
-
-               public SecurityKeyIdentifier WrappingTokenReference {
-                       get { return wrap_token_ref; }
-               }
-
-               public byte [] GetWrappedKey ()
-               {
-                       return (byte []) wrapped_key.Clone ();
-               }
-
-               internal void SetWrappedKey (byte [] value)
-               {
-                       wrapped_key = (byte []) value.Clone ();
-               }
-
-               [MonoTODO]
-               public override bool CanCreateKeyIdentifierClause<T> ()
-               {
-                       /*
-                       foreach (SecurityKeyIdentifierClause k in WrappingTokenReference) {
-                               Type t = k.GetType ();
-                               if (t == typeof (T) || t.IsSubclassOf (typeof (T)))
-                                       return true;
-                       }
-                       */
-                       return false;
-               }
-
-               [MonoTODO]
-               public override T CreateKeyIdentifierClause<T> ()
-               {
-                       /*
-                       foreach (SecurityKeyIdentifierClause k in WrappingTokenReference) {
-                               Type t = k.GetType ();
-                               if (t == typeof (T) || t.IsSubclassOf (typeof (T)))
-                                       return (T) k;
-                       }
-                       */
-                       throw new NotSupportedException (String.Format ("WrappedKeySecurityToken cannot create '{0}'", typeof (T)));
-               }
-
-               public override bool MatchesKeyIdentifierClause (SecurityKeyIdentifierClause keyIdentifierClause)
-               {
-                       LocalIdKeyIdentifierClause lkic = keyIdentifierClause as LocalIdKeyIdentifierClause;
-                       if (lkic != null && lkic.LocalId == Id)
-                               return true;
-
-                       InternalEncryptedKeyIdentifierClause khic = keyIdentifierClause as InternalEncryptedKeyIdentifierClause;
-                       if (keyhash == null)
-                               keyhash = SHA1.Create ().ComputeHash (wrapped_key);
-                       if (khic != null && khic.Matches (keyhash))
-                               return true;
-
-                       return false;
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Security/BinarySecretKeyIdentifierClause.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Security/BinarySecretKeyIdentifierClause.cs
deleted file mode 100644 (file)
index 497d5c7..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// BinarySecretKeyIdentifierClause.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2006 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;
-using System.Collections.Generic;
-using System.Xml;
-using System.IdentityModel.Policy;
-using System.IdentityModel.Tokens;
-
-namespace System.ServiceModel.Security
-{
-       public class BinarySecretKeyIdentifierClause : BinaryKeyIdentifierClause
-       {
-               public BinarySecretKeyIdentifierClause (byte [] key)
-                       : this (key, true)
-               {
-               }
-
-               [MonoTODO ("ClauseType")]
-               public BinarySecretKeyIdentifierClause (byte [] key, bool cloneBuffer)
-                       : base ("", key, cloneBuffer)
-               {
-               }
-
-               [MonoTODO ("ClauseType")]
-               public BinarySecretKeyIdentifierClause (byte [] key, bool cloneBuffer, byte [] derivationNonce, int derivationLength)
-                       : base ("", key, cloneBuffer, derivationNonce, derivationLength)
-               {
-               }
-
-               public override bool CanCreateKey {
-                       get { return true; }
-               }
-
-               public byte [] GetKeyBytes ()
-               {
-                       return GetBuffer ();
-               }
-
-               public override SecurityKey CreateKey ()
-               {
-                       return new InMemorySymmetricSecurityKey (GetRawBuffer (), true);
-               }
-
-               public override bool Matches (SecurityKeyIdentifierClause clause)
-               {
-                       if (clause == null)
-                               throw new ArgumentNullException ("clause");
-                       BinarySecretKeyIdentifierClause other =
-                               clause as BinarySecretKeyIdentifierClause;
-                       if (other == null)
-                               return false;
-                       byte [] b1 = GetRawBuffer ();
-                       byte [] b2 = other.GetRawBuffer ();
-                       if (b1.Length != b2.Length)
-                               return false;
-                       for (int i = 0; i < b1.Length; i++)
-                               if (b1 [i] != b2 [i])
-                                       return false;
-                       return true;
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Security/KeyNameIdentifierClause.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Security/KeyNameIdentifierClause.cs
deleted file mode 100644 (file)
index ad7a84a..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// KeyNameIdentifierClause.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2006 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;
-using System.Collections.Generic;
-using System.Xml;
-using System.IdentityModel.Policy;
-using System.IdentityModel.Tokens;
-
-namespace System.ServiceModel.Security
-{
-       public class KeyNameIdentifierClause : SecurityKeyIdentifierClause
-       {
-               public KeyNameIdentifierClause (string keyName)
-                       : base (null)
-               {
-                       key_name = keyName;
-               }
-
-               string key_name;
-
-               public string KeyName {
-                       get { return key_name; }
-               }
-
-               public override bool Matches (SecurityKeyIdentifierClause clause)
-               {
-                       if (clause == null)
-                               throw new ArgumentNullException ("clause");
-                       KeyNameIdentifierClause knic =
-                               clause as KeyNameIdentifierClause;
-                       return knic != null && Matches (knic.KeyName);
-               }
-
-               public bool Matches (string keyName)
-               {
-                       return key_name == keyName;
-               }
-
-               public override string ToString ()
-               {
-                       return String.Concat ("KeyNameIdentifierClause(KeyName = '", KeyName, "')");
-               }
-       }
-}
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs
deleted file mode 100644 (file)
index 2ac33ba..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// SecurityContextKeyIdentifierClause.cs
-//
-// Author:
-//     Atsushi Enomoto <atsushi@ximian.com>
-//
-// Copyright (C) 2006 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.IdentityModel.Selectors;
-using System.IdentityModel.Tokens;
-using System.Xml;
-
-namespace System.ServiceModel.Security
-{
-       public class SecurityContextKeyIdentifierClause : SecurityKeyIdentifierClause
-       {
-               public SecurityContextKeyIdentifierClause (UniqueId contextId)
-                       : this (contextId, new UniqueId ())
-               {
-               }
-
-               public SecurityContextKeyIdentifierClause (UniqueId contextId, UniqueId generation)
-                       : this (contextId, generation, null, 0)
-               {
-               }
-
-               public SecurityContextKeyIdentifierClause (UniqueId contextId, UniqueId generation, byte [] derivationNonce, int derivationLength)
-                       : base (null, derivationNonce, derivationLength)
-               {
-                       this.context = contextId;
-                       this.generation = generation;
-               }
-
-               UniqueId context, generation;
-
-               public UniqueId ContextId {
-                       get { return context; }
-               }
-
-               public UniqueId Generation {
-                       get { return generation; }
-               }
-
-               public override bool Matches (
-                       SecurityKeyIdentifierClause keyIdentifierClause)
-               {
-                       SecurityContextKeyIdentifierClause other =
-                               keyIdentifierClause as SecurityContextKeyIdentifierClause;
-                       return  other != null && Matches (other.context, other.generation);
-               }
-
-               public bool Matches (UniqueId contextId, UniqueId generation)
-               {
-                       return context == contextId &&
-                               this.generation == generation;
-               }
-
-               [MonoTODO]
-               public override string ToString ()
-               {
-                       return base.ToString ();
-               }
-       }
-}
index 8e54cb5c622cfbb4f2f7f328292feb1605ee3d24..3f62fe4b035b325691c6d97569f7efc3284bae05 100644 (file)
@@ -726,7 +726,6 @@ System.ServiceModel.PeerResolvers/ServiceSettingsResponseInfo.cs
 System.ServiceModel.PeerResolvers/UnregisterInfo.cs
 System.ServiceModel.PeerResolvers/UpdateInfo.cs
 System.ServiceModel.Security.Tokens/AuthenticatorCommunicationObject.cs
-System.ServiceModel.Security.Tokens/BinarySecretSecurityToken.cs
 System.ServiceModel.Security.Tokens/ClaimTypeRequirement.cs
 System.ServiceModel.Security.Tokens/CommunicationSecurityTokenAuthenticator.cs
 System.ServiceModel.Security.Tokens/CommunicationSecurityTokenProvider.cs
@@ -734,7 +733,6 @@ System.ServiceModel.Security.Tokens/DerivedKeySecurityToken.cs
 System.ServiceModel.Security.Tokens/IIssuanceSecurityTokenAuthenticator.cs
 System.ServiceModel.Security.Tokens/ISecurityContextSecurityTokenCache.cs
 System.ServiceModel.Security.Tokens/InitiatorServiceModelSecurityTokenRequirement.cs
-System.ServiceModel.Security.Tokens/InternalEncryptedKeyIdentifierClause.cs
 System.ServiceModel.Security.Tokens/IssuedSecurityTokenHandler.cs
 System.ServiceModel.Security.Tokens/IssuedSecurityTokenParameters.cs
 System.ServiceModel.Security.Tokens/IssuedSecurityTokenProvider.cs
@@ -767,10 +765,8 @@ System.ServiceModel.Security.Tokens/SupportingTokenParameters.cs
 System.ServiceModel.Security.Tokens/TlsClientSession.cs
 System.ServiceModel.Security.Tokens/TlsServerSession.cs
 System.ServiceModel.Security.Tokens/UserNameSecurityTokenParameters.cs
-System.ServiceModel.Security.Tokens/WrappedKeySecurityToken.cs
 System.ServiceModel.Security.Tokens/X509SecurityTokenParameters.cs
 System.ServiceModel.Security/BasicSecurityProfileVersion.cs
-System.ServiceModel.Security/BinarySecretKeyIdentifierClause.cs
 System.ServiceModel.Security/ChannelProtectionRequirements.cs
 System.ServiceModel.Security/DataProtectionSecurityStateEncoder.cs
 System.ServiceModel.Security/ExpiredSecurityTokenException.cs
@@ -783,7 +779,6 @@ System.ServiceModel.Security/InfocardInteractiveChannelInitializer.cs
 System.ServiceModel.Security/IssuedTokenClientCredential.cs
 System.ServiceModel.Security/IssuedTokenServiceCredential.cs
 System.ServiceModel.Security/KeyEntropyMode.cs
-System.ServiceModel.Security/KeyNameIdentifierClause.cs
 System.ServiceModel.Security/MessagePartSpecification.cs
 System.ServiceModel.Security/MessageProtectionOrder.cs
 System.ServiceModel.Security/MessageSecurityException.cs
@@ -793,7 +788,6 @@ System.ServiceModel.Security/SecureConversationServiceCredential.cs
 System.ServiceModel.Security/SecureConversationVersion.cs
 System.ServiceModel.Security/SecurityAccessDeniedException.cs
 System.ServiceModel.Security/SecurityAlgorithmSuite.cs
-System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs
 System.ServiceModel.Security/SecurityCredentialsManager.cs
 System.ServiceModel.Security/SecurityMessageProperty.cs
 System.ServiceModel.Security/SecurityNegotiationException.cs
index d06cb33fe21c43bca6002a04358d3c9f0c28bbe9..c788a402138e04da469f0701d7f16f5e10fdcd91 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 NUnitMoonHelper.cs
 FeatureBased/Features.Client/AsyncCallTesterProxy.cs
 FeatureBased/Features.Client/AsyncPatternServer.cs
index b85b9f02f4cabc7f0e9893114b241ac472fe3dd0..8942c7abf32b4d63e8999cb126f4e63aca43b57a 100644 (file)
@@ -37,7 +37,6 @@ using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 using QName = System.Xml.XmlQualifiedName;
 using WS = System.Web.Services.Description;
@@ -91,7 +90,7 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                static void CheckSoapBinding (object extension, string transport, TestLabel label)
                {
                        label.EnterScope ("soap");
-                       Assert.That (extension, Is.InstanceOfType (typeof (WS.SoapBinding)), label.Get ());
+                       Assert.That (extension, Is.AssignableTo<WS.SoapBinding>(), label.Get ());
                        var soap = (WS.SoapBinding)extension;
                        Assert.That (soap.Style, Is.EqualTo (WS.SoapBindingStyle.Document), label.Get ());
                        Assert.That (soap.Transport, Is.EqualTo (transport), label.Get ());
@@ -107,9 +106,9 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                        label.EnterScope ("http");
 
                        if (security == BasicHttpSecurityMode.Message) {
-                               Assert.That (binding, Is.InstanceOfType (typeof(CustomBinding)), label.Get ());
+                               Assert.IsInstanceOfType (typeof(CustomBinding), binding, label.Get ());
                        } else {
-                               Assert.That (binding, Is.InstanceOfType (typeof(BasicHttpBinding)), label.Get ());
+                               Assert.IsInstanceOfType (typeof(BasicHttpBinding), binding, label.Get ());
                                var basicHttp = (BasicHttpBinding)binding;
                                Assert.That (basicHttp.EnvelopeVersion, Is.EqualTo (EnvelopeVersion.Soap11), label.Get ());
                                Assert.That (basicHttp.MessageVersion, Is.EqualTo (MessageVersion.Soap11), label.Get ());
@@ -157,7 +156,7 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                        label.EnterScope ("text");
                        if (encoding == WSMessageEncoding.Text) {
                                Assert.That (textElement, Is.Not.Null, label.Get ());
-                               Assert.That (textElement.WriteEncoding, Is.InstanceOfType (typeof(UTF8Encoding)), label.Get ());
+                               Assert.IsInstanceOfType (typeof(UTF8Encoding), textElement.WriteEncoding, label.Get ());
                        } else {
                                Assert.That (textElement, Is.Null, label.Get ());
                        }
@@ -409,9 +408,9 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                {
                        label.EnterScope ("net-tcp");
                        if (security == SecurityMode.Message) {
-                               Assert.That (binding, Is.InstanceOfType (typeof(CustomBinding)), label.Get ());
+                               Assert.IsInstanceOfType (typeof(CustomBinding), binding, label.Get ());
                        } else {
-                               Assert.That (binding, Is.InstanceOfType (typeof(NetTcpBinding)), label.Get ());
+                               Assert.IsInstanceOfType (typeof(NetTcpBinding), binding, label.Get ());
                                var netTcp = (NetTcpBinding)binding;
                                Assert.That (netTcp.EnvelopeVersion, Is.EqualTo (EnvelopeVersion.Soap12), label.Get ());
                                Assert.That (netTcp.MessageVersion, Is.EqualTo (MessageVersion.Soap12WSAddressing10), label.Get ());
@@ -751,7 +750,7 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                        foreach (var node in all.ChildNodes) {
                                if (node is XmlWhitespace)
                                        continue;
-                               Assert.That (node, Is.InstanceOfType (typeof (XmlElement)), label.ToString ());
+                               Assert.IsInstanceOfType (typeof (XmlElement), node, label.ToString ());
                                collection.Add ((XmlElement)node);
                        }
                        label.LeaveScope ();
@@ -789,7 +788,7 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                        label.EnterScope ("extensions");
                        Assert.That (op.Extensions, Is.Not.Null, label.Get ());
                        Assert.That (op.Extensions.Count, Is.EqualTo (1), label.Get ());
-                       Assert.That (op.Extensions [0], Is.InstanceOfType (typeof (WS.SoapOperationBinding)), label.Get ());
+                       Assert.That (op.Extensions [0], Is.AssignableTo<WS.SoapOperationBinding>(), label.Get ());
                        var soap = (WS.SoapOperationBinding)op.Extensions [0];
                        TestSoap (soap, soap12, label);
                        label.LeaveScope ();
@@ -821,7 +820,7 @@ namespace MonoTests.System.ServiceModel.MetadataTests {
                        Assert.That (binding.ExtensibleAttributes, Is.Null, label.Get ());
                        Assert.That (binding.Extensions, Is.Not.Null, label.Get ());
                        Assert.That (binding.Extensions.Count, Is.EqualTo (1), label.Get ());
-                       Assert.That (binding.Extensions [0], Is.InstanceOfType (typeof (WS.SoapBodyBinding)), label.Get ());
+                       Assert.That (binding.Extensions [0], Is.AssignableTo<WS.SoapBodyBinding> (), label.Get ());
                        var body = (WS.SoapBodyBinding)binding.Extensions [0];
                        TestSoapBody (body, soap12, label);
                        label.LeaveScope ();
index 3bd64b70dedce02d94b06b2bc65c923ab133c830..a4cbb9cd3eeaec39c008895366358e6a1369a4ce 100644 (file)
@@ -36,7 +36,6 @@ using WS = System.Web.Services.Description;
 
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 namespace MonoTests.System.ServiceModel.MetadataTests {
 
index f43655c573616811d5c737923109c124ff68edec..6262109c1169a09a5cd0235f4a543030c185db48 100644 (file)
@@ -34,7 +34,6 @@ using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 using WS = System.Web.Services.Description;
 
index 3a92db121d5f92b59acc561e9478754899d6638b..4da65c703a524f6083cc7aaac19ca97f9d44f09c 100644 (file)
@@ -34,7 +34,6 @@ using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 namespace MonoTests.System.ServiceModel.MetadataTests {
        
index f6656e5c7d9603377dd5858ecc08c32db865c4e8..1e5c270d988b57f7c15dab049c81c37097cf54a5 100644 (file)
@@ -34,7 +34,6 @@ using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 using WS = System.Web.Services.Description;
 
index 19560b9315095ec4183d79f33e2af1de49fe1114..2acf8f04b81cbaca4b5eeff56d230438f4853c66 100644 (file)
@@ -34,7 +34,6 @@ using System.ServiceModel.Description;
 using System.Text;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
-using NUnit.Framework.SyntaxHelpers;
 
 using TextElement = System.ServiceModel.Channels.TextMessageEncodingBindingElement;
 using BinaryElement = System.ServiceModel.Channels.BinaryMessageEncodingBindingElement;
index eae3d7ca74b439878c6a87619bd791926cb0cfcf..5c73c059324be5ac4dc2198f80e65d3454e77a59 100644 (file)
@@ -71,6 +71,7 @@ namespace MonoTests.System.ServiceModel.Channels
     <s:Fault>
       <faultcode>a:ActionNotSupported</faultcode>
       <faultstring xml:lang='en-US'>some error</faultstring>
+      <faultactor>Random</faultactor>
     </s:Fault>
   </s:Body>
 </s:Envelope>";
index 641a95852ee198c0bfd2d652495f9de556f8c91a..f7d30c63c3466ab403f9033814f6cfcc12eaa892 100644 (file)
@@ -105,23 +105,53 @@ namespace MonoTests.System.ServiceModel.Dispatcher
                                        Assert.AreEqual (5, p.ErrorCode, "#2");
                                        Assert.AreEqual ("foobarerror", p.Text, "#3");
                                }
+                       } finally {
+                               host.Close ();
+                       }
+               }
+
+               [Test]
+               public void FaultContractInfos_2 ()
+               {
+                       var host = new ServiceHost (typeof (TestFaultContract));
+                       int port = NetworkHelpers.FindFreePort ();
+                       host.Description.Behaviors.Find<ServiceDebugBehavior> ().IncludeExceptionDetailInFaults = false;
+                       host.AddServiceEndpoint (typeof (ITestFaultContract), new BasicHttpBinding (), new Uri ("http://localhost:" + port));
+                       host.Open ();
+                       try {
+                               var cf = new ChannelFactory<ITestFaultContract> (new BasicHttpBinding (), new EndpointAddress ("http://localhost:" + port));
+                               var cli = cf.CreateChannel ();
 
                                try {
                                        cli.Run ("deriveddata");
                                        Assert.Fail ("#4");
-                               } catch (Exception ex) {
+                               } catch (FaultException ex) {
                                        // The type must be explicitly listed in the [FaultContract],
                                        // it is not allowed to use a subclass of the exception data type.
-                                       Assert.AreEqual (typeof (FaultException), ex.GetType (), "#5");
                                }
+                       } finally {
+                               host.Close ();
+                       }
+               }
 
+               [Test]
+               public void FaultContractInfos_3 ()
+               {
+                       var host = new ServiceHost (typeof (TestFaultContract));
+                       int port = NetworkHelpers.FindFreePort ();
+                       host.Description.Behaviors.Find<ServiceDebugBehavior> ().IncludeExceptionDetailInFaults = false;
+                       host.AddServiceEndpoint (typeof (ITestFaultContract), new BasicHttpBinding (), new Uri ("http://localhost:" + port));
+                       host.Open ();
+                       try {
+                               var cf = new ChannelFactory<ITestFaultContract> (new BasicHttpBinding (), new EndpointAddress ("http://localhost:" + port));
+                               var cli = cf.CreateChannel ();
+                               
                                try {
                                        cli.Run ("derivedexception");
                                        Assert.Fail ("#6");
-                               } catch (Exception ex) {
+                               } catch (FaultException<PrivateAffairError> ex) {
                                        // However, it is allowed to derive from FaultException<T>, provided
                                        // that T is explicitly listed in [FaultContract].  Bug #7177.
-                                       Assert.AreEqual (typeof (FaultException<PrivateAffairError>), ex.GetType (), "#7");
                                }
                        } finally {
                                host.Close ();
index f5b081aeda63022867e832a90b824e1233c4e4d7..ea92e69528ec021e5fffb7903ed05bd982bb561e 100644 (file)
@@ -41,7 +41,6 @@ System.ServiceModel.Security/MessagePartSpecification.cs
 System.ServiceModel.Security/PeerCredential.cs
 System.ServiceModel.Security/ScopedMessagePartSpecification.cs
 System.ServiceModel.Security/SecurityAlgorithmSuite.cs
-System.ServiceModel.Security/SecurityContextKeyIdentifierClause.cs
 System.ServiceModel.Security/SecurityMessageProperty.cs
 System.ServiceModel.Security/SecurityStateEncoder.cs
 System.ServiceModel.Security/SecurityTokenAttachmentMode.cs
index ade3d4333395f267221663d4154f8c734a33f6aa..1efcefe3f864e2966d4b225ad005e934dced8f6e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index fee6147202eec4b96a90408dce6fe7519b55cfc1..11a62dd6529ccb39aaf2717850500d883de7f0a6 100644 (file)
@@ -390,17 +390,17 @@ namespace System.ServiceProcess
                                                        throw new Win32Exception (err);
                                                }
                                        } else {
-                                               int iPtr = buffer.ToInt32 ();
+                                               IntPtr iPtr = buffer;
 
                                                services = new ServiceController [servicesReturned];
                                                for (int i = 0; i < servicesReturned; i++) {
                                                        ENUM_SERVICE_STATUS serviceStatus = (ENUM_SERVICE_STATUS) Marshal.PtrToStructure (
-                                                               new IntPtr (iPtr), typeof (ENUM_SERVICE_STATUS));
+                                                               iPtr, typeof (ENUM_SERVICE_STATUS));
                                                        // TODO: use internal ctor that takes displayname too ?
                                                        services [i] = new ServiceController (serviceStatus.pServiceName,
                                                                machineName);
                                                        // move on to the next services
-                                                       iPtr += ENUM_SERVICE_STATUS.SizeOf;
+                                                       iPtr = IntPtr.Add(iPtr, ENUM_SERVICE_STATUS.SizeOf);
                                                }
 
                                                // we're done, so exit the loop
@@ -611,17 +611,17 @@ namespace System.ServiceProcess
                                                        throw new Win32Exception (err);
                                                }
                                        } else {
-                                               int iPtr = buffer.ToInt32 ();
+                                               IntPtr iPtr = buffer;
 
                                                services = new ServiceController [servicesReturned];
                                                for (int i = 0; i < servicesReturned; i++) {
                                                        ENUM_SERVICE_STATUS_PROCESS serviceStatus = (ENUM_SERVICE_STATUS_PROCESS) Marshal.PtrToStructure (
-                                                               new IntPtr (iPtr), typeof (ENUM_SERVICE_STATUS_PROCESS));
+                                                               iPtr, typeof (ENUM_SERVICE_STATUS_PROCESS));
                                                        // TODO: use internal ctor that takes displayname too
                                                        services [i] = new ServiceController (serviceStatus.pServiceName,
                                                                machineName);
                                                        // move on to the next services
-                                                       iPtr += ENUM_SERVICE_STATUS_PROCESS.SizeOf;
+                                                       iPtr = IntPtr.Add(iPtr, ENUM_SERVICE_STATUS_PROCESS.SizeOf);
                                                }
 
                                                // we're done, so exit the loop
index 6a85bfc9e8d22ac0068c5de552aa2012bbecaf92..23c4a7ed6b86a121e5d3aaf0a8fd216fca5748e0 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 System.ServiceProcess/ServiceBaseTest.cs
 System.ServiceProcess/ServiceControllerTest.cs
 System.ServiceProcess/ServiceControllerPermissionAttributeTest.cs
index 8f5b8f6000b50c1927c8e79c4b36e834fa09ca5b..9f5ae98d470b75b5c838143b69fda659de97fce2 100644 (file)
@@ -31,6 +31,7 @@
 // - Start
 
 using System;
+using System.Collections.Generic;
 using System.ComponentModel;
 using System.ServiceProcess;
 using TimeoutException = System.ServiceProcess.TimeoutException;
@@ -42,6 +43,58 @@ namespace MonoTests.System.ServiceProcess
        [TestFixture]
        public class ServiceControllerTest
        {
+               class ServiceInfo
+               {
+                       public string ServiceName;
+                       public string DisplayName;
+                       public ServiceType ServiceType = ServiceType.Win32ShareProcess;
+                       public string[] Dependents = new string[] {};
+                       public string[] DependedOn = new string[] {};
+               }
+
+               static ServiceInfo DISK_DRIVER_SERVICE = new ServiceInfo { ServiceName = "disk", DisplayName = "Disk Driver", ServiceType = ServiceType.KernelDriver };
+               static ServiceInfo ROUTING_AND_REMOTE_ACCESS_SERVICE = new ServiceInfo { ServiceName = "RemoteAccess", DisplayName = "Routing and Remote Access", DependedOn = new [] { "bfe", "http", "rasman", "rpcss" } };
+               static ServiceInfo SECONDARY_LOGON_SERVICE = new ServiceInfo { ServiceName = "seclogon", DisplayName = "Secondary Logon", Dependents = new [] { "te.service" } };
+               static ServiceInfo SECURITY_ACCOUNTS_MANAGER_SERVICE = new ServiceInfo { ServiceName = "SamSs", DisplayName = "Security Accounts Manager", Dependents = new [] { "browser", "ktmrm", "lanmanserver", "msdtc" }, DependedOn = new [] { "rpcss" } };
+               static ServiceInfo WINDOWS_IMAGE_ACQUISITION_SERVICE = new ServiceInfo { ServiceName = "stisvc", DisplayName = "Windows Image Acquisition (WIA)", ServiceType = ServiceType.Win32OwnProcess, DependedOn = new [] { "rpcss" } };
+               static ServiceInfo WINDOWS_SEARCH_SERVICE = new ServiceInfo { ServiceName = "WSearch", DisplayName = "Windows Search", ServiceType = ServiceType.Win32OwnProcess, Dependents = new [] { "wmpnetworksvc", "workfolderssvc" }, DependedOn = new [] { "rpcss" } };
+               static ServiceInfo WINDOWS_TIME_SERVICE = new ServiceInfo { ServiceName = "W32Time", DisplayName = "Windows Time" };
+               static ServiceInfo WINDOWS_UPDATE_SERVICE = new ServiceInfo { ServiceName = "wuauserv", DisplayName = "Windows Update", DependedOn = new [] { "rpcss" } };
+               static ServiceInfo WORKSTATION_SERVICE = new ServiceInfo { ServiceName = "LanmanWorkstation", DisplayName = "Workstation", Dependents = new [] { "browser", "netlogon", "sessionenv" }, DependedOn = new [] { "bowser", "mrxsmb20", "nsi" } };
+
+               // A service which is expected to be disabled by default on all supported Windows versions.
+               static ServiceInfo DISABLED_SERVICE = ROUTING_AND_REMOTE_ACCESS_SERVICE;
+               // A service which is running by default and can be stopped/paused by the current user when running with admin rights.
+               static ServiceInfo CONTROLLABLE_SERVICE = WINDOWS_IMAGE_ACQUISITION_SERVICE;
+               // A service which cannot be stopped/paused.
+               static ServiceInfo UNCONTROLLABLE_SERVICE = SECURITY_ACCOUNTS_MANAGER_SERVICE;
+               // A service with ServiceType == KernelDriver
+               static ServiceInfo KERNEL_SERVICE = DISK_DRIVER_SERVICE;
+               // A service with ServiceType == Win32ShareProcess.
+               static ServiceInfo SHARE_PROCESS_SERVICE = WORKSTATION_SERVICE;
+
+               static ServiceInfo SERVICE_1_WITH_DEPENDENTS_AND_DEPENDED_ON = SECURITY_ACCOUNTS_MANAGER_SERVICE;
+               static ServiceInfo SERVICE_2_WITH_DEPENDENTS_AND_DEPENDED_ON = WINDOWS_SEARCH_SERVICE;
+               static ServiceInfo SERVICE_3_WITH_DEPENDENTS_AND_DEPENDED_ON = WORKSTATION_SERVICE;
+
+               static ServiceInfo SERVICE_WITH_MANY_DEPENDENTS = WORKSTATION_SERVICE;
+               static ServiceInfo SERVICE_WITH_ONE_DEPENDENT = SECONDARY_LOGON_SERVICE;
+               static ServiceInfo SERVICE_WITH_NO_DEPENDENTS = WINDOWS_TIME_SERVICE;
+
+               static ServiceInfo SERVICE_WITH_MANY_DEPENDED_ON = WORKSTATION_SERVICE;
+               static ServiceInfo SERVICE_WITH_ONE_DEPENDED_ON = WINDOWS_UPDATE_SERVICE;
+               static ServiceInfo SERVICE_WITH_NO_DEPENDED_ON = WINDOWS_TIME_SERVICE;
+
+               [TestFixtureSetUp]
+               public void FixtureSetUp ()
+               {
+                       try {
+                               EnsureServiceIsRunning (new ServiceController (CONTROLLABLE_SERVICE.ServiceName));
+                       } catch {
+                               Assert.Ignore ($"Failed to start the service '{CONTROLLABLE_SERVICE.DisplayName}'. Ensure you are running the tests with admin privileges.");
+                       }
+               }
+
                [Test]
                public void Constructor1 ()
                {
@@ -164,7 +217,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("lanmanworkstation");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName);
 
                        Assert.IsTrue (sc.CanPauseAndContinue, "#A1");
                        Assert.IsTrue (sc.CanShutdown, "#B1");
@@ -175,10 +228,10 @@ namespace MonoTests.System.ServiceProcess
 
                        ServiceController [] dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#D1");
-                       Assert.IsTrue (dependentServices.Length > 1, "#D2");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.Dependents, ServiceNames (dependentServices), "#D2");
 
                        Assert.IsNotNull (sc.DisplayName, "#E1");
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#E2");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.DisplayName, sc.DisplayName, "#E2");
 
                        Assert.IsNotNull (sc.MachineName, "#F1");
                        Assert.AreEqual (".", sc.MachineName, "#F2");
@@ -186,13 +239,13 @@ namespace MonoTests.System.ServiceProcess
                        sc.Refresh ();
 
                        Assert.IsNotNull (sc.ServiceName, "#G1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#G2");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.ServiceName, sc.ServiceName, "#G2");
 
                        ServiceController [] servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#H1");
-                       Assert.AreEqual (0, servicesDependedOn.Length, "#H2");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.DependedOn, ServiceNames (servicesDependedOn), "#H2");
 
-                       Assert.AreEqual (ServiceType.Win32ShareProcess, sc.ServiceType, "#I1");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.ServiceType, sc.ServiceType, "#I1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#J1");
                }
 
@@ -219,7 +272,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("workstation");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.DisplayName);
 
                        Assert.IsTrue (sc.CanPauseAndContinue, "#A1");
                        Assert.IsTrue (sc.CanShutdown, "#B1");
@@ -249,7 +302,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("lanmanworkstation");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName);
 
                        Assert.IsTrue (sc.CanPauseAndContinue, "#A1");
                        Assert.IsTrue (sc.CanShutdown, "#B1");
@@ -262,7 +315,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("lanmanworkstation",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                Environment.MachineName);
 
                        Assert.IsTrue (sc.CanPauseAndContinue, "#A1");
@@ -274,10 +327,10 @@ namespace MonoTests.System.ServiceProcess
 
                        ServiceController [] dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#D1");
-                       Assert.IsTrue (dependentServices.Length > 1, "#D2");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.Dependents, ServiceNames (dependentServices), "#D2");
 
                        Assert.IsNotNull (sc.DisplayName, "#E1");
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#E2");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.DisplayName, sc.DisplayName, "#E2");
 
                        Assert.IsNotNull (sc.MachineName, "#F1");
                        Assert.AreEqual (Environment.MachineName, sc.MachineName, "#F2");
@@ -285,13 +338,13 @@ namespace MonoTests.System.ServiceProcess
                        sc.Refresh ();
 
                        Assert.IsNotNull (sc.ServiceName, "#G1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#G2");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.ServiceName, sc.ServiceName, "#G2");
 
                        ServiceController [] servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#H1");
-                       Assert.AreEqual (0, servicesDependedOn.Length, "#H2");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.DependedOn, ServiceNames (servicesDependedOn), "#H2");
 
-                       Assert.AreEqual (ServiceType.Win32ShareProcess, sc.ServiceType, "#I1");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.ServiceType, sc.ServiceType, "#I1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#J1");
                }
 
@@ -299,7 +352,7 @@ namespace MonoTests.System.ServiceProcess
                public void Constructor3_MachineName_Empty ()
                {
                        try {
-                               new ServiceController ("alerter", string.Empty);
+                               new ServiceController (CONTROLLABLE_SERVICE.ServiceName, string.Empty);
                                Assert.Fail ("#1");
                        } catch (ArgumentException ex) {
                                // MachineName value  is invalid
@@ -316,7 +369,7 @@ namespace MonoTests.System.ServiceProcess
                public void Constructor3_MachineName_Null ()
                {
                        try {
-                               new ServiceController ("alerter", null);
+                               new ServiceController (CONTROLLABLE_SERVICE.ServiceName, null);
                                Assert.Fail ("#1");
                        } catch (ArgumentException ex) {
                                // MachineName value  is invalid
@@ -369,11 +422,11 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.IsTrue (sc.CanPauseAndContinue, "#1");
-                       sc.ServiceName = "SamSs";
+                       sc.ServiceName = UNCONTROLLABLE_SERVICE.ServiceName;
                        Assert.IsFalse (sc.CanPauseAndContinue, "#2");
-                       sc.DisplayName = "Workstation";
+                       sc.DisplayName = CONTROLLABLE_SERVICE.DisplayName;
                        Assert.IsTrue (sc.CanPauseAndContinue, "#3");
                        sc.MachineName = "doesnotexist";
                        try {
@@ -403,7 +456,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                bool canPauseAndContinue = sc.CanPauseAndContinue;
@@ -432,7 +485,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("NetDDE", ".");
+                       ServiceController sc1 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
                        Assert.IsFalse (sc1.CanPauseAndContinue);
                }
 
@@ -470,7 +523,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("SamSs", ".");
+                       ServiceController sc1 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.IsFalse (sc1.CanPauseAndContinue);
                }
 
@@ -480,7 +533,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#1");
                        Assert.IsTrue (sc.CanPauseAndContinue, "#2");
                }
@@ -491,8 +544,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -528,8 +581,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -584,11 +637,11 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.IsTrue (sc.CanShutdown, "#1");
-                       sc.ServiceName = "SamSs";
+                       sc.ServiceName = UNCONTROLLABLE_SERVICE.ServiceName;
                        Assert.IsFalse (sc.CanShutdown, "#2");
-                       sc.DisplayName = "Workstation";
+                       sc.DisplayName = CONTROLLABLE_SERVICE.DisplayName;
                        Assert.IsTrue (sc.CanShutdown, "#3");
                        sc.MachineName = "doesnotexist";
                        try {
@@ -618,7 +671,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                bool canShutdown = sc.CanShutdown;
@@ -647,7 +700,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("NetDDE", ".");
+                       ServiceController sc1 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
                        Assert.IsFalse (sc1.CanShutdown);
                }
 
@@ -685,7 +738,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("SamSs", ".");
+                       ServiceController sc1 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.IsFalse (sc1.CanShutdown);
                }
 
@@ -695,7 +748,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#1");
                        Assert.IsTrue (sc.CanShutdown, "#2");
                }
@@ -706,8 +759,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -743,8 +796,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -799,11 +852,11 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.IsTrue (sc.CanStop, "#1");
-                       sc.ServiceName = "SamSs";
+                       sc.ServiceName = UNCONTROLLABLE_SERVICE.ServiceName;
                        Assert.IsFalse (sc.CanStop, "#2");
-                       sc.DisplayName = "Workstation";
+                       sc.DisplayName = CONTROLLABLE_SERVICE.DisplayName;
                        Assert.IsTrue (sc.CanStop, "#3");
                        sc.MachineName = "doesnotexist";
                        try {
@@ -833,7 +886,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                bool canStop = sc.CanStop;
@@ -862,7 +915,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("NetDDE", ".");
+                       ServiceController sc1 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
                        Assert.IsFalse (sc1.CanStop);
                }
 
@@ -900,7 +953,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("SamSs", ".");
+                       ServiceController sc1 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.IsFalse (sc1.CanStop);
                }
 
@@ -910,7 +963,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#1");
                        Assert.IsTrue (sc.CanStop, "#2");
                }
@@ -921,8 +974,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -958,8 +1011,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -1014,8 +1067,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -1052,7 +1105,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                sc.Continue ();
@@ -1081,8 +1134,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("NetDDE", ".");
-                       ServiceController sc2 = new ServiceController ("NetDDE", ".");
+                       ServiceController sc1 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Stopped, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Stopped, sc2.Status, "#A2");
@@ -1094,7 +1147,7 @@ namespace MonoTests.System.ServiceProcess
                                // Cannot resume NetDDE service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                Assert.IsNotNull (ex.Message, "#B3");
-                               Assert.IsTrue (ex.Message.IndexOf ("NetDDE") != -1, "#B4");
+                               Assert.IsTrue (ex.Message.IndexOf (DISABLED_SERVICE.ServiceName) != -1, "#B4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -1145,8 +1198,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("SamSs", ".");
-                       ServiceController sc2 = new ServiceController ("SamSs", ".");
+                       ServiceController sc1 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -1155,10 +1208,10 @@ namespace MonoTests.System.ServiceProcess
                                sc1.Continue ();
                                Assert.Fail ("#B1");
                        } catch (InvalidOperationException ex) {
-                               // Cannot resume SamSs service on computer '.'
+                               // Cannot resume service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                Assert.IsNotNull (ex.Message, "#B3");
-                               Assert.IsTrue (ex.Message.IndexOf ("SamSs") != -1, "#B4");
+                               Assert.IsTrue (ex.Message.IndexOf (UNCONTROLLABLE_SERVICE.ServiceName) != -1, "#B4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -1181,8 +1234,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -1199,8 +1252,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -1219,10 +1272,10 @@ namespace MonoTests.System.ServiceProcess
                                sc1.Continue ();
                                Assert.Fail ("#D1");
                        } catch (InvalidOperationException ex) {
-                               // Cannot resume Schedule service on computer '.'
+                               // Cannot resume the service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#D2");
                                Assert.IsNotNull (ex.Message, "#D3");
-                               Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#D4");
+                               Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#D4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#D5");
                                Assert.IsNotNull (ex.InnerException, "#D6");
 
@@ -1271,52 +1324,52 @@ namespace MonoTests.System.ServiceProcess
                        ServiceController [] dependentServices = null;
 
                        // single dependent service
-                       sc = new ServiceController ("dmserver", ".");
+                       sc = new ServiceController (SERVICE_WITH_ONE_DEPENDENT.ServiceName, ".");
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#A1");
                        Assert.AreEqual (1, dependentServices.Length, "#A2");
-                       Assert.AreEqual ("dmadmin", dependentServices [0].ServiceName, "#A3");
+                       Assert.AreEqual (SERVICE_WITH_ONE_DEPENDENT.Dependents, ServiceNames (dependentServices), "#A3");
 
                        // modifying ServiceName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.ServiceName = "alerter";
+                       sc.ServiceName = SERVICE_WITH_NO_DEPENDENTS.ServiceName;
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#B1");
                        Assert.AreEqual (1, dependentServices.Length, "#B2");
-                       Assert.AreEqual ("dmadmin", dependentServices [0].ServiceName, "#B3");
+                       Assert.AreEqual (SERVICE_WITH_ONE_DEPENDENT.Dependents, ServiceNames (dependentServices), "#B3");
 
                        // modifying DisplayName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.DisplayName = "Spooler";
+                       sc.DisplayName = SERVICE_WITH_MANY_DEPENDENTS.DisplayName;
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#C1");
                        Assert.AreEqual (1, dependentServices.Length, "#C2");
-                       Assert.AreEqual ("dmadmin", dependentServices [0].ServiceName, "#C3");
+                       Assert.AreEqual (SERVICE_WITH_ONE_DEPENDENT.Dependents, ServiceNames (dependentServices), "#C3");
 
                        // modifying MachineName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
                        sc.MachineName = "doesnotexist";
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#D1");
-                       Assert.AreEqual (1, dependentServices.Length, "#D2");
-                       Assert.AreEqual ("dmadmin", dependentServices [0].ServiceName, "#D3");
+                       Assert.AreEqual (1, dependentServices.Length, "#D");
+                       Assert.AreEqual (SERVICE_WITH_ONE_DEPENDENT.Dependents, ServiceNames (dependentServices), "#D3");
 
                        // no dependent services
-                       sc = new ServiceController ("alerter", ".");
+                       sc = new ServiceController (SERVICE_WITH_NO_DEPENDENTS.ServiceName, ".");
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#E1");
                        Assert.AreEqual (0, dependentServices.Length, "#E2");
 
                        // modifying ServiceName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.ServiceName = "dmserver";
+                       sc.ServiceName = SERVICE_WITH_MANY_DEPENDENTS.ServiceName;
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#F1");
                        Assert.AreEqual (0, dependentServices.Length, "#F2");
 
                        // modifying DisplayName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.DisplayName = "Workstation";
+                       sc.DisplayName = SERVICE_WITH_ONE_DEPENDENT.DisplayName;
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#G1");
                        Assert.AreEqual (0, dependentServices.Length, "#G2");
@@ -1329,39 +1382,35 @@ namespace MonoTests.System.ServiceProcess
                        Assert.AreEqual (0, dependentServices.Length, "#H2");
 
                        // multiple dependent services
-                       sc = new ServiceController ("TapiSrv", ".");
+                       sc = new ServiceController (SERVICE_WITH_MANY_DEPENDENTS.ServiceName, ".");
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#I1");
-                       Assert.AreEqual (2, dependentServices.Length, "#I2");
-                       Assert.AreEqual ("RasAuto", dependentServices [0].ServiceName, "#I3");
-                       Assert.AreEqual ("RasMan", dependentServices [1].ServiceName, "#I4");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDENTS.Dependents.Length, dependentServices.Length, "#I2");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDENTS.Dependents, ServiceNames (dependentServices), "#I3");
 
                        // modifying ServiceName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.ServiceName = "spooler";
+                       sc.ServiceName = SERVICE_WITH_NO_DEPENDENTS.ServiceName;
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#J1");
-                       Assert.AreEqual (2, dependentServices.Length, "#J3");
-                       Assert.AreEqual ("RasAuto", dependentServices [0].ServiceName, "#J4");
-                       Assert.AreEqual ("RasMan", dependentServices [1].ServiceName, "#J5");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDENTS.Dependents.Length, dependentServices.Length, "#J3");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDENTS.Dependents, ServiceNames (dependentServices), "#J3");
 
                        // modifying DisplayName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.DisplayName = "Alerter";
+                       sc.DisplayName = SERVICE_WITH_ONE_DEPENDENT.DisplayName;
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#K1");
-                       Assert.AreEqual (2, dependentServices.Length, "#K2");
-                       Assert.AreEqual ("RasAuto", dependentServices [0].ServiceName, "#K3");
-                       Assert.AreEqual ("RasMan", dependentServices [1].ServiceName, "#K4");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDENTS.Dependents.Length, dependentServices.Length, "#K2");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDENTS.Dependents, ServiceNames (dependentServices), "#K3");
 
                        // modifying MachineName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
                        sc.MachineName = Environment.MachineName;
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#L1");
-                       Assert.AreEqual (2, dependentServices.Length, "#L2");
-                       Assert.AreEqual ("RasAuto", dependentServices [0].ServiceName, "#L3");
-                       Assert.AreEqual ("RasMan", dependentServices [1].ServiceName, "#L4");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDENTS.Dependents.Length, dependentServices.Length, "#L2");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDENTS.Dependents, ServiceNames (dependentServices), "#L3");
                }
 
                [Test]
@@ -1370,7 +1419,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("dmserver",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                ServiceController [] dependenServices = sc.DependentServices;
@@ -1399,11 +1448,10 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("NetDDE", ".");
+                       ServiceController sc = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
                        ServiceController [] dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#1");
-                       Assert.AreEqual (1, dependentServices.Length, "#2");
-                       Assert.AreEqual ("ClipSrv", dependentServices [0].ServiceName, "#3");
+                       Assert.AreEqual (DISABLED_SERVICE.Dependents, ServiceNames (dependentServices), "#2");
                }
 
                [Test]
@@ -1459,36 +1507,39 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
+                       var s1 = WORKSTATION_SERVICE;
+                       var s2 = WINDOWS_SEARCH_SERVICE;
+
                        ServiceController sc = new ServiceController ();
-                       sc.DisplayName = "workstation";
-                       Assert.AreEqual ("workstation", sc.DisplayName, "#A1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#A2");
+                       sc.DisplayName = s1.DisplayName.ToLower ();
+                       Assert.AreEqual (s1.DisplayName.ToLower (), sc.DisplayName, "#A1");
+                       Assert.AreEqual (s1.ServiceName, sc.ServiceName, "#A2");
 
-                       sc.DisplayName = "alerter";
-                       Assert.AreEqual ("alerter", sc.DisplayName, "#B1");
-                       Assert.AreEqual ("Alerter", sc.ServiceName, "#B2");
+                       sc.DisplayName = s2.DisplayName.ToLower ();
+                       Assert.AreEqual (s2.DisplayName.ToLower (), sc.DisplayName, "#B1");
+                       Assert.AreEqual (s2.ServiceName, sc.ServiceName, "#B2");
 
-                       sc = new ServiceController ("workstation");
-                       sc.DisplayName = "alerter";
-                       Assert.AreEqual ("alerter", sc.DisplayName, "#C1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#C2");
-                       Assert.AreEqual ("workstation", sc.DisplayName, "#C3");
+                       sc = new ServiceController (s1.DisplayName.ToLower ());
+                       sc.DisplayName = s2.DisplayName.ToLower ();
+                       Assert.AreEqual (s2.DisplayName.ToLower (), sc.DisplayName, "#C1");
+                       Assert.AreEqual (s1.ServiceName, sc.ServiceName, "#C2");
+                       Assert.AreEqual (s1.DisplayName.ToLower (), sc.DisplayName, "#C3");
 
-                       sc.DisplayName = "alerter";
-                       Assert.AreEqual ("alerter", sc.DisplayName, "#D1");
-                       Assert.AreEqual ("Alerter", sc.ServiceName, "#D2");
+                       sc.DisplayName = s2.DisplayName.ToLower ();
+                       Assert.AreEqual (s2.DisplayName.ToLower (), sc.DisplayName, "#D1");
+                       Assert.AreEqual (s2.ServiceName, sc.ServiceName, "#D2");
 
-                       sc.DisplayName = "workstation";
-                       Assert.AreEqual ("workstation", sc.DisplayName, "#E1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#E2");
+                       sc.DisplayName = s1.DisplayName;
+                       Assert.AreEqual (s1.DisplayName, sc.DisplayName, "#E1");
+                       Assert.AreEqual (s1.ServiceName, sc.ServiceName, "#E2");
 
-                       sc = new ServiceController ("workstation");
-                       Assert.AreEqual ("workstation", sc.DisplayName, "#F1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#F2");
+                       sc = new ServiceController (s1.DisplayName.ToLower ());
+                       Assert.AreEqual (s1.DisplayName.ToLower (), sc.DisplayName, "#F1");
+                       Assert.AreEqual (s1.ServiceName, sc.ServiceName, "#F2");
 
-                       sc.DisplayName = "Workstation";
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#G1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#G2");
+                       sc.DisplayName = s1.DisplayName;
+                       Assert.AreEqual (s1.DisplayName, sc.DisplayName, "#G1");
+                       Assert.AreEqual (s1.ServiceName, sc.ServiceName, "#G2");
                }
 
                [Test]
@@ -1497,7 +1548,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("dmserver",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                string displayName = sc.DisplayName;
@@ -1526,8 +1577,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("NetDDE", ".");
-                       Assert.AreEqual ("Network DDE", sc.DisplayName);
+                       ServiceController sc = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
+                       Assert.AreEqual (DISABLED_SERVICE.DisplayName, sc.DisplayName);
                }
 
                [Test]
@@ -1565,9 +1616,9 @@ namespace MonoTests.System.ServiceProcess
                                Assert.Ignore ("Running on Unix.");
 
                        ServiceController sc = new ServiceController ();
-                       sc.DisplayName = "workstation";
-                       Assert.AreEqual ("workstation", sc.DisplayName, "#A1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#A2");
+                       sc.DisplayName = WORKSTATION_SERVICE.DisplayName.ToLower ();
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName.ToLower (), sc.DisplayName, "#A1");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#A2");
                }
 
                [Test]
@@ -1611,10 +1662,10 @@ namespace MonoTests.System.ServiceProcess
                        Assert.AreEqual (string.Empty, sc.DisplayName, "#A1");
                        Assert.AreEqual (string.Empty, sc.ServiceName, "#A2");
 
-                       sc.DisplayName = "WorkStation";
+                       sc.DisplayName = WORKSTATION_SERVICE.DisplayName;
 
-                       Assert.AreEqual ("WorkStation", sc.DisplayName, "#B1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#B2");
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName, sc.DisplayName, "#B1");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#B2");
 
                        sc.DisplayName = string.Empty;
 
@@ -1629,7 +1680,7 @@ namespace MonoTests.System.ServiceProcess
                                Assert.Ignore ("Running on Unix.");
 
                        ServiceController sc = new ServiceController ();
-                       sc.DisplayName = "Alerter";
+                       sc.DisplayName = CONTROLLABLE_SERVICE.DisplayName;
                        try {
                                sc.DisplayName = null;
                                Assert.Fail ("#1");
@@ -1640,7 +1691,7 @@ namespace MonoTests.System.ServiceProcess
                                Assert.AreEqual ("value", ex.ParamName, "#5");
                                Assert.IsNull (ex.InnerException, "#6");
                        }
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#7");
+                       Assert.AreEqual (CONTROLLABLE_SERVICE.DisplayName, sc.DisplayName, "#7");
                }
 
                [Test]
@@ -1650,10 +1701,10 @@ namespace MonoTests.System.ServiceProcess
                                Assert.Ignore ("Running on Unix.");
 
                        ServiceController sc = new ServiceController ();
-                       sc.DisplayName = "lanmanworkstation";
-                       Assert.AreEqual ("lanmanworkstation", sc.DisplayName, "#A1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#A2");
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#A3");
+                       sc.DisplayName = WORKSTATION_SERVICE.ServiceName;
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.DisplayName, "#A1");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#A2");
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName, sc.DisplayName, "#A3");
                }
 
                [Test]
@@ -1662,7 +1713,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Disk", ".");
+                       ServiceController sc = new ServiceController (DISK_DRIVER_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        try {
@@ -1670,10 +1721,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_CONTINUE);
                                        Assert.Fail ("#B1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                        Assert.IsNotNull (ex.Message, "#B3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#B4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#B4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                        Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -1690,10 +1741,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_DEVICEEVENT);
                                        Assert.Fail ("#C1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#C2");
                                        Assert.IsNotNull (ex.Message, "#C3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#C4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#C4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#C5");
                                        Assert.IsNotNull (ex.InnerException, "#C6");
 
@@ -1710,10 +1761,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_HARDWAREPROFILECHANGE);
                                        Assert.Fail ("#D1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#D2");
                                        Assert.IsNotNull (ex.Message, "#D3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#D4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#D4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#D5");
                                        Assert.IsNotNull (ex.InnerException, "#D6");
 
@@ -1730,10 +1781,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_INTERROGATE);
                                        Assert.Fail ("#E1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#E2");
                                        Assert.IsNotNull (ex.Message, "#E3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#E4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#E4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#E5");
                                        Assert.IsNotNull (ex.InnerException, "#E6");
 
@@ -1750,10 +1801,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_NETBINDADD);
                                        Assert.Fail ("#F1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#F2");
                                        Assert.IsNotNull (ex.Message, "#F3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#F4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#F4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#F5");
                                        Assert.IsNotNull (ex.InnerException, "#F6");
 
@@ -1770,10 +1821,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_NETBINDDISABLE);
                                        Assert.Fail ("#G1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#G2");
                                        Assert.IsNotNull (ex.Message, "#G3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#G4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#G4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#G5");
                                        Assert.IsNotNull (ex.InnerException, "#G6");
 
@@ -1790,10 +1841,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_NETBINDENABLE);
                                        Assert.Fail ("#H1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#H2");
                                        Assert.IsNotNull (ex.Message, "#H3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#H4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#H4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#H5");
                                        Assert.IsNotNull (ex.InnerException, "#H6");
 
@@ -1810,10 +1861,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_NETBINDREMOVE);
                                        Assert.Fail ("#I1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#I2");
                                        Assert.IsNotNull (ex.Message, "#I3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#I4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#I4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#I5");
                                        Assert.IsNotNull (ex.InnerException, "#I6");
 
@@ -1830,10 +1881,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_PARAMCHANGE);
                                        Assert.Fail ("#J1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#J2");
                                        Assert.IsNotNull (ex.Message, "#J3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#J4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#J4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#J5");
                                        Assert.IsNotNull (ex.InnerException, "#J6");
 
@@ -1850,10 +1901,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_PAUSE);
                                        Assert.Fail ("#K1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#K2");
                                        Assert.IsNotNull (ex.Message, "#K3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#K4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#K4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#K5");
                                        Assert.IsNotNull (ex.InnerException, "#K6");
 
@@ -1870,10 +1921,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_POWEREVENT);
                                        Assert.Fail ("#L1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#L2");
                                        Assert.IsNotNull (ex.Message, "#L3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#L4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#L4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#L5");
                                        Assert.IsNotNull (ex.InnerException, "#L6");
 
@@ -1890,10 +1941,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_SESSIONCHANGE);
                                        Assert.Fail ("#M1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#M2");
                                        Assert.IsNotNull (ex.Message, "#M3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#M4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#M4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#M5");
                                        Assert.IsNotNull (ex.InnerException, "#M6");
 
@@ -1910,10 +1961,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_SHUTDOWN);
                                        Assert.Fail ("#N1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#N2");
                                        Assert.IsNotNull (ex.Message, "#N3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#N4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#N4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#N5");
                                        Assert.IsNotNull (ex.InnerException, "#N6");
 
@@ -1930,10 +1981,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_STOP);
                                        Assert.Fail ("#O1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#O2");
                                        Assert.IsNotNull (ex.Message, "#O3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Disk") != -1, "#O4");
+                                       Assert.IsTrue (ex.Message.IndexOf (DISK_DRIVER_SERVICE.ServiceName) != -1, "#O4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#O5");
                                        Assert.IsNotNull (ex.InnerException, "#O6");
 
@@ -1958,7 +2009,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_PAUSE);
@@ -1987,7 +2038,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        try {
@@ -1995,10 +2046,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (127);
                                        Assert.Fail ("#B1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                        Assert.IsNotNull (ex.Message, "#B3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#B4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#B4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                        Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -2018,10 +2069,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (256);
                                        Assert.Fail ("#C1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#C2");
                                        Assert.IsNotNull (ex.Message, "#C3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#C4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#C4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#C5");
                                        Assert.IsNotNull (ex.InnerException, "#C6");
 
@@ -2046,7 +2097,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        sc.Pause ();
@@ -2063,10 +2114,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (127);
                                        Assert.Fail ("#C1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#C2");
                                        Assert.IsNotNull (ex.Message, "#C3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#C4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#C4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#C5");
                                        Assert.IsNotNull (ex.InnerException, "#C6");
 
@@ -2091,7 +2142,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        try {
@@ -2099,10 +2150,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_CONTINUE);
                                        Assert.Fail ("#B1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                        Assert.IsNotNull (ex.Message, "#B3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#B4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#B4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                        Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -2119,10 +2170,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_DEVICEEVENT);
                                        Assert.Fail ("#C1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#C2");
                                        Assert.IsNotNull (ex.Message, "#C3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#C4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#C4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#C5");
                                        Assert.IsNotNull (ex.InnerException, "#C6");
 
@@ -2139,10 +2190,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_HARDWAREPROFILECHANGE);
                                        Assert.Fail ("#D1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#D2");
                                        Assert.IsNotNull (ex.Message, "#D3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#D4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#D4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#D5");
                                        Assert.IsNotNull (ex.InnerException, "#D6");
 
@@ -2159,10 +2210,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_INTERROGATE);
                                        Assert.Fail ("#E1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#E2");
                                        Assert.IsNotNull (ex.Message, "#E3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#E4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#E4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#E5");
                                        Assert.IsNotNull (ex.InnerException, "#E6");
 
@@ -2179,10 +2230,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_NETBINDADD);
                                        Assert.Fail ("#F1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#F2");
                                        Assert.IsNotNull (ex.Message, "#F3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#F4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#F4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#F5");
                                        Assert.IsNotNull (ex.InnerException, "#F6");
 
@@ -2199,10 +2250,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_NETBINDDISABLE);
                                        Assert.Fail ("#G1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#G2");
                                        Assert.IsNotNull (ex.Message, "#G3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#G4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#G4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#G5");
                                        Assert.IsNotNull (ex.InnerException, "#G6");
 
@@ -2219,10 +2270,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_NETBINDENABLE);
                                        Assert.Fail ("#H1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#H2");
                                        Assert.IsNotNull (ex.Message, "#H3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#H4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#H4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#H5");
                                        Assert.IsNotNull (ex.InnerException, "#H6");
 
@@ -2239,10 +2290,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_NETBINDREMOVE);
                                        Assert.Fail ("#I1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#I2");
                                        Assert.IsNotNull (ex.Message, "#I3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#I4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#I4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#I5");
                                        Assert.IsNotNull (ex.InnerException, "#I6");
 
@@ -2259,10 +2310,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_PARAMCHANGE);
                                        Assert.Fail ("#J1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#J2");
                                        Assert.IsNotNull (ex.Message, "#J3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#J4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#J4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#J5");
                                        Assert.IsNotNull (ex.InnerException, "#J6");
 
@@ -2279,10 +2330,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_PAUSE);
                                        Assert.Fail ("#K1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#K2");
                                        Assert.IsNotNull (ex.Message, "#K3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#K4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#K4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#K5");
                                        Assert.IsNotNull (ex.InnerException, "#K6");
 
@@ -2299,10 +2350,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_POWEREVENT);
                                        Assert.Fail ("#L1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#L2");
                                        Assert.IsNotNull (ex.Message, "#L3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#L4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#L4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#L5");
                                        Assert.IsNotNull (ex.InnerException, "#L6");
 
@@ -2319,10 +2370,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_SESSIONCHANGE);
                                        Assert.Fail ("#M1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#M2");
                                        Assert.IsNotNull (ex.Message, "#M3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#M4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#M4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#M5");
                                        Assert.IsNotNull (ex.InnerException, "#M6");
 
@@ -2339,10 +2390,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_SHUTDOWN);
                                        Assert.Fail ("#N1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#N2");
                                        Assert.IsNotNull (ex.Message, "#N3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#N4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#N4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#N5");
                                        Assert.IsNotNull (ex.InnerException, "#N6");
 
@@ -2359,10 +2410,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand ((int) SERVICE_CONTROL_TYPE.SERVICE_CONTROL_STOP);
                                        Assert.Fail ("#O1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#O2");
                                        Assert.IsNotNull (ex.Message, "#O3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#O4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#O4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#O5");
                                        Assert.IsNotNull (ex.InnerException, "#O6");
 
@@ -2415,7 +2466,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        sc.Pause ();
@@ -2440,7 +2491,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        sc.Pause ();
@@ -2452,10 +2503,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (127);
                                        Assert.Fail ("#B1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                        Assert.IsNotNull (ex.Message, "#B3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#B4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#B4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                        Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -2480,7 +2531,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        sc.Stop ();
@@ -2495,10 +2546,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (127);
                                        Assert.Fail ("#C1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#C2");
                                        Assert.IsNotNull (ex.Message, "#C3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#C4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#C4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#C5");
                                        Assert.IsNotNull (ex.InnerException, "#C6");
 
@@ -2515,10 +2566,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (128);
                                        Assert.Fail ("#D1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#D2");
                                        Assert.IsNotNull (ex.Message, "#D3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#D4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#D4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#D5");
                                        Assert.IsNotNull (ex.InnerException, "#D6");
 
@@ -2543,7 +2594,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        sc.Stop ();
@@ -2556,10 +2607,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (127);
                                        Assert.Fail ("#C1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                        Assert.IsNotNull (ex.Message, "#C3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#C4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#C4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#C5");
                                        Assert.IsNotNull (ex.InnerException, "#C6");
 
@@ -2576,10 +2627,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (128);
                                        Assert.Fail ("#D1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#D2");
                                        Assert.IsNotNull (ex.Message, "#D3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#D4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#D4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#D5");
                                        Assert.IsNotNull (ex.InnerException, "#D6");
 
@@ -2604,7 +2655,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule", ".");
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A");
 
                        sc.Stop ();
@@ -2614,10 +2665,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (127);
                                        Assert.Fail ("#B1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                        Assert.IsNotNull (ex.Message, "#B3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#B4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#B4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                        Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -2634,10 +2685,10 @@ namespace MonoTests.System.ServiceProcess
                                        sc.ExecuteCommand (128);
                                        Assert.Fail ("#C1");
                                } catch (InvalidOperationException ex) {
-                                       // Cannot control Schedule service on computer '.'
+                                       // Cannot control XXX service on computer '.'
                                        Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#C2");
                                        Assert.IsNotNull (ex.Message, "#C3");
-                                       Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#C4");
+                                       Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#C4");
                                        Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#C5");
                                        Assert.IsNotNull (ex.InnerException, "#C6");
 
@@ -2686,46 +2737,40 @@ namespace MonoTests.System.ServiceProcess
                        devices = ServiceController.GetDevices ();
                        Assert.IsNotNull (devices, "#A1");
 
-                       bool foundDisk = false;
-                       bool foundAlerter = false;
+                       bool foundKernelService = false;
+                       bool foundShareProcessService = false;
 
                        foreach (ServiceController sc in devices) {
-                               switch (sc.ServiceName) {
-                               case "Disk":
-                                       Assert.AreEqual ("Disk Driver", sc.DisplayName, "#A2");
+                               if (sc.ServiceName.ToLower () == KERNEL_SERVICE.ServiceName.ToLower ()) {
+                                       Assert.AreEqual (KERNEL_SERVICE.DisplayName, sc.DisplayName, "#A2");
                                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#A3");
-                                       foundDisk = true;
-                                       break;
-                               case "Alerter":
-                                       foundAlerter = true;
-                                       break;
+                                       foundKernelService = true;
+                               } else if (sc.ServiceName.ToLower () == SHARE_PROCESS_SERVICE.ServiceName.ToLower ()) {
+                                       foundShareProcessService = true;
                                }
                        }
 
-                       Assert.IsTrue (foundDisk, "#A4");
-                       Assert.IsFalse (foundAlerter, "#A5");
+                       Assert.IsTrue (foundKernelService, "#A4");
+                       Assert.IsFalse (foundShareProcessService, "#A5");
 
                        devices = ServiceController.GetDevices (Environment.MachineName);
                        Assert.IsNotNull (devices, "#B1");
 
-                       foundDisk = false;
-                       foundAlerter = false;
+                       foundKernelService = false;
+                       foundShareProcessService = false;
 
                        foreach (ServiceController sc in devices) {
-                               switch (sc.ServiceName) {
-                               case "Disk":
-                                       Assert.AreEqual ("Disk Driver", sc.DisplayName, "#B2");
+                               if (sc.ServiceName.ToLower () == KERNEL_SERVICE.ServiceName.ToLower ()) {
+                                       Assert.AreEqual (KERNEL_SERVICE.DisplayName, sc.DisplayName, "#B2");
                                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#B3");
-                                       foundDisk = true;
-                                       break;
-                               case "Alerter":
-                                       foundAlerter = true;
-                                       break;
+                                       foundKernelService = true;
+                               } else if (sc.ServiceName.ToLower () == SHARE_PROCESS_SERVICE.ServiceName.ToLower ()) {
+                                       foundShareProcessService = true;
                                }
                        }
 
-                       Assert.IsTrue (foundDisk, "#B4");
-                       Assert.IsFalse (foundAlerter, "#B5");
+                       Assert.IsTrue (foundKernelService, "#B4");
+                       Assert.IsFalse (foundShareProcessService, "#B5");
                }
 
                [Test]
@@ -2800,44 +2845,38 @@ namespace MonoTests.System.ServiceProcess
                        services = ServiceController.GetServices ();
                        Assert.IsNotNull (services, "#A1");
 
-                       bool foundDisk = false;
-                       bool foundWorkstation = false;
+                       bool foundKernelService = false;
+                       bool foundShareProcessService = false;
 
                        foreach (ServiceController sc in services) {
-                               switch (sc.ServiceName) {
-                               case "Disk":
-                                       foundDisk = true;
-                                       break;
-                               case "lanmanworkstation":
-                                       foundWorkstation = true;
-                                       break;
+                               if (sc.ServiceName.ToLower () == KERNEL_SERVICE.ServiceName.ToLower ()) {
+                                       foundKernelService = true;
+                               } else if (sc.ServiceName.ToLower () == SHARE_PROCESS_SERVICE.ServiceName.ToLower ()) {
+                                       foundShareProcessService = true;
                                }
                        }
 
-                       Assert.IsFalse (foundDisk, "#A4");
-                       Assert.IsTrue (foundWorkstation, "#A5");
+                       Assert.IsFalse (foundKernelService, "#A4");
+                       Assert.IsTrue (foundShareProcessService, "#A5");
 
                        services = ServiceController.GetServices (Environment.MachineName);
                        Assert.IsNotNull (services, "#B1");
 
-                       foundDisk = false;
-                       foundWorkstation = false;
+                       foundKernelService = false;
+                       foundShareProcessService = false;
 
                        foreach (ServiceController sc in services) {
-                               switch (sc.ServiceName) {
-                               case "Disk":
-                                       foundDisk = true;
-                                       break;
-                               case "lanmanworkstation":
-                                       Assert.AreEqual ("Workstation", sc.DisplayName, "#B2");
+                               if (sc.ServiceName.ToLower () == KERNEL_SERVICE.ServiceName.ToLower ()) {
+                                       foundKernelService = true;
+                               } else if (sc.ServiceName.ToLower () == SHARE_PROCESS_SERVICE.ServiceName.ToLower ()) {
+                                       Assert.AreEqual (SHARE_PROCESS_SERVICE.DisplayName, sc.DisplayName, "#B2");
                                        Assert.AreEqual (ServiceControllerStatus.Running, sc.Status, "#B3");
-                                       foundWorkstation = true;
-                                       break;
+                                       foundShareProcessService = true;
                                }
                        }
 
-                       Assert.IsFalse (foundDisk, "#B4");
-                       Assert.IsTrue (foundWorkstation, "#B5");
+                       Assert.IsFalse (foundKernelService, "#B4");
+                       Assert.IsTrue (foundShareProcessService, "#B5");
                }
 
                [Test]
@@ -2908,25 +2947,25 @@ namespace MonoTests.System.ServiceProcess
                                Assert.Ignore ("Running on Unix.");
 
                        ServiceController sc = new ServiceController ();
-                       sc.ServiceName = "alerter";
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#A1");
+                       sc.ServiceName = WORKSTATION_SERVICE.ServiceName;
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName, sc.DisplayName, "#A1");
                        Assert.AreEqual (".", sc.MachineName, "#A2");
-                       Assert.AreEqual ("alerter", sc.ServiceName, "#A3");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#A3");
 
                        sc.MachineName = Environment.MachineName;
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#B1");
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName, sc.DisplayName, "#B1");
                        Assert.AreEqual (Environment.MachineName, sc.MachineName, "#B2");
-                       Assert.AreEqual ("alerter", sc.ServiceName, "#B3");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#B3");
 
                        sc.MachineName = "doesnotexist";
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#C1");
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName, sc.DisplayName, "#C1");
                        Assert.AreEqual ("doesnotexist", sc.MachineName, "#C2");
-                       Assert.AreEqual ("alerter", sc.ServiceName, "#C3");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#C3");
 
                        sc.MachineName = "DoesNotExist";
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#D1");
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName, sc.DisplayName, "#D1");
                        Assert.AreEqual ("DoesNotExist", sc.MachineName, "#D2");
-                       Assert.AreEqual ("alerter", sc.ServiceName, "#D3");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#D3");
                }
 
                [Test]
@@ -2981,8 +3020,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -3012,7 +3051,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                sc.Pause ();
@@ -3041,8 +3080,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("NetDDE", ".");
-                       ServiceController sc2 = new ServiceController ("NetDDE", ".");
+                       ServiceController sc1 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Stopped, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Stopped, sc2.Status, "#A2");
@@ -3054,7 +3093,7 @@ namespace MonoTests.System.ServiceProcess
                                // Cannot pause NetDDE service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                Assert.IsNotNull (ex.Message, "#B3");
-                               Assert.IsTrue (ex.Message.IndexOf ("NetDDE") != -1, "#B4");
+                               Assert.IsTrue (ex.Message.IndexOf (DISABLED_SERVICE.ServiceName) != -1, "#B4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -3105,8 +3144,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("SamSs", ".");
-                       ServiceController sc2 = new ServiceController ("SamSs", ".");
+                       ServiceController sc1 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -3115,10 +3154,10 @@ namespace MonoTests.System.ServiceProcess
                                sc1.Pause ();
                                Assert.Fail ("#B1");
                        } catch (InvalidOperationException ex) {
-                               // Cannot pause SamSs service on computer '.'
+                               // Cannot pause XXX service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                Assert.IsNotNull (ex.Message, "#B3");
-                               Assert.IsTrue (ex.Message.IndexOf ("SamSs") != -1, "#B4");
+                               Assert.IsTrue (ex.Message.IndexOf (UNCONTROLLABLE_SERVICE.ServiceName) != -1, "#B4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -3141,8 +3180,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -3177,8 +3216,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -3197,10 +3236,10 @@ namespace MonoTests.System.ServiceProcess
                                sc1.Pause ();
                                Assert.Fail ("#D1");
                        } catch (InvalidOperationException ex) {
-                               // Cannot pause Schedule service on computer '.'
+                               // Cannot pause XXX service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#D2");
                                Assert.IsNotNull (ex.Message, "#D3");
-                               Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#D4");
+                               Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#D4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#D5");
                                Assert.IsNotNull (ex.InnerException, "#D6");
 
@@ -3249,39 +3288,32 @@ namespace MonoTests.System.ServiceProcess
                        ServiceController [] dependentServices = null;
                        ServiceController [] servicesDependedOn = null;
 
-                       sc = new ServiceController ("NetDDE", ".");
+                       sc = new ServiceController (SERVICE_1_WITH_DEPENDENTS_AND_DEPENDED_ON.ServiceName, ".");
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#A1");
-                       Assert.AreEqual (1, dependentServices.Length, "#A2");
-                       Assert.AreEqual ("ClipSrv", dependentServices [0].ServiceName, "#A3");
+                       Assert.AreEqual (SERVICE_1_WITH_DEPENDENTS_AND_DEPENDED_ON.Dependents, ServiceNames (dependentServices), "#A2");
                        servicesDependedOn = sc.ServicesDependedOn;
-                       Assert.IsNotNull (servicesDependedOn, "#A4");
-                       Assert.AreEqual (1, servicesDependedOn.Length, "#A5");
-                       Assert.AreEqual ("NetDDEDSDM", servicesDependedOn [0].ServiceName, "#A6");
+                       Assert.AreEqual (SERVICE_1_WITH_DEPENDENTS_AND_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#A3");
 
-                       sc.ServiceName = "rasman";
+                       sc.ServiceName = SERVICE_2_WITH_DEPENDENTS_AND_DEPENDED_ON.ServiceName;
                        sc.Refresh ();
 
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#B1");
-                       Assert.AreEqual (1, dependentServices.Length, "#B2");
-                       Assert.AreEqual ("RasAuto", dependentServices [0].ServiceName, "#B3");
+                       Assert.AreEqual (SERVICE_2_WITH_DEPENDENTS_AND_DEPENDED_ON.Dependents, ServiceNames (dependentServices), "#B2");
                        servicesDependedOn = sc.ServicesDependedOn;
-                       Assert.IsNotNull (servicesDependedOn, "#B4");
-                       Assert.AreEqual (1, servicesDependedOn.Length, "#B5");
-                       Assert.AreEqual ("Tapisrv", servicesDependedOn [0].ServiceName, "#B6");
+                       Assert.IsNotNull (servicesDependedOn, "#B3");
+                       Assert.AreEqual (SERVICE_2_WITH_DEPENDENTS_AND_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#A4");
 
-                       sc.DisplayName = "NetDDE";
+                       sc.DisplayName = SERVICE_3_WITH_DEPENDENTS_AND_DEPENDED_ON.ServiceName;
                        sc.Refresh ();
 
                        dependentServices = sc.DependentServices;
                        Assert.IsNotNull (dependentServices, "#C1");
-                       Assert.AreEqual (1, dependentServices.Length, "#C2");
-                       Assert.AreEqual ("ClipSrv", dependentServices [0].ServiceName, "#C3");
+                       Assert.AreEqual (SERVICE_3_WITH_DEPENDENTS_AND_DEPENDED_ON.Dependents, ServiceNames (dependentServices), "#C2");
                        servicesDependedOn = sc.ServicesDependedOn;
-                       Assert.IsNotNull (servicesDependedOn, "#C4");
-                       Assert.AreEqual (1, servicesDependedOn.Length, "#C5");
-                       Assert.AreEqual ("NetDDEDSDM", servicesDependedOn [0].ServiceName, "#C6");
+                       Assert.IsNotNull (servicesDependedOn, "#C3");
+                       Assert.AreEqual (SERVICE_3_WITH_DEPENDENTS_AND_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#C4");
                }
 
                [Test]
@@ -3290,7 +3322,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        sc.Refresh ();
                }
@@ -3311,8 +3343,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -3352,8 +3384,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -3404,8 +3436,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -3450,36 +3482,40 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
+                       var s1 = WORKSTATION_SERVICE;
+                       var s2 = WINDOWS_SEARCH_SERVICE;
+
                        ServiceController sc = new ServiceController ();
-                       sc.ServiceName = "lanmanworkstation";
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#A1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#A2");
+                       sc.ServiceName = s1.ServiceName;
+                       Assert.AreEqual (s1.DisplayName, sc.DisplayName, "#A1");
+                       Assert.AreEqual (s1.ServiceName, sc.ServiceName, "#A2");
 
-                       sc.ServiceName = "alerter";
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#B1");
-                       Assert.AreEqual ("alerter", sc.ServiceName, "#B2");
+                       sc.ServiceName = s2.ServiceName;
+                       Assert.AreEqual (s2.DisplayName, sc.DisplayName, "#B1");
+                       Assert.AreEqual (s2.ServiceName, sc.ServiceName, "#B2");
 
-                       sc = new ServiceController ("lanmanworkstation");
-                       sc.ServiceName = "alerter";
-                       Assert.AreEqual ("alerter", sc.ServiceName, "#C1");
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#C2");
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#C3");
+                       sc = new ServiceController (s1.ServiceName);
+                       sc.ServiceName = s2.ServiceName;
+                       Assert.AreEqual (s2.ServiceName, sc.ServiceName, "#C1");
+                       Assert.AreEqual (s2.DisplayName, sc.DisplayName, "#C2");
+                       Assert.AreEqual (s2.DisplayName, sc.DisplayName, "#C3");
 
-                       sc.ServiceName = "alerter";
-                       Assert.AreEqual ("alerter", sc.ServiceName, "#D1");
-                       Assert.AreEqual ("Alerter", sc.DisplayName, "#D2");
+                       sc.ServiceName = s2.ServiceName;
+                       Assert.AreEqual (s2.ServiceName, sc.ServiceName, "#D1");
+                       Assert.AreEqual (s2.DisplayName, sc.DisplayName, "#D2");
 
-                       sc.ServiceName = "lanmanworkstation";
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#E1");
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#E2");
+                       sc.ServiceName = s1.ServiceName;
+                       Assert.AreEqual (s1.ServiceName, sc.ServiceName, "#E1");
+                       Assert.AreEqual (s1.DisplayName, sc.DisplayName, "#E2");
 
-                       sc = new ServiceController ("lanmanWorkstation");
-                       Assert.AreEqual ("lanmanWorkstation", sc.ServiceName, "#F1");
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#F2");
+                       sc = new ServiceController (s1.ServiceName.ToUpper ());
+                       Assert.AreEqual (s1.ServiceName.ToUpper (), sc.ServiceName, "#F1");
+                       Assert.AreEqual (s1.DisplayName, sc.DisplayName, "#F2");
 
-                       sc.ServiceName = "LanManWorkstation";
-                       Assert.AreEqual ("LanManWorkstation", sc.ServiceName, "#G1");
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#G2");
+                       var serviceName = s1.ServiceName [0].ToString ().ToUpper () + s1.ServiceName.Substring (1).ToLower ();
+                       sc.ServiceName = serviceName;
+                       Assert.AreEqual (serviceName, sc.ServiceName, "#G1");
+                       Assert.AreEqual (s1.DisplayName, sc.DisplayName, "#G2");
                }
 
                [Test]
@@ -3488,7 +3524,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("dmserver",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                string serviceName = sc.ServiceName;
@@ -3517,8 +3553,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("NetDDE", ".");
-                       Assert.AreEqual ("NetDDE", sc.ServiceName);
+                       ServiceController sc = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
+                       Assert.AreEqual (DISABLED_SERVICE.ServiceName, sc.ServiceName);
                }
 
                [Test]
@@ -3556,9 +3592,9 @@ namespace MonoTests.System.ServiceProcess
                                Assert.Ignore ("Running on Unix.");
 
                        ServiceController sc = new ServiceController ();
-                       sc.ServiceName = "lanmanworkstation";
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#2");
+                       sc.ServiceName = WORKSTATION_SERVICE.ServiceName;
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName, sc.DisplayName, "#1");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#2");
                }
 
                [Test]
@@ -3601,10 +3637,10 @@ namespace MonoTests.System.ServiceProcess
                        Assert.AreEqual (string.Empty, sc.DisplayName, "#A1");
                        Assert.AreEqual (string.Empty, sc.ServiceName, "#A2");
 
-                       sc.ServiceName = "lanmanworkstation";
+                       sc.ServiceName = WORKSTATION_SERVICE.ServiceName;
 
-                       Assert.AreEqual ("Workstation", sc.DisplayName, "#B1");
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#B2");
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName, sc.DisplayName, "#B1");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#B2");
 
                        try {
                                sc.ServiceName = string.Empty;
@@ -3628,7 +3664,7 @@ namespace MonoTests.System.ServiceProcess
                                Assert.Ignore ("Running on Unix.");
 
                        ServiceController sc = new ServiceController ();
-                       sc.ServiceName = "lanmanworkstation";
+                       sc.ServiceName = WORKSTATION_SERVICE.ServiceName;
                        try {
                                sc.ServiceName = null;
                                Assert.Fail ("#1");
@@ -3640,7 +3676,7 @@ namespace MonoTests.System.ServiceProcess
                                Assert.IsNull (ex.InnerException, "#6");
                        }
 
-                       Assert.AreEqual ("lanmanworkstation", sc.ServiceName, "#7");
+                       Assert.AreEqual (WORKSTATION_SERVICE.ServiceName, sc.ServiceName, "#7");
                }
 
                [Test]
@@ -3650,16 +3686,16 @@ namespace MonoTests.System.ServiceProcess
                                Assert.Ignore ("Running on Unix.");
 
                        ServiceController sc = new ServiceController ();
-                       sc.ServiceName = "workstation";
+                       sc.ServiceName = WORKSTATION_SERVICE.DisplayName.ToLower ();
                        try {
                                string displayName = sc.DisplayName;
                                Assert.Fail ("#1: " + displayName);
                        } catch (InvalidOperationException ex) {
-                               // Display name could not be retrieved for service workstation
+                               // Display name could not be retrieved for service XXX
                                // on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
                                Assert.IsNotNull (ex.Message, "#3");
-                               Assert.IsTrue (ex.Message.IndexOf ("workstation") != -1, "#4");
+                               Assert.IsTrue (ex.Message.IndexOf (WORKSTATION_SERVICE.DisplayName.ToLower ()) != -1, "#4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#5");
                                Assert.IsNotNull (ex.InnerException, "#6");
 
@@ -3671,7 +3707,7 @@ namespace MonoTests.System.ServiceProcess
                                Assert.AreEqual (1060, win32Error.NativeErrorCode, "#10");
                                Assert.IsNull (win32Error.InnerException, "#11");
                        }
-                       Assert.AreEqual ("workstation", sc.ServiceName, "#12");
+                       Assert.AreEqual (WORKSTATION_SERVICE.DisplayName.ToLower (), sc.ServiceName, "#12");
                }
 
                [Test]
@@ -3684,27 +3720,27 @@ namespace MonoTests.System.ServiceProcess
                        ServiceController [] servicesDependedOn = null;
 
                        // single depended service
-                       sc = new ServiceController ("spooler", ".");
+                       sc = new ServiceController (SERVICE_WITH_ONE_DEPENDED_ON.ServiceName, ".");
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#A1");
                        Assert.AreEqual (1, servicesDependedOn.Length, "#A2");
-                       Assert.AreEqual ("RPCSS", servicesDependedOn [0].ServiceName, "#A3");
+                       Assert.AreEqual (SERVICE_WITH_ONE_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#A3");
 
                        // modifying ServiceName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.ServiceName = "lanmanworkstation";
+                       sc.ServiceName = SERVICE_WITH_NO_DEPENDED_ON.ServiceName;
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#B1");
                        Assert.AreEqual (1, servicesDependedOn.Length, "#B2");
-                       Assert.AreEqual ("RPCSS", servicesDependedOn [0].ServiceName, "#B3");
+                       Assert.AreEqual (SERVICE_WITH_ONE_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#B3");
 
                        // modifying DisplayName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.DisplayName = "alerter";
+                       sc.DisplayName = SERVICE_WITH_MANY_DEPENDED_ON.DisplayName;
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#C1");
                        Assert.AreEqual (1, servicesDependedOn.Length, "#C2");
-                       Assert.AreEqual ("RPCSS", servicesDependedOn [0].ServiceName, "#C3");
+                       Assert.AreEqual (SERVICE_WITH_ONE_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#C3");
 
                        // modifying MachineName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
@@ -3712,24 +3748,24 @@ namespace MonoTests.System.ServiceProcess
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#D1");
                        Assert.AreEqual (1, servicesDependedOn.Length, "#D2");
-                       Assert.AreEqual ("RPCSS", servicesDependedOn [0].ServiceName, "#D3");
+                       Assert.AreEqual (SERVICE_WITH_ONE_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#D3");
 
                        // no depended services
-                       sc = new ServiceController ("lanmanworkstation", ".");
+                       sc = new ServiceController (SERVICE_WITH_NO_DEPENDED_ON.ServiceName, ".");
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#E1");
                        Assert.AreEqual (0, servicesDependedOn.Length, "#E2");
 
                        // modifying ServiceName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.ServiceName = "spooler";
+                       sc.ServiceName = SERVICE_WITH_MANY_DEPENDED_ON.ServiceName;
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#F1");
                        Assert.AreEqual (0, servicesDependedOn.Length, "#F2");
 
                        // modifying DisplayName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.DisplayName = "Alerter";
+                       sc.DisplayName = SERVICE_WITH_ONE_DEPENDED_ON.DisplayName;
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#G1");
                        Assert.AreEqual (0, servicesDependedOn.Length, "#G2");
@@ -3742,47 +3778,35 @@ namespace MonoTests.System.ServiceProcess
                        Assert.AreEqual (0, servicesDependedOn.Length, "#H2");
 
                        // multiple depended services
-                       sc = new ServiceController ("dmadmin", ".");
+                       sc = new ServiceController (SERVICE_WITH_MANY_DEPENDED_ON.ServiceName, ".");
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#I1");
-                       Assert.AreEqual (3, servicesDependedOn.Length, "#I2");
-                       // do not rely on the order of the services
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "RpcSs"), "#I3");
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "PlugPlay"), "#I4");
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "DmServer"), "#I5");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDED_ON.DependedOn.Length, servicesDependedOn.Length, "#I2");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#I3");
 
                        // modifying ServiceName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.ServiceName = "spooler";
+                       sc.ServiceName = SERVICE_WITH_NO_DEPENDED_ON.ServiceName;
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#J1");
-                       Assert.AreEqual (3, servicesDependedOn.Length, "#J2");
-                       // do not rely on the order of the services
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "RpcSs"), "#J3");
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "PlugPlay"), "#J4");
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "DmServer"), "#J5");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDED_ON.DependedOn.Length, servicesDependedOn.Length, "#J2");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#J3");
 
                        // modifying DisplayName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
-                       sc.DisplayName = "Alerter";
+                       sc.DisplayName = SERVICE_WITH_ONE_DEPENDED_ON.DisplayName;
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#K1");
-                       Assert.AreEqual (3, servicesDependedOn.Length, "#K2");
-                       // do not rely on the order of the services
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "RpcSs"), "#K3");
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "PlugPlay"), "#K4");
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "DmServer"), "#K5");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDED_ON.DependedOn.Length, servicesDependedOn.Length, "#K2");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#K3");
 
                        // modifying MachineName does not cause cache to be cleared:
                        // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=201762
                        sc.MachineName = Environment.MachineName;
                        servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#L1");
-                       Assert.AreEqual (3, servicesDependedOn.Length, "#L2");
-                       // do not rely on the order of the services
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "RpcSs"), "#L3");
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "PlugPlay"), "#L4");
-                       Assert.IsTrue (ContainsService (servicesDependedOn, "DmServer"), "#L5");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDED_ON.DependedOn.Length, servicesDependedOn.Length, "#L2");
+                       Assert.AreEqual (SERVICE_WITH_MANY_DEPENDED_ON.DependedOn, ServiceNames (servicesDependedOn), "#L3");
                }
 
                [Test]
@@ -3791,7 +3815,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("dmserver",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                ServiceController [] servicesDependedOn = sc.ServicesDependedOn;
@@ -3820,11 +3844,10 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("ClipSrv", ".");
+                       ServiceController sc = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
                        ServiceController [] servicesDependedOn = sc.ServicesDependedOn;
                        Assert.IsNotNull (servicesDependedOn, "#1");
-                       Assert.AreEqual (1, servicesDependedOn.Length, "#2");
-                       Assert.AreEqual ("NetDDE", servicesDependedOn [0].ServiceName, "#3");
+                       Assert.AreEqual (DISABLED_SERVICE.DependedOn, ServiceNames (servicesDependedOn), "#2");
                }
 
                [Test]
@@ -3882,11 +3905,11 @@ namespace MonoTests.System.ServiceProcess
 
                        ServiceController sc = null;
                        
-                       sc = new ServiceController ("dmserver", ".");
+                       sc = new ServiceController (SHARE_PROCESS_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceType.Win32ShareProcess, sc.ServiceType, "#A1");
-                       sc.ServiceName = "Disk";
+                       sc.ServiceName = KERNEL_SERVICE.ServiceName;
                        Assert.AreEqual (ServiceType.KernelDriver, sc.ServiceType, "#A2");
-                       sc.DisplayName = "Workstation";
+                       sc.DisplayName = SHARE_PROCESS_SERVICE.ServiceName;
                        Assert.AreEqual (ServiceType.Win32ShareProcess, sc.ServiceType, "#A3");
                        sc.MachineName = "doesnotexist";
                        try {
@@ -3909,13 +3932,13 @@ namespace MonoTests.System.ServiceProcess
                                Assert.IsNull (win32Error.InnerException, "#A13");
                        }
 
-                       sc = new ServiceController ("Disk", ".");
+                       sc = new ServiceController (KERNEL_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceType.KernelDriver, sc.ServiceType, "#B1");
-                       sc.DisplayName = "Alerter";
+                       sc.DisplayName = SHARE_PROCESS_SERVICE.DisplayName;
                        Assert.AreEqual (ServiceType.Win32ShareProcess, sc.ServiceType, "#B2");
                        sc.MachineName = Environment.MachineName;
                        Assert.AreEqual (ServiceType.Win32ShareProcess, sc.ServiceType, "#B3");
-                       sc.ServiceName = "Disk";
+                       sc.ServiceName = KERNEL_SERVICE.ServiceName;
                        Assert.AreEqual (ServiceType.KernelDriver, sc.ServiceType, "#B4");
                }
 
@@ -3925,7 +3948,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("dmserver",
+                       ServiceController sc = new ServiceController (SHARE_PROCESS_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                ServiceType serviceType = sc.ServiceType;
@@ -3954,7 +3977,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("NetDDE", ".");
+                       ServiceController sc = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
                        Assert.AreEqual (ServiceType.Win32ShareProcess, sc.ServiceType);
                }
 
@@ -3995,11 +4018,11 @@ namespace MonoTests.System.ServiceProcess
                        ServiceController sc = null;
 
                        sc = new ServiceController ();
-                       sc.DisplayName = "workstation";
+                       sc.DisplayName = SHARE_PROCESS_SERVICE.DisplayName.ToLower ();
                        Assert.AreEqual (ServiceType.Win32ShareProcess, sc.ServiceType, "#1");
 
                        sc = new ServiceController ();
-                       sc.DisplayName = "disk driver";
+                       sc.DisplayName = KERNEL_SERVICE.DisplayName.ToLower ();
                        Assert.AreEqual (ServiceType.KernelDriver, sc.ServiceType, "#2");
                }
 
@@ -4023,8 +4046,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -4054,7 +4077,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                sc.Stop ();
@@ -4083,8 +4106,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("NetDDE", ".");
-                       ServiceController sc2 = new ServiceController ("NetDDE", ".");
+                       ServiceController sc1 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Stopped, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Stopped, sc2.Status, "#A2");
@@ -4096,7 +4119,7 @@ namespace MonoTests.System.ServiceProcess
                                // Cannot stop NetDDE service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                Assert.IsNotNull (ex.Message, "#B3");
-                               Assert.IsTrue (ex.Message.IndexOf ("NetDDE") != -1, "#B4");
+                               Assert.IsTrue (ex.Message.IndexOf (DISABLED_SERVICE.ServiceName) != -1, "#B4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -4147,8 +4170,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("SamSs", ".");
-                       ServiceController sc2 = new ServiceController ("SamSs", ".");
+                       ServiceController sc1 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -4157,10 +4180,10 @@ namespace MonoTests.System.ServiceProcess
                                sc1.Stop ();
                                Assert.Fail ("#B1");
                        } catch (InvalidOperationException ex) {
-                               // Cannot stop SamSs service on computer '.'
+                               // Cannot stop XXX service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#B2");
                                Assert.IsNotNull (ex.Message, "#B3");
-                               Assert.IsTrue (ex.Message.IndexOf ("SamSs") != -1, "#B4");
+                               Assert.IsTrue (ex.Message.IndexOf (UNCONTROLLABLE_SERVICE.ServiceName) != -1, "#B4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#B5");
                                Assert.IsNotNull (ex.InnerException, "#B6");
 
@@ -4183,8 +4206,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -4224,8 +4247,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -4244,10 +4267,10 @@ namespace MonoTests.System.ServiceProcess
                                sc1.Stop ();
                                Assert.Fail ("#D1");
                        } catch (InvalidOperationException ex) {
-                               // Cannot stop Schedule service on computer '.'
+                               // Cannot stop XXX service on computer '.'
                                Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#D2");
                                Assert.IsNotNull (ex.Message, "#D3");
-                               Assert.IsTrue (ex.Message.IndexOf ("Schedule") != -1, "#D4");
+                               Assert.IsTrue (ex.Message.IndexOf (CONTROLLABLE_SERVICE.ServiceName) != -1, "#D4");
                                Assert.IsTrue (ex.Message.IndexOf ("'.'") != -1, "#D5");
                                Assert.IsNotNull (ex.InnerException, "#D6");
 
@@ -4292,8 +4315,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -4338,7 +4361,7 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc = new ServiceController ("Schedule",
+                       ServiceController sc = new ServiceController (CONTROLLABLE_SERVICE.ServiceName,
                                "doesnotexist");
                        try {
                                sc.WaitForStatus (ServiceControllerStatus.Stopped,
@@ -4368,8 +4391,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("NetDDE", ".");
-                       ServiceController sc2 = new ServiceController ("NetDDE", ".");
+                       ServiceController sc1 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (DISABLED_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Stopped, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Stopped, sc2.Status, "#A2");
@@ -4428,8 +4451,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("SamSs", ".");
-                       ServiceController sc2 = new ServiceController ("SamSs", ".");
+                       ServiceController sc1 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (UNCONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -4480,8 +4503,8 @@ namespace MonoTests.System.ServiceProcess
                        if (RunningOnUnix)
                                Assert.Ignore ("Running on Unix.");
 
-                       ServiceController sc1 = new ServiceController ("Schedule", ".");
-                       ServiceController sc2 = new ServiceController ("Schedule", ".");
+                       ServiceController sc1 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
+                       ServiceController sc2 = new ServiceController (CONTROLLABLE_SERVICE.ServiceName, ".");
 
                        Assert.AreEqual (ServiceControllerStatus.Running, sc1.Status, "#A1");
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#A2");
@@ -4503,6 +4526,28 @@ namespace MonoTests.System.ServiceProcess
                        Assert.AreEqual (ServiceControllerStatus.Running, sc2.Status, "#C2");
                }
 
+               // Run this on .NET to generate ServiceInfo objects for services on the current machine
+//             [Test]
+               public static void DumpServices ()
+               {
+                       foreach (ServiceController sc in ServiceController.GetServices ()) {
+                               try {
+                                       var si = new ServiceInfo { ServiceName = sc.ServiceName, DisplayName = sc.DisplayName, ServiceType = sc.ServiceType, Dependents = ServiceNames (sc.DependentServices), DependedOn = ServiceNames (sc.ServicesDependedOn) };
+                                       var l = new List<string> ();
+                                       l.Add ($"ServiceName = \"{si.ServiceName}\"");
+                                       l.Add ($"DisplayName = \"{si.DisplayName}\"");
+                                       if (si.ServiceType != ServiceType.Win32ShareProcess)
+                                               l.Add ($"ServiceType = ServiceType.{si.ServiceType}");
+                                       if (si.Dependents.Length > 0)
+                                               l.Add ("Dependents = new [] { \"" + String.Join ("\", \"", si.Dependents) + "\" }");
+                                       if (si.DependedOn.Length > 0)
+                                               l.Add ("DependedOn = new [] { \"" + String.Join ("\", \"", si.DependedOn) + "\" }");
+                                       Console.WriteLine ("static ServiceInfo " + si.DisplayName.ToUpper ().Replace (' ', '_').Replace ('-', '_') + "_SERVICE = new ServiceInfo { " + String.Join (", ", l) + " };");
+                               } catch {
+                               }
+                       }
+               }
+
                private static void EnsureServiceIsRunning (ServiceController sc)
                {
                        sc.Refresh ();
@@ -4543,6 +4588,15 @@ namespace MonoTests.System.ServiceProcess
                        return false;
                }
 
+               private static string[] ServiceNames (ServiceController [] services)
+               {
+                       var result = new string [services.Length];
+                       for (var i = 0; i < result.Length; i++)
+                               result [i] = services [i].ServiceName.ToLower ();
+                       Array.Sort<string> (result);
+                       return result;
+               }
+
                private bool RunningOnUnix
                {
                        get {
index a793bf739fc8c9d0daf85ee11da99df0082176aa..605835807d85e8a95a8669b17b01e61d19fa8a60 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONCURRENT_COLLECTIONS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONCURRENT_COLLECTIONS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONCURRENT_COLLECTIONS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONCURRENT_COLLECTIONS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index bec9f30a1884947be265b146bcbe9a14ad3d76e3..46953497fd3b0669a9f1d3339492d34c64df71ba 100644 (file)
@@ -131,7 +131,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (transform.Post (1));
                        Assert.IsTrue (transform.Post (2));
 
-                       Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1);
+                       AssertHelper.GreaterOrEqual (scheduler.ExecuteAll (), 1);
 
                        Assert.AreEqual (2, Volatile.Read (ref n));
                }
@@ -154,7 +154,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                        Assert.IsTrue (transform.Post (1));
                        Assert.IsTrue (transform.Post (2));
 
-                       Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1);
+                       AssertHelper.GreaterOrEqual (scheduler.ExecuteAll (), 1);
 
                        Assert.AreEqual (2, Volatile.Read (ref n));
                }
@@ -177,7 +177,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsFalse (transform.Post (101));
 
-                       Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1);
+                       AssertHelper.GreaterOrEqual (scheduler.ExecuteAll (), 1);
 
                        Assert.IsFalse (transform.Post (102));
 
index f897f06e23ec0462959abcb771decc277aa2ed6f..65ed145d72c40b9180e7655942714c806f95108e 100644 (file)
@@ -128,7 +128,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        Assert.IsNotNull (ex);
                        Assert.IsNotNull (ex.InnerException);
-                       Assert.IsInstanceOfType (typeof(OperationCanceledException),
+                       Assert.IsInstanceOfType (typeof(TaskCanceledException),
                                ex.InnerException);
                        Assert.IsTrue (task.IsCompleted);
                        Assert.AreEqual (TaskStatus.Canceled, task.Status);
index 6d87932058401cac0c2528c0ed6da421068ea900..087385c2ffc4f9e009a6d4815195fc2a9229cdc6 100644 (file)
@@ -90,7 +90,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                                var queue = new ConcurrentQueue<Tuple<int, int>> ();
                                var block = factory (queue);
 
-                               Assert.IsEmpty (queue);
+                               CollectionAssert.IsEmpty (queue);
 
                                for (int i = 0; i < 100; i++)
                                        block.Post (i);
@@ -170,15 +170,15 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                                options = new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 2 };
                                foreach (var taskIds in GetTaskIdsForExecutionsOptions (options))
-                                       Assert.LessOrEqual (CalculateDegreeOfParallelism (taskIds), 2);
+                                       AssertHelper.LessOrEqual (CalculateDegreeOfParallelism (taskIds), 2);
 
                                options = new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 4 };
                                foreach (var taskIds in GetTaskIdsForExecutionsOptions (options))
-                                       Assert.LessOrEqual (CalculateDegreeOfParallelism (taskIds), 4);
+                                       AssertHelper.LessOrEqual (CalculateDegreeOfParallelism (taskIds), 4);
 
                                options = new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = -1 };
                                foreach (var taskIds in GetTaskIdsForExecutionsOptions (options))
-                                       Assert.LessOrEqual (CalculateDegreeOfParallelism (taskIds), taskIds.Length);
+                                       AssertHelper.LessOrEqual (CalculateDegreeOfParallelism (taskIds), taskIds.Length);
                        }
                }
 
@@ -187,7 +187,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
                {
                        var options = new ExecutionDataflowBlockOptions ();
                        foreach (var taskIds in GetTaskIdsForExecutionsOptions (options))
-                               Assert.GreaterOrEqual (taskIds.Distinct ().Count (), 1);
+                               AssertHelper.GreaterOrEqual (taskIds.Distinct ().Count (), 1);
 
                        options = new ExecutionDataflowBlockOptions { MaxMessagesPerTask = 1 };
                        foreach (var taskIds in GetTaskIdsForExecutionsOptions (options))
@@ -195,11 +195,11 @@ namespace MonoTests.System.Threading.Tasks.Dataflow {
 
                        options = new ExecutionDataflowBlockOptions { MaxMessagesPerTask = 2 };
                        foreach (var taskIds in GetTaskIdsForExecutionsOptions (options))
-                               Assert.GreaterOrEqual (taskIds.Distinct ().Count (), taskIds.Length / 2);
+                               AssertHelper.GreaterOrEqual (taskIds.Distinct ().Count (), taskIds.Length / 2);
 
                        options = new ExecutionDataflowBlockOptions { MaxMessagesPerTask = 4 };
                        foreach (var taskIds in GetTaskIdsForExecutionsOptions (options))
-                               Assert.GreaterOrEqual (taskIds.Distinct ().Count (), taskIds.Length / 4);
+                               AssertHelper.GreaterOrEqual (taskIds.Distinct ().Count (), taskIds.Length / 4);
                }
 
                [Test]
index 0040fd6840b17b446d8eaca8e51b434d279d5b46..f41504c857ec237691508e4f5363609aba14dc9b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index b7bfc3e76b57a1ebd6138fa56004e6ad47b2fc75..ab01576214c284bf011e4b6981b612a013712d76 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 461643c497be3fb04509e909a0f06f17c22cc2cb..f9a9fb250f87cfb52c985e3037676f19d4edc093 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SYSTEM_WEB_APPLICATIONSERVICES</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;SYSTEM_WEB_APPLICATIONSERVICES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SYSTEM_WEB_APPLICATIONSERVICES</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;SYSTEM_WEB_APPLICATIONSERVICES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 84781bfe0b9fd06b4142c3fbf9493afc157f18b4..ebd674760cc8a02bc30c8906665e343940f658f2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f619c25efb836f13b1917d0271c2844403b5ec34..67e3e1a64087ed1f59f6793603081d499d3dc91c 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 ../../System.Web/Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/crc32.cs
 ../../System.Web/Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/Header.cs
 ../../System.Web/Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/HtmlAttribute.cs
@@ -71,7 +72,6 @@ Common/FooWithToString.cs
 Common/ITestDataContext.cs
 Common/KnownResponseHeader.cs
 Common/MiscExtensions.cs
-Common/Mocks.cs
 Common/MyDynamicDataRouteHandler.cs
 Common/MyHttpContextWrapper.cs
 Common/MyHttpRequestWrapper.cs
diff --git a/mcs/class/System.Web.DynamicData/Test/Common/Mocks.cs b/mcs/class/System.Web.DynamicData/Test/Common/Mocks.cs
deleted file mode 100644 (file)
index 5010769..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Web;
-
-using NUnit.Framework;
-using NUnit.Mocks;
-
-namespace MonoTests.Common
-{
-    static class Mocks
-    {
-     
-    }
-}
index cbd6a10a5331af005b1c8f7125f438a3818a7015..7f2d214ea49ef93befc1f62dec1af8d97e6d3357 100644 (file)
@@ -52,7 +52,6 @@ using System.Web.UI.WebControls;
 using System.IO;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
index b144e17e4ed64f676c0b9b7d9895ec0da0153d6a..b44c8bd9327ed8fcedede646fba2d66487cef16e 100644 (file)
@@ -47,7 +47,6 @@ using System.Web.DynamicData.ModelProviders;
 using System.Web.Routing;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
index 3954861970bb5b674e8c4d44ed149a535c14ceda..1151fb86612a273fe4d427e4c80eb0f29147ae99 100644 (file)
@@ -49,7 +49,6 @@ using System.Web.DynamicData.ModelProviders;
 using System.Web.Routing;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
index 6f5f4fdd3dc22f3f4879dad9fbec0357577deba5..0884c7a5cef1aa91ea4f05625d08844f98d1921c 100644 (file)
@@ -52,7 +52,6 @@ using System.Web.UI.WebControls;
 using System.IO;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
index 4398b8bf4f5e42b01efb1a3b3c26b6736fbc2f97..8362f3b6a96ccebb306b4c78c13b6a462737cfec 100644 (file)
@@ -52,7 +52,6 @@ using System.Web.UI.WebControls;
 using System.IO;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
@@ -647,7 +646,7 @@ namespace MonoTests.System.Web.DynamicData
                        // Custom with UIHint attribute
                        mc = t.GetColumn ("CustomColumn2");
                        Assert.IsNotNull (mc.UIHint, "#A2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#A2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#A2-1");
 
                        // Proves that UIHint on the column is not used, just the uiHint argument
                        AssertExtensions.Throws<InvalidOperationException> (() => {
@@ -669,7 +668,7 @@ namespace MonoTests.System.Web.DynamicData
                        // Custom with UIHint attribute
                        mc = t.GetColumn ("CustomColumn4");
                        Assert.IsNotNull (mc.UIHint, "#A4");
-                       Assert.Greater (mc.UIHint.Length, 0, "#A4-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#A4-1");
 
                        // Proves that UIHint on the column is not used, just the uiHint argument
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#A4-2");
@@ -686,7 +685,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("DateTimeColumn2");
                        Assert.IsNotNull (mc.UIHint, "#B2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#B2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#B2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "DateTime.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#B2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "DateTime.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#B2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "DateTime.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#B2-5");
@@ -701,7 +700,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("DateColumn2");
                        Assert.IsNotNull (mc.UIHint, "#C2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#C2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#C2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#C2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#C2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#C2-5");
@@ -715,7 +714,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("DateColumn4");
                        Assert.IsNotNull (mc.UIHint, "#C4");
-                       Assert.Greater (mc.UIHint.Length, 0, "#C4-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#C4-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#C4-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#C4-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#C4-5");
@@ -730,7 +729,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("TimeColumn2");
                        Assert.IsNotNull (mc.UIHint, "#D2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#D2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#D2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#D2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#D2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#D2-5");
@@ -745,7 +744,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("DurationColumn2");
                        Assert.IsNotNull (mc.UIHint, "#E2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#E2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#E2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#E2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#E2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#E2-5");
@@ -760,7 +759,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("PhoneNumberColumn2");
                        Assert.IsNotNull (mc.UIHint, "#F2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#F2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#F2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#F2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#F2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#F2-5");
@@ -775,7 +774,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("CurrencyColumn2");
                        Assert.IsNotNull (mc.UIHint, "#G2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#G2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#G2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#G2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#G2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#G2-5");
@@ -790,7 +789,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("TextColumn2");
                        Assert.IsNotNull (mc.UIHint, "#H2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#H2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#H2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#H2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#H2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#H2-5");
@@ -805,7 +804,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("HtmlColumn2");
                        Assert.IsNotNull (mc.UIHint, "#I2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#I2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#I2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#I2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#I2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#I2-5");
@@ -820,7 +819,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("MultilineTextColumn2");
                        Assert.IsNotNull (mc.UIHint, "#J2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#J2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#J2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#J2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#J2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#J2-5");
@@ -835,7 +834,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("EmailAddressColumn2");
                        Assert.IsNotNull (mc.UIHint, "#K2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#K2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#K2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#K2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#K2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#K2-5");
@@ -850,7 +849,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("PasswordColumn2");
                        Assert.IsNotNull (mc.UIHint, "#L2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#L2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#L2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#L2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#L2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#L2-5");
@@ -865,7 +864,7 @@ namespace MonoTests.System.Web.DynamicData
 
                        mc = t.GetColumn ("UrlColumn2");
                        Assert.IsNotNull (mc.UIHint, "#M2");
-                       Assert.Greater (mc.UIHint.Length, 0, "#M2-1");
+                       AssertHelper.Greater (mc.UIHint.Length, 0, "#M2-1");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#M2-3");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#M2-4");
                        Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#M2-5");
index 46de57ad76c287813c64267eddba63dfca055946..423237d1ec0fa6c95cc6227714325f5c37d3bee7 100644 (file)
@@ -52,7 +52,6 @@ using System.Web.UI.WebControls;
 using System.IO;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
index e2e1e24b1548853ef3371778c24f9b72d11284fe..17766eae14e236c4b4504c655c5e74893b112581 100644 (file)
@@ -47,7 +47,6 @@ using System.Web.DynamicData.ModelProviders;
 using System.Web.Routing;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
index fe43459bfc717f97c93a55496e08f2494c92474b..ed33152de0d52e743bc7730e216bfd4b764ccf33 100644 (file)
@@ -48,7 +48,6 @@ using System.Web.DynamicData.ModelProviders;
 using System.Web.Routing;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
index 76d528e4e790089e3eb0eddd9456c36a1a06858d..b51fb6d731401e2d57603bd85814325ed1a9eec9 100644 (file)
@@ -49,7 +49,6 @@ using System.Web.Routing;
 using System.Web.UI.WebControls;
 
 using NUnit.Framework;
-using NUnit.Mocks;
 using MonoTests.stand_alone.WebHarness;
 using MonoTests.SystemWeb.Framework;
 using MonoTests.Common;
index a812da1666512c6952fa26671fee20c038ae41f5..ce6be88aa1424c5b8c0889c59a7756364f51472b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d008409de93ceb62724eb093777654e53c135be9..67dc8fdf46681bdd4a72e018241a16ed0b10f965 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5;SYSTEM_WEB_EXTENSIONS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;SYSTEM_WEB_EXTENSIONS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_3_5;SYSTEM_WEB_EXTENSIONS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;SYSTEM_WEB_EXTENSIONS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 70ba4af74c2bc27f6ecfa11211b2903d7bd0c446..f22283343a92f66e00475acccf8aea07714a62e7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0d1b62859ab115e15eb8d255bd48d8bc45892522..01aa27d48e3b8809c7313d3dc4ef348e6508bc59 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index bb5c8db8c3f130b909c1ec27769405d46a3d5b92..560bd38bf071e1cc5ab99aacff0ab70807d46e84 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETMVC</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETMVC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index bc1337a2a49b2e6f2567798e58a082117311f748..9725f7b56f2538c3f0afbdcbb1eea8e9274c5ec2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 3b76937bb6285bddab64b7752f01287a29760775..e5c1fa6b2f81272e6fda9e948d919dd5c01224d2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7b693416b897c7b8a85bb37efb2b7daac80698a2..0cb68b46eedaed337ea34262b049edaa2e0a0ecd 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETWEBPAGES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETWEBPAGES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index be101eaa2a8a51643a79d308a6c3f2ec594b2908..e69a280b041ed17efab8290d979d60d3f392343e 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 4f47b14286db28704527e8d43ee27a23b454260c..7f1c39753d952c12ea7d80c5462b924226f30ea6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0dfc8236d4b1c71de2ee476616b03e9501c3b146..1dd86dcc1130c434b48c5fad2829c889ba34ec09 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,168,169,219,414,612,649</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_BROKEN_CONFIGURATION_DLL</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;MONO_BROKEN_CONFIGURATION_DLL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,168,169,219,414,612,649</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;MONO_BROKEN_CONFIGURATION_DLL</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;MONO_BROKEN_CONFIGURATION_DLL</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 6fd9784625d0608769e75495cab00b7179016e0d..1f047d204fba57afbe17fc9fc0a14a4ee950eadc 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETWEBPAGES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETWEBPAGES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9e427e5ed1a72fd8078481143287c386ab12e38a..ddeedce17b93474d74818bed04518e83eb9e3b49 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETWEBPAGES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETWEBPAGES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 28ca085172c7cc7f4344a6487b358146e755cdc0..c61327be0e5f8bf2db733c8f98fd45fe22069193 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETWEBPAGES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASPNETWEBPAGES</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASPNETWEBPAGES</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0b1699b80a47715877f7cebe3453c131b7eecf9d..d79222b2568b4116cbbd893a5fa383f446a859bd 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,612,618,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,612,618,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="..\referencesource\System.Web\Util\AssemblyUtil.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\BinaryCompatibility.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\DateTimeUtil.cs" />\r
+    <Compile Include="..\referencesource\System.Web\Util\Debug.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\DisposableAction.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\DoNotResetAttribute.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\EmptyCollection.cs" />\r
     <Compile Include="..\System.Windows.Forms\System.Resources\ResXResourceWriter.cs" />\r
     <Compile Include="..\System.Windows.Forms\System.Resources\SerializedFromResXHandler.cs" />\r
     <Compile Include="..\System.Windows.Forms\System.Resources\TypeConverterFromResXHandler.cs" />\r
+    <Compile Include="..\System\System\MonoToolsLocator.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="Mono.Web.Util\ISectionSettingsMapper.cs" />\r
     <Compile Include="Mono.Web.Util\MembershipSectionMapper.cs" />\r
index 9d2976f9148216411ff9d3a779ca5170c6bc5562..a4fc142507f8fb172f0fffe32673cc35c1bda716 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,612,618,618</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;INSIDE_SYSTEM_WEB</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;INSIDE_SYSTEM_WEB</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,612,618,618</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;INSIDE_SYSTEM_WEB</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;INSIDE_SYSTEM_WEB</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="..\referencesource\System.Web\Util\AssemblyUtil.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\BinaryCompatibility.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\DateTimeUtil.cs" />\r
+    <Compile Include="..\referencesource\System.Web\Util\Debug.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\DisposableAction.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\DoNotResetAttribute.cs" />\r
     <Compile Include="..\referencesource\System.Web\Util\EmptyCollection.cs" />\r
     <Compile Include="..\System.Windows.Forms\System.Resources\ResXResourceWriter.cs" />\r
     <Compile Include="..\System.Windows.Forms\System.Resources\SerializedFromResXHandler.cs" />\r
     <Compile Include="..\System.Windows.Forms\System.Resources\TypeConverterFromResXHandler.cs" />\r
+    <Compile Include="..\System\System\MonoToolsLocator.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="Mono.Web.Util\ISectionSettingsMapper.cs" />\r
     <Compile Include="Mono.Web.Util\MembershipSectionMapper.cs" />\r
index 09a2639d7355a6ccf51210dff4d46f49aac5124d..46f3627f416fa5f5342ba4ef05c35b8a56e65ba1 100644 (file)
@@ -2,7 +2,7 @@ Assembly/AssemblyInfo.cs
 ../../build/common/Consts.cs
 ../../build/common/Locale.cs
 ../../build/common/MonoTODOAttribute.cs
-../System/System/MonoExeLocator.cs
+../System/System/MonoToolsLocator.cs
 ../System.Windows.Forms/System.Resources/AssemblyNamesTypeResolutionService.cs
 ../System.Windows.Forms/System.Resources/ByteArrayFromResXHandler.cs
 ../System.Windows.Forms/System.Resources/ResXNullRef.cs
index 09bd670bd4d091650ebc39a84c89dd0aecf45ae7..47a1fa4a8dedb246bb0f5720262453c766a8b67f 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 Test/standalone-tests/Consts.cs
 Test/standalone-tests/Locations.cs
 Test/standalone-tests/OutputCacheProvider.cs
index 4416f5a698b9262d036092092c23f1b41e3585a4..70593c25d06a0d72c3314d40fad9d64d4688b7a0 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 ../../System.Web.DynamicData/Test/Common/AssertExtensions.cs
 mainsoft/MainsoftWebTest/HtmlAgilityPack/AssemblyInfo.cs
 mainsoft/MainsoftWebTest/HtmlAgilityPack/crc32.cs
index 22f3996e76bde65974fdc6873edf26fa350da26f..e240e4355ff5dc3e47b72d8ef5ec25369c05886e 100644 (file)
@@ -77,13 +77,13 @@ namespace MonoTests.System.Web.Hosting {
                        Assert.IsNull (HostingEnvironment.InitializationException, "During:InitializationException");
                        Assert.IsTrue (HostingEnvironment.IsHosted, "During:IsHosted");
                        Assert.IsNotNull (HostingEnvironment.ApplicationID, "During:ApplicationID:Null");
-                       Assert.IsNotEmpty (HostingEnvironment.ApplicationID, "During:ApplicationID:Empty");
+                       AssertHelper.IsNotEmpty (HostingEnvironment.ApplicationID, "During:ApplicationID:Empty");
                        Assert.IsNotNull (HostingEnvironment.ApplicationPhysicalPath, "During:ApplicationPhysicalPath:Null");
-                       Assert.IsNotEmpty (HostingEnvironment.ApplicationPhysicalPath, "During:ApplicationPhysicalPath:Empty");
+                       AssertHelper.IsNotEmpty (HostingEnvironment.ApplicationPhysicalPath, "During:ApplicationPhysicalPath:Empty");
                        Assert.IsNotNull (HostingEnvironment.ApplicationVirtualPath, "During:ApplicationVirtualPath:Null");
-                       Assert.IsNotEmpty (HostingEnvironment.ApplicationVirtualPath, "During:ApplicationVirtualPath:Empty");
+                       AssertHelper.IsNotEmpty (HostingEnvironment.ApplicationVirtualPath, "During:ApplicationVirtualPath:Empty");
                        Assert.IsNotNull (HostingEnvironment.SiteName, "During:SiteName:Null");
-                       Assert.IsNotEmpty (HostingEnvironment.SiteName, "During:SiteName:Empty");
+                       AssertHelper.IsNotEmpty (HostingEnvironment.SiteName, "During:SiteName:Empty");
                        Assert.IsNotNull (HostingEnvironment.Cache, "During:Cache");
                        Assert.AreEqual (ApplicationShutdownReason.None, HostingEnvironment.ShutdownReason, "During:ShutdownReason");
                        Assert.IsNotNull (HostingEnvironment.VirtualPathProvider, "During:VirtualPathProvider");
old mode 100644 (file)
new mode 100755 (executable)
index 0e1bb04..5e07845
@@ -57,7 +57,7 @@ namespace MonoTests.System.Web.UI.WebControls.Adapters
                        sw = new StringWriter();
                        w = new HtmlTextWriter(sw);
                        a.Render (w);
-                       Assert.AreEqual ("RenderBeginTag\nRenderContents\nRenderEndTag\n", sw.ToString(), "Render #1");
+                       Assert.AreEqual ("RenderBeginTag\nRenderContents\nRenderEndTag\n", sw.ToString().Replace ("\r", ""), "Render #1");
                        
                        
                        sw = new StringWriter();
old mode 100644 (file)
new mode 100755 (executable)
index fe1cb73..a40764b
@@ -91,21 +91,21 @@ namespace MonoTests.System.Web.UI.WebControls.Adapters
                public void RenderBeginTag ()
                {
                        a.RenderBeginTag (w);
-                       Assert.AreEqual ("RenderBeginTag\n", sw.ToString (), "RenderBeginTag #1");
+                       Assert.AreEqual ("RenderBeginTag\n", sw.ToString ().Replace ("\r", ""), "RenderBeginTag #1");
                }
 
                [Test]
                public void RenderContentsTag ()
                {
                        a.RenderContents (w);
-                       Assert.AreEqual ("RenderContents\n", sw.ToString (), "RenderContents #1");
+                       Assert.AreEqual ("RenderContents\n", sw.ToString ().Replace ("\r", ""), "RenderContents #1");
                }
 
                [Test]
                public void RenderEndTag ()
                {
                        a.RenderEndTag (w);
-                       Assert.AreEqual ("RenderEndTag\n", sw.ToString (), "RenderEndTag #1");
+                       Assert.AreEqual ("RenderEndTag\n", sw.ToString ().Replace ("\r", ""), "RenderEndTag #1");
                }
 
                [Test]
old mode 100644 (file)
new mode 100755 (executable)
index 12b2d0f..85f5040
@@ -63,28 +63,28 @@ namespace MonoTests.System.Web.UI.WebControls.Adapters
                public void RenderBeginTag ()
                {
                        a.RenderBeginTag (w);
-                       Assert.AreEqual ("RenderBeginTag\n", sw.ToString (), "RenderBeginTag #1");
+                       Assert.AreEqual ("RenderBeginTag\n", sw.ToString ().Replace ("\r", ""), "RenderBeginTag #1");
                }
 
                [Test]
                public void RenderContentsTag ()
                {
                        a.RenderContents (w);
-                       Assert.AreEqual ("RenderContents\n", sw.ToString (), "RenderContents #1");
+                       Assert.AreEqual ("RenderContents\n", sw.ToString ().Replace ("\r", ""), "RenderContents #1");
                }
 
                [Test]
                public void RenderEndTag ()
                {
                        a.RenderEndTag (w);
-                       Assert.AreEqual ("RenderEndTag\n", sw.ToString (), "RenderEndTag #1");
+                       Assert.AreEqual ("RenderEndTag\n", sw.ToString ().Replace ("\r", ""), "RenderEndTag #1");
                }
 
                [Test]
                public void Render ()
                {
                        a.Render (w);
-                       Assert.AreEqual ("RenderBeginTag\nRenderContents\nRenderEndTag\n", sw.ToString (), "Render #1");
+                       Assert.AreEqual ("RenderBeginTag\nRenderContents\nRenderEndTag\n", sw.ToString ().Replace ("\r", ""), "Render #1");
                }
                
                [Test]
old mode 100644 (file)
new mode 100755 (executable)
index f81a3a8..df2d711
@@ -1538,7 +1538,7 @@ namespace MonoTests.System.Web.UI.WebControls
                        Console.WriteLine ("----------------------------");
                        Console.WriteLine (renderedHtml);
                        
-                       Assert.AreEqual (origHtml, renderedHtml, "#A1");
+                       Assert.AreEqual (origHtml.Replace ("\r", ""), renderedHtml.Replace ("\r", ""), "#A1");
                }
 
                [Test]
@@ -1566,13 +1566,13 @@ namespace MonoTests.System.Web.UI.WebControls
                        string origHtml = "Header<table cellspacing=\"5\" cellpadding=\"5\">\r\n\t<tr>\r\n\t\t<td align=\"right\"><input type=\"submit\" name=\"MyWizard$StepNavigationTemplateContainerID$StepPreviousButton\" value=\"Previous\" id=\"MyWizard_StepNavigationTemplateContainerID_StepPreviousButton\" /></td><td align=\"right\"><input type=\"submit\" name=\"MyWizard$StepNavigationTemplateContainerID$StepNextButton\" value=\"Next\" id=\"MyWizard_StepNavigationTemplateContainerID_StepNextButton\" /></td>\n\t</tr>\n</table>Step";
                        string renderedHtml = HtmlDiff.GetControlFromPageHtml (result);
 
-                       Assert.AreEqual (origHtml, renderedHtml, "#A1");
+                       Assert.AreEqual (origHtml.Replace ("\r", ""), renderedHtml.Replace ("\r", ""), "#A1");
 
                        t.UserData = "RenderHeader_InSpan";
                        result = t.Run ();
                        origHtml = "Header<table cellspacing=\"5\" cellpadding=\"5\">\r\n\t<tr>\r\n\t\t<td align=\"right\"><input type=\"submit\" name=\"MyWizard$StepNavigationTemplateContainerID$StepPreviousButton\" value=\"Previous\" id=\"MyWizard_StepNavigationTemplateContainerID_StepPreviousButton\" /></td><td align=\"right\"><input type=\"submit\" name=\"MyWizard$StepNavigationTemplateContainerID$StepNextButton\" value=\"Next\" id=\"MyWizard_StepNavigationTemplateContainerID_StepNextButton\" /></td>\n\t</tr>\n</table>Step";
                        renderedHtml = HtmlDiff.GetControlFromPageHtml (result);
-                       Assert.AreEqual (origHtml, renderedHtml, "#A2");
+                       Assert.AreEqual (origHtml.Replace ("\r", ""), renderedHtml.Replace ("\r", ""), "#A2");
                }
 
                [Test]
index 2ce8621aec4781a1245a02df3114d4f7c8d3b030..0342a707978e4971ebe73e3217ea353d9be06a79 100644 (file)
@@ -547,7 +547,7 @@ namespace MonoTests.System.Web {
 
                        KnownResponseHeader known;
 
-                       Assert.LessOrEqual (1, f.KnownResponseHeaders.Count, "#B1");
+                       AssertHelper.LessOrEqual (1, f.KnownResponseHeaders.Count, "#B1");
 
                        known = (KnownResponseHeader)f.KnownResponseHeaders ["Content-Type"];
                        Assert.AreEqual (HttpWorkerRequest.HeaderContentType, known.Index, "#B2");
@@ -571,7 +571,7 @@ namespace MonoTests.System.Web {
 
                        KnownResponseHeader known;
 
-                       Assert.LessOrEqual (1, f.KnownResponseHeaders.Count, "#B1");
+                       AssertHelper.LessOrEqual (1, f.KnownResponseHeaders.Count, "#B1");
 
                        known = (KnownResponseHeader)f.KnownResponseHeaders ["Content-Type"];
                        Assert.AreEqual (HttpWorkerRequest.HeaderContentType, known.Index, "#B2");
index 52439e975abadcb7073dca94f9ae0f42e9ef4f51..51742ec6bc9d739aa44ef9b69d317e285427df3a 100644 (file)
@@ -55,7 +55,6 @@ namespace MonoTests.System.Web
                [Test]
                [Category ("NunitWeb")]
                [Ignore ("Pending fix for bug 351878")]
-               [Explicit]
                public void UnloadAppDomain100Times () 
                {
                        for (int i = 0; i < 100; i++)
index 23487dacb07c844cc0fc2046b631820a1ba1d34b..73c5c75bb2c29ba36d618e41e1da91a03cf51702 100644 (file)
@@ -148,7 +148,7 @@ namespace MonoTests.System.Web
                        provider.DoAddNode (node, rootNode);
 
                        Assert.IsNotNull (provider.CallTrace, "#A1");
-                       Assert.Greater (provider.CallTrace.Length, 1, "#A1-1");
+                       AssertHelper.Greater (provider.CallTrace.Length, 1, "#A1-1");
                        Assert.AreEqual (provider.CallTrace[0].Name, "BuildSiteMap", "#A1-2");
                }
 
@@ -247,7 +247,7 @@ namespace MonoTests.System.Web
                        Assert.IsNotNull (provider.RootNode, "#A1");
                        Assert.AreEqual (provider.RootNode.Provider, provider, "#A2");
                        Assert.IsNotNull (provider.CallTrace, "#A3");
-                       Assert.Greater (provider.CallTrace.Length, 1, "#A3-1");
+                       AssertHelper.Greater (provider.CallTrace.Length, 1, "#A3-1");
                        Assert.AreEqual ("BuildSiteMap", provider.CallTrace[0].Name, "#A3-2");
                        Assert.AreEqual ("get_RootNode", provider.CallTrace[1].Name, "#A3-3");
                }
index 9064929de012eb685ebf71f8563c19b332e3c076..1a523884ce95053f0ee2affae05252ef95013f22 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c1e931e0a9b631f15f767dc754ddaefec8e4bd9b..2f8b7fd1318f8b91eaf2448eab1ea7a15f28a3cc 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,618,612,809</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,618,612,809</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -50,6 +51,7 @@
   <ItemGroup>\r
     <Compile Include="..\..\build\common\Consts.cs" />\r
     <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
+    <Compile Include="..\System\System\MonoToolsLocator.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
     <Compile Include="Assembly\Locale.cs" />\r
     <Compile Include="System.Resources\AssemblyNamesTypeResolutionService.cs" />\r
index c78f10bd89dde97a7d1d7d0fa0704ab550894125..5774443e80666a890065b83dba4e9165cb0e6b7a 100644 (file)
@@ -2,7 +2,7 @@
 ../../build/common/MonoTODOAttribute.cs
 Assembly/AssemblyInfo.cs
 Assembly/Locale.cs
-../System/System/MonoExeLocator.cs
+../System/System/MonoToolsLocator.cs
 System.Resources/AssemblyNamesTypeResolutionService.cs
 System.Resources/ByteArrayFromResXHandler.cs
 System.Resources/ResXNullRef.cs
index 1087563b16ad124ceb91234588b7e4bfdf55388a..a6b37d7c2a812d0531b3ca17e66d67fbc6342b4b 100644 (file)
@@ -5411,9 +5411,12 @@ namespace System.Windows.Forms
                                bool selection_changed = false;
                                if (is_main_collection && owner != null) {
 
-                                       int display_index = item.DisplayIndex;
-                                       if (item.Focused && display_index + 1 == Count) // Last item
-                                               owner.SetFocusedItem (display_index == 0 ? -1 : display_index - 1);
+                                       ListViewItem focused_item = owner.FocusedItem;
+                                       if (focused_item != null) {
+                                               int focused_item_index = focused_item.DisplayIndex;
+                                               if (focused_item_index + 1 >= Count) // Last item
+                                                       owner.SetFocusedItem (Count - 2);
+                                       }
 
                                        selection_changed = owner.SelectedIndices.Contains (index);
                                        owner.item_control.CancelEdit (item);
@@ -5479,7 +5482,7 @@ namespace System.Windows.Forms
 
                                        value.SetGroup (group);
                                }
-
+                               value.DisplayIndex = -1;
                                list.Add (value);
 
                                // force an update of the selected info if the new item is selected.
index f336b1537be36e1a8975e7fe1d530d1e8fe23f6f..884953ac3dd9e06e8d460a54b70cbc646b84ebbd 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 ../../../build/common/Consts.cs
 System.Windows.Forms/ApplicationTest.cs
 System.Windows.Forms/AutoCompleteStringCollectionTest.cs
index d0e3fc1bd3d8315e2dfd49e19881ce93b76d0590..0414fa18e710249b0d7c4f2a74448c8cfb4bce69 100644 (file)
@@ -47,7 +47,7 @@ namespace MonoTests.System.Resources {
 
                        Assert.IsNotNull (returnedNode, "#A1");
                        object val = returnedNode.GetValue (new ReturnSerializableSubClassITRS ());
-                       Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A2");
+                       AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A2");
                        Assert.IsInstanceOfType (typeof (serializable), val, "#A3");
                }
 
@@ -84,7 +84,7 @@ namespace MonoTests.System.Resources {
                        node = GetNodeFileRefToSerializable ("ser.bbb",true);
 
                        object val = node.GetValue (new ReturnSerializableSubClassITRS ());
-                       Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A1");
+                       AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A1");
                        Assert.IsInstanceOfType (typeof (serializable), val, "#A2");
                }
 
index 8ca5f4eb574d131270e3a12297929e39a02f9f86..3c0fc3beaaff338c0fa31e85244079d349c433da 100644 (file)
@@ -90,7 +90,7 @@ namespace MonoTests.System.Resources {
                        // get value passing no params
                        object val = returnedNode.GetValue ((ITypeResolutionService) null);
                        Assert.IsInstanceOfType (typeof (serializable), val, "#A2");
-                       Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A3");
+                       AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A3");
 
                        //get value type passing different params
                        string newType = returnedNode.GetValueTypeName (new ReturnSerializableSubClassITRS ());
index d27d4439bb680fdf7c9f9aa919c08de6694f3f3c..ffd3711a8c298212c8d3af3d1ff8feaff2235e0e 100644 (file)
@@ -50,10 +50,10 @@ namespace MonoTests.System.Resources {
 
                        object defaultVal = returnedNode.GetValue ((ITypeResolutionService) null);
                        Assert.IsInstanceOfType (typeof (serializable), defaultVal, "#A2");
-                       Assert.IsNotInstanceOfType (typeof (serializableSubClass), defaultVal, "#A3");
+                       AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), defaultVal, "#A3");
 
                        object newVal = returnedNode.GetValue (new ReturnSerializableSubClassITRS ());
-                       Assert.IsNotInstanceOfType (typeof (serializableSubClass), newVal, "#A4");
+                       AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), newVal, "#A4");
                        Assert.IsInstanceOfType (typeof (serializable), newVal, "#A5");
                }
 
@@ -88,7 +88,7 @@ namespace MonoTests.System.Resources {
 
                        // get value passing null params
                        object val = returnedNode.GetValue ((ITypeResolutionService) null);
-                       // Assert.IsNotInstanceOfType (typeof (serializable), val, "#A5"); this would fail as subclasses are id-ed as instances of parents
+                       // AssertHelper.IsNotInstanceOfType (typeof (serializable), val, "#A5"); this would fail as subclasses are id-ed as instances of parents
                        Assert.IsInstanceOfType (typeof (serializableSubClass), val, "#A4");
                }
 
index 3a6cfbda95ad293b920e005e167a955b932c697c..5c6d1a960cc56f9f898cbe9f857433d9d5ef4b9b 100644 (file)
@@ -314,7 +314,7 @@ namespace MonoTests.System.Resources {
 
                        object o = node.GetValue ((AssemblyName []) null);
 
-                       Assert.IsNotInstanceOfType (typeof (serializableSubClass), o, "#A2");
+                       AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), o, "#A2");
                        Assert.IsInstanceOfType (typeof (serializable), o, "#A3");
                        rr.Close ();
                }
index 6c69a328a088f11f3a44bdb27dd44fdc74194928..9bfe7b1b416b192272f84c49492d78bb8aa94516 100644 (file)
@@ -252,7 +252,7 @@ namespace MonoTests.System.Resources {
                        Assert.IsNotNull (finalNode, "#A3");
 
                        object finalVal = finalNode.GetValue ((ITypeResolutionService) null);
-                       Assert.IsNotInstanceOfType (typeof (serializableSubClass), finalVal, "#A4");
+                       AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), finalVal, "#A4");
                        Assert.IsInstanceOfType (typeof (serializable), finalVal, "#A5");
                }
 
index 02f4db20f28c475e67c584a36c293f3fbc5e2ac0..6514bfe1c030a91bd8928d05d494781df7933cb4 100644 (file)
@@ -91,6 +91,7 @@ namespace MonoTests.System.Windows.Forms
                }
 
                [Test]
+               [Ignore ("causes an infinite restart loop since we're not in a separate AppDomain with nunit-lite")]
                [ExpectedException (typeof (NotSupportedException))]
                public void RestartNotSupportedExceptionTest ()
                {
index 46adeaaccb4d967f207eb6befe7015306307bad9..a71067dc5f4e8985bd9b799a003414f7c25f198d 100644 (file)
@@ -1958,5 +1958,56 @@ namespace MonoTests.System.Windows.Forms
                                return base.IsInputChar (charCode);
                        }
                }
+
+               [Test]  // Should not throw IndexOutOfBoundsException
+               public void ReaddingItem ()
+               {
+                       Form form = new Form ();
+                       form.ShowInTaskbar = false;
+                       ListView lvw1 = new ListView ();
+                       ListView lvw2 = new ListView ();
+                       lvw1.View = View.Details;
+                       lvw2.View = View.Details;
+                       lvw1.Columns.Add (new ColumnHeader ("1"));
+                       lvw2.Columns.Add (new ColumnHeader ("2"));
+                       form.Controls.Add (lvw1);
+                       form.Controls.Add (lvw2);
+                       form.Show ();
+
+                       for (int i = 0; i < 50; i++)
+                               lvw1.Items.Add ("A");
+                       lvw2.Items.Add ("B1");
+
+                       ListViewItem item = lvw1.Items [lvw1.Items.Count - 1];
+                       item.Selected = true;
+                       item.Remove ();
+                       lvw2.Items.Add (item);
+                       item.Selected = true;
+
+                       Assert.AreEqual (lvw1.Items.Count, 49, "#1");
+                       Assert.AreEqual (lvw2.Items.Count, 2, "#2");
+                       Assert.AreEqual (lvw2.Items [1].Selected, true, "#3");
+
+                       form.Dispose ();
+               }
+
+               [Test]  // Should not throw ArgumentOutOfRangeException
+               public void DeleteNotFocusedItem ()
+               {
+                       Form form = new Form ();
+                       form.ShowInTaskbar = false;
+                       ListView lvw = new ListView ();
+                       form.Controls.Add (lvw);
+                       form.Show ();
+
+                       for (int i = 0; i < 3; i++)
+                               lvw.Items.Add ("A");
+
+                       lvw.Items [lvw.Items.Count - 1].Focused = true;
+                       lvw.Items [0].Remove ();
+                       lvw.Items [0].Remove ();
+
+                       form.Dispose ();
+               }
        }
 }
index acade5f6933827a5755cc1f7758ddf32ab6c3bac..18271cfba2d479509548c2ce1b963ad781bb4ca4 100644 (file)
@@ -946,10 +946,10 @@ namespace MonoTests.System.Windows.Forms
                        Assert.AreEqual (31, p.GetRowHeights ()[0], "D1");\r
                        Assert.AreEqual (31, p.GetRowHeights ()[1], "D2");\r
                        Assert.AreEqual (81, p.GetColumnWidths ()[0], "D3");\r
-                       Assert.LessOrEqual (75, p.GetColumnWidths ()[1], "D4");\r
-                       Assert.GreaterOrEqual (78, p.GetColumnWidths ()[1], "D5");\r
-                       Assert.LessOrEqual (78, p.GetColumnWidths ()[2], "D6");\r
-                       Assert.GreaterOrEqual (81, p.GetColumnWidths ()[2], "D7");\r
+                       AssertHelper.LessOrEqual (75, p.GetColumnWidths ()[1], "D4");\r
+                       AssertHelper.GreaterOrEqual (78, p.GetColumnWidths ()[1], "D5");\r
+                       AssertHelper.LessOrEqual (78, p.GetColumnWidths ()[2], "D6");\r
+                       AssertHelper.GreaterOrEqual (81, p.GetColumnWidths ()[2], "D7");\r
                }\r
                \r
                [Test]\r
@@ -1702,7 +1702,7 @@ namespace MonoTests.System.Windows.Forms
                        Assert.AreEqual (4, tlp.RowCount, "X18638-1");\r
                        Assert.AreEqual (3, tlp.ColumnCount, "X18638-2");\r
                        Assert.AreEqual (60, widths[0], "X18638-3");\r
-                       Assert.Greater (label2.Width, widths[1], "X18638-5");\r
+                       AssertHelper.Greater (label2.Width, widths[1], "X18638-5");\r
                        Assert.AreEqual (45, widths[2], "X18638-4");\r
                }\r
 \r
index 59ba68253f7678d90e83373cafbee8397a1bced5..8ecaa25e3df7ad48e4f810ddcd8b1d18dbba0c89 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c4285270bae308c734bd1136297b0373fad48b71..7a56cecb473c1c3c74b7f0f58608d509e9b19da3 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 32d268ac86e9ff227b087e84e8a504c558b56f74..8f04dff8786694af28eaa08009a9d9c6e9eda4ae 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index ecceeff1d25ab131fedbf915563dc943f5d41b32..1130cf15ff59395838371f4c649f7af04ad9e44b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -34,7 +35,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -42,7 +43,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7eacb3ddd76186652336c001a6d305daf646eb96..559fe4fd245f4e9515b2fe3380932b1224b44d72 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,219,414,649,1717</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASYNC</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASYNC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,219,414,649,1717</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASYNC</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASYNC</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 753fdd5bbb8f23a12b369415577b1624e2dfae04..917ebd0b54caa29fcd6c69e354d494e6e595b265 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,219,414,649,1717</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASYNC;CONFIGURATION_DEP</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;ASYNC;CONFIGURATION_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,219,414,649,1717</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;ASYNC;CONFIGURATION_DEP</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;ASYNC;CONFIGURATION_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f32bb39e09182b6d88559c0758c6af511e14cddc..55de52a77844e4a891fafbbc60cafa9476b45199 100644 (file)
@@ -135,10 +135,16 @@ namespace System.Xml.Serialization
 
                void LookupTypeConvertor ()
                {
-                       // We only need this for System.Xml.Linq.
-                       var convertor = type.GetCustomAttribute<XmlTypeConvertorAttribute> ();
-                       if (convertor != null)
-                               typeConvertor = type.GetMethod (convertor.Method, BindingFlags.Static | BindingFlags.NonPublic);
+                       // We only need this for System.Xml.Linq
+                       var t = type;
+                       // HACK: because interpreter array handling is so bad
+                       if (t.IsArray)
+                               t = t.GetElementType ();
+
+                       var convertor = t.GetCustomAttribute<XmlTypeConvertorAttribute> ();
+                       if (convertor != null) {
+                               typeConvertor = t.GetMethod (convertor.Method, BindingFlags.Static | BindingFlags.NonPublic);
+                       }
                }
 
                internal void ConvertForAssignment (ref object value)
index a7343e0182087700e47107335d8613fc6d891a01..e27f99a0fb7e3bf66a545cf486b281a115e2be1e 100644 (file)
@@ -243,6 +243,33 @@ namespace System.Xml.Serialization {
                        }
                }
 
+               static string[] allTimeFormats = new string[] {
+                       "HH:mm:ss.fffffffzzzzzz",
+                       "HH:mm:ss",
+                       "HH:mm:ss.f",
+                       "HH:mm:ss.ff",
+                       "HH:mm:ss.fff",
+                       "HH:mm:ss.ffff",
+                       "HH:mm:ss.fffff",
+                       "HH:mm:ss.ffffff",
+                       "HH:mm:ss.fffffff",
+                       "HH:mm:ssZ",
+                       "HH:mm:ss.fZ",
+                       "HH:mm:ss.ffZ",
+                       "HH:mm:ss.fffZ",
+                       "HH:mm:ss.ffffZ",
+                       "HH:mm:ss.fffffZ",
+                       "HH:mm:ss.ffffffZ",
+                       "HH:mm:ss.fffffffZ",
+                       "HH:mm:sszzzzzz",
+                       "HH:mm:ss.fzzzzzz",
+                       "HH:mm:ss.ffzzzzzz",
+                       "HH:mm:ss.fffzzzzzz",
+                       "HH:mm:ss.ffffzzzzzz",
+                       "HH:mm:ss.fffffzzzzzz",
+                       "HH:mm:ss.ffffffzzzzzz",
+               };
+
                internal static object FromXmlString (TypeData type, string value)
                {
                        if (value == null) return null;
@@ -254,7 +281,7 @@ namespace System.Xml.Serialization {
                                case "char": return (char)XmlConvert.ToInt32 (value);
                                case "dateTime": return XmlConvert.ToDateTime (value, XmlDateTimeSerializationMode.RoundtripKind);
                                case "date": return XmlConvert.ToDateTime (value).Date;
-                               case "time": return DateTime.ParseExact (value, "HH:mm:ss.FFFFFFF", null);
+                               case "time": return DateTime.ParseExact(value, allTimeFormats, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.AllowLeadingWhite | DateTimeStyles.AllowTrailingWhite | DateTimeStyles.NoCurrentDateDefault | DateTimeStyles.RoundtripKind);
                                case "decimal": return XmlConvert.ToDecimal (value);
                                case "double": return XmlConvert.ToDouble (value);
                                case "short": return XmlConvert.ToInt16 (value);
index 5d9e4b24f341cd6a2054bb8d1ab9aea3d18342e5..d03dea1ff01228e237db86dfc4a9a7028f2da73e 100644 (file)
@@ -737,7 +737,8 @@ namespace System.Xml.Serialization
                        Type type = listType.Type;
                        if (type.IsArray)
                        {
-                               list = EnsureArrayIndex ((Array)list, index, type.GetElementType());
+                               list = EnsureArrayIndex ((Array)list, index, type.GetElementType ());
+                               listType.ConvertForAssignment (ref value);
                                ((Array)list).SetValue (value, index);
                        }
                        else    // Must be IEnumerable
index ec13691da1c6f391354da03759db0b487818446c..1393c354207eeb7596880a9dd9755adcddf337bb 100644 (file)
@@ -1555,6 +1555,13 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (new DateTime (2012,2,5,9,0,0,DateTimeKind.Utc), o.SomeDate.ToUniversalTime ());
                }
 
+               [Test]
+               public void TimeWithUtc ()
+               {
+                       XmlSerializer xs = new XmlSerializer (typeof (UtcTimeClass));
+                       var o = (UtcTimeClass) xs.Deserialize (new StringReader ("<UtcTimeClass xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><DateTimeValue>12:34:56.0Z</DateTimeValue></UtcTimeClass>"));
+                       Assert.AreEqual (new DateTime (1,1,1,12,34,56,DateTimeKind.Utc), o.DateTimeValue);
+               }
 
                public class Foo
                {
index 661273a3bf73358944481c32ae4ab7d58a7cc0d4..e8bdfd8829c1ef8d4662dce4a739de610503f2ac 100644 (file)
@@ -46,7 +46,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format(CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -64,7 +64,7 @@ namespace MonoTests.System.XmlSerialization
                                "            this.namesField = value;{0}" +
                                "        }}{0}" +
                                "    }}{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
 
 
                        codeNamespace = ExportCode (typeof (ArrayClass[]));
@@ -76,7 +76,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -93,7 +93,7 @@ namespace MonoTests.System.XmlSerialization
                                "            this.namesField = value;{0}" +
                                "        }}{0}" +
                                "    }}{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#4");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#4");
                }
 
                [Test]
@@ -110,7 +110,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -128,7 +128,7 @@ namespace MonoTests.System.XmlSerialization
                                "            this.itemsField = value;{0}" +
                                "        }}{0}" +
                                "    }}{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
                }
 
                [Test]
@@ -145,7 +145,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -163,7 +163,7 @@ namespace MonoTests.System.XmlSerialization
                                "            this.cdataField = value;{0}" +
                                "        }}{0}" +
                                "    }}{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
                }
 
                [Test]
@@ -182,7 +182,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -204,7 +204,7 @@ namespace MonoTests.System.XmlSerialization
                                "            this.myChoiceField = value;{0}" +
                                "        }}{0}" +
                                "    }}{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
                }
 
                [Test]
@@ -222,7 +222,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -403,7 +403,7 @@ namespace MonoTests.System.XmlSerialization
                                "{0}" +
                                "/// <remarks/>{0}" +
                                "[System.FlagsAttribute()]{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "public enum MapModifiers {{{0}" +
                                "    {0}" +
@@ -414,7 +414,7 @@ namespace MonoTests.System.XmlSerialization
                                "    /// <remarks/>{0}" +
                                "    [System.Xml.Serialization.XmlEnumAttribute(\"protected\")]{0}" +
                                "    Protected = 2,{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
                }
 
                [Test]
@@ -431,7 +431,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Xml.Serialization.XmlTypeAttribute(IncludeInSchema=false)]{0}" +
                                "[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=false)]{0}" +
@@ -446,7 +446,7 @@ namespace MonoTests.System.XmlSerialization
                                "    {0}" +
                                "    /// <remarks/>{0}" +
                                "    ChoiceTwo,{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
 
                        codeNamespace = ExportCode (typeof (ItemChoiceType[]));
                        Assert.IsNotNull (codeNamespace, "#3");
@@ -457,7 +457,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Xml.Serialization.XmlTypeAttribute(IncludeInSchema=false)]{0}" +
                                "public enum ItemChoiceType {{{0}" +
@@ -471,7 +471,7 @@ namespace MonoTests.System.XmlSerialization
                                "    {0}" +
                                "    /// <remarks/>{0}" +
                                "    ChoiceTwo,{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#4");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#4");
                }
 
                [Test]
@@ -488,7 +488,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -509,7 +509,7 @@ namespace MonoTests.System.XmlSerialization
                                "}}{0}" +
                                "{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -526,7 +526,7 @@ namespace MonoTests.System.XmlSerialization
                                "            this.somethingField = value;{0}" +
                                "        }}{0}" +
                                "    }}{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
                }
 
                [Test]
@@ -544,7 +544,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -578,7 +578,7 @@ namespace MonoTests.System.XmlSerialization
                                "}}{0}" +
                                "{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -667,7 +667,7 @@ namespace MonoTests.System.XmlSerialization
                                "{0}" +
                                "/// <remarks/>{0}" +
                                "[System.FlagsAttribute()]{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"some:urn\")]{0}" +
                                "public enum FlagEnum {{{0}" +
@@ -786,7 +786,7 @@ namespace MonoTests.System.XmlSerialization
                                "{0}" +
                                "/// <remarks/>{0}" +
                                "[System.FlagsAttribute()]{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"urn:myNS\")]{0}" +
                                "public enum FlagEnum {{{0}" +
@@ -806,7 +806,7 @@ namespace MonoTests.System.XmlSerialization
                                "{0}" +
                                "/// <remarks/>{0}" +
                                "[System.FlagsAttribute()]{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"urn:myNS\")]{0}" +
                                "public enum FlagEnum_Encoded {{{0}" +
@@ -819,7 +819,7 @@ namespace MonoTests.System.XmlSerialization
                                "    {0}" +
                                "    /// <remarks/>{0}" +
                                "    e4 = 4,{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
                }
 
                [Test]
@@ -836,7 +836,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Diagnostics.DebuggerStepThroughAttribute()]{0}" +
                                "[System.ComponentModel.DesignerCategoryAttribute(\"code\")]{0}" +
@@ -855,7 +855,7 @@ namespace MonoTests.System.XmlSerialization
                                "            this.somethingField = value;{0}" +
                                "        }}{0}" +
                                "    }}{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
                }
 
                [Test]
@@ -909,7 +909,7 @@ namespace MonoTests.System.XmlSerialization
                                "{0}{0}" +
                                "/// <remarks/>{0}" +
                                "[System.FlagsAttribute()]{0}" +
-                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Xml\", \"{1}\")]{0}" +
+                               "[System.CodeDom.Compiler.GeneratedCodeAttribute(\"nunit-lite-console\", \"0.0.0.0\")]{0}" +
                                "[System.SerializableAttribute()]{0}" +
                                "[System.Xml.Serialization.XmlRootAttribute(Namespace=\"\", IsNullable=false)]{0}" +
                                "public enum ZeroFlagEnum {{{0}" +
@@ -925,7 +925,7 @@ namespace MonoTests.System.XmlSerialization
                                "    /// <remarks/>{0}" +
                                "    [System.Xml.Serialization.XmlEnumAttribute(\"tns:t<w>o\")]{0}" +
                                "    e2 = 4,{0}" +
-                               "}}{0}", Environment.NewLine, XmlFileVersion), sw.ToString (), "#2");
+                               "}}{0}", Environment.NewLine), sw.ToString (), "#2");
                }
 
                [Test]
@@ -1005,15 +1005,6 @@ namespace MonoTests.System.XmlSerialization
                        return codeNamespace;
                }
 
-               string XmlFileVersion {
-                       get {
-                               Assembly xmlAsm = typeof (XmlDocument).Assembly;
-                               AssemblyFileVersionAttribute afv = (AssemblyFileVersionAttribute)
-                                       Attribute.GetCustomAttribute (xmlAsm, typeof (AssemblyFileVersionAttribute));
-                               return afv.Version;
-                       }
-               }
-
                [XmlRootAttribute ("root", Namespace="urn:aNS", IsNullable=false)]
                public class Root
                {
index 116bbe323ad312f2fcfb8779cb5a1027ba7b69c3..4adcc11b20d8032cfb427bb0490a8a093fc7eace 100644 (file)
@@ -1071,6 +1071,12 @@ namespace MonoTests.System.Xml.TestClasses
                public DateTime SomeDate;
        }
 
+       public class UtcTimeClass
+       {
+               [XmlElementAttribute (DataType = "time")]
+               public DateTime DateTimeValue;
+       }
+
        public class Bug8468BaseClass
        {
                public string Base;
index bdd08aa7c69f5101ca4b85479f374d3da2f89b16..61835e709a09541daa56c89b501efc256c0ba3c1 100644 (file)
@@ -161,14 +161,12 @@ namespace MonoTests.System.XmlSerialization
                }
 
                // test constructors
-#if USE_VERSION_1_1    // It doesn't pass on MS.NET 1.1.
                [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
                public void TestConstructor()
                {
                        XmlSerializer ser = new XmlSerializer (null, "");
                }
-#else
-#endif
 
                // test basic types ////////////////////////////////////////////////////////
                [Test]
@@ -2323,6 +2321,7 @@ namespace MonoTests.System.XmlSerialization
                        Assert.AreEqual ("<:ErrorneousGetSchema></>", Infoset (sw.ToString ()));
                }
 
+               [Test]
                public void DateTimeRoundtrip ()
                {
                        // bug #337729
index 493bc6a8ad04504160745edfb05ef59ca5cc06d9..2624f2a5ba087f3629c397f41d376b6fd072317d 100644 (file)
@@ -136,7 +136,7 @@ namespace MonoTests.System.Xml
                        Assert.AreEqual ("file", resolved.Scheme);
                        var task = sr.GetEntityAsync (resolved, null, typeof (Stream));
                        Assert.That (task.Wait (3000));
-                       Assert.IsInstanceOfType (typeof (Stream), task.Result);
+                       Assert.IsInstanceOfType (typeof (FileStream), task.Result);
                }
 
        }
index a5d11aeffb1c16f590397c74502c490045f6e757..190dbdbe5e05ff385392643855eeee4952013f80 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e3988ed811ffcb03d826fec78c7a4b1d4fbb96d8..10ca891ef7cc469897ed47d49be4580242697ccd 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_SERIALIZATION</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_SERIALIZATION</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_SERIALIZATION</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_SERIALIZATION</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 693d4a2e296436b7c6c4cc7a24c97a727acd6c46..67efb6025e6504d6830210c54bb1fa53b28dbe70 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 System.Xml.Linq/ExtensionsTest.cs
 System.Xml.Linq/XAttributeTest.cs
 System.Xml.Linq/XCommentTest.cs
index 5415ff8e50a4beb760cc5825406fd6e49e7a3989..f93bbabc3d88e21bca92fc48e741c150f261a945 100644 (file)
@@ -2099,6 +2099,27 @@ namespace MonoTests.System.Xml.Linq
                        Assert.AreEqual (xe.Content.ToString (), "<Data />", "#3");
                }
 
+               [XmlType ("Root")]
+               public class DeserializeXElementArray_Data
+               {
+                       [XmlAnyElement]
+                       public XElement[] Content;
+               }
+
+               [Test]
+               public void DeserializeXElementArray ()
+               {
+                       var xmlString = "<Root><Data /></Root>";
+
+                       var serializer = new XmlSerializer (typeof (DeserializeXElementArray_Data));
+                       var res = serializer.Deserialize (new StringReader (xmlString));
+
+                       Assert.IsNotNull (res, "#1");
+                       Assert.AreEqual (typeof (DeserializeXElementArray_Data), res.GetType (), "#2");
+                       var xe = (DeserializeXElementArray_Data)res;
+                       Assert.AreEqual (xe.Content [0].ToString (), "<Data />", "#3");
+               }
+
                [Test] // Bug #20151
                public void XElementFromArrayWithNullValuesAsObject ()
                {
index da577e644effc0f851c9617fa46466d4140a3c4a..bbbf42e13f5d5a1b9374221ec8f40308bd423432 100644 (file)
@@ -220,8 +220,8 @@ namespace MonoTests.System.Xml.Schema
                                }
                        }
 
-                       Assert.GreaterOrEqual (afterNoOfAttributes, beforeNoOfAttributes, "newAttributes");
-                       Assert.GreaterOrEqual (afterNoOfElements, beforeNoOfElements, "newElements");       
+                       AssertHelper.GreaterOrEqual (afterNoOfAttributes, beforeNoOfAttributes, "newAttributes");
+                       AssertHelper.GreaterOrEqual (afterNoOfElements, beforeNoOfElements, "newElements");       
                }
 
                /*
index 5168c310d8608d21d54db0c43b9d10c90567c014..fa1bdd68c392c865451da9c9e2b6db2690ac2e02 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a80606ef6681ab5fb206f56beb846e816f5bc309..6ed83d7c1e03020ffe63c8d68f4d129ec468b6bd 100644 (file)
@@ -74,5 +74,7 @@ using System.Runtime.InteropServices;
        [assembly: StringFreezing]
        [assembly: DefaultDependency (LoadHint.Always)]
 
+       [assembly: InternalsVisibleTo ("btls-cert-sync, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
+       [assembly: InternalsVisibleTo ("Mono.Btls.Interface, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
        [assembly: InternalsVisibleTo ("Mono.Security, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
 
index fe01d7e4317c78eaa7a368f31ccd41952da83cb4..3c4d4dfc432545695f408db248194988c893da40 100644 (file)
@@ -19,22 +19,38 @@ TEST_RESOURCES = \
        Test/System/test-uri-props-manual.txt \
        Test/System/test-uri-relative-props.txt
 
+ifndef NO_MONO_SECURITY
+MONO_SECURITY=Mono.Security
+MONO_SECURITY_REF=MonoSecurity=Mono.Security
+MONO_SECURITY_DLL=$(the_libdir_base)Mono.Security.dll
+endif
+
 ifndef MOBILE_PROFILE
-TEST_LIB_REFS = System.Drawing Mono.Security System.Data System.Xml System.Core System.Configuration
+TEST_LIB_REFS = System.Drawing $(MONO_SECURITY) System.Data System.Xml System.Core System.Configuration
 else
-TEST_LIB_REFS = Mono.Security System.Data System.Xml System.Core
+TEST_LIB_REFS = $(MONO_SECURITY) System.Data System.Xml System.Core
 endif
 
 TEST_MCS_FLAGS = -nowarn:618,672,219,67,169,612 \
        $(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f)))
 
+TEST_NUNITLITE_APP_CONFIG_GLOBAL=Test/test-config-file
+
 REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX
 ifndef NO_PROCESS_START
 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_PROCESS_START
 TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
 endif
 
-LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
+LIB_MCS_FLAGS = -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
+
+ifndef PROFILE_DISABLE_BTLS
+ifdef HAVE_BTLS
+
+LIB_MCS_FLAGS += -d:MONO_FEATURE_BTLS
+
+endif
+endif
 
 ifndef NO_THREAD_ABORT
 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
@@ -57,7 +73,7 @@ TXT_RESOURCE_STRINGS = ../referencesource/System/System.txt
 # MOBILE_PROFILE needs SECURITY_DEP
 #
 ifdef MOBILE_PROFILE
-LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP
+LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635
 else
 EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS
 endif
@@ -67,7 +83,7 @@ endif
 #
 ifeq (secxml/, $(intermediate))
 LOCAL_MCS_FLAGS =
-LIB_REFS += bare/System.Xml MonoSecurity=Mono.Security
+LIB_REFS += bare/System.Xml $(MONO_SECURITY_REF)
 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP $(EXTERN_ALIAS_FLAGS)
 endif
 
@@ -75,7 +91,7 @@ endif
 # Flags used to build the final version of System (when intermediate is not defined)
 #
 ifndef intermediate
-LIB_REFS += System.Xml MonoSecurity=Mono.Security
+LIB_REFS += System.Xml $(MONO_SECURITY_REF)
 LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP $(EXTERN_ALIAS_FLAGS)
 
 ifndef MOBILE_PROFILE
@@ -87,7 +103,6 @@ endif
 
 EXTRA_DISTFILES = \
        Test/test-config-file                           \
-       Test/test-config-file-net-2.0                   \
        Test/System.Security.Cryptography.X509Certificates/pkits/Makefile       \
        Test/System.Security.Cryptography.X509Certificates/pkits/README         \
        Test/System.Security.Cryptography.X509Certificates/pkits/x509build.cs   \
@@ -99,7 +114,7 @@ include ../../build/library.make
 system_library_deps := \
        $(secxml_libdir)/System.dll             \
        $(the_libdir_base)System.Xml.dll        \
-       $(the_libdir_base)Mono.Security.dll     \
+       $(MONO_SECURITY_DLL)                            \
        $(bare_libdir)/System.dll
 
 ifndef MOBILE_PROFILE
@@ -108,7 +123,7 @@ endif
 
 artifacts = $(system_library_deps)                     \
        $(bare_libdir)/System.Xml.dll                   \
-       $(the_libdir_base)Mono.Security.dll             \
+       $(MONO_SECURITY_DLL)                            \
        $(the_libdir_base)System.Configuration.dll
 
 .NOTPARALLEL: $(system_library_deps)
@@ -123,7 +138,7 @@ $(bare_libdir)/System.dll:
 endif
 
 ifneq (secxml/,$(intermediate))
-$(secxml_libdir)/System.dll: $(bare_libdir)/System.dll $(bare_libdir)/System.Xml.dll $(the_libdir_base)Mono.Security.dll $(bare_libdir)/System.dll
+$(secxml_libdir)/System.dll: $(bare_libdir)/System.dll $(bare_libdir)/System.Xml.dll $(MONO_SECURITY_DLL) $(bare_libdir)/System.dll
        $(MAKE) intermediate=secxml/ $(secxml_libdir)/System.dll
 else
 build-sec:
@@ -143,10 +158,7 @@ $(the_libdir_base)System.Configuration.dll:
 
 $(build_lib): $(CYCLIC_DEP_FILES)
 
-$(test_lib): $(test_lib).config $(TEST_RESOURCES)
-
-$(test_lib).config: Test/test-config-file
-       cp $< $@
+$(test_lib): $(TEST_RESOURCES)
 
 CLEAN_FILES = $(test_lib).config $(bare_libdir)/System.dll $(secxml_libdir)/System.dll $(bare_libdir)/System.dll.mdb $(secxml_libdir)/System.dll.mdb
 
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsBio.cs b/mcs/class/System/Mono.Btls/MonoBtlsBio.cs
new file mode 100644 (file)
index 0000000..204d167
--- /dev/null
@@ -0,0 +1,449 @@
+//
+// MonoBtlsBio.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Text;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+#if MONOTOUCH
+using MonoTouch;
+#endif
+
+namespace Mono.Btls
+{
+       class MonoBtlsBio : MonoBtlsObject
+       {
+               internal MonoBtlsBio (BoringBioHandle handle)
+                       : base (handle)
+               {
+               }
+
+               new protected internal BoringBioHandle Handle {
+                       get { return (BoringBioHandle)base.Handle; }
+               }
+
+               protected internal class BoringBioHandle : MonoBtlsHandle
+               {
+                       public BoringBioHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               if (handle != IntPtr.Zero) {
+                                       mono_btls_bio_free (handle);
+                                       handle = IntPtr.Zero;
+                               }
+                               return true;
+                       }
+
+               }
+
+               public static MonoBtlsBio CreateMonoStream (Stream stream)
+               {
+                       return MonoBtlsBioMono.CreateStream (stream, false);
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_bio_read (IntPtr bio, IntPtr data, int len);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_bio_write (IntPtr bio, IntPtr data, int len);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_bio_flush (IntPtr bio);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_bio_indent (IntPtr bio, uint indent, uint max_indent);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_bio_hexdump (IntPtr bio, IntPtr data, int len, uint indent);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_bio_print_errors (IntPtr bio);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_bio_free (IntPtr handle);
+
+               public int Read (byte[] buffer, int offset, int size)
+               {
+                       CheckThrow ();
+                       var data = Marshal.AllocHGlobal (size);
+                       if (data == IntPtr.Zero)
+                               throw new OutOfMemoryException ();
+
+                       bool release = false;
+                       try {
+                               Handle.DangerousAddRef (ref release);
+                               var ret = mono_btls_bio_read (Handle.DangerousGetHandle (), data, size);
+                               if (ret > 0)
+                                       Marshal.Copy (data, buffer,offset, ret);
+                               return ret;
+                       } finally {
+                               if (release)
+                                       Handle.DangerousRelease ();
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public int Write (byte[] buffer, int offset, int size)
+               {
+                       CheckThrow ();
+                       var data = Marshal.AllocHGlobal (size);
+                       if (data == IntPtr.Zero)
+                               throw new OutOfMemoryException ();
+
+                       bool release = false;
+                       try {
+                               Handle.DangerousAddRef (ref release);
+                               Marshal.Copy (buffer, offset, data, size);
+                               return mono_btls_bio_write (Handle.DangerousGetHandle (), data, size);
+                       } finally {
+                               if (release)
+                                       Handle.DangerousRelease ();
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public int Flush ()
+               {
+                       CheckThrow ();
+                       bool release = false;
+                       try {
+                               Handle.DangerousAddRef (ref release);
+                               return mono_btls_bio_flush (Handle.DangerousGetHandle ());
+                       } finally {
+                               if (release)
+                                       Handle.DangerousRelease ();
+                       }
+               }
+
+               public int Indent (uint indent, uint max_indent)
+               {
+                       CheckThrow ();
+                       bool release = false;
+                       try {
+                               Handle.DangerousAddRef (ref release);
+                               return mono_btls_bio_indent (Handle.DangerousGetHandle (), indent, max_indent);
+                       } finally {
+                               if (release)
+                                       Handle.DangerousRelease ();
+                       }
+               }
+
+               public int HexDump (byte[] buffer, uint indent)
+               {
+                       CheckThrow ();
+                       var data = Marshal.AllocHGlobal (buffer.Length);
+                       if (data == IntPtr.Zero)
+                               throw new OutOfMemoryException ();
+
+                       bool release = false;
+                       try {
+                               Handle.DangerousAddRef (ref release);
+                               Marshal.Copy (buffer, 0, data, buffer.Length);
+                               return mono_btls_bio_hexdump (Handle.DangerousGetHandle (), data, buffer.Length, indent);
+                       } finally {
+                               if (release)
+                                       Handle.DangerousRelease ();
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public void PrintErrors ()
+               {
+                       CheckThrow ();
+                       bool release = false;
+                       try {
+                               Handle.DangerousAddRef (ref release);
+                               mono_btls_bio_print_errors (Handle.DangerousGetHandle ());
+                       } finally {
+                               if (release)
+                                       Handle.DangerousRelease ();
+                       }
+               }
+       }
+
+       class MonoBtlsBioMemory : MonoBtlsBio
+       {
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_bio_mem_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_bio_mem_get_data (IntPtr handle, out IntPtr data);
+
+               public MonoBtlsBioMemory ()
+                       : base (new BoringBioHandle (mono_btls_bio_mem_new ()))
+               {
+               }
+
+               public byte[] GetData ()
+               {
+                       IntPtr data;
+                       bool release = false;
+                       try {
+                               Handle.DangerousAddRef (ref release);
+                               var size = mono_btls_bio_mem_get_data (Handle.DangerousGetHandle (), out data);
+                               CheckError (size > 0);
+                               var buffer = new byte[size];
+                               Marshal.Copy (data, buffer, 0, size);
+                               return buffer;
+                       } finally {
+                               if (release)
+                                       Handle.DangerousRelease ();
+                       }
+               }
+       }
+
+       interface IMonoBtlsBioMono
+       {
+               int Read (byte[] buffer, int offset, int size, out bool wantMore);
+
+               bool Write (byte[] buffer, int offset, int size);
+
+               void Flush ();
+
+               void Close ();
+       }
+
+       class MonoBtlsBioMono : MonoBtlsBio
+       {
+               GCHandle handle;
+               IntPtr instance;
+               BioReadFunc readFunc;
+               BioWriteFunc writeFunc;
+               BioControlFunc controlFunc;
+               IntPtr readFuncPtr;
+               IntPtr writeFuncPtr;
+               IntPtr controlFuncPtr;
+               IMonoBtlsBioMono backend;
+
+               public MonoBtlsBioMono (IMonoBtlsBioMono backend)
+                       : base (new BoringBioHandle (mono_btls_bio_mono_new ()))
+               {
+                       this.backend = backend;
+                       handle = GCHandle.Alloc (this);
+                       instance = GCHandle.ToIntPtr (handle);
+                       readFunc = OnRead;
+                       writeFunc = OnWrite;
+                       controlFunc = Control;
+                       readFuncPtr = Marshal.GetFunctionPointerForDelegate (readFunc);
+                       writeFuncPtr = Marshal.GetFunctionPointerForDelegate (writeFunc);
+                       controlFuncPtr = Marshal.GetFunctionPointerForDelegate (controlFunc);
+                       mono_btls_bio_mono_initialize (Handle.DangerousGetHandle (), instance, readFuncPtr, writeFuncPtr, controlFuncPtr);
+               }
+
+               public static MonoBtlsBioMono CreateStream (Stream stream, bool ownsStream)
+               {
+                       return new MonoBtlsBioMono (new StreamBackend (stream, ownsStream));
+               }
+
+               public static MonoBtlsBioMono CreateString (StringWriter writer)
+               {
+                       return new MonoBtlsBioMono (new StringBackend (writer));
+               }
+
+               enum ControlCommand
+               {
+                       Flush = 1
+               }
+
+               delegate int BioReadFunc (IntPtr bio, IntPtr data, int dataLength, out int wantMore);
+               delegate int BioWriteFunc (IntPtr bio, IntPtr data, int dataLength);
+               delegate long BioControlFunc (IntPtr bio, ControlCommand command, long arg);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_bio_mono_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_bio_mono_initialize (IntPtr handle, IntPtr instance, IntPtr readFunc, IntPtr writeFunc, IntPtr controlFunc);
+
+               long Control (ControlCommand command, long arg)
+               {
+                       switch (command) {
+                       case ControlCommand.Flush:
+                               backend.Flush ();
+                               return 1;
+
+                       default:
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               int OnRead (IntPtr data, int dataLength, out int wantMore)
+               {
+                       bool wantMoreBool;
+                       var buffer = new byte[dataLength];
+                       var ret = backend.Read (buffer, 0, dataLength, out wantMoreBool);
+                       wantMore = wantMoreBool ? 1 : 0;
+                       if (ret <= 0)
+                               return ret;
+                       Marshal.Copy (buffer, 0, data, ret);
+                       return ret;
+               }
+
+#if MONOTOUCH
+               [MonoPInvokeCallback (typeof (BioReadFunc))]
+#endif
+               static int OnRead (IntPtr instance, IntPtr data, int dataLength, out int wantMore)
+               {
+                       var c = (MonoBtlsBioMono)GCHandle.FromIntPtr (instance).Target;
+                       try {
+                               return c.OnRead (data, dataLength, out wantMore);
+                       } catch (Exception ex) {
+                               c.SetException (ex);
+                               wantMore = 0;
+                               return -1;
+                       }
+               }
+
+               int OnWrite (IntPtr data, int dataLength)
+               {
+                       var buffer = new byte[dataLength];
+                       Marshal.Copy (data, buffer, 0, dataLength);
+                       var ok = backend.Write (buffer, 0, dataLength);
+                       return ok ? dataLength : -1;
+               }
+
+#if MONOTOUCH
+               [MonoPInvokeCallback (typeof (BioWriteFunc))]
+#endif
+               static int OnWrite (IntPtr instance, IntPtr data, int dataLength)
+               {
+                       var c = (MonoBtlsBioMono)GCHandle.FromIntPtr (instance).Target;
+                       try {
+                               return c.OnWrite (data, dataLength);
+                       } catch (Exception ex) {
+                               c.SetException (ex);
+                               return -1;
+                       }
+               }
+
+#if MONOTOUCH
+               [MonoPInvokeCallback (typeof (BioControlFunc))]
+#endif
+               static long Control (IntPtr instance, ControlCommand command, long arg)
+               {
+                       var c = (MonoBtlsBioMono)GCHandle.FromIntPtr (instance).Target;
+                       try {
+                               return c.Control (command, arg);
+                       } catch (Exception ex) {
+                               c.SetException (ex);
+                               return -1;
+                       }
+               }
+
+               protected override void Close ()
+               {
+                       try {
+                               if (backend != null) {
+                                       backend.Close ();
+                                       backend = null;
+                               }
+                               if (handle.IsAllocated)
+                                       handle.Free ();
+                       } finally {
+                               base.Close ();
+                       }
+               }
+
+               class StreamBackend : IMonoBtlsBioMono
+               {
+                       Stream stream;
+                       bool ownsStream;
+
+                       public Stream InnerStream {
+                               get { return stream; }
+                       }
+
+                       public StreamBackend (Stream stream, bool ownsStream)
+                       {
+                               this.stream = stream;
+                               this.ownsStream = ownsStream;
+                       }
+
+                       public int Read (byte[] buffer, int offset, int size, out bool wantMore)
+                       {
+                               wantMore = false;
+                               return stream.Read (buffer, offset, size);
+                       }
+
+                       public bool Write (byte[] buffer, int offset, int size)
+                       {
+                               stream.Write (buffer, offset, size);
+                               return true;
+                       }
+
+                       public void Flush ()
+                       {
+                               stream.Flush ();
+                       }
+
+                       public void Close ()
+                       {
+                               if (ownsStream && stream != null)
+                                       stream.Dispose ();
+                               stream = null;
+                       }
+               }
+
+               class StringBackend : IMonoBtlsBioMono
+               {
+                       StringWriter writer;
+                       Encoding encoding = new UTF8Encoding ();
+
+                       public StringBackend (StringWriter writer)
+                       {
+                               this.writer = writer;
+                       }
+
+                       public int Read (byte[] buffer, int offset, int size, out bool wantMore)
+                       {
+                               wantMore = false;
+                               return -1;
+                       }
+
+                       public bool Write (byte[] buffer, int offset, int size)
+                       {
+                               var text = encoding.GetString (buffer, offset, size);
+                               writer.Write (text);
+                               return true;
+                       }
+
+                       public void Flush ()
+                       {
+                       }
+
+                       public void Close ()
+                       {
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsContext.cs b/mcs/class/System/Mono.Btls/MonoBtlsContext.cs
new file mode 100644 (file)
index 0000000..051656c
--- /dev/null
@@ -0,0 +1,444 @@
+//
+// MonoBtlsContext.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+using System;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Authentication;
+using System.Runtime.InteropServices;
+
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+#else
+using Mono.Security.Interface;
+#endif
+
+using MNS = Mono.Net.Security;
+
+namespace Mono.Btls
+{
+       class MonoBtlsContext : MNS.MobileTlsContext, IMonoBtlsBioMono
+       {
+               X509Certificate remoteCertificate;
+               X509Certificate clientCertificate;
+               X509CertificateImplBtls nativeServerCertificate;
+               X509CertificateImplBtls nativeClientCertificate;
+               MonoBtlsSslCtx ctx;
+               MonoBtlsSsl ssl;
+               MonoBtlsBio bio;
+               MonoBtlsBio errbio;
+
+               MonoTlsConnectionInfo connectionInfo;
+               bool certificateValidated;
+               bool isAuthenticated;
+               bool connected;
+
+               public MonoBtlsContext (
+                       MNS.MobileAuthenticatedStream parent,
+                       bool serverMode, string targetHost,
+                       SslProtocols enabledProtocols, X509Certificate serverCertificate,
+                       X509CertificateCollection clientCertificates, bool askForClientCert)
+                       : base (parent, serverMode, targetHost, enabledProtocols,
+                               serverCertificate, clientCertificates, askForClientCert)
+               {
+                       if (serverMode)
+                               nativeServerCertificate = GetPrivateCertificate (serverCertificate);
+               }
+
+               static X509CertificateImplBtls GetPrivateCertificate (X509Certificate certificate)
+               {
+                       var impl = certificate.Impl as X509CertificateImplBtls;
+                       if (impl != null)
+                               return (X509CertificateImplBtls)impl.Clone ();
+
+                       var password = Guid.NewGuid ().ToString ();
+                       var buffer = certificate.Export (X509ContentType.Pfx, password);
+
+                       impl = new X509CertificateImplBtls ();
+                       impl.Import (buffer, password, X509KeyStorageFlags.DefaultKeySet);
+                       return impl;
+               }
+
+               new public MonoBtlsProvider Provider {
+                       get { return (MonoBtlsProvider)base.Provider; }
+               }
+
+               int VerifyCallback (MonoBtlsX509StoreCtx storeCtx)
+               {
+                       using (var chainImpl = new X509ChainImplBtls (storeCtx))
+                       using (var managedChain = new X509Chain (chainImpl)) {
+                               var leaf = managedChain.ChainElements[0].Certificate;
+                               var result = ValidateCertificate (leaf, managedChain);
+                               certificateValidated = true;
+                               return result ? 1 : 0;
+                       }
+               }
+
+               int SelectCallback ()
+               {
+                       Debug ("SELECT CALLBACK!");
+
+                       GetPeerCertificate ();
+                       if (remoteCertificate == null)
+                               throw new TlsException (AlertDescription.InternalError, "Cannot request client certificate before receiving one from the server.");
+
+                       var clientCert = SelectClientCertificate (remoteCertificate, null);
+                       Debug ("SELECT CALLBACK #1: {0}", clientCert);
+                       if (clientCert == null)
+                               return 1;
+
+                       nativeClientCertificate = GetPrivateCertificate (clientCert);
+                       Debug ("SELECT CALLBACK #2: {0}", nativeClientCertificate);
+                       clientCertificate = new X509Certificate (nativeClientCertificate);
+                       SetPrivateCertificate (nativeClientCertificate);
+                       return 1;
+               }
+
+               public override void StartHandshake ()
+               {
+                       InitializeConnection ();
+
+                       ssl = new MonoBtlsSsl (ctx);
+
+                       bio = new MonoBtlsBioMono (this);
+                       ssl.SetBio (bio);
+
+                       if (IsServer) {
+                               SetPrivateCertificate (nativeServerCertificate);
+                       } else {
+                               ssl.SetServerName (ServerName);
+                       }
+               }
+
+               void SetPrivateCertificate (X509CertificateImplBtls privateCert)
+               {
+                       Debug ("SetPrivateCertificate: {0}", privateCert);
+                       ssl.SetCertificate (privateCert.X509);
+                       ssl.SetPrivateKey (privateCert.NativePrivateKey);
+                       var intermediate = privateCert.IntermediateCertificates;
+                       if (intermediate == null)
+                               return;
+                       for (int i = 0; i < intermediate.Count; i++) {
+                               var impl = (X509CertificateImplBtls)intermediate [i];
+                               Debug ("SetPrivateCertificate - add intermediate: {0}", impl);
+                               ssl.AddIntermediateCertificate (impl.X509);
+                       }
+               }
+
+               static Exception GetException (MonoBtlsSslError status)
+               {
+                       var error = MonoBtlsError.GetError ();
+                       var text = MonoBtlsError.GetErrorString (error);
+                       return new MonoBtlsException ("{0} {1}", status, text);
+               }
+
+               public override bool ProcessHandshake ()
+               {
+                       var done = false;
+                       while (!done) {
+                               Debug ("ProcessHandshake");
+                               MonoBtlsError.ClearError ();
+                               var status = DoProcessHandshake ();
+                               Debug ("ProcessHandshake #1: {0}", status);
+
+                               switch (status) {
+                               case MonoBtlsSslError.None:
+                                       if (connected)
+                                               done = true;
+                                       else
+                                               connected = true;
+                                       break;
+                               case MonoBtlsSslError.WantRead:
+                               case MonoBtlsSslError.WantWrite:
+                                       return false;
+                               default:
+                                       throw GetException (status);
+                               }
+                       }
+
+                       ssl.PrintErrors ();
+
+                       return true;
+               }
+
+               MonoBtlsSslError DoProcessHandshake ()
+               {
+                       if (connected)
+                               return ssl.Handshake ();
+                       else if (IsServer)
+                               return ssl.Accept ();
+                       else
+                               return ssl.Connect ();
+               }
+
+               public override void FinishHandshake ()
+               {
+                       InitializeSession ();
+
+                       isAuthenticated = true;
+               }
+
+               void SetupCertificateStore ()
+               {
+                       MonoBtlsProvider.SetupCertificateStore (ctx.CertificateStore);
+
+                       if (Settings != null && Settings.TrustAnchors != null) {
+                               var trust = IsServer ? MonoBtlsX509TrustKind.TRUST_CLIENT : MonoBtlsX509TrustKind.TRUST_SERVER;
+                               ctx.CertificateStore.AddCollection (Settings.TrustAnchors, trust);
+                       }
+               }
+
+               void InitializeConnection ()
+               {
+                       ctx = new MonoBtlsSslCtx ();
+
+#if MARTIN_DEBUG
+                       errbio = MonoBtlsBio.CreateMonoStream (Console.OpenStandardError ());
+                       ctx.SetDebugBio (errbio);
+#endif
+
+                       SetupCertificateStore ();
+
+                       if (!IsServer || AskForClientCertificate)
+                               ctx.SetVerifyCallback (VerifyCallback, false);
+                       if (!IsServer)
+                               ctx.SetSelectCallback (SelectCallback);
+
+                       ctx.SetVerifyParam (MonoBtlsProvider.GetVerifyParam (ServerName, IsServer));
+
+                       TlsProtocolCode minProtocol, maxProtocol;
+                       GetProtocolVersions (out minProtocol, out maxProtocol);
+
+                       ctx.SetMinVersion ((int)minProtocol);
+                       ctx.SetMaxVersion ((int)maxProtocol);
+
+                       if (Settings != null && Settings.EnabledCiphers != null) {
+                               var ciphers = new short [Settings.EnabledCiphers.Length];
+                               for (int i = 0; i < ciphers.Length; i++)
+                                       ciphers [i] = (short)Settings.EnabledCiphers [i];
+                               ctx.SetCiphers (ciphers, true);
+                       }
+               }
+
+               void GetPeerCertificate ()
+               {
+                       if (remoteCertificate != null)
+                               return;
+                       using (var remoteCert = ssl.GetPeerCertificate ()) {
+                               if (remoteCert != null)
+                                       remoteCertificate = MonoBtlsProvider.CreateCertificate (remoteCert);
+                       }
+               }
+
+               void InitializeSession ()
+               {
+                       GetPeerCertificate ();
+
+                       if (IsServer && AskForClientCertificate && !certificateValidated) {
+                               if (!ValidateCertificate (null, null))
+                                       throw new TlsException (AlertDescription.CertificateUnknown);
+                       }
+
+                       var cipher = (CipherSuiteCode)ssl.GetCipher ();
+                       var protocol = (TlsProtocolCode)ssl.GetVersion ();
+                       Debug ("GET CONNECTION INFO: {0:x}:{0} {1:x}:{1} {2}", cipher, protocol, (TlsProtocolCode)protocol);
+
+                       connectionInfo = new MonoTlsConnectionInfo {
+                               CipherSuiteCode = cipher,
+                               ProtocolVersion = GetProtocol (protocol)
+                       };
+               }
+
+               static TlsProtocols GetProtocol (TlsProtocolCode protocol)
+               {
+                       switch (protocol) {
+                       case TlsProtocolCode.Tls10:
+                               return TlsProtocols.Tls10;
+                       case TlsProtocolCode.Tls11:
+                               return TlsProtocols.Tls11;
+                       case TlsProtocolCode.Tls12:
+                               return TlsProtocols.Tls12;
+                       default:
+                               throw new NotSupportedException ();
+                       }
+               }
+
+               public override void Flush ()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public override int Read (byte[] buffer, int offset, int size, out bool wantMore)
+               {
+                       Debug ("Read: {0} {1} {2}", buffer.Length, offset, size);
+
+                       var data = Marshal.AllocHGlobal (size);
+                       if (data == IntPtr.Zero)
+                               throw new OutOfMemoryException ();
+
+                       try {
+                               MonoBtlsError.ClearError ();
+                               var status = ssl.Read (data, ref size);
+                               Debug ("Read done: {0} {1}", status, size);
+
+                               if (status == MonoBtlsSslError.WantRead) {
+                                       wantMore = true;
+                                       return 0;
+                               } else if (status != MonoBtlsSslError.None) {
+                                       throw GetException (status);
+                               }
+
+                               if (size > 0)
+                                       Marshal.Copy (data, buffer, offset, size);
+
+                               wantMore = false;
+                               return size;
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public override int Write (byte[] buffer, int offset, int size, out bool wantMore)
+               {
+                       Debug ("Write: {0} {1} {2}", buffer.Length, offset, size);
+
+                       var data = Marshal.AllocHGlobal (size);
+                       if (data == IntPtr.Zero)
+                               throw new OutOfMemoryException ();
+
+                       try {
+                               MonoBtlsError.ClearError ();
+                               Marshal.Copy (buffer, offset, data, size);
+                               var status = ssl.Write (data, ref size);
+                               Debug ("Write done: {0} {1}", status, size);
+
+                               if (status == MonoBtlsSslError.WantWrite) {
+                                       wantMore = true;
+                                       return 0;
+                               } else if (status != MonoBtlsSslError.None) {
+                                       throw GetException (status);
+                               }
+
+                               wantMore = false;
+                               return size;
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public override void Close ()
+               {
+                       Debug ("Close!");
+                       ssl.Dispose ();
+               }
+
+               void Dispose<T> (ref T disposable)
+                       where T : class, IDisposable
+               {
+                       try {
+                               if (disposable != null)
+                                       disposable.Dispose ();
+                       } catch {
+                               ;
+                       } finally {
+                               disposable = null;
+                       }
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+                       try {
+                               if (disposing) {
+                                       Dispose (ref remoteCertificate);
+                                       Dispose (ref nativeServerCertificate);
+                                       Dispose (ref nativeClientCertificate);
+                                       Dispose (ref clientCertificate);
+                                       Dispose (ref ctx);
+                                       Dispose (ref ssl);
+                                       Dispose (ref bio);
+                                       Dispose (ref errbio);
+                               }
+                       } finally {
+                               base.Dispose (disposing);
+                       }
+               }
+
+               int IMonoBtlsBioMono.Read (byte[] buffer, int offset, int size, out bool wantMore)
+               {
+                       Debug ("InternalRead: {0} {1}", offset, size);
+                       var ret = Parent.InternalRead (buffer, offset, size, out wantMore);
+                       Debug ("InternalReadDone: {0} {1}", ret, wantMore);
+                       return ret;
+               }
+
+               bool IMonoBtlsBioMono.Write (byte[] buffer, int offset, int size)
+               {
+                       Debug ("InternalWrite: {0} {1}", offset, size);
+                       var ret = Parent.InternalWrite (buffer, offset, size);
+                       Debug ("InternalWrite done: {0}", ret);
+                       return ret;
+               }
+
+               void IMonoBtlsBioMono.Flush ()
+               {
+                       ;
+               }
+
+               void IMonoBtlsBioMono.Close ()
+               {
+                       ;
+               }
+
+               public override bool HasContext {
+                       get { return ssl != null && ssl.IsValid; }
+               }
+               public override bool IsAuthenticated {
+                       get { return isAuthenticated; }
+               }
+               public override MonoTlsConnectionInfo ConnectionInfo {
+                       get { return connectionInfo; }
+               }
+               internal override bool IsRemoteCertificateAvailable {
+                       get { return remoteCertificate != null; }
+               }
+               internal override X509Certificate LocalClientCertificate {
+                       get { return clientCertificate; }
+               }
+               public override X509Certificate RemoteCertificate {
+                       get { return remoteCertificate; }
+               }
+               public override TlsProtocols NegotiatedProtocol {
+                       get { return connectionInfo.ProtocolVersion; }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsError.cs b/mcs/class/System/Mono.Btls/MonoBtlsError.cs
new file mode 100644 (file)
index 0000000..5e61bcf
--- /dev/null
@@ -0,0 +1,83 @@
+//
+// MonoBtlsError.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 SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+#if MONOTOUCH
+using MonoTouch;
+#endif
+
+namespace Mono.Btls
+{
+       static class MonoBtlsError
+       {
+               [DllImport (MonoBtlsObject.BTLS_DYLIB)]
+               extern static int mono_btls_error_peek_error ();
+
+               [DllImport (MonoBtlsObject.BTLS_DYLIB)]
+               extern static int mono_btls_error_get_error ();
+
+               [DllImport (MonoBtlsObject.BTLS_DYLIB)]
+               extern static void mono_btls_error_clear_error ();
+
+               [DllImport (MonoBtlsObject.BTLS_DYLIB)]
+               extern static void mono_btls_error_get_error_string_n (int error, IntPtr buf, int len);
+
+               public static int PeekError ()
+               {
+                       return mono_btls_error_peek_error ();
+               }
+
+               public static int GetError ()
+               {
+                       return mono_btls_error_get_error ();
+               }
+
+               public static void ClearError ()
+               {
+                       mono_btls_error_clear_error ();
+               }
+
+               public static string GetErrorString (int error)
+               {
+                       var size = 1024;
+                       var buffer = Marshal.AllocHGlobal (size);
+                       if (buffer == IntPtr.Zero)
+                               throw new OutOfMemoryException ();
+                       try {
+                               mono_btls_error_get_error_string_n (error, buffer, size);
+                               return Marshal.PtrToStringAnsi (buffer);
+                       } finally {
+                               Marshal.FreeHGlobal (buffer);
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsException.cs b/mcs/class/System/Mono.Btls/MonoBtlsException.cs
new file mode 100644 (file)
index 0000000..44282c9
--- /dev/null
@@ -0,0 +1,53 @@
+//
+// MonoBtlsException.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+
+namespace Mono.Btls
+{
+       class MonoBtlsException : Exception
+       {
+               public MonoBtlsException ()
+               {
+               }
+
+               public MonoBtlsException (MonoBtlsSslError error)
+                       : base (error.ToString ())
+               {
+               }
+
+               public MonoBtlsException (string message)
+                       : base (message)
+               {
+               }
+
+               public MonoBtlsException (string format, params object[] args)
+                       : base (string.Format (format, args))
+               {
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsKey.cs b/mcs/class/System/Mono.Btls/MonoBtlsKey.cs
new file mode 100644 (file)
index 0000000..f0cc376
--- /dev/null
@@ -0,0 +1,104 @@
+//
+// MonoBtlsKey.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace Mono.Btls
+{
+       class MonoBtlsKey : MonoBtlsObject
+       {
+               internal class BoringKeyHandle : MonoBtlsHandle
+               {
+                       internal BoringKeyHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_key_free (handle);
+                               return true;
+                       }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_key_free (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_key_up_ref (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_key_get_bytes (IntPtr handle, out IntPtr data, out int size, int include_private_bits);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_key_get_bits (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_key_is_rsa (IntPtr handle);
+
+               new internal BoringKeyHandle Handle {
+                       get { return (BoringKeyHandle)base.Handle; }
+               }
+
+               internal MonoBtlsKey (BoringKeyHandle handle)
+                       : base (handle)
+               {
+               }
+
+               public byte[] GetBytes (bool include_private_bits)
+               {
+                       int size;
+                       IntPtr data;
+
+                       var ret = mono_btls_key_get_bytes (Handle.DangerousGetHandle (), out data, out size, include_private_bits ? 1 : 0);
+                       CheckError (ret);
+
+                       var buffer = new byte [size];
+                       Marshal.Copy (data, buffer, 0, size);
+                       FreeDataPtr (data);
+                       return buffer;
+               }
+
+               public bool IsRsa {
+                       get {
+                               return mono_btls_key_is_rsa (Handle.DangerousGetHandle ()) != 0;
+                       }
+               }
+
+               public MonoBtlsKey Copy ()
+               {
+                       CheckThrow ();
+                       var copy = mono_btls_key_up_ref (Handle.DangerousGetHandle ());
+                       CheckError (copy != IntPtr.Zero);
+                       return new MonoBtlsKey (new BoringKeyHandle (copy));
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsObject.cs b/mcs/class/System/Mono.Btls/MonoBtlsObject.cs
new file mode 100644 (file)
index 0000000..4264411
--- /dev/null
@@ -0,0 +1,145 @@
+//
+// MonoBtlsObject.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace Mono.Btls
+{
+       abstract class MonoBtlsObject : IDisposable
+       {
+               internal const string BTLS_DYLIB = "libmono-btls-shared";
+
+               internal MonoBtlsObject (MonoBtlsHandle handle)
+               {
+                       this.handle = handle;
+               }
+
+               protected internal abstract class MonoBtlsHandle : SafeHandle
+               {
+                       internal MonoBtlsHandle ()
+                               : base (IntPtr.Zero, true)
+                       {
+                       }
+
+                       internal MonoBtlsHandle (IntPtr handle, bool ownsHandle)
+                               : base (handle, ownsHandle)
+                       {
+                       }
+
+                       public override bool IsInvalid {
+                               get { return handle == IntPtr.Zero; }
+                       }
+               }
+
+               internal MonoBtlsHandle Handle {
+                       get {
+                               CheckThrow ();
+                               return handle;
+                       }
+               }
+
+               public bool IsValid {
+                       get { return handle != null && !handle.IsInvalid; }
+               }
+
+               MonoBtlsHandle handle;
+               Exception lastError;
+
+               protected void CheckThrow ()
+               {
+                       if (lastError != null)
+                               throw lastError;
+                       if (handle == null || handle.IsInvalid)
+                               throw new ObjectDisposedException ("MonoBtlsSsl");
+               }
+
+               protected Exception SetException (Exception ex)
+               {
+                       if (lastError == null)
+                               lastError = ex;
+                       return ex;
+               }
+
+               protected void CheckError (bool ok, [CallerMemberName] string callerName = null)
+               {
+                       if (!ok) {
+                               if (callerName != null)
+                                       throw new MonoBtlsException ("{0}.{1} failed.", GetType ().Name, callerName);
+                               else
+                                       throw new MonoBtlsException ();
+                       }
+
+               }
+
+               protected void CheckError (int ret, [CallerMemberName] string callerName = null)
+               {
+                       CheckError (ret == 1, callerName);
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_free (IntPtr data);
+
+               protected void FreeDataPtr (IntPtr data)
+               {
+                       mono_btls_free (data);
+               }
+
+               protected virtual void Close ()
+               {
+               }
+
+               protected void Dispose (bool disposing)
+               {
+                       if (disposing) {
+                               try {
+                                       if (handle != null) {
+                                               Close ();
+                                               handle.Dispose ();
+                                               handle = null;
+                                       }
+                               } finally {
+                                       var disposedExc = new ObjectDisposedException (GetType ().Name);
+                                       Interlocked.CompareExchange (ref lastError, disposedExc, null);
+                               }
+                       }
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+                       GC.SuppressFinalize (this);
+               }
+
+               ~MonoBtlsObject ()
+               {
+                       Dispose (false);
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsPkcs12.cs b/mcs/class/System/Mono.Btls/MonoBtlsPkcs12.cs
new file mode 100644 (file)
index 0000000..92e4320
--- /dev/null
@@ -0,0 +1,145 @@
+//
+// MonoBtlsPkcs12.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 SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Security.Cryptography.X509Certificates;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace Mono.Btls
+{
+       class MonoBtlsPkcs12 : MonoBtlsObject
+       {
+               internal class BoringPkcs12Handle : MonoBtlsHandle
+               {
+                       public BoringPkcs12Handle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_pkcs12_free (handle);
+                               return true;
+                       }
+               }
+
+               new internal BoringPkcs12Handle Handle {
+                       get { return (BoringPkcs12Handle)base.Handle; }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_pkcs12_free (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_pkcs12_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_pkcs12_get_count (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_pkcs12_get_cert (IntPtr Handle, int index);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_pkcs12_add_cert (IntPtr chain, IntPtr x509);
+
+               [DllImport (BTLS_DYLIB)]
+               extern unsafe static int mono_btls_pkcs12_import (IntPtr chain, void* data, int len, IntPtr password);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_pkcs12_has_private_key (IntPtr pkcs12);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_pkcs12_get_private_key (IntPtr pkcs12);
+
+               internal MonoBtlsPkcs12 ()
+                       : base (new BoringPkcs12Handle (mono_btls_pkcs12_new ()))
+               {
+               }
+
+               internal MonoBtlsPkcs12 (BoringPkcs12Handle handle)
+                       : base (handle)
+               {
+               }
+
+               MonoBtlsKey privateKey;
+
+               public int Count {
+                       get { return mono_btls_pkcs12_get_count (Handle.DangerousGetHandle ()); }
+               }
+
+               public MonoBtlsX509 GetCertificate (int index)
+               {
+                       if (index >= Count)
+                               throw new IndexOutOfRangeException ();
+                       var handle = mono_btls_pkcs12_get_cert (Handle.DangerousGetHandle (), index);
+                       CheckError (handle != IntPtr.Zero);
+                       return new MonoBtlsX509 (new MonoBtlsX509.BoringX509Handle (handle));
+               }
+
+               public void AddCertificate (MonoBtlsX509 x509)
+               {
+                       mono_btls_pkcs12_add_cert (
+                               Handle.DangerousGetHandle (),
+                               x509.Handle.DangerousGetHandle ());
+               }
+
+               public unsafe void Import (byte[] buffer, string password)
+               {
+                       var passptr = IntPtr.Zero;
+                       fixed (void* ptr = buffer)
+                       try {
+                               if (password != null)
+                                       passptr = Marshal.StringToHGlobalAnsi (password);
+                               var ret = mono_btls_pkcs12_import (
+                                       Handle.DangerousGetHandle (), ptr,
+                                       buffer.Length, passptr);
+                               CheckError (ret);
+                       } finally {
+                               if (passptr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (passptr);
+                       }
+               }
+
+               public bool HasPrivateKey {
+                       get { return mono_btls_pkcs12_has_private_key (Handle.DangerousGetHandle ()) != 0; }
+               }
+
+               public MonoBtlsKey GetPrivateKey ()
+               {
+                       if (!HasPrivateKey)
+                               throw new InvalidOperationException ();
+                       if (privateKey == null) {
+                               var handle = mono_btls_pkcs12_get_private_key (Handle.DangerousGetHandle ());
+                               CheckError (handle != IntPtr.Zero);
+                               privateKey = new MonoBtlsKey (new MonoBtlsKey.BoringKeyHandle (handle));
+                       }
+                       return privateKey;
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs b/mcs/class/System/Mono.Btls/MonoBtlsProvider.cs
new file mode 100644 (file)
index 0000000..b300585
--- /dev/null
@@ -0,0 +1,295 @@
+//
+// MonoBtlsProvider.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+using System;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Authentication;
+
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+using MX = MonoSecurity::Mono.Security.X509;
+#else
+using Mono.Security.Interface;
+using MX = Mono.Security.X509;
+#endif
+
+using MNS = Mono.Net.Security;
+
+namespace Mono.Btls
+{
+       class MonoBtlsProvider : MonoTlsProvider
+       {
+               static readonly Guid id = new Guid ("432d18c9-9348-4b90-bfbf-9f2a10e1f15b");
+
+               public override Guid ID {
+                       get { return id; }
+               }
+               public override string Name {
+                       get { return "btls"; }
+               }
+
+               internal MonoBtlsProvider ()
+               {
+                       if (!MNS.MonoTlsProviderFactory.IsBtlsSupported ())
+                               throw new NotSupportedException ("BTLS is not supported in this runtime.");
+               }
+
+               public override bool SupportsSslStream {
+                       get { return true; }
+               }
+
+               public override bool SupportsMonoExtensions {
+                       get { return true; }
+               }
+
+               public override bool SupportsConnectionInfo {
+                       get { return true; }
+               }
+
+               public override SslProtocols SupportedProtocols {
+                       get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
+               }
+
+               public override IMonoSslStream CreateSslStream (
+                       Stream innerStream, bool leaveInnerStreamOpen,
+                       MonoTlsSettings settings = null)
+               {
+                       return new MonoBtlsStream (
+                               innerStream, leaveInnerStreamOpen, settings, this);
+               }
+
+               internal override bool HasNativeCertificates {
+                       get { return true; }
+               }
+
+               internal override X509Certificate2Impl GetNativeCertificate (
+                       byte[] data, string password, X509KeyStorageFlags flags)
+               {
+                       var impl = new X509CertificateImplBtls (false);
+                       impl.Import (data, password, flags);
+                       return impl;
+               }
+
+               internal override X509Certificate2Impl GetNativeCertificate (
+                       X509Certificate certificate)
+               {
+                       var impl = certificate.Impl as X509CertificateImplBtls;
+                       if (impl != null)
+                               return (X509Certificate2Impl)impl.Clone ();
+
+                       var data = certificate.GetRawCertData ();
+                       return new X509CertificateImplBtls (data, MonoBtlsX509Format.DER, false);
+               }
+
+               internal static MonoBtlsX509VerifyParam GetVerifyParam (string targetHost, bool serverMode)
+               {
+                       MonoBtlsX509VerifyParam param;
+                       if (serverMode)
+                               param = MonoBtlsX509VerifyParam.GetSslClient ();
+                       else
+                               param = MonoBtlsX509VerifyParam.GetSslServer ();
+
+                       if (targetHost == null)
+                               return param;
+
+                       try {
+                               var copy = param.Copy ();
+                               copy.SetHost (targetHost);
+                               return copy;
+                       } finally {
+                               param.Dispose ();
+                       }
+               }
+
+               internal override bool ValidateCertificate (
+                       ICertificateValidator2 validator, string targetHost, bool serverMode,
+                       X509CertificateCollection certificates, bool wantsChain, ref X509Chain chain,
+                       ref MonoSslPolicyErrors errors, ref int status11)
+               {
+                       if (chain != null) {
+                               var chainImpl = (X509ChainImplBtls)chain.Impl;
+                               var success = chainImpl.StoreCtx.VerifyResult == 1;
+                               CheckValidationResult (
+                                       validator, targetHost, serverMode, certificates,
+                                       wantsChain, chain, chainImpl.StoreCtx,
+                                       success, ref errors, ref status11);
+                               return success;
+                       }
+
+                       using (var store = new MonoBtlsX509Store ())
+                       using (var nativeChain = MonoBtlsProvider.GetNativeChain (certificates))
+                       using (var param = GetVerifyParam (targetHost, serverMode))
+                       using (var storeCtx = new MonoBtlsX509StoreCtx ()) {
+                               SetupCertificateStore (store);
+
+                               storeCtx.Initialize (store, nativeChain);
+
+                               storeCtx.SetVerifyParam (param);
+
+                               var ret = storeCtx.Verify ();
+
+                               var success = ret == 1;
+
+                               if (wantsChain && chain == null) {
+                                       chain = GetManagedChain (nativeChain);
+                               }
+
+                               CheckValidationResult (
+                                       validator, targetHost, serverMode, certificates,
+                                       wantsChain, null, storeCtx,
+                                       success, ref errors, ref status11);
+                               return success;
+                       }
+               }
+
+               internal static bool ValidateCertificate (MonoBtlsX509Chain chain, MonoBtlsX509VerifyParam param)
+               {
+                       using (var store = new MonoBtlsX509Store ())
+                       using (var storeCtx = new MonoBtlsX509StoreCtx ()) {
+                               SetupCertificateStore (store);
+
+                               storeCtx.Initialize (store, chain);
+
+                               if (param != null)
+                                       storeCtx.SetVerifyParam (param);
+
+                               var ret = storeCtx.Verify ();
+
+                               return ret == 1;
+                       }
+               }
+
+               void CheckValidationResult (
+                       ICertificateValidator validator, string targetHost, bool serverMode,
+                       X509CertificateCollection certificates, bool wantsChain,
+                       X509Chain chain, MonoBtlsX509StoreCtx storeCtx,
+                       bool success, ref MonoSslPolicyErrors errors, ref int status11)
+               {
+                       if (!success) {
+                               errors = MonoSslPolicyErrors.RemoteCertificateChainErrors;
+                               status11 = unchecked((int)0x800B010B);
+                       }
+               }
+
+               internal static void SetupCertificateStore (MonoBtlsX509Store store)
+               {
+#if MONODROID
+                       store.SetDefaultPaths ();
+                       store.AddAndroidLookup ();
+#else
+                       var userPath = MonoBtlsX509StoreManager.GetStorePath (MonoBtlsX509StoreType.UserTrustedRoots);
+                       if (Directory.Exists (userPath))
+                               store.AddDirectoryLookup (userPath, MonoBtlsX509FileType.PEM);
+                       var machinePath = MonoBtlsX509StoreManager.GetStorePath (MonoBtlsX509StoreType.MachineTrustedRoots);
+                       if (Directory.Exists (machinePath))
+                               store.AddDirectoryLookup (machinePath, MonoBtlsX509FileType.PEM);
+#endif
+               }
+
+               public static string GetSystemStoreLocation ()
+               {
+#if ANDROID
+                       return "/system/etc/security/cacerts";
+#else
+                       var appData = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
+                       var path = Path.Combine (appData, ".mono", "certs", "NewTrust");
+                       return path;
+#endif
+               }
+
+               public static X509Certificate CreateCertificate (byte[] data, MonoBtlsX509Format format, bool disallowFallback = false)
+               {
+                       using (var impl = new X509CertificateImplBtls (data, format, disallowFallback)) {
+                               return new X509Certificate (impl);
+                       }
+               }
+
+               public static X509Certificate2 CreateCertificate2 (byte[] data, MonoBtlsX509Format format, bool disallowFallback = false)
+               {
+                       using (var impl = new X509CertificateImplBtls (data, format, disallowFallback)) {
+                               return new X509Certificate2 (impl);
+                       }
+               }
+
+               public static X509Certificate2 CreateCertificate2 (byte[] data, string password, bool disallowFallback = false)
+               {
+                       using (var impl = new X509CertificateImplBtls (disallowFallback)) {
+                               impl.Import (data, password, X509KeyStorageFlags.DefaultKeySet);
+                               return new X509Certificate2 (impl);
+                       }
+               }
+
+               public static X509Certificate CreateCertificate (MonoBtlsX509 x509)
+               {
+                       using (var impl = new X509CertificateImplBtls (x509, true))
+                               return new X509Certificate (impl);
+               }
+
+               public static X509Chain CreateChain ()
+               {
+                       using (var impl = new X509ChainImplBtls ())
+                               return new X509Chain (impl);
+               }
+
+               public static X509Chain GetManagedChain (MonoBtlsX509Chain chain)
+               {
+                       var impl = new X509ChainImplBtls (chain);
+                       return new X509Chain (impl);
+               }
+
+               public static MonoBtlsX509 GetBtlsCertificate (X509Certificate certificate)
+               {
+                       var impl = certificate.Impl as X509CertificateImplBtls;
+                       if (impl != null)
+                               return impl.X509.Copy ();
+
+                       return MonoBtlsX509.LoadFromData (certificate.GetRawCertData (), MonoBtlsX509Format.DER);
+               }
+
+               public static MonoBtlsX509Chain GetNativeChain (X509CertificateCollection certificates)
+               {
+                       var chain = new MonoBtlsX509Chain ();
+                       try {
+                               foreach (var cert in certificates) {
+                                       using (var x509 = GetBtlsCertificate (cert))
+                                               chain.AddCertificate (x509);
+                               }
+                               return chain;
+                       } catch {
+                               chain.Dispose ();
+                               throw;
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsSsl.cs b/mcs/class/System/Mono.Btls/MonoBtlsSsl.cs
new file mode 100644 (file)
index 0000000..d751090
--- /dev/null
@@ -0,0 +1,418 @@
+//
+// MonoBtlsSsl.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 SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+#if MONOTOUCH
+using MonoTouch;
+#endif
+
+namespace Mono.Btls
+{
+       delegate int MonoBtlsVerifyCallback (MonoBtlsX509StoreCtx ctx);
+       delegate int MonoBtlsSelectCallback ();
+
+       class MonoBtlsSsl : MonoBtlsObject
+       {
+               internal class BoringSslHandle : MonoBtlsHandle
+               {
+                       public BoringSslHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_ssl_destroy (handle);
+                               return true;
+                       }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_destroy (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_ssl_new (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_use_certificate (IntPtr handle, IntPtr x509);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_use_private_key (IntPtr handle, IntPtr key);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_add_chain_certificate (IntPtr handle, IntPtr x509);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_accept (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_connect (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_handshake (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_close (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_set_bio (IntPtr handle, IntPtr bio);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_read (IntPtr handle, IntPtr data, int len);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_write (IntPtr handle, IntPtr data, int len);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_get_error (IntPtr handle, int ret_code);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_get_version (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_set_min_version (IntPtr handle, int version);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_set_max_version (IntPtr handle, int version);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_get_cipher (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_get_ciphers (IntPtr handle, out IntPtr data);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_ssl_get_peer_certificate (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_set_cipher_list (IntPtr handle, IntPtr str);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_print_errors_cb (IntPtr func, IntPtr ctx);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_set_verify_param (IntPtr handle, IntPtr param);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_set_server_name (IntPtr handle, IntPtr name);
+
+               static BoringSslHandle Create_internal (MonoBtlsSslCtx ctx)
+               {
+                       var handle = mono_btls_ssl_new (ctx.Handle.DangerousGetHandle ());
+                       if (handle == IntPtr.Zero)
+                               throw new MonoBtlsException ();
+                       return new BoringSslHandle (handle);
+               }
+
+               PrintErrorsCallbackFunc printErrorsFunc;
+               IntPtr printErrorsFuncPtr;
+
+               public MonoBtlsSsl (MonoBtlsSslCtx ctx)
+                       : base (Create_internal (ctx))
+               {
+                       printErrorsFunc = PrintErrorsCallback;
+                       printErrorsFuncPtr = Marshal.GetFunctionPointerForDelegate (printErrorsFunc);
+               }
+
+               new internal BoringSslHandle Handle {
+                       get { return (BoringSslHandle)base.Handle; }
+               }
+
+               public void SetBio (MonoBtlsBio bio)
+               {
+                       CheckThrow ();
+                       mono_btls_ssl_set_bio (
+                               Handle.DangerousGetHandle (),
+                               bio.Handle.DangerousGetHandle ());
+               }
+
+               Exception ThrowError ([CallerMemberName] string callerName = null)
+               {
+                       string errors;
+                       try {
+                               if (callerName == null)
+                                       callerName = GetType ().Name;
+                               errors = GetErrors ();
+                       } catch {
+                               errors = null;
+                       }
+
+                       if (errors != null) {
+                               Console.Error.WriteLine ("ERROR: {0} failed: {1}", callerName, errors);
+                               throw new MonoBtlsException ("{0} failed: {1}.", callerName, errors);
+                       } else {
+                               Console.Error.WriteLine ("ERROR: {0} failed.", callerName);
+                               throw new MonoBtlsException ("{0} failed.", callerName);
+                       }
+               }
+
+               MonoBtlsSslError GetError (int ret_code)
+               {
+                       CheckThrow ();
+                       var error = mono_btls_ssl_get_error (
+                               Handle.DangerousGetHandle (), ret_code);
+                       return (MonoBtlsSslError)error;
+               }
+
+               public void SetCertificate (MonoBtlsX509 x509)
+               {
+                       CheckThrow ();
+
+                       var ret = mono_btls_ssl_use_certificate (
+                               Handle.DangerousGetHandle (),
+                               x509.Handle.DangerousGetHandle ());
+                       if (ret <= 0)
+                               throw ThrowError ();
+               }
+
+               public void SetPrivateKey (MonoBtlsKey key)
+               {
+                       CheckThrow ();
+
+                       var ret = mono_btls_ssl_use_private_key (
+                               Handle.DangerousGetHandle (),
+                               key.Handle.DangerousGetHandle ());
+                       if (ret <= 0)
+                               throw ThrowError ();
+               }
+
+               public void AddIntermediateCertificate (MonoBtlsX509 x509)
+               {
+                       CheckThrow ();
+
+                       var ret = mono_btls_ssl_add_chain_certificate (
+                               Handle.DangerousGetHandle (),
+                               x509.Handle.DangerousGetHandle ());
+                       if (ret <= 0)
+                               throw ThrowError ();
+               }
+
+               public MonoBtlsSslError Accept ()
+               {
+                       CheckThrow ();
+
+                       var ret = mono_btls_ssl_accept (Handle.DangerousGetHandle ());
+
+                       var error = GetError (ret);
+                       return error;
+               }
+
+               public MonoBtlsSslError Connect ()
+               {
+                       CheckThrow ();
+
+                       var ret = mono_btls_ssl_connect (Handle.DangerousGetHandle ());
+
+                       var error = GetError (ret);
+                       return error;
+               }
+
+               public MonoBtlsSslError Handshake ()
+               {
+                       CheckThrow ();
+
+                       var ret = mono_btls_ssl_handshake (Handle.DangerousGetHandle ());
+
+                       var error = GetError (ret);
+                       return error;
+               }
+
+               delegate int PrintErrorsCallbackFunc (IntPtr str, IntPtr len, IntPtr ctx);
+
+#if MONOTOUCH
+               [MonoPInvokeCallback (typeof (PrintErrorsCallbackFunc))]
+#endif
+               static int PrintErrorsCallback (IntPtr str, IntPtr len, IntPtr ctx)
+               {
+                       var sb = (StringBuilder)GCHandle.FromIntPtr (ctx).Target;
+                       try {
+                               var text = Marshal.PtrToStringAnsi (str, (int)len);
+                               sb.Append (text);
+                               return 1;
+                       } catch {
+                               return 0;
+                       }
+               }
+
+               public string GetErrors ()
+               {
+                       var text = new StringBuilder ();
+                       var handle = GCHandle.Alloc (text);
+
+                       try {
+                               mono_btls_ssl_print_errors_cb (printErrorsFuncPtr, GCHandle.ToIntPtr (handle));
+                               return text.ToString ();
+                       } finally {
+                               if (handle.IsAllocated)
+                                       handle.Free ();
+                       }
+               }
+
+               public void PrintErrors ()
+               {
+                       var errors = GetErrors ();
+                       if (string.IsNullOrEmpty (errors))
+                               return;
+                       Console.Error.WriteLine (errors);
+               }
+
+               public MonoBtlsSslError Read (IntPtr data, ref int dataSize)
+               {
+                       CheckThrow ();
+                       var ret = mono_btls_ssl_read (
+                               Handle.DangerousGetHandle (), data, dataSize);
+
+                       if (ret >= 0) {
+                               dataSize = ret;
+                               return MonoBtlsSslError.None;
+                       }
+
+                       var error = mono_btls_ssl_get_error (
+                               Handle.DangerousGetHandle (), ret);
+                       dataSize = 0;
+                       return (MonoBtlsSslError)error;
+               }
+
+               public MonoBtlsSslError Write (IntPtr data, ref int dataSize)
+               {
+                       CheckThrow ();
+                       var ret = mono_btls_ssl_write (
+                               Handle.DangerousGetHandle (), data, dataSize);
+
+                       if (ret >= 0) {
+                               dataSize = ret;
+                               return MonoBtlsSslError.None;
+                       }
+
+                       var error = mono_btls_ssl_get_error (
+                               Handle.DangerousGetHandle (), ret);
+                       dataSize = 0;
+                       return (MonoBtlsSslError)error;
+               }
+
+               public int GetVersion ()
+               {
+                       CheckThrow ();
+                       return mono_btls_ssl_get_version (Handle.DangerousGetHandle ());
+               }
+
+               public void SetMinVersion (int version)
+               {
+                       CheckThrow ();
+                       mono_btls_ssl_set_min_version (Handle.DangerousGetHandle (), version);
+               }
+
+               public void SetMaxVersion (int version)
+               {
+                       CheckThrow ();
+                       mono_btls_ssl_set_max_version (Handle.DangerousGetHandle (), version);
+               }
+
+               public int GetCipher ()
+               {
+                       CheckThrow ();
+                       var cipher = mono_btls_ssl_get_cipher (Handle.DangerousGetHandle ());
+                       CheckError (cipher > 0);
+                       return cipher;
+               }
+
+               public short[] GetCiphers ()
+               {
+                       CheckThrow ();
+                       IntPtr data;
+                       var count = mono_btls_ssl_get_ciphers (
+                               Handle.DangerousGetHandle (), out data);
+                       CheckError (count > 0);
+                       try {
+                               short[] ciphers = new short[count];
+                               Marshal.Copy (data, ciphers, 0, count);
+                               return ciphers;
+                       } finally {
+                               FreeDataPtr (data);
+                       }
+               }
+
+               public void SetCipherList (string str)
+               {
+                       CheckThrow ();
+                       IntPtr strPtr = IntPtr.Zero;
+                       try {
+                               strPtr = Marshal.StringToHGlobalAnsi (str);
+                               var ret = mono_btls_ssl_set_cipher_list (
+                                       Handle.DangerousGetHandle (), strPtr);
+                               CheckError (ret);
+                       } finally {
+                               if (strPtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (strPtr);
+                       }
+               }
+
+               public MonoBtlsX509 GetPeerCertificate ()
+               {
+                       CheckThrow ();
+                       var x509 = mono_btls_ssl_get_peer_certificate (
+                               Handle.DangerousGetHandle ());
+                       if (x509 == IntPtr.Zero)
+                               return null;
+                       return new MonoBtlsX509 (new MonoBtlsX509.BoringX509Handle (x509));
+               }
+
+               public void SetVerifyParam (MonoBtlsX509VerifyParam param)
+               {
+                       CheckThrow ();
+                       var ret = mono_btls_ssl_set_verify_param (
+                               Handle.DangerousGetHandle (),
+                               param.Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               public void SetServerName (string name)
+               {
+                       CheckThrow ();
+                       IntPtr namePtr = IntPtr.Zero;
+                       try {
+                               namePtr = Marshal.StringToHGlobalAnsi (name);
+                               var ret = mono_btls_ssl_set_server_name (
+                                       Handle.DangerousGetHandle (), namePtr);
+                               CheckError (ret);
+                       } finally {
+                               if (namePtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (namePtr);
+                       }
+               }
+
+               protected override void Close ()
+               {
+                       mono_btls_ssl_close (Handle.DangerousGetHandle ());
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsSslCtx.cs b/mcs/class/System/Mono.Btls/MonoBtlsSslCtx.cs
new file mode 100644 (file)
index 0000000..fd9b6f1
--- /dev/null
@@ -0,0 +1,260 @@
+//
+// MonoBtlsSslCtx.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+#if MONOTOUCH
+using MonoTouch;
+#endif
+
+namespace Mono.Btls
+{
+       class MonoBtlsSslCtx : MonoBtlsObject
+       {
+               internal class BoringSslCtxHandle : MonoBtlsHandle
+               {
+                       public BoringSslCtxHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_ssl_ctx_free (handle);
+                               return true;
+                       }
+               }
+
+               new internal BoringSslCtxHandle Handle {
+                       get { return (BoringSslCtxHandle)base.Handle; }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_ssl_ctx_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_ctx_free (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_ssl_ctx_up_ref (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_ctx_initialize (IntPtr handle, IntPtr instance);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_ctx_set_debug_bio (IntPtr handle, IntPtr bio);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_ctx_set_cert_verify_callback (IntPtr handle, IntPtr func, int cert_required);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_ctx_set_cert_select_callback (IntPtr handle, IntPtr func);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_ctx_set_min_version (IntPtr handle, int version);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_ssl_ctx_set_max_version (IntPtr handle, int version);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_ctx_is_cipher_supported (IntPtr handle, short value);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_ctx_set_ciphers (IntPtr handle, int count, IntPtr data, int allow_unsupported);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_ssl_ctx_set_verify_param (IntPtr handle, IntPtr param);
+
+               delegate int NativeVerifyFunc (IntPtr instance, int preverify_ok, IntPtr ctx);
+               delegate int NativeSelectFunc (IntPtr instance);
+
+               NativeVerifyFunc verifyFunc;
+               NativeSelectFunc selectFunc;
+               IntPtr verifyFuncPtr;
+               IntPtr selectFuncPtr;
+               MonoBtlsVerifyCallback verifyCallback;
+               MonoBtlsSelectCallback selectCallback;
+               MonoBtlsX509Store store;
+               GCHandle instance;
+               IntPtr instancePtr;
+
+               public MonoBtlsSslCtx ()
+                       : this (new BoringSslCtxHandle (mono_btls_ssl_ctx_new ()))
+               {
+               }
+
+               internal MonoBtlsSslCtx (BoringSslCtxHandle handle)
+                       : base (handle)
+               {
+                       instance = GCHandle.Alloc (this);
+                       instancePtr = GCHandle.ToIntPtr (instance);
+                       mono_btls_ssl_ctx_initialize (
+                               handle.DangerousGetHandle (), instancePtr);
+
+                       verifyFunc = NativeVerifyCallback;
+                       selectFunc = NativeSelectCallback;
+                       verifyFuncPtr = Marshal.GetFunctionPointerForDelegate (verifyFunc);
+                       selectFuncPtr = Marshal.GetFunctionPointerForDelegate (selectFunc);
+
+                       store = new MonoBtlsX509Store (Handle);
+               }
+
+               internal MonoBtlsSslCtx Copy ()
+               {
+                       var copy = mono_btls_ssl_ctx_up_ref (Handle.DangerousGetHandle ());
+                       return new MonoBtlsSslCtx (new BoringSslCtxHandle (copy));
+               }
+
+               public MonoBtlsX509Store CertificateStore {
+                       get { return store; }
+               }
+
+               int VerifyCallback (bool preverify_ok, MonoBtlsX509StoreCtx ctx)
+               {
+                       if (verifyCallback != null)
+                               return verifyCallback (ctx);
+                       return 0;
+               }
+
+#if MONOTOUCH
+               [MonoPInvokeCallback (typeof (NativeVerifyFunc))]
+#endif
+               static int NativeVerifyCallback (IntPtr instance, int preverify_ok, IntPtr store_ctx)
+               {
+                       var c = (MonoBtlsSslCtx)GCHandle.FromIntPtr (instance).Target;
+                       using (var ctx = new MonoBtlsX509StoreCtx (preverify_ok, store_ctx)) {
+                               try {
+                                       return c.VerifyCallback (preverify_ok != 0, ctx);
+                               } catch (Exception ex) {
+                                       c.SetException (ex);
+                               }
+                       }
+                       return 0;
+               }
+
+               int SelectCallback ()
+               {
+                       if (selectCallback != null)
+                               return selectCallback ();
+                       return 1;
+               }
+
+#if MONOTOUCH
+               [MonoPInvokeCallback (typeof (NativeSelectFunc))]
+#endif
+               static int NativeSelectCallback (IntPtr instance)
+               {
+                       var c = (MonoBtlsSslCtx)GCHandle.FromIntPtr (instance).Target;
+                       try {
+                               return c.SelectCallback ();
+                       } catch (Exception ex) {
+                               c.SetException (ex);
+                               return 0;
+                       }
+               }
+
+               public void SetDebugBio (MonoBtlsBio bio)
+               {
+                       CheckThrow ();
+                       mono_btls_ssl_ctx_set_debug_bio (Handle.DangerousGetHandle (), bio.Handle.DangerousGetHandle ());
+               }
+
+               public void SetVerifyCallback (MonoBtlsVerifyCallback callback, bool client_cert_required)
+               {
+                       CheckThrow ();
+
+                       verifyCallback = callback;
+                       mono_btls_ssl_ctx_set_cert_verify_callback (
+                               Handle.DangerousGetHandle (), verifyFuncPtr,
+                               client_cert_required ? 1 : 0);
+               }
+
+               public void SetSelectCallback (MonoBtlsSelectCallback callback)
+               {
+                       CheckThrow ();
+
+                       selectCallback = callback;
+                       mono_btls_ssl_ctx_set_cert_select_callback (
+                               Handle.DangerousGetHandle (), selectFuncPtr);
+               }
+
+               public void SetMinVersion (int version)
+               {
+                       CheckThrow ();
+                       mono_btls_ssl_ctx_set_min_version (Handle.DangerousGetHandle (), version);
+               }
+
+               public void SetMaxVersion (int version)
+               {
+                       CheckThrow ();
+                       mono_btls_ssl_ctx_set_max_version (Handle.DangerousGetHandle (), version);
+               }
+
+               public bool IsCipherSupported (short value)
+               {
+                       CheckThrow ();
+                       return mono_btls_ssl_ctx_is_cipher_supported (Handle.DangerousGetHandle (), value) != 0;
+               }
+
+               public void SetCiphers (short[] ciphers, bool allow_unsupported)
+               {
+                       CheckThrow ();
+                       var data = Marshal.AllocHGlobal (ciphers.Length * 2);
+                       try {
+                               Marshal.Copy (ciphers, 0, data, ciphers.Length);
+                               var ret = mono_btls_ssl_ctx_set_ciphers (
+                                       Handle.DangerousGetHandle (),
+                                       ciphers.Length, data, allow_unsupported ? 1 : 0);
+                               CheckError (ret > 0);
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public void SetVerifyParam (MonoBtlsX509VerifyParam param)
+               {
+                       CheckThrow ();
+                       var ret = mono_btls_ssl_ctx_set_verify_param (
+                               Handle.DangerousGetHandle (),
+                               param.Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               protected override void Close ()
+               {
+                       if (store != null) {
+                               store.Dispose ();
+                               store = null;
+                       }
+                       if (instance.IsAllocated)
+                               instance.Free ();
+                       base.Close ();
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsSslError.cs b/mcs/class/System/Mono.Btls/MonoBtlsSslError.cs
new file mode 100644 (file)
index 0000000..432ba5d
--- /dev/null
@@ -0,0 +1,47 @@
+//
+// MonoBtlsSslError.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 SECURITY_DEP && MONO_FEATURE_BTLS
+namespace Mono.Btls
+{
+       // keep in sync with boringssl/include/ssl.h
+       enum MonoBtlsSslError
+       {
+               None = 0,
+               Ssl = 1,
+               WantRead = 2,
+               WantWrite = 3,
+               WantX509Lookup = 4,
+               Syscall = 5,
+               ZeroReturn = 6,
+               WantConnect = 7,
+               WantAccept = 8,
+               WantChannelIdLookup = 9,
+               PendingSession = 11,
+               PendingCertificate = 12,
+               WantPrivateKeyOperation = 13
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsStream.cs b/mcs/class/System/Mono.Btls/MonoBtlsStream.cs
new file mode 100644 (file)
index 0000000..38b6d83
--- /dev/null
@@ -0,0 +1,65 @@
+//
+// MonoBtlsStream.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+using System;
+using System.IO;
+using System.Security.Authentication;
+using System.Security.Cryptography.X509Certificates;
+
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+#else
+using Mono.Security.Interface;
+#endif
+
+using MNS = Mono.Net.Security;
+
+namespace Mono.Btls
+{
+       class MonoBtlsStream : MNS.MobileAuthenticatedStream
+       {
+               public MonoBtlsStream (Stream innerStream, bool leaveInnerStreamOpen, MonoTlsSettings settings, MonoTlsProvider provider)
+                       : base (innerStream, leaveInnerStreamOpen, settings, provider)
+               {
+               }
+
+               protected override MNS.MobileTlsContext CreateContext (
+                       MNS.MobileAuthenticatedStream parent, bool serverMode, string targetHost,
+                       SslProtocols enabledProtocols, X509Certificate serverCertificate,
+                       X509CertificateCollection clientCertificates, bool askForClientCert)
+               {
+                       return new MonoBtlsContext (
+                               parent, serverMode, targetHost,
+                               enabledProtocols, serverCertificate,
+                               clientCertificates, askForClientCert);
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsUtils.cs b/mcs/class/System/Mono.Btls/MonoBtlsUtils.cs
new file mode 100644 (file)
index 0000000..4175968
--- /dev/null
@@ -0,0 +1,187 @@
+//
+// MonoBtlsUtils.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.Text;
+using System.Security.Cryptography.X509Certificates;
+
+namespace Mono.Btls
+{
+       static class MonoBtlsUtils
+       {
+               static byte[] emailOid = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01 };
+
+               public static bool Compare (byte[] a, byte[] b)
+               {
+                       if (a.Length != b.Length)
+                               return false;
+                       for (int i = 0; i < a.Length; i++) {
+                               if (a[i] != b[i])
+                                       return false;
+                       }
+                       return true;
+               }
+
+               static bool AppendEntry (StringBuilder sb, MonoBtlsX509Name name, int index, string separator, bool quotes)
+               {
+                       var type = name.GetEntryType (index);
+                       if (type < 0)
+                               return false;
+                       else if (type == 0) {
+                               var oidValue = name.GetEntryOidData (index);
+                               if (Compare (oidValue, emailOid))
+                                       type = MonoBtlsX509NameEntryType.Email;
+                       }
+                       int tag;
+                       var text = name.GetEntryValue (index, out tag);
+                       if (text == null)
+                               return false;
+                       var oid = name.GetEntryOid (index);
+                       if (oid == null)
+                               return false;
+
+                       if (sb.Length > 0)
+                               sb.Append (separator);
+
+                       switch (type) {
+                       case MonoBtlsX509NameEntryType.CountryName:
+                               sb.Append ("C=");
+                               break;
+                       case MonoBtlsX509NameEntryType.OrganizationName:
+                               sb.Append ("O=");
+                               break;
+                       case MonoBtlsX509NameEntryType.OrganizationalUnitName:
+                               sb.Append ("OU=");
+                               break;
+                       case MonoBtlsX509NameEntryType.CommonName:
+                               sb.Append ("CN=");
+                               break;
+                       case MonoBtlsX509NameEntryType.LocalityName:
+                               sb.Append ("L=");
+                               break;
+                       case MonoBtlsX509NameEntryType.StateOrProvinceName:
+                               sb.Append ("S=");       // NOTE: RFC2253 uses ST=
+                               break;
+                       case MonoBtlsX509NameEntryType.StreetAddress:
+                               sb.Append ("STREET=");
+                               break;
+                       case MonoBtlsX509NameEntryType.DomainComponent:
+                               sb.Append ("DC=");
+                               break;
+                       case MonoBtlsX509NameEntryType.UserId:
+                               sb.Append ("UID=");
+                               break;
+                       case MonoBtlsX509NameEntryType.Email:
+                               sb.Append ("E=");       // NOTE: Not part of RFC2253
+                               break;
+                       case MonoBtlsX509NameEntryType.DnQualifier:
+                               sb.Append ("dnQualifier=");
+                               break;
+                       case MonoBtlsX509NameEntryType.Title:
+                               sb.Append ("T=");
+                               break;
+                       case MonoBtlsX509NameEntryType.Surname:
+                               sb.Append ("SN=");
+                               break;
+                       case MonoBtlsX509NameEntryType.GivenName:
+                               sb.Append ("G=");
+                               break;
+                       case MonoBtlsX509NameEntryType.Initial:
+                               sb.Append ("I=");
+                               break;
+                       default:
+                               // unknown OID
+                               sb.Append ("OID.");     // NOTE: Not present as RFC2253
+                               sb.Append (oid);
+                               sb.Append ("=");
+                               break;
+                       }
+
+                       // 16bits or 8bits string ? TODO not complete (+special chars!)
+                       char[] specials = { ',', '+', '"', '\\', '<', '>', ';' };
+                       if (quotes && tag != 0x1E) {
+                               if ((text.IndexOfAny (specials, 0, text.Length) > 0) ||
+                                   text.StartsWith (" ") || (text.EndsWith (" ")))
+                                       text = "\"" + text + "\"";
+                       }
+
+                       sb.Append (text);
+                       return true;
+               }
+
+               const X500DistinguishedNameFlags AllFlags = X500DistinguishedNameFlags.Reversed |
+                       X500DistinguishedNameFlags.UseSemicolons | X500DistinguishedNameFlags.DoNotUsePlusSign |
+                       X500DistinguishedNameFlags.DoNotUseQuotes | X500DistinguishedNameFlags.UseCommas |
+                       X500DistinguishedNameFlags.UseNewLines | X500DistinguishedNameFlags.UseUTF8Encoding |
+                       X500DistinguishedNameFlags.UseT61Encoding | X500DistinguishedNameFlags.ForceUTF8Encoding;
+
+               static string GetSeparator (X500DistinguishedNameFlags flag)
+               {
+                       if ((flag & X500DistinguishedNameFlags.UseSemicolons) != 0)
+                               return "; ";
+                       if ((flag & X500DistinguishedNameFlags.UseCommas) != 0)
+                               return ", ";
+                       if ((flag & X500DistinguishedNameFlags.UseNewLines) != 0)
+                               return Environment.NewLine;
+                       return ", "; //default
+               }
+
+               public static string FormatName (MonoBtlsX509Name name, X500DistinguishedNameFlags flag)
+               {
+                       if ((flag != 0) && ((flag & AllFlags) == 0))
+                               throw new ArgumentException ("flag");
+
+                       if (name.GetEntryCount () == 0)
+                               return String.Empty;
+
+                       // Mono.Security reversed isn't the same as fx 2.0 (which is the reverse of 1.x)
+                       bool reversed = ((flag & X500DistinguishedNameFlags.Reversed) != 0);
+                       bool quotes = ((flag & X500DistinguishedNameFlags.DoNotUseQuotes) == 0);
+                       string separator = GetSeparator (flag);
+
+                       return FormatName (name, reversed, separator, quotes);
+               }
+
+               public static string FormatName (MonoBtlsX509Name name, bool reversed, string separator, bool quotes)
+               {
+                       var count = name.GetEntryCount ();
+                       StringBuilder sb = new StringBuilder ();
+
+                       if (reversed) {
+                               for (int i = count - 1; i >= 0; i--) {
+                                       AppendEntry (sb, name, i, separator, quotes);
+                               }
+                       } else {
+                               for (int i = 0; i < count; i++) {
+                                       AppendEntry (sb, name, i, separator, quotes);
+                               }
+                       }
+
+                       return sb.ToString ();
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509.cs
new file mode 100644 (file)
index 0000000..c722ad9
--- /dev/null
@@ -0,0 +1,465 @@
+//
+// MonoBtlsX509.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Text;
+using System.Threading;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Cryptography;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509 : MonoBtlsObject
+       {
+               internal class BoringX509Handle : MonoBtlsHandle
+               {
+                       public BoringX509Handle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               if (handle != IntPtr.Zero)
+                                       mono_btls_x509_free (handle);
+                               return true;
+                       }
+
+                       public IntPtr StealHandle ()
+                       {
+                               var retval = Interlocked.Exchange (ref handle, IntPtr.Zero);
+                               return retval;
+                       }
+               }
+
+               new internal BoringX509Handle Handle {
+                       get { return (BoringX509Handle)base.Handle; }
+               }
+
+               internal MonoBtlsX509 (BoringX509Handle handle) 
+                       : base (handle)
+               {
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_up_ref (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_from_data (IntPtr data, int len, MonoBtlsX509Format format);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_get_subject_name (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_get_issuer_name (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_subject_name_string (IntPtr handle, IntPtr buffer, int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_issuer_name_string (IntPtr handle, IntPtr buffer, int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_raw_data (IntPtr handle, IntPtr bio, MonoBtlsX509Format format);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_cmp (IntPtr a, IntPtr b);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_hash (IntPtr handle, out IntPtr data);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static long mono_btls_x509_get_not_before (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static long mono_btls_x509_get_not_after (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_public_key (IntPtr handle, IntPtr bio);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_serial_number (IntPtr handle, IntPtr data, int size, int mono_style);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_version (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_signature_algorithm (IntPtr handle, IntPtr buffer, int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_public_key_asn1 (IntPtr handle, IntPtr oid, int oid_size, out IntPtr data, out int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_public_key_parameters (IntPtr handle, IntPtr oid, int oid_size, out IntPtr data, out int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_get_pubkey (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_get_subject_key_identifier (IntPtr handle, out IntPtr data, out int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_print (IntPtr handle, IntPtr bio);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_free (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_dup (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_add_trust_object (IntPtr handle, MonoBtlsX509Purpose purpose);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_add_reject_object (IntPtr handle, MonoBtlsX509Purpose purpose);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_add_explicit_trust (IntPtr handle, MonoBtlsX509TrustKind kind);
+
+               internal MonoBtlsX509 Copy ()
+               {
+                       var copy = mono_btls_x509_up_ref (Handle.DangerousGetHandle ());
+                       CheckError (copy != IntPtr.Zero);
+                       return new MonoBtlsX509 (new BoringX509Handle (copy));
+               }
+
+               // This will actually duplicate the underlying 'X509 *' object instead of
+               // simply increasing the reference count.
+               internal MonoBtlsX509 Duplicate ()
+               {
+                       var copy = mono_btls_x509_dup (Handle.DangerousGetHandle ());
+                       CheckError (copy != IntPtr.Zero);
+                       return new MonoBtlsX509 (new BoringX509Handle (copy));
+               }
+
+               public static MonoBtlsX509 LoadFromData (byte[] buffer, MonoBtlsX509Format format)
+               {
+                       var data = Marshal.AllocHGlobal (buffer.Length);
+                       if (data == IntPtr.Zero)
+                               throw new OutOfMemoryException ();
+
+                       try {
+                               Marshal.Copy (buffer, 0, data, buffer.Length);
+                               var x509 = mono_btls_x509_from_data (data, buffer.Length, format);
+                               if (x509 == IntPtr.Zero)
+                                       throw new MonoBtlsException ("Failed to read certificate from data.");
+
+                               return new MonoBtlsX509 (new BoringX509Handle (x509));
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public MonoBtlsX509Name GetSubjectName ()
+               {
+                       var handle = mono_btls_x509_get_subject_name (Handle.DangerousGetHandle ());
+                       CheckError (handle != IntPtr.Zero);
+                       return new MonoBtlsX509Name (new MonoBtlsX509Name.BoringX509NameHandle (handle, false));
+               }
+
+               public string GetSubjectNameString ()
+               {
+                       const int size = 4096;
+                       var data = Marshal.AllocHGlobal (size);
+                       try {
+                               var ret = mono_btls_x509_get_subject_name_string (
+                                       Handle.DangerousGetHandle (), data, size);
+                               CheckError (ret);
+                               return Marshal.PtrToStringAnsi (data);
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public long GetSubjectNameHash ()
+               {
+                       CheckThrow ();
+                       using (var subject = GetSubjectName ())
+                               return subject.GetHash ();
+               }
+
+               public MonoBtlsX509Name GetIssuerName ()
+               {
+                       var handle = mono_btls_x509_get_issuer_name (Handle.DangerousGetHandle ());
+                       CheckError (handle != IntPtr.Zero);
+                       return new MonoBtlsX509Name (new MonoBtlsX509Name.BoringX509NameHandle (handle, false));
+               }
+
+               public string GetIssuerNameString ()
+               {
+                       const int size = 4096;
+                       var data = Marshal.AllocHGlobal (size);
+                       try {
+                               var ret = mono_btls_x509_get_issuer_name_string (
+                                       Handle.DangerousGetHandle (), data, size);
+                               CheckError (ret);
+                               return Marshal.PtrToStringAnsi (data);
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public byte[] GetRawData (MonoBtlsX509Format format)
+               {
+                       using (var bio = new MonoBtlsBioMemory ()) {
+                               var ret = mono_btls_x509_get_raw_data (
+                                       Handle.DangerousGetHandle (),
+                                       bio.Handle.DangerousGetHandle (),
+                                       format);
+                               CheckError (ret);
+                               return bio.GetData ();
+                       }
+               }
+
+               public void GetRawData (MonoBtlsBio bio, MonoBtlsX509Format format)
+               {
+                       CheckThrow ();
+                       var ret = mono_btls_x509_get_raw_data (
+                               Handle.DangerousGetHandle (),
+                               bio.Handle.DangerousGetHandle (),
+                               format);
+                       CheckError (ret);
+               }
+
+               public static int Compare (MonoBtlsX509 a, MonoBtlsX509 b)
+               {
+                       return mono_btls_x509_cmp (
+                               a.Handle.DangerousGetHandle (),
+                               b.Handle.DangerousGetHandle ());
+               }
+
+               public byte[] GetCertHash ()
+               {
+                       IntPtr data;
+                       var ret = mono_btls_x509_get_hash (Handle.DangerousGetHandle (), out data);
+                       CheckError (ret > 0);
+                       var buffer = new byte [ret];
+                       Marshal.Copy (data, buffer, 0, ret);
+                       return buffer;
+               }
+
+               public DateTime GetNotBefore ()
+               {
+                       var ticks = mono_btls_x509_get_not_before (Handle.DangerousGetHandle ());
+                       return new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds (ticks);
+               }
+
+               public DateTime GetNotAfter ()
+               {
+                       var ticks = mono_btls_x509_get_not_after (Handle.DangerousGetHandle ());
+                       return new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds (ticks);
+               }
+
+               public byte[] GetPublicKeyData ()
+               {
+                       using (var bio = new MonoBtlsBioMemory ()) {
+                               var ret = mono_btls_x509_get_public_key (
+                                       Handle.DangerousGetHandle (),
+                                       bio.Handle.DangerousGetHandle ());
+                               CheckError (ret > 0);
+                               return bio.GetData ();
+                       }
+               }
+
+               public byte[] GetSerialNumber (bool mono_style)
+               {
+                       int size = 256;
+                       IntPtr data = Marshal.AllocHGlobal (size);
+                       try {
+                               var ret = mono_btls_x509_get_serial_number (
+                                       Handle.DangerousGetHandle (), data,
+                                       size, mono_style ? 1 : 0);
+                               CheckError (ret > 0);
+                               var buffer = new byte [ret];
+                               Marshal.Copy (data, buffer, 0, ret);
+                               return buffer;
+                       } finally {
+                               if (data != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public int GetVersion ()
+               {
+                       return mono_btls_x509_get_version (Handle.DangerousGetHandle ());
+               }
+
+               public Oid GetSignatureAlgorithm ()
+               {
+                       int size = 256;
+                       IntPtr data = Marshal.AllocHGlobal (size);
+                       try {
+                               var ret = mono_btls_x509_get_signature_algorithm (
+                                       Handle.DangerousGetHandle (), data, size);
+                               CheckError (ret > 0);
+                               return new Oid (Marshal.PtrToStringAnsi (data));
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public AsnEncodedData GetPublicKeyAsn1 ()
+               {
+                       int size;
+                       IntPtr data;
+
+                       int oidSize = 256;
+                       var oidData = Marshal.AllocHGlobal (256);
+                       string oid;
+
+                       try {
+                               var ret = mono_btls_x509_get_public_key_asn1 (
+                                       Handle.DangerousGetHandle (), oidData, oidSize,
+                                       out data, out size);
+                               CheckError (ret);
+                               oid = Marshal.PtrToStringAnsi (oidData);
+                       } finally {
+                               Marshal.FreeHGlobal (oidData);
+                       }
+
+                       try {
+                               var buffer = new byte[size];
+                               Marshal.Copy (data, buffer, 0, size);
+                               return new AsnEncodedData (oid.ToString (), buffer);
+                       } finally {
+                               if (data != IntPtr.Zero)
+                                       FreeDataPtr (data);
+                       }
+               }
+
+               public AsnEncodedData GetPublicKeyParameters ()
+               {
+                       int size;
+                       IntPtr data;
+
+                       int oidSize = 256;
+                       var oidData = Marshal.AllocHGlobal (256);
+                       string oid;
+
+                       try {
+                               var ret = mono_btls_x509_get_public_key_parameters (
+                                       Handle.DangerousGetHandle (), oidData, oidSize,
+                                       out data, out size);
+                               CheckError (ret);
+                               oid = Marshal.PtrToStringAnsi (oidData);
+                       } finally {
+                               Marshal.FreeHGlobal (oidData);
+                       }
+
+                       try {
+                               var buffer = new byte[size];
+                               Marshal.Copy (data, buffer, 0, size);
+                               return new AsnEncodedData (oid.ToString (), buffer);
+                       } finally {
+                               if (data != IntPtr.Zero)
+                                       FreeDataPtr (data);
+                       }
+               }
+
+               public byte[] GetSubjectKeyIdentifier ()
+               {
+                       int size;
+                       IntPtr data = IntPtr.Zero;
+
+                       try {
+                               var ret = mono_btls_x509_get_subject_key_identifier (
+                                       Handle.DangerousGetHandle (), out data, out size);
+                               CheckError (ret);
+                               var buffer = new byte[size];
+                               Marshal.Copy (data, buffer, 0, size);
+                               return buffer;
+                       } finally {
+                               if (data != IntPtr.Zero)
+                                       FreeDataPtr (data);
+                       }
+               }
+
+               public MonoBtlsKey GetPublicKey ()
+               {
+                       var handle = mono_btls_x509_get_pubkey (Handle.DangerousGetHandle ());
+                       CheckError (handle != IntPtr.Zero);
+                       return new MonoBtlsKey (new MonoBtlsKey.BoringKeyHandle (handle));
+               }
+
+               public void Print (MonoBtlsBio bio)
+               {
+                       var ret = mono_btls_x509_print (
+                               Handle.DangerousGetHandle (),
+                               bio.Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               public void ExportAsPEM (MonoBtlsBio bio, bool includeHumanReadableForm)
+               {
+                       GetRawData (bio, MonoBtlsX509Format.PEM);
+
+                       if (!includeHumanReadableForm)
+                               return;
+
+                       Print (bio);
+
+                       var hash = GetCertHash ();
+                       var output = new StringBuilder ();
+                       output.Append ("SHA1 Fingerprint=");
+                       for (int i = 0; i < hash.Length; i++) {
+                               if (i > 0)
+                                       output.Append (":");
+                               output.AppendFormat ("{0:X2}", hash [i]);
+                       }
+                       output.AppendLine ();
+                       var outputData = Encoding.ASCII.GetBytes (output.ToString ());
+                       bio.Write (outputData, 0, outputData.Length);
+               }
+
+               public void AddTrustObject (MonoBtlsX509Purpose purpose)
+               {
+                       CheckThrow ();
+                       var ret = mono_btls_x509_add_trust_object (
+                               Handle.DangerousGetHandle (), purpose);
+                       CheckError (ret);
+               }
+
+               public void AddRejectObject (MonoBtlsX509Purpose purpose)
+               {
+                       CheckThrow ();
+                       var ret = mono_btls_x509_add_reject_object (
+                               Handle.DangerousGetHandle (), purpose);
+                       CheckError (ret);
+               }
+
+               public void AddExplicitTrust (MonoBtlsX509TrustKind kind)
+               {
+                       CheckThrow ();
+                       var ret = mono_btls_x509_add_explicit_trust (
+                               Handle.DangerousGetHandle (), kind);
+                       CheckError (ret);
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Chain.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Chain.cs
new file mode 100644 (file)
index 0000000..7113d1f
--- /dev/null
@@ -0,0 +1,122 @@
+//
+// MonoBtlsX509Chain.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Security.Cryptography.X509Certificates;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509Chain : MonoBtlsObject
+       {
+               internal class BoringX509ChainHandle : MonoBtlsHandle
+               {
+                       public BoringX509ChainHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_x509_chain_free (handle);
+                               return true;
+                       }
+               }
+
+               new internal BoringX509ChainHandle Handle {
+                       get { return (BoringX509ChainHandle)base.Handle; }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_chain_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_chain_get_count (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_chain_get_cert (IntPtr Handle, int index);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_chain_add_cert (IntPtr chain, IntPtr x509);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_chain_up_ref (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_chain_free (IntPtr handle);
+
+               public MonoBtlsX509Chain ()
+                       : base (new BoringX509ChainHandle (mono_btls_x509_chain_new ()))
+               {
+               }
+
+               internal MonoBtlsX509Chain (BoringX509ChainHandle handle)
+                       : base (handle)
+               {
+               }
+
+               public int Count {
+                       get { return mono_btls_x509_chain_get_count (Handle.DangerousGetHandle ()); }
+               }
+
+               public MonoBtlsX509 GetCertificate (int index)
+               {
+                       if (index >= Count)
+                               throw new IndexOutOfRangeException ();
+                       var handle = mono_btls_x509_chain_get_cert (
+                               Handle.DangerousGetHandle (), index);
+                       CheckError (handle != IntPtr.Zero);
+                       return new MonoBtlsX509 (new MonoBtlsX509.BoringX509Handle (handle));
+               }
+
+               public void Dump ()
+               {
+                       Console.Error.WriteLine ("CHAIN: {0:x} {1}", Handle, Count);
+                       for (int i = 0; i < Count; i++) {
+                               using (var cert = GetCertificate (i)) {
+                                       Console.Error.WriteLine ("  CERT #{0}: {1}", i, cert.GetSubjectNameString ());
+                               }
+                       }
+               }
+
+               public void AddCertificate (MonoBtlsX509 x509)
+               {
+                       mono_btls_x509_chain_add_cert (
+                               Handle.DangerousGetHandle (),
+                               x509.Handle.DangerousGetHandle ());
+               }
+
+               internal MonoBtlsX509Chain Copy ()
+               {
+                       var copy = mono_btls_x509_chain_up_ref (Handle.DangerousGetHandle ());
+                       CheckError (copy != IntPtr.Zero);
+                       return new MonoBtlsX509Chain (new BoringX509ChainHandle (copy));
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs
new file mode 100644 (file)
index 0000000..6801b79
--- /dev/null
@@ -0,0 +1,185 @@
+//
+// MonoBtlsX509Crl.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Text;
+using System.Threading;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Cryptography;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509Crl : MonoBtlsObject
+       {
+               internal class BoringX509CrlHandle : MonoBtlsHandle
+               {
+                       public BoringX509CrlHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               if (handle != IntPtr.Zero)
+                                       mono_btls_x509_crl_free (handle);
+                               return true;
+                       }
+
+                       public IntPtr StealHandle ()
+                       {
+                               var retval = Interlocked.Exchange (ref handle, IntPtr.Zero);
+                               return retval;
+                       }
+               }
+
+               new internal BoringX509CrlHandle Handle {
+                       get { return (BoringX509CrlHandle)base.Handle; }
+               }
+
+               internal MonoBtlsX509Crl (BoringX509CrlHandle handle) 
+                       : base (handle)
+               {
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_crl_ref (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_crl_from_data (IntPtr data, int len, MonoBtlsX509Format format);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_crl_get_by_cert (IntPtr handle, IntPtr x509);
+
+               [DllImport (BTLS_DYLIB)]
+               unsafe extern static IntPtr mono_btls_x509_crl_get_by_serial (IntPtr handle, void *serial, int len);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_crl_get_revoked_count (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_crl_get_revoked (IntPtr handle, int index);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static long mono_btls_x509_crl_get_last_update (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static long mono_btls_x509_crl_get_next_update (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static long mono_btls_x509_crl_get_version (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_crl_get_issuer (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_crl_free (IntPtr handle);
+
+               public static MonoBtlsX509Crl LoadFromData (byte[] buffer, MonoBtlsX509Format format)
+               {
+                       var data = Marshal.AllocHGlobal (buffer.Length);
+                       if (data == IntPtr.Zero)
+                               throw new OutOfMemoryException ();
+
+                       try {
+                               Marshal.Copy (buffer, 0, data, buffer.Length);
+                               var crl = mono_btls_x509_crl_from_data (data, buffer.Length, format);
+                               if (crl == IntPtr.Zero)
+                                       throw new MonoBtlsException ("Failed to read CRL from data.");
+
+                               return new MonoBtlsX509Crl (new BoringX509CrlHandle (crl));
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public MonoBtlsX509Revoked GetByCert (MonoBtlsX509 x509)
+               {
+                       var revoked = mono_btls_x509_crl_get_by_cert (
+                               Handle.DangerousGetHandle (),
+                               x509.Handle.DangerousGetHandle ());
+                       if (revoked == IntPtr.Zero)
+                               return null;
+                       return new MonoBtlsX509Revoked (new MonoBtlsX509Revoked.BoringX509RevokedHandle (revoked));
+               }
+
+               public unsafe MonoBtlsX509Revoked GetBySerial (byte[] serial)
+               {
+                       fixed (void *ptr = serial)
+                       {
+                               var revoked = mono_btls_x509_crl_get_by_serial (
+                                       Handle.DangerousGetHandle (), ptr, serial.Length);
+                               if (revoked == IntPtr.Zero)
+                                       return null;
+                               return new MonoBtlsX509Revoked (new MonoBtlsX509Revoked.BoringX509RevokedHandle (revoked));
+                       }
+               }
+
+               public int GetRevokedCount ()
+               {
+                       return mono_btls_x509_crl_get_revoked_count (Handle.DangerousGetHandle ());
+               }
+
+               public MonoBtlsX509Revoked GetRevoked (int index)
+               {
+                       if (index >= GetRevokedCount ())
+                               throw new ArgumentOutOfRangeException ();
+
+                       var revoked = mono_btls_x509_crl_get_revoked (
+                               Handle.DangerousGetHandle (), index);
+                       if (revoked == IntPtr.Zero)
+                               return null;
+                       return new MonoBtlsX509Revoked (new MonoBtlsX509Revoked.BoringX509RevokedHandle (revoked));
+               }
+
+               public DateTime GetLastUpdate ()
+               {
+                       var ticks = mono_btls_x509_crl_get_last_update (Handle.DangerousGetHandle ());
+                       return new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds (ticks);
+               }
+
+               public DateTime GetNextUpdate ()
+               {
+                       var ticks = mono_btls_x509_crl_get_next_update (Handle.DangerousGetHandle ());
+                       return new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds (ticks);
+               }
+
+               public long GetVersion ()
+               {
+                       return mono_btls_x509_crl_get_version (Handle.DangerousGetHandle ());
+               }
+
+               public MonoBtlsX509Name GetIssuerName ()
+               {
+                       var handle = mono_btls_x509_crl_get_issuer (Handle.DangerousGetHandle ());
+                       CheckError (handle != IntPtr.Zero);
+                       return new MonoBtlsX509Name (new MonoBtlsX509Name.BoringX509NameHandle (handle, false));
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Error.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Error.cs
new file mode 100644 (file)
index 0000000..bf40275
--- /dev/null
@@ -0,0 +1,111 @@
+//
+// MonoBtlsX509Error.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+namespace Mono.Btls
+{
+       // Keep in sync with x509_vfy.h
+       enum MonoBtlsX509Error
+       {
+               OK = 0,
+               /* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */
+
+               UNABLE_TO_GET_ISSUER_CERT = 2,
+               UNABLE_TO_GET_CRL = 3,
+               UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4,
+               UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5,
+               UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6,
+               CERT_SIGNATURE_FAILURE = 7,
+               CRL_SIGNATURE_FAILURE = 8,
+               CERT_NOT_YET_VALID = 9,
+               CERT_HAS_EXPIRED = 10,
+               CRL_NOT_YET_VALID = 11,
+               CRL_HAS_EXPIRED = 12,
+               ERROR_IN_CERT_NOT_BEFORE_FIELD = 13,
+               ERROR_IN_CERT_NOT_AFTER_FIELD = 14,
+               ERROR_IN_CRL_LAST_UPDATE_FIELD = 15,
+               ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16,
+               OUT_OF_MEM = 17,
+               DEPTH_ZERO_SELF_SIGNED_CERT = 18,
+               SELF_SIGNED_CERT_IN_CHAIN = 19,
+               UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20,
+               UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21,
+               CERT_CHAIN_TOO_LONG = 22,
+               CERT_REVOKED = 23,
+               INVALID_CA = 24,
+               PATH_LENGTH_EXCEEDED = 25,
+               INVALID_PURPOSE = 26,
+               CERT_UNTRUSTED = 27,
+               CERT_REJECTED = 28,
+               /* These are 'informational' when looking for issuer cert */
+               SUBJECT_ISSUER_MISMATCH = 29,
+               AKID_SKID_MISMATCH = 30,
+               AKID_ISSUER_SERIAL_MISMATCH = 31,
+               KEYUSAGE_NO_CERTSIGN = 32,
+
+               UNABLE_TO_GET_CRL_ISSUER = 33,
+               UNHANDLED_CRITICAL_EXTENSION = 34,
+               KEYUSAGE_NO_CRL_SIGN = 35,
+               UNHANDLED_CRITICAL_CRL_EXTENSION = 36,
+               INVALID_NON_CA = 37,
+               PROXY_PATH_LENGTH_EXCEEDED = 38,
+               KEYUSAGE_NO_DIGITAL_SIGNATURE = 39,
+               PROXY_CERTIFICATES_NOT_ALLOWED = 40,
+
+               INVALID_EXTENSION = 41,
+               INVALID_POLICY_EXTENSION = 42,
+               NO_EXPLICIT_POLICY = 43,
+               DIFFERENT_CRL_SCOPE = 44,
+               UNSUPPORTED_EXTENSION_FEATURE = 45,
+
+               UNNESTED_RESOURCE = 46,
+
+               PERMITTED_VIOLATION = 47,
+               EXCLUDED_VIOLATION = 48,
+               SUBTREE_MINMAX = 49,
+               UNSUPPORTED_CONSTRAINT_TYPE = 51,
+               UNSUPPORTED_CONSTRAINT_SYNTAX = 52,
+               UNSUPPORTED_NAME_SYNTAX = 53,
+               CRL_PATH_VALIDATION_ERROR = 54,
+
+               /* Suite B mode algorithm violation */
+               SUITE_B_INVALID_VERSION = 56,
+               SUITE_B_INVALID_ALGORITHM = 57,
+               SUITE_B_INVALID_CURVE = 58,
+               SUITE_B_INVALID_SIGNATURE_ALGORITHM = 59,
+               SUITE_B_LOS_NOT_ALLOWED = 60,
+               SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 = 61,
+
+               /* Host, email and IP check errors */
+               HOSTNAME_MISMATCH = 62,
+               EMAIL_MISMATCH = 63,
+               IP_ADDRESS_MISMATCH = 64,
+
+               /* The application is not happy */
+               APPLICATION_VERIFICATION = 50
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Exception.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Exception.cs
new file mode 100644 (file)
index 0000000..bb982bc
--- /dev/null
@@ -0,0 +1,56 @@
+//
+// MonoBtlsX509Exception.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509Exception : Exception
+       {
+               public MonoBtlsX509Error ErrorCode {
+                       get;
+                       private set;
+               }
+
+               public string ErrorMessage {
+                       get;
+                       private set;
+               }
+
+               public MonoBtlsX509Exception (MonoBtlsX509Error code, string message)
+                       : base (message)
+               {
+                       ErrorCode = code;
+                       ErrorMessage = message;
+               }
+
+               public override string ToString ()
+               {
+                       return string.Format ("[MonoBtlsX509Exception: ErrorCode={0}, ErrorMessage={1}]", ErrorCode, ErrorMessage);
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509FileType.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509FileType.cs
new file mode 100644 (file)
index 0000000..1475457
--- /dev/null
@@ -0,0 +1,37 @@
+//
+// MonoBtlsX509FileType.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+namespace Mono.Btls
+{
+       enum MonoBtlsX509FileType
+       {
+               PEM = 1,
+               ASN1 = 2,
+               DEFAULT = 3
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Format.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Format.cs
new file mode 100644 (file)
index 0000000..609d0c1
--- /dev/null
@@ -0,0 +1,36 @@
+//
+// MonoBtlsX509Format.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+namespace Mono.Btls
+{
+       enum MonoBtlsX509Format
+       {
+               DER = 1,
+               PEM = 2
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs
new file mode 100644 (file)
index 0000000..8a6bf30
--- /dev/null
@@ -0,0 +1,213 @@
+//
+// MonoBtlsX509Lookup.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+using System.Collections.Generic;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509Lookup : MonoBtlsObject
+       {
+               internal class BoringX509LookupHandle : MonoBtlsHandle
+               {
+                       public BoringX509LookupHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_x509_lookup_free (handle);
+                               return true;
+                       }
+               }
+
+               new internal BoringX509LookupHandle Handle {
+                       get { return (BoringX509LookupHandle)base.Handle; }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_lookup_new (IntPtr store, MonoBtlsX509LookupType type);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_lookup_load_file (IntPtr handle, IntPtr file, MonoBtlsX509FileType type);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_lookup_add_dir (IntPtr handle, IntPtr dir, MonoBtlsX509FileType type);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_lookup_add_mono (IntPtr handle, IntPtr monoLookup);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_lookup_init (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_lookup_shutdown (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_lookup_by_subject (IntPtr handle, IntPtr name);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_lookup_by_fingerprint (IntPtr handle, IntPtr bytes, int len);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_lookup_free (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_lookup_peek_lookup (IntPtr handle);
+
+               MonoBtlsX509LookupType type;
+               List<MonoBtlsX509LookupMono> monoLookups;
+
+#if FIXME
+               // Do we need this?
+               internal MonoBtlsX509Lookup (BoringX509LookupHandle handle)
+                       : base (handle)
+               {
+               }
+#endif
+
+               static BoringX509LookupHandle Create_internal (MonoBtlsX509Store store, MonoBtlsX509LookupType type)
+               {
+                       var handle = mono_btls_x509_lookup_new (
+                               store.Handle.DangerousGetHandle (), type);
+                       if (handle == IntPtr.Zero)
+                               throw new MonoBtlsException ();
+                       return new BoringX509LookupHandle (handle);
+               }
+
+               internal MonoBtlsX509Lookup (MonoBtlsX509Store store, MonoBtlsX509LookupType type)
+                       : base (Create_internal (store, type))
+               {
+                       this.type = type;
+               }
+
+               internal IntPtr GetNativeLookup ()
+               {
+                       return mono_btls_x509_lookup_peek_lookup (Handle.DangerousGetHandle ());
+               }
+
+               public void LoadFile (string file, MonoBtlsX509FileType type)
+               {
+                       IntPtr filePtr = IntPtr.Zero;
+                       try {
+                               if (file != null)
+                                       filePtr = Marshal.StringToHGlobalAnsi (file);
+                               var ret = mono_btls_x509_lookup_load_file (
+                                       Handle.DangerousGetHandle (), filePtr, type);
+                               CheckError (ret);
+                       } finally {
+                               if (filePtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (filePtr);
+                       }
+               }
+
+               public void AddDirectory (string dir, MonoBtlsX509FileType type)
+               {
+                       IntPtr dirPtr = IntPtr.Zero;
+                       try {
+                               if (dir != null)
+                                       dirPtr = Marshal.StringToHGlobalAnsi (dir);
+                               var ret = mono_btls_x509_lookup_add_dir (
+                                       Handle.DangerousGetHandle (), dirPtr, type);
+                               CheckError (ret);
+                       } finally {
+                               if (dirPtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (dirPtr);
+                       }
+               }
+
+               // Takes ownership of the 'monoLookup'.
+               internal void AddMono (MonoBtlsX509LookupMono monoLookup)
+               {
+                       if (type != MonoBtlsX509LookupType.MONO)
+                               throw new NotSupportedException ();
+                       var ret = mono_btls_x509_lookup_add_mono (
+                               Handle.DangerousGetHandle (), monoLookup.Handle.DangerousGetHandle ());
+                       CheckError (ret);
+
+                       if (monoLookups == null)
+                               monoLookups = new List<MonoBtlsX509LookupMono> ();
+                       monoLookups.Add (monoLookup);
+               }
+
+               public void Initialize ()
+               {
+                       var ret = mono_btls_x509_lookup_init (Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               public void Shutdown ()
+               {
+                       var ret = mono_btls_x509_lookup_shutdown (Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               public MonoBtlsX509 LookupBySubject (MonoBtlsX509Name name)
+               {
+                       var handle = mono_btls_x509_lookup_by_subject (
+                               Handle.DangerousGetHandle (),
+                               name.Handle.DangerousGetHandle ());
+                       if (handle == IntPtr.Zero)
+                               return null;
+                       return new MonoBtlsX509 (new MonoBtlsX509.BoringX509Handle (handle));
+               }
+
+               public MonoBtlsX509 LookupByFingerPrint (byte[] fingerprint)
+               {
+                       var bytes = Marshal.AllocHGlobal (fingerprint.Length);
+                       try {
+                               Marshal.Copy (fingerprint, 0, bytes, fingerprint.Length);
+                               var handle = mono_btls_x509_lookup_by_fingerprint (
+                                       Handle.DangerousGetHandle (),
+                                       bytes, fingerprint.Length);
+                               if (handle == IntPtr.Zero)
+                                       return null;
+                               return new MonoBtlsX509 (new MonoBtlsX509.BoringX509Handle (handle));
+                       } finally {
+                               if (bytes != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (bytes);
+                       }
+               }
+
+               protected override void Close ()
+               {
+                       try {
+                               if (monoLookups != null) {
+                                       foreach (var monoLookup in monoLookups)
+                                               monoLookup.Dispose ();
+                               monoLookups = null;
+                               }
+                       } finally {
+                               base.Close ();
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509LookupAndroid.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509LookupAndroid.cs
new file mode 100644 (file)
index 0000000..db0151a
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// MonoBtlsX509LookupAndroid.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS && MONODROID
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+using System.Security.Cryptography.X509Certificates;
+
+namespace Mono.Btls
+{
+       internal class MonoBtlsX509LookupAndroid : MonoBtlsX509LookupMono
+       {
+               protected override MonoBtlsX509 OnGetBySubject (MonoBtlsX509Name name)
+               {
+                       return AndroidPlatform.CertStoreLookup (name);
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509LookupMono.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509LookupMono.cs
new file mode 100644 (file)
index 0000000..cd86cde
--- /dev/null
@@ -0,0 +1,128 @@
+//
+// MonoBtlsX509LookupMono.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace Mono.Btls
+{
+       abstract class MonoBtlsX509LookupMono : MonoBtlsObject
+       {
+               internal class BoringX509LookupMonoHandle : MonoBtlsHandle
+               {
+                       public BoringX509LookupMonoHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_x509_lookup_mono_free (handle);
+                               return true;
+                       }
+               }
+
+               new internal BoringX509LookupMonoHandle Handle {
+                       get { return (BoringX509LookupMonoHandle)base.Handle; }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_lookup_mono_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_lookup_mono_init (
+                       IntPtr handle, IntPtr instance, IntPtr by_subject_func);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_lookup_mono_free (IntPtr handle);
+
+               delegate int BySubjectFunc (IntPtr instance, IntPtr name, out IntPtr x509_ptr);
+
+               GCHandle gch;
+               IntPtr instance;
+               BySubjectFunc bySubjectFunc;
+               IntPtr bySubjectFuncPtr;
+
+               internal MonoBtlsX509LookupMono ()
+                       : base (new BoringX509LookupMonoHandle (mono_btls_x509_lookup_mono_new ()))
+               {
+                       gch = GCHandle.Alloc (this);
+                       instance = GCHandle.ToIntPtr (gch);
+                       bySubjectFunc = OnGetBySubject;
+                       bySubjectFuncPtr = Marshal.GetFunctionPointerForDelegate (bySubjectFunc);
+                       mono_btls_x509_lookup_mono_init (Handle.DangerousGetHandle (), instance, bySubjectFuncPtr);
+               }
+
+               protected abstract MonoBtlsX509 OnGetBySubject (MonoBtlsX509Name name);
+
+#if MONOTOUCH
+               [MonoTouch.MonoPInvokeCallback (typeof (BySubjectFunc))]
+#endif
+               static int OnGetBySubject (IntPtr instance, IntPtr name_ptr, out IntPtr x509_ptr)
+               {
+                       try {
+                               MonoBtlsX509LookupMono obj;
+                               MonoBtlsX509Name.BoringX509NameHandle name_handle = null;
+                               try {
+                                       obj = (MonoBtlsX509LookupMono)GCHandle.FromIntPtr (instance).Target;
+                                       name_handle = new MonoBtlsX509Name.BoringX509NameHandle (name_ptr, false);
+                                       MonoBtlsX509Name name_obj = new MonoBtlsX509Name (name_handle);
+                                       var x509 = obj.OnGetBySubject (name_obj);
+                                       if (x509 != null) {
+                                               x509_ptr = x509.Handle.StealHandle ();
+                                               return 1;
+                                       } else {
+                                               x509_ptr = IntPtr.Zero;
+                                               return 0;
+                                       }
+                               } finally {
+                                       if (name_handle != null)
+                                               name_handle.Dispose ();
+                               }
+                       } catch (Exception ex) {
+                               Console.WriteLine ("LOOKUP METHOD - GET BY SUBJECT EX: {0}", ex);
+                               x509_ptr = IntPtr.Zero;
+                               return 0;
+                       }
+               }
+
+               protected override void Close ()
+               {
+                       try {
+                               if (gch.IsAllocated)
+                                       gch.Free ();
+                       } finally {
+                               instance = IntPtr.Zero;
+                               bySubjectFunc = null;
+                               bySubjectFuncPtr = IntPtr.Zero;
+                               base.Close ();
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509LookupMonoCollection.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509LookupMonoCollection.cs
new file mode 100644 (file)
index 0000000..139243e
--- /dev/null
@@ -0,0 +1,102 @@
+//
+// MonoBtlsX509LookupMonoCollection.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+using System.Security.Cryptography.X509Certificates;
+
+#if MONOTOUCH
+using MonoTouch;
+#endif
+
+namespace Mono.Btls
+{
+       internal class MonoBtlsX509LookupMonoCollection : MonoBtlsX509LookupMono
+       {
+               long[] hashes;
+               MonoBtlsX509[] certificates;
+               X509CertificateCollection collection;
+               MonoBtlsX509TrustKind trust;
+
+               internal MonoBtlsX509LookupMonoCollection (X509CertificateCollection collection, MonoBtlsX509TrustKind trust)
+               {
+                       this.collection = collection;
+                       this.trust = trust;
+               }
+
+               void Initialize ()
+               {
+                       if (certificates != null)
+                               return;
+
+                       hashes = new long [collection.Count];
+                       certificates = new MonoBtlsX509 [collection.Count];
+                       for (int i = 0; i < collection.Count; i++) {
+                               // Create new 'X509 *' instance since we need to modify it to add the
+                               // trust settings.
+                               var data = collection [i].GetRawCertData ();
+                               certificates [i] = MonoBtlsX509.LoadFromData (data, MonoBtlsX509Format.DER);
+                               certificates [i].AddExplicitTrust (trust);
+                               hashes [i] = certificates [i].GetSubjectNameHash ();
+                       }
+               }
+
+               protected override MonoBtlsX509 OnGetBySubject (MonoBtlsX509Name name)
+               {
+                       Console.WriteLine ("COLLECTION LOOKUP: {0:x} - {1}", name.GetHash (), name.GetString ());
+                       Initialize ();
+
+                       var hash = name.GetHash ();
+                       for (int i = 0; i < certificates.Length; i++) {
+                               if (hashes [i] == hash)
+                                       return certificates [i];
+                       }
+
+                       return null;
+               }
+
+               protected override void Close ()
+               {
+                       try {
+                               if (certificates != null) {
+                                       for (int i = 0; i < certificates.Length; i++) {
+                                               if (certificates [i] != null) {
+                                                       certificates [i].Dispose ();
+                                                       certificates [i] = null;
+                                               }
+                                       }
+                                       certificates = null;
+                                       hashes = null;
+                               }
+                       } finally {
+                               base.Close ();
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509LookupType.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509LookupType.cs
new file mode 100644 (file)
index 0000000..6bb42d9
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// MonoBtlsX509LookupCollection.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+
+namespace Mono.Btls
+{
+       enum MonoBtlsX509LookupType
+       {
+               UNKNOWN = 0,
+               FILE,
+               HASH_DIR,
+               MONO
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Name.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Name.cs
new file mode 100644 (file)
index 0000000..74e335a
--- /dev/null
@@ -0,0 +1,216 @@
+//
+// MonoBtlsX509Name.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509Name : MonoBtlsObject
+       {
+               internal class BoringX509NameHandle : MonoBtlsHandle
+               {
+                       bool dontFree;
+
+                       internal BoringX509NameHandle (IntPtr handle, bool ownsHandle)
+                               : base (handle, ownsHandle)
+                       {
+                               this.dontFree = !ownsHandle;
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               if (!dontFree)
+                                       mono_btls_x509_name_free (handle);
+                               return true;
+                       }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_name_print_bio (IntPtr handle, IntPtr bio);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_name_print_string (IntPtr handle, IntPtr buffer, int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_name_get_raw_data (IntPtr handle, out IntPtr buffer, int use_canon_enc);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static long mono_btls_x509_name_hash (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static long mono_btls_x509_name_hash_old (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_name_get_entry_count (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static MonoBtlsX509NameEntryType mono_btls_x509_name_get_entry_type (IntPtr name, int index);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_name_get_entry_oid (IntPtr name, int index, IntPtr buffer, int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_name_get_entry_oid_data (IntPtr name, int index, out IntPtr data);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_name_get_entry_value (IntPtr name, int index, out int tag, out IntPtr str);
+
+               [DllImport (BTLS_DYLIB)]
+               extern unsafe static IntPtr mono_btls_x509_name_from_data (void* data, int len, int use_canon_enc);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_name_free (IntPtr handle);
+
+               new internal BoringX509NameHandle Handle {
+                       get { return (BoringX509NameHandle)base.Handle; }
+               }
+
+               internal MonoBtlsX509Name (BoringX509NameHandle handle)
+                       : base (handle)
+               {
+               }
+
+               public string GetString ()
+               {
+                       const int size = 4096;
+                       var data = Marshal.AllocHGlobal (size);
+                       try {
+                               var ret = mono_btls_x509_name_print_string (
+                                       Handle.DangerousGetHandle (), data, size);
+                               CheckError (ret);
+                               return Marshal.PtrToStringAnsi (data);
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public void PrintBio (MonoBtlsBio bio)
+               {
+                       var ret = mono_btls_x509_name_print_bio (
+                               Handle.DangerousGetHandle (),
+                               bio.Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               public byte[] GetRawData (bool use_canon_enc)
+               {
+                       IntPtr data;
+                       var ret = mono_btls_x509_name_get_raw_data (
+                               Handle.DangerousGetHandle (),
+                               out data, use_canon_enc ? 1 : 0);
+                       CheckError (ret > 0);
+                       var buffer = new byte [ret];
+                       Marshal.Copy (data, buffer, 0, ret);
+                       FreeDataPtr (data);
+                       return buffer;
+               }
+
+               public long GetHash ()
+               {
+                       return mono_btls_x509_name_hash (Handle.DangerousGetHandle ());
+               }
+
+               public long GetHashOld ()
+               {
+                       return mono_btls_x509_name_hash_old (Handle.DangerousGetHandle ());
+               }
+
+               public int GetEntryCount ()
+               {
+                       return mono_btls_x509_name_get_entry_count (Handle.DangerousGetHandle ());
+               }
+
+               public MonoBtlsX509NameEntryType GetEntryType (int index)
+               {
+                       if (index >= GetEntryCount ())
+                               throw new ArgumentOutOfRangeException ();
+                       return mono_btls_x509_name_get_entry_type (
+                               Handle.DangerousGetHandle (), index);
+               }
+
+               public string GetEntryOid (int index)
+               {
+                       if (index >= GetEntryCount ())
+                               throw new ArgumentOutOfRangeException ();
+
+                       const int size = 4096;
+                       var data = Marshal.AllocHGlobal (size);
+                       try {
+                               var ret = mono_btls_x509_name_get_entry_oid (
+                                       Handle.DangerousGetHandle (),
+                                       index, data, size);
+                               CheckError (ret > 0);
+                               return Marshal.PtrToStringAnsi (data);
+                       } finally {
+                               Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public byte[] GetEntryOidData (int index)
+               {
+                       IntPtr data;
+                       var ret = mono_btls_x509_name_get_entry_oid_data (
+                               Handle.DangerousGetHandle (), index, out data);
+                       CheckError (ret > 0);
+
+                       var bytes = new byte[ret];
+                       Marshal.Copy (data, bytes, 0, ret);
+                       return bytes;
+               }
+
+               public unsafe string GetEntryValue (int index, out int tag)
+               {
+                       if (index >= GetEntryCount ())
+                               throw new ArgumentOutOfRangeException ();
+                       IntPtr data;
+                       var ret = mono_btls_x509_name_get_entry_value (
+                               Handle.DangerousGetHandle (), index, out tag, out data);
+                       if (ret <= 0)
+                               return null;
+                       try {
+                               return new UTF8Encoding ().GetString ((byte*)data, ret);
+                       } finally {
+                               if (data != IntPtr.Zero)
+                                       FreeDataPtr (data);
+                       }
+               }
+
+               public static unsafe MonoBtlsX509Name CreateFromData (byte[] data, bool use_canon_enc)
+               {
+                       fixed (void *ptr = data) {
+                               var handle = mono_btls_x509_name_from_data (ptr, data.Length, use_canon_enc ? 1 : 0);
+                               if (handle == IntPtr.Zero)
+                                       throw new MonoBtlsException ("mono_btls_x509_name_from_data() failed.");
+                               return new MonoBtlsX509Name (new BoringX509NameHandle (handle, false));
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509NameEntryType.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509NameEntryType.cs
new file mode 100644 (file)
index 0000000..1a4cdae
--- /dev/null
@@ -0,0 +1,51 @@
+//
+// MonoBtlsX509NameEntryType.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+namespace Mono.Btls
+{
+       enum MonoBtlsX509NameEntryType : int
+       {
+               Unknown = 0,
+               CountryName,
+               OrganizationName,
+               OrganizationalUnitName,
+               CommonName,
+               LocalityName,
+               StateOrProvinceName,
+               StreetAddress,
+               SerialNumber,
+               DomainComponent,
+               UserId,
+               Email,
+               DnQualifier,
+               Title,
+               Surname,
+               GivenName,
+               Initial
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Purpose.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Purpose.cs
new file mode 100644 (file)
index 0000000..b8b4163
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// MonoBtlsX509Purpose.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+namespace Mono.Btls
+{
+       enum MonoBtlsX509Purpose
+       {
+               SSL_CLIENT = 1,
+               SSL_SERVER = 2,
+               NS_SSL_SERVER = 3,
+               SMIME_SIGN = 4,
+               SMIME_ENCRYPT = 5,
+               CRL_SIGN = 6,
+               ANY = 7,
+               OCSP_HELPER = 8,
+               TIMESTAMP_SIGN = 9,
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Revoked.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Revoked.cs
new file mode 100644 (file)
index 0000000..1bb279a
--- /dev/null
@@ -0,0 +1,120 @@
+//
+// MonoBtlsX509Revoked.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Text;
+using System.Threading;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Cryptography;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509Revoked : MonoBtlsObject
+       {
+               internal class BoringX509RevokedHandle : MonoBtlsHandle
+               {
+                       public BoringX509RevokedHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               if (handle != IntPtr.Zero)
+                                       mono_btls_x509_revoked_free (handle);
+                               return true;
+                       }
+
+                       public IntPtr StealHandle ()
+                       {
+                               var retval = Interlocked.Exchange (ref handle, IntPtr.Zero);
+                               return retval;
+                       }
+               }
+
+               new internal BoringX509RevokedHandle Handle {
+                       get { return (BoringX509RevokedHandle)base.Handle; }
+               }
+
+               internal MonoBtlsX509Revoked (BoringX509RevokedHandle handle)
+                       : base (handle)
+               {
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_revoked_get_serial_number (IntPtr handle, IntPtr data, int size);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static long mono_btls_x509_revoked_get_revocation_date (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_revoked_get_reason (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_revoked_get_sequence (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_revoked_free (IntPtr handle);
+
+               public byte[] GetSerialNumber ()
+               {
+                       int size = 256;
+                       IntPtr data = Marshal.AllocHGlobal (size);
+                       try {
+                               var ret = mono_btls_x509_revoked_get_serial_number (
+                                       Handle.DangerousGetHandle (), data, size);
+                               CheckError (ret > 0);
+                               var buffer = new byte[ret];
+                               Marshal.Copy (data, buffer, 0, ret);
+                               return buffer;
+                       } finally {
+                               if (data != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (data);
+                       }
+               }
+
+               public DateTime GetRevocationDate ()
+               {
+                       var ticks = mono_btls_x509_revoked_get_revocation_date (
+                               Handle.DangerousGetHandle ());
+                       return new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds (ticks);
+               }
+
+               public int GetReason ()
+               {
+                       return mono_btls_x509_revoked_get_reason (Handle.DangerousGetHandle ());
+               }
+
+               public int GetSequence ()
+               {
+                       return mono_btls_x509_revoked_get_sequence (Handle.DangerousGetHandle ());
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Store.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Store.cs
new file mode 100644 (file)
index 0000000..5379935
--- /dev/null
@@ -0,0 +1,230 @@
+//
+// MonoBtlsX509Store.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+using System.Security.Cryptography.X509Certificates;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509Store : MonoBtlsObject
+       {
+               internal class BoringX509StoreHandle : MonoBtlsHandle
+               {
+                       public BoringX509StoreHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_x509_store_free (handle);
+                               return true;
+                       }
+               }
+
+               new internal BoringX509StoreHandle Handle {
+                       get { return (BoringX509StoreHandle)base.Handle; }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_from_ctx (IntPtr ctx);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_from_ssl_ctx (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_store_load_locations (IntPtr handle, IntPtr file, IntPtr path);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_store_set_default_paths (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_store_add_cert (IntPtr handle, IntPtr x509);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_store_get_count (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_store_free (IntPtr handle);
+
+               Dictionary<IntPtr,MonoBtlsX509Lookup> lookupHash;
+
+               public void LoadLocations (string file, string path)
+               {
+                       IntPtr filePtr = IntPtr.Zero;
+                       IntPtr pathPtr = IntPtr.Zero;
+                       try {
+                               if (file != null)
+                                       filePtr = Marshal.StringToHGlobalAnsi (file);
+                               if (path != null)
+                                       pathPtr = Marshal.StringToHGlobalAnsi (path);
+                               var ret = mono_btls_x509_store_load_locations (
+                                       Handle.DangerousGetHandle (), filePtr, pathPtr);
+                               CheckError (ret);
+                       } finally {
+                               if (filePtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (filePtr);
+                               if (pathPtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (pathPtr);
+                       }
+               }
+
+               public void SetDefaultPaths ()
+               {
+                       var ret = mono_btls_x509_store_set_default_paths (Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               static BoringX509StoreHandle Create_internal ()
+               {
+                       var handle = mono_btls_x509_store_new ();
+                       if (handle == IntPtr.Zero)
+                               throw new MonoBtlsException ();
+                       return new BoringX509StoreHandle (handle);
+               }
+
+               static BoringX509StoreHandle Create_internal (IntPtr store_ctx)
+               {
+                       var handle = mono_btls_x509_store_from_ssl_ctx (store_ctx);
+                       if (handle == IntPtr.Zero)
+                               throw new MonoBtlsException ();
+                       return new BoringX509StoreHandle (handle);
+               }
+
+               static BoringX509StoreHandle Create_internal (MonoBtlsSslCtx.BoringSslCtxHandle ctx)
+               {
+                       var handle = mono_btls_x509_store_from_ssl_ctx (ctx.DangerousGetHandle ());
+                       if (handle == IntPtr.Zero)
+                               throw new MonoBtlsException ();
+                       return new BoringX509StoreHandle (handle);
+               }
+
+               internal MonoBtlsX509Store ()
+                       : base (Create_internal ())
+               {
+               }
+
+               internal MonoBtlsX509Store (IntPtr store_ctx)
+                       : base (Create_internal (store_ctx))
+               {
+               }
+
+               internal MonoBtlsX509Store (MonoBtlsSslCtx.BoringSslCtxHandle ctx)
+                       : base (Create_internal (ctx))
+               {
+               }
+
+               public void AddCertificate (MonoBtlsX509 x509)
+               {
+                       var ret = mono_btls_x509_store_add_cert (
+                               Handle.DangerousGetHandle (),
+                               x509.Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               public int GetCount ()
+               {
+                       return mono_btls_x509_store_get_count (Handle.DangerousGetHandle ());
+               }
+
+               internal void AddTrustedRoots ()
+               {
+                       var systemRoot = MonoBtlsProvider.GetSystemStoreLocation ();
+                       LoadLocations (null, systemRoot);
+               }
+
+               public MonoBtlsX509Lookup AddLookup (MonoBtlsX509LookupType type)
+               {
+                       if (lookupHash == null)
+                               lookupHash = new Dictionary<IntPtr,MonoBtlsX509Lookup> ();
+
+                       /*
+                        * X509_STORE_add_lookup() returns the same 'X509_LOOKUP *' for each
+                        * unique 'X509_LOOKUP_METHOD *' (which is supposed to be a static struct)
+                        * and we want to use the same managed object for each unique 'X509_LOOKUP *'.
+                       */
+                       var lookup = new MonoBtlsX509Lookup (this, type);
+                       var nativeLookup = lookup.GetNativeLookup ();
+                       if (lookupHash.ContainsKey (nativeLookup)) {
+                               lookup.Dispose ();
+                               lookup = lookupHash [nativeLookup];
+                       } else {
+                               lookupHash.Add (nativeLookup, lookup);
+                       }
+
+                       return lookup;
+               }
+
+               public void AddDirectoryLookup (string dir, MonoBtlsX509FileType type)
+               {
+                       var lookup = AddLookup (MonoBtlsX509LookupType.HASH_DIR);
+                       lookup.AddDirectory (dir, type);
+               }
+
+               public void AddFileLookup (string file, MonoBtlsX509FileType type)
+               {
+                       var lookup = AddLookup (MonoBtlsX509LookupType.FILE);
+                       lookup.LoadFile (file, type);
+               }
+
+               public void AddCollection (X509CertificateCollection collection, MonoBtlsX509TrustKind trust)
+               {
+                       var monoLookup = new MonoBtlsX509LookupMonoCollection (collection, trust);
+                       var lookup = new MonoBtlsX509Lookup (this, MonoBtlsX509LookupType.MONO);
+                       lookup.AddMono (monoLookup);
+               }
+
+#if MONODROID
+               public void AddAndroidLookup ()
+               {
+                       var androidLookup = new MonoBtlsX509LookupAndroid ();
+                       var lookup = new MonoBtlsX509Lookup (this, MonoBtlsX509LookupType.MONO);
+                       lookup.AddMono (androidLookup);
+               }
+#endif
+
+               protected override void Close ()
+               {
+                       try {
+                               if (lookupHash != null) {
+                                       foreach (var lookup in lookupHash.Values)
+                                               lookup.Dispose ();
+                                       lookupHash = null;
+                               }
+                       } finally {
+                               base.Close ();
+                       }
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509StoreCtx.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509StoreCtx.cs
new file mode 100644 (file)
index 0000000..9b8e82b
--- /dev/null
@@ -0,0 +1,244 @@
+//
+// MonoBtlsX509StoreCtx.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509StoreCtx : MonoBtlsObject
+       {
+               internal class BoringX509StoreCtxHandle : MonoBtlsHandle
+               {
+                       bool dontFree;
+
+                       internal BoringX509StoreCtxHandle (IntPtr handle, bool ownsHandle = true)
+                               : base (handle, ownsHandle)
+                       {
+                               dontFree = !ownsHandle;
+                       }
+
+                       #if FIXME
+                       internal BoringX509StoreCtxHandle (IntPtr handle)
+                               : base ()
+                       {
+                               base.handle = handle;
+                               this.dontFree = true;
+                       }
+                       #endif
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               if (!dontFree)
+                                       mono_btls_x509_store_ctx_free (handle);
+                               return true;
+                       }
+               }
+
+               int? verifyResult;
+
+               new internal BoringX509StoreCtxHandle Handle {
+                       get { return (BoringX509StoreCtxHandle)base.Handle; }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_from_ptr (IntPtr ctx);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static MonoBtlsX509Error mono_btls_x509_store_ctx_get_error (IntPtr handle, out IntPtr error_string);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_store_ctx_get_error_depth (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_get_chain (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_store_ctx_init (IntPtr handle, IntPtr store, IntPtr chain);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_store_ctx_set_param (IntPtr handle, IntPtr param);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_store_ctx_verify_cert (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_get_by_subject (IntPtr handle, IntPtr name);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_get_current_cert (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_get_current_issuer (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_get_verify_param (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_get_untrusted (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_store_ctx_up_ref (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_store_ctx_free (IntPtr handle);
+
+               internal MonoBtlsX509StoreCtx ()
+                       : base (new BoringX509StoreCtxHandle (mono_btls_x509_store_ctx_new ()))
+               {
+               }
+
+               static BoringX509StoreCtxHandle Create_internal (IntPtr store_ctx)
+               {
+                       var handle = mono_btls_x509_store_ctx_from_ptr (store_ctx);
+                       if (handle == IntPtr.Zero)
+                               throw new MonoBtlsException ();
+                       return new BoringX509StoreCtxHandle (handle);
+               }
+
+               internal MonoBtlsX509StoreCtx (int preverify_ok, IntPtr store_ctx)
+                       : base (Create_internal (store_ctx))
+               {
+                       verifyResult = preverify_ok;
+               }
+
+               internal MonoBtlsX509StoreCtx (BoringX509StoreCtxHandle ptr, int? verifyResult)
+                       : base (ptr)
+               {
+                       this.verifyResult = verifyResult;
+               }
+
+               public MonoBtlsX509Error GetError ()
+               {
+                       IntPtr error_string_ptr;
+                       return mono_btls_x509_store_ctx_get_error (Handle.DangerousGetHandle (), out error_string_ptr);
+               }
+
+               public MonoBtlsX509Exception GetException ()
+               {
+                       IntPtr error_string_ptr;
+                       var error = mono_btls_x509_store_ctx_get_error (Handle.DangerousGetHandle (), out error_string_ptr);
+                       if (error == 0)
+                               return null;
+                       if (error_string_ptr != IntPtr.Zero) {
+                               var error_string = Marshal.PtrToStringAnsi (error_string_ptr);
+                               return new MonoBtlsX509Exception (error, error_string);
+                       }
+                       return new MonoBtlsX509Exception (error, "Unknown verify error.");
+               }
+
+               public MonoBtlsX509Chain GetChain ()
+               {
+                       var chain = mono_btls_x509_store_ctx_get_chain (Handle.DangerousGetHandle ());
+                       CheckError (chain != IntPtr.Zero);
+                       return new MonoBtlsX509Chain (new MonoBtlsX509Chain.BoringX509ChainHandle (chain));
+               }
+
+               public MonoBtlsX509Chain GetUntrusted ()
+               {
+                       var chain = mono_btls_x509_store_ctx_get_untrusted (Handle.DangerousGetHandle ());
+                       CheckError (chain != IntPtr.Zero);
+                       return new MonoBtlsX509Chain (new MonoBtlsX509Chain.BoringX509ChainHandle (chain));
+               }
+
+               public void Initialize (MonoBtlsX509Store store, MonoBtlsX509Chain chain)
+               {
+                       var ret = mono_btls_x509_store_ctx_init (
+                               Handle.DangerousGetHandle (),
+                               store.Handle.DangerousGetHandle (),
+                               chain.Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               public void SetVerifyParam (MonoBtlsX509VerifyParam param)
+               {
+                       var ret = mono_btls_x509_store_ctx_set_param (
+                               Handle.DangerousGetHandle (),
+                               param.Handle.DangerousGetHandle ());
+                       CheckError (ret);
+               }
+
+               public int VerifyResult {
+                       get {
+                               if (verifyResult == null)
+                                       throw new InvalidOperationException ();
+                               return verifyResult.Value;
+                       }
+               }
+
+               public int Verify ()
+               {
+                       verifyResult = mono_btls_x509_store_ctx_verify_cert (Handle.DangerousGetHandle ());
+                       return verifyResult.Value;
+               }
+
+               public MonoBtlsX509 LookupBySubject (MonoBtlsX509Name name)
+               {
+                       var handle = mono_btls_x509_store_ctx_get_by_subject (
+                               Handle.DangerousGetHandle (), name.Handle.DangerousGetHandle ());
+                       if (handle == IntPtr.Zero)
+                               return null;
+                       return new MonoBtlsX509 (new MonoBtlsX509.BoringX509Handle (handle));
+               }
+
+               public MonoBtlsX509 GetCurrentCertificate ()
+               {
+                       var x509 = mono_btls_x509_store_ctx_get_current_cert (Handle.DangerousGetHandle ());
+                       if (x509 == IntPtr.Zero)
+                               return null;
+                       return new MonoBtlsX509 (new MonoBtlsX509.BoringX509Handle (x509));
+               }
+
+               public MonoBtlsX509 GetCurrentIssuer ()
+               {
+                       var x509 = mono_btls_x509_store_ctx_get_current_issuer (Handle.DangerousGetHandle ());
+                       if (x509 == IntPtr.Zero)
+                               return null;
+                       return new MonoBtlsX509 (new MonoBtlsX509.BoringX509Handle (x509));
+               }
+
+               public MonoBtlsX509VerifyParam GetVerifyParam ()
+               {
+                       var param = mono_btls_x509_store_ctx_get_verify_param (Handle.DangerousGetHandle ());
+                       if (param == IntPtr.Zero)
+                               return null;
+                       return new MonoBtlsX509VerifyParam (new MonoBtlsX509VerifyParam.BoringX509VerifyParamHandle (param));
+               }
+
+               public MonoBtlsX509StoreCtx Copy ()
+               {
+                       var copy = mono_btls_x509_store_ctx_up_ref (Handle.DangerousGetHandle ());
+                       CheckError (copy != IntPtr.Zero);
+                       return new MonoBtlsX509StoreCtx (new BoringX509StoreCtxHandle (copy), verifyResult);
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509StoreManager.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509StoreManager.cs
new file mode 100644 (file)
index 0000000..42fbdf7
--- /dev/null
@@ -0,0 +1,122 @@
+//
+// MonoBtlsX509StoreManager.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+using System;
+using System.IO;
+using System.Security.Cryptography.X509Certificates;
+
+#if MONO_SECURITY_ALIAS
+using MonoSecurity::Mono.Security.Interface;
+using MX = MonoSecurity::Mono.Security.X509;
+#else
+using Mono.Security.Interface;
+using MX = Mono.Security.X509;
+#endif
+
+namespace Mono.Btls
+{
+       static class MonoBtlsX509StoreManager
+       {
+               static bool initialized;
+#if !ANDROID
+               static string machineTrustedRootPath;
+               static string machineIntermediateCAPath;
+               static string machineUntrustedPath;
+               static string userTrustedRootPath;
+               static string userIntermediateCAPath;
+               static string userUntrustedPath;
+#endif
+
+               static void Initialize ()
+               {
+                       if (initialized)
+                               return;
+
+                       try {
+                               DoInitialize ();
+                       } catch (Exception ex) {
+                               Console.Error.WriteLine ("MonoBtlsX509StoreManager.Initialize() threw exception: {0}", ex);
+                       } finally {
+                               initialized = true;
+                       }
+               }
+
+               static void DoInitialize ()
+               {
+#if !ANDROID
+                       var userPath = MX.X509StoreManager.NewCurrentUserPath;
+                       userTrustedRootPath = Path.Combine (userPath, MX.X509Stores.Names.TrustedRoot);
+                       userIntermediateCAPath = Path.Combine (userPath, MX.X509Stores.Names.IntermediateCA);
+                       userUntrustedPath = Path.Combine (userPath, MX.X509Stores.Names.Untrusted);
+
+                       var machinePath = MX.X509StoreManager.NewLocalMachinePath;
+                       machineTrustedRootPath = Path.Combine (userPath, MX.X509Stores.Names.TrustedRoot);
+                       machineIntermediateCAPath = Path.Combine (userPath, MX.X509Stores.Names.IntermediateCA);
+                       machineUntrustedPath = Path.Combine (userPath, MX.X509Stores.Names.Untrusted);
+#endif
+               }
+
+               public static bool HasStore (MonoBtlsX509StoreType type)
+               {
+#if ANDROID
+                       return false;
+#else
+                       var path = GetStorePath (type);
+                       return path != null && Directory.Exists (path);
+#endif
+               }
+
+               public static string GetStorePath (MonoBtlsX509StoreType type)
+               {
+#if ANDROID
+                       throw new NotSupportedException ();
+#else
+                       Initialize ();
+                       switch (type) {
+                       case MonoBtlsX509StoreType.MachineTrustedRoots:
+                               return machineTrustedRootPath;
+                       case MonoBtlsX509StoreType.MachineIntermediateCA:
+                               return machineIntermediateCAPath;
+                       case MonoBtlsX509StoreType.MachineUntrusted:
+                               return machineUntrustedPath;
+                       case MonoBtlsX509StoreType.UserTrustedRoots:
+                               return userTrustedRootPath;
+                       case MonoBtlsX509StoreType.UserIntermediateCA:
+                               return userIntermediateCAPath;
+                       case MonoBtlsX509StoreType.UserUntrusted:
+                               return userUntrustedPath;
+                       default:
+                               throw new NotSupportedException ();
+                       }
+#endif
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509StoreType.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509StoreType.cs
new file mode 100644 (file)
index 0000000..b4ac593
--- /dev/null
@@ -0,0 +1,40 @@
+//
+// MonoBtlsX509StoreType.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+namespace Mono.Btls
+{
+       enum MonoBtlsX509StoreType
+       {
+               Custom,
+               MachineTrustedRoots,
+               MachineIntermediateCA,
+               MachineUntrusted,
+               UserTrustedRoots,
+               UserIntermediateCA,
+               UserUntrusted
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509TrustKind.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509TrustKind.cs
new file mode 100644 (file)
index 0000000..4d85588
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// MonoBtlsX509TrustKind.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+namespace Mono.Btls
+{
+       [Flags]
+       enum MonoBtlsX509TrustKind
+       {
+               DEFAULT         = 0,
+               TRUST_CLIENT    = 1,
+               TRUST_SERVER    = 2,
+               TRUST_ALL       = 4,
+               REJECT_CLIENT   = 32,
+               REJECT_SERVER   = 64,
+               REJECT_ALL      = 128
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509VerifyFlags.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509VerifyFlags.cs
new file mode 100644 (file)
index 0000000..493fc9b
--- /dev/null
@@ -0,0 +1,39 @@
+//
+// MonoBtlsX509VerifyFlags.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+namespace Mono.Btls
+{
+       [Flags]
+       enum MonoBtlsX509VerifyFlags
+       {
+               DEFAULT         = 0,
+               CRL_CHECK       = 1,
+               CRL_CHECK_ALL   = 2,
+               X509_STRIC      = 4
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509VerifyParam.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509VerifyParam.cs
new file mode 100644 (file)
index 0000000..9029722
--- /dev/null
@@ -0,0 +1,277 @@
+//
+// MonoBtlsX509VerifyParam.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace Mono.Btls
+{
+       class MonoBtlsX509VerifyParam : MonoBtlsObject
+       {
+               internal class BoringX509VerifyParamHandle : MonoBtlsHandle
+               {
+                       public BoringX509VerifyParamHandle (IntPtr handle)
+                               : base (handle, true)
+                       {
+                       }
+
+                       protected override bool ReleaseHandle ()
+                       {
+                               mono_btls_x509_verify_param_free (handle);
+                               return true;
+                       }
+               }
+
+               new internal BoringX509VerifyParamHandle Handle {
+                       get { return (BoringX509VerifyParamHandle)base.Handle; }
+               }
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_verify_param_new ();
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_verify_param_copy (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_verify_param_lookup (IntPtr name);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_can_modify (IntPtr param);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_set_name (IntPtr handle, IntPtr name);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_set_host (IntPtr handle, IntPtr name, int namelen);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_add_host (IntPtr handle, IntPtr name, int namelen);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static ulong mono_btls_x509_verify_param_get_flags (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_set_flags (IntPtr handle, ulong flags);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static MonoBtlsX509VerifyFlags mono_btls_x509_verify_param_get_mono_flags (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_set_mono_flags (IntPtr handle, MonoBtlsX509VerifyFlags flags);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_set_purpose (IntPtr handle, MonoBtlsX509Purpose purpose);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_get_depth (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_set_depth (IntPtr handle, int depth);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static int mono_btls_x509_verify_param_set_time (IntPtr handle, long time);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static IntPtr mono_btls_x509_verify_param_get_peername (IntPtr handle);
+
+               [DllImport (BTLS_DYLIB)]
+               extern static void mono_btls_x509_verify_param_free (IntPtr handle);
+
+               internal MonoBtlsX509VerifyParam ()
+                       : base (new BoringX509VerifyParamHandle (mono_btls_x509_verify_param_new ()))
+               {
+               }
+
+               internal MonoBtlsX509VerifyParam (BoringX509VerifyParamHandle handle)
+                       : base (handle)
+               {
+               }
+
+               public MonoBtlsX509VerifyParam Copy ()
+               {
+                       var copy = mono_btls_x509_verify_param_copy (Handle.DangerousGetHandle ());
+                       CheckError (copy != IntPtr.Zero);
+                       return new MonoBtlsX509VerifyParam (new BoringX509VerifyParamHandle (copy));
+               }
+
+               public static MonoBtlsX509VerifyParam GetSslClient ()
+               {
+                       return Lookup ("ssl_client", true);
+               }
+
+               public static MonoBtlsX509VerifyParam GetSslServer ()
+               {
+                       return Lookup ("ssl_server", true);
+               }
+
+               public static MonoBtlsX509VerifyParam Lookup (string name, bool fail = false)
+               {
+                       IntPtr namePtr = IntPtr.Zero;
+                       IntPtr handle = IntPtr.Zero;
+
+                       try {
+                               namePtr = Marshal.StringToHGlobalAnsi (name);
+                               handle = mono_btls_x509_verify_param_lookup (namePtr);
+                               if (handle == IntPtr.Zero) {
+                                       if (!fail)
+                                               return null;
+                                       throw new MonoBtlsException ("X509_VERIFY_PARAM_lookup() could not find '{0}'.", name);
+                               }
+
+                               return new MonoBtlsX509VerifyParam (new BoringX509VerifyParamHandle (handle));
+                       } finally {
+                               if (namePtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (namePtr);
+                       }
+               }
+
+               public bool CanModify {
+                       get {
+                               return mono_btls_x509_verify_param_can_modify (Handle.DangerousGetHandle ()) != 0;
+                       }
+               }
+
+               void WantToModify ()
+               {
+                       if (!CanModify)
+                               throw new MonoBtlsException ("Attempting to modify read-only MonoBtlsX509VerifyParam instance.");
+               }
+
+               public void SetName (string name)
+               {
+                       WantToModify ();
+                       IntPtr namePtr = IntPtr.Zero;
+                       try {
+                               namePtr = Marshal.StringToHGlobalAnsi (name);
+                               var ret = mono_btls_x509_verify_param_set_name (
+                                       Handle.DangerousGetHandle (), namePtr);
+                               CheckError (ret);
+                       } finally {
+                               if (namePtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (namePtr);
+                       }
+               }
+
+               public void SetHost (string name)
+               {
+                       WantToModify ();
+                       IntPtr namePtr = IntPtr.Zero;
+                       try {
+                               namePtr = Marshal.StringToHGlobalAnsi (name);
+                               var ret = mono_btls_x509_verify_param_set_host (
+                                       Handle.DangerousGetHandle (), namePtr, name.Length);
+                               CheckError (ret);
+                       } finally {
+                               if (namePtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (namePtr);
+                       }
+               }
+
+               public void AddHost (string name)
+               {
+                       WantToModify ();
+                       IntPtr namePtr = IntPtr.Zero;
+                       try {
+                               namePtr = Marshal.StringToHGlobalAnsi (name);
+                               var ret = mono_btls_x509_verify_param_add_host (
+                                       Handle.DangerousGetHandle (), namePtr, name.Length);
+                               CheckError (ret);
+                       } finally {
+                               if (namePtr != IntPtr.Zero)
+                                       Marshal.FreeHGlobal (namePtr);
+                       }
+               }
+
+               public ulong GetFlags ()
+               {
+                       return mono_btls_x509_verify_param_get_flags (Handle.DangerousGetHandle ());
+               }
+
+               public void SetFlags (ulong flags)
+               {
+                       WantToModify ();
+                       var ret = mono_btls_x509_verify_param_set_flags (
+                               Handle.DangerousGetHandle (), flags);
+                       CheckError (ret);
+               }
+
+               public MonoBtlsX509VerifyFlags GetMonoFlags ()
+               {
+                       return mono_btls_x509_verify_param_get_mono_flags (
+                               Handle.DangerousGetHandle ());
+               }
+
+               public void SetMonoFlags (MonoBtlsX509VerifyFlags flags)
+               {
+                       WantToModify ();
+                       var ret = mono_btls_x509_verify_param_set_mono_flags (
+                               Handle.DangerousGetHandle (), flags);
+                       CheckError (ret);
+               }
+
+               public void SetPurpose (MonoBtlsX509Purpose purpose)
+               {
+                       WantToModify ();
+                       var ret = mono_btls_x509_verify_param_set_purpose (
+                               Handle.DangerousGetHandle (), purpose);
+                       CheckError (ret);
+               }
+
+               public int GetDepth ()
+               {
+                       return mono_btls_x509_verify_param_get_depth (Handle.DangerousGetHandle ());
+               }
+
+               public void SetDepth (int depth)
+               {
+                       WantToModify ();
+                       var ret = mono_btls_x509_verify_param_set_depth (
+                               Handle.DangerousGetHandle (), depth);
+                       CheckError (ret);
+               }
+
+               public void SetTime (DateTime time)
+               {
+                       WantToModify ();
+                       var epoch = new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
+                       var ticks = (long)time.Subtract (epoch).TotalSeconds;
+                       var ret = mono_btls_x509_verify_param_set_time (
+                               Handle.DangerousGetHandle (), ticks);
+                       CheckError (ret);
+               }
+
+               public string GetPeerName ()
+               {
+                       var peer = mono_btls_x509_verify_param_get_peername (Handle.DangerousGetHandle ());
+                       if (peer == IntPtr.Zero)
+                               return null;
+                       return Marshal.PtrToStringAnsi (peer);
+               }
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/X509CertificateImplBtls.cs b/mcs/class/System/Mono.Btls/X509CertificateImplBtls.cs
new file mode 100644 (file)
index 0000000..f780812
--- /dev/null
@@ -0,0 +1,495 @@
+//
+// X509CertificateImplBtls.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+#endif
+
+#if MONO_SECURITY_ALIAS
+using MX = MonoSecurity::Mono.Security.X509;
+#else
+using MX = Mono.Security.X509;
+#endif
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Security;
+using System.Security.Cryptography;
+using System.Security.Cryptography.X509Certificates;
+using Mono.Security.Cryptography;
+
+namespace Mono.Btls
+{
+       class X509CertificateImplBtls : X509Certificate2Impl
+       {
+               MonoBtlsX509 x509;
+               MonoBtlsKey privateKey;
+               X500DistinguishedName subjectName;
+               X500DistinguishedName issuerName;
+               X509CertificateImplCollection intermediateCerts;
+               PublicKey publicKey;
+               bool archived;
+               bool disallowFallback;
+
+               internal X509CertificateImplBtls (bool disallowFallback = false)
+               {
+                       this.disallowFallback = disallowFallback;
+               }
+
+               internal X509CertificateImplBtls (MonoBtlsX509 x509, bool disallowFallback = false)
+               {
+                       this.disallowFallback = disallowFallback;
+                       this.x509 = x509.Copy ();
+               }
+
+               X509CertificateImplBtls (X509CertificateImplBtls other)
+               {
+                       disallowFallback = other.disallowFallback;
+                       x509 = other.x509 != null ? other.x509.Copy () : null;
+                       privateKey = other.privateKey != null ? other.privateKey.Copy () : null;
+                       if (other.intermediateCerts != null)
+                               intermediateCerts = other.intermediateCerts.Clone ();
+               }
+
+               internal X509CertificateImplBtls (byte[] data, MonoBtlsX509Format format, bool disallowFallback = false)
+               {
+                       this.disallowFallback = disallowFallback;
+                       x509 = MonoBtlsX509.LoadFromData (data, format);
+               }
+
+               public override bool IsValid {
+                       get { return x509 != null && x509.IsValid; }
+               }
+
+               public override IntPtr Handle {
+                       get { return x509.Handle.DangerousGetHandle (); }
+               }
+
+               public override IntPtr GetNativeAppleCertificate ()
+               {
+                       return IntPtr.Zero;
+               }
+
+               internal MonoBtlsX509 X509 {
+                       get {
+                               ThrowIfContextInvalid ();
+                               return x509;
+                       }
+               }
+
+               internal MonoBtlsKey NativePrivateKey {
+                       get {
+                               ThrowIfContextInvalid ();
+                               return privateKey;
+                       }
+               }
+
+               public override X509CertificateImpl Clone ()
+               {
+                       ThrowIfContextInvalid ();
+                       return new X509CertificateImplBtls (this);
+               }
+
+               public override bool Equals (X509CertificateImpl other, out bool result)
+               {
+                       var otherBoringImpl = other as X509CertificateImplBtls;
+                       if (otherBoringImpl == null) {
+                               result = false;
+                               return false;
+                       }
+
+                       result = MonoBtlsX509.Compare (X509, otherBoringImpl.X509) == 0;
+                       return true;
+               }
+
+               protected override byte[] GetCertHash (bool lazy)
+               {
+                       return X509.GetCertHash ();
+               }
+
+               public override byte[] GetRawCertData ()
+               {
+                       return X509.GetRawData (MonoBtlsX509Format.DER);
+               }
+
+               public override string GetSubjectName (bool legacyV1Mode)
+               {
+                       if (legacyV1Mode)
+                               return SubjectName.Decode (X500DistinguishedNameFlags.None);
+                       return SubjectName.Name;
+               }
+
+               public override string GetIssuerName (bool legacyV1Mode)
+               {
+                       if (legacyV1Mode)
+                               return IssuerName.Decode (X500DistinguishedNameFlags.None);
+                       return IssuerName.Name;
+               }
+
+               public override DateTime GetValidFrom ()
+               {
+                       return X509.GetNotBefore ().ToLocalTime ();
+               }
+
+               public override DateTime GetValidUntil ()
+               {
+                       return X509.GetNotAfter ().ToLocalTime ();
+               }
+
+               public override byte[] GetPublicKey ()
+               {
+                       return X509.GetPublicKeyData ();
+               }
+
+               public override byte[] GetSerialNumber ()
+               {
+                       return X509.GetSerialNumber (true);
+               }
+
+               public override string GetKeyAlgorithm ()
+               {
+                       return PublicKey.Oid.Value;
+               }
+
+               public override byte[] GetKeyAlgorithmParameters ()
+               {
+                       return PublicKey.EncodedParameters.RawData;
+               }
+
+               public override byte[] Export (X509ContentType contentType, byte[] password)
+               {
+                       ThrowIfContextInvalid ();
+
+                       switch (contentType) {
+                       case X509ContentType.Cert:
+                               return GetRawCertData ();
+                       case X509ContentType.Pfx: // this includes Pkcs12
+                               // TODO
+                               throw new NotSupportedException ();
+                       case X509ContentType.SerializedCert:
+                               // TODO
+                               throw new NotSupportedException ();
+                       default:
+                               string msg = Locale.GetText ("This certificate format '{0}' cannot be exported.", contentType);
+                               throw new CryptographicException (msg);
+                       }
+               }
+
+               internal override X509CertificateImplCollection IntermediateCertificates {
+                       get { return intermediateCerts; }
+               }
+
+               public override string ToString (bool full)
+               {
+                       ThrowIfContextInvalid ();
+
+                       if (!full) {
+                               var summary = GetSubjectName (false);
+                               return string.Format ("[X509Certificate: {0}]", summary);
+                       }
+
+                       string nl = Environment.NewLine;
+                       StringBuilder sb = new StringBuilder ();
+                       sb.AppendFormat ("[Subject]{0}  {1}{0}{0}", nl, GetSubjectName (false));
+
+                       sb.AppendFormat ("[Issuer]{0}  {1}{0}{0}", nl, GetIssuerName (false));
+                       sb.AppendFormat ("[Not Before]{0}  {1}{0}{0}", nl, GetValidFrom ().ToLocalTime ());
+                       sb.AppendFormat ("[Not After]{0}  {1}{0}{0}", nl, GetValidUntil ().ToLocalTime ());
+                       sb.AppendFormat ("[Thumbprint]{0}  {1}{0}", nl, X509Helper.ToHexString (GetCertHash ()));
+
+                       sb.Append (nl);
+                       return sb.ToString ();
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+                       if (x509 != null) {
+                               x509.Dispose ();
+                               x509 = null;
+                       }
+               }
+
+#region X509Certificate2Impl
+
+               X509Certificate2Impl fallback;
+
+               void MustFallback ()
+               {
+                       if (disallowFallback)
+                               throw new InvalidOperationException ();
+                       if (fallback != null)
+                               return;
+                       fallback = X509Helper2.Import (GetRawCertData (), null, X509KeyStorageFlags.DefaultKeySet, true);
+               }
+
+               internal override X509Certificate2Impl FallbackImpl {
+                       get {
+                               MustFallback ();
+                               return fallback;
+                       }
+               }
+
+               [MonoTODO]
+               public override bool Archived {
+                       get {
+                               ThrowIfContextInvalid ();
+                               return archived;
+                       }
+                       set {
+                               ThrowIfContextInvalid ();
+                               archived = value;
+                       }
+               }
+
+               public override X509ExtensionCollection Extensions {
+                       get { return FallbackImpl.Extensions; }
+               }
+
+               public override bool HasPrivateKey {
+                       get { return privateKey != null; }
+               }
+
+               public override X500DistinguishedName IssuerName {
+                       get {
+                               ThrowIfContextInvalid ();
+                               if (issuerName == null) {
+                                       using (var xname = x509.GetIssuerName ()) {
+                                               var encoding = xname.GetRawData (false);
+                                               var canonEncoding = xname.GetRawData (true);
+                                               var name = MonoBtlsUtils.FormatName (xname, true, ", ", true);
+                                               issuerName = new X500DistinguishedName (encoding, canonEncoding, name);
+                                       }
+                               }
+                               return issuerName;
+                       }
+               }
+
+               public override AsymmetricAlgorithm PrivateKey {
+                       get {
+                               if (privateKey == null || !privateKey.IsRsa)
+                                       return null;
+                               var bytes = privateKey.GetBytes (true);
+                               return PKCS8.PrivateKeyInfo.DecodeRSA (bytes);
+                       }
+                       set { FallbackImpl.PrivateKey = value; }
+               }
+
+               public override PublicKey PublicKey {
+                       get {
+                               ThrowIfContextInvalid ();
+                               if (publicKey == null) {
+                                       var keyAsn = X509.GetPublicKeyAsn1 ();
+                                       var keyParamAsn = X509.GetPublicKeyParameters ();
+                                       publicKey = new PublicKey (keyAsn.Oid, keyParamAsn, keyAsn);
+                               }
+                               return publicKey;
+                       }
+               }
+
+               public override Oid SignatureAlgorithm {
+                       get {
+                               ThrowIfContextInvalid ();
+                               return X509.GetSignatureAlgorithm ();
+                       }
+               }
+
+               public override X500DistinguishedName SubjectName {
+                       get {
+                               ThrowIfContextInvalid ();
+                               if (subjectName == null) {
+                                       using (var xname = x509.GetSubjectName ()) {
+                                               var encoding = xname.GetRawData (false);
+                                               var canonEncoding = xname.GetRawData (true);
+                                               var name = MonoBtlsUtils.FormatName (xname, true, ", ", true);
+                                               subjectName = new X500DistinguishedName (encoding, canonEncoding, name);
+                                       }
+                               }
+                               return subjectName;
+                       }
+               }
+
+               public override int Version {
+                       get { return X509.GetVersion (); }
+               }
+
+               public override string GetNameInfo (X509NameType nameType, bool forIssuer)
+               {
+                       return FallbackImpl.GetNameInfo (nameType, forIssuer);
+               }
+
+               public override void Import (byte[] data, string password, X509KeyStorageFlags keyStorageFlags)
+               {
+                       if (password == null) {
+                               try {
+                                       Import (data);
+                               } catch (Exception e) {
+                                       try {
+                                                ImportPkcs12 (data, null);
+                                       } catch {
+                                               string msg = Locale.GetText ("Unable to decode certificate.");
+                                               // inner exception is the original (not second) exception
+                                               throw new CryptographicException (msg, e);
+                                       }
+                               }
+                       } else {
+                               // try PKCS#12
+                               try {
+                                       ImportPkcs12 (data, password);
+                               } catch (Exception e) {
+                                       try {
+                                               // it's possible to supply a (unrequired/unusued) password
+                                               // fix bug #79028
+                                               Import (data);
+                                       } catch {
+                                               string msg = Locale.GetText ("Unable to decode certificate.");
+                                               // inner exception is the original (not second) exception
+                                               throw new CryptographicException (msg, e);
+                                       }
+                               }
+                       }
+               }
+
+               void Import (byte[] data)
+               {
+                       // Does it look like PEM?
+                       if ((data.Length > 0) && (data [0] != 0x30))
+                               x509 = MonoBtlsX509.LoadFromData (data, MonoBtlsX509Format.PEM);
+                       else
+                               x509 = MonoBtlsX509.LoadFromData (data, MonoBtlsX509Format.DER);
+               }
+
+               void ImportPkcs12 (byte[] data, string password)
+               {
+                       using (var pkcs12 = new MonoBtlsPkcs12 ()) {
+                               if (string.IsNullOrEmpty (password)) {
+                                       try {
+                                               // Support both unencrypted PKCS#12..
+                                               pkcs12.Import (data, null);
+                                       } catch {
+                                               // ..and PKCS#12 encrypted with an empty password
+                                               pkcs12.Import (data, string.Empty);
+                                       }
+                               } else {
+                                       pkcs12.Import (data, password);
+                               }
+
+                               x509 = pkcs12.GetCertificate (0);
+                               if (pkcs12.HasPrivateKey)
+                                       privateKey = pkcs12.GetPrivateKey ();
+                               if (pkcs12.Count > 1) {
+                                       intermediateCerts = new X509CertificateImplCollection ();
+                                       for (int i = 0; i < pkcs12.Count; i++) {
+                                               using (var ic = pkcs12.GetCertificate (i)) {
+                                                       if (MonoBtlsX509.Compare (ic, x509) == 0)
+                                                               continue;
+                                                       var impl = new X509CertificateImplBtls (ic, true);
+                                                       intermediateCerts.Add (impl, true);
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               public override byte[] Export (X509ContentType contentType, string password)
+               {
+                       ThrowIfContextInvalid ();
+
+                       switch (contentType) {
+                       case X509ContentType.Cert:
+                               return GetRawCertData ();
+                       case X509ContentType.Pfx: // this includes Pkcs12
+                               return ExportPkcs12 (password);
+                       case X509ContentType.SerializedCert:
+                               // TODO
+                               throw new NotSupportedException ();
+                       default:
+                               string msg = Locale.GetText ("This certificate format '{0}' cannot be exported.", contentType);
+                               throw new CryptographicException (msg);
+                       }
+               }
+
+               byte[] ExportPkcs12 (string password)
+               {
+                       var pfx = new MX.PKCS12 ();
+                       try {
+                               var attrs = new Hashtable ();
+                               var localKeyId = new ArrayList ();
+                               localKeyId.Add (new byte[] { 1, 0, 0, 0 });
+                               attrs.Add (MX.PKCS9.localKeyId, localKeyId);
+                               if (password != null)
+                                       pfx.Password = password;
+                               pfx.AddCertificate (new MX.X509Certificate (GetRawCertData ()), attrs);
+                               if (IntermediateCertificates != null) {
+                                       for (int i = 0; i < IntermediateCertificates.Count; i++)
+                                               pfx.AddCertificate (new MX.X509Certificate (IntermediateCertificates [i].GetRawCertData ()));
+                               }
+                               var privateKey = PrivateKey;
+                               if (privateKey != null)
+                                       pfx.AddPkcs8ShroudedKeyBag (privateKey, attrs);
+                               return pfx.GetBytes ();
+                       } finally {
+                               pfx.Password = null;
+                       }
+               }
+
+               public override bool Verify (X509Certificate2 thisCertificate)
+               {
+                       using (var chain = new MonoBtlsX509Chain ()) {
+                               chain.AddCertificate (x509.Copy ());
+                               if (intermediateCerts != null) {
+                                       for (int i = 0; i < intermediateCerts.Count; i++) {
+                                               var intermediate = (X509CertificateImplBtls)intermediateCerts [i];
+                                               chain.AddCertificate (intermediate.x509.Copy ());
+                                       }
+                               }
+                               return MonoBtlsProvider.ValidateCertificate (chain, null);
+                       }
+               }
+
+               public override void Reset ()
+               {
+                       if (x509 != null) {
+                               x509.Dispose ();
+                               x509 = null;
+                       }
+                       if (privateKey != null) {
+                               privateKey = null;
+                               privateKey = null;
+                       }
+                       subjectName = null;
+                       issuerName = null;
+                       archived = false;
+                       publicKey = null;
+                       intermediateCerts = null;
+                       if (fallback != null)
+                               fallback.Reset ();
+               }
+
+#endregion
+       }
+}
+#endif
diff --git a/mcs/class/System/Mono.Btls/X509ChainImplBtls.cs b/mcs/class/System/Mono.Btls/X509ChainImplBtls.cs
new file mode 100644 (file)
index 0000000..1359668
--- /dev/null
@@ -0,0 +1,178 @@
+//
+// X509ChainImplBtls.cs
+//
+// Author:
+//       Martin Baulig <martin.baulig@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.
+#if SECURITY_DEP && MONO_FEATURE_BTLS
+using System;
+using System.Text;
+using System.Security;
+using System.Security.Cryptography;
+using System.Security.Cryptography.X509Certificates;
+using MX = Mono.Security.X509;
+
+namespace Mono.Btls
+{
+       class X509ChainImplBtls : X509ChainImpl
+       {
+               MonoBtlsX509StoreCtx storeCtx;
+               MonoBtlsX509Chain chain;
+               MonoBtlsX509Chain untrustedChain;
+               X509ChainElementCollection elements;
+               X509Certificate2Collection untrusted;
+               X509Certificate2[] certificates;
+               X509ChainPolicy policy;
+
+               internal X509ChainImplBtls (MonoBtlsX509Chain chain)
+               {
+                       this.chain = chain.Copy ();
+                       policy = new X509ChainPolicy ();
+               }
+
+               internal X509ChainImplBtls (MonoBtlsX509StoreCtx storeCtx)
+               {
+                       this.storeCtx = storeCtx.Copy ();
+                       this.chain = storeCtx.GetChain ();
+
+                       policy = new X509ChainPolicy ();
+
+                       untrustedChain = storeCtx.GetUntrusted ();
+
+                       if (untrustedChain != null) {
+                               untrusted = new X509Certificate2Collection ();
+                               policy.ExtraStore = untrusted;
+                               for (int i = 0; i < untrustedChain.Count; i++) {
+                                       var cert = untrustedChain.GetCertificate (i);
+                                       using (var impl = new X509CertificateImplBtls (cert))
+                                               untrusted.Add (new X509Certificate2 (impl));
+                               }
+                       }
+               }
+
+               internal X509ChainImplBtls ()
+               {
+                       chain = new MonoBtlsX509Chain ();
+                       elements = new X509ChainElementCollection ();
+                       policy = new X509ChainPolicy ();
+               }
+
+               public override bool IsValid {
+                       get { return chain != null && chain.IsValid; }
+               }
+
+               public override IntPtr Handle {
+                       get { return chain.Handle.DangerousGetHandle (); }
+               }
+
+               internal MonoBtlsX509Chain Chain {
+                       get {
+                               ThrowIfContextInvalid ();
+                               return chain;
+                       }
+               }
+
+               internal MonoBtlsX509StoreCtx StoreCtx {
+                       get {
+                               ThrowIfContextInvalid ();
+                               return storeCtx;
+                       }
+               }
+
+               public override X509ChainElementCollection ChainElements {
+                       get {
+                               ThrowIfContextInvalid ();
+                               if (elements != null)
+                                       return elements;
+
+                               elements = new X509ChainElementCollection ();
+                               certificates = new X509Certificate2 [chain.Count];
+
+                               for (int i = 0; i < certificates.Length; i++) {
+                                       var cert = chain.GetCertificate (i);
+                                       using (var impl = new X509CertificateImplBtls (cert))
+                                               certificates [i] = new X509Certificate2 (impl);
+                                       elements.Add (certificates [i]);
+                               }
+
+                               return elements;
+                       }
+               }
+
+               public override X509ChainPolicy ChainPolicy {
+                       get { return policy; }
+                       set { policy = value; }
+               }
+
+               public override X509ChainStatus[] ChainStatus {
+                       get { throw new NotImplementedException (); }
+               }
+
+               public override bool Build (X509Certificate2 certificate)
+               {
+                       return false;
+               }
+
+               public override void Reset ()
+               {
+                       if (certificates != null) {
+                               foreach (var certificate in certificates)
+                                       certificate.Dispose ();
+                               certificates = null;
+                       }
+                       if (elements != null) {
+                               elements.Clear ();
+                               elements = null;
+                       }
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+                       if (disposing) {
+                               if (chain != null) {
+                                       chain.Dispose ();
+                                       chain = null;
+                               }
+                               if (storeCtx != null) {
+                                       storeCtx.Dispose ();
+                                       storeCtx = null;
+                               }
+                               if (untrustedChain != null) {
+                                       untrustedChain.Dispose ();
+                                       untrustedChain = null;
+                               }
+                               if (untrusted != null) {
+                                       foreach (var cert in untrusted)
+                                               cert.Dispose ();
+                                       untrusted = null;
+                               }
+                               if (certificates != null) {
+                                       foreach (var cert in certificates)
+                                               cert.Dispose ();
+                                       certificates = null;
+                               }
+                       }
+                       base.Dispose (disposing);
+               }
+       }
+}
+#endif
index ec38c2fd5d6b6dc912ebaf23c484aed19635b48f..324192d6af182a898272432a394351099def6971 100644 (file)
@@ -75,6 +75,8 @@ namespace Mono.Net.Security
                readonly MonoTlsStream tlsStream;
                readonly HttpWebRequest request;
 
+#pragma warning disable 618
+
                internal static ICertificateValidator GetInternalValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
                        if (settings == null)
@@ -182,6 +184,8 @@ namespace Mono.Net.Security
                                certValidationCallback = ServicePointManager.ServerCertValidationCallback;
                }
 
+#pragma warning restore 618
+
                static X509Certificate DefaultSelectionCallback (string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
                {
                        X509Certificate clientCertificate;
@@ -314,6 +318,13 @@ namespace Mono.Net.Security
                                return new ValidationResult (result, user_denied, 0, (MonoSslPolicyErrors)errors);
                        }
 
+                       // Ignore port number when validating certificates.
+                       if (!string.IsNullOrEmpty (host)) {
+                               var pos = host.IndexOf (':');
+                               if (pos > 0)
+                                       host = host.Substring (0, pos);
+                       }
+
                        ICertificatePolicy policy = ServicePointManager.GetLegacyCertificatePolicy ();
 
                        int status11 = 0; // Error code passed to the obsolete ICertificatePolicy callback
@@ -328,14 +339,15 @@ namespace Mono.Net.Security
                        result = provider.ValidateCertificate (this, host, server, certs, wantsChain, ref chain, ref xerrors, ref status11);
                        errors = (SslPolicyErrors)xerrors;
 
+                       if (status11 == 0 && errors != 0) {
+                               // TRUST_E_FAIL
+                               status11 = unchecked ((int)0x800B010B);
+                       }
+
                        if (policy != null && (!(policy is DefaultCertificatePolicy) || certValidationCallback == null)) {
                                ServicePoint sp = null;
                                if (request != null)
                                        sp = request.ServicePointNoLock;
-                               if (status11 == 0 && errors != 0) {
-                                       // TRUST_E_FAIL
-                                       status11 = unchecked ((int)0x800B010B);
-                               }
 
                                // pre 2.0 callback
                                result = policy.CheckValidationResult (sp, leaf, request, status11);
index 7ec9a86813977d98ddcf63b3d85b52cfdf69deb2..1ca30e6c96daf0e2b1a8c457dab8464d83a2141e 100644 (file)
@@ -316,12 +316,14 @@ namespace Mono.Net.Security.Private
 */
                X509Certificate OnCertificateSelection (X509CertificateCollection clientCerts, X509Certificate serverCert, string targetHost, X509CertificateCollection serverRequestedCerts)
                {
+#pragma warning disable 618
                        string [] acceptableIssuers = new string [serverRequestedCerts != null ? serverRequestedCerts.Count : 0];
                        for (int i = 0; i < acceptableIssuers.Length; i++)
                                acceptableIssuers [i] = serverRequestedCerts [i].GetIssuerName ();
                        X509Certificate clientCertificate;
                        certificateValidator.SelectClientCertificate (targetHost, clientCerts, serverCert, acceptableIssuers, out clientCertificate);
                        return clientCertificate;
+#pragma warning restore 618
                }
 
                public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
index f051a5fcbc2c04ca406f2edebcf63019cc0af693..79f0468d4619aee415b238d9171366fe801abb8e 100644 (file)
@@ -35,6 +35,7 @@ namespace Mono.Net.Security
                MobileAuthenticatedStream parent;
                bool serverMode;
                string targetHost;
+               string serverName;
                SslProtocols enabledProtocols;
                X509Certificate serverCertificate;
                X509CertificateCollection clientCertificates;
@@ -54,6 +55,13 @@ namespace Mono.Net.Security
                        this.clientCertificates = clientCertificates;
                        this.askForClientCert = askForClientCert;
 
+                       serverName = targetHost;
+                       if (!string.IsNullOrEmpty (serverName)) {
+                               var pos = serverName.IndexOf (':');
+                               if (pos > 0)
+                                       serverName = serverName.Substring (0, pos);
+                       }
+
                        certificateValidator = CertificateValidationHelper.GetInternalValidator (
                                parent.Settings, parent.Provider);
                }
@@ -92,6 +100,10 @@ namespace Mono.Net.Security
                        get { return targetHost; }
                }
 
+               protected string ServerName {
+                       get { return serverName; }
+               }
+
                protected bool AskForClientCertificate {
                        get { return askForClientCert; }
                }
index 7ba425257f592e7432baac6850c980b0a5d22f94..f9bd47396e6328a2a272c22832a6dcb873b16423 100644 (file)
@@ -2,7 +2,7 @@
 #if SECURITY_DEP
 using System;
 using MSI = Mono.Security.Interface;
-#if HAVE_BTLS
+#if MONO_FEATURE_BTLS
 using Mono.Btls;
 #endif
 
@@ -19,13 +19,11 @@ namespace Mono.Net.Security
                        case "default":
                        case "legacy":
                                return new LegacyTlsProvider ();
+#if MONO_FEATURE_BTLS
                        case "btls":
-#if HAVE_BTLS
-                               if (!MonoBtlsProvider.IsSupported ())
+                               if (!IsBtlsSupported ())
                                        throw new NotSupportedException ("BTLS in not supported!");
                                return new MonoBtlsProvider ();
-#else
-                               throw new NotSupportedException ("BTLS in not supported!");
 #endif
                        default:
                                throw new NotSupportedException (string.Format ("Invalid TLS Provider: `{0}'.", provider));
index 34d64334c1583e1ebe40d52830aabf5c1e07c8c4..071535a5c44ca31c5d8ac4fdb84d7ffdac657c3c 100644 (file)
@@ -39,6 +39,7 @@ using System.Security.Cryptography.X509Certificates;
 using System;
 using System.Net;
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 #if !MOBILE
 using System.Reflection;
@@ -107,6 +108,9 @@ namespace Mono.Net.Security
                                initialized = true;
                        }
                }
+
+               [MethodImpl (MethodImplOptions.InternalCall)]
+               internal extern static bool IsBtlsSupported ();
 #endif
 
                static object locker = new object ();
@@ -156,10 +160,9 @@ namespace Mono.Net.Security
                                        return;
                                providerRegistration = new Dictionary<string,string> ();
                                providerRegistration.Add ("legacy", "Mono.Net.Security.LegacyTlsProvider");
-#if HAVE_BTLS
-                               if (Mono.Btls.MonoBtlsProvider.IsSupported ())
+                               providerRegistration.Add ("default", "Mono.Net.Security.LegacyTlsProvider");
+                               if (IsBtlsSupported ())
                                        providerRegistration.Add ("btls", "Mono.Btls.MonoBtlsProvider");
-#endif
                                X509Helper2.Initialize ();
                        }
                }
@@ -168,11 +171,8 @@ namespace Mono.Net.Security
                static MSI.MonoTlsProvider TryDynamicLoad ()
                {
                        var variable = Environment.GetEnvironmentVariable ("MONO_TLS_PROVIDER");
-                       if (variable == null)
-                               return null;
-
-                       if (string.Equals (variable, "default", StringComparison.OrdinalIgnoreCase))
-                               return null;
+                       if (string.IsNullOrEmpty (variable))
+                               variable = "default";
 
                        return LookupProvider (variable, true);
                }
index 4e76cad89ff9e394858ed1544f99e8158ae78741..6e0e2a9b1f0740cfe7ebbcb7b0aaa98b56191efd 100644 (file)
@@ -75,7 +75,7 @@ namespace Mono.Net.Security
                }
 
 #if SECURITY_DEP
-               readonly ChainValidationHelper validationHelper;
+//             readonly ChainValidationHelper validationHelper;
                readonly MonoTlsSettings settings;
 
                public MonoTlsStream (HttpWebRequest request, NetworkStream networkStream)
@@ -87,7 +87,7 @@ namespace Mono.Net.Security
                        provider = request.TlsProvider ?? MonoTlsProviderFactory.GetProviderInternal ();
                        status = WebExceptionStatus.SecureChannelFailure;
 
-                       validationHelper = ChainValidationHelper.Create (provider.Provider, ref settings, this);
+                       /*validationHelper =*/ ChainValidationHelper.Create (provider.Provider, ref settings, this);
                }
 
                internal Stream CreateStream (byte[] buffer)
@@ -101,7 +101,7 @@ namespace Mono.Net.Security
                                        ServicePointManager.CheckCertificateRevocationList);
 
                                status = WebExceptionStatus.Success;
-                       } catch (Exception ex) {
+                       } catch (Exception) {
                                status = WebExceptionStatus.SecureChannelFailure;
                                throw;
                        } finally {
index 4e4d2859b032021c4fe0bbaf2b0dc9f7fb081b2d..f3b840e8f7f56533be087a32001bfdabaacd9a82 100644 (file)
@@ -1,7 +1,9 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Text.RegularExpressions;
+#if !MONOTOUCH_WATCH
 using Mono.Net;
+#endif
 
 namespace System.Net
 {
index 28e1c47e7d5801e8d0e81f3d2ad4db6c755c625d..9a8d89fab44999c3f6cbb4198abefb16585afccc 100644 (file)
@@ -27,8 +27,6 @@ namespace System.Security.Cryptography {
                                return "md2RSA";
                        case "1.2.840.113549.1.1.3":
                                return "md4RSA";
-                               return "md4RSA";
-                               return "md4RSA";
                        case "1.3.14.3.2.27":
                                return "dsaSHA1";
                        case "2.16.840.1.101.2.1.1.19":
index b7f3043a5941e184860fa86382ff491aed9709e0..8d92f001d56d241281f3bd1f1be02508be82bf4b 100644 (file)
@@ -2,7 +2,7 @@ using System.Collections;
 
 namespace System.Net
 {
-       static class UnsafeNclNativeMethods
+       static partial class UnsafeNclNativeMethods
        {
                internal static unsafe class HttpApi 
                {
index bbe72eed740eeef74c159f3b95e047f3dc38fa61..8eb5e066d02487b08f300b15d1d6b1a7ccee2ad7 100644 (file)
@@ -1,12 +1,9 @@
 using System.Diagnostics;
 
 namespace System.Net {
-       class Logging {
-               internal static bool On {
-                       get {
-                               return false;
-                       }
-               }
+       static class Logging
+       {
+               internal static readonly bool On = false;
 
                internal static TraceSource Web {
                        get {
@@ -34,6 +31,10 @@ namespace System.Net {
                internal static void Enter(TraceSource traceSource, string msg) {
                }
 
+               [Conditional ("TRACE")]
+               internal static void Enter(TraceSource traceSource, string msg, string parameters) {
+               }
+
                [Conditional ("TRACE")]
                internal static void Exception(TraceSource traceSource, object obj, string method, Exception e) {
                }
@@ -46,6 +47,10 @@ namespace System.Net {
                internal static void Exit(TraceSource traceSource, string msg) {
                }
 
+               [Conditional ("TRACE")]
+               internal static void Exit(TraceSource traceSource, string msg, string parameters) {
+               }
+
                [Conditional ("TRACE")]
                internal static void PrintInfo(TraceSource traceSource, object obj, string method, string msg) {
                }
diff --git a/mcs/class/System/ReferenceSources/SecureStringHelper.cs b/mcs/class/System/ReferenceSources/SecureStringHelper.cs
new file mode 100644 (file)
index 0000000..31372e2
--- /dev/null
@@ -0,0 +1,47 @@
+using System.Security;
+using System.Runtime.InteropServices;
+
+namespace System.Net
+{
+       static partial class UnsafeNclNativeMethods
+       {
+        internal unsafe static class SecureStringHelper
+        {
+            internal static string CreateString(SecureString secureString)
+            {
+                string plainString;
+                IntPtr bstr = IntPtr.Zero;
+
+                if (secureString == null || secureString.Length == 0)
+                    return String.Empty;
+
+                try
+                {
+                    bstr = Marshal.SecureStringToBSTR(secureString);
+                    plainString = Marshal.PtrToStringBSTR(bstr);
+                }
+                finally
+                {
+                    if (bstr != IntPtr.Zero)
+                        Marshal.ZeroFreeBSTR(bstr);
+                }
+                return plainString;
+            }
+
+            internal static SecureString CreateSecureString(string plainString)
+            {
+                SecureString secureString;
+
+                if (plainString == null || plainString.Length == 0)
+                    return new SecureString();
+
+                fixed (char* pch = plainString)
+                {
+                    secureString = new SecureString(pch, plainString.Length);
+                }
+
+                return secureString;
+            }
+        }
+    }
+}
\ No newline at end of file
index afe34459bbb58f8ae30911fd6b10b158757feed1..e7719c1afaadb5c134af12056a6613077c4fd021 100644 (file)
@@ -1,4 +1,5 @@
 using System.Net.Security;
+using System.Net.Sockets;
 
 namespace System.Net.Configuration {
        sealed class SettingsSectionInternal
@@ -16,8 +17,8 @@ namespace System.Net.Configuration {
                internal UnicodeDecodingConformance WebUtilityUnicodeDecodingConformance = UnicodeDecodingConformance.Auto;
 #endif
 
-               internal bool HttpListenerUnescapeRequestUrl = true;
-
+               internal readonly bool HttpListenerUnescapeRequestUrl = true;
+               internal readonly IPProtectionLevel IPProtectionLevel = IPProtectionLevel.Unspecified;
 
                internal bool UseNagleAlgorithm { get; set; }
                internal bool Expect100Continue { get; set; }
@@ -26,5 +27,20 @@ namespace System.Net.Configuration {
                internal bool EnableDnsRoundRobin { get; set; }
                internal bool CheckCertificateRevocationList { get; set; }
                internal EncryptionPolicy EncryptionPolicy { get; private set; }
+
+               internal bool Ipv6Enabled {
+                       get {
+#if CONFIGURATION_DEP && !MOBILE
+                               try {
+                                       var config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
+                                       if (config != null)
+                                               return config.Ipv6.Enabled;
+                               } catch {
+                               }
+#endif
+
+                               return true;
+                       }
+               }
        }
 }
index 62a424bb669ffd473e05aafea342bf3713a9fabc..40c5df098af3cfbd73a090ecac7874bb2683afb5 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -7,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{483DB7F6-9145-4AE2-B9B2-2B5EE6FDEFB4}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x/bare</OutputPath>\r
     <IntermediateOutputPath>obj-bare</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS</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,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="..\referencesource\System\net\System\Net\_ProxyChain.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_ScatterGatherBuffers.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_Semaphore.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\_ServiceNameStore.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_TimerThread.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_WebProxyDataBuilder.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\AuthenticationScheme.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\mail\TransferEncoding.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\mail\WriteStateInfoBase.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkAccess.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\NetworkCredential.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\DuplicateAddressDetectionState.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\GatewayIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\GatewayIPAddressInformationCollection.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemMulticastIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemTcpConnection.cs" />\r
-    <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemUnicastIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpConnection.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpState.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpStatistics.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\ServicePointManager.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\SocketAddress.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\SocketException.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\_MultipleConnectAsync.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\AddressFamily.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\IOControlCode.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\IPPacketInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\ProtocolFamily.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\ProtocolType.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SelectMode.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\Socket.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketErrors.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketFlags.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketOptionName.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketShutdown.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketType.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPClient.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPListener.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\TransmitFileFlags.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\UDPClient.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\UdpReceiveResult.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\TransportContext.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\TransportType.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexRunnerFactory.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexTree.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexWriter.cs" />\r
+    <Compile Include="..\referencesource\System\security\system\security\Authentication\ExtendedProtection\ServiceNameCollection.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\Authentication\ExtendedProtection\TokenBinding.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\cryptography\oid.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\cryptography\x509\x509utils.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\permissions\typedescriptorpermission.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\AsyncStreamReader.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\Process.cs" />\r
+    <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessModuleCollection.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessStartInfo.cs" />\r
+    <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessThreadCollection.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\processwaithandle.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\ElapsedEventHandler.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\Timer.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\TimersDescriptionAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\collections\concurrent\BlockingCollection.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\collections\concurrent\ConcurrentBag.cs" />\r
+    <Compile Include="..\referencesource\System\sys\system\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\IO\ports\InternalResources.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\runtime\interopservices\DefaultParameterValueAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\runtime\interopservices\handlecollector.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeCompiler.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeGenerator.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeProvider.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeX509ChainHandle.cs" />\r
     <Compile Include="Microsoft.Win32\IntranetZoneCredentialPolicy.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventArgs.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventHandler.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangedEventHandler.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangingEventArgs.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangingEventHandler.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsBio.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsContext.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsError.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsException.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsKey.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsObject.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsPkcs12.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsProvider.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSsl.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSslCtx.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSslError.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsStream.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsUtils.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Chain.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Crl.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Error.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Exception.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509FileType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Format.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Lookup.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupMono.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupMonoCollection.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Name.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509NameEntryType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Purpose.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Revoked.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Store.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreCtx.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreManager.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509TrustKind.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509VerifyFlags.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509VerifyParam.cs" />\r
+    <Compile Include="Mono.Btls\X509CertificateImplBtls.cs" />\r
+    <Compile Include="Mono.Btls\X509ChainImplBtls.cs" />\r
     <Compile Include="Mono.Http\NtlmClient.cs" />\r
     <Compile Include="Mono.Net.Dns\DnsClass.cs" />\r
     <Compile Include="Mono.Net.Dns\DnsHeader.cs" />\r
     <Compile Include="Mono.Net.Dns\ResolverError.cs" />\r
     <Compile Include="Mono.Net.Dns\SimpleResolver.cs" />\r
     <Compile Include="Mono.Net.Dns\SimpleResolverEventArgs.cs" />\r
+    <Compile Include="Mono.Net.Security\AsyncProtocolRequest.cs" />\r
     <Compile Include="Mono.Net.Security\CallbackHelpers.cs" />\r
     <Compile Include="Mono.Net.Security\ChainValidationHelper.cs" />\r
     <Compile Include="Mono.Net.Security\IMonoSslStream.cs" />\r
     <Compile Include="Mono.Net.Security\IMonoTlsProvider.cs" />\r
     <Compile Include="Mono.Net.Security\LegacySslStream.cs" />\r
-    <Compile Include="Mono.Net.Security\MonoDefaultTlsProvider.cs" />\r
+    <Compile Include="Mono.Net.Security\LegacyTlsProvider.cs" />\r
+    <Compile Include="Mono.Net.Security\MobileAuthenticatedStream.cs" />\r
+    <Compile Include="Mono.Net.Security\MobileTlsContext.cs" />\r
     <Compile Include="Mono.Net.Security\MonoSslStreamImpl.cs" />\r
     <Compile Include="Mono.Net.Security\MonoSslStreamWrapper.cs" />\r
     <Compile Include="Mono.Net.Security\MonoTlsProviderFactory.cs" />\r
     <Compile Include="ReferenceSources\EnvironmentHelpers.cs" />\r
     <Compile Include="ReferenceSources\HttpApi.cs" />\r
     <Compile Include="ReferenceSources\HttpSysSettings.cs" />\r
+    <Compile Include="ReferenceSources\LocalAppContextSwitches.cs" />\r
     <Compile Include="ReferenceSources\Logging.cs" />\r
     <Compile Include="ReferenceSources\NativeMethods.cs" />\r
     <Compile Include="ReferenceSources\RequestCacheProtocol.cs" />\r
+    <Compile Include="ReferenceSources\SecureStringHelper.cs" />\r
     <Compile Include="ReferenceSources\SettingsSectionInternal.cs" />\r
     <Compile Include="ReferenceSources\Socket.cs" />\r
     <Compile Include="ReferenceSources\SR.cs" />\r
     <Compile Include="System.Configuration\UriSection.cs" />\r
     <Compile Include="System.Configuration\UserScopedSettingAttribute.cs" />\r
     <Compile Include="System.Configuration\UserSettingsGroup.cs" />\r
-    <Compile Include="System.Diagnostics.CodeAnalysis\ExcludeFromCodeCoverageAttribute.cs" />\r
     <Compile Include="System.Diagnostics\AlphabeticalEnumConverter.cs" />\r
     <Compile Include="System.Diagnostics\CounterCreationData.cs" />\r
     <Compile Include="System.Diagnostics\CounterCreationDataCollection.cs" />\r
     <Compile Include="System.Diagnostics\PerformanceCounterType.cs" />\r
     <Compile Include="System.Diagnostics\Process.cs" />\r
     <Compile Include="System.Diagnostics\ProcessModule.cs" />\r
-    <Compile Include="System.Diagnostics\ProcessModuleCollection.cs" />\r
     <Compile Include="System.Diagnostics\ProcessPriorityClass.cs" />\r
     <Compile Include="System.Diagnostics\ProcessStartInfo.cs" />\r
     <Compile Include="System.Diagnostics\ProcessThread.cs" />\r
-    <Compile Include="System.Diagnostics\ProcessThreadCollection.cs" />\r
     <Compile Include="System.Diagnostics\ProcessWindowStyle.cs" />\r
     <Compile Include="System.Diagnostics\Stopwatch.cs" />\r
     <Compile Include="System.Diagnostics\ThreadPriorityLevel.cs" />\r
     <Compile Include="System.Net.Security\SslPolicyErrors.cs" />\r
     <Compile Include="System.Net.Security\SslStream.cs" />\r
     <Compile Include="System.Net.Sockets\SafeSocketHandle.cs" />\r
-    <Compile Include="System.Net.Sockets\SendPacketsElement.cs" />\r
     <Compile Include="System.Net.Sockets\Socket.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
     <Compile Include="System.Net.Sockets\SocketOperation.cs" />\r
-    <Compile Include="System.Net.Sockets\TcpClient.cs" />\r
-    <Compile Include="System.Net.Sockets\TcpListener.cs" />\r
-    <Compile Include="System.Net.Sockets\UdpClient.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveMessageFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketTaskExtensions.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocket.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocketOptions.cs" />\r
     <Compile Include="System.Net.WebSockets\HttpListenerWebSocketContext.cs" />\r
     <Compile Include="System.Net\HttpListenerPrefixCollection.cs" />\r
     <Compile Include="System.Net\HttpListenerRequest.cs" />\r
     <Compile Include="System.Net\HttpListenerResponse.cs" />\r
+    <Compile Include="System.Net\HttpListenerResponseHelper.cs" />\r
     <Compile Include="System.Net\HttpListenerTimeoutManager.cs" />\r
     <Compile Include="System.Net\HttpRequestCreator.cs" />\r
     <Compile Include="System.Net\HttpStreamAsyncResult.cs" />\r
     <Compile Include="System.Net\MacProxy.cs" />\r
     <Compile Include="System.Net\MonoHttpDate.cs" />\r
     <Compile Include="System.Net\NetConfig.cs" />\r
-    <Compile Include="System.Net\NetworkCredential.cs" />\r
     <Compile Include="System.Net\NtlmClient.cs" />\r
     <Compile Include="System.Net\RequestStream.cs" />\r
     <Compile Include="System.Net\ResponseStream.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\ExtendedProtectionPolicyTypeConverter.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\PolicyEnforcement.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\ProtectionScenario.cs" />\r
-    <Compile Include="System.Security.Authentication.ExtendedProtection\ServiceNameCollection.cs" />\r
     <Compile Include="System.Security.Authentication\AuthenticationException.cs" />\r
     <Compile Include="System.Security.Authentication\CipherAlgorithmType.cs" />\r
     <Compile Include="System.Security.Authentication\ExchangeAlgorithmType.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2Impl.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2ImplMono.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateCollection.cs" />\r
+    <Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateImplCollection.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Chain.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainElement.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainElementCollection.cs" />\r
     <Compile Include="System.Web\AspNetHostingPermissionLevel.cs" />\r
     <Compile Include="System.Windows.Input\ICommand.cs" />\r
     <Compile Include="System\IOSelector.cs" />\r
+    <Compile Include="System\MonoToolsLocator.cs" />\r
     <Compile Include="System\Platform.cs" />\r
     <Compile Include="System\SRDescriptionAttribute.cs" />\r
     <Compile Include="System\UriTypeConverter.cs" />\r  </ItemGroup>\r
index bd89dd5b2868dc0c1f469f9e68cc97e41f7c6fd3..c02b60fcc01de334d5140209855d985ac79eec67 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -7,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{2762E921-91A8-4C87-91E9-BA628013F753}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
     <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_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,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="..\referencesource\System\net\System\Net\_ProxyChain.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_ScatterGatherBuffers.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_Semaphore.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\_ServiceNameStore.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_TimerThread.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_WebProxyDataBuilder.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\AuthenticationScheme.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\mail\TransferEncoding.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\mail\WriteStateInfoBase.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkAccess.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\NetworkCredential.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\DuplicateAddressDetectionState.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\GatewayIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\GatewayIPAddressInformationCollection.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemMulticastIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemTcpConnection.cs" />\r
-    <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemUnicastIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpConnection.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpState.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpStatistics.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\ServicePointManager.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\SocketAddress.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\SocketException.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\_MultipleConnectAsync.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\AddressFamily.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\IOControlCode.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\IPPacketInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\ProtocolFamily.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\ProtocolType.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SelectMode.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\Socket.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketErrors.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketFlags.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketOptionName.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketShutdown.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketType.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPClient.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPListener.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\TransmitFileFlags.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\UDPClient.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\UdpReceiveResult.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\TransportContext.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\TransportType.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexRunnerFactory.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexTree.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexWriter.cs" />\r
+    <Compile Include="..\referencesource\System\security\system\security\Authentication\ExtendedProtection\ServiceNameCollection.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\Authentication\ExtendedProtection\TokenBinding.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\cryptography\oid.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\cryptography\x509\x509utils.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\permissions\typedescriptorpermission.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\AsyncStreamReader.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\Process.cs" />\r
+    <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessModuleCollection.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessStartInfo.cs" />\r
+    <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessThreadCollection.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\processwaithandle.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\ElapsedEventHandler.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\Timer.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\TimersDescriptionAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\collections\concurrent\BlockingCollection.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\collections\concurrent\ConcurrentBag.cs" />\r
+    <Compile Include="..\referencesource\System\sys\system\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\IO\ports\InternalResources.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\runtime\interopservices\DefaultParameterValueAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\runtime\interopservices\handlecollector.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeCompiler.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeGenerator.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeProvider.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeX509ChainHandle.cs" />\r
     <Compile Include="Microsoft.Win32\IntranetZoneCredentialPolicy.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventArgs.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventHandler.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangedEventHandler.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangingEventArgs.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangingEventHandler.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsBio.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsContext.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsError.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsException.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsKey.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsObject.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsPkcs12.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsProvider.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSsl.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSslCtx.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSslError.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsStream.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsUtils.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Chain.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Crl.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Error.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Exception.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509FileType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Format.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Lookup.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupMono.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupMonoCollection.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Name.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509NameEntryType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Purpose.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Revoked.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Store.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreCtx.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreManager.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509TrustKind.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509VerifyFlags.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509VerifyParam.cs" />\r
+    <Compile Include="Mono.Btls\X509CertificateImplBtls.cs" />\r
+    <Compile Include="Mono.Btls\X509ChainImplBtls.cs" />\r
     <Compile Include="Mono.Http\NtlmClient.cs" />\r
     <Compile Include="Mono.Net.Dns\DnsClass.cs" />\r
     <Compile Include="Mono.Net.Dns\DnsHeader.cs" />\r
     <Compile Include="Mono.Net.Dns\ResolverError.cs" />\r
     <Compile Include="Mono.Net.Dns\SimpleResolver.cs" />\r
     <Compile Include="Mono.Net.Dns\SimpleResolverEventArgs.cs" />\r
+    <Compile Include="Mono.Net.Security\AsyncProtocolRequest.cs" />\r
     <Compile Include="Mono.Net.Security\CallbackHelpers.cs" />\r
     <Compile Include="Mono.Net.Security\ChainValidationHelper.cs" />\r
     <Compile Include="Mono.Net.Security\IMonoSslStream.cs" />\r
     <Compile Include="Mono.Net.Security\IMonoTlsProvider.cs" />\r
     <Compile Include="Mono.Net.Security\LegacySslStream.cs" />\r
-    <Compile Include="Mono.Net.Security\MonoDefaultTlsProvider.cs" />\r
+    <Compile Include="Mono.Net.Security\LegacyTlsProvider.cs" />\r
+    <Compile Include="Mono.Net.Security\MobileAuthenticatedStream.cs" />\r
+    <Compile Include="Mono.Net.Security\MobileTlsContext.cs" />\r
     <Compile Include="Mono.Net.Security\MonoSslStreamImpl.cs" />\r
     <Compile Include="Mono.Net.Security\MonoSslStreamWrapper.cs" />\r
     <Compile Include="Mono.Net.Security\MonoTlsProviderFactory.cs" />\r
     <Compile Include="ReferenceSources\EnvironmentHelpers.cs" />\r
     <Compile Include="ReferenceSources\HttpApi.cs" />\r
     <Compile Include="ReferenceSources\HttpSysSettings.cs" />\r
+    <Compile Include="ReferenceSources\LocalAppContextSwitches.cs" />\r
     <Compile Include="ReferenceSources\Logging.cs" />\r
     <Compile Include="ReferenceSources\NativeMethods.cs" />\r
     <Compile Include="ReferenceSources\RequestCacheProtocol.cs" />\r
+    <Compile Include="ReferenceSources\SecureStringHelper.cs" />\r
     <Compile Include="ReferenceSources\SettingsSectionInternal.cs" />\r
     <Compile Include="ReferenceSources\Socket.cs" />\r
     <Compile Include="ReferenceSources\SR.cs" />\r
     <Compile Include="System.Configuration\UriSection.cs" />\r
     <Compile Include="System.Configuration\UserScopedSettingAttribute.cs" />\r
     <Compile Include="System.Configuration\UserSettingsGroup.cs" />\r
-    <Compile Include="System.Diagnostics.CodeAnalysis\ExcludeFromCodeCoverageAttribute.cs" />\r
     <Compile Include="System.Diagnostics\AlphabeticalEnumConverter.cs" />\r
     <Compile Include="System.Diagnostics\CounterCreationData.cs" />\r
     <Compile Include="System.Diagnostics\CounterCreationDataCollection.cs" />\r
     <Compile Include="System.Diagnostics\PerformanceCounterType.cs" />\r
     <Compile Include="System.Diagnostics\Process.cs" />\r
     <Compile Include="System.Diagnostics\ProcessModule.cs" />\r
-    <Compile Include="System.Diagnostics\ProcessModuleCollection.cs" />\r
     <Compile Include="System.Diagnostics\ProcessPriorityClass.cs" />\r
     <Compile Include="System.Diagnostics\ProcessStartInfo.cs" />\r
     <Compile Include="System.Diagnostics\ProcessThread.cs" />\r
-    <Compile Include="System.Diagnostics\ProcessThreadCollection.cs" />\r
     <Compile Include="System.Diagnostics\ProcessWindowStyle.cs" />\r
     <Compile Include="System.Diagnostics\Stopwatch.cs" />\r
     <Compile Include="System.Diagnostics\ThreadPriorityLevel.cs" />\r
     <Compile Include="System.Net.Security\SslPolicyErrors.cs" />\r
     <Compile Include="System.Net.Security\SslStream.cs" />\r
     <Compile Include="System.Net.Sockets\SafeSocketHandle.cs" />\r
-    <Compile Include="System.Net.Sockets\SendPacketsElement.cs" />\r
     <Compile Include="System.Net.Sockets\Socket.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
     <Compile Include="System.Net.Sockets\SocketOperation.cs" />\r
-    <Compile Include="System.Net.Sockets\TcpClient.cs" />\r
-    <Compile Include="System.Net.Sockets\TcpListener.cs" />\r
-    <Compile Include="System.Net.Sockets\UdpClient.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveMessageFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketTaskExtensions.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocket.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocketOptions.cs" />\r
     <Compile Include="System.Net.WebSockets\HttpListenerWebSocketContext.cs" />\r
     <Compile Include="System.Net\HttpListenerPrefixCollection.cs" />\r
     <Compile Include="System.Net\HttpListenerRequest.cs" />\r
     <Compile Include="System.Net\HttpListenerResponse.cs" />\r
+    <Compile Include="System.Net\HttpListenerResponseHelper.cs" />\r
     <Compile Include="System.Net\HttpListenerTimeoutManager.cs" />\r
     <Compile Include="System.Net\HttpRequestCreator.cs" />\r
     <Compile Include="System.Net\HttpStreamAsyncResult.cs" />\r
     <Compile Include="System.Net\MacProxy.cs" />\r
     <Compile Include="System.Net\MonoHttpDate.cs" />\r
     <Compile Include="System.Net\NetConfig.cs" />\r
-    <Compile Include="System.Net\NetworkCredential.cs" />\r
     <Compile Include="System.Net\NtlmClient.cs" />\r
     <Compile Include="System.Net\RequestStream.cs" />\r
     <Compile Include="System.Net\ResponseStream.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\ExtendedProtectionPolicyTypeConverter.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\PolicyEnforcement.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\ProtectionScenario.cs" />\r
-    <Compile Include="System.Security.Authentication.ExtendedProtection\ServiceNameCollection.cs" />\r
     <Compile Include="System.Security.Authentication\AuthenticationException.cs" />\r
     <Compile Include="System.Security.Authentication\CipherAlgorithmType.cs" />\r
     <Compile Include="System.Security.Authentication\ExchangeAlgorithmType.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2Impl.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2ImplMono.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateCollection.cs" />\r
+    <Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateImplCollection.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Chain.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainElement.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainElementCollection.cs" />\r
     <Compile Include="System.Web\AspNetHostingPermissionLevel.cs" />\r
     <Compile Include="System.Windows.Input\ICommand.cs" />\r
     <Compile Include="System\IOSelector.cs" />\r
+    <Compile Include="System\MonoToolsLocator.cs" />\r
     <Compile Include="System\Platform.cs" />\r
     <Compile Include="System\SRDescriptionAttribute.cs" />\r
     <Compile Include="System\UriTypeConverter.cs" />\r  </ItemGroup>\r
index 29567cd320bf9946eb614e97f6b90f44804b1779..dcaca1cff413a3bd8d0a1959922589674bc64634 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -7,7 +8,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{19954F80-065E-4D46-8FEF-62BA4D6CFDAD}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x/secxml</OutputPath>\r
     <IntermediateOutputPath>obj-secxml</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;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,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="..\referencesource\System\net\System\Net\_ProxyChain.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_ScatterGatherBuffers.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_Semaphore.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\_ServiceNameStore.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_TimerThread.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\_WebProxyDataBuilder.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\AuthenticationScheme.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\mail\TransferEncoding.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\mail\WriteStateInfoBase.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkAccess.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\NetworkCredential.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\DuplicateAddressDetectionState.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\GatewayIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\GatewayIPAddressInformationCollection.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemMulticastIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemTcpConnection.cs" />\r
-    <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\SystemUnicastIPAddressInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpConnection.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpState.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\NetworkInformation\TcpStatistics.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\ServicePointManager.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\SocketAddress.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\SocketException.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\_MultipleConnectAsync.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\AddressFamily.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\IOControlCode.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\IPPacketInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\ProtocolFamily.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\ProtocolType.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SelectMode.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\Socket.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketErrors.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketFlags.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketInformation.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketOptionName.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketShutdown.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\SocketType.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPClient.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\TCPListener.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\TransmitFileFlags.cs" />\r
+    <Compile Include="..\referencesource\System\net\System\Net\Sockets\UDPClient.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\Sockets\UdpReceiveResult.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\TransportContext.cs" />\r
     <Compile Include="..\referencesource\System\net\System\Net\TransportType.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexRunnerFactory.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexTree.cs" />\r
     <Compile Include="..\referencesource\System\regex\system\text\regularexpressions\RegexWriter.cs" />\r
+    <Compile Include="..\referencesource\System\security\system\security\Authentication\ExtendedProtection\ServiceNameCollection.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\Authentication\ExtendedProtection\TokenBinding.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\cryptography\oid.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\cryptography\x509\x509utils.cs" />\r
     <Compile Include="..\referencesource\System\security\system\security\permissions\typedescriptorpermission.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\AsyncStreamReader.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\Process.cs" />\r
+    <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessModuleCollection.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessStartInfo.cs" />\r
+    <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\ProcessThreadCollection.cs" />\r
     <Compile Include="..\referencesource\System\services\monitoring\system\diagnosticts\processwaithandle.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\ElapsedEventHandler.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\Timer.cs" />\r
     <Compile Include="..\referencesource\System\services\timers\system\timers\TimersDescriptionAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\collections\concurrent\BlockingCollection.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\collections\concurrent\ConcurrentBag.cs" />\r
+    <Compile Include="..\referencesource\System\sys\system\Diagnostics\CodeAnalysis\ExcludeFromCodeCoverageAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\IO\ports\InternalResources.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\runtime\interopservices\DefaultParameterValueAttribute.cs" />\r
     <Compile Include="..\referencesource\System\sys\system\runtime\interopservices\handlecollector.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeCompiler.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeGenerator.cs" />\r
     <Compile Include="Microsoft.VisualBasic\VBCodeProvider.cs" />\r
+    <Compile Include="Microsoft.Win32.SafeHandles\SafeX509ChainHandle.cs" />\r
     <Compile Include="Microsoft.Win32\IntranetZoneCredentialPolicy.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventArgs.cs" />\r
     <Compile Include="Microsoft.Win32\PowerModeChangedEventHandler.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangedEventHandler.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangingEventArgs.cs" />\r
     <Compile Include="Microsoft.Win32\UserPreferenceChangingEventHandler.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsBio.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsContext.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsError.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsException.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsKey.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsObject.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsPkcs12.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsProvider.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSsl.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSslCtx.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsSslError.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsStream.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsUtils.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Chain.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Crl.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Error.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Exception.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509FileType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Format.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Lookup.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupMono.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupMonoCollection.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509LookupType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Name.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509NameEntryType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Purpose.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Revoked.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509Store.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreCtx.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreManager.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509StoreType.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509TrustKind.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509VerifyFlags.cs" />\r
+    <Compile Include="Mono.Btls\MonoBtlsX509VerifyParam.cs" />\r
+    <Compile Include="Mono.Btls\X509CertificateImplBtls.cs" />\r
+    <Compile Include="Mono.Btls\X509ChainImplBtls.cs" />\r
     <Compile Include="Mono.Http\NtlmClient.cs" />\r
     <Compile Include="Mono.Net.Dns\DnsClass.cs" />\r
     <Compile Include="Mono.Net.Dns\DnsHeader.cs" />\r
     <Compile Include="Mono.Net.Dns\ResolverError.cs" />\r
     <Compile Include="Mono.Net.Dns\SimpleResolver.cs" />\r
     <Compile Include="Mono.Net.Dns\SimpleResolverEventArgs.cs" />\r
+    <Compile Include="Mono.Net.Security\AsyncProtocolRequest.cs" />\r
     <Compile Include="Mono.Net.Security\CallbackHelpers.cs" />\r
     <Compile Include="Mono.Net.Security\ChainValidationHelper.cs" />\r
     <Compile Include="Mono.Net.Security\IMonoSslStream.cs" />\r
     <Compile Include="Mono.Net.Security\IMonoTlsProvider.cs" />\r
     <Compile Include="Mono.Net.Security\LegacySslStream.cs" />\r
-    <Compile Include="Mono.Net.Security\MonoDefaultTlsProvider.cs" />\r
+    <Compile Include="Mono.Net.Security\LegacyTlsProvider.cs" />\r
+    <Compile Include="Mono.Net.Security\MobileAuthenticatedStream.cs" />\r
+    <Compile Include="Mono.Net.Security\MobileTlsContext.cs" />\r
     <Compile Include="Mono.Net.Security\MonoSslStreamImpl.cs" />\r
     <Compile Include="Mono.Net.Security\MonoSslStreamWrapper.cs" />\r
     <Compile Include="Mono.Net.Security\MonoTlsProviderFactory.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\LocalAppContextSwitches.cs" />\r
     <Compile Include="ReferenceSources\Logging.cs" />\r
     <Compile Include="ReferenceSources\NativeMethods.cs" />\r
     <Compile Include="ReferenceSources\RequestCacheProtocol.cs" />\r
+    <Compile Include="ReferenceSources\SecureStringHelper.cs" />\r
     <Compile Include="ReferenceSources\SettingsSectionInternal.cs" />\r
     <Compile Include="ReferenceSources\Socket.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="System.Configuration\UriSection.cs" />\r
     <Compile Include="System.Configuration\UserScopedSettingAttribute.cs" />\r
     <Compile Include="System.Configuration\UserSettingsGroup.cs" />\r
-    <Compile Include="System.Diagnostics.CodeAnalysis\ExcludeFromCodeCoverageAttribute.cs" />\r
     <Compile Include="System.Diagnostics\AlphabeticalEnumConverter.cs" />\r
     <Compile Include="System.Diagnostics\CounterCreationData.cs" />\r
     <Compile Include="System.Diagnostics\CounterCreationDataCollection.cs" />\r
     <Compile Include="System.Diagnostics\PerformanceCounterType.cs" />\r
     <Compile Include="System.Diagnostics\Process.cs" />\r
     <Compile Include="System.Diagnostics\ProcessModule.cs" />\r
-    <Compile Include="System.Diagnostics\ProcessModuleCollection.cs" />\r
     <Compile Include="System.Diagnostics\ProcessPriorityClass.cs" />\r
     <Compile Include="System.Diagnostics\ProcessStartInfo.cs" />\r
     <Compile Include="System.Diagnostics\ProcessThread.cs" />\r
-    <Compile Include="System.Diagnostics\ProcessThreadCollection.cs" />\r
     <Compile Include="System.Diagnostics\ProcessWindowStyle.cs" />\r
     <Compile Include="System.Diagnostics\Stopwatch.cs" />\r
     <Compile Include="System.Diagnostics\ThreadPriorityLevel.cs" />\r
     <Compile Include="System.Net.Security\SslPolicyErrors.cs" />\r
     <Compile Include="System.Net.Security\SslStream.cs" />\r
     <Compile Include="System.Net.Sockets\SafeSocketHandle.cs" />\r
-    <Compile Include="System.Net.Sockets\SendPacketsElement.cs" />\r
     <Compile Include="System.Net.Sockets\Socket.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
-    <Compile Include="System.Net.Sockets\SocketAsyncOperation.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
     <Compile Include="System.Net.Sockets\SocketOperation.cs" />\r
-    <Compile Include="System.Net.Sockets\TcpClient.cs" />\r
-    <Compile Include="System.Net.Sockets\TcpListener.cs" />\r
-    <Compile Include="System.Net.Sockets\UdpClient.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveMessageFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketTaskExtensions.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocket.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocketOptions.cs" />\r
     <Compile Include="System.Net.WebSockets\HttpListenerWebSocketContext.cs" />\r
     <Compile Include="System.Net\HttpListenerPrefixCollection.cs" />\r
     <Compile Include="System.Net\HttpListenerRequest.cs" />\r
     <Compile Include="System.Net\HttpListenerResponse.cs" />\r
+    <Compile Include="System.Net\HttpListenerResponseHelper.cs" />\r
     <Compile Include="System.Net\HttpListenerTimeoutManager.cs" />\r
     <Compile Include="System.Net\HttpRequestCreator.cs" />\r
     <Compile Include="System.Net\HttpStreamAsyncResult.cs" />\r
     <Compile Include="System.Net\MacProxy.cs" />\r
     <Compile Include="System.Net\MonoHttpDate.cs" />\r
     <Compile Include="System.Net\NetConfig.cs" />\r
-    <Compile Include="System.Net\NetworkCredential.cs" />\r
     <Compile Include="System.Net\NtlmClient.cs" />\r
     <Compile Include="System.Net\RequestStream.cs" />\r
     <Compile Include="System.Net\ResponseStream.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\ExtendedProtectionPolicyTypeConverter.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\PolicyEnforcement.cs" />\r
     <Compile Include="System.Security.Authentication.ExtendedProtection\ProtectionScenario.cs" />\r
-    <Compile Include="System.Security.Authentication.ExtendedProtection\ServiceNameCollection.cs" />\r
     <Compile Include="System.Security.Authentication\AuthenticationException.cs" />\r
     <Compile Include="System.Security.Authentication\CipherAlgorithmType.cs" />\r
     <Compile Include="System.Security.Authentication\ExchangeAlgorithmType.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2Impl.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Certificate2ImplMono.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateCollection.cs" />\r
+    <Compile Include="System.Security.Cryptography.X509Certificates\X509CertificateImplCollection.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Chain.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainElement.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509ChainElementCollection.cs" />\r
     <Compile Include="System.Web\AspNetHostingPermissionLevel.cs" />\r
     <Compile Include="System.Windows.Input\ICommand.cs" />\r
     <Compile Include="System\IOSelector.cs" />\r
+    <Compile Include="System\MonoToolsLocator.cs" />\r
     <Compile Include="System\Platform.cs" />\r
     <Compile Include="System\SRDescriptionAttribute.cs" />\r
     <Compile Include="System\UriTypeConverter.cs" />\r  </ItemGroup>\r
index b24eda319cfeab888dc038a778aa6d7d2ec47c07..192f1c070739da293c929c92976b268f2e2f7a8c 100644 (file)
@@ -37,6 +37,8 @@ using System.IO;
 using System.Runtime.InteropServices;
 using System.Security.Permissions;
 
+#pragma warning disable 618
+
 namespace System.CodeDom.Compiler {
 
        [ComVisible (true)]
@@ -314,3 +316,5 @@ namespace System.CodeDom.Compiler {
                }               
        }
 }
+
+#pragma warning restore 618
\ No newline at end of file
index 80c30eece70d9d13e40ed5d50ffb86c729d42938..2f679cb6895010260c4996643d1da974189921ed 100644 (file)
@@ -103,11 +103,13 @@ namespace System.CodeDom.Compiler {
                                                }
                                        }
 
+#if FEATURE_MONO_CAS
                                        // and you must have discovery access to the combined path
                                        // note: the cache behaviour is tested in the CAS tests
                                        if (SecurityManager.SecurityEnabled) {
                                                new FileIOPermission (FileIOPermissionAccess.PathDiscovery, basepath).Demand ();
                                        }
+#endif
                                }
 
                                return(basepath);
index 7a0bd6ef5dff7a556ba5159e668a4887b9b1acb6..304238e63d589bfa889a0ebf06f25e432ab49023 100644 (file)
@@ -31,6 +31,8 @@
 using System.Reflection;
 using System.Collections.Specialized;
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        public class AppSettingsReader
index 89adbe2589101044f97e5213389bd42f7dd8bb65..fd9bb69de96581ab123a4b99819b0d4bbf4bffd1 100644 (file)
@@ -34,6 +34,8 @@ using System.Collections.Specialized;
 using System.Xml;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        class ConfigHelper
index 1ab98591990dbc8668c681db8452119b74526f55..c6ec61f1af60067e9072385ad0d2f13720d2f9a7 100644 (file)
@@ -37,6 +37,8 @@ using System.Security.Permissions;
 #if (XML_DEP)
 using System.Xml;
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
index 9b2f8e9986b8768ff7ae95a95620bbb19cb9d7a1..8a038c81aa62ecee7ab1d79e8db136561da1886c 100644 (file)
@@ -43,6 +43,8 @@ using System.Xml;
 using System.Xml.XPath;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        public sealed class ConfigurationSettings
index efa336e927c8ee4f3ba5a20f26045ba53fe8ba00..301c65d87b5cdce21a45a07671e2353392bfa6a2 100644 (file)
@@ -37,6 +37,8 @@ using System.Xml;
 using XmlNode = System.Object;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        public class NameValueFileSectionHandler : IConfigurationSectionHandler
index 346b5b5f3a1fe5f91f77e8ac753035bb1e59903a..9c66654b3da57cc359f6a4def3d0fa09a075708b 100644 (file)
@@ -36,6 +36,8 @@ using System.Xml;
 using XmlNode = System.Object;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        /// <summary>
index cecf7de61f45b6d20b1ff3c631e1e1c2d38a5403..e1940f910f25823b68a4bff1dc65ecb3e7da20d1 100644 (file)
@@ -32,7 +32,6 @@
 //
 
 using System;
-using System.Diagnostics;
 using System.Collections;
 using System.ComponentModel;
 using System.ComponentModel.Design;
@@ -40,6 +39,8 @@ using System.Globalization;
 using System.IO;
 using System.Runtime.InteropServices;
 
+#pragma warning disable 618
+
 namespace System.Diagnostics 
 {
        [DefaultEvent ("EntryWritten")]
index f76f0950f459bbf951ebbf0ebba82e30b0f097bf..4261b3bc491040c8aee0446fe9f8fa71be8313ae 100644 (file)
@@ -159,7 +159,7 @@ namespace System.Diagnostics {
                }
 
                // may throw ArgumentNullException
-               [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+               [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
                [TypeConverter ("System.Diagnostics.Design.CategoryValueConverter, " + Consts.AssemblySystem_Design)]
                [SRDescription ("The category name for this performance counter.")]
                public string CategoryName {
@@ -181,7 +181,7 @@ namespace System.Diagnostics {
                }
 
                // may throw ArgumentNullException
-               [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+               [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
                [TypeConverter ("System.Diagnostics.Design.CounterNameConverter, " + Consts.AssemblySystem_Design)]
                [SRDescription ("The name of this performance counter.")]
                public string CounterName 
@@ -212,7 +212,7 @@ namespace System.Diagnostics {
                        set { lifetime = value; }
                }
 
-               [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+               [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
                [TypeConverter ("System.Diagnostics.Design.InstanceNameConverter, " + Consts.AssemblySystem_Design)]
                [SRDescription ("The instance name for this performance counter.")]
                public string InstanceName {
@@ -227,7 +227,7 @@ namespace System.Diagnostics {
 
                // may throw ArgumentException if machine name format is wrong
                [MonoTODO("What's the machine name format?")]
-               [DefaultValue ("."), Browsable (false), RecommendedAsConfigurable (true)]
+               [DefaultValue ("."), Browsable (false), SettingsBindable (true)]
                [SRDescription ("The machine where this performance counter resides.")]
                public string MachineName {
                        get {return machineName;}
index 455d60b0d22802e0a7fba89a3671ec0977ca516b..74f1990f516f3ffd90536cfd6e6e85792e949b7d 100644 (file)
@@ -469,16 +469,6 @@ namespace System.Diagnostics
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private extern static IntPtr GetProcess_internal(int pid);
 
-               public static Process GetProcessById(int processId)
-               {
-                       IntPtr proc = GetProcess_internal(processId);
-                       
-                       if (proc == IntPtr.Zero)
-                               throw new ArgumentException ("Can't find process with ID " + processId.ToString ());
-
-                       return (new Process (new SafeProcessHandle (proc, false), processId));
-               }
-
                [MonoTODO ("There is no support for retrieving process information from a remote machine")]
                public static Process GetProcessById(int processId, string machineName) {
                        if (machineName == null)
@@ -487,34 +477,17 @@ namespace System.Diagnostics
                        if (!IsLocalMachine (machineName))
                                throw new NotImplementedException ();
 
-                       return GetProcessById (processId);
+                       IntPtr proc = GetProcess_internal(processId);
+
+                       if (proc == IntPtr.Zero)
+                               throw new ArgumentException ("Can't find process with ID " + processId.ToString ());
+
+                       return (new Process (new SafeProcessHandle (proc, false), processId));
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private extern static int[] GetProcesses_internal();
 
-               public static Process[] GetProcesses ()
-               {
-                       int [] pids = GetProcesses_internal ();
-                       if (pids == null)
-                               return new Process [0];
-
-                       var proclist = new List<Process> (pids.Length);
-                       for (int i = 0; i < pids.Length; i++) {
-                               try {
-                                       proclist.Add (GetProcessById (pids [i]));
-                               } catch (SystemException) {
-                                       /* The process might exit
-                                        * between
-                                        * GetProcesses_internal and
-                                        * GetProcessById
-                                        */
-                               }
-                       }
-
-                       return proclist.ToArray ();
-               }
-
                [MonoTODO ("There is no support for retrieving process information from a remote machine")]
                public static Process[] GetProcesses(string machineName) {
                        if (machineName == null)
@@ -523,21 +496,14 @@ namespace System.Diagnostics
                        if (!IsLocalMachine (machineName))
                                throw new NotImplementedException ();
 
-                       return GetProcesses ();
-               }
-
-               public static Process[] GetProcessesByName(string processName)
-               {
                        int [] pids = GetProcesses_internal ();
                        if (pids == null)
                                return new Process [0];
-                       
+
                        var proclist = new List<Process> (pids.Length);
                        for (int i = 0; i < pids.Length; i++) {
                                try {
-                                       Process p = GetProcessById (pids [i]);
-                                       if (String.Compare (processName, p.ProcessName, true) == 0)
-                                               proclist.Add (p);
+                                       proclist.Add (GetProcessById (pids [i]));
                                } catch (SystemException) {
                                        /* The process might exit
                                         * between
@@ -550,11 +516,6 @@ namespace System.Diagnostics
                        return proclist.ToArray ();
                }
 
-               [MonoTODO]
-               public static Process[] GetProcessesByName(string processName, string machineName) {
-                       throw new NotImplementedException();
-               }
-
                private static bool IsLocalMachine (string machineName)
                {
                        if (machineName == "." || machineName.Length == 0)
index 02e1e3d10009c8ba67b112e289c6f160184c1133..d3fd1d5770922196e794f133f9a1a420f5f1d495 100644 (file)
@@ -737,7 +737,7 @@ namespace System.Diagnostics
                        while (true) {
                                try {
                                        resetEvent.WaitOne ();
-                               } catch (ObjectDisposedException e) {
+                               } catch (ObjectDisposedException) {
                                        // Notifications have been disabled and event 
                                        // has been closed but not yet nulled. End thread.
                                        break;
index 43d3c2f362e1f681a13c46a53265585006de6e6a..53e31d61f7ea7d7891f431b4800e42ffe8b09d29 100644 (file)
@@ -224,7 +224,7 @@ namespace System.IO {
 
                [DefaultValue("*.*")]
                [IODescription("File name filter pattern")]
-               [RecommendedAsConfigurable(true)]
+               [SettingsBindable(true)]
                [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
                public string Filter {
                        get { return filter; }
@@ -293,7 +293,7 @@ namespace System.IO {
 
                [DefaultValue("")]
                [IODescription("The directory to monitor")]
-               [RecommendedAsConfigurable(true)]
+               [SettingsBindable(true)]
                [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
                [Editor ("System.Diagnostics.Design.FSWPathEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
                public string Path {
index 04bd35a142f7a54ca212fb25b2faa7cebe938cdd..e1031141a9fad2beb01ac72d286f28feade96d83 100644 (file)
@@ -28,6 +28,8 @@
 
 using System.ComponentModel;
 
+#pragma warning disable 67
+
 namespace System.IO
 {
     public class FileSystemWatcher : Component, IDisposable, ISupportInitialize
@@ -57,7 +59,6 @@ namespace System.IO
         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 () { throw new NotImplementedException (); }
         protected override void Dispose (bool disposing) { throw new NotImplementedException (); }
     }
 }
\ No newline at end of file
index 42a0d5afb7583832643a0cadd4e791a2d6f0c458..36a1db9d29b399399e103b3c3bd6909bcb4da2e3 100644 (file)
@@ -36,6 +36,8 @@ using System.Xml;
 using XmlNode = System.Object;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Net.Configuration
 {
        class ConnectionManagementData
index 594803e2c2dc0314087b3dbec5c55e6ccd4f14c0..1bdf52da949c9952bb88fe1b193d263341de7a29 100644 (file)
@@ -64,9 +64,9 @@ namespace System.Net.Configuration
                                        continue;
                                }
 
-                               string prefix = HandlersUtil.ExtractAttributeValue ("prefix", child);
+                               //string prefix = HandlersUtil.ExtractAttributeValue ("prefix", child);
                                if (name == "add") {
-                                       string type = HandlersUtil.ExtractAttributeValue ("type", child, false);
+                                       //string type = HandlersUtil.ExtractAttributeValue ("type", child, false);
                                        if (child.Attributes != null && child.Attributes.Count != 0)
                                                HandlersUtil.ThrowException ("Unrecognized attribute", child);
 
index be2d13b71c02383937747b08837e1de486198005..6b5e60cdcff8abc84a7baa53eb32ef01b88254c7 100644 (file)
@@ -487,7 +487,7 @@ namespace System.Net.NetworkInformation {
 
                public override IcmpV4Statistics GetIcmpV4Statistics ()
                {
-                       if (!Socket.SupportsIPv4)
+                       if (!Socket.OSSupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIBICMPINFO stats;
                        GetIcmpStatistics (out stats, AF_INET);
@@ -505,7 +505,7 @@ namespace System.Net.NetworkInformation {
 
                public override IPGlobalStatistics GetIPv4GlobalStatistics ()
                {
-                       if (!Socket.SupportsIPv4)
+                       if (!Socket.OSSupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIB_IPSTATS stats;
                        GetIpStatisticsEx (out stats, AF_INET);
@@ -523,7 +523,7 @@ namespace System.Net.NetworkInformation {
 
                public override TcpStatistics GetTcpIPv4Statistics ()
                {
-                       if (!Socket.SupportsIPv4)
+                       if (!Socket.OSSupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIB_TCPSTATS stats;
                        GetTcpStatisticsEx (out stats, AF_INET);
@@ -541,7 +541,7 @@ namespace System.Net.NetworkInformation {
 
                public override UdpStatistics GetUdpIPv4Statistics ()
                {
-                       if (!Socket.SupportsIPv4)
+                       if (!Socket.OSSupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIB_UDPSTATS stats;
                        GetUdpStatisticsEx (out stats, AF_INET);
index 9a8560a92b58275149f51640218549c4c1a15652..af9fbec33bef62230039b5cefe5983203eb9ca64 100644 (file)
@@ -406,17 +406,17 @@ namespace System.Net.NetworkInformation {
                        get {
                                Win32_IP_ADAPTER_INFO ai = Win32NetworkInterface2.GetAdapterInfoByIndex (mib4.Index);
                                // FIXME: should ipv6 DhcpServer be considered?
-                               return ai != null ? Win32FromUnicast ((int) ai.Index, addr.FirstUnicastAddress) : new UnicastIPAddressInformationCollection ();
+                               return ai != null ? Win32FromUnicast (addr.FirstUnicastAddress) : new UnicastIPAddressInformationCollection ();
                        }
                }
 
-               static UnicastIPAddressInformationCollection Win32FromUnicast (int ifIndex, IntPtr ptr)
+               static UnicastIPAddressInformationCollection Win32FromUnicast (IntPtr ptr)
                {
                        UnicastIPAddressInformationCollection c = new UnicastIPAddressInformationCollection ();
                        Win32_IP_ADAPTER_UNICAST_ADDRESS a;
                        for (IntPtr p = ptr; p != IntPtr.Zero; p = a.Next) {
                                a = (Win32_IP_ADAPTER_UNICAST_ADDRESS) Marshal.PtrToStructure (p, typeof (Win32_IP_ADAPTER_UNICAST_ADDRESS));
-                               c.InternalAdd (new Win32UnicastIPAddressInformation (ifIndex, a));
+                               c.InternalAdd (new Win32UnicastIPAddressInformation (a));
                        }
                        return c;
                }
index d1bf2e763b08f02eb55c7bd576b58c423bbacf9d..3f872e731c6a6f5fea677b5090f1e25112219f53 100644 (file)
@@ -510,7 +510,6 @@ namespace System.Net.NetworkInformation {
 #if MONOTOUCH || XAMMAC
                        return new MacOsNetworkInterfaceAPI ();
 #else
-                       Version windowsVer51 = new Version (5, 1);
                        bool runningOnUnix = (Environment.OSVersion.Platform == PlatformID.Unix);
 
                        if (runningOnUnix) {
@@ -521,6 +520,7 @@ namespace System.Net.NetworkInformation {
                        }
 
 #if !MOBILE
+                       Version windowsVer51 = new Version (5, 1);
                        if (Environment.OSVersion.Version >= windowsVer51)
                                return new Win32NetworkInterfaceAPI ();
 #endif
@@ -631,6 +631,19 @@ namespace System.Net.NetworkInformation {
                string               iface_operstate_path;
                string               iface_flags_path;          
 
+#if MONODROID
+               [DllImport ("__Internal")]
+               static extern int _monodroid_get_android_api_level ();
+
+               [DllImport ("__Internal")]
+               static extern bool _monodroid_get_network_interface_up_state (string ifname, ref bool is_up);
+
+               [DllImport ("__Internal")]
+               static extern bool _monodroid_get_network_interface_supports_multicast (string ifname, ref bool supports_multicast);
+
+               bool android_use_java_api;
+#endif
+
                internal string IfacePath {
                        get { return iface_path; }
                }
@@ -641,6 +654,9 @@ namespace System.Net.NetworkInformation {
                        iface_path = "/sys/class/net/" + name + "/";
                        iface_operstate_path = iface_path + "operstate";
                        iface_flags_path = iface_path + "flags";
+#if MONODROID
+                       android_use_java_api = _monodroid_get_android_api_level () >= 24;
+#endif
                }
 
                public override IPInterfaceProperties GetIPProperties ()
@@ -659,6 +675,23 @@ namespace System.Net.NetworkInformation {
 
                public override OperationalStatus OperationalStatus {
                        get {
+#if MONODROID
+                               if (android_use_java_api) {
+                                       // Starting from API 24 (Android 7 "Nougat") Android restricts access to many
+                                       // files in the /sys filesystem (see https://code.google.com/p/android/issues/detail?id=205565
+                                       // for more information) and therefore we are forced to call into Java API in
+                                       // order to get the information. Alas, what we can obtain in this way is quite
+                                       // limited. In the case of OperationalStatus we can only determine whether the
+                                       // interface is up or down. There is a way to get more detailed information but
+                                       // it requires an instance of the Android Context class which is not available
+                                       // to us here.
+                                       bool is_up = false;
+                                       if (_monodroid_get_network_interface_up_state (Name, ref is_up))
+                                               return is_up ? OperationalStatus.Up : OperationalStatus.Down;
+                                       else
+                                               return OperationalStatus.Unknown;
+                               }
+#endif
                                if (!Directory.Exists (iface_path))
                                        return OperationalStatus.Unknown;
                                
@@ -695,6 +728,17 @@ namespace System.Net.NetworkInformation {
 
                public override bool SupportsMulticast {
                        get {
+#if MONODROID
+                               if (android_use_java_api) {
+                                       // Starting from API 24 (Android 7 "Nougat") Android restricts access to many
+                                       // files in the /sys filesystem (see https://code.google.com/p/android/issues/detail?id=205565
+                                       // for more information) and therefore we are forced to call into Java API in
+                                       // order to get the information.
+                                       bool supports_multicast = false;
+                                       _monodroid_get_network_interface_supports_multicast (Name, ref supports_multicast);
+                                       return supports_multicast;
+                               }
+#endif
                                if (!Directory.Exists (iface_path))
                                        return false;
                                
index 8232a9eaac445c5a035e6bff57ab6ef45357b3ff..c69388a58076e36d35a638b0dd911fcf785f9a46 100644 (file)
@@ -209,9 +209,12 @@ namespace System.Net.NetworkInformation {
 
                static IPAddress GetNonLoopbackIP ()
                {
+#pragma warning disable 618
                        foreach (IPAddress addr in Dns.GetHostByName (Dns.GetHostName ()).AddressList)
                                if (!IPAddress.IsLoopback (addr))
                                        return addr;
+#pragma warning restore 618
+
                        throw new InvalidOperationException ("Could not resolve non-loopback IP address for localhost");
                }
 
index 439cab07cf091c553d92b9ba5565fdd1d81bb0dc..17710c420fd9c5188fef8dfcef54222bf74c250c 100644 (file)
 using System;
 using System.Runtime.InteropServices;
 using System.Net.Sockets;
+using System.Diagnostics.Contracts;
 
 namespace System.Net.NetworkInformation {
 #if !MOBILE
        class Win32UnicastIPAddressInformation : UnicastIPAddressInformation 
        {
-               int if_index;
                Win32_IP_ADAPTER_UNICAST_ADDRESS info;
+               IPAddress ipv4Mask;
 
-               public Win32UnicastIPAddressInformation (int ifIndex, Win32_IP_ADAPTER_UNICAST_ADDRESS info)
+               public Win32UnicastIPAddressInformation (Win32_IP_ADAPTER_UNICAST_ADDRESS info)
                {
-                       this.if_index = ifIndex;
                        this.info = info;
+                       IPAddress ipAddress = info.Address.GetIPAddress ();
+                       // IPv6 returns 0.0.0.0 for consistancy with XP
+                       if (ipAddress.AddressFamily == AddressFamily.InterNetwork) {
+                               ipv4Mask = PrefixLengthToSubnetMask (info.OnLinkPrefixLength, ipAddress.AddressFamily);
+                       }
                }
 
                public override IPAddress Address {
@@ -74,27 +79,15 @@ namespace System.Net.NetworkInformation {
                        get { return info.DadState; }
                }
 
-               public override IPAddress IPv4Mask {
+               public override IPAddress IPv4Mask{
                        get {
-                               Win32_IP_ADAPTER_INFO ai = Win32NetworkInterface2.GetAdapterInfoByIndex (if_index);
-                               if (ai == null)
-                                       throw new Exception ("huh? " + if_index);
-                               if (this.Address == null)
-                                       return null;
-                               string expected = this.Address.ToString ();
-                               unsafe {
-                                       Win32_IP_ADDR_STRING p = ai.IpAddressList;
-                                       while (true) {
-                                               if (p.IpAddress == expected)
-                                                       return IPAddress.Parse (p.IpMask);
-                                               if (p.Next == IntPtr.Zero)
-                                                       break;
-                                               p = (Win32_IP_ADDR_STRING) Marshal.PtrToStructure (p.Next, typeof (Win32_IP_ADDR_STRING));
-                                       }
-
-                                       // Or whatever it should be...
-                                       return null;
+                               // The IPv6 equivilant was never available on XP, and we've kept this behavior for legacy reasons.
+                               // For IPv6 use PrefixLength instead.
+                               if (Address.AddressFamily != AddressFamily.InterNetwork) {
+                                       return IPAddress.Any;
                                }
+
+                               return ipv4Mask;
                        }
                }
 
@@ -105,6 +98,28 @@ namespace System.Net.NetworkInformation {
                public override SuffixOrigin SuffixOrigin {
                        get { return info.SuffixOrigin; }
                }
+
+               // Convert a CIDR prefix length to a subnet mask "255.255.255.0" format
+               private static IPAddress PrefixLengthToSubnetMask (byte prefixLength, AddressFamily family) {
+                       Contract.Requires ((0 <= prefixLength) && (prefixLength <= 126));
+                       Contract.Requires ((family == AddressFamily.InterNetwork) || (family == AddressFamily.InterNetworkV6));
+
+                       byte[] addressBytes;
+                       if (family == AddressFamily.InterNetwork) {
+                               addressBytes = new byte [4];
+                       } else { // v6
+                               addressBytes = new byte [16];
+                       }
+
+                       Contract.Assert (prefixLength < (addressBytes.Length * 8));
+
+                       // Enable bits one at a time from left/high to right/low
+                       for (int bit = 0; bit < prefixLength; bit++) {
+                               addressBytes [bit / 8] |= (byte) (0x80 >> (bit % 8));
+                       }
+
+                       return new IPAddress (addressBytes);
+               }
        }
 #endif
 
index bf483016db3025211c0293aa96997b51d9e4320f..701eaaad7616c9d654f109aab64485f554384be0 100644 (file)
@@ -94,7 +94,9 @@ namespace System.Net.Security
 
                static MonoTlsProvider GetProvider ()
                {
+#pragma warning disable 612
                        return MonoTlsProviderFactory.GetDefaultProvider ();
+#pragma warning restore 612
                }
 
                public SslStream (Stream innerStream)
diff --git a/mcs/class/System/System.Net.Security/SslStream.platformnotsupported.cs b/mcs/class/System/System.Net.Security/SslStream.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..1d3f040
--- /dev/null
@@ -0,0 +1,287 @@
+//
+// SslStream.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.IO;
+using System.Security.Authentication;
+using System.Security.Cryptography.X509Certificates;
+using System.Threading.Tasks;
+
+namespace System.Net.Security
+{
+       public class SslStream : AuthenticatedStream
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.Security.SslStream is not supported on the current platform.";
+
+               public SslStream (Stream innerStream)
+                       : this (innerStream, false, null, null)
+               {
+               }
+
+               public SslStream (Stream innerStream, bool leaveInnerStreamOpen)
+                       : this (innerStream, leaveInnerStreamOpen, null, null)
+               {
+               }
+
+               public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback)
+                       : this (innerStream, leaveInnerStreamOpen, userCertificateValidationCallback, null)
+               {
+               }
+
+               public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback)
+                       : base (innerStream, leaveInnerStreamOpen)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback, EncryptionPolicy encryptionPolicy)
+                       : this (innerStream, leaveInnerStreamOpen, userCertificateValidationCallback, userCertificateSelectionCallback)
+               {
+               }
+
+               public virtual void AuthenticateAsClient (string targetHost)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual void AuthenticateAsServer (X509Certificate serverCertificate)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public TransportContext TransportContext {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual Task AuthenticateAsClientAsync (string targetHost)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override bool IsAuthenticated {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsMutuallyAuthenticated {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsEncrypted {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsSigned {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool IsServer {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual SslProtocols SslProtocol {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual bool CheckCertRevocationStatus {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual X509Certificate LocalCertificate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual X509Certificate RemoteCertificate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual CipherAlgorithmType CipherAlgorithm {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual int CipherStrength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual HashAlgorithmType HashAlgorithm {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual int HashStrength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual ExchangeAlgorithmType KeyExchangeAlgorithm {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual int KeyExchangeStrength {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool CanSeek {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool CanRead {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool CanTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override bool CanWrite {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int ReadTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override int WriteTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override long Length {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override long Position {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public override void SetLength (long value)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override long Seek (long offset, SeekOrigin origin)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Flush ()
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               protected override void Dispose (bool disposing)
+               {
+               }
+
+               public override int Read (byte[] buffer, int offset, int count)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public void Write (byte[] buffer)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void Write (byte[] buffer, int offset, int count)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override int EndRead (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public override void EndWrite (IAsyncResult asyncResult)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
diff --git a/mcs/class/System/System.Net.Sockets/SendPacketsElement.cs b/mcs/class/System/System.Net.Sockets/SendPacketsElement.cs
deleted file mode 100644 (file)
index 983faa9..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-// System.Net.Sockets.SocketAsyncEventArgs.cs
-//
-// Authors:
-//     Marek Habersack (mhabersack@novell.com)
-//
-// Copyright (c) 2008 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;
-
-namespace System.Net.Sockets
-{
-       public class SendPacketsElement
-       {
-               public byte[] Buffer { get; private set; }
-               public int Count { get; private set; }
-               public bool EndOfPacket { get; private set; }
-               public string FilePath { get; private set; }
-               public int Offset { get; private set; }
-
-               public SendPacketsElement (byte[] buffer) : this (buffer, 0, buffer != null ? buffer.Length : 0)
-               {
-               }
-
-               public SendPacketsElement (byte[] buffer, int offset, int count) : this (buffer, offset, count, false)
-               {
-               }
-
-               public SendPacketsElement (byte[] buffer, int offset, int count, bool endOfPacket)
-               {
-                       if (buffer == null)
-                               throw new ArgumentNullException ("buffer");
-
-                       int buflen = buffer.Length;
-                       if (offset < 0 || offset >= buflen)
-                               throw new ArgumentOutOfRangeException ("offset");
-
-                       if (count < 0 || offset + count >= buflen)
-                               throw new ArgumentOutOfRangeException ("count");
-
-                       Buffer = buffer;
-                       Offset = offset;
-                       Count = count;
-                       EndOfPacket = endOfPacket;
-                       FilePath = null;
-               }
-               
-               public SendPacketsElement (string filepath) : this (filepath, 0, 0, false)
-               {
-               }
-
-               public SendPacketsElement (string filepath, int offset, int count) : this (filepath, offset, count, false)
-               {
-               }
-
-               // LAME SPEC: only ArgumentNullException for filepath is thrown
-               public SendPacketsElement (string filepath, int offset, int count, bool endOfPacket)
-               {
-                       if (filepath == null)
-                               throw new ArgumentNullException ("filepath");
-
-                       Buffer = null;
-                       Offset = offset;
-                       Count = count;
-                       EndOfPacket = endOfPacket;
-                       FilePath = filepath;
-               }
-       }
-}
index e80e84ac7e840ca81706a7e9e9aa36594c143174..752dcd08d8b5621fe15229aa4f13617c83bb2ea9 100644 (file)
@@ -55,13 +55,6 @@ namespace System.Net.Sockets
                const string TIMEOUT_EXCEPTION_MSG = "A connection attempt failed because the connected party did not properly respond" +
                        "after a period of time, or established connection failed because connected host has failed to respond";
 
-               /*
-                *      These two fields are looked up by name by the runtime, don't change
-                *  their name without also updating the runtime code.
-                */
-               static int ipv4_supported = -1;
-               static int ipv6_supported = -1;
-
                /* true if we called Close_internal */
                bool is_closed;
 
@@ -98,80 +91,8 @@ namespace System.Net.Sockets
                int m_IntCleanedUp;
                internal bool connect_in_progress;
 
-               private static volatile bool s_LoggingEnabled = Logging.On;
-
 #region Constructors
 
-               static Socket ()
-               {
-                       if (ipv4_supported == -1) {
-                               try {
-                                       Socket tmp = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-                                       tmp.Close();
-
-                                       ipv4_supported = 1;
-                               } catch {
-                                       ipv4_supported = 0;
-                               }
-                       }
-
-                       if (ipv6_supported == -1) {
-                               // We need to put a try/catch around ConfigurationManager methods as will always throw an exception 
-                               // when run in a mono embedded application.  This occurs as embedded applications do not have a setup
-                               // for application config.  The exception is not thrown when called from a normal .NET application. 
-                               //
-                               // We, then, need to guard calls to the ConfigurationManager.  If the config is not found or throws an
-                               // exception, will fall through to the existing Socket / API directly below in the code.
-                               //
-                               // Also note that catching ConfigurationErrorsException specifically would require library dependency
-                               // System.Configuration, and wanted to avoid that.
-#if !MOBILE
-#if CONFIGURATION_DEP
-                               try {
-                                       SettingsSection config;
-                                       config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
-                                       if (config != null)
-                                               ipv6_supported = config.Ipv6.Enabled ? -1 : 0;
-                               } catch {
-                                       ipv6_supported = -1;
-                               }
-#else
-                               try {
-                                       NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
-                                       if (config != null)
-                                               ipv6_supported = config.ipv6Enabled ? -1 : 0;
-                               } catch {
-                                       ipv6_supported = -1;
-                               }
-#endif
-#endif
-                               if (ipv6_supported != 0) {
-                                       try {
-                                               Socket tmp = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
-                                               tmp.Close();
-
-                                               ipv6_supported = 1;
-                                       } catch {
-                                               ipv6_supported = 0;
-                                       }
-                               }
-                       }
-               }
-
-               public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
-               {
-                       this.addressFamily = addressFamily;
-                       this.socketType = socketType;
-                       this.protocolType = protocolType;
-
-                       int error;
-                       this.m_Handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
-
-                       if (error != 0)
-                               throw new SocketException (error);
-
-                       SocketDefaults ();
-               }
 
                public Socket (SocketInformation socketInformation)
                {
@@ -188,6 +109,8 @@ namespace System.Net.Sockets
                        this.is_bound = (ProtocolType) (int) result [3] != 0;
                        this.m_Handle = new SafeSocketHandle ((IntPtr) (long) result [4], true);
 
+                       InitializeSockets ();
+
                        SocketDefaults ();
                }
 
@@ -200,6 +123,8 @@ namespace System.Net.Sockets
                        
                        this.m_Handle = safe_handle;
                        this.is_connected = true;
+
+                       InitializeSockets ();   
                }
 
                void SocketDefaults ()
@@ -236,54 +161,6 @@ namespace System.Net.Sockets
 
 #region Properties
 
-               [ObsoleteAttribute ("Use OSSupportsIPv4 instead")]
-               public static bool SupportsIPv4 {
-                       get { return ipv4_supported == 1; }
-               }
-
-               [ObsoleteAttribute ("Use OSSupportsIPv6 instead")]
-               public static bool SupportsIPv6 {
-                       get { return ipv6_supported == 1; }
-               }
-
-#if MOBILE
-               public static bool OSSupportsIPv4 {
-                       get { return ipv4_supported == 1; }
-               }
-#else
-               public static bool OSSupportsIPv4 {
-                       get {
-                               NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces ();
-
-                               foreach (NetworkInterface adapter in nics) {
-                                       if (adapter.Supports (NetworkInterfaceComponent.IPv4))
-                                               return true;
-                               }
-
-                               return false;
-                       }
-               }
-#endif
-
-#if MOBILE
-               public static bool OSSupportsIPv6 {
-                       get { return ipv6_supported == 1; }
-               }
-#else
-               public static bool OSSupportsIPv6 {
-                       get {
-                               NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces ();
-
-                               foreach (NetworkInterface adapter in nics) {
-                                       if (adapter.Supports (NetworkInterfaceComponent.IPv6))
-                                               return true;
-                               }
-
-                               return false;
-                       }
-               }
-#endif
-
                public int Available {
                        get {
                                ThrowIfDisposedAndClosed ();
@@ -967,51 +844,6 @@ namespace System.Net.Sockets
                        Connect (Dns.GetHostAddresses (host), port);
                }
 
-               public void Connect (IPAddress[] addresses, int port)
-               {
-                       ThrowIfDisposedAndClosed ();
-
-                       if (addresses == null)
-                               throw new ArgumentNullException ("addresses");
-                       if (this.AddressFamily != AddressFamily.InterNetwork && this.AddressFamily != AddressFamily.InterNetworkV6)
-                               throw new NotSupportedException ("This method is only valid for addresses in the InterNetwork or InterNetworkV6 families");
-                       if (is_listening)
-                               throw new InvalidOperationException ();
-
-                       // FIXME: do non-blocking sockets Poll here?
-                       int error = 0;
-                       foreach (IPAddress address in addresses) {
-                               IPEndPoint iep = new IPEndPoint (address, port);
-                               
-                               iep = RemapIPEndPoint (iep);
-
-                               Connect_internal (m_Handle, iep.Serialize (), out error);
-                               if (error == 0) {
-                                       is_connected = true;
-                                       is_bound = true;
-                                       seed_endpoint = iep;
-                                       return;
-                               }
-                               if (error != (int)SocketError.InProgress && error != (int)SocketError.WouldBlock)
-                                       continue;
-
-                               if (!is_blocking) {
-                                       Poll (-1, SelectMode.SelectWrite);
-                                       error = (int)GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
-                                       if (error == 0) {
-                                               is_connected = true;
-                                               is_bound = true;
-                                               seed_endpoint = iep;
-                                               return;
-                                       }
-                               }
-                       }
-
-                       if (error != 0)
-                               throw new SocketException (error);
-               }
-
-
                public void Connect (EndPoint remoteEP)
                {
                        ThrowIfDisposedAndClosed ();
@@ -1036,7 +868,7 @@ namespace System.Net.Sockets
                        SocketAddress serial = remoteEP.Serialize ();
 
                        int error = 0;
-                       Connect_internal (m_Handle, serial, out error);
+                       Connect_internal (m_Handle, serial, out error, is_blocking);
 
                        if (error == 0 || error == 10035)
                                seed_endpoint = remoteEP; // Keep the ep around for non-blocking sockets
@@ -1090,12 +922,6 @@ namespace System.Net.Sockets
                        return true;
                }
 
-               public static bool ConnectAsync (SocketType socketType, ProtocolType protocolType, SocketAsyncEventArgs e)
-               {
-                       var sock = new Socket (e.RemoteEndPoint.AddressFamily, socketType, protocolType);
-                       return sock.ConnectAsync (e);
-               }
-
                public static void CancelConnectAsync (SocketAsyncEventArgs e)
                {
                        if (e == null)
@@ -1178,7 +1004,7 @@ namespace System.Net.Sockets
                        bool blk = is_blocking;
                        if (blk)
                                Blocking = false;
-                       Connect_internal (m_Handle, end_point.Serialize (), out error);
+                       Connect_internal (m_Handle, end_point.Serialize (), out error, false);
                        if (blk)
                                Blocking = true;
 
@@ -1328,11 +1154,11 @@ namespace System.Net.Sockets
                        sockares.CheckIfThrowDelayedException();
                }
 
-               static void Connect_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error)
+               static void Connect_internal (SafeSocketHandle safeHandle, SocketAddress sa, out int error, bool blocking)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
-                               Connect_internal (safeHandle.DangerousGetHandle (), sa, out error);
+                               Connect_internal (safeHandle.DangerousGetHandle (), sa, out error, blocking);
                        } finally {
                                safeHandle.UnRegisterForBlockingSyscall ();
                        }
@@ -1340,7 +1166,7 @@ namespace System.Net.Sockets
 
                /* Connects to the remote address */
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static void Connect_internal(IntPtr sock, SocketAddress sa, out int error);
+               extern static void Connect_internal(IntPtr sock, SocketAddress sa, out int error, bool blocking);
 
                /* Returns :
                 *  - false when it is ok to use RemoteEndPoint
@@ -1484,7 +1310,7 @@ namespace System.Net.Sockets
                        ThrowIfBufferOutOfRange (buffer, offset, size);
 
                        int nativeError;
-                       int ret = Receive_internal (m_Handle, buffer, offset, size, socketFlags, out nativeError);
+                       int ret = Receive_internal (m_Handle, buffer, offset, size, socketFlags, out nativeError, is_blocking);
 
                        errorCode = (SocketError) nativeError;
                        if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) {
@@ -1527,7 +1353,7 @@ namespace System.Net.Sockets
                        }
 
                        try {
-                               ret = Receive_internal (m_Handle, bufarray, socketFlags, out nativeError);
+                               ret = Receive_internal (m_Handle, bufarray, socketFlags, out nativeError, is_blocking);
                        } finally {
                                for (int i = 0; i < numsegments; i++) {
                                        if (gch[i].IsAllocated)
@@ -1616,7 +1442,7 @@ namespace System.Net.Sockets
                        int total = 0;
 
                        try {
-                               total = Receive_internal (sockares.socket.m_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, sockares.socket.is_blocking);
                        } catch (Exception e) {
                                sockares.Complete (e);
                                return;
@@ -1682,31 +1508,31 @@ namespace System.Net.Sockets
                        return sockares.Total;
                }
 
-               static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
+               static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error, bool blocking)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
-                               return Receive_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
+                               return Receive_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error, blocking);
                        } finally {
                                safeHandle.UnRegisterForBlockingSyscall ();
                        }
                }
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               extern static int Receive_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
+               extern static int Receive_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error, bool blocking);
 
-               static int Receive_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, out int error)
+               static int Receive_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, out int error, bool blocking)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
-                               return Receive_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, out error);
+                               return Receive_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, out error, blocking);
                        } finally {
                                safeHandle.UnRegisterForBlockingSyscall ();
                        }
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static int Receive_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, out int error);
+               extern static int Receive_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, out int error, bool blocking);
 
 #endregion
 
@@ -1735,7 +1561,7 @@ namespace System.Net.Sockets
                        SocketAddress sockaddr = remoteEP.Serialize();
 
                        int nativeError;
-                       int cnt = ReceiveFrom_internal (m_Handle, buffer, offset, size, socketFlags, ref sockaddr, out nativeError);
+                       int cnt = ReceiveFrom_internal (m_Handle, buffer, offset, size, socketFlags, ref sockaddr, out nativeError, is_blocking);
 
                        errorCode = (SocketError) nativeError;
                        if (errorCode != SocketError.Success) {
@@ -1866,18 +1692,18 @@ namespace System.Net.Sockets
 
 
 
-               static int ReceiveFrom_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error)
+               static int ReceiveFrom_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error, bool blocking)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
-                               return ReceiveFrom_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, ref sockaddr, out error);
+                               return ReceiveFrom_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, ref sockaddr, out error, blocking);
                        } finally {
                                safeHandle.UnRegisterForBlockingSyscall ();
                        }
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static int ReceiveFrom_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error);
+               extern static int ReceiveFrom_internal(IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error, bool blocking);
 
 #endregion
 
@@ -1928,7 +1754,7 @@ namespace System.Net.Sockets
                        if (endPoint == null)
                                throw new ArgumentNullException ("endPoint");
 
-                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceiveMessageFrom", "asyncResult");
+                       /*SocketAsyncResult sockares =*/ ValidateEndIAsyncResult (asyncResult, "EndReceiveMessageFrom", "asyncResult");
 
                        throw new NotImplementedException ();
                }
@@ -1952,7 +1778,7 @@ namespace System.Net.Sockets
                        int sent = 0;
                        do {
                                sent += Send_internal (
-m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
+m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError, is_blocking);
                                errorCode = (SocketError)nativeError;
                                if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) {
                                        is_connected = false;
@@ -1995,7 +1821,7 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
                        }
 
                        try {
-                               ret = Send_internal (m_Handle, bufarray, socketFlags, out nativeError);
+                               ret = Send_internal (m_Handle, bufarray, socketFlags, out nativeError, is_blocking);
                        } finally {
                                for(int i = 0; i < numsegments; i++) {
                                        if (gch[i].IsAllocated) {
@@ -2084,7 +1910,7 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
                        int total = 0;
 
                        try {
-                               total = Socket.Send_internal (sockares.socket.m_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, false);
                        } catch (Exception e) {
                                sockares.Complete (e);
                                return;
@@ -2172,33 +1998,31 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
                        return sockares.Total;
                }
 
-               static int Send_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
+               static int Send_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error, bool blocking)
                {
-                       bool release = false;
                        try {
-                               safeHandle.DangerousAddRef (ref release);
-                               return Send_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error);
+                               safeHandle.RegisterForBlockingSyscall ();
+                               return Send_internal (safeHandle.DangerousGetHandle (), bufarray, flags, out error, blocking);
                        } finally {
-                               if (release)
-                                       safeHandle.DangerousRelease ();
+                               safeHandle.UnRegisterForBlockingSyscall ();
                        }
                }
 
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               extern static int Send_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error);
+               extern static int Send_internal (IntPtr sock, WSABUF[] bufarray, SocketFlags flags, out int error, bool blocking);
 
-               static int Send_internal (SafeSocketHandle safeHandle, byte[] buf, int offset, int count, SocketFlags flags, out int error)
+               static int Send_internal (SafeSocketHandle safeHandle, byte[] buf, int offset, int count, SocketFlags flags, out int error, bool blocking)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
-                               return Send_internal (safeHandle.DangerousGetHandle (), buf, offset, count, flags, out error);
+                               return Send_internal (safeHandle.DangerousGetHandle (), buf, offset, count, flags, out error, blocking);
                        } finally {
                                safeHandle.UnRegisterForBlockingSyscall ();
                        }
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static int Send_internal(IntPtr sock, byte[] buf, int offset, int count, SocketFlags flags, out int error);
+               extern static int Send_internal(IntPtr sock, byte[] buf, int offset, int count, SocketFlags flags, out int error, bool blocking);
 
 #endregion
 
@@ -2214,7 +2038,7 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
                                throw new ArgumentNullException("remoteEP");
 
                        int error;
-                       int ret = SendTo_internal (m_Handle, buffer, offset, size, socketFlags, remoteEP.Serialize (), out error);
+                       int ret = SendTo_internal (m_Handle, buffer, offset, size, socketFlags, remoteEP.Serialize (), out error, is_blocking);
 
                        SocketError err = (SocketError) error;
                        if (err != 0) {
@@ -2330,18 +2154,18 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
                        return sockares.Total;
                }
 
-               static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
+               static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error, bool blocking)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
-                               return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, sa, out error);
+                               return SendTo_internal (safeHandle.DangerousGetHandle (), buffer, offset, count, flags, sa, out error, blocking);
                        } finally {
                                safeHandle.UnRegisterForBlockingSyscall ();
                        }
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static int SendTo_internal (IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error);
+               extern static int SendTo_internal (IntPtr sock, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error, bool blocking);
 
 #endregion
 
@@ -2356,8 +2180,9 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
                        if (!is_blocking)
                                throw new InvalidOperationException ();
 
-                       if (!SendFile_internal (m_Handle, fileName, preBuffer, postBuffer, flags)) {
-                               SocketException exc = new SocketException ();
+                       int error = 0;
+                       if (!SendFile_internal (m_Handle, fileName, preBuffer, postBuffer, flags, out error, is_blocking) || error != 0) {
+                               SocketException exc = new SocketException (error);
                                if (exc.ErrorCode == 2 || exc.ErrorCode == 3)
                                        throw new FileNotFoundException ();
                                throw exc;
@@ -2392,18 +2217,18 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
                        ares.Delegate.EndInvoke (ares.Original);
                }
 
-               static bool SendFile_internal (SafeSocketHandle safeHandle, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags)
+               static bool SendFile_internal (SafeSocketHandle safeHandle, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags, out int error, bool blocking)
                {
                        try {
                                safeHandle.RegisterForBlockingSyscall ();
-                               return SendFile_internal (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags);
+                               return SendFile_internal (safeHandle.DangerousGetHandle (), filename, pre_buffer, post_buffer, flags, out error, blocking);
                        } finally {
                                safeHandle.UnRegisterForBlockingSyscall ();
                        }
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern static bool SendFile_internal (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags);
+               extern static bool SendFile_internal (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags, out int error, bool blocking);
 
                delegate void SendFileHandler (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags);
 
@@ -2628,9 +2453,6 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
                {
                        ThrowIfDisposedAndClosed ();
 
-                       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 (m_Handle, optionLevel, optionName, null, null, optionValue, out error);
 
@@ -2919,6 +2741,41 @@ m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                internal static extern bool SupportsPortReuse (ProtocolType proto);
+
+               internal static int FamilyHint {
+                       get {
+                               // Returns one of
+                               //      MONO_HINT_UNSPECIFIED           = 0,
+                               //      MONO_HINT_IPV4                          = 1,
+                               //      MONO_HINT_IPV6                          = 2,
+
+                               int hint = 0;
+                               if (OSSupportsIPv4) {
+                                       hint = 1;
+                               }
+
+                               if (OSSupportsIPv6) {
+                                       hint = hint == 0 ? 2 : 0;
+                               }
+
+                               return hint;
+                       }
+               }
+
+               static bool IsProtocolSupported (NetworkInterfaceComponent networkInterface)
+               {
+#if MOBILE
+                       return true;
+#else
+                       var nics = NetworkInterface.GetAllNetworkInterfaces ();
+                       foreach (var adapter in nics) {
+                               if (adapter.Supports (networkInterface))
+                                       return true;
+                       }
+
+                       return false;
+#endif
+               }
        }
 }
 
index 438d4bc31e9a3dcf97f763d3ba444272030d218d..419035efe15fe3ad31aac61aa2ba427ccc397620 100644 (file)
@@ -61,13 +61,13 @@ namespace System.Net.Sockets
                        private set;
                }
 
-               IList <ArraySegment <byte>> _bufferList;
+               internal IList<ArraySegment<byte>> m_BufferList;
                public IList<ArraySegment<byte>> BufferList {
-                       get { return _bufferList; }
+                       get { return m_BufferList; }
                        set {
                                if (Buffer != null && value != null)
                                        throw new ArgumentException ("Buffer and BufferList properties cannot both be non-null.");
-                               _bufferList = value;
+                               m_BufferList = value;
                        }
                }
 
@@ -177,13 +177,6 @@ namespace System.Net.Sockets
 
                        if (disposing && in_progress != 0)
                                return;
-
-                       AcceptSocket = null;
-                       Buffer = null;
-                       BufferList = null;
-                       RemoteEndPoint = null;
-                       UserToken = null;
-                       SendPacketsElements = null;
                }
 
                public void Dispose ()
@@ -241,5 +234,43 @@ namespace System.Net.Sockets
 
                        Buffer = buffer;
                }
+
+               internal void StartOperationCommon (Socket socket)
+               {
+                       current_socket = socket;
+               }
+
+               internal void StartOperationWrapperConnect (MultipleConnectAsync args)
+               {
+                       SetLastOperation (SocketAsyncOperation.Connect);
+
+                       //m_MultipleConnect = args;
+               }
+
+               internal void FinishConnectByNameSyncFailure (Exception exception, int bytesTransferred, SocketFlags flags)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal void FinishOperationAsyncFailure (Exception exception, int bytesTransferred, SocketFlags flags)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               internal void FinishWrapperConnectSuccess (Socket connectSocket, int bytesTransferred, SocketFlags flags)
+               {
+                       SetResults(SocketError.Success, bytesTransferred, flags);
+                       current_socket = connectSocket;
+
+                       Complete ();
+                       OnCompleted (this);
+               }
+
+               internal void SetResults (SocketError socketError, int bytesTransferred, SocketFlags flags)
+               {
+                       SocketError = socketError;
+                       BytesTransferred = bytesTransferred;
+                       SocketFlags = flags;
+               }
        }
 }
diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncOperation.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncOperation.cs
deleted file mode 100644 (file)
index 87d6de5..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// System.Net.Sockets.SocketAsyncOperation.cs
-//
-// Authors:
-//     Marek Habersack (mhabersack@novell.com)
-//
-// Copyright (c) 2008 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.
-//
-namespace System.Net.Sockets
-{
-       public enum SocketAsyncOperation
-       {
-               None,
-               Accept,
-               Connect,
-               Disconnect,
-               Receive,
-               ReceiveFrom,
-               ReceiveMessageFrom,
-               Send,
-               SendPackets,
-               SendTo
-       }
-}
diff --git a/mcs/class/System/System.Net.Sockets/SocketReceiveFromResult.cs b/mcs/class/System/System.Net.Sockets/SocketReceiveFromResult.cs
new file mode 100644 (file)
index 0000000..6059483
--- /dev/null
@@ -0,0 +1,40 @@
+//
+// SocketReceiveFromResult.cs
+//
+// 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.
+//
+
+#if NETSTANDARD
+
+namespace System.Net.Sockets
+{
+       public struct SocketReceiveFromResult
+       {
+               public int ReceivedBytes;
+               public EndPoint RemoteEndPoint;
+       }
+}
+
+#endif
diff --git a/mcs/class/System/System.Net.Sockets/SocketReceiveMessageFromResult.cs b/mcs/class/System/System.Net.Sockets/SocketReceiveMessageFromResult.cs
new file mode 100644 (file)
index 0000000..f06b339
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// SocketReceiveMessageFromResult.cs
+//
+// 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.
+//
+
+#if NETSTANDARD
+
+namespace System.Net.Sockets
+{
+       public struct SocketReceiveMessageFromResult
+       {
+               public int ReceivedBytes;
+               public SocketFlags SocketFlags;
+               public EndPoint RemoteEndPoint;
+               public IPPacketInformation PacketInformation;
+       }
+}
+
+#endif
diff --git a/mcs/class/System/System.Net.Sockets/SocketTaskExtensions.cs b/mcs/class/System/System.Net.Sockets/SocketTaskExtensions.cs
new file mode 100644 (file)
index 0000000..33bb55a
--- /dev/null
@@ -0,0 +1,254 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#if NETSTANDARD
+
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace System.Net.Sockets
+{
+    public static class SocketTaskExtensions
+    {
+        public static Task<Socket> AcceptAsync(this Socket socket)
+        {
+            return Task<Socket>.Factory.FromAsync(
+                (callback, state) => ((Socket)state).BeginAccept(callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
+                state: socket);
+        }
+
+        public static Task<Socket> AcceptAsync(this Socket socket, Socket acceptSocket)
+        {
+            const int ReceiveSize = 0;
+            return Task<Socket>.Factory.FromAsync(
+                (socketForAccept, receiveSize, callback, state) => ((Socket)state).BeginAccept(socketForAccept, receiveSize, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
+                acceptSocket,
+                ReceiveSize,
+                state: socket);
+        }
+
+        public static Task ConnectAsync(this Socket socket, EndPoint remoteEP)
+        {
+            return Task.Factory.FromAsync(
+                (targetEndPoint, callback, state) => ((Socket)state).BeginConnect(targetEndPoint, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+                remoteEP,
+                state: socket);
+        }
+
+        public static Task ConnectAsync(this Socket socket, IPAddress address, int port)
+        {
+            return Task.Factory.FromAsync(
+                (targetAddress, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddress, targetPort, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+                address,
+                port,
+                state: socket);
+        }
+
+        public static Task ConnectAsync(this Socket socket, IPAddress[] addresses, int port)
+        {
+            return Task.Factory.FromAsync(
+                (targetAddresses, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddresses, targetPort, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+                addresses,
+                port,
+                state: socket);
+        }
+
+        public static Task ConnectAsync(this Socket socket, string host, int port)
+        {
+            return Task.Factory.FromAsync(
+                (targetHost, targetPort, callback, state) => ((Socket)state).BeginConnect(targetHost, targetPort, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+                host,
+                port,
+                state: socket);
+        }
+
+        public static Task<int> ReceiveAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffer, flags, callback, state) => ((Socket)state).BeginReceive(
+                                                              targetBuffer.Array,
+                                                              targetBuffer.Offset,
+                                                              targetBuffer.Count,
+                                                              flags,
+                                                              callback,
+                                                              state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
+                buffer,
+                socketFlags,
+                state: socket);
+        }
+
+        public static Task<int> ReceiveAsync(
+            this Socket socket,
+            IList<ArraySegment<byte>> buffers,
+            SocketFlags socketFlags)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffers, flags, callback, state) => ((Socket)state).BeginReceive(targetBuffers, flags, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
+                buffers,
+                socketFlags,
+                state: socket);
+        }
+
+        public static Task<SocketReceiveFromResult> ReceiveFromAsync(
+            this Socket socket,
+            ArraySegment<byte> buffer,
+            SocketFlags socketFlags,
+            EndPoint remoteEndPoint)
+        {
+            object[] packedArguments = new object[] { socket, remoteEndPoint };
+
+            return Task<SocketReceiveFromResult>.Factory.FromAsync(
+                (targetBuffer, flags, callback, state) =>
+                {
+                    var arguments = (object[])state;
+                    var s = (Socket)arguments[0];
+                    var e = (EndPoint)arguments[1];
+
+                    IAsyncResult result = s.BeginReceiveFrom(
+                        targetBuffer.Array,
+                        targetBuffer.Offset,
+                        targetBuffer.Count,
+                        flags,
+                        ref e,
+                        callback,
+                        state);
+
+                    arguments[1] = e;
+                    return result;
+                },
+                asyncResult =>
+                {
+                    var arguments = (object[])asyncResult.AsyncState;
+                    var s = (Socket)arguments[0];
+                    var e = (EndPoint)arguments[1];
+
+                    int bytesReceived = s.EndReceiveFrom(asyncResult, ref e);
+
+                    return new SocketReceiveFromResult()
+                    {
+                        ReceivedBytes = bytesReceived,
+                        RemoteEndPoint = e
+                    };
+                },
+                buffer,
+                socketFlags,
+                state: packedArguments);
+        }
+
+        public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(
+            this Socket socket,
+            ArraySegment<byte> buffer,
+            SocketFlags socketFlags,
+            EndPoint remoteEndPoint)
+        {
+            object[] packedArguments = new object[] { socket, socketFlags, remoteEndPoint };
+
+            return Task<SocketReceiveMessageFromResult>.Factory.FromAsync(
+                (targetBuffer, callback, state) =>
+                {
+                    var arguments = (object[])state;
+                    var s = (Socket)arguments[0];
+                    var f = (SocketFlags)arguments[1];
+                    var e = (EndPoint)arguments[2];
+
+                    IAsyncResult result = s.BeginReceiveMessageFrom(
+                        targetBuffer.Array,
+                        targetBuffer.Offset,
+                        targetBuffer.Count,
+                        f,
+                        ref e,
+                        callback,
+                        state);
+
+                    arguments[2] = e;
+                    return result;
+                },
+                asyncResult =>
+                {
+                    var arguments = (object[])asyncResult.AsyncState;
+                    var s = (Socket)arguments[0];
+                    var f = (SocketFlags)arguments[1];
+                    var e = (EndPoint)arguments[2];
+                    IPPacketInformation ipPacket;
+
+                    int bytesReceived = s.EndReceiveMessageFrom(
+                        asyncResult,
+                        ref f,
+                        ref e,
+                        out ipPacket);
+
+                    return new SocketReceiveMessageFromResult()
+                    {
+                        PacketInformation = ipPacket,
+                        ReceivedBytes = bytesReceived,
+                        RemoteEndPoint = e,
+                        SocketFlags = f
+                    };
+                },
+                buffer,
+                state: packedArguments);
+        }
+
+        public static Task<int> SendAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffer, flags, callback, state) => ((Socket)state).BeginSend(
+                                                              targetBuffer.Array,
+                                                              targetBuffer.Offset,
+                                                              targetBuffer.Count,
+                                                              flags,
+                                                              callback,
+                                                              state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
+                buffer,
+                socketFlags,
+                state: socket);
+        }
+
+        public static Task<int> SendAsync(
+            this Socket socket,
+            IList<ArraySegment<byte>> buffers,
+            SocketFlags socketFlags)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffers, flags, callback, state) => ((Socket)state).BeginSend(targetBuffers, flags, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
+                buffers,
+                socketFlags,
+                state: socket);
+        }
+
+        public static Task<int> SendToAsync(
+            this Socket socket,
+            ArraySegment<byte> buffer,
+            SocketFlags socketFlags,
+            EndPoint remoteEP)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffer, flags, endPoint, callback, state) => ((Socket)state).BeginSendTo(
+                                                                        targetBuffer.Array,
+                                                                        targetBuffer.Offset,
+                                                                        targetBuffer.Count,
+                                                                        flags,
+                                                                        endPoint,
+                                                                        callback,
+                                                                        state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndSendTo(asyncResult),
+                buffer,
+                socketFlags,
+                remoteEP,
+                state: socket);
+        }
+    }
+}
+
+#endif
diff --git a/mcs/class/System/System.Net.Sockets/TcpClient.cs b/mcs/class/System/System.Net.Sockets/TcpClient.cs
deleted file mode 100644 (file)
index bbdb034..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-// TcpClient.cs
-//
-// Author:
-//     Phillip Pearson (pp@myelin.co.nz)
-//     Gonzalo Paniagua Javier (gonzalo@novell.com)
-//     Sridhar Kulkarni (sridharkulkarni@gmail.com)
-//     Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2001, Phillip Pearson http://www.myelin.co.nz
-// Copyright (c) 2006 Novell, Inc. (http://www.novell.com)
-// Copyright 2011 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.Net;
-using System.Threading.Tasks;
-
-namespace System.Net.Sockets
-{
-       public class TcpClient : IDisposable {
-               enum Properties : uint {
-                       LingerState = 1,
-                       NoDelay = 2,
-                       ReceiveBufferSize = 4,
-                       ReceiveTimeout = 8,
-                       SendBufferSize = 16,
-                       SendTimeout = 32
-               }
-
-               // private data
-               NetworkStream stream;
-               bool active;
-               Socket client;
-               bool disposed;
-               Properties values;
-               int recv_timeout, send_timeout;
-               int recv_buffer_size, send_buffer_size;
-               LingerOption linger_state;
-               bool no_delay;
-               
-               private void Init (AddressFamily family)
-               {
-                       active = false;
-
-                       if(client != null) {
-                               client.Close();
-                               client = null;
-                       }
-
-                       client = new Socket(family, SocketType.Stream, ProtocolType.Tcp);
-               }
-
-               public TcpClient ()
-               {
-                       Init(AddressFamily.InterNetwork);
-                       client.Bind(new IPEndPoint(IPAddress.Any, 0));
-               }
-
-               internal TcpClient (Socket s)
-               {
-                       client = s;
-               }
-       
-               public TcpClient (AddressFamily family)
-               {
-                       if (family != AddressFamily.InterNetwork &&
-                           family != AddressFamily.InterNetworkV6) {
-                               throw new ArgumentException ("Family must be InterNetwork or InterNetworkV6", "family");
-                       }
-                       
-                       Init (family);
-                       IPAddress any = IPAddress.Any;
-                       if (family == AddressFamily.InterNetworkV6)
-                               any = IPAddress.IPv6Any;
-                       client.Bind (new IPEndPoint (any, 0));
-               }
-
-               public TcpClient (IPEndPoint localEP)
-               {
-                       Init (localEP.AddressFamily);
-                       client.Bind (localEP);
-               }
-               
-               public TcpClient (string hostname, int port)
-               {
-                       Connect(hostname, port);
-               }
-                               
-               protected bool Active {
-                       get { return active; }
-                       set { active = value; }
-               }
-               
-               public Socket Client {
-                       get { return client; }
-                       set {
-                               client = value;
-                               stream = null;
-                       }
-               }
-
-               public int Available {
-                       get { return client.Available; }
-               }
-
-               public bool Connected {
-                       get { return client.Connected; }
-               }
-
-               public bool ExclusiveAddressUse {
-                       get {
-                               return(client.ExclusiveAddressUse);
-                       }
-                       set {
-                               client.ExclusiveAddressUse = value;
-                       }
-               }
-
-               public LingerOption LingerState {
-                       get {
-                               if ((values & Properties.LingerState) != 0)
-                                       return linger_state;
-
-                               return (LingerOption) client.GetSocketOption (SocketOptionLevel.Socket,
-                                                                       SocketOptionName.Linger);
-                       }
-                       set {
-                               if (!client.Connected) {
-                                       linger_state = value;
-                                       values |= Properties.LingerState;
-                                       return;
-                               }
-                               client.SetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.Linger, value);
-                       }
-               }
-                               
-               public bool NoDelay {
-                       get {
-                               if ((values & Properties.NoDelay) != 0)
-                                       return no_delay;
-
-                               return (bool)client.GetSocketOption(
-                                       SocketOptionLevel.Tcp,
-                                       SocketOptionName.NoDelay);
-                       }
-                       set {
-                               if (!client.Connected) {
-                                       no_delay = value;
-                                       values |= Properties.NoDelay;
-                                       return;
-                               }
-                               client.SetSocketOption(
-                                       SocketOptionLevel.Tcp,
-                                       SocketOptionName.NoDelay, value ? 1 : 0);
-                       }
-               }
-                               
-               public int ReceiveBufferSize {
-                       get {
-                               if ((values & Properties.ReceiveBufferSize) != 0)
-                                       return recv_buffer_size;
-
-                               return (int)client.GetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.ReceiveBuffer);
-                       }
-                       set {
-                               if (!client.Connected) {
-                                       recv_buffer_size = value;
-                                       values |= Properties.ReceiveBufferSize;
-                                       return;
-                               }
-                               client.SetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.ReceiveBuffer, value);
-                       }
-               }
-                       
-               public int ReceiveTimeout {
-                       get {
-                               if ((values & Properties.ReceiveTimeout) != 0)
-                                       return recv_timeout;
-
-                               return (int)client.GetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.ReceiveTimeout);
-                       }
-                       set {
-                               if (!client.Connected) {
-                                       recv_timeout = value;
-                                       values |= Properties.ReceiveTimeout;
-                                       return;
-                               }
-                               client.SetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.ReceiveTimeout, value);
-                       }
-               }
-               
-               public int SendBufferSize {
-                       get {
-                               if ((values & Properties.SendBufferSize) != 0)
-                                       return send_buffer_size;
-
-                               return (int)client.GetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.SendBuffer);
-                       }
-                       set {
-                               if (!client.Connected) {
-                                       send_buffer_size = value;
-                                       values |= Properties.SendBufferSize;
-                                       return;
-                               }
-                               client.SetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.SendBuffer, value);
-                       }
-               }
-               
-               public int SendTimeout {
-                       get {
-                               if ((values & Properties.SendTimeout) != 0)
-                                       return send_timeout;
-
-                               return (int)client.GetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.SendTimeout);
-                       }
-                       set {
-                               if (!client.Connected) {
-                                       send_timeout = value;
-                                       values |= Properties.SendTimeout;
-                                       return;
-                               }
-                               client.SetSocketOption(
-                                       SocketOptionLevel.Socket,
-                                       SocketOptionName.SendTimeout, value);
-                       }
-               }
-               
-               
-               // methods
-               
-               public void Close ()
-               {
-                       Dispose ();
-               }
-
-               public void Connect (IPEndPoint remoteEP)
-               {
-                       try {
-                               client.Connect (remoteEP);
-                               active = true;
-                       } finally {
-                               CheckDisposed ();
-                       }
-               }
-               
-               public void Connect (IPAddress address, int port)
-               {
-                       Connect(new IPEndPoint(address, port));
-               }
-
-               void SetOptions ()
-               {
-                       Properties props = values;
-                       values = 0;
-
-                       if ((props & Properties.LingerState) != 0)
-                               LingerState = linger_state;
-                       if ((props & Properties.NoDelay) != 0)
-                               NoDelay = no_delay;
-                       if ((props & Properties.ReceiveBufferSize) != 0)
-                               ReceiveBufferSize = recv_buffer_size;
-                       if ((props & Properties.ReceiveTimeout) != 0)
-                               ReceiveTimeout = recv_timeout;
-                       if ((props & Properties.SendBufferSize) != 0)
-                               SendBufferSize = send_buffer_size;
-                       if ((props & Properties.SendTimeout) != 0)
-                               SendTimeout = send_timeout;
-               }
-
-               public void Connect (string hostname, int port)
-               {
-                       IPAddress [] addresses = Dns.GetHostAddresses (hostname);
-                       Connect (addresses, port);
-               }
-
-               public void Connect (IPAddress[] ipAddresses, int port)
-               {
-                       CheckDisposed ();
-                       
-                       if (ipAddresses == null) {
-                               throw new ArgumentNullException ("ipAddresses");
-                       }
-                       
-                       for(int i = 0; i < ipAddresses.Length; i++) {
-                               try {
-                                       IPAddress address = ipAddresses[i];
-
-                                       if (address.Equals (IPAddress.Any) ||
-                                           address.Equals (IPAddress.IPv6Any)) {
-                                               throw new SocketException ((int)SocketError.AddressNotAvailable);
-                                       }
-
-                                       Init (address.AddressFamily);
-                                       
-                                       if (address.AddressFamily == AddressFamily.InterNetwork) {
-                                               client.Bind (new IPEndPoint (IPAddress.Any, 0));
-                                       } else if (address.AddressFamily == AddressFamily.InterNetworkV6) {
-                                               client.Bind (new IPEndPoint (IPAddress.IPv6Any, 0));
-                                       } else {
-                                               throw new NotSupportedException ("This method is only valid for sockets in the InterNetwork and InterNetworkV6 families");
-                                       }
-
-                                       Connect (new IPEndPoint (address, port));
-                                       
-                                       if (values != 0) {
-                                               SetOptions ();
-                                       }
-                                       
-                                       break;
-                               } catch (Exception e) {
-                                       /* Reinitialise the socket so
-                                        * other properties still work
-                                        * (see no-arg constructor)
-                                        */
-                                       Init (AddressFamily.InterNetwork);
-
-                                       /* This is the last known
-                                        * address, so re-throw the
-                                        * exception
-                                        */
-                                       if (i == ipAddresses.Length - 1) {
-                                               throw e;
-                                       }
-                               }
-                       }
-               }
-               
-               public void EndConnect (IAsyncResult asyncResult)
-               {
-                       client.EndConnect (asyncResult);
-               }
-               
-               public IAsyncResult BeginConnect (IPAddress address, int port, AsyncCallback requestCallback, object state)
-               {
-                       return client.BeginConnect (address, port, requestCallback, state);
-               }
-               
-               public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
-               {
-                       return client.BeginConnect (addresses, port, requestCallback, state);
-               }
-               
-               public IAsyncResult BeginConnect (string host, int port, AsyncCallback requestCallback, object state)
-               {
-                       return client.BeginConnect (host, port, requestCallback, state);
-               }
-               
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (disposed)
-                               return;
-                       disposed = true;
-
-                       if (disposing) {
-                               // release managed resources
-                               NetworkStream s = stream;
-                               stream = null;
-                               if (s != null) {
-                                       // This closes the socket as well, as the NetworkStream
-                                       // owns the socket.
-                                       s.Close();
-                                       active = false;
-                                       s = null;
-                               } else if (client != null){
-                                       client.Close ();
-                                       client = null;
-                               }
-                       }
-               }
-               
-               ~TcpClient ()
-               {
-                       Dispose (false);
-               }
-               
-               public NetworkStream GetStream()
-               {
-                       try {
-                               if (stream == null)
-                                       stream = new NetworkStream (client, true);
-                               return stream;
-                       }
-                       finally { CheckDisposed (); }
-               }
-
-               public Task ConnectAsync (IPAddress address, int port)
-               {
-                       return Task.Factory.FromAsync (BeginConnect, EndConnect, address, port, null);
-               }
-
-               public Task ConnectAsync (IPAddress[] addresses, int port)
-               {
-                       return Task.Factory.FromAsync (BeginConnect, EndConnect, addresses, port, null);
-               }
-
-               public Task ConnectAsync (string host, int port)
-               {
-                       return Task.Factory.FromAsync (BeginConnect, EndConnect, host, port, null);
-               }
-               private void CheckDisposed ()
-               {
-                       if (disposed)
-                               throw new ObjectDisposedException (GetType().FullName);
-               }
-       }
-}
-
diff --git a/mcs/class/System/System.Net.Sockets/TcpListener.cs b/mcs/class/System/System.Net.Sockets/TcpListener.cs
deleted file mode 100644 (file)
index e8b8ec4..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-// TcpListener.cs
-//
-// Authors:
-//    Phillip Pearson (pp@myelin.co.nz)
-//    Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//       Patrik Torstensson
-//    Sridhar Kulkarni (sridharkulkarni@gmail.com)
-//    Marek Safar (marek.safar@gmail.com)
-
-//
-// Copyright (C) 2001, Phillip Pearson http://www.myelin.co.nz
-//
-// (c) 2003 Ximian, Inc. (http://www.ximian.com)
-// (c) 2004-2006 Novell, Inc.
-// Copyright 2011 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.Net;
-using System.Threading.Tasks;
-
-namespace System.Net.Sockets
-{
-       /// <remarks>
-       /// A slightly more abstracted way to listen for incoming
-       /// network connections than a Socket.
-       /// </remarks>
-       public class TcpListener
-       {
-               // private data
-               
-               bool active;
-               Socket server;
-               EndPoint savedEP;
-               
-               // constructor
-
-               /// <summary>
-               /// Some code that is shared between the constructors.
-               /// </summary>
-               private void Init (AddressFamily family, EndPoint ep)
-               {
-                       active = false;
-                       server = new Socket(family, SocketType.Stream, ProtocolType.Tcp);
-                       savedEP = ep;
-               }
-               
-               /// <summary>
-               /// Constructs a new TcpListener to listen on a specified port
-               /// </summary>
-               /// <param name="port">The port to listen on, e.g. 80 if you 
-               /// are a web server</param>
-               [Obsolete ("Use TcpListener (IPAddress address, int port) instead")]
-               public TcpListener (int port)
-               {
-                       if (port < 0 || port > 65535)
-                               throw new ArgumentOutOfRangeException ("port");
-
-                       Init (AddressFamily.InterNetwork, new IPEndPoint (IPAddress.Any, port));
-               }
-
-               /// <summary>
-               /// Constructs a new TcpListener with a specified local endpoint
-               /// </summary>
-               /// <param name="local_end_point">The endpoint</param>
-               public TcpListener (IPEndPoint localEP)
-               {
-                       if (localEP == null)
-                               throw new ArgumentNullException ("localEP");
-
-                       Init (localEP.AddressFamily, localEP);
-               }
-               
-               /// <summary>
-               /// Constructs a new TcpListener, listening on a specified port
-               /// and IP (for use on a multi-homed machine)
-               /// </summary>
-               /// <param name="listen_ip">The IP to listen on</param>
-               /// <param name="port">The port to listen on</param>
-               public TcpListener (IPAddress localaddr, int port)
-               {
-                       if (localaddr == null)
-                               throw new ArgumentNullException ("localaddr");
-
-                       if (port < 0 || port > 65535)
-                               throw new ArgumentOutOfRangeException ("port");
-
-                       Init (localaddr.AddressFamily, new IPEndPoint (localaddr, port));
-               }
-
-
-               // properties
-
-               /// <summary>
-               /// A flag that is 'true' if the TcpListener is listening,
-               /// or 'false' if it is not listening
-               /// </summary>
-               protected bool Active
-               {
-                       get { return active; }
-               }
-
-               /// <summary>
-               /// The local end point
-               /// </summary>
-               public EndPoint LocalEndpoint
-               {
-                       get { 
-                               if (active)
-                                       return server.LocalEndPoint;
-
-                               return savedEP; 
-                       }
-               }
-               
-               /// <summary>
-               /// The listening socket
-               /// </summary>
-               public Socket Server
-               {
-                       get { return server; }
-               }
-
-               /// <summary>
-               /// Specifies whether the TcpListener allows only one
-               /// underlying socket to listen to a specific port
-               /// </summary>
-               public bool ExclusiveAddressUse
-               {
-                       get {
-                               if (server == null) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               if (active) {
-                                       throw new InvalidOperationException ("The TcpListener has been started");
-                               }
-
-                               return(server.ExclusiveAddressUse);
-                       }
-                       set {
-                               if (server == null) {
-                                       throw new ObjectDisposedException (GetType ().ToString ());
-                               }
-                               if (active) {
-                                       throw new InvalidOperationException ("The TcpListener has been started");
-                               }
-
-                               server.ExclusiveAddressUse = value;
-                       }
-               }
-               
-               // methods
-
-               /// <summary>
-               /// Accepts a pending connection
-               /// </summary>
-               /// <returns>A Socket object for the new connection</returns>
-               public Socket AcceptSocket ()
-               {
-                       if (!active)
-                               throw new InvalidOperationException ("Socket is not listening");
-
-                       return server.Accept();
-               }
-               
-               /// <summary>
-               /// Accepts a pending connection
-               /// </summary>
-               /// <returns>A TcpClient
-               /// object made from the new socket.</returns>
-               public TcpClient AcceptTcpClient ()
-               {
-                       if (!active)
-                               throw new InvalidOperationException ("Socket is not listening");
-
-                       Socket clientSocket = server.Accept ();
-
-                       TcpClient client = new TcpClient(clientSocket);
-                       
-                       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>
-               ~TcpListener ()
-               {
-                       if (active)
-                               Stop();
-               }
-       
-               /// <returns>
-               /// Returns 'true' if there is a connection waiting to be accepted
-               /// with AcceptSocket() or AcceptTcpClient().
-               /// </returns>
-               public bool Pending ()
-               {
-                       if (!active)
-                               throw new InvalidOperationException ("Socket is not listening");
-
-                       return server.Poll(0, SelectMode.SelectRead);
-               }
-               
-               /// <summary>
-               /// Tells the TcpListener to start listening.
-               /// </summary>
-               public void Start ()
-               {
-                       // MS: sets Listen to Int32.MaxValue
-                       this.Start (5);
-                       // According to the man page some BSD and BSD-derived
-                       // systems limit the backlog to 5.  This should really be
-                       // configurable though
-               }
-
-               /// <summary>
-               /// Tells the TcpListener to start listening for max number
-               /// of pending connections.
-               /// </summary>
-
-               public void Start (int backlog)
-               {
-                       if (active) {
-                               return;
-                       }
-                       if (server == null) {
-                               throw new InvalidOperationException ("Invalid server socket");
-                       }
-                       
-                       server.Bind (savedEP);
-                       server.Listen (backlog);
-                       active = true;
-               }
-
-               public IAsyncResult BeginAcceptSocket (AsyncCallback callback,
-                                                      object state)
-               {
-                       if (server == null) {
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       }
-                       
-                       return(server.BeginAccept (callback, state));
-               }
-               
-               public IAsyncResult BeginAcceptTcpClient (AsyncCallback callback, object state)
-               {
-                       if (server == null) {
-                               throw new ObjectDisposedException (GetType ().ToString ());
-                       }
-                       
-                       return(server.BeginAccept (callback, state));
-               }
-               
-               public Socket EndAcceptSocket (IAsyncResult asyncResult) 
-               {
-                       return(server.EndAccept (asyncResult));
-               }
-               
-               public TcpClient EndAcceptTcpClient (IAsyncResult asyncResult)
-               {
-                       Socket clientSocket = server.EndAccept (asyncResult);
-                       TcpClient client = new TcpClient (clientSocket);
-                       
-                       return(client);
-               }
-               
-               /// <summary>
-               /// Tells the TcpListener to stop listening and dispose
-               /// of all managed resources.
-               /// </summary>
-               public void Stop ()
-               {
-                       if (active) 
-                       {
-                               server.Close ();
-                               server = null;
-                       }
-
-                       Init (AddressFamily.InterNetwork, savedEP);
-               }
-
-               public Task<Socket> AcceptSocketAsync ()
-               {
-                       return Task<Socket>.Factory.FromAsync (BeginAcceptSocket, EndAcceptSocket, null);
-               }
-
-               public Task<TcpClient> AcceptTcpClientAsync ()
-               {
-                       return Task<TcpClient>.Factory.FromAsync (BeginAcceptTcpClient, EndAcceptTcpClient, null);
-               }
-       }
-}
index 7b64967345f6f9090b77306735af467b3443e122..76941fc7ce3078117839ed7a13778dc9af1c676f 100644 (file)
@@ -78,6 +78,16 @@ namespace System.Net.Sockets
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
                }
 
+               public void AllowNatTraversal (bool allowed)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static TcpListener Create (int port)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
                ~TcpListener ()
                {
                }
diff --git a/mcs/class/System/System.Net.Sockets/UdpClient.cs b/mcs/class/System/System.Net.Sockets/UdpClient.cs
deleted file mode 100644 (file)
index c82529b..0000000
+++ /dev/null
@@ -1,642 +0,0 @@
-//
-// System.Net.Sockets.UdpClient.cs
-//
-// Author:
-//    Gonzalo Paniagua Javier <gonzalo@ximian.com>
-//    Sridhar Kulkarni (sridharkulkarni@gmail.com)
-//    Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) Ximian, Inc. http://www.ximian.com
-// Copyright 2011 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.Net;
-using System.Threading.Tasks;
-
-namespace System.Net.Sockets
-{
-       public class UdpClient : IDisposable
-       {
-               private bool disposed = false;
-               private bool active = false;
-               private Socket socket;
-               private AddressFamily family = AddressFamily.InterNetwork;
-               private byte[] recvbuffer;
-       
-               public UdpClient () : this(AddressFamily.InterNetwork)
-               {
-               }
-
-               public UdpClient(AddressFamily family)
-               {
-                       if(family != AddressFamily.InterNetwork && family != AddressFamily.InterNetworkV6)
-                               throw new ArgumentException ("Family must be InterNetwork or InterNetworkV6", "family");
-
-                       this.family = family;
-                       InitSocket (null);
-               }
-
-               public UdpClient (int port)
-               {
-                       if (port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort)
-                               throw new ArgumentOutOfRangeException ("port");
-
-                       this.family = AddressFamily.InterNetwork;
-
-                       IPEndPoint localEP = new IPEndPoint (IPAddress.Any, port);
-                       InitSocket (localEP);
-               }
-
-               public UdpClient (IPEndPoint localEP)
-               {
-                       if (localEP == null)
-                               throw new ArgumentNullException ("localEP");
-
-                       this.family = localEP.AddressFamily;
-
-                       InitSocket (localEP);
-               }
-
-               public UdpClient (int port, AddressFamily family)
-               {
-                       if (family != AddressFamily.InterNetwork && family != AddressFamily.InterNetworkV6)
-                               throw new ArgumentException ("Family must be InterNetwork or InterNetworkV6", "family");
-
-                       if (port < IPEndPoint.MinPort ||
-                           port > IPEndPoint.MaxPort) {
-                               throw new ArgumentOutOfRangeException ("port");
-                       }
-
-                       this.family = family;
-
-                       IPEndPoint localEP;
-
-                       if (family == AddressFamily.InterNetwork)
-                               localEP = new IPEndPoint (IPAddress.Any, port);
-                       else
-                               localEP = new IPEndPoint (IPAddress.IPv6Any, port);
-                       InitSocket (localEP);
-               }
-
-               public UdpClient (string hostname, int port)
-               {
-                       if (hostname == null)
-                               throw new ArgumentNullException ("hostname");
-
-                       if (port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort)
-                               throw new ArgumentOutOfRangeException ("port");
-
-                       InitSocket (null);
-                       Connect (hostname, port);
-               }
-
-               private void InitSocket (EndPoint localEP)
-               {
-                       if(socket != null) {
-                               socket.Close();
-                               socket = null;
-                       }
-
-                       socket = new Socket (family, SocketType.Dgram, ProtocolType.Udp);
-
-                       if (localEP != null)
-                               socket.Bind (localEP);
-               }
-
-               public void AllowNatTraversal (bool allowed)
-               {
-                       if (allowed)
-                               socket.SetIPProtectionLevel (IPProtectionLevel.Unrestricted);
-                       else
-                               socket.SetIPProtectionLevel (IPProtectionLevel.EdgeRestricted);
-               }
-
-               public void Close ()
-               {
-                       Dispose ();
-               }
-#region Connect
-
-               void DoConnect (IPEndPoint endPoint)
-               {
-                       /* Catch EACCES and turn on SO_BROADCAST then,
-                        * as UDP sockets don't have it set by default
-                        */
-                       try {
-                               socket.Connect (endPoint);
-                       } catch (SocketException ex) {
-                               if (ex.ErrorCode == (int)SocketError.AccessDenied) {
-                                       socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
-                                       
-                                       socket.Connect (endPoint);
-                               } else {
-                                       throw;
-                               }
-                       }
-               }
-               
-               public void Connect (IPEndPoint endPoint)
-               {
-                       CheckDisposed ();
-                       if (endPoint == null)
-                               throw new ArgumentNullException ("endPoint");
-
-                       DoConnect (endPoint);
-                       active = true;
-               }
-
-               public void Connect (IPAddress addr, int port)
-               {
-                       if (addr == null)
-                               throw new ArgumentNullException ("addr");
-
-                       if (port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort)
-                               throw new ArgumentOutOfRangeException ("port");
-
-
-                       Connect (new IPEndPoint (addr, port));
-               }
-
-               public void Connect (string hostname, int port)
-               {
-                       if (port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort)
-                               throw new ArgumentOutOfRangeException ("port");
-
-                       IPAddress[] addresses = Dns.GetHostAddresses (hostname);
-                       for(int i=0; i<addresses.Length; i++) {
-                               try {
-                                       this.family = addresses[i].AddressFamily;
-                                       Connect (new IPEndPoint (addresses[i], port));
-                                       break;
-                               } catch(Exception e) {
-                                       if(i == addresses.Length - 1){
-                                               if(socket != null) {
-                                                       socket.Close();
-                                                       socket = null;
-                                               }
-                                               /// This is the last entry, re-throw the exception
-                                               throw e;
-                                       }
-                               }
-                       }
-               }
-#endregion
-               #region Multicast methods
-               public void DropMulticastGroup (IPAddress multicastAddr)
-               {
-                       CheckDisposed ();
-                       if (multicastAddr == null)
-                               throw new ArgumentNullException ("multicastAddr");
-
-                       if(family == AddressFamily.InterNetwork)
-                               socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.DropMembership,
-                                       new MulticastOption (multicastAddr));
-                       else
-                               socket.SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DropMembership,
-                                       new IPv6MulticastOption (multicastAddr));
-               }
-
-               public void DropMulticastGroup (IPAddress multicastAddr,
-                                               int ifindex)
-               {
-                       CheckDisposed ();
-
-                       /* LAMESPEC: exceptions haven't been specified
-                        * for this overload.
-                        */
-                       if (multicastAddr == null) {
-                               throw new ArgumentNullException ("multicastAddr");
-                       }
-
-                       /* Does this overload only apply to IPv6?
-                        * Only the IPv6MulticastOption has an
-                        * ifindex-using constructor.  The MS docs
-                        * don't say.
-                        */
-                       if (family == AddressFamily.InterNetworkV6) {
-                               socket.SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DropMembership, new IPv6MulticastOption (multicastAddr, ifindex));
-                       }
-               }
-               
-               public void JoinMulticastGroup (IPAddress multicastAddr)
-               {
-                       CheckDisposed ();
-
-                       if (multicastAddr == null)
-                               throw new ArgumentNullException ("multicastAddr");
-
-                       if(family == AddressFamily.InterNetwork)
-                               socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.AddMembership,
-                                       new MulticastOption (multicastAddr));
-                       else
-                               socket.SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.AddMembership,
-                                       new IPv6MulticastOption (multicastAddr));
-               }
-
-               public void JoinMulticastGroup (int ifindex,
-                                               IPAddress multicastAddr)
-               {
-                       CheckDisposed ();
-
-                       if (multicastAddr == null)
-                               throw new ArgumentNullException ("multicastAddr");
-
-                       if (family == AddressFamily.InterNetworkV6)
-                               socket.SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.AddMembership, new IPv6MulticastOption (multicastAddr, ifindex));
-                       else
-                               throw new SocketException ((int) SocketError.OperationNotSupported);
-               }
-
-               public void JoinMulticastGroup (IPAddress multicastAddr, int timeToLive)
-               {
-                       CheckDisposed ();
-                       if (multicastAddr == null)
-                               throw new ArgumentNullException ("multicastAddr");
-                       if (timeToLive < 0 || timeToLive > 255)
-                               throw new ArgumentOutOfRangeException ("timeToLive");
-
-                       JoinMulticastGroup (multicastAddr);
-                       if(family == AddressFamily.InterNetwork)
-                               socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive,
-                                       timeToLive);
-                       else
-                               socket.SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.MulticastTimeToLive,
-                                       timeToLive);
-               }
-
-               public void JoinMulticastGroup (IPAddress multicastAddr,
-                                               IPAddress localAddress)
-               {
-                       CheckDisposed ();
-
-                       if (family == AddressFamily.InterNetwork)
-                               socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption (multicastAddr, localAddress));
-                       else
-                               throw new SocketException ((int) SocketError.OperationNotSupported);
-               }
-
-               #endregion
-               #region Data I/O
-               public byte [] Receive (ref IPEndPoint remoteEP)
-               {
-                       CheckDisposed ();
-
-                       byte [] recBuffer = new byte [65536]; // Max. size
-                       EndPoint endPoint = (EndPoint) remoteEP;
-                       int dataRead = socket.ReceiveFrom (recBuffer, ref endPoint);
-                       if (dataRead < recBuffer.Length)
-                               recBuffer = CutArray (recBuffer, dataRead);
-
-                       remoteEP = (IPEndPoint) endPoint;
-                       return recBuffer;
-               }
-
-               int DoSend (byte[] dgram, int bytes, IPEndPoint endPoint)
-               {
-                       /* Catch EACCES and turn on SO_BROADCAST then,
-                        * as UDP sockets don't have it set by default
-                        */
-                       try {
-                               if (endPoint == null) {
-                                       return(socket.Send (dgram, 0, bytes,
-                                                           SocketFlags.None));
-                               } else {
-                                       return(socket.SendTo (dgram, 0, bytes,
-                                                             SocketFlags.None,
-                                                             endPoint));
-                               }
-                       } catch (SocketException ex) {
-                               if (ex.ErrorCode == (int)SocketError.AccessDenied) {
-                                       socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
-                                       if (endPoint == null) {
-                                               return(socket.Send (dgram, 0, bytes, SocketFlags.None));
-                                       } else {
-                                               return(socket.SendTo (dgram, 0, bytes, SocketFlags.None, endPoint));
-                                       }
-                               } else {
-                                       throw;
-                               }
-                       }
-               }
-               
-               public int Send (byte [] dgram, int bytes)
-               {
-                       CheckDisposed ();
-                       if (dgram == null)
-                               throw new ArgumentNullException ("dgram");
-
-                       if (!active)
-                               throw new InvalidOperationException ("Operation not allowed on " + 
-                                                                    "non-connected sockets.");
-
-                       return(DoSend (dgram, bytes, null));
-               }
-
-               public int Send (byte [] dgram, int bytes, IPEndPoint endPoint)
-               {
-                       CheckDisposed ();
-                       if (dgram == null)
-                               throw new ArgumentNullException ("dgram is null");
-                       
-                       if (active) {
-                               if (endPoint != null)
-                                       throw new InvalidOperationException ("Cannot send packets to an " +
-                                                                            "arbitrary host while connected.");
-
-                               return(DoSend (dgram, bytes, null));
-                       }
-
-                       return(DoSend (dgram, bytes, endPoint));
-               }
-
-               public int Send (byte [] dgram, int bytes, string hostname, int port)
-               {
-                       return Send (dgram, bytes, 
-                                    new IPEndPoint (Dns.GetHostAddresses (hostname) [0], port));
-               }
-
-               private byte [] CutArray (byte [] orig, int length)
-               {
-                       byte [] newArray = new byte [length];
-                       Buffer.BlockCopy (orig, 0, newArray, 0, length);
-
-                       return newArray;
-               }
-#endregion
-
-               IAsyncResult DoBeginSend (byte[] datagram, int bytes,
-                                         IPEndPoint endPoint,
-                                         AsyncCallback requestCallback,
-                                         object state)
-               {
-                       /* Catch EACCES and turn on SO_BROADCAST then,
-                        * as UDP sockets don't have it set by default
-                        */
-                       try {
-                               if (endPoint == null) {
-                                       return(socket.BeginSend (datagram, 0, bytes, SocketFlags.None, requestCallback, state));
-                               } else {
-                                       return(socket.BeginSendTo (datagram, 0, bytes, SocketFlags.None, endPoint, requestCallback, state));
-                               }
-                       } catch (SocketException ex) {
-                               if (ex.ErrorCode == (int)SocketError.AccessDenied) {
-                                       socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
-                                       if (endPoint == null) {
-                                               return(socket.BeginSend (datagram, 0, bytes, SocketFlags.None, requestCallback, state));
-                                       } else {
-                                               return(socket.BeginSendTo (datagram, 0, bytes, SocketFlags.None, endPoint, requestCallback, state));
-                                       }
-                               } else {
-                                       throw;
-                               }
-                       }
-               }
-               
-               public IAsyncResult BeginSend (byte[] datagram, int bytes,
-                                              AsyncCallback requestCallback,
-                                              object state)
-               {
-                       return(BeginSend (datagram, bytes, null,
-                                         requestCallback, state));
-               }
-               
-               public IAsyncResult BeginSend (byte[] datagram, int bytes,
-                                              IPEndPoint endPoint,
-                                              AsyncCallback requestCallback,
-                                              object state)
-               {
-                       CheckDisposed ();
-
-                       if (datagram == null) {
-                               throw new ArgumentNullException ("datagram");
-                       }
-                       
-                       return(DoBeginSend (datagram, bytes, endPoint,
-                                           requestCallback, state));
-               }
-               
-               public IAsyncResult BeginSend (byte[] datagram, int bytes,
-                                              string hostname, int port,
-                                              AsyncCallback requestCallback,
-                                              object state)
-               {
-                       return(BeginSend (datagram, bytes, new IPEndPoint (Dns.GetHostAddresses (hostname) [0], port), requestCallback, state));
-               }
-               
-               public int EndSend (IAsyncResult asyncResult)
-               {
-                       CheckDisposed ();
-                       
-                       if (asyncResult == null) {
-                               throw new ArgumentNullException ("asyncResult is a null reference");
-                       }
-                       
-                       return(socket.EndSend (asyncResult));
-               }
-
-               public IAsyncResult BeginReceive (AsyncCallback requestCallback, object state)
-               {
-                       CheckDisposed ();
-
-                       recvbuffer = new byte[8192];
-                       
-                       EndPoint ep;
-                       
-                       if (family == AddressFamily.InterNetwork) {
-                               ep = new IPEndPoint (IPAddress.Any, 0);
-                       } else {
-                               ep = new IPEndPoint (IPAddress.IPv6Any, 0);
-                       }
-                       
-                       return(socket.BeginReceiveFrom (recvbuffer, 0, 8192,
-                                                       SocketFlags.None,
-                                                       ref ep,
-                                                       requestCallback, state));
-               }
-               
-               public byte[] EndReceive (IAsyncResult asyncResult, ref IPEndPoint remoteEP)
-               {
-                       CheckDisposed ();
-                       
-                       if (asyncResult == null) {
-                               throw new ArgumentNullException ("asyncResult is a null reference");
-                       }
-                       
-                       EndPoint ep;
-                       
-                       if (family == AddressFamily.InterNetwork) {
-                               ep = new IPEndPoint (IPAddress.Any, 0);
-                       } else {
-                               ep = new IPEndPoint (IPAddress.IPv6Any, 0);
-                       }
-                       
-                       int bytes = socket.EndReceiveFrom (asyncResult,
-                                                          ref ep);
-                       remoteEP = (IPEndPoint)ep;
-
-                       /* Need to copy into a new array here, because
-                        * otherwise the returned array length is not
-                        * 'bytes'
-                        */
-                       byte[] buf = new byte[bytes];
-                       Array.Copy (recvbuffer, buf, bytes);
-                       
-                       return(buf);
-               }
-                               
-#region Properties
-               protected bool Active {
-                       get { return active; }
-                       set { active = value; }
-               }
-
-               public Socket Client {
-                       get { return socket; }
-                       set { socket = value; }
-               }
-
-               public int Available
-               {
-                       get {
-                               return(socket.Available);
-                       }
-               }
-               
-               public bool DontFragment
-               {
-                       get {
-                               return(socket.DontFragment);
-                       }
-                       set {
-                               socket.DontFragment = value;
-                       }
-               }
-
-               public bool EnableBroadcast
-               {
-                       get {
-                               return(socket.EnableBroadcast);
-                       }
-                       set {
-                               socket.EnableBroadcast = value;
-                       }
-               }
-               
-               public bool ExclusiveAddressUse
-               {
-                       get {
-                               return(socket.ExclusiveAddressUse);
-                       }
-                       set {
-                               socket.ExclusiveAddressUse = value;
-                       }
-               }
-               
-               public bool MulticastLoopback
-               {
-                       get {
-                               return(socket.MulticastLoopback);
-                       }
-                       set {
-                               socket.MulticastLoopback = value;
-                       }
-               }
-               
-               public short Ttl
-               {
-                       get {
-                               return(socket.Ttl);
-                       }
-                       set {
-                               socket.Ttl = value;
-                       }
-               }
-
-#endregion
-#region Disposing
-               public void Dispose ()
-               {
-                       Dispose (true);
-                       GC.SuppressFinalize (this);
-               }
-
-               protected virtual void Dispose (bool disposing)
-               {
-                       if (disposed)
-                               return;
-                       disposed = true;
-
-                       if (disposing){
-                               if (socket != null)
-                                       socket.Close ();
-
-                               socket = null;
-                       }
-               }
-               
-               ~UdpClient ()
-               {
-                       Dispose (false);
-               }
-               
-               private void CheckDisposed ()
-               {
-                       if (disposed)
-                               throw new ObjectDisposedException (GetType().FullName);
-               }               
-#endregion
-
-               
-               public Task<UdpReceiveResult> ReceiveAsync ()
-               {
-                       return Task<UdpReceiveResult>.Factory.FromAsync (BeginReceive, r => {
-                               IPEndPoint remoteEndPoint = null;
-                               return new UdpReceiveResult (EndReceive (r, ref remoteEndPoint), remoteEndPoint);
-                       }, null);
-               }
-
-               public Task<int> SendAsync (byte[] datagram, int bytes)
-               {
-                       return Task<int>.Factory.FromAsync (BeginSend, EndSend, datagram, bytes, null);
-               }
-
-               public Task<int> SendAsync (byte[] datagram, int bytes, IPEndPoint endPoint)
-               {
-                       return Task<int>.Factory.FromAsync (BeginSend, EndSend, datagram, bytes, endPoint, null);
-               }
-
-               public Task<int> SendAsync (byte[] datagram, int bytes, string hostname, int port)
-               {
-                       var t = Tuple.Create (datagram, bytes, hostname, port, this);
-
-                       return Task<int>.Factory.FromAsync ((callback, state) => {
-                               var d = (Tuple<byte[], int, string, int, UdpClient>) state;
-                               return d.Item5.BeginSend (d.Item1, d.Item2, d.Item3, d.Item4, callback, null);
-                       }, EndSend, t);
-               }
-       }
-}
-
index 953350146d25ed24d79e37f4a9fcd510174c4353..7a5e2dd740c87d6fc28d2de886e685c3ae156d62 100644 (file)
@@ -204,6 +204,11 @@ namespace System.Net.Sockets
                        set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                }
 
+               public void AllowNatTraversal (bool allowed)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
                public void Dispose ()
                {
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
diff --git a/mcs/class/System/System.Net/AuthenticationManager.platformnotsupported.cs b/mcs/class/System/System.Net/AuthenticationManager.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..1572ce7
--- /dev/null
@@ -0,0 +1,77 @@
+//
+// AuthenticationManager.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Collections;
+using System.Collections.Specialized;
+
+namespace System.Net
+{
+       public class AuthenticationManager {
+               const string EXCEPTION_MESSAGE = "System.Net.AuthenticationManager is not supported on the current platform.";
+
+               private AuthenticationManager ()
+               {
+               }
+
+               public static ICredentialPolicy CredentialPolicy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static StringDictionary CustomTargetNameDictionary {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static IEnumerator RegisteredModules {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static Authorization Authenticate (string challenge, WebRequest request, ICredentials credentials)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static Authorization PreAuthenticate (WebRequest request, ICredentials credentials)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static void Register (IAuthenticationModule authenticationModule)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static void Unregister (IAuthenticationModule authenticationModule)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static void Unregister (string authenticationScheme)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index 806bfc119d6e52d9f4157c3ba1552643104a9beb..dac834884441e8ccd8764f846dcea5289ebd073b 100644 (file)
@@ -295,10 +295,10 @@ namespace System.Net {
 
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static bool GetHostByName_internal(string host, out string h_name, out string[] h_aliases, out string[] h_addr_list);
+               private extern static bool GetHostByName_internal(string host, out string h_name, out string[] h_aliases, out string[] h_addr_list, int hint);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern static bool GetHostByAddr_internal(string addr, out string h_name, out string[] h_aliases, out string[] h_addr_list);
+               private extern static bool GetHostByAddr_internal(string addr, out string h_name, out string[] h_aliases, out string[] h_addr_list, int hint);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private extern static bool GetHostName_internal(out string h_name);
@@ -372,7 +372,7 @@ namespace System.Net {
 
                        string h_name;
                        string[] h_aliases, h_addrlist;
-                       bool ret = GetHostByAddr_internal(address, out h_name, out h_aliases, out h_addrlist);
+                       bool ret = GetHostByAddr_internal(address, out h_name, out h_aliases, out h_addrlist, Socket.FamilyHint);
                        if (!ret)
                                Error_11001 (address);
                        return (hostent_to_IPHostEntry (address, h_name, h_aliases, h_addrlist));
@@ -434,7 +434,7 @@ namespace System.Net {
                        string h_name;
                        string[] h_aliases, h_addrlist;
 
-                       bool ret = GetHostByName_internal(hostName, out h_name, out h_aliases, out h_addrlist);
+                       bool ret = GetHostByName_internal(hostName, out h_name, out h_aliases, out h_addrlist, Socket.FamilyHint);
                        if (ret == false)
                                Error_11001 (hostName);
 
index 9e2c655cb2dd9842e3afde14b817fe1b32b451e2..c0ea1b551195e55dd06e5919c44646ee5548dc8e 100644 (file)
@@ -17,6 +17,7 @@ using MSI = Mono.Security.Interface;
 #endif
 
 using System;
+using System.Globalization;
 using System.IO;
 using System.Net.Sockets;
 using System.Text;
@@ -42,6 +43,7 @@ namespace System.Net
                NetworkCredential credentials;
                IPHostEntry hostEntry;
                IPEndPoint localEndPoint;
+               IPEndPoint remoteEndPoint;
                IWebProxy proxy;
                int timeout = 100000;
                int rwTimeout = 300000;
@@ -65,7 +67,9 @@ namespace System.Net
                const string PasswordCommand = "PASS";
                const string TypeCommand = "TYPE";
                const string PassiveCommand = "PASV";
+               const string ExtendedPassiveCommand = "EPSV";
                const string PortCommand = "PORT";
+               const string ExtendedPortCommand = "EPRT";
                const string AbortCommand = "ABOR";
                const string AuthCommand = "AUTH";
                const string RestCommand = "REST";
@@ -401,6 +405,7 @@ namespace System.Net
                                                State = RequestState.Scheduled;
 
                                        Thread thread = new Thread (ProcessRequest);
+                                       thread.IsBackground = true;
                                        thread.Start ();
                                }
                        }
@@ -452,6 +457,7 @@ namespace System.Net
 
                        asyncResult = new FtpAsyncResult (callback, state);
                        Thread thread = new Thread (ProcessRequest);
+                       thread.IsBackground = true;
                        thread.Start ();
 
                        return asyncResult;
@@ -775,14 +781,14 @@ namespace System.Net
                        foreach (IPAddress address in hostEntry.AddressList) {
                                sock = new Socket (address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
 
-                               IPEndPoint remote = new IPEndPoint (address, requestUri.Port);
+                               remoteEndPoint = new IPEndPoint (address, requestUri.Port);
 
-                               if (!ServicePoint.CallEndPointDelegate (sock, remote)) {
+                               if (!ServicePoint.CallEndPointDelegate (sock, remoteEndPoint)) {
                                        sock.Close ();
                                        sock = null;
                                } else {
                                        try {
-                                               sock.Connect (remote);
+                                               sock.Connect (remoteEndPoint);
                                                localEndPoint = (IPEndPoint) sock.LocalEndPoint;
                                                break;
                                        } catch (SocketException exc) {
@@ -837,52 +843,19 @@ namespace System.Net
                }
 
                // Probably we could do better having here a regex
-               Socket SetupPassiveConnection (string statusDescription)
+               Socket SetupPassiveConnection (string statusDescription, bool ipv6)
                {
                        // Current response string
                        string response = statusDescription;
                        if (response.Length < 4)
                                throw new WebException ("Cannot open passive data connection");
-                       
-                       // Look for first digit after code
-                       int i;
-                       for (i = 3; i < response.Length && !Char.IsDigit (response [i]); i++)
-                               ;
-                       if (i >= response.Length)
-                               throw new WebException ("Cannot open passive data connection");
-
-                       // Get six elements
-                       string [] digits = response.Substring (i).Split (new char [] {','}, 6);
-                       if (digits.Length != 6)
-                               throw new WebException ("Cannot open passive data connection");
-
-                       // Clean non-digits at the end of last element
-                       int j;
-                       for (j = digits [5].Length - 1; j >= 0 && !Char.IsDigit (digits [5][j]); j--)
-                               ;
-                       if (j < 0)
-                               throw new WebException ("Cannot open passive data connection");
-                       
-                       digits [5] = digits [5].Substring (0, j + 1);
-
-                       IPAddress ip;
-                       try {
-                               ip = IPAddress.Parse (String.Join (".", digits, 0, 4));
-                       } catch (FormatException) {
-                               throw new WebException ("Cannot open passive data connection");
-                       }
 
-                       // Get the port
-                       int p1, p2, port;
-                       if (!Int32.TryParse (digits [4], out p1) || !Int32.TryParse (digits [5], out p2))
-                               throw new WebException ("Cannot open passive data connection");
+                       int port = ipv6 ? GetPortV6 (response) : GetPortV4 (response);
 
-                       port = (p1 << 8) + p2; // p1 * 256 + p2
-                       //port = p1 * 256 + p2;
                        if (port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort)
                                throw new WebException ("Cannot open passive data connection");
 
-                       IPEndPoint ep = new IPEndPoint (ip, port);
+                       IPEndPoint ep = new IPEndPoint (remoteEndPoint.Address, port);
                        Socket sock = new Socket (ep.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
                        try {
                                sock.Connect (ep);
@@ -894,6 +867,87 @@ namespace System.Net
                        return sock;
                }
 
+               // GetPortV4, GetPortV6, FormatAddress and FormatAddressV6 are copied from referencesource
+               // TODO: replace FtpWebRequest completely.
+               private int GetPortV4(string responseString)
+               {
+                       string [] parsedList = responseString.Split(new char [] {' ', '(', ',', ')'});
+
+                       // We need at least the status code and the port
+                       if (parsedList.Length <= 7) {
+                               throw new FormatException(SR.GetString(SR.net_ftp_response_invalid_format, responseString));
+                       }
+
+                       int index = parsedList.Length-1;
+                       // skip the last non-number token (e.g. terminating '.')
+#if MONO
+                       // the MS code expects \r\n here in parsedList[index],
+                       // but we're stripping the EOL off earlier so the array contains
+                       // an empty string here which would make Char.IsNumber throw
+                       // TODO: this can be removed once we switch FtpWebRequest to referencesource
+                       if (parsedList[index] == "" || !Char.IsNumber(parsedList[index], 0))
+#else
+                       if (!Char.IsNumber(parsedList[index], 0))
+#endif
+                               index--;
+
+                       int port = Convert.ToByte(parsedList[index--], NumberFormatInfo.InvariantInfo);
+                       port = port |
+                               (Convert.ToByte(parsedList[index--], NumberFormatInfo.InvariantInfo) << 8);
+
+                       return port;
+               }
+
+               private int GetPortV6(string responseString)
+               {
+                       int pos1 = responseString.LastIndexOf("(");
+                       int pos2 = responseString.LastIndexOf(")");
+                       if (pos1 == -1 || pos2 <= pos1) 
+                               throw new FormatException(SR.GetString(SR.net_ftp_response_invalid_format, responseString));
+
+                       // addressInfo will contain a string of format "|||<tcp-port>|"
+                       string addressInfo = responseString.Substring(pos1+1, pos2-pos1-1);
+
+                       // Although RFC2428 recommends using "|" as the delimiter,
+                       // It allows ASCII characters in range 33-126 inclusive.
+                       // We should consider allowing the full range.
+
+                       string [] parsedList = addressInfo.Split(new char [] {'|'});
+                       if (parsedList.Length < 4)
+                               throw new FormatException(SR.GetString(SR.net_ftp_response_invalid_format, responseString));
+                       
+                       return Convert.ToInt32(parsedList[3], NumberFormatInfo.InvariantInfo);
+               }
+
+               private String FormatAddress(IPAddress address, int Port )
+               {
+                       byte [] localAddressInBytes = address.GetAddressBytes();
+
+                       // produces a string in FTP IPAddress/Port encoding (a1, a2, a3, a4, p1, p2), for sending as a parameter
+                       // to the port command.
+                       StringBuilder sb = new StringBuilder(32);
+                       foreach (byte element in localAddressInBytes) {
+                               sb.Append(element);
+                               sb.Append(',');
+                       }
+                       sb.Append(Port / 256 );
+                       sb.Append(',');
+                       sb.Append(Port % 256 );
+                       return sb.ToString();
+               }
+
+               private string FormatAddressV6(IPAddress address, int port) {
+                       StringBuilder sb = new StringBuilder(43); // based on max size of IPv6 address + port + seperators
+                       String addressString = address.ToString();
+                       sb.Append("|2|");
+                       sb.Append(addressString);
+                       sb.Append('|');
+                       sb.Append(port.ToString(NumberFormatInfo.InvariantInfo));
+                       sb.Append('|');
+                       return sb.ToString();
+               }
+               //
+
                Exception CreateExceptionFromResponse (FtpStatus status)
                {
                        FtpWebResponse ftpResponse = new FtpWebResponse (this, requestUri, method, status);
@@ -932,18 +986,19 @@ namespace System.Net
                Socket InitDataConnection ()
                {
                        FtpStatus status;
-                       
+                       bool ipv6 = remoteEndPoint.AddressFamily == AddressFamily.InterNetworkV6;
+
                        if (usePassive) {
-                               status = SendCommand (PassiveCommand);
-                               if (status.StatusCode != FtpStatusCode.EnteringPassive) {
+                               status = SendCommand (ipv6 ? ExtendedPassiveCommand : PassiveCommand);
+                               if (status.StatusCode != (ipv6 ? (FtpStatusCode)229 : FtpStatusCode.EnteringPassive)) { // FtpStatusCode doesn't contain code 229 for EPSV so we need to cast...
                                        throw CreateExceptionFromResponse (status);
                                }
                                
-                               return SetupPassiveConnection (status.StatusDescription);
+                               return SetupPassiveConnection (status.StatusDescription, ipv6);
                        }
 
                        // Open a socket to listen the server's connection
-                       Socket sock = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                       Socket sock = new Socket (remoteEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
                        try {
                                sock.Bind (new IPEndPoint (localEndPoint.Address, 0));
                                sock.Listen (1); // We only expect a connection from server
@@ -955,12 +1010,10 @@ namespace System.Net
                        }
 
                        IPEndPoint ep = (IPEndPoint) sock.LocalEndPoint;
-                       string ipString = ep.Address.ToString ().Replace ('.', ',');
-                       int h1 = ep.Port >> 8; // ep.Port / 256
-                       int h2 = ep.Port % 256;
 
-                       string portParam = ipString + "," + h1 + "," + h2;
-                       status = SendCommand (PortCommand, portParam);
+                       var portParam = ipv6 ? FormatAddressV6 (ep.Address, ep.Port) : FormatAddress (ep.Address, ep.Port);
+
+                       status = SendCommand (ipv6 ? ExtendedPortCommand : PortCommand, portParam);
                        
                        if (status.StatusCode != FtpStatusCode.CommandOK) {
                                sock.Close ();
index b37b9d30bfb1cdcb3adea83df147d9ac07ada83e..88ae1d361e3f2585816a34c174e8d4c1ed579b90 100644 (file)
@@ -26,6 +26,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Security.Authentication.ExtendedProtection;
 using System.Threading.Tasks;
 
 namespace System.Net {
@@ -33,12 +34,9 @@ namespace System.Net {
        {
                internal const string EXCEPTION_MESSAGE = "System.Net.HttpListener is not supported on the current platform.";
 
-               public HttpListener ()
-               {
-                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
-               }
+               public delegate ExtendedProtectionPolicy ExtendedProtectionSelector (HttpListenerRequest request);
 
-               internal HttpListener (System.Security.Cryptography.X509Certificates.X509Certificate certificate, Mono.Net.Security.IMonoTlsProvider tlsProvider, Mono.Security.Interface.MonoTlsSettings tlsSettings)
+               public HttpListener ()
                {
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
                }
@@ -80,6 +78,27 @@ namespace System.Net {
                        set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                }
 
+               public HttpListenerTimeoutManager TimeoutManager {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public ExtendedProtectionPolicy ExtendedProtectionPolicy
+               {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public ExtendedProtectionSelector ExtendedProtectionSelectorDelegate
+               {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public ServiceNameCollection DefaultServiceNames
+               {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
                public void Abort ()
                {
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
index 4c729de26c4ca7173a4a2b4ea9bc4c667e50d5cc..275d6d4ad14d7df3d47eb3d56b86d5f84d170dbc 100644 (file)
@@ -55,6 +55,11 @@ namespace System.Net {
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
                }
 
+               public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, TimeSpan keepAliveInterval)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
                public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval)
                {
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
index a9c5bb9ee32bb7e7a7208fb5ff68081f11a143de..a12aa233b71643e260d48e1ed79834390f9d6de0 100644 (file)
@@ -370,7 +370,7 @@ namespace System.Net {
                                                return false;
                                        if (InputStream.EndRead (ares) <= 0)
                                                return true;
-                               } catch (ObjectDisposedException e) {
+                               } catch (ObjectDisposedException) {
                                        input_stream = null;
                                        return true;
                                } catch {
index 1d48dfe0b87af4f3729fa0b14caf4dc9558ab373..a57c579250ed33e6f27cb11ad04469840f3a06b3 100644 (file)
@@ -1320,8 +1320,11 @@ namespace System.Net
                                        msg = "Error: " + status;
                                        wex = new WebException (msg, status);
                                } else {
-                                       msg = String.Format ("Error: {0} ({1})", status, exc.Message);
-                                       wex = new WebException (msg, status, WebExceptionInternalStatus.RequestFatal, exc);
+                                       wex = exc as WebException;
+                                       if (wex == null) {
+                                               msg = String.Format ("Error: {0} ({1})", status, exc.Message);
+                                               wex = new WebException (msg, status, WebExceptionInternalStatus.RequestFatal, exc);
+                                       }
                                }
                                r.SetCompleted (false, wex);
                                r.DoCallback ();
index 5fc016498d277eb98522fbdfa334ff4fa096a960..590c82b0bd29ccee9c1565559de387307a0c43bc 100644 (file)
@@ -38,11 +38,6 @@ namespace System.Net
        {
                internal const string EXCEPTION_MESSAGE = "System.Net.HttpWebRequest is not supported on the current platform.";
 
-               internal WebConnection WebConnection {
-                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
-                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
-               }
-
 #if MOBILE
                public
 #else
@@ -72,12 +67,12 @@ namespace System.Net
                        get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                }
 
-               public bool AllowAutoRedirect {
+               public virtual bool AllowAutoRedirect {
                        get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                        set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                }
 
-               public bool AllowWriteStreamBuffering {
+               public virtual bool AllowWriteStreamBuffering {
                        get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                        set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                }
@@ -96,14 +91,6 @@ namespace System.Net
                        get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                }
 
-               internal Mono.Net.Security.IMonoTlsProvider TlsProvider {
-                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
-               }
-
-               internal Mono.Security.Interface.MonoTlsSettings TlsSettings {
-                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
-               }
-
                public X509CertificateCollection ClientCertificates {
                        get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
                        set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
@@ -373,6 +360,11 @@ namespace System.Net
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
                }
 
+               public System.IO.Stream GetRequestStream (out TransportContext context)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
                public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
                {
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
@@ -431,30 +423,5 @@ namespace System.Net
                {
                        throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
                }
-
-               internal void SetWriteStream (WebConnectionStream stream)
-               {
-                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
-               }
-
-               internal void SetResponseData (WebConnectionData data)
-               {
-                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
-               }
-
-               internal void SetResponseError (WebExceptionStatus status, Exception e, string where)
-               {
-                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
-               }
-
-               internal bool ReuseConnection {
-                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
-                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
-               }
-
-               internal WebConnection StoredConnection {
-                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
-                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
-               }
        }
 }
index 9f7daa6c4523b2b5b3e9ef6585d0d19b7d5602d5..5402d58f522a0f413aac15f2dc281e19a66d4827 100644 (file)
@@ -225,7 +225,7 @@ namespace System.Net
                public string Server {
                        get {
                                CheckDisposed ();
-                               return webHeaders ["Server"]
+                               return webHeaders ["Server"] ?? "";
                        }
                }
                
diff --git a/mcs/class/System/System.Net/NetworkCredential.cs b/mcs/class/System/System.Net/NetworkCredential.cs
deleted file mode 100644 (file)
index faba55d..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// System.Net.NetworkCredential.cs
-//
-// Authors: Duncan Mak (duncan@ximian.com)
-//          Rolf Bjarne KVinge (rolf@xamarin.com)
-//          Marek Safar (marek.safar@gmail.com)
-//
-// (C) Ximian, Inc.
-// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
-// Copyright (C) 2011, 2014 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.Security;
-
-namespace System.Net
-{
-       public class NetworkCredential : ICredentials
-                                       , ICredentialsByHost
-       {
-               // Fields
-               string userName;
-               string password;
-               string domain;
-               
-               SecureString securePassword;
-
-               // Constructors
-               public NetworkCredential ()
-               {
-               }
-
-               public NetworkCredential (string userName, string password)
-               {
-                       this.userName = userName;
-                       this.password = password;
-               }
-
-               public NetworkCredential (string userName, string password, string domain)
-                       : this (userName, password)
-               {
-                       this.domain = domain;
-               }
-
-               public NetworkCredential (string userName, SecureString password)
-               {
-                       this.userName = userName;
-                       SecurePassword = password;
-               }
-
-               public NetworkCredential (string userName, SecureString password, string domain)
-                       : this (userName, password)
-               {
-                       this.domain = domain;
-               }
-               // Properties
-
-               public string Domain {
-                       get { return domain ?? String.Empty; }
-                       set { domain = value; }
-               }
-
-               public string UserName {
-                       get { return userName ?? String.Empty; }
-                       set { userName = value; }                       
-               }
-
-               public string Password {
-                       get { return password ?? String.Empty; }
-                       set { password = value; }
-               }
-
-               public SecureString SecurePassword {
-                       get { return securePassword; }
-                       set {
-                               if (value == null) {
-                                       securePassword = new SecureString ();
-                               } else {
-                                       securePassword = value;
-                               }
-                       }
-               }
-
-               public NetworkCredential GetCredential (Uri uri, string authType)
-               {
-                       return this;
-               }
-
-               public NetworkCredential GetCredential (string host, int port, string authenticationType)
-               {
-                       return this;
-               }
-       }
-}
index 6a47f40ae2a3cf823bfda8923e86cb2a7334e2f1..03993e989590fdf086917fa523d314b1dfa6d68d 100644 (file)
@@ -97,7 +97,7 @@ namespace System.Net {
                                                        InternalWrite (bytes, 0, bytes.Length);
                                                        trailer_sent = true;
                                                }
-                                       } catch (IOException ex) {
+                                       } catch (IOException) {
                                                // Ignore error due to connection reset by peer
                                        }
                                }
diff --git a/mcs/class/System/System.Net/ServicePoint.platformnotsupported.cs b/mcs/class/System/System.Net/ServicePoint.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..d744a55
--- /dev/null
@@ -0,0 +1,127 @@
+//
+// ServicePoint.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Net.Sockets;
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.Net
+{
+       public class ServicePoint
+       {
+               const string EXCEPTION_MESSAGE = "System.Net.ServicePoint is not supported on the current platform.";
+
+               ServicePoint () {}
+
+               public Uri Address {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               static Exception GetMustImplement ()
+               {
+                       return new NotImplementedException ();
+               }
+
+               public BindIPEndPoint BindIPEndPointDelegate
+               {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ConnectionLeaseTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ConnectionLimit {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public string ConnectionName {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int CurrentConnections {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public DateTime IdleSince {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int MaxIdleTime {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public virtual Version ProtocolVersion {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public int ReceiveBufferSize {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool SupportsPipelining {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool Expect100Continue {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public bool UseNagleAlgorithm {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public void SetTcpKeepAlive (bool enabled, int keepAliveTime, int keepAliveInterval)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public bool CloseConnectionGroup (string connectionGroupName)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public  X509Certificate Certificate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public  X509Certificate ClientCertificate {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               // For reference source
+               internal Socket GetConnection(PooledStream PooledStream, object owner, bool async, out IPAddress address, ref Socket abortSocket, ref Socket abortSocket6)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
index d379526e80b9cb0510bd1619ad782d4d339d5fa3..56d682bd402541a3c79e35f0bcc17c1922525f86 100644 (file)
@@ -158,7 +158,10 @@ namespace System.Net
                                return;
                        }
 #endif
+
+#pragma warning disable 618
                        manager = (ConnectionManagementData) ConfigurationSettings.GetConfig (configKey);
+#pragma warning restore 618
                        if (manager != null) {
                                defaultConnectionLimit = (int) manager.GetMaxConnections ("*");                         
                        }
diff --git a/mcs/class/System/System.Net/ServicePointManager.platformnotsupported.cs b/mcs/class/System/System.Net/ServicePointManager.platformnotsupported.cs
new file mode 100644 (file)
index 0000000..49c02e5
--- /dev/null
@@ -0,0 +1,129 @@
+//
+// ServicePointManager.cs
+//
+// Author:
+//       Rolf Bjarne Kvinge <rolf@xamarin.com>
+//
+// Copyright (c) 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.Net.Security;
+
+namespace System.Net
+{
+       public partial class ServicePointManager {
+               const string EXCEPTION_MESSAGE = "System.Net.ServicePointManager is not supported on the current platform.";
+
+               public const int DefaultNonPersistentConnectionLimit = 4;
+#if MOBILE
+               public const int DefaultPersistentConnectionLimit = 10;
+#else
+               public const int DefaultPersistentConnectionLimit = 2;
+#endif
+
+               private ServicePointManager ()
+               {
+               }
+
+               public static ICertificatePolicy CertificatePolicy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static bool CheckCertificateRevocationList {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static int DefaultConnectionLimit {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static int DnsRefreshTimeout {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static bool EnableDnsRoundRobin {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static int MaxServicePointIdleTime {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static int MaxServicePoints {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static bool ReusePort {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static SecurityProtocolType SecurityProtocol {
+                       get;
+                       set;
+               } = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
+
+               public static RemoteCertificateValidationCallback ServerCertificateValidationCallback {
+                       get;
+                       set;
+               }
+
+               public static EncryptionPolicy EncryptionPolicy {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static bool Expect100Continue {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static bool UseNagleAlgorithm {
+                       get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+                       set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
+               }
+
+               public static void SetTcpKeepAlive (bool enabled, int keepAliveTime, int keepAliveInterval)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static ServicePoint FindServicePoint (Uri address)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static ServicePoint FindServicePoint (string uriString, IWebProxy proxy)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+
+               public static ServicePoint FindServicePoint (Uri address, IWebProxy proxy)
+               {
+                       throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
+               }
+       }
+}
index c1bd5271adf78ba7dbb25aac7638d8cb7a676378..0a36e21004943427b937884ef9993d703c7a2c9c 100644 (file)
@@ -83,7 +83,6 @@ namespace System.Net
                HttpWebRequest connect_request;
 
                Exception connect_exception;
-               static object classLock = new object ();
                MonoTlsStream tlsStream;
 
 #if MONOTOUCH && !MONOTOUCH_TV && !MONOTOUCH_WATCH
@@ -257,14 +256,16 @@ namespace System.Net
                                        connect_request.Credentials = creds;
                                }
 
-                               for (int i = 0; i < challenge.Length; i++) {
-                                       var auth = AuthenticationManager.Authenticate (challenge [i], connect_request, creds);
-                                       if (auth == null)
-                                               continue;
-                                       ntlm = (auth.ModuleAuthenticationType == "NTLM");
-                                       sb.Append ("\r\nProxy-Authorization: ");
-                                       sb.Append (auth.Message);
-                                       break;
+                               if (creds != null) {
+                                       for (int i = 0; i < challenge.Length; i++) {
+                                               var auth = AuthenticationManager.Authenticate (challenge [i], connect_request, creds);
+                                               if (auth == null)
+                                                       continue;
+                                               ntlm = (auth.ModuleAuthenticationType == "NTLM");
+                                               sb.Append ("\r\nProxy-Authorization: ");
+                                               sb.Append (auth.Message);
+                                               break;
+                                       }
                                }
                        }
 
@@ -292,11 +293,14 @@ namespace System.Net
                                }
 
                                Data.StatusCode = status;
-                               Data.Challenge = result.GetValues ("Proxy-Authentic");
+                               Data.Challenge = result.GetValues ("Proxy-Authenticate");
+                               Data.Headers = result;
                                return false;
-                       } else if (status != 200) {
-                               string msg = String.Format ("The remote server returned a {0} status code.", status);
-                               HandleError (WebExceptionStatus.SecureChannelFailure, null, msg);
+                       }
+
+                       if (status != 200) {
+                               Data.StatusCode = status;
+                               Data.Headers = result;
                                return false;
                        }
 
@@ -368,6 +372,9 @@ namespace System.Net
                                        }
 
                                        status = (int)UInt32.Parse (parts [1]);
+                                       if (parts.Length >= 3)
+                                               Data.StatusDescription = String.Join (" ", parts, 2, parts.Length - 2);
+
                                        gotStatus = true;
                                }
                        }
@@ -738,7 +745,11 @@ namespace System.Net
                                Exception cnc_exc = connect_exception;
                                if (cnc_exc == null && (Data.StatusCode == 401 || Data.StatusCode == 407)) {
                                        st = WebExceptionStatus.ProtocolError;
-                                       cnc_exc = new WebException (Data.StatusCode == 407 ? "(407) Proxy Authentication Required" : "(401) Unauthorized" , st);
+                                       if (Data.Headers == null)
+                                               Data.Headers = new WebHeaderCollection ();
+
+                                       var webResponse = new HttpWebResponse (sPoint.Address, "CONNECT", Data, null);
+                                       cnc_exc = new WebException (Data.StatusCode == 407 ? "(407) Proxy Authentication Required" : "(401) Unauthorized", null, st, webResponse);
                                }
                        
                                connect_exception = null;
index ac6db80037dfe506d1b2da49ad07c8196424eb33..2d7dd557095b3061703d872fd14f33aeff1e6d2f 100644 (file)
@@ -133,7 +133,7 @@ namespace System.Security.AccessControl
                        SetAuditRule((AuditRule)rule);
                }
                
-               internal new void Persist (SafeHandle handle)
+               internal void Persist (SafeHandle handle)
                {
                        WriteLock();
                        try {
index b26263a75a5a788c510fce489e1f4708a4926d56..6f5cf7042b012493e7030fb6188bc69bf1f6cbee 100644 (file)
@@ -146,7 +146,7 @@ namespace System.Security.Cryptography.X509Certificates {
 
                                certArray = FromIntPtrs (secCerts);
 
-                               if (!string.IsNullOrEmpty (hostName))
+                               if (hostName != null)
                                        host = CFStringCreateWithCharacters (IntPtr.Zero, hostName, (IntPtr) hostName.Length);
                                sslsecpolicy = SecPolicyCreateSSL (true, host);
 
index 795f0d04b21acfabb51a09db288cfa3ccfecd274..78a87057ce7e65b89198e52ddbd940bd4c514246 100644 (file)
@@ -124,7 +124,6 @@ namespace System.Security.Cryptography.X509Certificates {
                }
 
                internal X500DistinguishedName (byte[] encoded, byte[] canonEncoding, string name)
-                       : this (encoded)
                {
                        this.canonEncoding = canonEncoding;
                        this.name = name;
@@ -234,7 +233,7 @@ namespace System.Security.Cryptography.X509Certificates {
                                if (name1.canonEncoding.Length != name2.canonEncoding.Length)
                                        return false;
                                for (int i = 0; i < name1.canonEncoding.Length; i++) {
-                                       if (name1.canonEncoding[i] != name2.canonEncoding[2])
+                                       if (name1.canonEncoding[i] != name2.canonEncoding[i])
                                                return false;
                                }
                                return true;
index bd69c786b89b80f947a56046fa9d7eb45411e291..ef10413f59722853150a79935cca076d7e1fbcae 100644 (file)
@@ -399,13 +399,10 @@ namespace System.Security.Cryptography.X509Certificates {
                // internal stuff because X509Certificate2 isn't complete enough
                // (maybe X509Certificate3 will be better?)
 
-               [Obsolete ("KILL")]
+               [MonoTODO ("See comment in X509Helper2.GetMonoCertificate().")]
                internal MX.X509Certificate MonoCertificate {
                        get {
-                               var monoImpl = Impl as X509Certificate2ImplMono;
-                               if (monoImpl == null)
-                                       throw new NotSupportedException ();
-                               return monoImpl.MonoCertificate;
+                               return X509Helper2.GetMonoCertificate (this);
                        }
                }
 
index 234d0907f2dbcaedf74a722b331e2083aaebf8af..38797d55fcee583b75ca47f09158b8dea078a3dd 100644 (file)
@@ -71,6 +71,10 @@ namespace System.Security.Cryptography.X509Certificates
                        get;
                }
 
+               internal abstract X509Certificate2Impl FallbackImpl {
+                       get;
+               }
+
                public abstract string GetNameInfo (X509NameType nameType, bool forIssuer);
 
                public abstract void Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags);
index cdc14c49eb13e2d2479c961ce8e9a4a4243ce484..ff2449906de7c2f8a45bb405397aed669f6e557e 100644 (file)
@@ -52,7 +52,6 @@ namespace System.Security.Cryptography.X509Certificates
        {
                bool _archived;
                X509ExtensionCollection _extensions;
-               string _serial;
                PublicKey _publicKey;
                X500DistinguishedName issuer_name;
                X500DistinguishedName subject_name;
@@ -483,6 +482,7 @@ namespace System.Security.Cryptography.X509Certificates
                [MonoTODO ("missing KeyStorageFlags support")]
                public override void Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
                {
+                       Reset ();
                        MX.X509Certificate cert = null;
                        if (password == null) {
                                try {
@@ -558,7 +558,6 @@ namespace System.Security.Cryptography.X509Certificates
                        _cert = null;
                        _archived = false;
                        _extensions = null;
-                       _serial = null;
                        _publicKey = null;
                        issuer_name = null;
                        subject_name = null;
@@ -718,6 +717,10 @@ namespace System.Security.Cryptography.X509Certificates
                internal MX.X509Certificate MonoCertificate {
                        get { return _cert; }
                }
+
+               internal override X509Certificate2Impl FallbackImpl {
+                       get { return this; }
+               }
        }
 }
 
index 0ea1c8e9b06ab45d4c27b716de5b7fcdea4c1e4b..a3323c8ef0c4b7d15a57dc0220289d54a6c58296 100644 (file)
@@ -47,8 +47,6 @@ namespace System.Security.Cryptography.X509Certificates {
 
                X509ChainImpl impl;
 
-               static X509ChainStatus[] Empty = new X509ChainStatus [0];
-
                internal X509ChainImpl Impl {
                        get {
                                X509Helper2.ThrowIfContextInvalid (impl);
index 1dc234575b86a3cb6806c7b471f8d0ba8ec9f694..2fcdd982f33366e8b1b163a1aa178947232fbd74 100644 (file)
@@ -91,6 +91,9 @@ namespace System.Security.Cryptography.X509Certificates {
                                }
                                return store2;
                        }
+                       internal set {
+                               store2 = value;
+                       }
                }
 
                public X509RevocationFlag RevocationFlag {
index 2a9163a346f89ae143e7477b9215c67659f5e875..7d0b3d1487cda4b4b5a74edbc957997fa56556f1 100644 (file)
@@ -33,14 +33,57 @@ extern alias MonoSecurity;
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;
+using MX = MonoSecurity::Mono.Security.X509;
 #else
+#if MONO_FEATURE_BTLS
 using Mono.Security.Interface;
 #endif
+using MX = Mono.Security.X509;
+#endif
+
+#if MONO_FEATURE_BTLS
+using Mono.Btls;
+#endif
+#endif
+
+using System.IO;
+using System.Text;
 
 namespace System.Security.Cryptography.X509Certificates
 {
        internal static class X509Helper2
        {
+               internal static long GetSubjectNameHash (X509Certificate certificate)
+               {
+                       return GetSubjectNameHash (certificate.Impl);
+               }
+
+               internal static long GetSubjectNameHash (X509CertificateImpl impl)
+               {
+#if SECURITY_DEP
+                       using (var x509 = GetNativeInstance (impl))
+                               return GetSubjectNameHash (x509);
+#else
+                       throw new NotSupportedException ();
+#endif
+               }
+
+               internal static void ExportAsPEM (X509Certificate certificate, Stream stream, bool includeHumanReadableForm)
+               {
+                       ExportAsPEM (certificate.Impl, stream, includeHumanReadableForm);
+               }
+
+               internal static void ExportAsPEM (X509CertificateImpl impl, Stream stream, bool includeHumanReadableForm)
+               {
+#if SECURITY_DEP
+                       using (var x509 = GetNativeInstance (impl))
+                               ExportAsPEM (x509, stream, includeHumanReadableForm);
+#else
+                       throw new NotSupportedException ();
+#endif
+               }
+
+#if SECURITY_DEP
                internal static void Initialize ()
                {
                        X509Helper.InstallNativeHelper (new MyNativeHelper ());
@@ -51,32 +94,90 @@ namespace System.Security.Cryptography.X509Certificates
                        X509Helper.ThrowIfContextInvalid (impl);
                }
 
-               internal static X509Certificate2Impl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags)
+#if !MONO_FEATURE_BTLS
+               static X509Certificate GetNativeInstance (X509CertificateImpl impl)
+               {
+                       throw new PlatformNotSupportedException ();
+               }
+#else
+               static MonoBtlsX509 GetNativeInstance (X509CertificateImpl impl)
                {
-                       var provider = MonoTlsProviderFactory.GetProvider ();
-                       if (provider.HasNativeCertificates) {
-                               var impl = provider.GetNativeCertificate (rawData, password, keyStorageFlags);
-                               return impl;
-                       } else {
-                               var impl = new X509Certificate2ImplMono ();
-                               impl.Import (rawData, password, keyStorageFlags);
-                               return impl;
+                       ThrowIfContextInvalid (impl);
+                       var btlsImpl = impl as X509CertificateImplBtls;
+                       if (btlsImpl != null)
+                               return btlsImpl.X509.Copy ();
+                       else
+                               return MonoBtlsX509.LoadFromData (impl.GetRawCertData (), MonoBtlsX509Format.DER);
+               }
+
+               internal static long GetSubjectNameHash (MonoBtlsX509 x509)
+               {
+                       using (var subject = x509.GetSubjectName ())
+                               return subject.GetHash ();
+               }
+
+               internal static void ExportAsPEM (MonoBtlsX509 x509, Stream stream, bool includeHumanReadableForm)
+               {
+                       using (var bio = MonoBtlsBio.CreateMonoStream (stream)) {
+                               x509.ExportAsPEM (bio, includeHumanReadableForm);
+                       }
+               }
+#endif // !MONO_FEATURE_BTLS
+
+               internal static X509Certificate2Impl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags, bool disableProvider = false)
+               {
+#if MONO_FEATURE_BTLS
+                       if (!disableProvider) {
+                               var provider = MonoTlsProviderFactory.GetProvider ();
+                               if (provider.HasNativeCertificates) {
+                                       var impl = provider.GetNativeCertificate (rawData, password, keyStorageFlags);
+                                       return impl;
+                               }
                        }
+#endif // MONO_FEATURE_BTLS
+                       var impl2 = new X509Certificate2ImplMono ();
+                       impl2.Import (rawData, password, keyStorageFlags);
+                       return impl2;
                }
 
-               internal static X509Certificate2Impl Import (X509Certificate cert)
+               internal static X509Certificate2Impl Import (X509Certificate cert, bool disableProvider = false)
                {
-                       var provider = MonoTlsProviderFactory.GetProvider ();
-                       if (provider.HasNativeCertificates) {
-                               var impl = provider.GetNativeCertificate (cert);
-                               return impl;
+#if MONO_FEATURE_BTLS
+                       if (!disableProvider) {
+                               var provider = MonoTlsProviderFactory.GetProvider ();
+                               if (provider.HasNativeCertificates) {
+                                       var impl = provider.GetNativeCertificate (cert);
+                                       return impl;
+                               }
                        }
+#endif // MONO_FEATURE_BTLS
                        var impl2 = cert.Impl as X509Certificate2Impl;
                        if (impl2 != null)
                                return (X509Certificate2Impl)impl2.Clone ();
                        return Import (cert.GetRawCertData (), null, X509KeyStorageFlags.DefaultKeySet);
                }
 
+               /*
+                * This is used by X509ChainImplMono
+                * 
+                * Some of the missing APIs such as X509v3 extensions can be added to the native
+                * BTLS implementation.
+                * 
+                * We should also consider replacing X509ChainImplMono with a new X509ChainImplBtls
+                * at some point.
+                */
+               [MonoTODO ("Investigate replacement; see comments in source.")]
+               internal static MX.X509Certificate GetMonoCertificate (X509Certificate2 certificate)
+               {
+                       var impl2 = certificate.Impl as X509Certificate2Impl;
+                       if (impl2 == null)
+                               impl2 = Import (certificate, true);
+                       var fallbackImpl = impl2.FallbackImpl as X509Certificate2ImplMono;
+                       if (fallbackImpl == null)
+                               throw new NotSupportedException ();
+                       return fallbackImpl.MonoCertificate;
+               }
+
                internal static X509ChainImpl CreateChainImpl (bool useMachineContext)
                {
                        return new X509ChainImplMono (useMachineContext);
@@ -111,6 +212,6 @@ namespace System.Security.Cryptography.X509Certificates
                                return X509Helper2.Import (cert);
                        }
                }
+#endif
        }
 }
-#endif
index 0e6fc9187a98e2c237a73f44de1789c8bcd8e722..d404a646402a9b9cc3738de38e4b90cc26c518c8 100644 (file)
@@ -161,7 +161,7 @@ System.Diagnostics/TraceImpl.cs
 System.Diagnostics/TraceSourceInfo.cs
 System.Diagnostics/Win32EventLog.cs
 System/Platform.cs
-System/MonoExeLocator.cs
+System/MonoToolsLocator.cs
 System.IO.Compression/CompressionLevel.cs
 System.IO.Compression/CompressionMode.cs
 System.IO.Compression/DeflateStream.cs
@@ -337,7 +337,6 @@ System.Net.Mail/SmtpStatusCode.cs
 System.Net/MacProxy.cs
 System.Net/MonoHttpDate.cs
 System.Net/NetConfig.cs
-System.Net/NetworkCredential.cs
 System.Net.NetworkInformation/IcmpV4Statistics.cs
 System.Net.NetworkInformation/IcmpV6Statistics.cs
 System.Net.NetworkInformation/IPAddressCollection.cs
@@ -375,36 +374,14 @@ System.Net/ServicePointManager.extra.cs
 System.Net/SimpleAsyncResult.cs
 System.Net/SocketPermissionAttribute.cs
 System.Net/SocketPermission.cs
-../referencesource/System/net/System/Net/Sockets/AddressFamily.cs
-../referencesource/System/net/System/Net/Sockets/IOControlCode.cs
-../referencesource/System/net/System/Net/Sockets/IPPacketInformation.cs
-../referencesource/System/net/System/Net/Sockets/LingerOption.cs
-../referencesource/System/net/System/Net/Sockets/MulticastOption.cs
-../referencesource/System/net/System/Net/Sockets/ProtocolFamily.cs
-../referencesource/System/net/System/Net/Sockets/ProtocolType.cs
 System.Net.Sockets/SafeSocketHandle.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
-../referencesource/System/net/System/Net/Sockets/SocketErrors.cs
-../referencesource/System/net/System/Net/SocketException.cs
-../referencesource/System/net/System/Net/Sockets/SocketFlags.cs
-../referencesource/System/net/System/Net/Sockets/SocketInformation.cs
-../referencesource/System/net/System/Net/Sockets/SocketInformationOptions.cs
 System.Net.Sockets/SocketOperation.cs
-../referencesource/System/net/System/Net/Sockets/SocketOptionLevel.cs
-../referencesource/System/net/System/Net/Sockets/SocketOptionName.cs
-../referencesource/System/net/System/Net/Sockets/SocketShutdown.cs
-../referencesource/System/net/System/Net/Sockets/SocketType.cs
-System.Net.Sockets/TcpClient.cs
-System.Net.Sockets/TcpListener.cs
-../referencesource/System/net/System/Net/Sockets/TransmitFileFlags.cs
-System.Net.Sockets/UdpClient.cs
-../referencesource/System/net/System/Net/Sockets/UdpReceiveResult.cs
+System.Net.Sockets/SocketReceiveFromResult.cs
+System.Net.Sockets/SocketReceiveMessageFromResult.cs
+System.Net.Sockets/SocketTaskExtensions.cs
 System.Net/WebAsyncResult.cs
 System.Net/WebConnection.cs
 System.Net/WebConnectionData.cs
@@ -538,6 +515,44 @@ System.Windows.Input/ICommand.cs
 
 System/IOSelector.cs
 
+Mono.Btls/MonoBtlsBio.cs
+Mono.Btls/MonoBtlsContext.cs
+Mono.Btls/MonoBtlsError.cs
+Mono.Btls/MonoBtlsException.cs
+Mono.Btls/MonoBtlsKey.cs
+Mono.Btls/MonoBtlsObject.cs
+Mono.Btls/MonoBtlsPkcs12.cs
+Mono.Btls/MonoBtlsProvider.cs
+Mono.Btls/MonoBtlsSsl.cs
+Mono.Btls/MonoBtlsSslCtx.cs
+Mono.Btls/MonoBtlsSslError.cs
+Mono.Btls/MonoBtlsStream.cs
+Mono.Btls/MonoBtlsUtils.cs
+Mono.Btls/MonoBtlsX509.cs
+Mono.Btls/MonoBtlsX509Chain.cs
+Mono.Btls/MonoBtlsX509Crl.cs
+Mono.Btls/MonoBtlsX509Error.cs
+Mono.Btls/MonoBtlsX509Exception.cs
+Mono.Btls/MonoBtlsX509FileType.cs
+Mono.Btls/MonoBtlsX509Format.cs
+Mono.Btls/MonoBtlsX509Lookup.cs
+Mono.Btls/MonoBtlsX509LookupMonoCollection.cs
+Mono.Btls/MonoBtlsX509LookupMono.cs
+Mono.Btls/MonoBtlsX509LookupType.cs
+Mono.Btls/MonoBtlsX509Name.cs
+Mono.Btls/MonoBtlsX509NameEntryType.cs
+Mono.Btls/MonoBtlsX509Purpose.cs
+Mono.Btls/MonoBtlsX509Revoked.cs
+Mono.Btls/MonoBtlsX509Store.cs
+Mono.Btls/MonoBtlsX509StoreCtx.cs
+Mono.Btls/MonoBtlsX509StoreManager.cs
+Mono.Btls/MonoBtlsX509StoreType.cs
+Mono.Btls/MonoBtlsX509TrustKind.cs
+Mono.Btls/MonoBtlsX509VerifyFlags.cs
+Mono.Btls/MonoBtlsX509VerifyParam.cs
+Mono.Btls/X509CertificateImplBtls.cs
+Mono.Btls/X509ChainImplBtls.cs
+
 Mono.Net.Security/AsyncProtocolRequest.cs
 Mono.Net.Security/CallbackHelpers.cs
 Mono.Net.Security/ChainValidationHelper.cs
@@ -568,6 +583,7 @@ ReferenceSources/Logging.cs
 ReferenceSources/NativeMethods.cs
 ReferenceSources/RequestCacheProtocol.cs
 ReferenceSources/SettingsSectionInternal.cs
+ReferenceSources/SecureStringHelper.cs
 ReferenceSources/Socket.cs
 ReferenceSources/SR.cs
 ReferenceSources/SR2.cs
@@ -1007,6 +1023,7 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/net/System/Net/IWebProxyFinder.cs
 ../referencesource/System/net/System/Net/IWebRequestCreate.cs
 ../referencesource/System/net/System/Net/NetworkAccess.cs
+../referencesource/System/net/System/Net/NetworkCredential.cs
 ../referencesource/System/net/System/Net/ProtocolViolationException.cs
 ../referencesource/System/net/System/Net/TransportContext.cs
 ../referencesource/System/net/System/Net/TransportType.cs
@@ -1014,6 +1031,7 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/net/System/Net/UnicodeEncodingConformance.cs
 ../referencesource/System/net/System/Net/ServicePointManager.cs
 ../referencesource/System/net/System/Net/SocketAddress.cs
+../referencesource/System/net/System/Net/SocketException.cs
 ../referencesource/System/net/System/Net/webclient.cs
 ../referencesource/System/net/System/Net/WebException.cs
 ../referencesource/System/net/System/Net/WebExceptionStatus.cs
@@ -1033,8 +1051,31 @@ ReferenceSources/Win32Exception.cs
 
 ../referencesource/System/net/System/Net/Configuration/DefaultProxySection.cs
 
+../referencesource/System/net/System/Net/Sockets/_MultipleConnectAsync.cs
+../referencesource/System/net/System/Net/Sockets/AddressFamily.cs
+../referencesource/System/net/System/Net/Sockets/IOControlCode.cs
+../referencesource/System/net/System/Net/Sockets/IPPacketInformation.cs
 ../referencesource/System/net/System/Net/Sockets/IPProtectionLevel.cs
+../referencesource/System/net/System/Net/Sockets/LingerOption.cs
+../referencesource/System/net/System/Net/Sockets/MulticastOption.cs
 ../referencesource/System/net/System/Net/Sockets/NetworkStream.cs
+../referencesource/System/net/System/Net/Sockets/ProtocolFamily.cs
+../referencesource/System/net/System/Net/Sockets/ProtocolType.cs
+../referencesource/System/net/System/Net/Sockets/SelectMode.cs
+../referencesource/System/net/System/Net/Sockets/Socket.cs
+../referencesource/System/net/System/Net/Sockets/SocketErrors.cs
+../referencesource/System/net/System/Net/Sockets/SocketFlags.cs
+../referencesource/System/net/System/Net/Sockets/SocketInformation.cs
+../referencesource/System/net/System/Net/Sockets/SocketInformationOptions.cs
+../referencesource/System/net/System/Net/Sockets/SocketOptionLevel.cs
+../referencesource/System/net/System/Net/Sockets/SocketOptionName.cs
+../referencesource/System/net/System/Net/Sockets/SocketShutdown.cs
+../referencesource/System/net/System/Net/Sockets/SocketType.cs
+../referencesource/System/net/System/Net/Sockets/TCPClient.cs
+../referencesource/System/net/System/Net/Sockets/TCPListener.cs
+../referencesource/System/net/System/Net/Sockets/TransmitFileFlags.cs
+../referencesource/System/net/System/Net/Sockets/UdpReceiveResult.cs
+../referencesource/System/net/System/Net/Sockets/UDPClient.cs
 
 ../referencesource/System/net/System/Net/NetworkInformation/DuplicateAddressDetectionState.cs
 ../referencesource/System/net/System/Net/NetworkInformation/GatewayIPAddressInformation.cs
@@ -1068,7 +1109,6 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/net/System/Net/NetworkInformation/SystemGatewayIPAddressInformation.cs
 ../referencesource/System/net/System/Net/NetworkInformation/SystemIPAddressInformation.cs
 ../referencesource/System/net/System/Net/NetworkInformation/SystemMulticastIPAddressInformation.cs
-../referencesource/System/net/System/Net/NetworkInformation/SystemUnicastIPAddressInformation.cs
 ../referencesource/System/net/System/Net/NetworkInformation/SystemTcpConnection.cs
 ../referencesource/System/net/System/Net/NetworkInformation/TcpConnection.cs
 ../referencesource/System/net/System/Net/NetworkInformation/TcpState.cs
index 1f010668d722f454e024aecb54db05e68905f3a6..dc4f4aaa54ec0200a97c579834cc1af691bc7012 100644 (file)
@@ -33,6 +33,9 @@ using System.Net.Security;
 using System.Security.Cryptography.X509Certificates;
 #if SECURITY_DEP
 using MSX = Mono.Security.X509;
+#if MONO_FEATURE_BTLS
+using Mono.Btls;
+#endif
 #endif
 
 namespace System {
@@ -43,6 +46,7 @@ namespace System {
                
 #if SECURITY_DEP
                static readonly Converter<List <byte[]>, bool> trustEvaluateSsl;
+               static readonly Func<long, bool, byte[]> certStoreLookup;
 #endif  // SECURITY_DEP
                static readonly Func<IWebProxy> getDefaultProxy;
                static readonly GetInterfaceAddressesDelegate getInterfaceAddresses;
@@ -58,6 +62,14 @@ namespace System {
                                                        "TrustEvaluateSsl",
                                                        ignoreCase:false,
                                                        throwOnBindFailure:true);
+#if MONO_FEATURE_BTLS
+                       certStoreLookup = (Func<long, bool, byte[]>)
+                               Delegate.CreateDelegate (typeof (Func<long, bool, byte[]>),
+                                                       t,
+                                                       "CertStoreLookup",
+                                                       ignoreCase:false,
+                                                       throwOnBindFailure:true);
+#endif  // MONO_FEATURE_BTLS
 #endif  // SECURITY_DEP
                        getDefaultProxy = (Func<IWebProxy>)Delegate.CreateDelegate (
                                typeof (Func<IWebProxy>), t, "GetDefaultProxy",
@@ -83,6 +95,26 @@ namespace System {
                                certsRawData.Add (cert.GetRawCertData ());
                        return trustEvaluateSsl (certsRawData);
                }
+
+#if MONO_FEATURE_BTLS
+               internal static MonoBtlsX509 CertStoreLookup (MonoBtlsX509Name name)
+               {
+                       var hash = name.GetHash ();
+                       var hashOld = name.GetHashOld ();
+                       var result = certStoreLookup (hash, false);
+                       if (result == null)
+                               result = certStoreLookup (hashOld, false);
+                       if (result == null)
+                               result = certStoreLookup (hash, true);
+                       if (result == null)
+                               result = certStoreLookup (hashOld, true);
+
+                       if (result == null)
+                               return null;
+
+                       return MonoBtlsX509.LoadFromData (result, MonoBtlsX509Format.DER);
+               }
+#endif  // MONO_FEATURE_BTLS
 #endif  // SECURITY_DEP
 
                internal static IWebProxy GetDefaultProxy ()
diff --git a/mcs/class/System/System/MonoExeLocator.cs b/mcs/class/System/System/MonoExeLocator.cs
deleted file mode 100755 (executable)
index 4ab1b33..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#if !MOBILE
-
-using System.Diagnostics;
-using System.IO;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-namespace System {
-
-       static class MonoToolsLocator
-       {
-               public static readonly string Mono;
-               public static readonly string CSharpCompiler;
-               public static readonly string VBCompiler;
-               public static readonly string AssemblyLinker;
-
-               // TODO: Should be lazy
-               static MonoToolsLocator ()
-               {
-                       var gac = typeof (Environment).GetProperty ("GacPath", BindingFlags.Static | BindingFlags.NonPublic);
-                       var getGacMethod = gac.GetGetMethod (true);
-                       var GacPath = Path.GetDirectoryName ((string) getGacMethod.Invoke (null, null));
-
-                       if (Path.DirectorySeparatorChar == '\\') {
-                               string processExe = Process.GetCurrentProcess ().MainModule.FileName;
-                               if (processExe != null) {
-                                       string fileName = Path.GetFileName (processExe);
-                                       if (fileName.StartsWith ("mono") && fileName.EndsWith (".exe"))
-                                               Mono = processExe;
-                               }
-
-                               if (!File.Exists (Mono))
-                                       Mono = Path.Combine (
-                                               Path.GetDirectoryName (
-                                                       Path.GetDirectoryName (GacPath)),
-                                               "bin\\mono.exe");
-
-                               if (!File.Exists (Mono))
-                                       Mono = Path.Combine (
-                                               Path.GetDirectoryName (
-                                                       Path.GetDirectoryName (
-                                                               Path.GetDirectoryName (GacPath))),
-                                               "mono\\mini\\mono.exe");
-
-                               //if (!File.Exists (Mono))
-                               //      throw new FileNotFoundException ("Windows mono path not found: " + Mono);
-
-                               CSharpCompiler = Path.Combine (GacPath, "4.5\\mcs.exe");
-                               if (!File.Exists (CSharpCompiler))
-                                       CSharpCompiler = Path.Combine (Path.GetDirectoryName (GacPath), "lib\\build\\mcs.exe");
-
-                               //if (!File.Exists (CSharpCompiler))
-                               //      throw new FileNotFoundException ("C# compiler not found at " + CSharpCompiler);
-
-                               VBCompiler = Path.Combine (GacPath,  "4.5\\vbnc.exe");
-                               AssemblyLinker = Path.Combine (GacPath, "4.5\\al.exe");
-
-                               if (!File.Exists (AssemblyLinker)) {
-                                       AssemblyLinker = Path.Combine (Path.GetDirectoryName (GacPath), "lib\\net_4_x\\al.exe");
-                               //      if (!File.Exists (AssemblyLinker))
-                               //              throw new FileNotFoundException ("Windows al path not found: " + AssemblyLinker);
-                               }
-                       } else {
-                               Mono = Path.Combine (GacPath, "bin", "mono");
-                               if (!File.Exists (Mono))
-                                       Mono = "mono";
-
-                               var mscorlibPath = new Uri (typeof (object).Assembly.CodeBase).LocalPath;
-                               CSharpCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "mcs"));
-                               if (!File.Exists (CSharpCompiler))
-                                       CSharpCompiler = "mcs";
-
-                               VBCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "vbnc"));
-                               if (!File.Exists (VBCompiler))
-                                       VBCompiler = "vbnc";
-
-                               AssemblyLinker = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "al"));
-                               if (!File.Exists (AssemblyLinker))
-                                       AssemblyLinker = "al";
-                       }
-               }
-       }
-}
-
-#endif
diff --git a/mcs/class/System/System/MonoToolsLocator.cs b/mcs/class/System/System/MonoToolsLocator.cs
new file mode 100755 (executable)
index 0000000..5443395
--- /dev/null
@@ -0,0 +1,96 @@
+#if !MOBILE
+
+using System.Diagnostics;
+using System.IO;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace System {
+
+       static class MonoToolsLocator
+       {
+               public static readonly string Mono;
+               public static readonly string CSharpCompiler;
+               public static readonly string VBCompiler;
+               public static readonly string AssemblyLinker;
+
+               // TODO: Should be lazy
+               static MonoToolsLocator ()
+               {
+                       var gac = typeof (Environment).GetProperty ("GacPath", BindingFlags.Static | BindingFlags.NonPublic);
+                       var getGacMethod = gac.GetGetMethod (true);
+                       var GacPath = Path.GetDirectoryName ((string) getGacMethod.Invoke (null, null));
+
+                       if (Path.DirectorySeparatorChar == '\\') {
+                               StringBuilder moduleName = new StringBuilder (1024);
+                               GetModuleFileName (IntPtr.Zero, moduleName, moduleName.Capacity);
+                               string processExe = moduleName.ToString ();
+                               string fileName = Path.GetFileName (processExe);
+                               if (fileName.StartsWith ("mono") && fileName.EndsWith (".exe"))
+                                       Mono = processExe;
+
+                               if (!File.Exists (Mono))
+                                       Mono = Path.Combine (
+                                               Path.GetDirectoryName (
+                                                       Path.GetDirectoryName (GacPath)),
+                                               "bin\\mono.exe");
+
+                               if (!File.Exists (Mono))
+                                       Mono = Path.Combine (
+                                               Path.GetDirectoryName (
+                                                       Path.GetDirectoryName (
+                                                               Path.GetDirectoryName (GacPath))),
+                                               "mono\\mini\\mono.exe");
+
+                               //if (!File.Exists (Mono))
+                               //      throw new FileNotFoundException ("Windows mono path not found: " + Mono);
+
+                               CSharpCompiler = Path.Combine (GacPath, "4.5\\mcs.exe");
+                               if (!File.Exists (CSharpCompiler))
+                                       CSharpCompiler = Path.Combine (Path.GetDirectoryName (GacPath), "lib\\build\\mcs.exe");
+
+                               //if (!File.Exists (CSharpCompiler))
+                               //      throw new FileNotFoundException ("C# compiler not found at " + CSharpCompiler);
+
+                               VBCompiler = Path.Combine (GacPath,  "4.5\\vbnc.exe");
+                               AssemblyLinker = Path.Combine (GacPath, "4.5\\al.exe");
+
+                               if (!File.Exists (AssemblyLinker)) {
+                                       AssemblyLinker = Path.Combine (Path.GetDirectoryName (GacPath), "lib\\net_4_x\\al.exe");
+                               //      if (!File.Exists (AssemblyLinker))
+                               //              throw new FileNotFoundException ("Windows al path not found: " + AssemblyLinker);
+                               }
+                       } else {
+                               Mono = Path.Combine (GacPath, "bin", "mono");
+                               if (!File.Exists (Mono))
+                                       Mono = "mono";
+
+                               var mscorlibPath = new Uri (typeof (object).Assembly.CodeBase).LocalPath;
+                               CSharpCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "mcs"));
+                               if (!File.Exists (CSharpCompiler))
+                                       CSharpCompiler = "mcs";
+
+                               VBCompiler = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "vbnc"));
+                               if (!File.Exists (VBCompiler))
+                                       VBCompiler = "vbnc";
+
+                               AssemblyLinker = Path.GetFullPath (Path.Combine (mscorlibPath, "..", "..", "..", "..", "bin", "al"));
+                               if (!File.Exists (AssemblyLinker))
+                                       AssemblyLinker = "al";
+                       }
+               }
+
+               // Due to an issue with shadow copying  and app domains in mono, we cannot currently use 
+               // Process.GetCurrentProcess ().MainModule.FileName (which would give the same result)
+               // when running in an AppDomain (eg System.Web hosts).
+               //
+               // Using native Windows API to get current process filename. This will only
+               // be called when running on Windows. 
+               [DllImport ("kernel32.dll")]
+               static extern uint GetModuleFileName ([In] IntPtr hModule, [Out] StringBuilder lpFilename, [In] int nSize);
+
+       }
+}
+
+#endif
index 6ec32758faf518b7194ff3462876a81e2fc0610b..24351699070af87a50754ae78540b810f07e5f66 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 Microsoft.CSharp/CodeGeneratorFromCompileUnitTest.cs
 Microsoft.CSharp/CodeGeneratorFromExpressionTest.cs
 Microsoft.CSharp/CodeGeneratorFromNamespaceTest.cs
index c6ccdf0a26ab1e81b475f0a646aaf63296196b3e..823204cf4867366cebc2cd86bffcdeb601dfa29c 100644 (file)
@@ -53,7 +53,7 @@ namespace MonoTests.System.CodeDom.Compiler
                        int importPosition = result.IndexOf (IMPORT);
                        int attributePosition = result.IndexOf (ATTRIBUTE);
 
-                       Assert.Greater (attributePosition, importPosition, "Actual order: " + result);
+                       AssertHelper.Greater (attributePosition, importPosition, "Actual order: " + result);
                }
 
                [Test]
index b6baac08e8546b092a48cb849ec3fc9debb3a37b..6586c4c092f9c554eae94a7f1bb7a62ba03bb79c 100644 (file)
@@ -38,9 +38,6 @@ using System.Text;
 using System.Runtime.Serialization;
 using System.Runtime.Serialization.Formatters.Binary;
 using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Collections.Generic
 {
index 820e84d2a89326a2ffe8a5de07f2403b4f0e7d37..07195bb9246a85a71c758c528406365828b7e7f8 100644 (file)
@@ -53,7 +53,7 @@ namespace MonoTests.System.Diagnostics
                public void ConstructorNullName ()
                {
                        SourceSwitch s = new SourceSwitch (null);
-                       Assert.IsEmpty (s.DisplayName);
+                       AssertHelper.IsEmpty (s.DisplayName);
                }
 
                [Test]
index 9d97fc8b53c615a8589e7fbea1a8cdc0d030038e..d8821a00c2ddbb42d380e3c49437300be24eac11 100644 (file)
@@ -190,8 +190,8 @@ namespace MonoTests.System.Diagnostics {
                public void NullSwitchHasEmptyDisplayNameAndDescription ()
                {
                        var s = new TestNullSwitch ();
-                       Assert.IsEmpty (s.DisplayName);
-                       Assert.IsEmpty (s.Description);
+                       AssertHelper.IsEmpty (s.DisplayName);
+                       AssertHelper.IsEmpty (s.Description);
                }
        }
 }
index 0fe01aaf102cd2c04b499ef4f1822e4da01a6955..1aa78a9d99368a75faa4bee76c1c0eecb03e35f8 100644 (file)
@@ -410,6 +410,46 @@ namespace MonoTests.System.IO.Compression
                        using (var unZippedStream = new StreamReader (gZipStream, Encoding.UTF8)) {
                                unZipped = unZippedStream.ReadToEnd ();
                        }
+
+                       Assert.AreEqual(1877, unZipped.Length);
+               }
+
+               [Test]
+               public void Bug44994_Inflate()
+               {
+                       var base64String = @"7cWxCQAgDACwpeBjgqsgXiHU0fd9QzBLErX1EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADepcxcuU/atm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm3btm37zy8=";
+
+                       byte[] byteArray = Convert.FromBase64String(base64String);
+                       string unZipped = null;
+
+                       using (var zippedMemoryStream = new MemoryStream(byteArray))
+                       using (var gZipStream = new DeflateStream(zippedMemoryStream, CompressionMode.Decompress))
+                       using (var unzippedMemStream = new MemoryStream())
+                       using (var unZippedStream = new StreamReader(gZipStream, Encoding.UTF8))
+                       {
+                               unZipped = unZippedStream.ReadToEnd();
+                       }
+
+                       Assert.AreEqual(81942, unZipped.Length);
+               }
+
+               [Test]
+               [Category ("MobileNotWorking")]
+               public void Bug44994_InflateByteByByte()
+               {
+                       int byteCount = 0;
+                       using (var fileStream = File.OpenRead(Path.Combine("Test", "compressed.bin")))
+                       {
+                               using (var deflateStream = new DeflateStream(fileStream, CompressionMode.Decompress, false))
+                               {
+                                       while (deflateStream.ReadByte() != -1)
+                                       {
+                                               byteCount++;
+                                       }
+                               }
+                       }
+
+                       Assert.AreEqual(125387, byteCount);
                }
        }
 }
index f0c29764ae9ec6f78d5dae84a80e76e902e4cf70..935aa77bcdf7e46f7d4ca959825931f219cebf6b 100644 (file)
@@ -247,6 +247,25 @@ namespace MonoTests.System.Net.Sockets {
                        SocketAsyncEventArgsPoker saea = new SocketAsyncEventArgsPoker ();
                        saea.OnCompleted_ (null);
                }
+
+               [Test]
+               public void TransparentDispose ()
+               {
+                       var buffer = new byte[5];
+                       var elements = new SendPacketsElement[2];
+                       var utoken = new object();
+
+                       var saea = new SocketAsyncEventArgs();
+                       saea.SetBuffer(buffer, 0, 3);
+                       saea.SendPacketsElements = elements;
+                       saea.UserToken = utoken;
+
+                       saea.Dispose();
+
+                       Assert.AreEqual (buffer, saea.Buffer);
+                       Assert.AreEqual (elements, saea.SendPacketsElements);
+                       Assert.AreEqual (utoken, saea.UserToken);
+               }
        }
 }
 
index b0616ac7966c9e8c29deb25b5aa6f7f954ed4a09..14ec2700869c289ee1159851c5402e07138b70a5 100755 (executable)
@@ -2717,6 +2717,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (AggregateException))] // Something catches the PlatformNotSupportedException and re-throws an AggregateException    
+#endif
                public void ConcurrentExceedSocketLimit ()
                {
                        var tasks = new Task[4];
@@ -2727,6 +2730,9 @@ namespace MonoTests.System.Net.Sockets
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void SendGenericExceedBuffer ()
                {
                        // Create a buffer larger than the default max.
index 25e8854ed6a87635c18cdec0a9f8778959ad2327..15b48e5fe2b772768700e8b8ee669c5b16c5f97e 100644 (file)
@@ -219,5 +219,27 @@ namespace MonoTests.System.Net.Sockets
                        listen.Start (65536);
                        listen.Stop ();
                }
+
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void EndAcceptTcpClient ()
+               {
+                       var port = NetworkHelpers.FindFreePort ();
+
+                       var listenerSocket = new TcpListener (IPAddress.Any, port);
+                       listenerSocket.Start ();
+                       listenerSocket.BeginAcceptTcpClient (new AsyncCallback (l => {
+                               listenerSocket.EndAcceptTcpClient (l);
+                       }), null);
+
+
+                       using (var outClient = new TcpClient ("localhost", port)) {
+                               using (var stream = outClient.GetStream ()) {
+                                       stream.WriteByte (3);
+                               }
+                       }
+               }
        }
 }
index 996da16f5cc0009ee0b3a56b4e6334812ba89508..33dc4464c86d89bbb0cfedb032c25c3ebf2e7b85 100644 (file)
@@ -558,25 +558,15 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress)
-               [Category ("NotWorking")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup1_Socket_NotBound ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
 
-                       UdpClient client = new UdpClient (AddressFamily.InterNetwork);
-                       try {
+                       using (UdpClient client = new UdpClient (AddressFamily.InterNetwork)) {
                                client.JoinMulticastGroup (mcast_addr);
-                               Assert.Fail ("#1");
-                       } catch (SocketException ex) {
-                               // An invalid argument was supplied
-                               Assert.AreEqual (typeof (SocketException), ex.GetType (), "#2");
-                               Assert.AreEqual (10022, ex.ErrorCode, "#3");
-                               Assert.IsNull (ex.InnerException, "#4");
-                               Assert.IsNotNull (ex.Message, "#5");
-                               Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
-                               Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
-                       } finally {
-                               client.Close ();
                        }
                }
 
@@ -666,25 +656,15 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (Int32, IPAddress)
-               [Category ("NotWorking")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup2_Socket_NotBound ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("ff02::1");
 
-                       UdpClient client = new UdpClient (AddressFamily.InterNetworkV6);
-                       try {
+                       using (UdpClient client = new UdpClient (AddressFamily.InterNetworkV6)) {
                                client.JoinMulticastGroup (0, mcast_addr);
-                               Assert.Fail ("#1");
-                       } catch (SocketException ex) {
-                               // An invalid argument was supplied
-                               Assert.AreEqual (typeof (SocketException), ex.GetType (), "#2");
-                               Assert.AreEqual (10022, ex.ErrorCode, "#3");
-                               Assert.IsNull (ex.InnerException, "#4");
-                               Assert.IsNotNull (ex.Message, "#5");
-                               Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
-                               Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
-                       } finally {
-                               client.Close ();
                        }
                }
 
@@ -767,25 +747,15 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, Int32)
-               [Category ("NotWorking")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup3_Socket_NotBound ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
 
-                       UdpClient client = new UdpClient (AddressFamily.InterNetwork);
-                       try {
+                       using (UdpClient client = new UdpClient (AddressFamily.InterNetwork)) {
                                client.JoinMulticastGroup (mcast_addr, 5);
-                               Assert.Fail ("#1");
-                       } catch (SocketException ex) {
-                               // An invalid argument was supplied
-                               Assert.AreEqual (typeof (SocketException), ex.GetType (), "#2");
-                               Assert.AreEqual (10022, ex.ErrorCode, "#3");
-                               Assert.IsNull (ex.InnerException, "#4");
-                               Assert.IsNotNull (ex.Message, "#5");
-                               Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
-                               Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
-                       } finally {
-                               client.Close ();
                        }
                }
 
@@ -896,26 +866,16 @@ namespace MonoTests.System.Net.Sockets {
                }
 
                [Test] // JoinMulticastGroup (IPAddress, IPAddress)
-               [Category ("NotWorking")]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void JoinMulticastGroup4_Socket_NotBound ()
                {
                        IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
                        IPAddress local_addr = Dns.GetHostEntry (string.Empty).AddressList [0];
 
-                       UdpClient client = new UdpClient (AddressFamily.InterNetwork);
-                       try {
+                       using (UdpClient client = new UdpClient (AddressFamily.InterNetwork)) {
                                client.JoinMulticastGroup (mcast_addr, local_addr);
-                               Assert.Fail ("#1");
-                       } catch (SocketException ex) {
-                               // An invalid argument was supplied
-                               Assert.AreEqual (typeof (SocketException), ex.GetType (), "#2");
-                               Assert.AreEqual (10022, ex.ErrorCode, "#3");
-                               Assert.IsNull (ex.InnerException, "#4");
-                               Assert.IsNotNull (ex.Message, "#5");
-                               Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
-                               Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
-                       } finally {
-                               client.Close ();
                        }
                }
 
index 8143edd7571492b7566dc025ffe0a8e076be7c69..771d5d1fb6ae4cf35c3e05db8b41a44cb6175435 100644 (file)
@@ -231,11 +231,28 @@ namespace MonoTests.System.Net
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
-               public void UploadFile1 ()
+               public void UploadFile1_v4 ()
                {
-                       ServerPut sp = new ServerPut ();
+                       UploadFile1 (false);
+               }
+
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void UploadFile1_v6 ()
+               {
+                       if (!Socket.OSSupportsIPv6)
+                               Assert.Ignore ("IPv6 not supported.");
+
+                       UploadFile1 (true);
+               }
+
+               void UploadFile1 (bool ipv6)
+               {
+                       ServerPut sp = new ServerPut (ipv6);
                        sp.Start ();
-                       string uri = String.Format ("ftp://{0}:{1}/uploads/file.txt", sp.IPAddress, sp.Port);
+                       string uri = String.Format ("ftp://{0}:{1}/uploads/file.txt", EncloseIPv6 (sp.IPAddress), sp.Port);
                        try {
                                FtpWebRequest ftp = (FtpWebRequest) WebRequest.Create (uri);
                                ftp.KeepAlive = false;
@@ -264,15 +281,32 @@ namespace MonoTests.System.Net
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
-               public void UploadFile_WebClient ()
+               public void UploadFile_WebClient_v4 ()
+               {
+                       UploadFile_WebClient (false);
+               }
+
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void UploadFile_WebClient_v6 ()
+               {
+                       if (!Socket.OSSupportsIPv6)
+                               Assert.Ignore ("IPv6 not supported.");
+
+                       UploadFile_WebClient (true);
+               }
+
+               public void UploadFile_WebClient (bool ipv6)
                {
-                       ServerPut sp = new ServerPut ();
+                       ServerPut sp = new ServerPut (ipv6);
                        File.WriteAllText (_tempFile, "0123456789");
                        sp.Start ();
 
                        using (WebClient m_WebClient = new WebClient())
                        {
-                               string uri = String.Format ("ftp://{0}:{1}/uploads/file.txt", sp.IPAddress, sp.Port);
+                               string uri = String.Format ("ftp://{0}:{1}/uploads/file.txt", EncloseIPv6 (sp.IPAddress), sp.Port);
                                
                                m_WebClient.UploadFile(uri, _tempFile);
                        }
@@ -285,15 +319,27 @@ namespace MonoTests.System.Net
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
-               public void DownloadFile1 ()
+               public void DownloadFile1_v4 ()
                {
-                       DownloadFile (new ServerDownload ());
+                       DownloadFile (new ServerDownload (false));
+               }
+
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void DownloadFile1_v6 ()
+               {
+                       if (!Socket.OSSupportsIPv6)
+                               Assert.Ignore ("IPv6 not supported.");
+
+                       DownloadFile (new ServerDownload (true));
                }
 
                void DownloadFile (ServerDownload sp)
                {
                        sp.Start ();
-                       string uri = String.Format ("ftp://{0}:{1}/file.txt", sp.IPAddress, sp.Port);
+                       string uri = String.Format ("ftp://{0}:{1}/file.txt", EncloseIPv6 (sp.IPAddress), sp.Port);
                        try {
                                FtpWebRequest ftp = (FtpWebRequest) WebRequest.Create (uri);
                                ftp.KeepAlive = false;
@@ -320,22 +366,50 @@ namespace MonoTests.System.Net
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
-               public void DownloadFile2 ()
+               public void DownloadFile2_v4 ()
                {
                        // Some embedded FTP servers in Industrial Automation Hardware report
                        // the PWD using backslashes, but allow forward slashes for CWD.
-                       DownloadFile (new ServerDownload (@"\Users\someuser", "/Users/someuser/"));
+                       DownloadFile (new ServerDownload (@"\Users\someuser", "/Users/someuser/", false));
+               }
+
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void DownloadFile2_v6 ()
+               {
+                       // Some embedded FTP servers in Industrial Automation Hardware report
+                       // the PWD using backslashes, but allow forward slashes for CWD.
+                       DownloadFile (new ServerDownload (@"\Users\someuser", "/Users/someuser/", true));
+               }
+
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void DeleteFile1_v4 ()
+               {
+                       DeleteFile1 (false);
                }
 
                [Test]
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
-               public void DeleteFile1 ()
+               public void DeleteFile1_v6 ()
                {
-                       ServerDeleteFile sp = new ServerDeleteFile ();
+                       if (!Socket.OSSupportsIPv6)
+                               Assert.Ignore ("IPv6 not supported.");
+
+                       DeleteFile1 (true);
+               }
+
+               void DeleteFile1 (bool ipv6)
+               {
+                       ServerDeleteFile sp = new ServerDeleteFile (ipv6);
                        sp.Start ();
-                       string uri = String.Format ("ftp://{0}:{1}/file.txt", sp.IPAddress, sp.Port);
+                       string uri = String.Format ("ftp://{0}:{1}/file.txt", EncloseIPv6 (sp.IPAddress), sp.Port);
                        try {
                                FtpWebRequest ftp = (FtpWebRequest) WebRequest.Create (uri);
                                Console.WriteLine (ftp.RequestUri);
@@ -360,11 +434,28 @@ namespace MonoTests.System.Net
 #if FEATURE_NO_BSD_SOCKETS
                [ExpectedException (typeof (PlatformNotSupportedException))]
 #endif
-               public void ListDirectory1 ()
+               public void ListDirectory1_v4 ()
+               {
+                       ListDirectory1 (false);
+               }
+
+               [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
+               public void ListDirectory1_v6 ()
                {
-                       ServerListDirectory sp = new ServerListDirectory ();
+                       if (!Socket.OSSupportsIPv6)
+                               Assert.Ignore ("IPv6 not supported.");
+
+                       ListDirectory1 (true);
+               }
+
+               void ListDirectory1 (bool ipv6)
+               {
+                       ServerListDirectory sp = new ServerListDirectory (ipv6);
                        sp.Start ();
-                       string uri = String.Format ("ftp://{0}:{1}/somedir/", sp.IPAddress, sp.Port);
+                       string uri = String.Format ("ftp://{0}:{1}/somedir/", EncloseIPv6 (sp.IPAddress), sp.Port);
                        try {
                                FtpWebRequest ftp = (FtpWebRequest) WebRequest.Create (uri);
                                Console.WriteLine (ftp.RequestUri);
@@ -387,7 +478,20 @@ namespace MonoTests.System.Net
                        }
                }
 
+               string EncloseIPv6 (IPAddress address)
+               {
+                       if (address.AddressFamily == AddressFamily.InterNetwork)
+                               return address.ToString ();
+                       
+                       return String.Format ("[{0}]", address.ToString ());
+               }
+
                class ServerListDirectory : FtpServer {
+                       public ServerListDirectory (bool ipv6)
+                               : base (ipv6)
+                       {
+                       }
+
                        protected override void Run ()
                        {
                                Socket client = control.Accept ();
@@ -405,24 +509,12 @@ namespace MonoTests.System.Net
                                }
 
                                string str = reader.ReadLine ();
-                               if (str != "PASV") {
-                                       Where = "PASV";
+                               string resp = FormatPassiveResponse (str);
+                               if (resp == null) {
                                        client.Close ();
                                        return;
                                }
-
-                               IPEndPoint end_data = (IPEndPoint) data.LocalEndPoint;
-                               byte [] addr_bytes = end_data.Address.GetAddressBytes ();
-                               byte [] port = new byte [2];
-                               port[0] = (byte) ((end_data.Port >> 8) & 255);
-                               port[1] = (byte) (end_data.Port & 255);
-                               StringBuilder sb = new StringBuilder ("227 Passive (");
-                               foreach (byte b in addr_bytes) {
-                                       sb.AppendFormat ("{0},", b);    
-                               }
-                               sb.AppendFormat ("{0},", port [0]);     
-                               sb.AppendFormat ("{0})", port [1]);     
-                               writer.WriteLine (sb.ToString ());
+                               writer.WriteLine (resp);
                                writer.Flush ();
 
                                str = reader.ReadLine ();
@@ -449,6 +541,11 @@ namespace MonoTests.System.Net
                }
 
                class ServerDeleteFile : FtpServer {
+                       public ServerDeleteFile (bool ipv6)
+                               : base (ipv6)
+                       {
+                       }
+
                        protected override void Run ()
                        {
                                Socket client = control.Accept ();
@@ -485,12 +582,13 @@ namespace MonoTests.System.Net
 
                        string Pwd, Cwd;
 
-                       public ServerDownload ()
-                               : this (null, null)
+                       public ServerDownload (bool ipv6)
+                               : this (null, null, ipv6)
                        {
                        }
 
-                       public ServerDownload (string pwd, string cwd)
+                       public ServerDownload (string pwd, string cwd, bool ipv6)
+                               : base (ipv6)
                        {
                                Pwd = pwd ?? "/home/someuser";
                                Cwd = cwd ?? "/home/someuser/";
@@ -513,24 +611,12 @@ namespace MonoTests.System.Net
                                }
 
                                string str = reader.ReadLine ();
-                               if (str != "PASV") {
-                                       Where = "PASV";
+                               string resp = FormatPassiveResponse (str);
+                               if (resp == null) {
                                        client.Close ();
                                        return;
                                }
-
-                               IPEndPoint end_data = (IPEndPoint) data.LocalEndPoint;
-                               byte [] addr_bytes = end_data.Address.GetAddressBytes ();
-                               byte [] port = new byte [2];
-                               port[0] = (byte) ((end_data.Port >> 8) & 255);
-                               port[1] = (byte) (end_data.Port & 255);
-                               StringBuilder sb = new StringBuilder ("227 Passive (");
-                               foreach (byte b in addr_bytes) {
-                                       sb.AppendFormat ("{0},", b);    
-                               }
-                               sb.AppendFormat ("{0},", port [0]);     
-                               sb.AppendFormat ("{0})", port [1]);     
-                               writer.WriteLine (sb.ToString ());
+                               writer.WriteLine (resp);
                                writer.Flush ();
 
                                str = reader.ReadLine ();
@@ -559,6 +645,11 @@ namespace MonoTests.System.Net
                class ServerPut : FtpServer {
                        public List<byte> result = new List<byte> ();
                        
+                       public ServerPut (bool ipv6)
+                               : base (ipv6)
+                       {
+                       }
+
                        protected override void Run ()
                        {
                                Socket client = control.Accept ();
@@ -576,24 +667,12 @@ namespace MonoTests.System.Net
                                }
 
                                string str = reader.ReadLine ();
-                               if (str != "PASV") {
-                                       Where = "PASV";
+                               string resp = FormatPassiveResponse (str);
+                               if (resp == null) {
                                        client.Close ();
                                        return;
                                }
-
-                               IPEndPoint end_data = (IPEndPoint) data.LocalEndPoint;
-                               byte [] addr_bytes = end_data.Address.GetAddressBytes ();
-                               byte [] port = new byte [2];
-                               port[0] = (byte) ((end_data.Port >> 8) & 255);
-                               port[1] = (byte) (end_data.Port & 255);
-                               StringBuilder sb = new StringBuilder ("227 Passive (");
-                               foreach (byte b in addr_bytes) {
-                                       sb.AppendFormat ("{0},", b);    
-                               }
-                               sb.AppendFormat ("{0},", port [0]);     
-                               sb.AppendFormat ("{0})", port [1]);     
-                               writer.WriteLine (sb.ToString ());
+                               writer.WriteLine (resp);
                                writer.Flush ();
 
                                str = reader.ReadLine ();
@@ -627,16 +706,18 @@ namespace MonoTests.System.Net
                        protected Socket control;
                        protected Socket data;
                        protected ManualResetEvent evt;
+                       protected bool ipv6;
                        public string Where = "";
 
-                       public FtpServer ()
+                       public FtpServer (bool ipv6)
                        {
-                               control = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-                               control.Bind (new IPEndPoint (IPAddress.Loopback, 0));
+                               control = new Socket (ipv6 ? AddressFamily.InterNetworkV6 : AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                               control.Bind (new IPEndPoint (ipv6 ? IPAddress.IPv6Loopback : IPAddress.Loopback, 0));
                                control.Listen (1);
-                               data = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-                               data.Bind (new IPEndPoint (IPAddress.Loopback, 0));
+                               data = new Socket (ipv6 ? AddressFamily.InterNetworkV6 : AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                               data.Bind (new IPEndPoint (ipv6 ? IPAddress.IPv6Loopback : IPAddress.Loopback, 0));
                                data.Listen (1);
+                               this.ipv6 = ipv6;
                        }
 
                        public void Start ()
@@ -720,7 +801,39 @@ namespace MonoTests.System.Net
                                writer.Flush ();
                                return true;
                        }
-                       
+
+                       protected string FormatPassiveResponse (string request)
+                       {
+                               if (ipv6) {
+                                       if (request != "EPSV") {
+                                               Where = "EPSV";
+                                               return null;
+                                       }
+
+                                       IPEndPoint end_data = (IPEndPoint) data.LocalEndPoint;
+                                       return String.Format ("229 Extended Passive (|||{0}|)", end_data.Port);
+                               }
+                               else {
+                                       if (request != "PASV") {
+                                               Where = "PASV";
+                                               return null;
+                                       }
+
+                                       IPEndPoint end_data = (IPEndPoint) data.LocalEndPoint;
+                                       byte [] addr_bytes = end_data.Address.GetAddressBytes ();
+                                       byte [] port = new byte [2];
+                                       port[0] = (byte) ((end_data.Port >> 8) & 255);
+                                       port[1] = (byte) (end_data.Port & 255);
+                                       StringBuilder sb = new StringBuilder ("227 Passive (");
+                                       foreach (byte b in addr_bytes) {
+                                               sb.AppendFormat ("{0},", b);    
+                                       }
+                                       sb.AppendFormat ("{0},", port [0]);     
+                                       sb.AppendFormat ("{0})", port [1]);     
+                                       return sb.ToString ();
+                               }
+                       }
+
                        public IPAddress IPAddress {
                                get { return ((IPEndPoint) control.LocalEndPoint).Address; }
                        }
index dbe3255cd6893121155b8f82242724cb8090805f..e5c46f8f901638ac860e8c8824a69e9327f8253e 100644 (file)
@@ -28,6 +28,7 @@
 
 using System;
 using System.Net;
+using System.Security;
 
 using NUnit.Framework;
 
@@ -99,6 +100,21 @@ namespace MonoTests.System.Net {
                        nc = new NetworkCredential ("user", "********", "dom");
                        CheckCustom (nc);
                }
+
+               [Test]
+               public void DecipherSecureString ()
+               {
+                       // many code snippets suggest using the following to get the decrypted string from a SecureString
+                       var ss = new SecureString ();
+                       ss.AppendChar('h');
+                       ss.AppendChar('e');
+                       ss.AppendChar('l');
+                       ss.AppendChar('l');
+                       ss.AppendChar('o');
+                       string plain = new NetworkCredential (string.Empty, ss).Password;
+                       Assert.AreEqual ("hello", plain);
+               }
        }
 }
 
index 8922c14f00e65e1afe983af6cd8aa7b6d1a0685c..c252d21b189bcd75d3c8b9cb2e94f621208fc838 100644 (file)
@@ -29,8 +29,10 @@ public class ServicePointManagerTest
        [SetUp]\r
         public void GetReady () \r
        {\r
+#if !FEATURE_NO_BSD_SOCKETS\r
                maxIdle = ServicePointManager.MaxServicePointIdleTime;\r
                ServicePointManager.MaxServicePointIdleTime = 10;\r
+#endif\r
                googleUri = new Uri ("http://www.google.com");\r
                yahooUri = new Uri ("http://www.yahoo.com");\r
                apacheUri = new Uri ("http://www.apache.org");\r
@@ -39,7 +41,9 @@ public class ServicePointManagerTest
        [TearDown]\r
        public void Finish ()\r
        {\r
+#if !FEATURE_NO_BSD_SOCKETS\r
                ServicePointManager.MaxServicePointIdleTime = maxIdle;\r
+#endif\r
        }\r
 \r
         [Test, ExpectedException (typeof (InvalidOperationException))]\r
@@ -82,12 +86,15 @@ public class ServicePointManagerTest
        }\r
        \r
         [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+       [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
        public void FindServicePoint ()\r
        {\r
                ServicePointManager.MaxServicePoints = 0;\r
                ServicePoint sp = ServicePointManager.FindServicePoint (googleUri, new WebProxy (apacheUri));\r
                Assert.AreEqual (apacheUri, sp.Address, "#1");\r
-#if MOBILE && !MONODROID\r
+#if MOBILE\r
                Assert.AreEqual (10, sp.ConnectionLimit, "#2");\r
 #else\r
                Assert.AreEqual (2, sp.ConnectionLimit, "#2");\r
index 1e848148f92c21783688163be5f07e1fcb669a87..6171a2fd25587d85a535b496111aa114628536e0 100644 (file)
@@ -23,6 +23,8 @@ namespace MonoTests.System.Net
 public class ServicePointTest\r
 {\r
        static private int max;\r
+\r
+#if !FEATURE_NO_BSD_SOCKETS\r
        [SetUp]\r
        public void SaveMax () {\r
                max = ServicePointManager.MaxServicePoints;\r
@@ -33,6 +35,7 @@ public class ServicePointTest
        public void RestoreMax () {\r
                ServicePointManager.MaxServicePoints = max;\r
        }\r
+#endif\r
 \r
         [Test]\r
                [Category ("InetAccess")]\r
index 3b048781f29ad6a15109241cb99f362d55b2f521..30531be7e880c09a3d69330be30fbc807154b7dc 100644 (file)
@@ -1778,6 +1778,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DefaultProxy ()
                {
                        WebClient wc = new WebClient ();
index 5da8a5d59c78e11bb00c93fe1c1041235e7a9efb..5f6daa28b60f1eadacf6cea0aaf73bc77ebe5cfa 100644 (file)
@@ -37,6 +37,7 @@ using System.IO;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
 using System.Text;
+using System.Reflection;
 
 namespace MonoTests.System.Security.Cryptography.X509Certificates {
 
@@ -64,7 +65,7 @@ namespace MonoTests.System.Security.Cryptography.X509Certificates {
                public void FixtureSetUp ()
                {
                        base_dir = String.Format ("{0}{1}Test{1}System.Security.Cryptography.X509Certificates{1}pkits{1}certs",
-                               Directory.GetCurrentDirectory (), Path.DirectorySeparatorChar);
+                               Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), Path.DirectorySeparatorChar);
                        if (!Directory.Exists (base_dir))
                                Assert.Ignore ("PKITS tests data not found under '{0}'.", new object[] { base_dir });
 
@@ -75,7 +76,8 @@ namespace MonoTests.System.Security.Cryptography.X509Certificates {
                [TestFixtureTearDown]
                public void FixtureTearDown ()
                {
-                       cache.Clear ();
+                       if (cache != null)
+                               cache.Clear ();
                        // clean-up, as best as possible, the stores
                }
 
index 9b2e93b730cdb572d1d230c1da5f8566e66c9087..a39ac73d0afa0949dcd04172bdeae22851faef21 100644 (file)
@@ -312,6 +312,8 @@ namespace MonoTests.System
                        Assert.IsFalse (Uri.IsWellFormedUriString (null, UriKind.Absolute), "null");
                        Assert.IsFalse (Uri.IsWellFormedUriString ("data", UriKind.Absolute), "data");
                        Assert.IsTrue (Uri.IsWellFormedUriString ("http://www.go-mono.com/Main_Page#1", UriKind.Absolute), "http/hex");
+                       Assert.IsTrue (Uri.IsWellFormedUriString ("test", UriKind.RelativeOrAbsolute), "rel1");
+                       Assert.IsTrue (Uri.IsWellFormedUriString ("/test", UriKind.RelativeOrAbsolute), "rel2");
                }
 
                [Test]
diff --git a/mcs/class/System/Test/compressed.bin b/mcs/class/System/Test/compressed.bin
new file mode 100644 (file)
index 0000000..3098195
Binary files /dev/null and b/mcs/class/System/Test/compressed.bin differ
index d2eea338663d07b6fc49eef39b266b3e0be4246e..69d28f6df916b6ce4641fa4756b97aa24a7ca615 100644 (file)
@@ -1,5 +1,3 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
   <system.diagnostics>
     <switches>
       <!-- Boolean switches: any non-zero value is true -->
@@ -22,5 +20,4 @@
       <add name="trace-negative" value="-1"/>
     </switches>
   </system.diagnostics>
-</configuration>
 
diff --git a/mcs/class/System/Test/test-config-file-net-2.0 b/mcs/class/System/Test/test-config-file-net-2.0
deleted file mode 100644 (file)
index 0394048..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-  <system.diagnostics>
-    <sources>
-      <source name="source1" switchName="switch" switchType="System.Diagnostics.SourceSwitch">
-        <!--
-        <listeners>
-          <add name="console" type="System.Diagnostics.ConsoleTraceListener"/>
-        </listeners>
-          -->
-      </source>
-    </sources>
-    <switches>
-      <!-- Boolean switches: any non-zero value is true -->
-      <add name="bool-true" value="1"/>
-      <add name="bool-true-2" value="4"/>
-      <add name="bool-true-3" value="-2"/>
-      <add name="bool-false" value="0"/>
-
-      <!-- trace switches: -->
-      <add name="trace-off" value="0"/>
-      <add name="trace-error" value="1"/>
-      <add name="trace-warning" value="2"/>
-      <add name="trace-info" value="3"/>
-      <add name="trace-verbose" value="4"/>
-
-      <!-- custom switches: -->
-      <add name="custom-switch" value="42"/>
-
-      <!-- this causes problems on .NET -->
-      <add name="trace-negative" value="-1"/>
-    </switches>
-  </system.diagnostics>
-</configuration>
-
index b971e3d0358f4ba1e8c549cc9544c6501675231d..1351778bb8643b61e65d07e951802ead59e45c29 100644 (file)
@@ -118,36 +118,14 @@ System.Net.Security/SslPolicyErrors.cs
 System.Net.Security/SslStream.cs
 System.Net/SocketPermissionAttribute.cs
 System.Net/SocketPermission.cs
-../referencesource/System/net/System/Net/Sockets/AddressFamily.cs
-../referencesource/System/net/System/Net/Sockets/IOControlCode.cs
-../referencesource/System/net/System/Net/Sockets/IPPacketInformation.cs
-../referencesource/System/net/System/Net/Sockets/LingerOption.cs
-../referencesource/System/net/System/Net/Sockets/MulticastOption.cs
-../referencesource/System/net/System/Net/Sockets/ProtocolFamily.cs
-../referencesource/System/net/System/Net/Sockets/ProtocolType.cs
 System.Net.Sockets/SafeSocketHandle.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
-../referencesource/System/net/System/Net/Sockets/SocketErrors.cs
-../referencesource/System/net/System/Net/SocketException.cs
-../referencesource/System/net/System/Net/Sockets/SocketFlags.cs
-../referencesource/System/net/System/Net/Sockets/SocketInformation.cs
-../referencesource/System/net/System/Net/Sockets/SocketInformationOptions.cs
 System.Net.Sockets/SocketOperation.cs
-../referencesource/System/net/System/Net/Sockets/SocketOptionLevel.cs
-../referencesource/System/net/System/Net/Sockets/SocketOptionName.cs
-../referencesource/System/net/System/Net/Sockets/SocketShutdown.cs
-../referencesource/System/net/System/Net/Sockets/SocketType.cs
-System.Net.Sockets/TcpClient.cs
-System.Net.Sockets/TcpListener.cs
-../referencesource/System/net/System/Net/Sockets/TransmitFileFlags.cs
-System.Net.Sockets/UdpClient.cs
-../referencesource/System/net/System/Net/Sockets/UdpReceiveResult.cs
+System.Net.Sockets/SocketReceiveFromResult.cs
+System.Net.Sockets/SocketReceiveMessageFromResult.cs
+System.Net.Sockets/SocketTaskExtensions.cs
 System.Net/AuthenticationManager.cs
 System.Net/BasicClient.cs
 System.Net/BindIPEndPoint.cs
@@ -188,7 +166,6 @@ System.Net/ListenerPrefix.cs
 System.Net/MacProxy.cs
 System.Net/MonoHttpDate.cs
 System.Net/NetConfig.cs
-System.Net/NetworkCredential.cs
 System.Net/NtlmClient.cs
 System.Net/RequestStream.cs
 System.Net/ResponseStream.cs
@@ -302,6 +279,44 @@ Mono.Net.Security/MonoTlsStream.cs
 Mono.Net.Security/NoReflectionHelper.cs
 Mono.Net.Security/SystemCertificateValidator.cs
 
+Mono.Btls/MonoBtlsBio.cs
+Mono.Btls/MonoBtlsContext.cs
+Mono.Btls/MonoBtlsError.cs
+Mono.Btls/MonoBtlsException.cs
+Mono.Btls/MonoBtlsKey.cs
+Mono.Btls/MonoBtlsObject.cs
+Mono.Btls/MonoBtlsPkcs12.cs
+Mono.Btls/MonoBtlsProvider.cs
+Mono.Btls/MonoBtlsSsl.cs
+Mono.Btls/MonoBtlsSslCtx.cs
+Mono.Btls/MonoBtlsSslError.cs
+Mono.Btls/MonoBtlsStream.cs
+Mono.Btls/MonoBtlsUtils.cs
+Mono.Btls/MonoBtlsX509.cs
+Mono.Btls/MonoBtlsX509Chain.cs
+Mono.Btls/MonoBtlsX509Crl.cs
+Mono.Btls/MonoBtlsX509Error.cs
+Mono.Btls/MonoBtlsX509Exception.cs
+Mono.Btls/MonoBtlsX509FileType.cs
+Mono.Btls/MonoBtlsX509Format.cs
+Mono.Btls/MonoBtlsX509Lookup.cs
+Mono.Btls/MonoBtlsX509LookupMonoCollection.cs
+Mono.Btls/MonoBtlsX509LookupMono.cs
+Mono.Btls/MonoBtlsX509LookupType.cs
+Mono.Btls/MonoBtlsX509Name.cs
+Mono.Btls/MonoBtlsX509NameEntryType.cs
+Mono.Btls/MonoBtlsX509Purpose.cs
+Mono.Btls/MonoBtlsX509Revoked.cs
+Mono.Btls/MonoBtlsX509Store.cs
+Mono.Btls/MonoBtlsX509StoreCtx.cs
+Mono.Btls/MonoBtlsX509StoreManager.cs
+Mono.Btls/MonoBtlsX509StoreType.cs
+Mono.Btls/MonoBtlsX509TrustKind.cs
+Mono.Btls/MonoBtlsX509VerifyFlags.cs
+Mono.Btls/MonoBtlsX509VerifyParam.cs
+Mono.Btls/X509CertificateImplBtls.cs
+Mono.Btls/X509ChainImplBtls.cs
+
 ReferenceSources/AutoWebProxyScriptEngine.cs
 ReferenceSources/AssertWrapper.cs
 ReferenceSources/CAPI.cs
@@ -313,6 +328,7 @@ ReferenceSources/Logging.cs
 ReferenceSources/NativeMethods.cs
 ReferenceSources/RequestCacheProtocol.cs
 ReferenceSources/SettingsSectionInternal.cs
+ReferenceSources/SecureStringHelper.cs
 ReferenceSources/Socket.cs
 ReferenceSources/SR.cs
 ReferenceSources/SRCategoryAttribute.cs
@@ -740,6 +756,7 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/net/System/Net/IWebProxyFinder.cs
 ../referencesource/System/net/System/Net/IWebRequestCreate.cs
 ../referencesource/System/net/System/Net/NetworkAccess.cs
+../referencesource/System/net/System/Net/NetworkCredential.cs
 ../referencesource/System/net/System/Net/ProtocolViolationException.cs
 ../referencesource/System/net/System/Net/TransportContext.cs
 ../referencesource/System/net/System/Net/TransportType.cs
@@ -747,6 +764,7 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/net/System/Net/UnicodeEncodingConformance.cs
 ../referencesource/System/net/System/Net/ServicePointManager.cs
 ../referencesource/System/net/System/Net/SocketAddress.cs
+../referencesource/System/net/System/Net/SocketException.cs
 ../referencesource/System/net/System/Net/webclient.cs
 ../referencesource/System/net/System/Net/WebException.cs
 ../referencesource/System/net/System/Net/WebExceptionStatus.cs
@@ -766,8 +784,31 @@ ReferenceSources/Win32Exception.cs
 
 ../referencesource/System/net/System/Net/Configuration/DefaultProxySection.cs
 
+../referencesource/System/net/System/Net/Sockets/_MultipleConnectAsync.cs
+../referencesource/System/net/System/Net/Sockets/AddressFamily.cs
+../referencesource/System/net/System/Net/Sockets/IOControlCode.cs
+../referencesource/System/net/System/Net/Sockets/IPPacketInformation.cs
 ../referencesource/System/net/System/Net/Sockets/IPProtectionLevel.cs
+../referencesource/System/net/System/Net/Sockets/LingerOption.cs
+../referencesource/System/net/System/Net/Sockets/MulticastOption.cs
 ../referencesource/System/net/System/Net/Sockets/NetworkStream.cs
+../referencesource/System/net/System/Net/Sockets/ProtocolFamily.cs
+../referencesource/System/net/System/Net/Sockets/ProtocolType.cs
+../referencesource/System/net/System/Net/Sockets/SelectMode.cs
+../referencesource/System/net/System/Net/Sockets/Socket.cs
+../referencesource/System/net/System/Net/Sockets/SocketErrors.cs
+../referencesource/System/net/System/Net/Sockets/SocketFlags.cs
+../referencesource/System/net/System/Net/Sockets/SocketInformation.cs
+../referencesource/System/net/System/Net/Sockets/SocketInformationOptions.cs
+../referencesource/System/net/System/Net/Sockets/SocketOptionLevel.cs
+../referencesource/System/net/System/Net/Sockets/SocketOptionName.cs
+../referencesource/System/net/System/Net/Sockets/SocketShutdown.cs
+../referencesource/System/net/System/Net/Sockets/SocketType.cs
+../referencesource/System/net/System/Net/Sockets/TCPClient.cs
+../referencesource/System/net/System/Net/Sockets/TCPListener.cs
+../referencesource/System/net/System/Net/Sockets/TransmitFileFlags.cs
+../referencesource/System/net/System/Net/Sockets/UdpReceiveResult.cs
+../referencesource/System/net/System/Net/Sockets/UDPClient.cs
 
 ../referencesource/System/net/System/Net/NetworkInformation/DuplicateAddressDetectionState.cs
 ../referencesource/System/net/System/Net/NetworkInformation/GatewayIPAddressInformation.cs
@@ -801,7 +842,6 @@ ReferenceSources/Win32Exception.cs
 ../referencesource/System/net/System/Net/NetworkInformation/SystemGatewayIPAddressInformation.cs
 ../referencesource/System/net/System/Net/NetworkInformation/SystemIPAddressInformation.cs
 ../referencesource/System/net/System/Net/NetworkInformation/SystemMulticastIPAddressInformation.cs
-../referencesource/System/net/System/Net/NetworkInformation/SystemUnicastIPAddressInformation.cs
 ../referencesource/System/net/System/Net/NetworkInformation/SystemTcpConnection.cs
 ../referencesource/System/net/System/Net/NetworkInformation/TcpConnection.cs
 ../referencesource/System/net/System/Net/NetworkInformation/TcpState.cs
index 686004bd3b16c16676290b8c5bec21daaa5b0827..c2950c536caf33f5d6f337df9463118118f248e8 100644 (file)
@@ -1,3 +1,4 @@
 #include mobile_System.dll.sources
 System/AndroidPlatform.cs
 Mono.Net.Security/MonoTlsProviderFactory.Droid.cs
+Mono.Btls/MonoBtlsX509LookupAndroid.cs
index 0138e11713a9d2305890b72e09a231a581cbf130..8d7969bf906d647a0c358b9c6080a17477d1153e 100644 (file)
+../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
+../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
+../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
+../Mono.Security/Mono.Security.Interface/Alert.cs
+../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
+../Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs
+../Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs
+../Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs
+../Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs
+../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs
+../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs
+../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs
+../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.Apple.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
+../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
+../Mono.Security/Mono.Security.Interface/TlsException.cs
+../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs
+../Mono.Security/Mono.Security.Interface/TlsProtocols.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmSettings.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.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.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/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/SslCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.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.Http/NtlmClient.cs
+Mono.Net.Security/AsyncProtocolRequest.cs
+Mono.Net.Security/CallbackHelpers.cs
+Mono.Net.Security/ChainValidationHelper.cs
+Mono.Net.Security/IMonoSslStream.cs
+Mono.Net.Security/IMonoTlsProvider.cs
 Mono.Net.Security/LegacySslStream.cs
+Mono.Net.Security/LegacySslStream.cs
+Mono.Net.Security/LegacyTlsProvider.cs
 Mono.Net.Security/LegacyTlsProvider.cs
+Mono.Net.Security/MobileAuthenticatedStream.cs
+Mono.Net.Security/MobileTlsContext.cs
+Mono.Net.Security/MonoSslStreamImpl.cs
+Mono.Net.Security/MonoSslStreamWrapper.cs
+Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
+Mono.Net.Security/MonoTlsProviderFactory.cs
+Mono.Net.Security/MonoTlsProviderImpl.cs
+Mono.Net.Security/MonoTlsProviderWrapper.cs
+Mono.Net.Security/MonoTlsStream.cs
+Mono.Net.Security/NoReflectionHelper.cs
+Mono.Net.Security/SystemCertificateValidator.cs
+System.Net/MacProxy.cs
 System.Net.Mail/SmtpClient.cs
+System.Net.Security/SslStream.cs
 System.Net.Sockets/TcpClient.cs
 System.Net.Sockets/TcpListener.cs
-System.Net.Sockets/UdpClient.cs
 System.Net.WebSockets/ClientWebSocket.cs
+System.Net/AuthenticationManager.cs
 System.Net/ChunkedInputStream.cs
 System.Net/EndPointListener.cs
 System.Net/EndPointManager.cs
@@ -23,5 +132,16 @@ System.Net/HttpListenerRequest.cs
 System.Net/HttpListenerResponse.cs
 System.Net/HttpWebRequest.cs
 System.Net/HttpWebResponse.cs
+System.Net/IWebConnectionState.cs
 System.Net/ListenerAsyncResult.cs
+System.Net/NtlmClient.cs
 System.Net/ResponseStream.cs
+System.Net/ServicePoint.cs
+System.Net/ServicePointManager.cs
+System.Net/WebConnection.cs
+System.Net/WebConnectionData.cs
+System.Net/WebConnectionGroup.cs
+System.Net/WebConnectionStream.cs
+../referencesource/System/net/System/Net/Sockets/TCPClient.cs
+../referencesource/System/net/System/Net/Sockets/TCPListener.cs
+../referencesource/System/net/System/Net/Sockets/UDPClient.cs
index b606c440802b9f3cb95c43e630fa82760982f681..f7e73d81e36ecfd3775457593b9630c74bd0083d 100644 (file)
@@ -1,9 +1,11 @@
 #include monotouch_System.dll.sources
 System.Net.Mail/SmtpClient.platformnotsupported.cs
+System.Net.Security/SslStream.platformnotsupported.cs
 System.Net.Sockets/TcpClient.platformnotsupported.cs
 System.Net.Sockets/TcpListener.platformnotsupported.cs
 System.Net.Sockets/UdpClient.platformnotsupported.cs
 System.Net.WebSockets/ClientWebSocket.platformnotsupported.cs
+System.Net/AuthenticationManager.platformnotsupported.cs
 System.Net/FtpRequestCreator.platformnotsupported.cs
 System.Net/FtpWebRequest.platformnotsupported.cs
 System.Net/FtpWebResponse.platformnotsupported.cs
@@ -14,3 +16,5 @@ System.Net/HttpListenerRequest.platformnotsupported.cs
 System.Net/HttpListenerResponse.platformnotsupported.cs
 System.Net/HttpWebRequest.platformnotsupported.cs
 System.Net/HttpWebResponse.platformnotsupported.cs
+System.Net/ServicePoint.platformnotsupported.cs
+System.Net/ServicePointManager.platformnotsupported.cs
diff --git a/mcs/class/System/monotouch_watch_runtime_System.dll.exclude.sources b/mcs/class/System/monotouch_watch_runtime_System.dll.exclude.sources
new file mode 100644 (file)
index 0000000..8869410
--- /dev/null
@@ -0,0 +1 @@
+#include monotouch_watch_System.dll.exclude.sources
index 7c0bd5983a519e8499a57c6c30b9be525658c105..c8c328c5ce6605a85a7e34f0db5e1f2c7335d9bb 100644 (file)
@@ -1 +1 @@
-#include monotouch_System.dll.sources
+#include monotouch_watch_System.dll.sources
index cff36539f3bee4d78e7a34495ad889df5509b2bd..22edb63a4c4e85b59fdae28b2bff4daa4e858c72 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index ed37cbc38ad5a2b1f4ca4ae9b79219d53b750ec1..3f87398b1606e3e6b69664f2f85440cef7d6da84 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 927528aa2960f68f2974b8f22c8f14feb23731c5..0d885863e40dca27d28abfe999b709dd9758961a 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 WebMatrix.Data/ConnectionEventArgsTests.cs
 WebMatrix.Data/DynamicRecordTests.cs
 ../WebMatrix.Data/DynamicRecord.cs
old mode 100644 (file)
new mode 100755 (executable)
index e4b4ae1..002d592
@@ -404,7 +404,12 @@ namespace System.IO.Packaging {
                                throw new FileFormatException ("Stream length cannot be zero with FileMode.Open");
 
                        Stream s = File.Open (path, packageMode, packageAccess, packageShare);
-                       return Open (s, packageMode, packageAccess, true);
+                       try {
+                               return Open (s, packageMode, packageAccess, true);
+                       } catch {
+                               s.Close  ();
+                               throw;
+                       }
                }
 
                static Package OpenCore (Stream stream, FileMode packageMode, FileAccess packageAccess, bool ownsStream)
index e83008d4452c91ba8e6e4ffe00dc566eaba6f6e5..6fddadb2f9167de43dcc81e91ce1875d9548c3f6 100644 (file)
@@ -259,6 +259,7 @@ namespace MonoTests.System.Windows {
                }
 
                [Test]
+               [SetCulture ("en-us")]
                public void ToStringTest ()
                {
                        Rect r = new Rect (1.0, 2.5, 3, 4);
index 5ac7164723c0f5473c203026edc0d7e2748e3e89..ed09cea235c246e046c531991e357ce1276e2505 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="System.Windows\WeakEventManager.cs" />\r
     <Compile Include="ZipSharp\IOFunctions.cs" />\r
     <Compile Include="ZipSharp\NativeUnzip.cs" />\r
+    <Compile Include="ZipSharp\NativeVersion.cs" />\r
     <Compile Include="ZipSharp\NativeZip.cs" />\r
     <Compile Include="ZipSharp\UnzipArchive.cs" />\r
     <Compile Include="ZipSharp\UnzipFileInfo.cs" />\r
index f0a6e5c2ab68e58364251c20accbd8f2784cb8ca..c36c7ce5608ab796e4a659abf9e57fae4d39ae48 100644 (file)
@@ -181,6 +181,7 @@ System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs
 System.Windows.Threading/DispatcherUnhandledExceptionEventHandler.cs
 System.Windows.Threading/DispatcherUnhandledExceptionFilterEventArgs.cs
 System.Windows.Threading/DispatcherUnhandledExceptionFilterEventHandler.cs
+ZipSharp/NativeVersion.cs
 ZipSharp/IOFunctions.cs
 ZipSharp/ZipArchive.cs
 ZipSharp/UnzipArchive.cs
index 64a199a988f901a3ee633c09c67cb3375e7ac439..620b1628eb850d629601e5a21e78704235dde29f 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 System.Collections.ObjectModel/ObservableCollectionTest.cs
 System.Collections.ObjectModel/ReadOnlyObservableCollectionTest.cs
 System.Collections.Specialized/NotifyCollectionChangedEventArgsTest.cs
index 04e6a3e9ca79e7919b62d2e245dc17959a5f1be2..d339f84425e9fdd4e006e4c9384664170a678629 100644 (file)
@@ -21,16 +21,28 @@ namespace zipsharp
        internal delegate IntPtr OpenFileFunc (IntPtr opaque, string filename, int mode);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
-       internal delegate /* ulong */ IntPtr ReadFileFunc (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size);
+       internal delegate /* uLong */ uint ReadFileFunc32 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* uLong */ uint size);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
-       internal delegate /* ulong */ IntPtr WriteFileFunc (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size);
+       internal delegate /* uLong */ uint WriteFileFunc32 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* uLong */ uint size);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
-       internal delegate /* long */ IntPtr TellFileFunc (IntPtr opaque, IntPtr stream);
+       internal delegate /* long */ int TellFileFunc32 (IntPtr opaque, IntPtr stream);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
-       internal delegate /* long */ IntPtr SeekFileFunc (IntPtr opaque, IntPtr stream, /* ulong */ IntPtr offset, int origin);
+       internal delegate /* long */ int SeekFileFunc32 (IntPtr opaque, IntPtr stream, /* uLong */ uint offset, int origin);
+
+       [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
+       internal delegate /* uLong */ ulong ReadFileFunc64 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* uLong */ ulong size);
+
+       [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
+       internal delegate /* uLong */ ulong WriteFileFunc64 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* uLong */ ulong size);
+
+       [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
+       internal delegate /* long */ long TellFileFunc64 (IntPtr opaque, IntPtr stream);
+
+       [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
+       internal delegate /* long */ long SeekFileFunc64 (IntPtr opaque, IntPtr stream, /* uLong */ ulong offset, int origin);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
        internal delegate int CloseFileFunc (IntPtr opaque, IntPtr stream);
@@ -39,13 +51,26 @@ namespace zipsharp
        internal delegate int TestErrorFileFunc (IntPtr opaque, IntPtr stream);
 
        [StructLayout (LayoutKind.Sequential)]
-       internal struct ZlibFileFuncDef
+       internal struct ZlibFileFuncDef32
+       {
+               [MarshalAs (UnmanagedType.FunctionPtr)] public OpenFileFunc      zopen_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public ReadFileFunc32    zread_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public WriteFileFunc32   zwrite_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public TellFileFunc32    ztell_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public SeekFileFunc32    zseek_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public CloseFileFunc     zclose_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public TestErrorFileFunc zerror_file;
+               public IntPtr            opaque;
+       }
+
+       [StructLayout (LayoutKind.Sequential)]
+       internal struct ZlibFileFuncDef64
        {
                [MarshalAs (UnmanagedType.FunctionPtr)] public OpenFileFunc      zopen_file;
-               [MarshalAs (UnmanagedType.FunctionPtr)] public ReadFileFunc      zread_file;
-               [MarshalAs (UnmanagedType.FunctionPtr)] public WriteFileFunc     zwrite_file;
-               [MarshalAs (UnmanagedType.FunctionPtr)] public TellFileFunc      ztell_file;
-               [MarshalAs (UnmanagedType.FunctionPtr)] public SeekFileFunc      zseek_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public ReadFileFunc64    zread_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public WriteFileFunc64   zwrite_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public TellFileFunc64    ztell_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public SeekFileFunc64    zseek_file;
                [MarshalAs (UnmanagedType.FunctionPtr)] public CloseFileFunc     zclose_file;
                [MarshalAs (UnmanagedType.FunctionPtr)] public TestErrorFileFunc zerror_file;
                public IntPtr            opaque;
index 3b3c3dc5d87dcf92a442a238a6dd325c1de151fe..673a2c921ebe3f240d4e0110c503983553c10d34 100644 (file)
@@ -65,43 +65,58 @@ namespace zipsharp
                        return unztell(handle).ToInt64 ();
                }
 
-               public static long CurrentFileLength (UnzipHandle handle)
+               public static long CurrentFileLength32 (UnzipHandle handle)
                {
-                       UnzipFileInfo info;
-                       int result = unzGetCurrentFileInfo (handle, out info, null, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, null,  IntPtr.Zero);
-                       
-                       if (result != 0)
-                               return -1;
-                       else
-                               return (long)info.UncompressedSize;
+                       UnzipFileInfo32 info;
+                       int result = unzGetCurrentFileInfo_32 (handle, out info, null, 0, IntPtr.Zero, 0, null,  0);
+                       return result != 0 ? -1 : (long) info.uncompressed_size;
                }
-               
-               static string GetCurrentFileName (UnzipHandle handle)
+
+               public static long CurrentFileLength64 (UnzipHandle handle)
                {
-                       UnzipFileInfo info;
-                       int result = unzGetCurrentFileInfo (handle, out info, null, IntPtr.Zero, IntPtr.Zero, new IntPtr (0), null,  IntPtr.Zero);
+                       UnzipFileInfo64 info;
+                       int result = unzGetCurrentFileInfo_64 (handle, out info, null, 0, IntPtr.Zero, 0, null,  0);
+                       return result != 0 ? -1 : (long) info.uncompressed_size;
+               }
 
-                       if (result != 0)
+               static string GetCurrentFileName32 (UnzipHandle handle)
+               {
+                       UnzipFileInfo32 info;
+                       if (unzGetCurrentFileInfo_32 (handle, out info, null, 0, IntPtr.Zero, 0, null, 0) != 0)
                                return null;
-                       
-                       StringBuilder sbName = new StringBuilder ((int)info.SizeFilename+1); // +1 to account for extra \0 at the end
-                       result = unzGetCurrentFileInfo (handle, out info, sbName, new IntPtr (sbName.Capacity), IntPtr.Zero, new IntPtr (0), null,  IntPtr.Zero);
-                       
-                       if (result != 0)
+                       var sbName = new StringBuilder ((int) info.size_filename + 1); // +1 to account for extra \0 at the end
+                       if (unzGetCurrentFileInfo_32 (handle, out info, sbName, (uint) sbName.Capacity, IntPtr.Zero, 0, null, 0) != 0)
                                return null;
-                       else
-                               return sbName.ToString ();
+                       return sbName.ToString ();
                }
 
-               public static string[] GetFiles (UnzipHandle handle)
+               static string GetCurrentFileName64 (UnzipHandle handle)
                {
-                       List<string> files = new List<string> ();
+                       UnzipFileInfo64 info;
+                       if (unzGetCurrentFileInfo_64 (handle, out info, null, 0, IntPtr.Zero, 0, null, 0) != 0)
+                               return null;
+                       var sbName = new StringBuilder ((int) info.size_filename + 1); // +1 to account for extra \0 at the end
+                       if (unzGetCurrentFileInfo_64 (handle, out info, sbName, (uint) sbName.Capacity, IntPtr.Zero, 0, null, 0) != 0)
+                               return null;
+                       return sbName.ToString ();
+               }
 
-                       GoToFirstFile (handle);
+               public static string[] GetFiles32 (UnzipHandle handle)
+               {
+                       return GetFiles (handle, GetCurrentFileName32);
+               }
+
+               public static string[] GetFiles64 (UnzipHandle handle)
+               {
+                       return GetFiles (handle, GetCurrentFileName64);
+               }
 
+               private static string[] GetFiles (UnzipHandle handle, Func<UnzipHandle, string> getCurrentFileName)
+               {
+                       GoToFirstFile (handle);
+                       var files = new List<string> ();
                        string name;
-                       while ((name = GetCurrentFileName(handle)) != null)
-                       {
+                       while ((name = getCurrentFileName (handle)) != null) {
                                files.Add (name);
                                if (!NativeUnzip.GoToNextFile (handle))
                                        break;
@@ -121,9 +136,17 @@ namespace zipsharp
                        return unzGoToNextFile(handle) == 0;
                }
                
-               public static UnzipHandle OpenArchive (ZlibFileFuncDef fileFuncs)
+               public static UnzipHandle OpenArchive32 (ZlibFileFuncDef32 fileFuncs)
+               {
+                       UnzipHandle handle = unzOpen2_32 ("", ref fileFuncs);
+                       if (handle.IsInvalid)
+                               throw new Exception ("Could not open unzip archive");
+                       return handle;
+               }
+
+               public static UnzipHandle OpenArchive64 (ZlibFileFuncDef64 fileFuncs)
                {
-                       UnzipHandle handle = unzOpen2 ("", ref fileFuncs);
+                       UnzipHandle handle = unzOpen2_64 ("", ref fileFuncs);
                        if (handle.IsInvalid)
                                throw new Exception ("Could not open unzip archive");
                        return handle;
@@ -160,9 +183,13 @@ namespace zipsharp
                [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
                static extern int unzGoToFirstFile (UnzipHandle handle);
 
-               [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
-               static extern UnzipHandle unzOpen2 (string path,
-                                                           ref ZlibFileFuncDef pzlib_filefunc_def);
+               [DllImport ("MonoPosixHelper", EntryPoint="unzOpen2", CallingConvention=CallingConvention.Cdecl)]
+               static extern UnzipHandle unzOpen2_32 (string path,
+                                                      ref ZlibFileFuncDef32 pzlib_filefunc_def);
+
+               [DllImport ("MonoPosixHelper", EntryPoint="unzOpen2", CallingConvention=CallingConvention.Cdecl)]
+               static extern UnzipHandle unzOpen2_64 (string path,
+                                                      ref ZlibFileFuncDef64 pzlib_filefunc_def);
 
                [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
                static extern int unzGoToNextFile (UnzipHandle handle);
@@ -178,15 +205,25 @@ namespace zipsharp
                                                       out int level,
                                                       int raw);
 
-               [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
-               static extern int unzGetCurrentFileInfo (UnzipHandle handle,
-                                                                out UnzipFileInfo pfile_info,
-                                                                StringBuilder szFileName,
-                                                                IntPtr fileNameBufferSize,   // uLong
-                                                                IntPtr extraField,           // void *
-                                                                IntPtr extraFieldBufferSize, // uLong
-                                                                StringBuilder szComment,
-                                                                IntPtr commentBufferSize);   // uLong
+               [DllImport ("MonoPosixHelper", EntryPoint="unzGetCurrentFileInfo", CallingConvention=CallingConvention.Cdecl)]
+               static extern int unzGetCurrentFileInfo_32 (UnzipHandle handle,
+                                                           out UnzipFileInfo32 pfile_info,
+                                                           StringBuilder szFileName,
+                                                           uint fileNameBufferSize,   // uLong
+                                                           IntPtr extraField,         // void *
+                                                           uint extraFieldBufferSize, // uLong
+                                                           StringBuilder szComment,
+                                                           uint commentBufferSize);   // uLong
+
+               [DllImport ("MonoPosixHelper", EntryPoint="unzGetCurrentFileInfo", CallingConvention=CallingConvention.Cdecl)]
+               static extern int unzGetCurrentFileInfo_64 (UnzipHandle handle,
+                                                           out UnzipFileInfo64 pfile_info,
+                                                           StringBuilder szFileName,
+                                                           ulong fileNameBufferSize,   // uLong
+                                                           IntPtr extraField,          // void *
+                                                           ulong extraFieldBufferSize, // uLong
+                                                           StringBuilder szComment,
+                                                           ulong commentBufferSize);   // uLong
 
                [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
                static unsafe extern int unzReadCurrentFile (UnzipHandle handle,
diff --git a/mcs/class/WindowsBase/ZipSharp/NativeVersion.cs b/mcs/class/WindowsBase/ZipSharp/NativeVersion.cs
new file mode 100755 (executable)
index 0000000..ce7112e
--- /dev/null
@@ -0,0 +1,20 @@
+using System;
+
+namespace zipsharp {
+       static class NativeVersion {
+
+               /// <summary>
+               /// ZipSharp code needs different code paths
+               /// depending on the size of the C long type on the underlying platform. On
+               /// gcc/clang the C long type follows the bitness of the targeted architecture,
+               /// it's 32-bit on 32-bit systems and 64-bit on 64-bit systems. With the VS
+               /// compiler however, the C long type is always 32-bit regardless of the
+               /// target architecture. zlib and minizip uses C long in a number of 
+               /// different function signatures and structs. 
+               /// 
+               /// This field is used to easily determine if the 32 bit version of 
+               /// functions and structs should be used when interacting with zlib.
+               /// </summary>
+               public static readonly bool Use32Bit = IntPtr.Size == 4 || Environment.OSVersion.Platform != PlatformID.Unix;
+       }
+}
index 225fc1acaba49b94a58b6999f54388d202c154e1..b556a9052e661d40251b895a24648346f7413466 100644 (file)
@@ -31,24 +31,44 @@ namespace zipsharp
                        zipCloseFileInZip (handle);
                }
 
-               public static ZipHandle OpenArchive (ZlibFileFuncDef funcDef, Append append)
+               public static ZipHandle OpenArchive32 (ZlibFileFuncDef32 funcDef, Append append)
                {
-                       ZipHandle h = zipOpen2 ("", (int) append, IntPtr.Zero, ref funcDef);
+                       ZipHandle h = zipOpen2_32 ("", (int) append, IntPtr.Zero, ref funcDef);
                        if (h.IsInvalid)
                                throw new Exception ("Could not open the zip archive");
                        return h;
                }
-               
-               public static int OpenFile (ZipHandle handle, string filename)
+
+               public static ZipHandle OpenArchive64 (ZlibFileFuncDef64 funcDef, Append append)
+               {
+                       ZipHandle h = zipOpen2_64 ("", (int) append, IntPtr.Zero, ref funcDef);
+                       if (h.IsInvalid)
+                               throw new Exception ("Could not open the zip archive");
+                       return h;
+               }
+
+               public static int OpenFile32 (ZipHandle handle, string filename)
+               {
+                       return OpenFile32 (handle, filename, DEFAULT_COMPRESSION);
+               }
+
+               public static int OpenFile32 (ZipHandle handle, string filename, int compressionLevel)
+               {
+                       ZipFileInfo32 fileInfo = new ZipFileInfo32 (DateTime.Now);
+                       int method = compressionLevel == 0 ? 0 : Z_DEFLATED;
+                       return zipOpenNewFileInZip_32 (handle, filename, ref fileInfo, IntPtr.Zero, 0, IntPtr.Zero, 0, "", method, compressionLevel);
+               }
+
+               public static int OpenFile64 (ZipHandle handle, string filename)
                {
-                       return OpenFile (handle, filename, DEFAULT_COMPRESSION);
+                       return OpenFile64 (handle, filename, DEFAULT_COMPRESSION);
                }
 
-               public static int OpenFile (ZipHandle handle, string filename, int compressionLevel)
+               public static int OpenFile64 (ZipHandle handle, string filename, int compressionLevel)
                {
-                       ZipFileInfo fileInfo = new ZipFileInfo (DateTime.Now);
+                       ZipFileInfo64 fileInfo = new ZipFileInfo64 (DateTime.Now);
                        int method = compressionLevel == 0 ? 0 : Z_DEFLATED;
-                       return zipOpenNewFileInZip (handle, filename, ref fileInfo, IntPtr.Zero, 0, IntPtr.Zero, 0, "", method, compressionLevel);
+                       return zipOpenNewFileInZip_64 (handle, filename, ref fileInfo, IntPtr.Zero, 0, IntPtr.Zero, 0, "", method, compressionLevel);
                }
 
                public static unsafe void Write (ZipHandle handle, byte[] buffer, int offset, uint count)
@@ -65,26 +85,43 @@ namespace zipsharp
                [DllImport ("MonoPosixHelper")]
                static extern int zipCloseFileInZip (ZipHandle handle);
 
-               [DllImport ("MonoPosixHelper")]
-               static extern ZipHandle zipOpen2 (string pathname,
-                                                 int append,
-                                                 IntPtr globalcomment, // zipcharpc*
-                                                 ref ZlibFileFuncDef pzlib_filefunc_def); // zlib_filefunc_def*
+               [DllImport ("MonoPosixHelper", EntryPoint = "zipOpen2")]
+               static extern ZipHandle zipOpen2_32 (string pathname,
+                                                    int append,
+                                                    IntPtr globalcomment, // zipcharpc*
+                                                    ref ZlibFileFuncDef32 pzlib_filefunc_def); // zlib_filefunc_def*
+
+               [DllImport ("MonoPosixHelper", EntryPoint = "zipOpen2")]
+               static extern ZipHandle zipOpen2_64 (string pathname,
+                                                    int append,
+                                                    IntPtr globalcomment, // zipcharpc*
+                                                    ref ZlibFileFuncDef64 pzlib_filefunc_def); // zlib_filefunc_def*
 
-               
                [DllImport ("MonoPosixHelper")]
                static extern int zipClose (ZipHandle handle, string globalComment);
 
-               [DllImport ("MonoPosixHelper")]
-               static extern int zipOpenNewFileInZip (ZipHandle handle,
-                                                      string filename,
-                                                      ref ZipFileInfo zipfi,
-                                                      IntPtr extrafield_local,
-                                                      uint size_extrafield_local,
-                                                      IntPtr extrafield_global,
-                                                      uint size_extrafield_global,
-                                                      string comment,
-                                                      int method,
-                                                      int level);
+               [DllImport ("MonoPosixHelper", EntryPoint = "zipOpenNewFileInZip")]
+               static extern int zipOpenNewFileInZip_32 (ZipHandle handle,
+                                                         string filename,
+                                                         ref ZipFileInfo32 zipfi,
+                                                         IntPtr extrafield_local,
+                                                         uint size_extrafield_local,
+                                                         IntPtr extrafield_global,
+                                                         uint size_extrafield_global,
+                                                         string comment,
+                                                         int method,
+                                                         int level);
+
+               [DllImport ("MonoPosixHelper", EntryPoint = "zipOpenNewFileInZip")]
+               static extern int zipOpenNewFileInZip_64 (ZipHandle handle,
+                                                         string filename,
+                                                         ref ZipFileInfo64 zipfi,
+                                                         IntPtr extrafield_local,
+                                                         uint size_extrafield_local,
+                                                         IntPtr extrafield_global,
+                                                         uint size_extrafield_global,
+                                                         string comment,
+                                                         int method,
+                                                         int level);
        }
 }
index d3be55886bf8cb9ed2b646c8911db857cfb740a3..59a5935c1128bb07ad734a9d339ce6348763ff25 100644 (file)
@@ -38,7 +38,7 @@ namespace zipsharp
                string[] Files {
                        get {
                                if (files == null)
-                                       files = NativeUnzip.GetFiles (Handle);
+                                       files = NativeVersion.Use32Bit ? NativeUnzip.GetFiles32 (Handle) : NativeUnzip.GetFiles64 (Handle);
                                return files;
                        }
                }
@@ -66,7 +66,7 @@ namespace zipsharp
                public UnzipArchive (Stream stream, bool ownsStream)
                {
                        Stream = new ZipStream (stream, ownsStream);
-                       Handle = NativeUnzip.OpenArchive (Stream.IOFunctions);
+                       Handle = NativeVersion.Use32Bit ? NativeUnzip.OpenArchive32 (Stream.IOFunctions32) : NativeUnzip.OpenArchive64 (Stream.IOFunctions64);
                }
 
                public void Dispose ()
index 9316c0a1773d617a8c26b266ddec0dd51d764723..d69241d7fa50ef1dab26f4597b4a10b614a3672e 100644 (file)
@@ -10,103 +10,46 @@ using System.Runtime.InteropServices;
 namespace zipsharp
 {
        [StructLayout (LayoutKind.Sequential)]
-       struct UnzipFileInfo
+       struct UnzipFileInfo32
        {
-           IntPtr version;              /* version made by                 2 bytes */
-           IntPtr version_needed;       /* version needed to extract       2 bytes */
-           IntPtr flag;                 /* general purpose bit flag        2 bytes */
-           IntPtr compression_method;   /* compression method              2 bytes */
-           IntPtr dosDate;              /* last mod file date in Dos fmt   4 bytes */
-           IntPtr crc;                  /* crc-32                          4 bytes */
-           IntPtr compressed_size;      /* compressed size                 4 bytes */
-           IntPtr uncompressed_size;    /* uncompressed size               4 bytes */
-           IntPtr size_filename;        /* filename length                 2 bytes */
-           IntPtr size_file_extra;      /* extra field length              2 bytes */
-           IntPtr size_file_comment;    /* file comment length             2 bytes */
+               public uint version;              /* version made by                 2 bytes */
+               public uint version_needed;       /* version needed to extract       2 bytes */
+               public uint flag;                 /* general purpose bit flag        2 bytes */
+               public uint compression_method;   /* compression method              2 bytes */
+               public uint dosDate;              /* last mod file date in Dos fmt   4 bytes */
+               public uint crc;                  /* crc-32                          4 bytes */
+               public uint compressed_size;      /* compressed size                 4 bytes */
+               public uint uncompressed_size;    /* uncompressed size               4 bytes */
+               public uint size_filename;        /* filename length                 2 bytes */
+               public uint size_file_extra;      /* extra field length              2 bytes */
+               public uint size_file_comment;    /* file comment length             2 bytes */
        
-           IntPtr disk_num_start;       /* disk number start               2 bytes */
-           IntPtr internal_fa;          /* internal file attributes        2 bytes */
-           IntPtr external_fa;          /* external file attributes        4 bytes */
+               public uint disk_num_start;       /* disk number start               2 bytes */
+               public uint internal_fa;          /* internal file attributes        2 bytes */
+               public uint external_fa;          /* external file attributes        4 bytes */
        
            ZipTime tmu_date;
-           
-           public ulong VersionNeeded {
-               get { return (ulong)version_needed.ToInt64 (); }
-               set { version_needed = new IntPtr ((int)value); }
-           }
-           
-           public ulong Version {
-               get { return (ulong)version.ToInt64 (); }
-               set { version = new IntPtr ((int)value); }
-           }
-           
-           public ulong UncompressedSize {
-               get { return (ulong)uncompressed_size.ToInt64 (); }
-                       set { uncompressed_size = new IntPtr ((int)value); }
-           }
-           
-           public ZipTime TmuDate {
-               get { return tmu_date; }
-               set { tmu_date = value; }
-           }
-           
-           public ulong SizeFilename {
-               get { return (ulong)size_filename.ToInt64 (); }
-               set { size_filename = new IntPtr ((int)value); }
-           }
-           
-           public ulong SizeFileExtra {
-               get { return (ulong)size_file_extra.ToInt64 (); }
-               set { size_file_extra = new IntPtr ((int)value); }
-           }
-           
-           public ulong SizeFileComment {
-               get {
-                       return (ulong)size_file_comment.ToInt64 ();
-               }
-               set {
-                       size_file_comment = new IntPtr ((int)value);
-               }
-           }
-           
-           public ulong InternalFa {
-               get { return (ulong)internal_fa.ToInt64 (); }
-               set { internal_fa = new IntPtr ((int)value); }
-           }
-           
-           public ulong Flag {
-               get { return (ulong)flag.ToInt64 (); }
-               set { flag = new IntPtr ((int)value); }
-           }
-           
-           public ulong ExternalFa {
-               get { return (ulong)external_fa.ToInt64 (); }
-               set { external_fa = new IntPtr ((int)value); }
-           }
-           
-           public ulong DosDate {
-               get { return (ulong)dosDate.ToInt64 (); }
-               set { dosDate = new IntPtr ((int)value); }
-           }
-           
-           public ulong DiskNumStart {
-               get { return (ulong)disk_num_start.ToInt64 (); }
-               set { disk_num_start = new IntPtr ((int)value); }
-           }
-           
-           public ulong Crc {
-               get { return (ulong)crc.ToInt64 (); }
-               set { crc = new IntPtr ((int)value); }
-           }
-           
-           public ulong CompressionMethod {
-               get { return (ulong)compression_method.ToInt64 (); }
-               set { compression_method = new IntPtr ((int)value); }
-           }
-           
-           public ulong CompressedSize {
-               get { return (ulong)compressed_size.ToInt64 (); }
-               set { compressed_size = new IntPtr ((int)value); }
-           }
+       }
+
+       [StructLayout (LayoutKind.Sequential)]
+       struct UnzipFileInfo64
+       {
+               public ulong version;              /* version made by                 2 bytes */
+               public ulong version_needed;       /* version needed to extract       2 bytes */
+               public ulong flag;                 /* general purpose bit flag        2 bytes */
+               public ulong compression_method;   /* compression method              2 bytes */
+               public ulong dosDate;              /* last mod file date in Dos fmt   4 bytes */
+               public ulong crc;                  /* crc-32                          4 bytes */
+               public ulong compressed_size;      /* compressed size                 4 bytes */
+               public ulong uncompressed_size;    /* uncompressed size               4 bytes */
+               public ulong size_filename;        /* filename length                 2 bytes */
+               public ulong size_file_extra;      /* extra field length              2 bytes */
+               public ulong size_file_comment;    /* file comment length             2 bytes */
+
+               public ulong disk_num_start;       /* disk number start               2 bytes */
+               public ulong internal_fa;          /* internal file attributes        2 bytes */
+               public ulong external_fa;          /* external file attributes        4 bytes */
+
+               ZipTime tmu_date;
        }
 }
index 39c793e8e0b2146ab808b62350689aa6453e9377..71cc129006d23f0581d3aae3a3e0c933d1d6e325 100644 (file)
@@ -70,7 +70,7 @@ namespace zipsharp
                        Archive = archive;
                        Archive.FileActive = true;
                        CompressionLevel = compressionLevel;
-                       length = NativeUnzip.CurrentFileLength (Archive.Handle);
+                       length = NativeVersion.Use32Bit ? NativeUnzip.CurrentFileLength32 (Archive.Handle) : NativeUnzip.CurrentFileLength64 (Archive.Handle);
                }
 
                public override void Close()
index 8f60aab4e9eedc97a8f48be7ffadc1e8e50e56b4..598d163991c8821d2540e28ee9b65d9f4c2565a6 100644 (file)
@@ -31,7 +31,7 @@ namespace zipsharp
                public ZipArchive (Stream stream, Append append, bool ownsStream)
                {
                        Stream = new ZipStream (stream, ownsStream);
-                       Handle = NativeZip.OpenArchive (Stream.IOFunctions, append);
+                       Handle = NativeVersion.Use32Bit ? NativeZip.OpenArchive32 (Stream.IOFunctions32, append) : NativeZip.OpenArchive64 (Stream.IOFunctions64, append);
                }
 
                
@@ -61,8 +61,11 @@ namespace zipsharp
                {
                        if (FileActive)
                                throw new InvalidOperationException ("A file is already open");
-                       
-                       NativeZip.OpenFile (Handle, filename, ConvertCompression (option));
+
+                       if (NativeVersion.Use32Bit)
+                               NativeZip.OpenFile32 (Handle, filename, ConvertCompression (option));
+                       else
+                               NativeZip.OpenFile64 (Handle, filename, ConvertCompression (option));
                        return new ZipWriteStream (this);
                }
 
index 2a81a73959bba6ddcf3595874bb9651989261160..0c3f0eeb7f98fefaa786a2c47db873fe1392acd9 100644 (file)
@@ -10,40 +10,36 @@ using System.Runtime.InteropServices;
 namespace zipsharp
 {
        [StructLayoutAttribute (LayoutKind.Sequential)]
-       struct ZipFileInfo
+       struct ZipFileInfo32
        {
                ZipTime date;
-               IntPtr dosDate;
-               IntPtr internalFileAttributes;
-               IntPtr externalFileAttributes;
+               uint dosDate;
+               uint internalFileAttributes;
+               uint externalFileAttributes;
 
-               public DateTime FileTime
+               public ZipFileInfo32 (DateTime fileTime)
                {
-                       get { return date.Date; }
+                       date = new ZipTime (fileTime);
+                       dosDate = 0;
+                       internalFileAttributes = 0;
+                       externalFileAttributes = 0;
                }
+       }
 
-               public long DosDate
-               {
-                       get { return dosDate.ToInt64 (); }
-               }
-               
-               internal long InternalFileAttributes
-               {
-                       get { return internalFileAttributes.ToInt64 (); }
-               }
+       [StructLayoutAttribute (LayoutKind.Sequential)]
+       struct ZipFileInfo64
+       {
+               ZipTime date;
+               ulong dosDate;
+               ulong internalFileAttributes;
+               ulong externalFileAttributes;
 
-               internal long ExternalFileAttributes
-               {
-                       get { return externalFileAttributes.ToInt64 (); }
-               }
-               
-               public ZipFileInfo (DateTime fileTime)
+               public ZipFileInfo64 (DateTime fileTime)
                {
                        date = new ZipTime (fileTime);
-                       dosDate = IntPtr.Zero;
-                       internalFileAttributes = IntPtr.Zero;
-                       externalFileAttributes = IntPtr.Zero;
+                       dosDate = 0;
+                       internalFileAttributes = 0;
+                       externalFileAttributes = 0;
                }
-
        }
 }
index 51d15c56c12dfa67691c08f2019edcedbd9c4851..f0007dfb8a244c059a0f511be0fb900b6fdda0cf 100644 (file)
@@ -40,7 +40,11 @@ namespace zipsharp
                        get; set;
                }
 
-               public ZlibFileFuncDef IOFunctions {
+               public ZlibFileFuncDef32 IOFunctions32 {
+                       get; set;
+               }
+
+               public ZlibFileFuncDef64 IOFunctions64 {
                        get; set;
                }
 
@@ -67,18 +71,27 @@ namespace zipsharp
                        DataStream = dataStream;
                        OwnsStream = ownsStream;
                        
-                       ZlibFileFuncDef f = new ZlibFileFuncDef();
-                       
-                       f.opaque = IntPtr.Zero;
-                       f.zclose_file = CloseFile_Native;
-                       f.zerror_file = TestError_Native;
-                       f.zopen_file = OpenFile_Native;
-                       f.zread_file = ReadFile_Native;
-                       f.zseek_file = SeekFile_Native;
-                       f.ztell_file = TellFile_Native;
-                       f.zwrite_file = WriteFile_Native;
-
-                       IOFunctions = f;
+                       ZlibFileFuncDef32 f32 = new ZlibFileFuncDef32 ();
+                       f32.opaque = IntPtr.Zero;
+                       f32.zclose_file = CloseFile_Native;
+                       f32.zerror_file = TestError_Native;
+                       f32.zopen_file = OpenFile_Native;
+                       f32.zread_file = ReadFile_Native32;
+                       f32.zseek_file = SeekFile_Native32;
+                       f32.ztell_file = TellFile_Native32;
+                       f32.zwrite_file = WriteFile_Native32;
+                       IOFunctions32 = f32;
+
+                       ZlibFileFuncDef64 f64 = new ZlibFileFuncDef64 ();
+                       f64.opaque = IntPtr.Zero;
+                       f64.zclose_file = CloseFile_Native;
+                       f64.zerror_file = TestError_Native;
+                       f64.zopen_file = OpenFile_Native;
+                       f64.zread_file = ReadFile_Native64;
+                       f64.zseek_file = SeekFile_Native64;
+                       f64.ztell_file = TellFile_Native64;
+                       f64.zwrite_file = WriteFile_Native64;
+                       IOFunctions64 = f64;
                }
 
                protected override void Dispose(bool disposing)
@@ -130,9 +143,14 @@ namespace zipsharp
                        return new IntPtr (1);
                }
 
-               unsafe IntPtr ReadFile_Native (IntPtr opaque, IntPtr stream, IntPtr buffer, IntPtr size)
+               unsafe uint ReadFile_Native32 (IntPtr opaque, IntPtr stream, IntPtr buffer, uint size)
                {
-                       int count = size.ToInt32 ();
+                       return (uint) ReadFile_Native64 (opaque, stream, buffer, size);
+               }
+
+               unsafe ulong ReadFile_Native64 (IntPtr opaque, IntPtr stream, IntPtr buffer, ulong size)
+               {
+                       int count = (int) size;
                        byte[] b = new byte[count];
                        int read;
                        
@@ -145,10 +163,15 @@ namespace zipsharp
                                read = -1;
                        }
 
-                       return new IntPtr (read);
+                       return (ulong) read;
                }
 
-               IntPtr SeekFile_Native (IntPtr opaque, IntPtr stream, IntPtr offset, int origin)
+               int SeekFile_Native32 (IntPtr opaque, IntPtr stream, uint offset, int origin)
+               {
+                       return (int) SeekFile_Native64 (opaque, stream, offset, origin);
+               }
+
+               long SeekFile_Native64 (IntPtr opaque, IntPtr stream, ulong offset, int origin)
                {
                        SeekOrigin seek;
                        if (origin == ZipStream.ZLIB_FILEFUNC_SEEK_CUR)
@@ -158,21 +181,21 @@ namespace zipsharp
                        else if (origin == ZLIB_FILEFUNC_SEEK_SET)
                                seek = SeekOrigin.Begin;
                        else
-                               return new IntPtr (-1);
+                               return -1;
 
-                       Seek (offset.ToInt64 (), seek);
+                       Seek ((long) offset, seek);
                        
-                       return new IntPtr (0);
+                       return 0;
                }
 
-               IntPtr TellFile_Native (IntPtr opaque, IntPtr stream)
+               int TellFile_Native32 (IntPtr opaque, IntPtr stream)
                {
-                       if (IntPtr.Size == 4)
-                               return new IntPtr ((int)Position);
-                       else if (IntPtr.Size == 8)
-                               return new IntPtr (Position);
-                       else
-                               return new IntPtr (-1);
+                       return (int) TellFile_Native64 (opaque, stream);
+               }
+
+               long TellFile_Native64 (IntPtr opaque, IntPtr stream)
+               {
+                       return Position;
                }
 
                int TestError_Native (IntPtr opaque, IntPtr stream)
@@ -181,9 +204,14 @@ namespace zipsharp
                        return 0;
                }
 
-               unsafe IntPtr WriteFile_Native (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size)
+               unsafe uint WriteFile_Native32 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ uint size)
+               {
+                       return (uint) WriteFile_Native64 (opaque, stream, buffer, size);
+               }
+
+               unsafe ulong WriteFile_Native64 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ ulong size)
                {
-                       int count = size.ToInt32 ();
+                       int count = (int) size;
                        byte[] b = new byte[count];
 
                        byte* ptrBuffer = (byte*) buffer.ToPointer ();
@@ -196,7 +224,7 @@ namespace zipsharp
                                
                        }
 
-                       return new IntPtr (count);
+                       return (ulong) count;
                }
        }
 }
index 3f22e653c194bb21bb73162180d68468beb1be8e..f01e0b18164ae532270648e0c0d9ca2a3144a347 100644 (file)
@@ -28,7 +28,6 @@ LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
 ifndef SKIP_AOT
 
 ifdef PLATFORM_AOT_SUFFIX
-Q_AOT=$(if $(V),,@echo "AOT     [$(PROFILE)] $(notdir $(@))";)
 $(mcs_aot_image): $(mcs_exe) $(mscorlib_dll) $(runtime_dep)
        $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(mcs_aot_image) --debug $(mcs_exe) || cat $(PROFILE)_aot.log || (cat $(PROFILE)_aot.log; exit 1)
 
index d315128745d2cf9d351027e6d2ace24674ff0a7c..6dc94160d19aa713ed172469e82102f8c9396bbd 100644 (file)
@@ -83,6 +83,7 @@ using System.Runtime.InteropServices;
 [assembly: InternalsVisibleTo ("Xamarin.TVOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
 #elif MONOTOUCH_WATCH
 [assembly: InternalsVisibleTo ("Xamarin.WatchOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
+[assembly: InternalsVisibleTo ("System.Security, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
 #else
 [assembly: InternalsVisibleTo ("monotouch, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
 [assembly: InternalsVisibleTo ("Xamarin.iOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
index a112faf5570d99236ce2888b1c778a061d6dc4cf..a35fe1dc666eb5bcfb05e1e1fca35b2a7c611c7c 100644 (file)
@@ -39,6 +39,18 @@ namespace System.Security.Cryptography {
                {
                }
                
+               public RNGCryptoServiceProvider (byte[] rgb)
+               {
+               }
+
+               public RNGCryptoServiceProvider (CspParameters cspParams)
+               {
+               }
+
+               public RNGCryptoServiceProvider (string str) 
+               {
+               }
+
                ~RNGCryptoServiceProvider () 
                {
                }
index a0f17b0f19628aa6324538c6b019eb9e263223f7..c05eb88982187a2070f9c67e3eec257a9d60caf9 100644 (file)
@@ -35,7 +35,7 @@ RESOURCE_FILES = \
        resources/collation.cjkKO.bin \
        resources/collation.cjkKOlv2.bin
 
-REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
+REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS
 
 ifndef MOBILE_PROFILE
 REFERENCE_SOURCES_FLAGS += -d:FEATURE_MACL
index efac37b709affdcf88a28ff4184b3d07043f777d..12148ed85d84c200f318fe12be0d087504dfff80 100644 (file)
@@ -31,7 +31,7 @@ using System.Runtime.CompilerServices;
 
 namespace Mono {
 
-#if MOBILE
+#if MOBILE || XAMMAC_4_5
        public
 #endif
        static class Runtime
@@ -40,7 +40,7 @@ namespace Mono {
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                private static extern void mono_runtime_install_handlers ();
 
-#if MOBILE
+#if MOBILE || XAMMAC_4_5
                public
 #else
                internal
@@ -50,7 +50,7 @@ namespace Mono {
                        mono_runtime_install_handlers ();
                }
 
-#if MOBILE
+#if MOBILE || XAMMAC_4_5
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                static extern void mono_runtime_cleanup_handlers ();
 
@@ -64,7 +64,7 @@ namespace Mono {
                // Safe to be called using reflection
                // Format is undefined only for use as a string for reporting
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-#if MOBILE
+#if MOBILE || XAMMAC_4_5
                public
 #else
                internal
diff --git a/mcs/class/corlib/ReferenceSources/SharedStatics.cs b/mcs/class/corlib/ReferenceSources/SharedStatics.cs
deleted file mode 100644 (file)
index 01252cc..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Threading;
-using StringMaker = System.Security.Util.Tokenizer.StringMaker;
-
-namespace System
-{
-       static class SharedStatics
-       {
-               static StringMaker shared;
-               static public StringMaker GetSharedStringMaker ()
-               {
-                       if (shared == null)
-                               Interlocked.CompareExchange (ref shared, new StringMaker (), null);
-
-                       return shared;
-               }
-
-               static public void ReleaseSharedStringMaker (ref StringMaker maker)
-               {
-
-               }
-       }
-}
\ No newline at end of file
index 370beffb237d13dfced0cf1337e278e0f83fee6c..a77d734c36617eaf2c41cc9d6b87cfe5f286118b 100644 (file)
@@ -102,6 +102,12 @@ namespace System
                        return UnderlyingSystemType;
                }
 
+               // Called from the runtime to return the corresponding finished Type object
+               internal virtual Type RuntimeResolve ()
+               {
+                       throw new NotImplementedException ();
+               }
+
                internal virtual bool IsUserType {
                        get {
                                return true;
diff --git a/mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs b/mcs/class/corlib/ReferenceSources/TypeBuilderInstantiation.cs
deleted file mode 100644 (file)
index 9e82664..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace System.Reflection.Emit
-{
-       abstract class TypeBuilderInstantiation : TypeInfo
-       {
-               internal static Type MakeGenericType (Type type, Type[] typeArguments)
-               {
-#if FULL_AOT_RUNTIME
-                       throw new NotSupportedException ("User types are not supported under full aot");
-#else
-                       return new MonoGenericClass (type, typeArguments);
-#endif
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventCounter.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventCounter.cs
new file mode 100644 (file)
index 0000000..4cb3625
--- /dev/null
@@ -0,0 +1,45 @@
+//
+// EventCounter.cs
+//
+// 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.
+//
+
+#if NETSTANDARD
+
+namespace System.Diagnostics.Tracing
+{
+       public class EventCounter
+       {
+               public EventCounter (string name, EventSource eventSource)
+               {
+               }
+
+               public void WriteMetric (float value)
+               {
+               }
+       }
+}
+
+#endif
index 8397f4c2d2f4db3bcd383e583bf265b06d486137..bb1b719404a992efd5277abda3f6909cdecc3ede 100644 (file)
@@ -151,6 +151,7 @@ namespace System.Diagnostics.Tracing
                {
                }
 
+               [CLSCompliant (false)]
                public void Write<T> (string eventName, ref EventSourceOptions options, ref T data)
                {
                }
index e6741d4d3caf2c0cf6467e382e9821c4281646eb..63c0c015978b1c58d7cc38e2ad58f74ab5318958 100644 (file)
@@ -180,7 +180,6 @@ namespace System.Globalization
                        get { return territory; }
                }
 
-#if !MOBILE
                // FIXME: It is implemented, but would be hell slow.
                [ComVisible (false)]
                public CultureTypes CultureTypes {
@@ -266,7 +265,6 @@ namespace System.Globalization
                                }
                        }
                }
-#endif
 
                public virtual int LCID {
                        get {
index 9c257cb9a80542fc882eb52ddfd9c05c58c0b2ee..ed524bb7c1878e5d63985411be8a9bf3a9dfbe9b 100644 (file)
@@ -1046,7 +1046,7 @@ namespace System.Reflection.Emit
                /*Warning, @typeArguments must be a mscorlib internal array. So make a copy before passing it in*/
                internal Type MakeGenericType (Type gtd, Type[] typeArguments)
                {
-                       return new MonoGenericClass (gtd, typeArguments);
+                       return new TypeBuilderInstantiation (gtd, typeArguments);
                }
 
                void _AssemblyBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
index 793e36fd2a01cc033d059b58e1d6d939c34cba2a..55a392d38442814419e937fdb4088f2f3bd8b526 100644 (file)
@@ -145,7 +145,11 @@ namespace System.Reflection.Emit {
                internal override Type GetParameterType (int pos) {
                        return parameters [pos];
                }
-               
+
+               internal MethodBase RuntimeResolve () {
+                       return type.RuntimeResolve ().GetConstructor (this);
+               }
+
                public override Object Invoke (Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                {
                        throw not_supported ();
@@ -372,6 +376,11 @@ namespace System.Reflection.Emit {
                                        TypeBuilder.ResolveUserTypes (types);
                        }
                }
+
+               internal void FixupTokens (Dictionary<int, int> token_map, Dictionary<int, MemberInfo> member_map) {
+                       if (ilgen != null)
+                               ilgen.FixupTokens (token_map, member_map);
+               }
                
                internal void GenerateDebugInfo (ISymbolWriter symbolWriter)
                {
index 149e5dbd6633d1a5d6940d761cfcc18be4a8e37f..643e7272a3a9be6666a2dd3366095b1dd968c8d5 100644 (file)
@@ -42,11 +42,11 @@ namespace System.Reflection.Emit
        internal class ConstructorOnTypeBuilderInst : ConstructorInfo
        {
                #region Keep in sync with object-internals.h
-               MonoGenericClass instantiation;
-               ConstructorInfo cb;
+               internal TypeBuilderInstantiation instantiation;
+               internal ConstructorInfo cb;
                #endregion
 
-               public ConstructorOnTypeBuilderInst (MonoGenericClass instantiation, ConstructorInfo cb)
+               public ConstructorOnTypeBuilderInst (TypeBuilderInstantiation instantiation, ConstructorInfo cb)
                {
                        this.instantiation = instantiation;
                        this.cb = cb;
@@ -134,6 +134,25 @@ namespace System.Reflection.Emit
                        return res;
                }
 
+               internal override Type[] GetParameterTypes () {
+                       if (cb is ConstructorBuilder) {
+                               return (cb as ConstructorBuilder).parameters;
+                       } else {
+                               ParameterInfo[] parms = cb.GetParameters ();
+                               var res = new Type [parms.Length];
+                               for (int i = 0; i < parms.Length; i++) {
+                                       res [i] = parms [i].ParameterType;
+                               }
+                               return res;
+                       }
+               }
+
+               // Called from the runtime to return the corresponding finished ConstructorInfo object
+               internal ConstructorInfo RuntimeResolve () {
+                       var type = instantiation.InternalResolve ();
+                       return type.GetConstructor (cb);
+               }
+
                public override int MetadataToken {
                        get {
                                return base.MetadataToken;
index b7ce6e0410a767355c9db8fcf9c9f0387ffd5f50..0e426991c6ec3392ece4fe91fb7342a7baa5fa61 100644 (file)
@@ -45,9 +45,6 @@ namespace System.Reflection.Emit
        {
                internal Type m_baseType;
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               static extern void create_unmanaged_type (Type type);
-
                internal SymbolType (Type elementType)
                {
                        this.m_baseType = elementType;
@@ -121,7 +118,6 @@ namespace System.Reflection.Emit
        
                public override Type UnderlyingSystemType {
                        get {
-                               create_unmanaged_type (this);
                                return this;
                        }
                }
@@ -131,6 +127,11 @@ namespace System.Reflection.Emit
                                return m_baseType.IsUserType;
                        }
                }
+
+               // Called from the runtime to return the corresponding finished Type object
+               internal override Type RuntimeResolve () {
+                       return InternalResolve ();
+               }
        }
 
        [StructLayout (LayoutKind.Sequential)]
@@ -150,9 +151,17 @@ namespace System.Reflection.Emit
 
                internal override Type InternalResolve ()
                {
-                       Type et = m_baseType.InternalResolve (); 
+                       Type et = m_baseType.InternalResolve ();
+                       if (rank == 0)
+                               return et.MakeArrayType ();
+                       return et.MakeArrayType (rank);
+               }
+
+               internal override Type RuntimeResolve ()
+               {
+                       Type et = m_baseType.RuntimeResolve ();
                        if (rank == 0)
-                               return et.MakeArrayType ();                     
+                               return et.MakeArrayType ();
                        return et.MakeArrayType (rank);
                }
 
index 2e4367ab96573525b9f8da270f134b7d83b8d06a..f54340ebf04df4013daf953c1ee1e3f5e31bc4ec 100644 (file)
@@ -42,17 +42,17 @@ namespace System.Reflection.Emit
        [StructLayout (LayoutKind.Sequential)]
        internal class EventOnTypeBuilderInst : EventInfo
        {
-               MonoGenericClass instantiation;
+               TypeBuilderInstantiation instantiation;
                EventBuilder event_builder;
                EventInfo event_info;
 
-               internal EventOnTypeBuilderInst (MonoGenericClass instantiation, EventBuilder evt)
+               internal EventOnTypeBuilderInst (TypeBuilderInstantiation instantiation, EventBuilder evt)
                {
                        this.instantiation = instantiation;
                        this.event_builder = evt;
                }
 
-               internal EventOnTypeBuilderInst (MonoGenericClass instantiation, EventInfo evt)
+               internal EventOnTypeBuilderInst (TypeBuilderInstantiation instantiation, EventInfo evt)
                {
                        this.instantiation = instantiation;
                        this.event_info = evt;
index f2fff7d7aa1ef9964d99e128965960aa869e2284..f8522ebe862a6dee35fac7668cf2d959260eb50d 100644 (file)
@@ -228,6 +228,10 @@ namespace System.Reflection.Emit {
                                marshal_info.marshaltyperef = TypeBuilder.ResolveUserType (marshal_info.marshaltyperef);
                }
 
+               internal FieldInfo RuntimeResolve () {
+                       return typeb.CreateType ().GetField (this);
+               }
+
                public override Module Module {
                        get {
                                return base.Module;
index ca3d43d85f94e49655d5a260e903cf04fd51b103..9de89b1e2b85d311ea49b1256755585b5f4f9895 100644 (file)
@@ -42,11 +42,11 @@ namespace System.Reflection.Emit
        internal class FieldOnTypeBuilderInst : FieldInfo
        {
                #region Keep in sync with object-internals.h
-               internal MonoGenericClass instantiation;
+               internal TypeBuilderInstantiation instantiation;
                internal FieldInfo fb;
                #endregion
 
-               public FieldOnTypeBuilderInst (MonoGenericClass instantiation, FieldInfo fb) {
+               public FieldOnTypeBuilderInst (TypeBuilderInstantiation instantiation, FieldInfo fb) {
                        this.instantiation = instantiation;
                        this.fb = fb;
                }
@@ -127,6 +127,12 @@ namespace System.Reflection.Emit
                public override void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) {
                        throw new NotSupportedException ();
                }
+
+               // Called from the runtime to return the corresponding finished FieldInfo object
+               internal FieldInfo RuntimeResolve () {
+                       var type = instantiation.RuntimeResolve ();
+                       return type.GetField (fb);
+               }
        }
 }
 #endif
index 037d36fdc3ee1fb6c06641a3a8a8ae38a895132d..30b6aac80e572f9402afd9b4403a9cf03e23c95b 100644 (file)
@@ -82,17 +82,21 @@ namespace System.Reflection.Emit
                        this.mbuilder = mbuilder;
                        this.name = name;
                        this.index = index;
-
-                       initialize ();
                }
 
                internal override Type InternalResolve ()
                {
-                       return tbuilder.InternalResolve ().GetGenericArguments () [index]; 
+                       if (mbuilder != null)
+                               return MethodBase.GetMethodFromHandle (mbuilder.MethodHandleInternal).GetGenericArguments () [index];
+                       return tbuilder.InternalResolve ().GetGenericArguments () [index];
                }
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern void initialize ();
+               internal override Type RuntimeResolve ()
+               {
+                       if (mbuilder != null)
+                               return MethodBase.GetMethodFromHandle (mbuilder.MethodHandleInternal, mbuilder.TypeBuilder.RuntimeResolve ().TypeHandle).GetGenericArguments () [index];
+                       return tbuilder.RuntimeResolve ().GetGenericArguments () [index];
+               }
 
                [ComVisible (true)]
                public override bool IsSubclassOf (Type c)
index ac4fda04472f0572052c8433509685a8e063af93..bf879e8e942f79961b352b37de60b39592e47a5f 100644 (file)
@@ -521,7 +521,7 @@ namespace System.Reflection.Emit {
                        int token = token_gen.GetToken (con, true);
                        make_room (6);
                        ll_emit (opcode);
-                       if (con.DeclaringType.Module == module)
+                       if (con.DeclaringType.Module == module || (con is ConstructorOnTypeBuilderInst) || (con is ConstructorBuilder))
                                add_token_fixup (con);
                        emit_int (token);
                        
@@ -554,7 +554,7 @@ namespace System.Reflection.Emit {
                        int token = token_gen.GetToken (field, true);
                        make_room (6);
                        ll_emit (opcode);
-                       if (field.DeclaringType.Module == module)
+                       if (field.DeclaringType.Module == module || (field is FieldOnTypeBuilderInst) || (field is FieldBuilder))
                                add_token_fixup (field);
                        emit_int (token);
                }
@@ -737,7 +737,7 @@ namespace System.Reflection.Emit {
                        Type declaringType = meth.DeclaringType;
                        // Might be a DynamicMethod with no declaring type
                        if (declaringType != null) {
-                               if (declaringType.Module == module)
+                               if (declaringType.Module == module || meth is MethodOnTypeBuilderInst || meth is MethodBuilder)
                                        add_token_fixup (meth);
                        }
                        emit_int (token);
@@ -755,7 +755,7 @@ namespace System.Reflection.Emit {
                        // Might be a DynamicMethod with no declaring type
                        Type declaringType = method.DeclaringType;
                        if (declaringType != null) {
-                               if (declaringType.Module == module)
+                               if (declaringType.Module == module || method is MethodBuilder)
                                        add_token_fixup (method);
                        }
                        emit_int (token);
@@ -813,7 +813,10 @@ namespace System.Reflection.Emit {
 
                        make_room (6);
                        ll_emit (opcode);
-                       emit_int (token_gen.GetToken (cls, opcode != OpCodes.Ldtoken));
+                       int token = token_gen.GetToken (cls, opcode != OpCodes.Ldtoken);
+                       if (cls is TypeBuilderInstantiation || cls is SymbolType || cls is TypeBuilder || cls is GenericTypeParameterBuilder)
+                               add_token_fixup (cls);
+                       emit_int (token);
                }
 
                [MonoLimitation ("vararg methods are not supported")]
@@ -1007,6 +1010,21 @@ namespace System.Reflection.Emit {
                        }
                }
 
+               internal void FixupTokens (Dictionary<int, int> token_map, Dictionary<int, MemberInfo> member_map) {
+                       for (int i = 0; i < num_token_fixups; ++i) {
+                               int pos = token_fixups [i].code_pos;
+                               int old_token = code [pos] | (code [pos + 1] << 8) | (code [pos + 2] << 16) | (code [pos + 3] << 24);
+                               int new_token;
+                               if (token_map.TryGetValue (old_token, out new_token)) {
+                                       token_fixups [i].member = member_map [old_token];
+                                       int old_cl = code_len;
+                                       code_len = pos;
+                                       emit_int (new_token);
+                                       code_len = old_cl;
+                               }
+                       }
+               }
+
                // Used by MethodBuilder.SetMethodBody
                internal void SetExceptionHandlers (ILExceptionInfo[] exHandlers) {
                        this.ex_handlers = exHandlers;
index 5545adca27657930a58d9aed580ece83fe515ea8..8748f20aba2b1e998f751affb651e45a133172e3 100644 (file)
@@ -138,6 +138,12 @@ namespace System.Reflection.Emit
                        }
                }
 
+               internal RuntimeMethodHandle MethodHandleInternal {
+                       get {
+                               return mhandle;
+                       }
+               }
+
                public override Type ReturnType {
                        get { return rtype; }
                }
@@ -248,6 +254,10 @@ namespace System.Reflection.Emit
                        return parameters [pos];
                }
 
+               internal MethodBase RuntimeResolve () {
+                       return type.RuntimeResolve ().GetMethod (this);
+               }
+
                public Module GetModule ()
                {
                        return type.Module;
@@ -380,6 +390,11 @@ namespace System.Reflection.Emit
                        }
                }
 
+               internal void FixupTokens (Dictionary<int, int> token_map, Dictionary<int, MemberInfo> member_map) {
+                       if (ilgen != null)
+                               ilgen.FixupTokens (token_map, member_map);
+               }
+
                internal void GenerateDebugInfo (ISymbolWriter symbolWriter)
                {
                        if (ilgen != null && ilgen.HasDebugInfo) {
index 9bc0b8a5994500a625b81919aa59c85cb18192a9..22c89ea9d0bf26717a90afce4b335e13fa97da78 100644 (file)
@@ -50,7 +50,7 @@ namespace System.Reflection.Emit
                #endregion
                MethodInfo generic_method_definition;
 
-               public MethodOnTypeBuilderInst (MonoGenericClass instantiation, MethodInfo base_method)
+               public MethodOnTypeBuilderInst (TypeBuilderInstantiation instantiation, MethodInfo base_method)
                {
                        this.instantiation = instantiation;
                        this.base_method = base_method;
@@ -100,6 +100,19 @@ namespace System.Reflection.Emit
                        return instantiation.GetGenericArguments ();
                }
 
+               // Called from the runtime to return the corresponding finished MethodInfo object
+               internal MethodInfo RuntimeResolve () {
+                       var type = instantiation.InternalResolve ();
+                       var m = type.GetMethod (base_method);
+                       if (method_arguments != null) {
+                               var args = new Type [method_arguments.Length];
+                               for (int i = 0; i < method_arguments.Length; ++i)
+                                       args [i] = method_arguments [i].InternalResolve ();
+                               m = m.MakeGenericMethod (args);
+                       }
+                       return m;
+               }
+
                //
                // MemberInfo members
                //
index 8d485153e38157f892cea66037eb53e78e76057a..b055797bd86763c3e82bc201c6c4d380e9884875 100644 (file)
@@ -681,15 +681,90 @@ namespace System.Reflection.Emit {
                        return result;
                }
 
+               static int typeref_tokengen =  0x01ffffff;
+               static int typedef_tokengen =  0x02ffffff;
+               static int typespec_tokengen =  0x1bffffff;
+               static int memberref_tokengen =  0x0affffff;
+               static int methoddef_tokengen =  0x06ffffff;
+               Dictionary<MemberInfo, int> inst_tokens = new Dictionary<MemberInfo, int> ();
+               Dictionary<MemberInfo, int> inst_tokens_open = new Dictionary<MemberInfo, int> ();
+
+               //
+               // Assign a pseudo token to the various TypeBuilderInst objects, so the runtime
+               // doesn't have to deal with them.
+               // For Save assemblies, the tokens will be fixed up later during Save ().
+               // For Run assemblies, the tokens will not be fixed up, so the runtime will
+               // still encounter these objects, it will resolve them by calling their
+               // RuntimeResolve () methods.
+               //
+               int GetPseudoToken (MemberInfo member, bool create_open_instance) {
+                       int token;
+
+                       if (create_open_instance) {
+                               if (inst_tokens_open.TryGetValue (member, out token))
+                                       return token;
+                       } else {
+                               if (inst_tokens.TryGetValue (member, out token))
+                                       return token;
+                       }
+                       // Count backwards to avoid collisions with the tokens
+                       // allocated by the runtime
+                       if (member is TypeBuilderInstantiation || member is SymbolType)
+                               token = typespec_tokengen --;
+                       else if (member is FieldOnTypeBuilderInst)
+                               token = memberref_tokengen --;
+                       else if (member is ConstructorOnTypeBuilderInst)
+                               token = memberref_tokengen --;
+                       else if (member is MethodOnTypeBuilderInst)
+                               token = memberref_tokengen --;
+                       else if (member is FieldBuilder)
+                               token = memberref_tokengen --;
+                       else if (member is TypeBuilder) {
+                               if (create_open_instance && (member as TypeBuilder).ContainsGenericParameters)
+                                       token = typespec_tokengen --;
+                               else if (member.Module == this)
+                                       token = typedef_tokengen --;
+                               else
+                                       token = typeref_tokengen --;
+                       } else if (member is ConstructorBuilder) {
+                               if (member.Module == this && !(member as ConstructorBuilder).TypeBuilder.ContainsGenericParameters)
+                                       token = methoddef_tokengen --;
+                               else
+                                       token = memberref_tokengen --;
+                       } else if (member is MethodBuilder) {
+                               var mb = member as MethodBuilder;
+                               if (member.Module == this && !mb.TypeBuilder.ContainsGenericParameters && !mb.IsGenericMethodDefinition)
+                                       token = methoddef_tokengen --;
+                               else
+                                       token = memberref_tokengen --;
+                       } else if (member is GenericTypeParameterBuilder) {
+                               token = typespec_tokengen --;
+                       } else
+                               throw new NotImplementedException ();
+                       if (create_open_instance)
+                               inst_tokens_open [member] = token;
+                       else
+                               inst_tokens [member] = token;
+                       RegisterToken (member, token);
+                       return token;
+               }
+
                internal int GetToken (MemberInfo member) {
+                       if (member is ConstructorBuilder || member is MethodBuilder)
+                               return GetPseudoToken (member, false);
                        return getToken (this, member, true);
                }
 
                internal int GetToken (MemberInfo member, bool create_open_instance) {
+                       if (member is TypeBuilderInstantiation || member is FieldOnTypeBuilderInst || member is ConstructorOnTypeBuilderInst || member is MethodOnTypeBuilderInst || member is SymbolType || member is FieldBuilder || member is TypeBuilder || member is ConstructorBuilder || member is MethodBuilder || member is GenericTypeParameterBuilder)
+                               return GetPseudoToken (member, create_open_instance);
                        return getToken (this, member, create_open_instance);
                }
 
                internal int GetToken (MethodBase method, IEnumerable<Type> opt_param_types) {
+                       if (method is ConstructorBuilder || method is MethodBuilder)
+                               return GetPseudoToken (method, false);
+
                        if (opt_param_types == null)
                                return getToken (this, method, true);
 
@@ -698,6 +773,8 @@ namespace System.Reflection.Emit {
                }
                
                internal int GetToken (MethodBase method, Type[] opt_param_types) {
+                       if (method is ConstructorBuilder || method is MethodBuilder)
+                               return GetPseudoToken (method, false);
                        return getMethodToken (this, method, opt_param_types);
                }
 
@@ -724,12 +801,88 @@ namespace System.Reflection.Emit {
                        return token_gen;
                }
 
+               // Called from the runtime to return the corresponding finished reflection object
+               internal static object RuntimeResolve (object obj) {
+                       if (obj is MethodBuilder)
+                               return (obj as MethodBuilder).RuntimeResolve ();
+                       if (obj is ConstructorBuilder)
+                               return (obj as ConstructorBuilder).RuntimeResolve ();
+                       if (obj is FieldBuilder)
+                               return (obj as FieldBuilder).RuntimeResolve ();
+                       if (obj is GenericTypeParameterBuilder)
+                               return (obj as GenericTypeParameterBuilder).RuntimeResolve ();
+                       if (obj is FieldOnTypeBuilderInst)
+                               return (obj as FieldOnTypeBuilderInst).RuntimeResolve ();
+                       if (obj is MethodOnTypeBuilderInst)
+                               return (obj as MethodOnTypeBuilderInst).RuntimeResolve ();
+                       if (obj is ConstructorOnTypeBuilderInst)
+                               return (obj as ConstructorOnTypeBuilderInst).RuntimeResolve ();
+                       if (obj is Type)
+                               return (obj as Type).RuntimeResolve ();
+                       throw new NotImplementedException (obj.GetType ().FullName);
+               }
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private static extern void build_metadata (ModuleBuilder mb);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private extern void WriteToFile (IntPtr handle);
 
+               void FixupTokens (Dictionary<int, int> token_map, Dictionary<int, MemberInfo> member_map, Dictionary<MemberInfo, int> inst_tokens,
+                                                 bool open) {
+                       foreach (var v in inst_tokens) {
+                               var member = v.Key;
+                               var old_token = v.Value;
+                               MemberInfo finished = null;
+
+                               // Construct the concrete reflection object corresponding to the
+                               // TypeBuilderInst object, and request a token for it instead.
+                               if (member is TypeBuilderInstantiation || member is SymbolType) {
+                                       finished = (member as Type).RuntimeResolve ();
+                               } else if (member is FieldOnTypeBuilderInst) {
+                                       finished = (member as FieldOnTypeBuilderInst).RuntimeResolve ();
+                               } else if (member is ConstructorOnTypeBuilderInst) {
+                                       finished = (member as ConstructorOnTypeBuilderInst).RuntimeResolve ();
+                               } else if (member is MethodOnTypeBuilderInst) {
+                                       finished = (member as MethodOnTypeBuilderInst).RuntimeResolve ();
+                               } else if (member is FieldBuilder) {
+                                       finished = (member as FieldBuilder).RuntimeResolve ();
+                               } else if (member is TypeBuilder) {
+                                       finished = (member as TypeBuilder).RuntimeResolve ();
+                               } else if (member is ConstructorBuilder) {
+                                       finished = (member as ConstructorBuilder).RuntimeResolve ();
+                               } else if (member is MethodBuilder) {
+                                       finished = (member as MethodBuilder).RuntimeResolve ();
+                               } else if (member is GenericTypeParameterBuilder) {
+                                       finished = (member as GenericTypeParameterBuilder).RuntimeResolve ();
+                               } else {
+                                       throw new NotImplementedException ();
+                               }
+
+                               int new_token = GetToken (finished, open);
+                               token_map [old_token] = new_token;
+                               member_map [old_token] = finished;
+                               // Replace the token mapping in the runtime so it points to the new object
+                               RegisterToken (finished, old_token);
+                       }
+               }
+
+               //
+               // Fixup the pseudo tokens assigned to the various SRE objects
+               //
+               void FixupTokens () {
+                       var token_map = new Dictionary<int, int> ();
+                       var member_map = new Dictionary<int, MemberInfo> ();
+                       FixupTokens (token_map, member_map, inst_tokens, false);
+                       FixupTokens (token_map, member_map, inst_tokens_open, true);
+
+                       // Replace the tokens in the IL stream
+                       if (types != null) {
+                               for (int i = 0; i < num_types; ++i)
+                                       types [i].FixupTokens (token_map, member_map);
+                       }
+               }
+
                internal void Save ()
                {
                        if (transient && !is_main)
@@ -741,6 +894,8 @@ namespace System.Reflection.Emit {
                                                throw new NotSupportedException ("Type '" + types [i].FullName + "' was not completed.");
                        }
 
+                       FixupTokens ();
+
                        if ((global_type != null) && (global_type_created == null))
                                global_type_created = global_type.CreateType ();
 
index 1035f494c86223a3bcc547243d9ea635be84dd9c..8b21446c4ef5416f3bd1421a6e59160c001a4cea 100644 (file)
@@ -41,10 +41,10 @@ namespace System.Reflection.Emit
        [StructLayout (LayoutKind.Sequential)]
        internal class PropertyOnTypeBuilderInst : PropertyInfo
        {
-               MonoGenericClass instantiation;
+               TypeBuilderInstantiation instantiation;
                PropertyInfo prop;
 
-               internal PropertyOnTypeBuilderInst (MonoGenericClass instantiation, PropertyInfo prop)
+               internal PropertyOnTypeBuilderInst (TypeBuilderInstantiation instantiation, PropertyInfo prop)
                {
                        this.instantiation = instantiation;
                        this.prop = prop;
index 3972192308d8082a7c6be66c929a8989b4a85dce..30ae09cdf16be9181dcdc2efc3335c966cb0739d 100644 (file)
@@ -40,6 +40,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Globalization;
 using System.Collections;
+using System.Collections.Generic;
 using System.Security;
 using System.Security.Permissions;
 using System.Diagnostics.SymbolStore;
@@ -91,15 +92,6 @@ namespace System.Reflection.Emit
                {
                        return attrs;
                }
-               
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern void setup_internal_class ();
-               
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern void create_generic_class ();
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern EventInfo get_event_info (EventBuilder eb);
 
                internal TypeBuilder (ModuleBuilder mb, TypeAttributes attr, int table_idx)
                {
@@ -111,7 +103,6 @@ namespace System.Reflection.Emit
                        this.nspace = String.Empty;
                        this.fullname = TypeIdentifiers.WithoutEscape(this.tname);
                        pmodule = mb;
-                       setup_internal_class ();
                }
 
                internal TypeBuilder (ModuleBuilder mb, string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packing_size, int type_size, Type nesting_type)
@@ -147,7 +138,6 @@ namespace System.Reflection.Emit
 
                        // skip .<Module> ?
                        table_idx = mb.get_next_table_index (this, 0x02, true);
-                       setup_internal_class ();
                        fullname = GetFullName ();
                }
 
@@ -764,8 +754,6 @@ namespace System.Reflection.Emit
                                SetParent (pmodule.assemblyb.corlib_object_type);
                        }
 
-                       create_generic_class ();
-
                        // Fire TypeResolve events for fields whose type is an unfinished
                        // value type.
                        if (fields != null) {
@@ -873,6 +861,21 @@ namespace System.Reflection.Emit
                        }
                }
 
+               internal void FixupTokens (Dictionary<int, int> token_map, Dictionary<int, MemberInfo> member_map) {
+                       if (methods != null) {
+                               for (int i = 0; i < num_methods; ++i)
+                                       methods[i].FixupTokens (token_map, member_map);
+                       }
+                       if (ctors != null) {
+                               foreach (var cb in ctors)
+                                       cb.FixupTokens (token_map, member_map);
+                       }
+                       if (subtypes != null) {
+                               foreach (var tb in subtypes)
+                                       tb.FixupTokens (token_map, member_map);
+                       }
+               }
+
                internal void GenerateDebugInfo (ISymbolWriter symbolWriter)
                {
                        symbolWriter.OpenNamespace (this.Namespace);
@@ -968,53 +971,6 @@ namespace System.Reflection.Emit
                        throw new NotSupportedException ();
                }
 
-               // This is only used from MonoGenericInst.initialize().
-               internal EventInfo[] GetEvents_internal (BindingFlags bindingAttr)
-               {
-                       if (events == null)
-                               return new EventInfo [0];
-                       ArrayList l = new ArrayList ();
-                       bool match;
-                       MethodAttributes mattrs;
-                       MethodInfo accessor;
-
-                       foreach (EventBuilder eb in events) {
-                               if (eb == null)
-                                       continue;
-                               EventInfo c = get_event_info (eb);
-                               match = false;
-                               accessor = c.GetAddMethod (true);
-                               if (accessor == null)
-                                       accessor = c.GetRemoveMethod (true);
-                               if (accessor == null)
-                                       continue;
-                               mattrs = accessor.Attributes;
-                               if ((mattrs & MethodAttributes.MemberAccessMask) == MethodAttributes.Public) {
-                                       if ((bindingAttr & BindingFlags.Public) != 0)
-                                               match = true;
-                               } else {
-                                       if ((bindingAttr & BindingFlags.NonPublic) != 0)
-                                               match = true;
-                               }
-                               if (!match)
-                                       continue;
-                               match = false;
-                               if ((mattrs & MethodAttributes.Static) != 0) {
-                                       if ((bindingAttr & BindingFlags.Static) != 0)
-                                               match = true;
-                               } else {
-                                       if ((bindingAttr & BindingFlags.Instance) != 0)
-                                               match = true;
-                               }
-                               if (!match)
-                                       continue;
-                               l.Add (c);
-                       }
-                       EventInfo[] result = new EventInfo [l.Count];
-                       l.CopyTo (result);
-                       return result;
-               }
-
                public override FieldInfo GetField (string name, BindingFlags bindingAttr)
                {
                        if (created != null)
@@ -1642,9 +1598,6 @@ namespace System.Reflection.Emit
                                this.parent = parent;
                        }
                        this.parent = ResolveUserType (this.parent);
-
-                       // will just set the parent-related bits if called a second time
-                       setup_internal_class ();
                }
 
                internal int get_next_table_index (object obj, int table, bool inc) {
@@ -1666,6 +1619,12 @@ namespace System.Reflection.Emit
                        return created;
                }
 
+               internal override Type RuntimeResolve ()
+               {
+                       check_created ();
+                       return created;
+               }
+
                internal bool is_created {
                        get {
                                return createTypeCalled;
@@ -1764,9 +1723,10 @@ namespace System.Reflection.Emit
                        }
                }
 
-               public extern override bool IsGenericParameter {
-                       [MethodImplAttribute(MethodImplOptions.InternalCall)]
-                       get;
+               public override bool IsGenericParameter {
+                       get {
+                               return false;
+                       }
                }
 
                public override GenericParameterAttributes GenericParameterAttributes {
@@ -1843,7 +1803,7 @@ namespace System.Reflection.Emit
 
                static bool IsValidGetMethodType (Type type)
                {
-                       if (type is TypeBuilder || type is MonoGenericClass)
+                       if (type is TypeBuilder || type is TypeBuilderInstantiation)
                                return true;
                        /*GetMethod() must work with TypeBuilders after CreateType() was called.*/
                        if (type.Module is ModuleBuilder)
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilderInstantiation.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilderInstantiation.cs
new file mode 100644 (file)
index 0000000..c6870f9
--- /dev/null
@@ -0,0 +1,506 @@
+//
+// System.Reflection.Emit.TypeBuilderInstantiation
+//
+// Sean MacIsaac (macisaac@ximian.com)
+// Paolo Molaro (lupus@ximian.com)
+// Patrik Torstensson (patrik.torstensson@labs2.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.
+//
+
+#if !FULL_AOT_RUNTIME
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Collections;
+using System.Runtime.CompilerServices;
+using System.Globalization;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace System.Reflection.Emit
+{
+       /*
+        * TypeBuilderInstantiation represents an instantiation of a generic TypeBuilder.
+        */
+       [StructLayout (LayoutKind.Sequential)]
+       sealed class TypeBuilderInstantiation :
+               TypeInfo
+       {
+               #region Keep in sync with object-internals.h
+#pragma warning disable 649
+               internal Type generic_type;
+               Type[] type_arguments;
+#pragma warning restore 649
+               #endregion
+
+               Hashtable fields, ctors, methods;
+
+               internal TypeBuilderInstantiation ()
+               {
+                       // this should not be used
+                       throw new InvalidOperationException ();
+               }
+
+               internal TypeBuilderInstantiation (Type tb, Type[] args)
+               {
+                       this.generic_type = tb;
+                       this.type_arguments = args;
+               }
+
+               internal override Type InternalResolve ()
+               {
+                       Type gtd = generic_type.InternalResolve ();
+                       Type[] args = new Type [type_arguments.Length];
+                       for (int i = 0; i < type_arguments.Length; ++i)
+                               args [i] = type_arguments [i].InternalResolve ();
+                       return gtd.MakeGenericType (args);
+               }
+
+               // Called from the runtime to return the corresponding finished Type object
+               internal override Type RuntimeResolve ()
+               {
+                       if (generic_type is TypeBuilder && !(generic_type as TypeBuilder).IsCreated ())
+                               AppDomain.CurrentDomain.DoTypeResolve (generic_type);
+                       for (int i = 0; i < type_arguments.Length; ++i) {
+                               var t = type_arguments [i];
+                               if (t is TypeBuilder && !(t as TypeBuilder).IsCreated ())
+                                       AppDomain.CurrentDomain.DoTypeResolve (t);
+                       }
+                       return InternalResolve ();
+               }
+
+               internal bool IsCreated {
+                       get {
+                               TypeBuilder tb = generic_type as TypeBuilder;
+                               return tb != null ? tb.is_created : true;
+                       }
+               }
+
+               private const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic |
+               BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly;
+
+               Type GetParentType ()
+               {
+                       return InflateType (generic_type.BaseType);             
+               }
+
+               internal Type InflateType (Type type)
+               {
+                       return InflateType (type, type_arguments, null);
+               }
+
+               internal Type InflateType (Type type, Type[] method_args)
+               {
+                       return InflateType (type, type_arguments, method_args);
+               }
+
+               internal static Type InflateType (Type type, Type[] type_args, Type[] method_args)
+               {
+                       if (type == null)
+                               return null;
+                       if (!type.IsGenericParameter && !type.ContainsGenericParameters)
+                               return type;
+                       if (type.IsGenericParameter) {
+                               if (type.DeclaringMethod == null)
+                                       return type_args == null ? type : type_args [type.GenericParameterPosition];
+                               return method_args == null ? type : method_args [type.GenericParameterPosition];
+                       }
+                       if (type.IsPointer)
+                               return InflateType (type.GetElementType (), type_args, method_args).MakePointerType ();
+                       if (type.IsByRef)
+                               return InflateType (type.GetElementType (), type_args, method_args).MakeByRefType ();
+                       if (type.IsArray) {
+                               if (type.GetArrayRank () > 1)
+                                       return InflateType (type.GetElementType (), type_args, method_args).MakeArrayType (type.GetArrayRank ());
+                               
+                               if (type.ToString ().EndsWith ("[*]", StringComparison.Ordinal)) /*FIXME, the reflection API doesn't offer a way around this*/
+                                       return InflateType (type.GetElementType (), type_args, method_args).MakeArrayType (1);
+                               return InflateType (type.GetElementType (), type_args, method_args).MakeArrayType ();
+                       }
+
+                       Type[] args = type.GetGenericArguments ();
+                       for (int i = 0; i < args.Length; ++i)
+                               args [i] = InflateType (args [i], type_args, method_args);
+
+                       Type gtd = type.IsGenericTypeDefinition ? type : type.GetGenericTypeDefinition ();
+                       return gtd.MakeGenericType (args);
+               }
+               
+               public override Type BaseType {
+                       get { return generic_type.BaseType; }
+               }
+
+               public override Type[] GetInterfaces ()
+               {
+                       throw new NotSupportedException ();
+               }
+
+               protected override bool IsValueTypeImpl ()
+               {
+                       return generic_type.IsValueType;
+               }
+
+               internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
+               {
+                       if (methods == null)
+                               methods = new Hashtable ();
+                       if (!methods.ContainsKey (fromNoninstanciated))
+                               methods [fromNoninstanciated] = new MethodOnTypeBuilderInst (this, fromNoninstanciated);
+                       return (MethodInfo)methods [fromNoninstanciated];
+               }
+
+               internal override ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
+               {
+                       if (ctors == null)
+                               ctors = new Hashtable ();
+                       if (!ctors.ContainsKey (fromNoninstanciated))
+                               ctors [fromNoninstanciated] = new ConstructorOnTypeBuilderInst (this, fromNoninstanciated);
+                       return (ConstructorInfo)ctors [fromNoninstanciated];
+               }
+
+               internal override FieldInfo GetField (FieldInfo fromNoninstanciated)
+               {
+                       if (fields == null)
+                               fields = new Hashtable ();
+                       if (!fields.ContainsKey (fromNoninstanciated))
+                               fields [fromNoninstanciated] = new FieldOnTypeBuilderInst (this, fromNoninstanciated);
+                       return (FieldInfo)fields [fromNoninstanciated];
+               }
+               
+               public override MethodInfo[] GetMethods (BindingFlags bf)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override ConstructorInfo[] GetConstructors (BindingFlags bf)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override FieldInfo[] GetFields (BindingFlags bf)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override PropertyInfo[] GetProperties (BindingFlags bf)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override EventInfo[] GetEvents (BindingFlags bf)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override Type[] GetNestedTypes (BindingFlags bf)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override bool IsAssignableFrom (Type c)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override Type UnderlyingSystemType {
+                       get { return this; }
+               }
+
+               public override Assembly Assembly {
+                       get { return generic_type.Assembly; }
+               }
+
+               public override Module Module {
+                       get { return generic_type.Module; }
+               }
+
+               public override string Name {
+                       get { return generic_type.Name; }
+               }
+
+               public override string Namespace {
+                       get { return generic_type.Namespace; }
+               }
+
+               public override string FullName {
+                       get { return format_name (true, false); }
+               }
+
+               public override string AssemblyQualifiedName {
+                       get { return format_name (true, true); }
+               }
+
+               public override Guid GUID {
+                       get { throw new NotSupportedException (); }
+               }
+
+               string format_name (bool full_name, bool assembly_qualified)
+               {
+                       StringBuilder sb = new StringBuilder (generic_type.FullName);
+
+                       sb.Append ("[");
+                       for (int i = 0; i < type_arguments.Length; ++i) {
+                               if (i > 0)
+                                       sb.Append (",");
+                               
+                               string name;
+                               if (full_name) {
+                                       string assemblyName = type_arguments [i].Assembly.FullName;
+                                       name = type_arguments [i].FullName;
+                                       if (name != null && assemblyName != null)
+                                               name = name + ", " + assemblyName;
+                               } else {
+                                       name = type_arguments [i].ToString ();
+                               }
+                               if (name == null) {
+                                       return null;
+                               }
+                               if (full_name)
+                                       sb.Append ("[");
+                               sb.Append (name);
+                               if (full_name)
+                                       sb.Append ("]");
+                       }
+                       sb.Append ("]");
+                       if (assembly_qualified) {
+                               sb.Append (", ");
+                               sb.Append (generic_type.Assembly.FullName);
+                       }
+                       return sb.ToString ();
+               }
+
+               public override string ToString ()
+               {
+                       return format_name (false, false);
+               }
+
+               public override Type GetGenericTypeDefinition ()
+               {
+                       return generic_type;
+               }
+
+               public override Type[] GetGenericArguments ()
+               {
+                       Type[] ret = new Type [type_arguments.Length];
+                       type_arguments.CopyTo (ret, 0);
+                       return ret;
+               }
+
+               public override bool ContainsGenericParameters {
+                       get {
+                               foreach (Type t in type_arguments) {
+                                       if (t.ContainsGenericParameters)
+                                               return true;
+                               }
+                               return false;
+                       }
+               }
+
+               public override bool IsGenericTypeDefinition {
+                       get { return false; }
+               }
+
+               public override bool IsGenericType {
+                       get { return true; }
+               }
+
+               public override Type DeclaringType {
+                       get { return generic_type.DeclaringType; }
+               }
+
+               public override RuntimeTypeHandle TypeHandle {
+                       get {
+                               throw new NotSupportedException ();
+                       }
+               }
+
+               public override Type MakeArrayType ()
+               {
+                       return new ArrayType (this, 0);
+               }
+
+               public override Type MakeArrayType (int rank)
+               {
+                       if (rank < 1)
+                               throw new IndexOutOfRangeException ();
+                       return new ArrayType (this, rank);
+               }
+
+               public override Type MakeByRefType ()
+               {
+                       return new ByRefType (this);
+               }
+
+               public override Type MakePointerType ()
+               {
+                       return new PointerType (this);
+               }
+
+               public override Type GetElementType ()
+               {
+                       throw new NotSupportedException ();
+               }
+
+               protected override bool HasElementTypeImpl ()
+               {
+                       return false;
+               }
+
+               protected override bool IsCOMObjectImpl ()
+               {
+                       return false;
+               }
+
+               protected override bool IsPrimitiveImpl ()
+               {
+                       return false;
+               }
+
+               protected override bool IsArrayImpl ()
+               {
+                       return false;
+               }
+
+               protected override bool IsByRefImpl ()
+               {
+                       return false;
+               }
+
+               protected override bool IsPointerImpl ()
+               {
+                       return false;
+               }
+
+               protected override TypeAttributes GetAttributeFlagsImpl ()
+               {
+                       return generic_type.Attributes; 
+               }
+
+               //stuff that throws
+               public override Type GetInterface (string name, bool ignoreCase)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override FieldInfo GetField( string name, BindingFlags bindingAttr)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override Type GetNestedType (string name, BindingFlags bindingAttr)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override object InvokeMember (string name, BindingFlags invokeAttr,
+                                                    Binder binder, object target, object[] args,
+                                                    ParameterModifier[] modifiers,
+                                                    CultureInfo culture, string[] namedParameters)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder,
+                                                            CallingConventions callConvention, Type[] types,
+                                                            ParameterModifier[] modifiers)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder,
+                                                                Type returnType, Type[] types, ParameterModifier[] modifiers)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr,
+                                                                      Binder binder,
+                                                                      CallingConventions callConvention,
+                                                                      Type[] types,
+                                                                      ParameterModifier[] modifiers)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               //MemberInfo
+               public override bool IsDefined (Type attributeType, bool inherit)
+               {
+                       throw new NotSupportedException ();
+               }
+
+               public override object [] GetCustomAttributes (bool inherit)
+               {
+                       if (IsCreated)
+                               return generic_type.GetCustomAttributes (inherit);
+                       throw new NotSupportedException ();
+               }
+
+               public override object [] GetCustomAttributes (Type attributeType, bool inherit)
+               {
+                       if (IsCreated)
+                               return generic_type.GetCustomAttributes (attributeType, inherit);
+                       throw new NotSupportedException ();
+               }
+
+               internal override bool IsUserType {
+                       get {
+                               foreach (var t in type_arguments) {
+                                       if (t.IsUserType)
+                                               return true;
+                               }
+                               return false;
+                       }
+               }
+
+               internal static Type MakeGenericType (Type type, Type[] typeArguments)
+               {
+                       return new TypeBuilderInstantiation (type, typeArguments);
+               }
+       }
+}
+#else
+namespace System.Reflection.Emit
+{
+       abstract class TypeBuilderInstantiation : TypeInfo
+       {
+               internal static Type MakeGenericType (Type type, Type[] typeArguments)
+               {
+                       throw new NotSupportedException ("User types are not supported under full aot");
+               }
+       }
+}
+#endif
diff --git a/mcs/class/corlib/System.Reflection/MonoGenericClass.cs b/mcs/class/corlib/System.Reflection/MonoGenericClass.cs
deleted file mode 100644 (file)
index 51a1a50..0000000
+++ /dev/null
@@ -1,519 +0,0 @@
-//
-// System.Reflection.MonoGenericClass
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Paolo Molaro (lupus@ximian.com)
-// Patrik Torstensson (patrik.torstensson@labs2.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.
-//
-
-#if !FULL_AOT_RUNTIME
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Text;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
-       /*
-        * MonoGenericClass represents an instantiation of a generic TypeBuilder. MS
-        * calls this class TypeBuilderInstantiation (a much better name). MS returns 
-        * NotImplementedException for many of the methods but we can't do that as gmcs
-        * depends on them.
-        */
-       [StructLayout (LayoutKind.Sequential)]
-       sealed class MonoGenericClass :
-               TypeInfo
-       {
-               #region Keep in sync with object-internals.h
-#pragma warning disable 649
-               internal Type generic_type;
-               Type[] type_arguments;
-               bool initialized;
-#pragma warning restore 649
-               #endregion
-
-               Hashtable fields, ctors, methods;
-
-               internal MonoGenericClass ()
-               {
-                       // this should not be used
-                       throw new InvalidOperationException ();
-               }
-
-               internal MonoGenericClass (Type tb, Type[] args)
-               {
-                       this.generic_type = tb;
-                       this.type_arguments = args;
-                       /*
-                       This is a temporary hack until we can fix the rest of the runtime
-                       to properly handle this class to be a complete UT.
-
-                       We must not regisrer this with the runtime after the type is created
-                       otherwise created_type.MakeGenericType will return an instance of MonoGenericClass,
-                       which is very very broken.
-                       */
-                       if (tb is TypeBuilder && !(tb as TypeBuilder).is_created)
-                               register_with_runtime (this);
-                       
-               }
-
-               internal override Type InternalResolve ()
-               {
-                       Type gtd = generic_type.InternalResolve ();
-                       Type[] args = new Type [type_arguments.Length];
-                       for (int i = 0; i < type_arguments.Length; ++i)
-                               args [i] = type_arguments [i].InternalResolve ();
-                       return gtd.MakeGenericType (args);
-               }
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               extern void initialize (FieldInfo[] fields);
-
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               internal static extern void register_with_runtime (Type type);
-
-               internal bool IsCreated {
-                       get {
-                               TypeBuilder tb = generic_type as TypeBuilder;
-                               return tb != null ? tb.is_created : true;
-                       }
-               }
-
-               private const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic |
-               BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly;
-
-               void initialize ()
-               {
-                       if (initialized)
-                               return;
-
-                       MonoGenericClass parent = GetParentType () as MonoGenericClass;
-                       if (parent != null)
-                               parent.initialize ();
-                               
-                       initialize (generic_type.GetFields (flags));
-
-                       initialized = true;
-               }
-
-               Type GetParentType ()
-               {
-                       return InflateType (generic_type.BaseType);             
-               }
-
-               internal Type InflateType (Type type)
-               {
-                       return InflateType (type, type_arguments, null);
-               }
-
-               internal Type InflateType (Type type, Type[] method_args)
-               {
-                       return InflateType (type, type_arguments, method_args);
-               }
-
-               internal static Type InflateType (Type type, Type[] type_args, Type[] method_args)
-               {
-                       if (type == null)
-                               return null;
-                       if (!type.IsGenericParameter && !type.ContainsGenericParameters)
-                               return type;
-                       if (type.IsGenericParameter) {
-                               if (type.DeclaringMethod == null)
-                                       return type_args == null ? type : type_args [type.GenericParameterPosition];
-                               return method_args == null ? type : method_args [type.GenericParameterPosition];
-                       }
-                       if (type.IsPointer)
-                               return InflateType (type.GetElementType (), type_args, method_args).MakePointerType ();
-                       if (type.IsByRef)
-                               return InflateType (type.GetElementType (), type_args, method_args).MakeByRefType ();
-                       if (type.IsArray) {
-                               if (type.GetArrayRank () > 1)
-                                       return InflateType (type.GetElementType (), type_args, method_args).MakeArrayType (type.GetArrayRank ());
-                               
-                               if (type.ToString ().EndsWith ("[*]", StringComparison.Ordinal)) /*FIXME, the reflection API doesn't offer a way around this*/
-                                       return InflateType (type.GetElementType (), type_args, method_args).MakeArrayType (1);
-                               return InflateType (type.GetElementType (), type_args, method_args).MakeArrayType ();
-                       }
-
-                       Type[] args = type.GetGenericArguments ();
-                       for (int i = 0; i < args.Length; ++i)
-                               args [i] = InflateType (args [i], type_args, method_args);
-
-                       Type gtd = type.IsGenericTypeDefinition ? type : type.GetGenericTypeDefinition ();
-                       return gtd.MakeGenericType (args);
-               }
-               
-               public override Type BaseType {
-                       get { return generic_type.BaseType; }
-               }
-
-               public override Type[] GetInterfaces ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override bool IsValueTypeImpl ()
-               {
-                       return generic_type.IsValueType;
-               }
-
-               internal override MethodInfo GetMethod (MethodInfo fromNoninstanciated)
-               {
-                       initialize ();
-
-                       if (methods == null)
-                               methods = new Hashtable ();
-                       if (!methods.ContainsKey (fromNoninstanciated))
-                               methods [fromNoninstanciated] = new MethodOnTypeBuilderInst (this, fromNoninstanciated);
-                       return (MethodInfo)methods [fromNoninstanciated];
-               }
-
-               internal override ConstructorInfo GetConstructor (ConstructorInfo fromNoninstanciated)
-               {
-                       initialize ();
-
-                       if (ctors == null)
-                               ctors = new Hashtable ();
-                       if (!ctors.ContainsKey (fromNoninstanciated))
-                               ctors [fromNoninstanciated] = new ConstructorOnTypeBuilderInst (this, fromNoninstanciated);
-                       return (ConstructorInfo)ctors [fromNoninstanciated];
-               }
-
-               internal override FieldInfo GetField (FieldInfo fromNoninstanciated)
-               {
-                       initialize ();
-                       if (fields == null)
-                               fields = new Hashtable ();
-                       if (!fields.ContainsKey (fromNoninstanciated))
-                               fields [fromNoninstanciated] = new FieldOnTypeBuilderInst (this, fromNoninstanciated);
-                       return (FieldInfo)fields [fromNoninstanciated];
-               }
-               
-               public override MethodInfo[] GetMethods (BindingFlags bf)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override ConstructorInfo[] GetConstructors (BindingFlags bf)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override FieldInfo[] GetFields (BindingFlags bf)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override PropertyInfo[] GetProperties (BindingFlags bf)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override EventInfo[] GetEvents (BindingFlags bf)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type[] GetNestedTypes (BindingFlags bf)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override bool IsAssignableFrom (Type c)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type UnderlyingSystemType {
-                       get { return this; }
-               }
-
-               public override Assembly Assembly {
-                       get { return generic_type.Assembly; }
-               }
-
-               public override Module Module {
-                       get { return generic_type.Module; }
-               }
-
-               public override string Name {
-                       get { return generic_type.Name; }
-               }
-
-               public override string Namespace {
-                       get { return generic_type.Namespace; }
-               }
-
-               public override string FullName {
-                       get { return format_name (true, false); }
-               }
-
-               public override string AssemblyQualifiedName {
-                       get { return format_name (true, true); }
-               }
-
-               public override Guid GUID {
-                       get { throw new NotSupportedException (); }
-               }
-
-               string format_name (bool full_name, bool assembly_qualified)
-               {
-                       StringBuilder sb = new StringBuilder (generic_type.FullName);
-
-                       sb.Append ("[");
-                       for (int i = 0; i < type_arguments.Length; ++i) {
-                               if (i > 0)
-                                       sb.Append (",");
-                               
-                               string name;
-                               if (full_name) {
-                                       string assemblyName = type_arguments [i].Assembly.FullName;
-                                       name = type_arguments [i].FullName;
-                                       if (name != null && assemblyName != null)
-                                               name = name + ", " + assemblyName;
-                               } else {
-                                       name = type_arguments [i].ToString ();
-                               }
-                               if (name == null) {
-                                       return null;
-                               }
-                               if (full_name)
-                                       sb.Append ("[");
-                               sb.Append (name);
-                               if (full_name)
-                                       sb.Append ("]");
-                       }
-                       sb.Append ("]");
-                       if (assembly_qualified) {
-                               sb.Append (", ");
-                               sb.Append (generic_type.Assembly.FullName);
-                       }
-                       return sb.ToString ();
-               }
-
-               public override string ToString ()
-               {
-                       return format_name (false, false);
-               }
-
-               public override Type GetGenericTypeDefinition ()
-               {
-                       return generic_type;
-               }
-
-               public override Type[] GetGenericArguments ()
-               {
-                       Type[] ret = new Type [type_arguments.Length];
-                       type_arguments.CopyTo (ret, 0);
-                       return ret;
-               }
-
-               public override bool ContainsGenericParameters {
-                       get {
-                               foreach (Type t in type_arguments) {
-                                       if (t.ContainsGenericParameters)
-                                               return true;
-                               }
-                               return false;
-                       }
-               }
-
-               public override bool IsGenericTypeDefinition {
-                       get { return false; }
-               }
-
-               public override bool IsGenericType {
-                       get { return true; }
-               }
-
-               public override Type DeclaringType {
-                       get { return generic_type.DeclaringType; }
-               }
-
-               public override RuntimeTypeHandle TypeHandle {
-                       get {
-                               throw new NotSupportedException ();
-                       }
-               }
-
-               public override Type MakeArrayType ()
-               {
-                       return new ArrayType (this, 0);
-               }
-
-               public override Type MakeArrayType (int rank)
-               {
-                       if (rank < 1)
-                               throw new IndexOutOfRangeException ();
-                       return new ArrayType (this, rank);
-               }
-
-               public override Type MakeByRefType ()
-               {
-                       return new ByRefType (this);
-               }
-
-               public override Type MakePointerType ()
-               {
-                       return new PointerType (this);
-               }
-
-               public override Type GetElementType ()
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override bool HasElementTypeImpl ()
-               {
-                       return false;
-               }
-
-               protected override bool IsCOMObjectImpl ()
-               {
-                       return false;
-               }
-
-               protected override bool IsPrimitiveImpl ()
-               {
-                       return false;
-               }
-
-               protected override bool IsArrayImpl ()
-               {
-                       return false;
-               }
-
-               protected override bool IsByRefImpl ()
-               {
-                       return false;
-               }
-
-               protected override bool IsPointerImpl ()
-               {
-                       return false;
-               }
-
-               protected override TypeAttributes GetAttributeFlagsImpl ()
-               {
-                       return generic_type.Attributes; 
-               }
-
-               //stuff that throws
-               public override Type GetInterface (string name, bool ignoreCase)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override FieldInfo GetField( string name, BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override Type GetNestedType (string name, BindingFlags bindingAttr)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object InvokeMember (string name, BindingFlags invokeAttr,
-                                                    Binder binder, object target, object[] args,
-                                                    ParameterModifier[] modifiers,
-                                                    CultureInfo culture, string[] namedParameters)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder,
-                                                            CallingConventions callConvention, Type[] types,
-                                                            ParameterModifier[] modifiers)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder,
-                                                                Type returnType, Type[] types, ParameterModifier[] modifiers)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr,
-                                                                      Binder binder,
-                                                                      CallingConventions callConvention,
-                                                                      Type[] types,
-                                                                      ParameterModifier[] modifiers)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               //MemberInfo
-               public override bool IsDefined (Type attributeType, bool inherit)
-               {
-                       throw new NotSupportedException ();
-               }
-
-               public override object [] GetCustomAttributes (bool inherit)
-               {
-                       if (IsCreated)
-                               return generic_type.GetCustomAttributes (inherit);
-                       throw new NotSupportedException ();
-               }
-
-               public override object [] GetCustomAttributes (Type attributeType, bool inherit)
-               {
-                       if (IsCreated)
-                               return generic_type.GetCustomAttributes (attributeType, inherit);
-                       throw new NotSupportedException ();
-               }
-
-               internal override bool IsUserType {
-                       get {
-                               foreach (var t in type_arguments) {
-                                       if (t.IsUserType)
-                                               return true;
-                               }
-                               return false;
-                       }
-               }
-
-       }
-}
-
-#endif
diff --git a/mcs/class/corlib/System.Reflection/MonoGenericMethod.cs b/mcs/class/corlib/System.Reflection/MonoGenericMethod.cs
deleted file mode 100644 (file)
index 48ef423..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Reflection.MonoGenericMethod
-//
-// Martin Baulig (martin@ximian.com)
-//
-// (C) 2004 Novell, 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.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
-       [Serializable]
-       [StructLayout (LayoutKind.Sequential)]
-       internal class MonoGenericMethod : MonoMethod
-       {
-               internal MonoGenericMethod ()
-               {
-                       // this should not be used
-                       throw new InvalidOperationException ();
-               }
-
-       }
-
-       [Serializable]
-       [StructLayout (LayoutKind.Sequential)]
-       internal class MonoGenericCMethod : MonoCMethod
-       {
-               internal MonoGenericCMethod ()
-               {
-                       // this should not be used
-                       throw new InvalidOperationException ();
-               }
-       }
-}
index a55f093678f618f00cb384f8fbd809f16264a1cd..8574472acb11f694c3b854866c76ed54070c7f2a 100644 (file)
@@ -1,10 +1,12 @@
-//
+//
 // ConditionalWeakTable.cs
 //
 // Author:
 //   Rodrigo Kumpera (rkumpera@novell.com)
+//   Tautvydas Žilys <zilys@unity3d.com>
 //
 // Copyright (C) 2010 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2016 Unity Technologies (https://unity3d.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -223,25 +225,94 @@ namespace System.Runtime.CompilerServices
 
                        return res;
                }
-               
+
+               //--------------------------------------------------------------------------------------------
+               // Find a key that equals (value equality) with the given key - don't use in perf critical path
+               // Note that it calls out to Object.Equals which may calls the override version of Equals
+               // and that may take locks and leads to deadlock
+               // Currently it is only used by WinRT event code and you should only use this function
+               // if you know for sure that either you won't run into dead locks or you need to live with the
+               // possiblity
+               //--------------------------------------------------------------------------------------------
+               [System.Security.SecuritySafeCritical]
+               [FriendAccessAllowed]
+               internal TKey FindEquivalentKeyUnsafe(TKey key, out TValue value)
+               {
+                       lock (_lock)
+                       {
+                               for (int i = 0; i < data.Length; ++i)
+                               {
+                                       var item = data[i];
+                                       if (Object.Equals(item.key, key))
+                                       {
+                                               value = (TValue)item.value;
+                                               return (TKey)item.key;
+                                       }
+                               }
+                       }
+
+                       value = default(TValue);
+                       return null;
+               }
+
+               //--------------------------------------------------------------------------------------------
+               // Clear all the key/value pairs
+               //--------------------------------------------------------------------------------------------
+               [System.Security.SecuritySafeCritical]
+               internal void Clear()
+               {
+                       lock (_lock)
+                       {
+                               for (int i = 0; i < data.Length; i++)
+                               {
+                                       data[i].key = GC.EPHEMERON_TOMBSTONE;
+                                       data[i].value = null;
+                               }
+
+                               size = 0;
+                       }
+               }
+
                // extracted from ../../../../external/referencesource/mscorlib/system/runtime/compilerservices/
                internal ICollection<TKey> Keys
                {
                        [System.Security.SecuritySafeCritical]
                        get
                        {
+                               var tombstone = GC.EPHEMERON_TOMBSTONE;
                                List<TKey> list = new List<TKey>(data.Length);
                                lock (_lock)
                                {
                                        for (int i = 0; i < data.Length; ++i)
                                        {
                                                TKey key = (TKey) data [i].key;
-                                               if (key != null)
+                                               if (key != null && key != tombstone)
                                                        list.Add (key);
                                        }
                                }
                                return list;
                        }
                }
+
+               internal ICollection<TValue> Values
+               {
+                       [System.Security.SecuritySafeCritical]
+                       get
+                       {
+                               var tombstone = GC.EPHEMERON_TOMBSTONE;
+                               List<TValue> list = new List<TValue>(data.Length);
+                               lock (_lock)
+                               {
+                                       for (int i = 0; i < data.Length; ++i)
+                                       {
+                                               var item = data[i];
+                                               if (item.key != null && item.key != tombstone)
+                                                       list.Add((TValue)item.value);
+                                       }
+                               }
+
+                               return list;
+                       }
+               }
        }
 }
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs
deleted file mode 100644 (file)
index 44c7662..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// DefaultInterfaceAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
-       public sealed class DefaultInterfaceAttribute : Attribute
-       {
-               public Type DefaultInterface {
-                       get;
-                       private set;
-               }
-
-               public DefaultInterfaceAttribute (Type defaultInterface)
-               {
-                       DefaultInterface = defaultInterface;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs
deleted file mode 100644 (file)
index e3479eb..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// EventRegistrationToken.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       public struct EventRegistrationToken
-       {
-#pragma warning disable 0649
-               long value;
-#pragma warning restore 0649
-
-               public static bool operator == (EventRegistrationToken left, EventRegistrationToken right)
-               {
-                       return left.value == right.value;
-               }
-
-               public static bool operator != (EventRegistrationToken left, EventRegistrationToken right)
-               {
-                       return left.value != right.value;
-               }
-
-               public override bool Equals (object obj)
-               {
-                       return ((EventRegistrationToken)obj).value == value;
-               }
-
-               public override int GetHashCode ()
-               {
-                       return unchecked ((int)value);
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs
deleted file mode 100644 (file)
index 0f09681..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// EventRegistrationTokenTable.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [MonoTODO]
-       public sealed class EventRegistrationTokenTable<T>
-               where T : class
-       {
-               public EventRegistrationTokenTable ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public T InvocationList {
-                       get { throw new NotImplementedException (); }
-                       set { throw new NotImplementedException (); }
-               }
-
-               public EventRegistrationToken AddEventHandler (T handler)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static EventRegistrationTokenTable<T> GetOrCreateEventRegistrationTokenTable(ref EventRegistrationTokenTable<T> refEventTable)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void RemoveEventHandler (T handler)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void RemoveEventHandler (EventRegistrationToken token)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs
deleted file mode 100644 (file)
index 7c516aa..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// IActivationFactory.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [Guid("00000035-0000-0000-C000-000000000046")]
-       public interface IActivationFactory
-       {
-               object ActivateInstance ();
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs
deleted file mode 100644 (file)
index c489221..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// InterfaceImplementedInVersionAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
-       public sealed class InterfaceImplementedInVersionAttribute : Attribute
-       {
-               public InterfaceImplementedInVersionAttribute (Type interfaceType, byte majorVersion, byte minorVersion,
-                       byte buildVersion, byte revisionVersion)
-               {
-                       InterfaceType = interfaceType;
-                       MajorVersion = majorVersion;
-                       MinorVersion = minorVersion;
-                       BuildVersion = buildVersion;
-                       RevisionVersion = revisionVersion;
-               }
-
-               public byte BuildVersion {
-                       get;
-                       private set;
-               }
-
-               public Type InterfaceType {
-                       get;
-                       private set;
-               }
-
-               public byte MajorVersion {
-                       get;
-                       private set;
-               }
-
-               public byte MinorVersion {
-                       get;
-                       private set;
-               }
-       
-               public byte RevisionVersion {
-                       get;
-                       private set;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs
deleted file mode 100644 (file)
index 9aa41a0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// ReadOnlyArrayAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)]
-       public sealed class ReadOnlyArrayAttribute : Attribute
-       {
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs
deleted file mode 100644 (file)
index 8fd0173..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// ReturnValueNameAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Delegate|AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = false)]
-       public sealed class ReturnValueNameAttribute : Attribute
-       {
-               public ReturnValueNameAttribute (string name)
-               {
-                       Name = name;
-               }
-
-               public string Name {
-                       get;
-                       private set;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/UnsafeNativeMethods.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/UnsafeNativeMethods.cs
new file mode 100644 (file)
index 0000000..a7101cf
--- /dev/null
@@ -0,0 +1,51 @@
+//
+// UnsafeNativeMethods.cs
+//
+// Author:
+//   Tautvydas Žilys <zilys@unity3d.com>
+//
+// Copyright (c) 2016 Unity Technologies (https://www.unity3d.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.CompilerServices;
+
+namespace System.Runtime.InteropServices.WindowsRuntime
+{
+       internal unsafe static class UnsafeNativeMethods
+       {
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern int WindowsCreateString(string sourceString, int length, IntPtr* hstring);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern int WindowsDeleteString(IntPtr hstring);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern char* WindowsGetStringRawBuffer(IntPtr hstring, uint* length);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern bool RoOriginateLanguageException(int error, string message, IntPtr languageException);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern void RoReportUnhandledError(IRestrictedErrorInfo error);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern IRestrictedErrorInfo GetRestrictedErrorInfo();
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs
deleted file mode 100644 (file)
index eb324b5..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// WindowsRuntimeMarshal.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [MonoTODO]
-       public static class WindowsRuntimeMarshal
-       {
-               public static void AddEventHandler<T> ( Func<T, EventRegistrationToken> addMethod, Action<EventRegistrationToken> removeMethod, T handler)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static void FreeHString (IntPtr ptr)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static IActivationFactory GetActivationFactory (Type type)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static string PtrToStringHString (IntPtr ptr)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static void RemoveAllEventHandlers(Action<EventRegistrationToken> removeMethod)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static void RemoveEventHandler<T> (Action<EventRegistrationToken> removeMethod, T handler)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static IntPtr StringToHString (string s)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               internal static bool ReportUnhandledError (Exception e)
-               {
-                       return false;
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs
deleted file mode 100644 (file)
index bfb3c06..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// WriteOnlyArrayAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 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.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)]
-       public sealed class WriteOnlyArrayAttribute : Attribute
-       {
-       }
-}
index 2def9ddba50828744ab6ae26d6e37d1870df033b..1516216ddc202f9758f32eb7f794620576b18332 100644 (file)
@@ -38,6 +38,7 @@ using System.Security;
 using System.Reflection;
 using System.Threading;
 using System.Runtime.InteropServices.ComTypes;
+using System.Text;
 
 using System.Runtime.ConstrainedExecution;
 #if !FULL_AOT_RUNTIME
@@ -74,8 +75,18 @@ namespace System.Runtime.InteropServices
                        return false;
                }
 
+               [MonoTODO]
+               public static void CleanupUnusedObjectsInCurrentContext ()
+               {
+                       if (Environment.IsRunningOnWindows)
+                               throw new PlatformNotSupportedException ();
+               }
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static IntPtr AllocCoTaskMem (int cb);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal extern static IntPtr AllocCoTaskMemSize (UIntPtr sizet);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.MayFail)]
@@ -278,6 +289,12 @@ namespace System.Runtime.InteropServices
                        FreeCoTaskMem (s);
                }
 
+               public static void ZeroFreeCoTaskMemUTF8 (IntPtr s)
+               {
+                       ClearAnsi (s);
+                       FreeCoTaskMem (s);
+               }
+               
                public static void ZeroFreeGlobalAllocAnsi (IntPtr s)
                {
                        ClearAnsi (s);
@@ -751,6 +768,16 @@ namespace System.Runtime.InteropServices
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static string PtrToStringAnsi (IntPtr ptr, int len);
 
+               public static string PtrToStringUTF8 (IntPtr ptr)
+               {
+                       return PtrToStringAnsi (ptr);
+               }
+               
+               public static string PtrToStringUTF8 (IntPtr ptr, int byteLen)
+               {
+                       return PtrToStringAnsi (ptr, byteLen);
+               }
+               
                public static string PtrToStringAuto (IntPtr ptr)
                {
                        return SystemDefaultCharSize == 2
@@ -769,15 +796,8 @@ namespace System.Runtime.InteropServices
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static string PtrToStringUni (IntPtr ptr, int len);
 
-#if !MOBILE
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static string PtrToStringBSTR (IntPtr ptr);
-#else
-               public static string PtrToStringBSTR (IntPtr ptr)
-               {
-                       throw new NotImplementedException ();
-               }
-#endif
                
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                [ComVisible (true)]
@@ -1053,23 +1073,9 @@ namespace System.Runtime.InteropServices
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static IntPtr StringToBSTR (string s);
 
-               //
-               // I believe this is wrong, because in Mono and in P/Invoke
-               // we treat "Ansi" conversions as UTF-8 conversions, while
-               // this one does not do this
-               //
                public static IntPtr StringToCoTaskMemAnsi (string s)
                {
-                       int length = s.Length + 1;
-                       IntPtr ctm = AllocCoTaskMem (length);
-
-                       byte[] asBytes = new byte[length];
-                       for (int i = 0; i < s.Length; i++)
-                               asBytes[i] = (byte)s[i];
-                       asBytes[s.Length] = 0;
-
-                       copy_to_unmanaged (asBytes, 0, ctm, length);
-                       return ctm;
+                       return StringToAllocatedMemoryUTF8 (s);
                }
 
                public static IntPtr StringToCoTaskMemAuto (string s)
@@ -1094,6 +1100,29 @@ namespace System.Runtime.InteropServices
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static IntPtr StringToHGlobalAnsi (string s);
 
+               unsafe public static IntPtr StringToAllocatedMemoryUTF8(String s)
+               {
+                       const int MAX_UTF8_CHAR_SIZE = 3;
+                       if (s == null)
+                               return IntPtr.Zero;
+
+                       int nb = (s.Length + 1) * MAX_UTF8_CHAR_SIZE;
+
+                       // Overflow checking
+                       if (nb < s.Length)
+                               throw new ArgumentOutOfRangeException("s");
+                       
+                       IntPtr pMem = AllocCoTaskMemSize(new UIntPtr((uint)nb +1));
+                       
+                       if (pMem == IntPtr.Zero)
+                               throw new OutOfMemoryException();
+
+                       byte* pbMem = (byte*)pMem;
+                       int nbWritten = s.GetBytesFromEncoding(pbMem, nb, Encoding.UTF8);
+                       pbMem[nbWritten] = 0;
+                       return pMem;
+               }
+               
                public static IntPtr StringToHGlobalAuto (string s)
                {
                        return SystemDefaultCharSize == 2
@@ -1722,5 +1751,31 @@ namespace System.Runtime.InteropServices
                internal static void SetLastWin32Error (int error)
                {
                }
+
+               // Copied from referencesource/mscorlib/system/runtime/interopservices/marshal.cs
+               //====================================================================
+               // return the raw IUnknown* for a COM Object not related to current 
+               // context
+               // Does not call AddRef
+               //====================================================================
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern IntPtr /* IUnknown* */ GetRawIUnknownForComObjectNoAddRef(Object o);
+               
+               // Copied from referencesource/mscorlib/system/runtime/interopservices/marshal.cs
+               //====================================================================
+               // Converts the CLR exception to an HRESULT. This function also sets
+               // up an IErrorInfo for the exception.
+               // This function is only used in WinRT and converts ObjectDisposedException
+               // to RO_E_CLOSED
+               //====================================================================
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern int GetHRForException_WinRT(Exception e);
+
+               // Copied from referencesource/mscorlib/system/runtime/interopservices/marshal.cs
+               //========================================================================
+               // Create activation factory and wraps it with a unique RCW
+               //========================================================================
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern object GetNativeActivationFactory(Type type);
        }
 }
index 33fef7a0a8d2c26525bdb5146ef1093305ae47d7..eb45ced8220104fedb88ee88eb5f57c6af55be7f 100644 (file)
@@ -106,7 +106,12 @@ namespace System.Runtime.Remoting
                {
                        lock (channelTemplates) {
                                if (!defaultConfigRead) {
-                                       ReadConfigFile (Environment.GetMachineConfigPath ());
+                                       var bundled = Environment.GetBundledMachineConfig ();
+                                       if (bundled != null)
+                                               ReadConfigString (bundled);
+
+                                       if (File.Exists (Environment.GetMachineConfigPath ()))
+                                               ReadConfigFile (Environment.GetMachineConfigPath ());
                                        defaultConfigRead = true;
                                }
 
@@ -121,6 +126,22 @@ namespace System.Runtime.Remoting
                        Configure (filename, false);
                }
 
+               private static void ReadConfigString (string filename)
+               {
+                       try
+                       {
+                               SmallXmlParser parser = new SmallXmlParser ();
+                               using (TextReader rreader = new StringReader (filename)) {
+                                       ConfigHandler handler = new ConfigHandler (false);
+                                       parser.Parse (rreader, handler);
+                               }
+                       }
+                       catch (Exception ex)
+                       {
+                               throw new RemotingException ("Configuration string could not be loaded: " + ex.Message, ex);
+                       }
+               }
+
                private static void ReadConfigFile (string filename)
                {
                        try
index d2b99281c3b4143b74566ab73fb8965b321b516f..815c1ba7e73727e93d0d58ca15d81976c08fe14d 100644 (file)
@@ -808,45 +808,15 @@ namespace System.Runtime.Remoting
                [SecurityPermission (SecurityAction.Assert, SerializationFormatter = true)] // FIXME: to be reviewed
                internal static byte[] SerializeExceptionData (Exception ex)
                {
+                       byte[] result = null;
                        try {
-                               int retry = 4;
-                               
-                               do {
-                                       try {
-                                               MemoryStream ms = new MemoryStream ();
-                                               _serializationFormatter.Serialize (ms, ex);
-                                               return ms.ToArray ();
-                                       }
-                                       catch (Exception e) {
-                                               if (e is ThreadAbortException) {
-#if MONO_FEATURE_THREAD_ABORT
-                                                       Thread.ResetAbort ();
-#endif
-                                                       retry = 5;
-                                                       ex = e;
-                                               }
-                                               else if (retry == 2) {
-                                                       ex = new Exception ();
-                                                       ex.SetMessage (e.Message);
-                                                       ex.SetStackTrace (e.StackTrace);
-                                               }
-                                               else
-                                                       ex = e;
-                                       }
-                                       retry--;
-                               }
-                               while (retry > 0);
-                               
-                               return null;
-                       }
-                       catch (Exception tex)
-                       {
-                               byte[] data = SerializeExceptionData (tex);
-#if MONO_FEATURE_THREAD_ABORT
-                               Thread.ResetAbort ();
-#endif
-                               return data;
+                               /* empty - we're only interested in the protected block */
+                       } finally {
+                               MemoryStream ms = new MemoryStream ();
+                               _serializationFormatter.Serialize (ms, ex);
+                               result = ms.ToArray ();
                        }
+                       return result;
                }
                
                internal static object GetDomainProxy(AppDomain domain) 
index e74123e761164c93c84fb94dc5720358f08f4537..4f20771c40a57681fa235dfebf59e9bc541910aa 100644 (file)
@@ -416,6 +416,15 @@ public partial class CryptoConfig {
                unresolved_algorithms.Add (nameECDsa_2, defaultECDsa);
                unresolved_algorithms.Add (nameECDsa_3, defaultECDsa);
 
+#if MONODROID
+               algorithms.Add (nameSHA1Cng, defaultSHA1);
+               algorithms.Add (nameSHA256Cng, defaultSHA256);
+               algorithms.Add (nameSHA256Provider, defaultSHA256);
+               algorithms.Add (nameSHA384Cng, defaultSHA384);
+               algorithms.Add (nameSHA384Provider, defaultSHA384);
+               algorithms.Add (nameSHA512Cng, defaultSHA512);
+               algorithms.Add (nameSHA512Provider, defaultSHA512);
+#else
                unresolved_algorithms.Add (nameSHA1Cng, defaultSHA1Cng);
                unresolved_algorithms.Add (nameSHA256Cng, defaultSHA256Cng);
                unresolved_algorithms.Add (nameSHA256Provider, defaultSHA256Provider);
@@ -423,6 +432,7 @@ public partial class CryptoConfig {
                unresolved_algorithms.Add (nameSHA384Provider, defaultSHA384Provider);
                unresolved_algorithms.Add (nameSHA512Cng, defaultSHA512Cng);
                unresolved_algorithms.Add (nameSHA512Provider, defaultSHA512Provider);
+#endif
                Dictionary<string,string> oid = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
 
                // comments here are to match with MS implementation (but not with doc)
index 29322f74ea8b8c8c30e82044455472439bcd7eb1..9ae2a61b75ad539b714e6c40a1042d8c1f02c56b 100755 (executable)
@@ -44,6 +44,16 @@ namespace System.Security.Cryptography {
        [ComVisible (true)]
        public partial class CryptoConfig {
 
+               public static void AddAlgorithm (Type algorithm, params string[] names)
+               {
+                       throw new PlatformNotSupportedException ();
+               }
+
+               public static void AddOID (string oid, params string[] names)
+               {
+                       throw new PlatformNotSupportedException ();
+               }
+
                // try to avoid hitting the CreateFromName overloads to help the linker
 
                public static object CreateFromName (string name)
diff --git a/mcs/class/corlib/System.Security.Cryptography/IncrementalHash.cs b/mcs/class/corlib/System.Security.Cryptography/IncrementalHash.cs
new file mode 100644 (file)
index 0000000..d52ed93
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// IncrementalHash.cs
+//
+// 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.
+//
+
+#if NETSTANDARD
+
+namespace System.Security.Cryptography
+{
+    public sealed class IncrementalHash : IDisposable
+    {
+        public IncrementalHash () { }
+        public HashAlgorithmName AlgorithmName { get { throw new NotImplementedException (); } }
+        public void AppendData (byte[] data) { }
+        public void AppendData (byte[] data, int offset, int count) { }
+        public static IncrementalHash CreateHash (HashAlgorithmName hashAlgorithm) { throw new NotImplementedException (); }
+        public static IncrementalHash CreateHMAC (HashAlgorithmName hashAlgorithm, byte[] key) { throw new NotImplementedException (); }
+        public void Dispose () { }
+        public byte[] GetHashAndReset () { throw new NotImplementedException (); }
+    }
+}
+
+#endif
\ No newline at end of file
index 8a98c9d5ad849b43707eedfd77ec93b5de597c53..7abdbecd11a782671b3976c02e15089365142756 100644 (file)
@@ -58,7 +58,7 @@ namespace System.Security.Cryptography {
                        _handle = RngInitialize (null);
                        Check ();
                }
-#if !MOBILE
+
                public RNGCryptoServiceProvider (byte[] rgb)
                {
                        _handle = RngInitialize (rgb);
@@ -81,7 +81,7 @@ namespace System.Security.Cryptography {
                                _handle = RngInitialize (Encoding.UTF8.GetBytes (str));
                        Check ();
                }
-#endif
+
                private void Check () 
                {
                        if (_handle == IntPtr.Zero) {
index 2e19104a39d81b5d9b92fdc6b2eda620468c3fad..4bce5168e7dea5288ecff37ad405bab3e929c66b 100644 (file)
@@ -49,7 +49,8 @@ namespace System.Threading {
                #region Sync with metadata/object-internals.h
                int lock_thread_id;
                // stores a thread handle
-               internal IntPtr system_thread_handle;
+               IntPtr handle;
+               IntPtr native_handle; // used only on Win32
 
                /* Note this is an opaque object (an array), not a CultureInfo */
                private object cached_culture_info;
@@ -92,6 +93,8 @@ namespace System.Threading {
                private IntPtr abort_protected_block_count;
                private int priority = (int) ThreadPriority.Normal;
                private IntPtr owned_mutex;
+               private IntPtr suspended_event;
+               private int self_suspended;
                /* 
                 * These fields are used to avoid having to increment corlib versions
                 * when a new field is added to the unmanaged MonoThread structure.
@@ -109,11 +112,11 @@ namespace System.Threading {
 
                // Closes the system thread handle
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern void Thread_free_internal(IntPtr handle);
+               private extern void Thread_free_internal();
 
                [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
                ~InternalThread() {
-                       Thread_free_internal(system_thread_handle);
+                       Thread_free_internal();
                }
        }
 
index 76a637ea631fbd4b64cfaf30bdb37607954f8380..ea12a7f34681a93c7def93d8e8678882349c7ccc 100644 (file)
@@ -1217,14 +1217,16 @@ namespace System {
                        SetData (name, data);
                }
 
-#if !MOBILE
                [Obsolete ("Use AppDomainSetup.DynamicBase")]
                [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
                public void SetDynamicBase (string path)
                {
+#if MOBILE
+                       throw new PlatformNotSupportedException ();
+#else
                        SetupInformationNoCopy.DynamicBase = path;
+#endif // MOBILE
                }
-#endif // !MOBILE
 
                [Obsolete ("AppDomain.GetCurrentThreadId has been deprecated"
                        + " because it does not provide a stable Id when managed"
@@ -1286,14 +1288,11 @@ namespace System {
                private Assembly DoAssemblyResolve (string name, Assembly requestingAssembly, bool refonly)
                {
                        ResolveEventHandler del;
-#if !MOBILE
                        if (refonly)
                                del = ReflectionOnlyAssemblyResolve;
                        else
                                del = AssemblyResolve;
-#else
-                       del = AssemblyResolve;
-#endif
+
                        if (del == null)
                                return null;
                        
@@ -1490,9 +1489,7 @@ namespace System {
                }
 #endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
 
-#if !MOBILE
                public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
-#endif
 
         #pragma warning disable 649
 #if MOBILE
index 5e854cbe3e439f01312ecdf1ffe3b075c188a676..c8b87782310327f36d1ffe0fbca382f0431c1987 100644 (file)
@@ -57,7 +57,7 @@ namespace System {
                 * of icalls, do not require an increment.
                 */
 #pragma warning disable 169
-               private const int mono_corlib_version = 157;
+               private const int mono_corlib_version = 163;
 #pragma warning restore 169
 
                [ComVisible (true)]
@@ -996,6 +996,14 @@ namespace System {
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                internal extern static int GetPageSize ();
 
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               extern private static string get_bundled_machine_config ();
+
+               internal static string GetBundledMachineConfig ()
+               {
+                       return get_bundled_machine_config ();
+               }
+
                static internal bool IsUnix {
                        get {
                                int platform = (int) Environment.Platform;
@@ -1032,6 +1040,15 @@ namespace System {
                        // Do not include a trailing newline for backwards compatibility
                        return st.ToString( System.Diagnostics.StackTrace.TraceFormat.Normal );
                }
+
+               // Copied from referencesource Environment
+               internal static bool IsWinRTSupported
+               {
+                       get
+                       {
+                               return true;
+                       }
+               }
        }
 }
 
index f02a6a7db40e47092dc2b446e020f1dc3992c20f..4ac94d59e1f5ca9594b4cc959290a306015c8506 100644 (file)
@@ -4,10 +4,6 @@ using System.Text;
 using NUnit.Framework;
 using Mono;
 
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
-
 namespace MonoTests.Mono {
 
        [TestFixture]
index 70c250d015da682354eb25b303d108380f06759e..75b2de89aac8ac5b700f448ecc8bc970d3bfea0c 100644 (file)
@@ -32,9 +32,6 @@ using System.Collections.Concurrent;
 
 using NUnit;
 using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Collections.Concurrent
 {
index 9cd2d1e11136e2e8cb6841595af01cb0ba7f71e9..4bf774937d5221a767dc1194876eb9e059c817b8 100644 (file)
@@ -30,9 +30,6 @@ using System.Collections.Generic;
 using System.Collections.Concurrent;
 
 using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Collections.Concurrent
 {
index 3ec70c82c26faa1c54f5880b590887d24e4726ca..a343cbe58b51a0360024b6b1f9ef8e64b7d768da 100644 (file)
@@ -68,8 +68,9 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                public void Constructor_StringMode ()
                {
                        string test = "string-filemode";
-                       IsolatedStorageFileStream isfs = new IsolatedStorageFileStream (test, FileMode.Create);
-                       CheckCommonDetails (test, isfs, true, true);
+                       using (var isfs = new IsolatedStorageFileStream (test, FileMode.Create)) {
+                               CheckCommonDetails (test, isfs, true, true);
+                       }
                }
 
                [Test]
@@ -83,8 +84,9 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                public void Constructor_StringModeAccess ()
                {
                        string test = "string-filemode-fileaccess";
-                       IsolatedStorageFileStream isfs = new IsolatedStorageFileStream (test, FileMode.Create, FileAccess.ReadWrite);
-                       CheckCommonDetails (test, isfs, true, true);
+                       using (var isfs = new IsolatedStorageFileStream (test, FileMode.Create, FileAccess.ReadWrite)) {
+                               CheckCommonDetails (test, isfs, true, true);
+                       }
                }
 
                [Test]
@@ -98,22 +100,24 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
                public void Constructor_StringModeAccessShare ()
                {
                        string test = "string-filemode-fileaccess-fileshare";
-                       IsolatedStorageFileStream isfs = new IsolatedStorageFileStream (test, FileMode.Create, FileAccess.Write, FileShare.Read);
-                       CheckCommonDetails (test, isfs, false, true);
+                       using (var isfs = new IsolatedStorageFileStream (test, FileMode.Create, FileAccess.Write, FileShare.Read)) {
+                               CheckCommonDetails (test, isfs, false, true);
+                       }
                }
 
                [Test]
                [ExpectedException (typeof (IsolatedStorageException))]
                public void Handle ()
                {
-                       IsolatedStorageFileStream isfs = new IsolatedStorageFileStream ("handle", FileMode.Create);
-                       IntPtr p = isfs.Handle;
+                       using (var isfs = new IsolatedStorageFileStream ("handle", FileMode.Create)) {
+                               IntPtr p = isfs.Handle;
+                       }
                }
 
                [Test]
                public void RootPath ()
                {
-                       new IsolatedStorageFileStream ("/rootpath", FileMode.Create);
+                       new IsolatedStorageFileStream ("/rootpath", FileMode.Create).Close ();
                }
 
                [Test]
index 88ae954687a88ce11d5f10cb3545a875e77c0d35..8e67c976f1e3bb267cc8781bbd720bd0561e2b2b 100644 (file)
@@ -506,6 +506,8 @@ namespace MonoTests.System.Reflection.Emit
                }
 
                [Test]
+               // The token is not guaranteed to be 0x0a000001
+               [Category ("NotWorking")]
                public void ResolveFieldMemberRefWithGenericArguments ()
                {
                        var assembly = genAssembly ();
@@ -533,6 +535,8 @@ namespace MonoTests.System.Reflection.Emit
                }
 
                [Test]
+               // The token is not guaranteed to be 0x0a000002
+               [Category ("NotWorking")]
                public void ResolveMethodMemberRefWithGenericArguments ()
                {
                        var assembly = genAssembly ();
@@ -566,6 +570,8 @@ namespace MonoTests.System.Reflection.Emit
                }
 
                [Test]
+               // The token is not guaranteed to be 0x2b000001
+               [Category("NotWorking")]
                public void ResolveMethodSpecWithGenericArguments ()
                {
                        var assembly = genAssembly ();
@@ -799,7 +805,7 @@ namespace MonoTests.System.Reflection.Emit
                public void GetType ()
                {
                        AssemblyBuilder ab = genAssembly ();
-                       ModuleBuilder module = ab.DefineDynamicModule ("foo.dll", "foo.dll", true);
+                       ModuleBuilder module = ab.DefineDynamicModule ("foo.dll", "foo.dll");
                        TypeBuilder tb = module.DefineType ("t1", TypeAttributes.Public);
 
                        Assert.AreEqual ("t1[]", module.GetType ("t1[]").FullName);
index 43f32cfa5959467d35da5011b26986550ffe0368..ac3b1f149fa3d8e587cb8cf5a691fcc62eef46a5 100644 (file)
@@ -112,7 +112,7 @@ namespace MonoTests.System.Reflection.Emit
                                Thread.GetDomain ().DefineDynamicAssembly (
                                        assemblyName, AssemblyBuilderAccess.RunAndSave, Path.GetTempPath ());
 
-                       module = assembly.DefineDynamicModule ("module1");
+                       module = assembly.DefineDynamicModule (ASSEMBLY_NAME, ASSEMBLY_NAME + ".dll");
                }
 
                static int typeIndexer = 0;
@@ -1827,6 +1827,23 @@ namespace MonoTests.System.Reflection.Emit
                        // TODO:
                }
 
+               [Test]
+               public void NestedTypeSave () {
+                       var tb = module.DefineType (genTypeName ());
+
+                       var tbuilder = tb.DefineNestedType ("Test.CodeGen", TypeAttributes.Public | TypeAttributes.Class);
+                       var entryp = tbuilder.DefineMethod("Main", MethodAttributes.Public | MethodAttributes.Static, typeof (void), null);
+                       var ilg = entryp.GetILGenerator (128);
+                       ilg.Emit (OpCodes.Ldtoken, tb);
+                       ilg.Emit (OpCodes.Pop);
+                       ilg.Emit (OpCodes.Ret);
+
+                       tbuilder.CreateType ();
+                       tb.CreateType ();
+
+                       assembly.Save (ASSEMBLY_NAME + ".dll");
+               }
+
                [Test]
                public void DefinePInvokeMethod_Name_NullChar ()
                {
@@ -9748,6 +9765,33 @@ namespace MonoTests.System.Reflection.Emit
                        //Console.WriteLine (res[0]);
                }
 
+               [Test]
+               public void FieldWithInitializedDataWorksWithCompilerRuntimeHelpers2 ()
+               {
+                       TypeBuilder tb = module.DefineType ("Type1", TypeAttributes.Public);
+                       var garg = tb.DefineGenericParameters ("T") [0];
+                       FieldBuilder fb = tb.DefineInitializedData ("Foo", new byte [] {1,2,3,4}, FieldAttributes.Static|FieldAttributes.Public);
+                       tb.CreateType ();
+
+                       assembly = Thread.GetDomain ().DefineDynamicAssembly (new AssemblyName (ASSEMBLY_NAME+"2"), AssemblyBuilderAccess.RunAndSave, Path.GetTempPath ());
+                       module = assembly.DefineDynamicModule ("Instance.exe");
+
+                       TypeBuilder tb2 = module.DefineType ("Type2", TypeAttributes.Public);
+                       MethodBuilder mb = tb2.DefineMethod ("Test", MethodAttributes.Public | MethodAttributes.Static, typeof (object), new Type [0]);
+                       ILGenerator il = mb.GetILGenerator ();
+
+                       il.Emit (OpCodes.Ldc_I4_1);
+                       il.Emit (OpCodes.Newarr, typeof (int));
+                       il.Emit (OpCodes.Dup);
+                       il.Emit (OpCodes.Ldtoken, fb);
+                       il.Emit (OpCodes.Call, typeof (RuntimeHelpers).GetMethod ("InitializeArray"));
+                       il.Emit (OpCodes.Ret);
+
+                       Type t = tb2.CreateType ();
+                       int[] res = (int[])t.GetMethod ("Test").Invoke (null, new object[0]);
+                       //Console.WriteLine (res[0]);
+               }
+
                public interface IDelegateFactory
                {
                        Delegate Create (Delegate del);
index 9234e9fc300cdbbb00d6ce0d774e4e8abcf08ab5..108680d10ad19f025c0b803d5cccceca134fac2c 100644 (file)
@@ -7,6 +7,7 @@
 
 using System;
 using System.Runtime.CompilerServices;
+using System.Threading;
 
 using NUnit.Framework;
 
@@ -45,6 +46,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
                        }
                }
 
+               [Test]
                public void TestOffsetToStringData () 
                {
                        Assert.AreEqual (
@@ -52,6 +54,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
                                                  RuntimeHelpers.OffsetToStringData, "OffsetToStringData is not constant");
                }
 
+               [Test]
                public void TestGetObjectValue ()
                {
                        FooStruct s1;
@@ -75,6 +78,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
                        Assert.AreEqual (s2.j, "FOO");
                }
 
+               [Test]
                public void TestRunClassConstructor ()
                {
                        RuntimeHelpers.RunClassConstructor (typeof(FooClass).TypeHandle);
@@ -169,6 +173,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
                        RuntimeHelpers.InitializeArray (new Fielder ().array, rfh);
                }
 
+               [Test]
                public void TestGetHashCode ()
                {
                        Assert.AreEqual (0, RuntimeHelpers.GetHashCode (null));
@@ -177,6 +182,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
                        Assert.IsTrue (5 != RuntimeHelpers.GetHashCode (new FooClass ()));
                }                       
 
+               [Test]
                public void TestEquals ()
                {
                        Assert.IsTrue (RuntimeHelpers.Equals (null, null));
@@ -197,5 +203,21 @@ namespace MonoTests.System.Runtime.CompilerServices {
                        Assert.IsTrue (RuntimeHelpers.Equals (o1, o3));
                        Assert.IsTrue (!RuntimeHelpers.Equals (o1, o4));
                }
+
+               [Test]
+               public void TestEnsureSufficientExecutionStack ()
+               {
+                       var t = new Thread (() => {
+                               unsafe {
+                                       var s = stackalloc byte [1024];
+                               }
+
+                               RuntimeHelpers.EnsureSufficientExecutionStack ();
+                       });
+
+
+                       t.Start ();
+                       t.Join ();
+               }
        }
 }
index c9d7aca855bc8a1fa9eb64ccd193d34715fd6e38..6a6ecc0b36d66e4bb24febc722b64536c5935179 100644 (file)
@@ -247,8 +247,8 @@ namespace MonoTests.System.Runtime.CompilerServices
                        return res.Result;
                }
 
-#if !MOBILE_STATIC
                [Test]
+               [Ignore ("Incompatible with nunitlite")]
                public void FinishedTaskOnCompleted ()
                {
                        var mres = new ManualResetEvent (false);
@@ -268,12 +268,10 @@ namespace MonoTests.System.Runtime.CompilerServices
 
                        mres.Set ();
                        // this will only terminate correctly if the test was not executed from the main thread
-                       // e.g. Touch.Unit defaults to run tests on the main thread and this will return false
+                       // e.g. nunitlite/Touch.Unit defaults to run tests on the main thread and this will return false
                        Assert.AreEqual (Thread.CurrentThread.IsBackground, mres2.WaitOne (2000), "#2");;
                }
 
-#endif
-
                [Test]
                public void CompletionOnSameCustomSynchronizationContext ()
                {
index d4ca72dc0a94857730af44a9635cffa80624a605..51f1797a2b814a7dc77ce0fbb4574cdc0ddf91c8 100644 (file)
@@ -155,6 +155,54 @@ namespace MonoTests.System.Runtime.InteropServices
                        }
                }
 
+               readonly String[] TestStrings = new String[] {
+                       "", //Empty String
+                       "Test String",
+                       "A", //Single character string
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself. " +
+                       "This is a very long string as it repeats itself.",
+                       "This \n is \n a \n multiline \n string",
+                       "This \0 is \0 a \0 string \0 with \0 nulls",
+                       "\0string",
+                       "string\0",
+                       "\0\0\0\0\0\0\0\0"
+               };
+
+               [Test]
+               public unsafe void PtrToStringUTF8_Test ()
+               {
+                       int i = 0; 
+                       foreach (String srcString in TestStrings)
+                       {
+                               i++;
+                               // we assume string null terminated
+                               if (srcString.Contains("\0"))
+                                       continue;
+
+                               IntPtr ptrString = Marshal.StringToAllocatedMemoryUTF8(srcString);
+                               string retString = Marshal.PtrToStringUTF8(ptrString);
+
+                               Assert.AreEqual (srcString, retString, "#" + i);
+                               if (srcString.Length > 0)
+                               {
+                                       string retString2 = Marshal.PtrToStringUTF8(ptrString, srcString.Length - 1);
+                                       Assert.AreEqual (srcString.Substring(0, srcString.Length - 1), retString2, "#s" + i);
+                               }
+                               Marshal.FreeHGlobal(ptrString);
+                       }                       
+               }
+               
                [Test]
                public unsafe void UnsafeAddrOfPinnedArrayElement ()
                {
@@ -368,7 +416,6 @@ namespace MonoTests.System.Runtime.InteropServices
                }
 
                [Test]
-               [Category ("MobileNotWorking")]
                public void BSTR_Roundtrip ()
                {
                        string s = "mono";
@@ -378,7 +425,6 @@ namespace MonoTests.System.Runtime.InteropServices
                }
 
                [Test]
-               [Category ("MobileNotWorking")]
                public void StringToBSTRWithNullValues ()
                {
                        int size = 128;
@@ -823,6 +869,7 @@ namespace MonoTests.System.Runtime.InteropServices
                );
 #endif
 
+#if !MOBILE_STATIC
                [StructLayout( LayoutKind.Sequential, Pack = 1 )]
                public class FourByteStruct
                {
@@ -967,6 +1014,7 @@ namespace MonoTests.System.Runtime.InteropServices
 
                        return objResult;
                }
+#endif
        }
 #if !MOBILE
        [ComImport()]
index bf93320e26b9e8abf86b0adc6626960ea76ebcbf..7a0e837cacfc57b227f0c351720ca13007dae4b6 100644 (file)
@@ -9,7 +9,6 @@ using System;
 using System.Security.AccessControl;
 using System.Security.Principal;
 using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
 
 namespace MonoTests.System.Security.AccessControl {
 
index 44830498971db5aa2d87dd3e5274875540a1777f..46fbe94a6d7dab11e3430fbd531b4bfe69f75dd4 100644 (file)
@@ -310,7 +310,7 @@ public class SignatureDescriptionTest {
        public void RSASignatureDescription ()
        {
 // TODO: this would be cleaner with NUnit TestCase'es but they're NUnit 2.5+ :(
-#if FULL_AOT_RUNTIME || MONOTOUCH
+#if FULL_AOT_RUNTIME || MONOTOUCH || MONODROID
                RSASignatureDescriptionCore ("http://www.w3.org/2000/09/xmldsig#rsa-sha1", "System.Security.Cryptography.SHA1Cng", "System.Security.Cryptography.SHA1CryptoServiceProvider");
                RSASignatureDescriptionCore ("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", "System.Security.Cryptography.SHA256Cng", "System.Security.Cryptography.SHA256Managed");
                RSASignatureDescriptionCore ("http://www.w3.org/2001/04/xmldsig-more#rsa-sha384", "System.Security.Cryptography.SHA384Cng", "System.Security.Cryptography.SHA384Managed");
@@ -345,4 +345,4 @@ public class SignatureDescriptionTest {
        }
 }
 
-}
\ No newline at end of file
+}
index f35a9d3883062cb04a0eaeeeff65f3ef43dc9116..ea6380d0977fc398fd018736c7ce5ec3fa2a386d 100644 (file)
@@ -10,10 +10,6 @@ using System.Text;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
 
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
-
 namespace MonoTests.System.Text
 {
        [TestFixture]
index 0195967cd3663b36d32cc4de6eb210f73d463c7e..c96da97d9c185eb470a8e1393443981f171ab2f2 100644 (file)
@@ -32,10 +32,6 @@ using System.Text;
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
 
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
-
 namespace MonoTests.System.Text
 {
        [TestFixture]
index 474abcd2208084f4ab516897df9e560c0d1d667a..12de999dc5b6372937898c66fdfa1c8d7805b088 100644 (file)
@@ -11,6 +11,7 @@
 
 using NUnit.Framework;
 using System;
+using System.Reflection;
 using System.IO;
 using System.Text;
 
@@ -1042,7 +1043,7 @@ namespace MonoTests.System.Text
                [Category ("MobileNotWorking")]
                public void Bug415628 ()
                {
-                       using (var f = File.Open ("Test/resources/415628.bin", FileMode.Open)) {
+                       using (var f = File.Open (Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "Test/resources/415628.bin"), FileMode.Open)) {
                                BinaryReader br = new BinaryReader (f);
                                byte [] buf = br.ReadBytes (8000);
                                Encoding.UTF8.GetString(buf);
index 903a6946a08163a08687381b77d54f21000ed0d7..94f191a121a4ea80b70c6ae0cf7877824992eb7c 100644 (file)
@@ -30,9 +30,6 @@ using System.Threading;
 using System.Threading.Tasks;
 
 using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Threading.Tasks
 {
index 94d36a131e5ab550770551e7dc0f2d2cffd3163b..1af618d3336965aa43958c7f0370abdf5412cc0e 100644 (file)
@@ -35,9 +35,6 @@ using System.Threading.Tasks;
 using System.Collections.Generic;
 
 using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Threading.Tasks
 {
index 0ca7f49f474c9c6fb8407df5eb41a663090a62c3..803b10c15eb9d4384b89465ad77d1d190bde275e 100644 (file)
@@ -32,9 +32,6 @@ using System.Threading;
 using System.Threading.Tasks;
 
 using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Threading.Tasks
 {
index e8130bc06fd5cf8bac6fc0e3dd06b7d81e841f9e..001f4d454cd80c1b8a9e9c8ea2c921c2bc620e52 100644 (file)
@@ -29,9 +29,6 @@ using System.Threading.Tasks;
 using System.Collections.Generic;
 
 using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Threading.Tasks
 {
index f4e8a9705f78e0beeacafc11313de8475cea8a30..07bd1fe0b56adeee0f7b15ad2b3221e9b307954d 100644 (file)
@@ -34,10 +34,6 @@ using System.Threading.Tasks;
 using System.Collections.Generic;
 using NUnit.Framework;
 
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
-
 namespace MonoTests.System.Threading.Tasks
 {
        [TestFixture]
index 8c063dccdc879ca860f78b88fe19806d97ff35bf..b65d150bb581ffb8625456b9525fcab3a28d67c1 100644 (file)
@@ -29,9 +29,6 @@ using System.Threading;
 
 using NUnit;
 using NUnit.Framework;
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
 
 namespace MonoTests.System.Threading
 {
index bf3beb47200ad653a5b441ec06d6a6eca21142d9..c4d0bd82fc9f6df28b133379d2db582b68de251d 100644 (file)
@@ -15,10 +15,6 @@ using System.Threading;
 
 using NUnit.Framework;
 
-#if !MOBILE
-using NUnit.Framework.SyntaxHelpers;
-#endif
-
 namespace MonoTests.System
 {
        [TestFixture]
index 1f408618bee270e7bb5c65ea1ace8861b925449e..4ea4f283bce97cc8e8add2ab8e81dd1891542daf 100644 (file)
@@ -3058,9 +3058,15 @@ namespace MonoTests.System
                public void MakeArrayTypeTest ()
                {
                        // This should not crash:
-                       typeof (void).MakeArrayType ();
+                       Type t = typeof (void).MakeArrayType ();
                }
                
+               [Test]
+               [ExpectedException (typeof (InvalidProgramException))]
+               public void MakeArrayTypedReferenceInstanceTest ()
+               {
+                       object o = Array.CreateInstance (typeof (global::System.TypedReference), 1);
+               }
 
                [ComVisible (true)]
                public class ComFoo<T> {
@@ -4191,6 +4197,17 @@ namespace MonoTests.System
                        MustTLE (string.Format ("{0}ZZZZ,{1}", typeof (MyRealEnum).FullName, aqn));
                }
 
+               [Test]
+               public void GetTypeExceptionMsg () {
+                       string typeName = "system.int32, foo";
+                       try {
+                               Type.GetType(typeName, true, false);
+                       } catch (TypeLoadException ex) {
+                               Assert.IsTrue (ex.Message.Contains ("system.int32"));
+                               Assert.IsTrue (ex.Message.Contains ("foo"));
+                       }
+               }
+
                delegate void MyAction<in T>(T ag);
 
                [Test] //bug #668506
@@ -4318,6 +4335,24 @@ namespace MonoTests.System
                }
 #endif
 
+
+               [Test]
+               public void GetTypeBadArity()
+               {
+                       // Regression test for #46250
+                       try {
+                               Type.GetType ("System.Collections.Generic.Dictionary`2[System.String]", true);
+                               Assert.Fail ("Did not throw an exception (#1)");
+                       } catch (ArgumentException) {
+                       }
+
+                       try {
+                               Type.GetType ("System.Collections.Generic.Dictionary`2[System.String,System.Int32,System.Int64]", true);
+                               Assert.Fail ("Did not throw an exception (#2)");
+                       } catch (ArgumentException) {
+                       }
+               }
+
                public abstract class Stream : IDisposable
                {
                        public void Dispose ()
diff --git a/mcs/class/corlib/corefx/SR.cs b/mcs/class/corlib/corefx/SR.cs
new file mode 100644 (file)
index 0000000..7330ff6
--- /dev/null
@@ -0,0 +1,7 @@
+// TODO: Should be auto-generated from resources.resx
+
+static class SR
+{
+       public const string ArgumentException_ValueTupleIncorrectType = "The parameter should be a ValueTuple type of appropriate arity.";
+       public const string ArgumentException_ValueTupleLastArgumentNotAValueTuple = "The TRest type argument of ValueTuple`8 must be a ValueTuple.";
+}
\ No newline at end of file
index 95f0db7329cb36a446b037c41d2f4f6a1347bf06..760f646ebdf3ee6fd8029f16d9c5a18d5a52cc91 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>612,618,1635,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
+    <DefineConstants>TRACE;INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>612,618,1635,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
+    <DefineConstants>INSIDE_CORLIB;MONO_CULTURE_DATA;LIBC;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;GENERICS_WORK;FEATURE_LIST_PREDICATES;FEATURE_SERIALIZATION;FEATURE_ASCII;FEATURE_LATIN1;FEATURE_UTF7;FEATURE_UTF32;MONO_HYBRID_ENCODING_SUPPORT;FEATURE_ASYNC_IO;NEW_EXPERIMENTAL_ASYNC_IO;FEATURE_UTF32;FEATURE_EXCEPTIONDISPATCHINFO;FEATURE_CORRUPTING_EXCEPTIONS;FEATURE_EXCEPTION_NOTIFICATIONS;FEATURE_STRONGNAME_MIGRATION;FEATURE_USE_LCID;FEATURE_FUSION;FEATURE_CRYPTO;FEATURE_X509_SECURESTRINGS;FEATURE_SYNCHRONIZATIONCONTEXT;FEATURE_SYNCHRONIZATIONCONTEXT_WAIT;HAS_CORLIB_CONTRACTS;FEATURE_MACL;FEATURE_REMOTING;MONO_COM;FEATURE_COMINTEROP;FEATURE_ROLE_BASED_SECURITY;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\corefx\src\Common\src\System\Numerics\Hashing\HashHelpers.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.ValueTuple\src\System\Runtime\CompilerServices\TupleElementNamesAttribute.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.ValueTuple\src\System\ValueTuple\TupleExtensions.cs" />\r
+    <Compile Include="..\..\..\external\corefx\src\System.ValueTuple\src\System\ValueTuple\ValueTuple.cs" />\r
     <Compile Include="..\..\build\common\AssemblyRef.cs" />\r
     <Compile Include="..\..\build\common\Consts.cs" />\r
     <Compile Include="..\..\build\common\Locale.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\diagnostics\contracts\contractsbcl.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\diagnostics\debuggerattributes.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\diagnostics\eventing\eventactivityoptions.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\diagnostics\eventing\eventsourceexception.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\diagnostics\eventing\TraceLogging\EventSourceOptions.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\diagnostics\eventing\TraceLogging\TraceLoggingEventTraits.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\diagnostics\eventing\winmeta.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\fieldaccessexception.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\flagsattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\formatexception.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\FormattableString.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\gc.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\globalization\bidicategory.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\globalization\calendar.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\globalization\calendaralgorithmtype.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\reflection\reflectioncontext.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\reflection\resourceattributes.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\reflection\RuntimeReflectionExtensions.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\reflection\targetexception.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\reflection\targetinvocationexception.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\reflection\targetparametercountexception.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\reflection\typeattributes.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\reflection\typedelegator.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\reflection\typefilter.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\datetimeconstantattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\decimalconstantattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\decoratednameattribute.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\disableprivatereflectionattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\discardableattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\extensionattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\fixedaddressvaluetypeattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\fixedbufferattribute.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\FormattableStringFactory.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\hascopysemanticsattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\IAsyncStateMachine.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\compilerservices\idispatchconstantattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\ucomienumconnections.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\unknownwrapper.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\variantWrapper.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\attributes.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\eventregistrationtoken.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\eventregistrationtokentable.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\iactivationfactory.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\irestrictederrorinfo.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\windowsruntimemarshal.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\NgenServicingAttributes.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\remoting\callcontext.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\serialization\deserializationeventhandler.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\serialization\streamingcontext.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\serialization\surrogateselector.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\serialization\valuetypefixupinfo.cs" />\r
-    <Compile Include="..\referencesource\mscorlib\system\runtime\versioning\binarycompatibility.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\versioning\componentguaranteesattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\versioning\multitargetinghelpers.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\versioning\NonVersionableAttribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\cryptography\ripemd160.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\cryptography\ripemd160managed.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\cryptography\rsa.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\security\cryptography\rsacryptoserviceprovider.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\cryptography\RSAEncryptionPadding.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\cryptography\RSAEncryptionPaddingMode.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\cryptography\rsaoaepkeyexchangedeformatter.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\cryptography\utils.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\cryptography\x509certificates\x509utils.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\principal\genericidentity.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\security\safesecurityhandles.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\securitycontext.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\securitydocument.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\util\hex.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\util\parser.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\security\util\tokenizer.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\serializableattribute.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\sharedstatics.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\single.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\stackoverflowexception.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\string.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\text\encoderreplacementfallback.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\text\encoding.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\text\encodinginfo.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\text\encodingprovider.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\text\mlangcodepageencoding.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\text\stringbuilder.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\text\stringbuildercache.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threadattributes.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\abandonedmutexexception.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\apartmentstate.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\threading\asynclocal.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\autoresetevent.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\CancellationToken.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\CancellationTokenRegistration.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\CancellationTokenSource.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\CountdownEvent.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\eventresetmode.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\threading\eventwaithandle.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\executioncontext.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\LazyInitializer.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\lockrecursionexception.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\timeout.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\waithandle.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threading\waithandlecannotbeopenedexception.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\threading\waithandleExtensions.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\threadstaticattribute.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\throwhelper.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\timeoutexception.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\unsafecharbuffer.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\version.cs" />\r
     <Compile Include="Assembly\AssemblyInfo.cs" />\r
-    <Compile Include="coreclr\AsyncLocal.cs" />\r
-    <Compile Include="coreclr\DisablePrivateReflectionAttribute.cs" />\r
-    <Compile Include="coreclr\EncodingProvider.cs" />\r
-    <Compile Include="coreclr\FormattableString.cs" />\r
-    <Compile Include="coreclr\FormattableStringFactory.cs" />\r
-    <Compile Include="coreclr\WaitHandleExtensions.cs" />\r
+    <Compile Include="corefx\SR.cs" />\r
     <Compile Include="Microsoft.Win32\IRegistryApi.cs" />\r
     <Compile Include="Microsoft.Win32\Registry.cs" />\r
     <Compile Include="Microsoft.Win32\RegistryHive.cs" />\r
     <Compile Include="Mono.Xml\SmallXmlParser.cs" />\r
     <Compile Include="Mono\DataConverter.cs" />\r
     <Compile Include="Mono\Runtime.cs" />\r
+    <Compile Include="Mono\RuntimeHandles.cs" />\r
+    <Compile Include="Mono\RuntimeMarshal.cs" />\r
+    <Compile Include="Mono\RuntimeStructs.cs" />\r
+    <Compile Include="Mono\SafeGPtrArrayHandle.cs" />\r
+    <Compile Include="Mono\SafeStringMarshal.cs" />\r
     <Compile Include="ReferenceSources\__ConsoleStream.cs" />\r
     <Compile Include="ReferenceSources\AppContextSwitches.cs" />\r
     <Compile Include="ReferenceSources\AppDomain.cs" />\r
     <Compile Include="ReferenceSources\Array.cs" />\r
     <Compile Include="ReferenceSources\BCLDebug.cs" />\r
+    <Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
     <Compile Include="ReferenceSources\Buffer.cs" />\r
     <Compile Include="ReferenceSources\CalendarData.cs" />\r
     <Compile Include="ReferenceSources\CLRConfig.cs" />\r
     <Compile Include="ReferenceSources\MethodBase.cs" />\r
     <Compile Include="ReferenceSources\NativeMethods.cs" />\r
     <Compile Include="ReferenceSources\ParseNumbers.cs" />\r
+    <Compile Include="ReferenceSources\PathInternal.cs" />\r
     <Compile Include="ReferenceSources\RemotingFieldCachedData.cs" />\r
     <Compile Include="ReferenceSources\RuntimeHandles.cs" />\r
     <Compile Include="ReferenceSources\RuntimeType.cs" />\r
     <Compile Include="ReferenceSources\SecurityContext.cs" />\r
-    <Compile Include="ReferenceSources\SharedStatics.cs" />\r
     <Compile Include="ReferenceSources\String.cs" />\r
     <Compile Include="ReferenceSources\TextInfo.cs" />\r
     <Compile Include="ReferenceSources\Type.cs" />\r
-    <Compile Include="ReferenceSources\TypeBuilderInstantiation.cs" />\r
     <Compile Include="ReferenceSources\TypeNameParser.cs" />\r
     <Compile Include="ReferenceSources\win32native.cs" />\r
     <Compile Include="System.Configuration.Assemblies\AssemblyHash.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventAttribute.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventCommand.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventCommandEventArgs.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventCounter.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventDataAttribute.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventFieldAttribute.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventFieldFormat.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventFieldTags.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventIgnoreAttribute.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventListener.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventManifestOptions.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventSource.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventSourceAttribute.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventSourceSettings.cs" />\r
     <Compile Include="System.IO\UnexceptionalStreamReader.cs" />\r
     <Compile Include="System.IO\UnexceptionalStreamWriter.cs" />\r
     <Compile Include="System.Reflection.Emit\AssemblyBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\AssemblyBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\AssemblyBuilderAccess.cs" />\r
     <Compile Include="System.Reflection.Emit\ConstructorBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\ConstructorBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\ConstructorOnTypeBuilderInst.cs" />\r
     <Compile Include="System.Reflection.Emit\CustomAttributeBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\CustomAttributeBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\DerivedTypes.cs" />\r
     <Compile Include="System.Reflection.Emit\DynamicILInfo.cs" />\r
     <Compile Include="System.Reflection.Emit\DynamicMethod.cs" />\r
     <Compile Include="System.Reflection.Emit\EnumBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\EnumBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\EventBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\EventBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\EventOnTypeBuilderInst.cs" />\r
     <Compile Include="System.Reflection.Emit\EventToken.cs" />\r
     <Compile Include="System.Reflection.Emit\FieldBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\FieldBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\FieldOnTypeBuilderInst.cs" />\r
     <Compile Include="System.Reflection.Emit\FieldToken.cs" />\r
     <Compile Include="System.Reflection.Emit\FlowControl.cs" />\r
     <Compile Include="System.Reflection.Emit\GenericTypeParameterBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\GenericTypeParameterBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\ILGenerator.cs" />\r
+    <Compile Include="System.Reflection.Emit\ILGenerator.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\Label.cs" />\r
     <Compile Include="System.Reflection.Emit\LocalBuilder.cs" />\r
     <Compile Include="System.Reflection.Emit\MethodBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\MethodBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\MethodOnTypeBuilderInst.cs" />\r
     <Compile Include="System.Reflection.Emit\MethodRental.cs" />\r
     <Compile Include="System.Reflection.Emit\MethodToken.cs" />\r
     <Compile Include="System.Reflection.Emit\ModuleBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\ModuleBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\MonoArrayMethod.cs" />\r
     <Compile Include="System.Reflection.Emit\OpCode.cs" />\r
     <Compile Include="System.Reflection.Emit\OpCodeNames.cs" />\r
     <Compile Include="System.Reflection.Emit\OperandType.cs" />\r
     <Compile Include="System.Reflection.Emit\PackingSize.cs" />\r
     <Compile Include="System.Reflection.Emit\ParameterBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\ParameterBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\ParameterToken.cs" />\r
     <Compile Include="System.Reflection.Emit\PEFileKinds.cs" />\r
     <Compile Include="System.Reflection.Emit\PropertyBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\PropertyBuilder.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\PropertyOnTypeBuilderInst.cs" />\r
     <Compile Include="System.Reflection.Emit\PropertyToken.cs" />\r
     <Compile Include="System.Reflection.Emit\SignatureHelper.cs" />\r
+    <Compile Include="System.Reflection.Emit\SignatureHelper.pns.cs" />\r
     <Compile Include="System.Reflection.Emit\SignatureToken.cs" />\r
     <Compile Include="System.Reflection.Emit\StackBehaviour.cs" />\r
     <Compile Include="System.Reflection.Emit\StringToken.cs" />\r
     <Compile Include="System.Reflection.Emit\TypeBuilder.cs" />\r
+    <Compile Include="System.Reflection.Emit\TypeBuilder.pns.cs" />\r
+    <Compile Include="System.Reflection.Emit\TypeBuilderInstantiation.cs" />\r
     <Compile Include="System.Reflection.Emit\TypeToken.cs" />\r
     <Compile Include="System.Reflection.Emit\UnmanagedMarshal.cs" />\r
+    <Compile Include="System.Reflection.Metadata\AssemblyExtensions.cs" />\r
     <Compile Include="System.Reflection\Assembly.cs" />\r
     <Compile Include="System.Reflection\AssemblyName.cs" />\r
     <Compile Include="System.Reflection\ConstructorInfo.cs" />\r
     <Compile Include="System.Reflection\MonoAssembly.cs" />\r
     <Compile Include="System.Reflection\MonoEvent.cs" />\r
     <Compile Include="System.Reflection\MonoField.cs" />\r
-    <Compile Include="System.Reflection\MonoGenericClass.cs" />\r
-    <Compile Include="System.Reflection\MonoGenericMethod.cs" />\r
     <Compile Include="System.Reflection\MonoMethod.cs" />\r
     <Compile Include="System.Reflection\MonoModule.cs" />\r
     <Compile Include="System.Reflection\MonoParameterInfo.cs" />\r
     <Compile Include="System.Reflection\PropertyInfo.cs" />\r
     <Compile Include="System.Reflection\ReflectionTypeLoadException.cs" />\r
     <Compile Include="System.Reflection\StrongNameKeyPair.cs" />\r
-    <Compile Include="System.Reflection\TargetException.cs" />\r
-    <Compile Include="System.Reflection\TargetInvocationException.cs" />\r
-    <Compile Include="System.Reflection\TargetParameterCountException.cs" />\r
     <Compile Include="System.Resources\Win32Resources.cs" />\r
     <Compile Include="System.Runtime.CompilerServices\ConditionalWeakTable.cs" />\r
     <Compile Include="System.Runtime.CompilerServices\RuntimeHelpers.cs" />\r
     <Compile Include="System.Runtime.Hosting\ActivationArguments.cs" />\r
     <Compile Include="System.Runtime.Hosting\ApplicationActivator.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\DefaultInterfaceAttribute.cs" />\r
     <Compile Include="System.Runtime.InteropServices.WindowsRuntime\DesignerNamespaceResolveEventArgs.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\EventRegistrationToken.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\EventRegistrationTokenTable.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\IActivationFactory.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\InterfaceImplementedInVersionAttribute.cs" />\r
     <Compile Include="System.Runtime.InteropServices.WindowsRuntime\NamespaceResolveEventArgs.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\ReadOnlyArrayAttribute.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\ReturnValueNameAttribute.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\WindowsRuntimeMarshal.cs" />\r
+    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\UnsafeNativeMethods.cs" />\r
     <Compile Include="System.Runtime.InteropServices.WindowsRuntime\WindowsRuntimeMetadata.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\WriteOnlyArrayAttribute.cs" />\r
     <Compile Include="System.Runtime.InteropServices\_Activator.cs" />\r
     <Compile Include="System.Runtime.InteropServices\_Assembly.cs" />\r
     <Compile Include="System.Runtime.InteropServices\_AssemblyBuilder.cs" />\r
     <Compile Include="System.Runtime.InteropServices\BIND_OPTS.cs" />\r
     <Compile Include="System.Runtime.InteropServices\BINDPTR.cs" />\r
     <Compile Include="System.Runtime.InteropServices\CALLCONV.cs" />\r
+    <Compile Include="System.Runtime.InteropServices\ComAwareEventInfo.cs" />\r
+    <Compile Include="System.Runtime.InteropServices\ComEventsHelper.cs" />\r
+    <Compile Include="System.Runtime.InteropServices\CustomQueryInterfaceMode.cs" />\r
     <Compile Include="System.Runtime.InteropServices\DESCKIND.cs" />\r
     <Compile Include="System.Runtime.InteropServices\DISPPARAMS.cs" />\r
     <Compile Include="System.Runtime.InteropServices\ELEMDESC.cs" />\r
     <Compile Include="System.Runtime.InteropServices\UCOMITypeLib.cs" />\r
     <Compile Include="System.Runtime.InteropServices\VARDESC.cs" />\r
     <Compile Include="System.Runtime.InteropServices\VARFLAGS.cs" />\r
+    <Compile Include="System.Runtime.Loader\AssemblyLoadContext.cs" />\r
     <Compile Include="System.Runtime.Remoting.Activation\ActivationServices.cs" />\r
     <Compile Include="System.Runtime.Remoting.Activation\ActivatorLevel.cs" />\r
     <Compile Include="System.Runtime.Remoting.Activation\AppDomainLevelActivator.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509Helper.cs" />\r
     <Compile Include="System.Security.Cryptography.X509Certificates\X509KeyStorageFlags.cs" />\r
     <Compile Include="System.Security.Cryptography\CryptoAPITransform.cs" />\r
+    <Compile Include="System.Security.Cryptography\CryptoConfig.common.cs" />\r
     <Compile Include="System.Security.Cryptography\CryptoConfig.cs" />\r
     <Compile Include="System.Security.Cryptography\CryptoConfig.fullaot.cs" />\r
-    <Compile Include="System.Security.Cryptography\CryptoConfig_2_1.cs" />\r
     <Compile Include="System.Security.Cryptography\CspKeyContainerInfo.cs" />\r
     <Compile Include="System.Security.Cryptography\DESCryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\DSACryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\ICspAsymmetricAlgorithm.cs" />\r
+    <Compile Include="System.Security.Cryptography\IncrementalHash.cs" />\r
     <Compile Include="System.Security.Cryptography\KeyNumber.cs" />\r
     <Compile Include="System.Security.Cryptography\MD5CryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\RC2CryptoServiceProvider.cs" />\r
     <Compile Include="System.Security\PermissionBuilder.cs" />\r
     <Compile Include="System.Security\PermissionSet.cs" />\r
     <Compile Include="System.Security\PolicyLevelType.cs" />\r
-    <Compile Include="System.Security\SafeAccessTokenHandle.cs" />\r
     <Compile Include="System.Security\SecureString.cs" />\r
     <Compile Include="System.Security\SecurityElement.cs" />\r
     <Compile Include="System.Security\SecurityException.cs" />\r
     <Compile Include="System.Text\NormalizationForm.cs" />\r
     <Compile Include="System.Threading.Tasks\DecoupledTask.cs" />\r
     <Compile Include="System.Threading\CompressedStack.cs" />\r
-    <Compile Include="System.Threading\EventWaitHandle.cs" />\r
     <Compile Include="System.Threading\HostExecutionContext.cs" />\r
     <Compile Include="System.Threading\HostExecutionContextManager.cs" />\r
     <Compile Include="System.Threading\Interlocked.cs" />\r
     <Compile Include="System\EmptyArray.cs" />\r
     <Compile Include="System\Environment.cs" />\r
     <Compile Include="System\EnvironmentVariableTarget.cs" />\r
-    <Compile Include="System\GC.cs" />\r
-    <Compile Include="System\GCCollectionMode.cs" />\r
-    <Compile Include="System\GCNotificationStatus.cs" />\r
     <Compile Include="System\Guid.cs" />\r
     <Compile Include="System\IConsoleDriver.cs" />\r
     <Compile Include="System\IntPtr.cs" />\r
index 3716291a2686d256f3466d4aa50d8b7ff0025a72..371d01ba4c1628b3105cd3c053802e0a6dab3a84 100644 (file)
@@ -164,6 +164,7 @@ System.Diagnostics/StackFrame.cs
 System.Diagnostics/StackTrace.cs
 System.Diagnostics.Tracing/EventAttribute.cs
 System.Diagnostics.Tracing/EventCommand.cs
+System.Diagnostics.Tracing/EventCounter.cs
 System.Diagnostics.Tracing/EventSource.cs
 System.Diagnostics.Tracing/EventSourceAttribute.cs
 System.Diagnostics.Tracing/EventSourceSettings.cs
@@ -245,8 +246,6 @@ System.Reflection/MethodBody.cs
 System.Reflection/Module.cs
 System.Reflection/ModuleResolveEventHandler.cs
 System.Reflection/MonoAssembly.cs
-System.Reflection/MonoGenericClass.cs
-System.Reflection/MonoGenericMethod.cs
 System.Reflection/MonoEvent.cs
 System.Reflection/MonoField.cs
 System.Reflection/MonoMethod.cs
@@ -301,6 +300,7 @@ System.Reflection.Emit/SignatureToken.cs
 System.Reflection.Emit/StackBehaviour.cs
 System.Reflection.Emit/StringToken.cs
 System.Reflection.Emit/TypeBuilder.cs
+System.Reflection.Emit/TypeBuilderInstantiation.cs
 System.Reflection.Emit/TypeToken.cs
 System.Reflection.Emit/UnmanagedMarshal.cs
 System.Reflection.Emit/AssemblyBuilder.pns.cs
@@ -424,18 +424,10 @@ System.Runtime.InteropServices/CustomQueryInterfaceMode.cs
 System.Runtime.InteropServices/ComAwareEventInfo.cs
 System.Runtime.InteropServices/ComEventsHelper.cs
 
-System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs
 System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs
-System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs
-System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs
-System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs
-System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs
 System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.cs
-System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs
-System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs
-System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs
+System.Runtime.InteropServices.WindowsRuntime/UnsafeNativeMethods.cs
 System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.cs
-System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs
 System.Runtime.Remoting/ActivatedClientTypeEntry.cs
 System.Runtime.Remoting/ActivatedServiceTypeEntry.cs
 System.Runtime.Remoting/CustomErrorsModes.cs
@@ -713,6 +705,7 @@ System.Security.Cryptography/CspKeyContainerInfo.cs
 System.Security.Cryptography/DESCryptoServiceProvider.cs
 System.Security.Cryptography/DSACryptoServiceProvider.cs
 System.Security.Cryptography/ICspAsymmetricAlgorithm.cs
+System.Security.Cryptography/IncrementalHash.cs
 System.Security.Cryptography/KeyNumber.cs
 System.Security.Cryptography/MD5CryptoServiceProvider.cs
 System.Security.Cryptography/RC2CryptoServiceProvider.cs
@@ -900,14 +893,14 @@ ReferenceSources/MethodBase.cs
 ReferenceSources/NativeMethods.cs
 ReferenceSources/RuntimeHandles.cs
 ReferenceSources/CompareInfo.cs
-ReferenceSources/TypeBuilderInstantiation.cs
 ReferenceSources/Buffer.cs
 ReferenceSources/TextInfo.cs
 ReferenceSources/win32native.cs
-ReferenceSources/SharedStatics.cs
 ReferenceSources/SecurityContext.cs
 ReferenceSources/PathInternal.cs
 ReferenceSources/BinaryCompatibility.cs
+ReferenceSources/String.cs
+ReferenceSources/Type.cs
 
 ../referencesource/mscorlib/system/__filters.cs
 ../referencesource/mscorlib/system/__hresults.cs
@@ -1030,6 +1023,7 @@ ReferenceSources/BinaryCompatibility.cs
 ../referencesource/mscorlib/system/rttype.cs
 ../referencesource/mscorlib/system/sbyte.cs
 ../referencesource/mscorlib/system/serializableattribute.cs
+../referencesource/mscorlib/system/sharedstatics.cs
 ../referencesource/mscorlib/system/stackoverflowexception.cs
 ../referencesource/mscorlib/system/single.cs
 ../referencesource/mscorlib/system/string.cs
@@ -1346,6 +1340,13 @@ ReferenceSources/BinaryCompatibility.cs
 
 ../referencesource/mscorlib/system/runtime/interopservices/expando/iexpando.cs
 
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iactivationfactory.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/irestrictederrorinfo.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs
+
 ../referencesource/mscorlib//system/runtime/reliability/criticalfinalizerobject.cs
 ../referencesource/mscorlib//system/runtime/reliability/prepreparemethodattribute.cs
 ../referencesource/mscorlib//system/runtime/reliability/reliabilitycontractattribute.cs
@@ -1642,5 +1643,10 @@ ReferenceSources/BinaryCompatibility.cs
 ../referencesource/mscorlib/microsoft/win32/safehandles/safewaithandle.cs
 ../referencesource/mscorlib/microsoft/win32/safehandles/win32safehandles.cs
 
-ReferenceSources/String.cs
-ReferenceSources/Type.cs
+corefx/SR.cs
+
+../../../external/corefx/src/Common/src/System/Numerics/Hashing/HashHelpers.cs
+
+../../../external/corefx/src/System.ValueTuple/src/System/ValueTuple/ValueTuple.cs
+../../../external/corefx/src/System.ValueTuple/src/System/ValueTuple/TupleExtensions.cs
+../../../external/corefx/src/System.ValueTuple/src/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs
index bc43d92b9202a4dd44bdfb2a61ad24b4f04e4e2a..4e444a37efa54a3462c548504d90a02f096fddb2 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 Microsoft.Win32/RegistryKeyTest.cs
 Mono/DataConvertTest.cs
 ../Mono/DataConverter.cs
index a2e5ca0a4c157c1d6e97c17d340b90375fbbaef3..3489ee15514ca283e2c358fbbfa84cdeaf144b88 100644 (file)
@@ -29,7 +29,9 @@ namespace System.Linq.Expressions.Compiler {
         private const MethodAttributes CtorAttributes = MethodAttributes.RTSpecialName | MethodAttributes.HideBySig | MethodAttributes.Public;
         private const MethodImplAttributes ImplAttributes = MethodImplAttributes.Runtime | MethodImplAttributes.Managed;
         private const MethodAttributes InvokeAttributes = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Virtual;
+#if FEATURE_REFEMIT
         private static readonly Type[] _DelegateCtorSignature = new Type[] { typeof(object), typeof(IntPtr) };
+#endif
 
         private static Type MakeNewCustomDelegate(Type[] types) {
 #if FEATURE_REFEMIT
diff --git a/mcs/class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj b/mcs/class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj
new file mode 100644 (file)
index 0000000..b00c041
--- /dev/null
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\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>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <NoWarn>1699,1699</NoWarn>\r
+    <OutputPath>./../../../class/lib/net_4_x/legacy</OutputPath>\r
+    <IntermediateOutputPath>obj-legacy</IntermediateOutputPath>\r
+    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
+    <NoStdLib>True</NoStdLib>\r
+    \r
+    <NoConfig>True</NoConfig>\r
+    \r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>\r
+    </RootNamespace>\r
+    <AssemblyName>Mono.Cecil</AssemblyName>\r
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
+    <FileAlignment>512</FileAlignment>\r
+  </PropertyGroup>\r
+    <PropertyGroup>\r
+    <SignAssembly>true</SignAssembly>\r
+  </PropertyGroup>\r
+  <PropertyGroup>\r
+    <AssemblyOriginatorKeyFile>../../mono.snk</AssemblyOriginatorKeyFile>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <NoWarn>1699,1699</NoWarn>\r
+    <Optimize>false</Optimize>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</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,1699</NoWarn>\r
+    <Optimize>true</Optimize>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5;NET_4_0;NET_4_5;NET_4_6;MONO;NET_3_5</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="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\Code.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\CodeReader.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\CodeWriter.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\Document.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\ExceptionHandler.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\ILProcessor.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\Instruction.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\MethodBody.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\OpCode.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\OpCodes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\SequencePoint.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\Symbols.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\VariableDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Cil\VariableReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\BlobHeap.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\Buffers.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\CodedIndex.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\ElementType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\GuidHeap.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\Heap.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\MetadataToken.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\Row.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\StringHeap.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\TableHeap.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\TokenType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\UserStringHeap.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.Metadata\Utilities.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\BinaryStreamReader.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\BinaryStreamWriter.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\ByteBuffer.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\ByteBufferEqualityComparer.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\DataDirectory.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\Image.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\ImageReader.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\ImageWriter.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\Section.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil.PE\TextMap.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ArrayType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyFlags.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyHashAlgorithm.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyInfo.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyLinkedResource.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyNameDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyNameReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyReader.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\AssemblyWriter.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\BaseAssemblyResolver.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\CallSite.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\CustomAttribute.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\DefaultAssemblyResolver.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\EmbeddedResource.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\EventAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\EventDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\EventReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ExportedType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FieldAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FieldDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FieldReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FileAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\FunctionPointerType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\GenericInstanceMethod.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\GenericInstanceType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\GenericParameter.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\GenericParameterAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IConstantProvider.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ICustomAttributeProvider.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IGenericInstance.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IGenericParameterProvider.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMarshalInfoProvider.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMemberDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMetadataScope.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMetadataTokenProvider.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\IMethodSignature.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\Import.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\LinkedResource.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ManifestResourceAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MarshalInfo.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MemberDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MemberReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MetadataResolver.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MetadataSystem.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodCallingConvention.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodImplAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodReturnType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodSemanticsAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\MethodSpecification.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\Modifiers.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ModuleDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ModuleKind.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ModuleReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\NativeType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ParameterAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ParameterDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ParameterDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ParameterReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PinnedType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PInvokeAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PInvokeInfo.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PointerType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PropertyAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PropertyDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\PropertyReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\ReferenceType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\Resource.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\SecurityDeclaration.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\SentinelType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TargetRuntime.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeAttributes.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeDefinition.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeParser.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeReference.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeSpecification.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\TypeSystem.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Cecil\VariantType.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Collections.Generic\Collection.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Collections.Generic\ReadOnlyCollection.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Security.Cryptography\CryptoConvert.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono.Security.Cryptography\CryptoService.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono\Actions.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono\Empty.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\Mono\Funcs.cs" />\r
+    <Compile Include="..\..\..\..\external\cecil-legacy\System.Runtime.CompilerServices\ExtensionAttribute.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.Core/System.Core-net_4_x.csproj">\r
+      <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
+      <Name>System.Core-net_4_x</Name>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Folder Include="Properties\" />\r
+  </ItemGroup>\r
+</Project>\r
+
index 9af81920a16b972c3d4f02f72597a4ba1d85e24d..fa3ffe15ac50e4eeb370f879d42c8af6ccfa69d8 100644 (file)
@@ -47,7 +47,7 @@ namespace MonoTests.Monodoc.Generators
                {
                        var xml = rootTree.RenderUrl ("T:System.String", generator);
                        Assert.IsNotNull (xml);
-                       Assert.IsNotEmpty (xml);
+                       AssertHelper.IsNotEmpty (xml);
                        AssertValidXml (xml);
                        AssertEcmaFullTypeName (xml, "System.String");
                }
@@ -57,7 +57,7 @@ namespace MonoTests.Monodoc.Generators
                {
                        var xml = rootTree.RenderUrl ("T:System.Int32", generator);
                        Assert.IsNotNull (xml);
-                       Assert.IsNotEmpty (xml);
+                       AssertHelper.IsNotEmpty (xml);
                        AssertValidXml (xml);
                        AssertEcmaFullTypeName (xml, "System.Int32");
                }
index 867c9b793898dfb675e3aa05f15da5df70e6ec4c..29da7513704aead3d9f0d098a5b02d737c99e847 100644 (file)
@@ -85,7 +85,7 @@ namespace MonoTests.Monodoc
 
                        // HACK: in reality we have currently 4 known issues which are due to duplicated namespaces across
                        // doc sources, something that was never supported and that we need to improve/fix at some stage
-                       Assert.LessOrEqual (4, errorCount, errorCount + " / " + testCount.ToString ());
+                       AssertHelper.LessOrEqual (4, errorCount, errorCount + " / " + testCount.ToString ());
                }
 
                IEnumerable<Node> GetLeaves (Node node)
index 29ac108da8d5f2db0e007e42b6c721f3116f97fa..fc6bf8da18afd209240b12ab87373ec2b2c57ef5 100644 (file)
@@ -17,7 +17,7 @@ namespace MonoTests.Monodoc
                {
                        // the docPath variable is the only one we know for sure should exist
                        Assert.IsNotNull (Config.Get ("docPath"));
-                       Assert.IsNotEmpty (Config.Get ("docPath"));
+                       AssertHelper.IsNotEmpty (Config.Get ("docPath"));
                }
        }
 }
index 114d68896c5a6de9edfadb80ac938174fc1c6f42..a356d2789c0cf2f2550e61f1de38a102d2d61205 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>618,612,672,809,1699,169,164,162,168,219,618,612</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;LEGACY_MODE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;LEGACY_MODE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>618,612,672,809,1699,169,164,162,168,219,618,612</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>LEGACY_MODE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>LEGACY_MODE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index b806b8fb6e970302dd755c331a070e831781639a..a3f19b731a01371628deab21a6efcb1866c0df76 100644 (file)
@@ -1,3 +1,4 @@
+../../test-helpers/NunitHelpers.cs
 Monodoc/HelpSourceTests.cs
 Monodoc/EcmaDocTests.cs
 Monodoc/TreeTest.cs
index d603b38fdcb1197ccaefe0df9449a6646e0e5779..a86c03ff01e8cfc78fb5c08150c498456faf873f 100644 (file)
@@ -40,6 +40,7 @@ namespace System.Data.Sql {
 
         override public DataTable GetDataSources() {
 #if MONO
+            timeoutTime = 0;
             throw new NotImplementedException ();
 #else
             (new NamedPermissionSet("FullTrust")).Demand(); // SQLBUDT 244304
index 9feea179f30dba470524c8f8a4c5e69ea385fac5..d1b0ab5f9ebfd615bf7497c17a6fe2dc50c09f72 100644 (file)
@@ -31,7 +31,9 @@ namespace System.CodeDom {
         private CodeNamespaceImportCollection imports = new CodeNamespaceImportCollection();
         private CodeCommentStatementCollection comments = new CodeCommentStatementCollection();
         private CodeTypeDeclarationCollection classes = new CodeTypeDeclarationCollection();
+#if CODEDOM_NESTED_NAMESPACES
         private CodeNamespaceCollection namespaces = new CodeNamespaceCollection();
+#endif
         
         private int  populated = 0x0;
         private const int ImportsCollection = 0x1;
index 28d511744cc529a7ce58dcd005affdd709863c8f..38ccf72ec0efd622c8ddb04f9d6f9bf6d7dae25a 100644 (file)
@@ -27,7 +27,9 @@ namespace System.CodeDom {
     public class CodePropertyReferenceExpression : CodeExpression {
         private CodeExpression targetObject;
         private string propertyName;
+#if !MONO
         private CodeExpressionCollection parameters = new CodeExpressionCollection();
+#endif
 
         /// <devdoc>
         ///    <para>
index 96ec1aa520a7c723dec25a3cfec0622a4fe1ca0d..82bfe6c56ae9d6e0857deca6701a76f49326824f 100644 (file)
@@ -98,11 +98,15 @@ namespace System.ComponentModel {
         }
 
         private class LicFileLicense : License {
+#if !MONO
             private LicFileLicenseProvider owner;
+#endif
             private string key;
 
             public LicFileLicense(LicFileLicenseProvider owner, string key) {
+#if !MONO
                 this.owner = owner;
+#endif
                 this.key = key;
             }
             public override string LicenseKey { 
index cfdaabbfc31b6a1cebc722cc91676164afa19480..ce8d0cd7dfdb4d866312365a2dad2c2f79c20bc8 100644 (file)
@@ -67,9 +67,10 @@ namespace System.ComponentModel {
     /// </devdoc>
     [HostProtection(SharedState = true)]
     internal sealed class ReflectEventDescriptor : EventDescriptor {
-
+#if !MONO
         private static readonly Type[] argsNone = new Type[0];
         private static readonly object  noDefault = new object();
+#endif
 
         private Type type;           // the delegate type for the event
         private readonly Type componentClass; // the class of the component this info is for
index 401c21e4d6697f3c41556dd58df794435d5c3d73..94424b88b02e177303499237b0c0f28e7a7894e7 100644 (file)
@@ -64,7 +64,9 @@ namespace System.ComponentModel {
         
         private static TraceSwitch PropDescCreateSwitch = new TraceSwitch("PropDescCreate", "ReflectPropertyDescriptor: Dump errors when creating property info");
         private static TraceSwitch PropDescUsageSwitch  = new TraceSwitch("PropDescUsage", "ReflectPropertyDescriptor: Debug propertydescriptor usage");
+#if !MONO
         private static TraceSwitch PropDescSwitch       = new TraceSwitch("PropDesc", "ReflectPropertyDescriptor: Debug property descriptor");
+#endif
         
         private static readonly int BitDefaultValueQueried      = BitVector32.CreateMask();
         private static readonly int BitGetQueried               = BitVector32.CreateMask(BitDefaultValueQueried);
index 246b3aee430291b32e13ec4c5882d268e17ce5b4..3bcd73437916cca6106e50c327e3fb4d4b83005a 100644 (file)
@@ -28,8 +28,10 @@ namespace System.ComponentModel {
 
         private const string s_UseCompatibleTypeConverterBehavior = "UseCompatibleTypeConverterBehavior";
         private static volatile bool useCompatibleTypeConversion = false;
+#if !MONO
         private static volatile bool firstLoadAppSetting = true;
         private static object loadAppSettingLock = new Object();
+#endif
 
         private static bool UseCompatibleTypeConversion {
             get {
index cf77c9972b2967219bba6e0992252ca86961ca7c..17c7e0f4077176e2fa91f6be683afadc8abb0796 100644 (file)
@@ -2348,11 +2348,11 @@ namespace System.ComponentModel
             {
                 TypeDescriptionNode head = (TypeDescriptionNode)_providerTable[key];
                 TypeDescriptionNode target = head;
-                TypeDescriptionNode prev = null;
+//                TypeDescriptionNode prev = null;
 
                 while(target != null && target.Provider != provider)
                 {
-                    prev = target;
+//                    prev = target;
                     target = target.Next;
                 }
 
index c400a3e411cdb36b18b7ec5dae2ca8191195b43c..1a4cd98d9610c35ddffd981e873d86431f1cc08d 100644 (file)
@@ -18,8 +18,10 @@ namespace System.Diagnostics {
         [ThreadStatic]
         static int indentLevel;
         static volatile int indentSize;
+#if CONFIGURATION_DEP
         static volatile bool settingsInitialized;
         static volatile bool defaultInitialized;
+#endif
 
 
         // this is internal so TraceSource can use it.  We want to lock on the same object because both TraceInternal and 
@@ -303,7 +305,9 @@ namespace System.Diagnostics {
         // in the System.Diagnostics.Trace class
         static internal void Refresh() {
             lock (critSec) {
+#if CONFIGURATION_DEP
                 settingsInitialized = false;
+#endif
                 listeners = null;
             }
             InitializeSettings();
index e3273c4c9c95a17746b5cae33d505851391c123c..dce8967231569d9d14eec974bc8db728257042b2 100644 (file)
@@ -183,8 +183,8 @@ namespace System.Net {
                 // call !
                 //
                 SocketException e = null;
-                long   scope = 0;
 #if !MONO
+                long   scope = 0;
                 if(Socket.OSSupportsIPv6)
                 {
                     byte[] bytes = new byte[IPv6AddressBytes];
index 05732c28d3646eba263c003145863812cd75f45d..bcd27d93699729e0b16b473c2ae353aa9e4ed5af 100644 (file)
@@ -953,7 +953,7 @@ namespace System.Net {
         // There are threading tricks a malicious app can use to create an ArraySegment with mismatched 
         // array/offset/count.  Copy locally and make sure they're valid before using them.
         internal static void ValidateSegment(ArraySegment<byte> segment) {
-            if (segment == null || segment.Array == null) {
+            if (/*segment == null ||*/ segment.Array == null) {
                 throw new ArgumentNullException("segment");
             }
             // Length zero is explicitly allowed
index 06aa93aa15b3494ee32297ef1ffb5ccae85d37d3..3f9b4d7c8c8e538011a29f93c04cee1b8d247adc 100644 (file)
@@ -4,6 +4,10 @@
 // </copyright>
 //------------------------------------------------------------------------------
 
+#if MONO
+#undef FEATURE_PAL
+#endif
+
 namespace System.Net {
 
     using System.IO;
@@ -22,9 +26,11 @@ namespace System.Net {
     /// </devdoc>
     public class NetworkCredential : ICredentials,ICredentialsByHost {
 
+#if FEATURE_MONO_CAS
         private static volatile EnvironmentPermission m_environmentUserNamePermission;
         private static volatile EnvironmentPermission m_environmentDomainNamePermission;
         private static readonly object lockingObject = new object();
+#endif
         private string m_domain;
         private string m_userName;
 #if !FEATURE_PAL
@@ -85,6 +91,7 @@ namespace System.Net {
         }
 #endif //!FEATURE_PAL        
 
+#if FEATURE_MONO_CAS
         void InitializePart1() {
             if (m_environmentUserNamePermission == null) {
                 lock(lockingObject) {
@@ -95,7 +102,7 @@ namespace System.Net {
                 }
             }
         }
-
+#endif
 
         /// <devdoc>
         ///    <para>
@@ -104,8 +111,10 @@ namespace System.Net {
         /// </devdoc>
         public string UserName {
             get {
+#if FEATURE_MONO_CAS
                 InitializePart1();
                 m_environmentUserNamePermission.Demand();
+#endif
                 return InternalGetUserName();
             }
             set {
@@ -124,7 +133,9 @@ namespace System.Net {
         /// </devdoc>
         public string Password {
             get {
+#if FEATURE_MONO_CAS
                 ExceptionHelper.UnmanagedPermission.Demand();
+#endif
                 return InternalGetPassword();
             }
             set {
@@ -151,7 +162,9 @@ namespace System.Net {
         /// </devdoc>
         public SecureString SecurePassword {
             get {
+#if FEATURE_MONO_CAS
                 ExceptionHelper.UnmanagedPermission.Demand();
+#endif
                 return InternalGetSecurePassword().Copy();
             }
             set {
@@ -171,8 +184,10 @@ namespace System.Net {
         /// </devdoc>
         public string Domain {
             get {
+#if FEATURE_MONO_CAS
                 InitializePart1();
                 m_environmentDomainNamePermission.Demand();
+#endif
                 return InternalGetDomain();
             }
             set {
index 506c90a59d6cb5cdf050ab20aa639faf9fb7737e..ee56c48eabc29f3a64539b00758f7abba3abc914 100644 (file)
@@ -108,23 +108,27 @@ namespace System.Net.Sockets {
         private SocketAddress   m_PermittedRemoteAddress;
 
         private DynamicWinsockMethods m_DynamicWinsockMethods;
+#endif // !MONO
 
         private static object s_InternalSyncObject;
+#if !MONO
         private int m_CloseTimeout = Socket.DefaultCloseTimeout;
         private int m_IntCleanedUp;                 // 0 if not completed >0 otherwise.
         private const int microcnv = 1000000;
         private readonly static int protocolInformationSize = Marshal.SizeOf(typeof(UnsafeNclNativeMethods.OSSOCK.WSAPROTOCOL_INFO));
+#endif // !MONO
 
         internal static volatile bool s_SupportsIPv4;
         internal static volatile bool s_SupportsIPv6;
         internal static volatile bool s_OSSupportsIPv6;
         internal static volatile bool s_Initialized;
+#if !MONO
         private static volatile WaitOrTimerCallback s_RegisteredWaitCallback;
+#endif
         private static volatile bool s_LoggingEnabled;
 #if !FEATURE_PAL // perfcounter
         internal static volatile bool s_PerfCountersEnabled;
 #endif
-#endif // !MONO
 
 //************* constructors *************************
 
@@ -136,7 +140,6 @@ namespace System.Net.Sockets {
             DualMode = true;
         }
 
-#if !MONO
         /// <devdoc>
         ///    <para>
         ///       Initializes a new instance of the <see cref='Sockets.Socket'/> class.
@@ -146,10 +149,16 @@ namespace System.Net.Sockets {
             s_LoggingEnabled = Logging.On;
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Socket", addressFamily);
             InitializeSockets();
+
+#if MONO
+            int error;
+            m_Handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
+#else
             m_Handle = SafeCloseSocket.CreateWSASocket(
                     addressFamily,
                     socketType,
                     protocolType);
+#endif
 
             if (m_Handle.IsInvalid) {
                 //
@@ -167,10 +176,14 @@ namespace System.Net.Sockets {
                 SetIPProtectionLevel(defaultProtectionLevel);
             }
 
+#if MONO
+            SocketDefaults ();
+#endif
+
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "Socket", null);
         }
 
-
+#if !MONO
         public Socket(SocketInformation socketInformation) {
             s_LoggingEnabled = Logging.On;
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Socket", addressFamily);
@@ -288,7 +301,7 @@ namespace System.Net.Sockets {
             protocolType = Sockets.ProtocolType.Unknown;
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "Socket", null);
         }
-
+#endif
 
 
 //************* properties *************************
@@ -339,7 +352,7 @@ namespace System.Net.Sockets {
             }
         }
 
-
+#if !MONO
         /// <devdoc>
         ///    <para>
         ///       Gets the amount of data pending in the network's input buffer that can be
@@ -1095,6 +1108,7 @@ namespace System.Net.Sockets {
             Connect(addresses,port);
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "Connect", null);
         }
+#endif // !MONO
 
         public void Connect(IPAddress[] addresses, int port){
             if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Connect", addresses);
@@ -1143,7 +1157,7 @@ namespace System.Net.Sockets {
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "Connect", null);
         }
 
-
+#if !MONO
         /// <devdoc>
         ///    <para>
         ///       Forces a socket connection to close.
@@ -5716,7 +5730,7 @@ namespace System.Net.Sockets {
             InternalSetBlocking(willBlockInternal);
             if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "Shutdown", "");
         }
-
+#endif
 
 
 //************* internal and private properties *************************
@@ -5731,6 +5745,7 @@ namespace System.Net.Sockets {
             }
         }
 
+#if !MONO
         private CacheSet Caches
         {
             get
@@ -6004,13 +6019,14 @@ namespace System.Net.Sockets {
 
             return socketAddress;
         }
-
+#endif
 
         internal static void InitializeSockets() {
             if (!s_Initialized) {
                 lock(InternalSyncObject){
                     if (!s_Initialized) {
 
+#if !MONO
                         WSAData wsaData = new WSAData();
 
                         SocketError errorCode =
@@ -6025,6 +6041,7 @@ namespace System.Net.Sockets {
                             // WSAStartup does not set LastWin32Error
                             throw new SocketException(errorCode);
                         }
+#endif
 
 #if !FEATURE_PAL
                         //
@@ -6045,6 +6062,10 @@ namespace System.Net.Sockets {
                         bool   ipv4      = true; 
                         bool   ipv6      = true; 
 
+#if MONO
+                        ipv4 = IsProtocolSupported (System.Net.NetworkInformation.NetworkInterfaceComponent.IPv4);
+                        ipv6 = IsProtocolSupported (System.Net.NetworkInformation.NetworkInterfaceComponent.IPv6);
+#else
                         SafeCloseSocket.InnerSafeCloseSocket socketV4 = 
                                                              UnsafeNclNativeMethods.OSSOCK.WSASocket(
                                                                     AddressFamily.InterNetwork, 
@@ -6078,7 +6099,7 @@ namespace System.Net.Sockets {
                         socketV6.Close();
 
                         // <
-
+#endif // MONO
 
 
 #if COMNET_DISABLEIPV6
@@ -6112,16 +6133,19 @@ namespace System.Net.Sockets {
 
                         // Cache some settings locally.
 
+#if !MONO
 #if !FEATURE_PAL // perfcounter
                         s_PerfCountersEnabled = NetworkingPerfCounters.Instance.Enabled;
 #endif
+#endif
+
                         s_Initialized = true;
                     }
                 }
             }
         }
 
-
+#if !MONO
         internal void InternalConnect(EndPoint remoteEP)
         {
             EndPoint endPointSnapshot = remoteEP;
@@ -7819,6 +7843,7 @@ namespace System.Net.Sockets {
             return retval;
         }
 
+#endif // MONO
         public static bool ConnectAsync(SocketType socketType, ProtocolType protocolType, SocketAsyncEventArgs e) {
 
             bool retval;
@@ -7861,6 +7886,7 @@ namespace System.Net.Sockets {
             return retval;
         }
 
+#if !MONO
         public static void CancelConnectAsync(SocketAsyncEventArgs e) {
 
             if (e == null) {
@@ -8406,7 +8432,7 @@ namespace System.Net.Sockets {
         internal AcceptAsyncResult(object myObject, object myState, AsyncCallback myCallBack):base(myObject, myState, myCallBack) {
         }
     }
-
+#endif
 
     public enum SocketAsyncOperation {
         None = 0,
@@ -8427,7 +8453,11 @@ namespace System.Net.Sockets {
         internal byte [] m_Buffer;
         internal int m_Offset;
         internal int m_Count;
+#if MONO
+        bool m_endOfPacket;
+#else
         internal UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags m_Flags;
+#endif
 
         // hide default constructor
         private SendPacketsElement() {}
@@ -8453,8 +8483,13 @@ namespace System.Net.Sockets {
             }
             Contract.EndContractBlock();
 
+#if MONO
+            Initialize(filepath, null, offset, count, /*UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags.File,*/
+                endOfPacket);
+#else
             Initialize(filepath, null, offset, count, UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags.File,
                 endOfPacket);
+#endif
         }
 
         // constructors for buffer elements
@@ -8476,21 +8511,30 @@ namespace System.Net.Sockets {
             }
             Contract.EndContractBlock();
 
+#if MONO
+            Initialize(null, buffer, offset, count, /*UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags.Memory,*/
+                endOfPacket);
+#else
             Initialize(null, buffer, offset, count, UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags.Memory, 
                 endOfPacket);
+#endif
         }
 
         private void Initialize(string filePath, byte[] buffer, int offset, int count, 
-            UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags flags, bool endOfPacket) {
+            /*UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags flags,*/ bool endOfPacket) {
 
             m_FilePath = filePath;
             m_Buffer = buffer;
             m_Offset = offset;
             m_Count = count;
+#if MONO
+            m_endOfPacket = endOfPacket;
+#else
             m_Flags = flags;
             if (endOfPacket) {
                 m_Flags |= UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags.EndOfPacket;
             }
+#endif
         }
 
         // Filename property
@@ -8515,7 +8559,13 @@ namespace System.Net.Sockets {
 
         // EndOfPacket property
         public bool EndOfPacket {
-            get { return (m_Flags & UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags.EndOfPacket) != 0; }
+            get {
+#if MONO
+                return m_endOfPacket;
+#else
+                return (m_Flags & UnsafeNclNativeMethods.OSSOCK.TransmitPacketsElementFlags.EndOfPacket) != 0;
+#endif
+             }
         }
     }
 
@@ -8530,6 +8580,7 @@ namespace System.Net.Sockets {
     }
     #endregion        
 
+#if !MONO
     public class SocketAsyncEventArgs : EventArgs, IDisposable {
 
         // Struct sizes needed for some custom marshalling.
index cf5ae7d3e836d489f3e1b0a4093530d14bbd6968..43a0479d2d401b20072382de536a106789e19737 100644 (file)
@@ -285,8 +285,13 @@ namespace System.Net.Sockets {
                 throw new ArgumentNullException("asyncResult");
             }
 
+#if MONO
+            var sar = asyncResult as SocketAsyncResult;
+            Socket asyncSocket = sar == null ? null : sar.socket;
+#else
             LazyAsyncResult lazyResult = asyncResult as LazyAsyncResult;
             Socket asyncSocket = lazyResult == null ? null : lazyResult.AsyncObject as Socket;
+#endif
             if (asyncSocket == null)
             {
                 throw new ArgumentException(SR.GetString(SR.net_io_invalidasyncresult), "asyncResult");
@@ -318,8 +323,13 @@ namespace System.Net.Sockets {
                 throw new ArgumentNullException("asyncResult");
             }
 
+#if MONO
+            var sar = asyncResult as SocketAsyncResult;
+            Socket asyncSocket = sar == null ? null : sar.socket;
+#else
             LazyAsyncResult lazyResult = asyncResult as LazyAsyncResult;
             Socket asyncSocket = lazyResult == null ? null : lazyResult.AsyncObject as Socket;
+#endif
             if (asyncSocket == null)
             {
                 throw new ArgumentException(SR.GetString(SR.net_io_invalidasyncresult), "asyncResult");
index a9be75be0a64be172631a8208a3654087be8cb87..9f1444146c15c608265776922dd3d83da803f650 100644 (file)
@@ -1209,7 +1209,6 @@ namespace System.Net {
             }
         }
 
-#if !MONO
         //
         internal void SetupCacheProtocol(Uri uri)
         {
@@ -1224,6 +1223,7 @@ namespace System.Net {
             }
         }
 
+#if !MONO
         delegate void DelEtwFireBeginWRGet(object id, string uri, bool success, bool synchronous);
         delegate void DelEtwFireEndWRGet(object id, bool success, bool synchronous);
         delegate void DelEtwFireEndWRespGet(object id, bool success, bool synchronous, int statusCode);
index 2a315eaf42426b0beae95ed064b64a4e4168d184..501fc3493562b8bdc73c722de30153dc2038161e 100644 (file)
@@ -146,7 +146,9 @@ namespace System.Net {
             }
             public object OwningObject;
             public GeneralAsyncDelegate AsyncCallback;
+#if !MONO
             public bool Completed;
+#endif
             public ConnectionPool Pool;
             public int CreationTimeout;
         }
@@ -811,7 +813,9 @@ namespace System.Net {
     /// </devdoc>
     sealed internal class InterlockedStack {
         private readonly Stack _stack = new Stack();
+#if !MONO
         private int _count;
+#endif
 
 #if DEBUG
         private readonly Hashtable doublepush = new Hashtable();
@@ -832,7 +836,9 @@ namespace System.Net {
 #if DEBUG
                 GlobalLog.Assert(_count+1 == _stack.Count, "push count mishandle");
 #endif
+#if !MONO
                 _count = _stack.Count;
+#endif
             }
         }
 
@@ -845,7 +851,9 @@ namespace System.Net {
                     GlobalLog.Assert(_count-1 == _stack.Count, "pop count mishandle");
                     doublepush.Remove(pooledStream);
 #endif
+#if !MONO
                     _count = _stack.Count;
+#endif
                 }
                 return pooledStream;
             }
index fec514b0dbc2bbdd1316a3f5521eb7ce3b01649a..a97f9ae48b1d21ff3d3c2b138bcb76b004c2d4bd 100644 (file)
@@ -379,7 +379,9 @@ namespace System.Net {
             DateTime tempUsed;
 
             CookieCollection lruCc = null;
+#if !MONO
             string   lruDomain =  null;
+#endif
             string   tempDomain = null;
 
             PathList pathList;
@@ -415,7 +417,9 @@ namespace System.Net {
                             // we also find the least used cookie collection in ENTIRE container
                             // we count the collection as LRU only if it holds 1+ elements
                             if (cc.Count > 0 && (tempUsed = cc.TimeStamp(CookieCollection.Stamp.Check)) < oldUsed) {
+#if !MONO
                                 lruDomain = tempDomain;
+#endif
                                 lruCc = cc;
                                 oldUsed = tempUsed;
                             }
index 0db05f3620e2fc500dfb3c0db05801c66b6bf99c..db9d4cf6b280b082969542c428c3dbdffdc58587 100644 (file)
@@ -18,8 +18,10 @@ namespace System.Net {
 
         private static WaitCallback s_GetRequestStreamCallback = new WaitCallback(GetRequestStreamCallback);
         private static WaitCallback s_GetResponseCallback = new WaitCallback(GetResponseCallback);
+#if !MONO
         private static ContextCallback s_WrappedGetRequestStreamCallback = new ContextCallback(GetRequestStreamCallback);
         private static ContextCallback s_WrappedResponseCallback = new ContextCallback(GetResponseCallback);
+#endif
 
     // fields
 
@@ -214,7 +216,9 @@ namespace System.Net {
         public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state)
         {
             GlobalLog.Enter("FileWebRequest::BeginGetRequestStream");
+#if !MONO
             bool success = true;
+#endif
             try {
                 if (Aborted)
                     throw ExceptionHelper.RequestAbortedException;
@@ -242,7 +246,9 @@ namespace System.Net {
                 m_ReadAResult = new LazyAsyncResult(this, state, callback);
                 ThreadPool.QueueUserWorkItem(s_GetRequestStreamCallback, m_ReadAResult);
             } catch (Exception exception) {
+#if !MONO
                 success = false; 
+#endif
                 if(Logging.On)Logging.Exception(Logging.Web, this, "BeginGetRequestStream", exception);
                 throw;
             } finally {
@@ -261,7 +267,9 @@ namespace System.Net {
         public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state)
         {
             GlobalLog.Enter("FileWebRequest::BeginGetResponse");
+#if !MONO
             bool success = true;
+#endif
 
             try {
                 if (Aborted)
@@ -278,7 +286,9 @@ namespace System.Net {
                 m_WriteAResult = new LazyAsyncResult(this,state,callback);
                 ThreadPool.QueueUserWorkItem(s_GetResponseCallback,m_WriteAResult);
             } catch (Exception exception) {
+#if !MONO
                 success = false;
+#endif
                 if(Logging.On)Logging.Exception(Logging.Web, this, "BeginGetResponse", exception);
                 throw;
             } finally {
@@ -302,7 +312,9 @@ namespace System.Net {
             GlobalLog.Enter("FileWebRequest::EndGetRequestStream");
 
             Stream stream;
+#if !MONO
             bool success = false;
+#endif
             try {
                 LazyAsyncResult  ar = asyncResult as LazyAsyncResult;
                 if (asyncResult == null || ar == null) {
@@ -317,7 +329,9 @@ namespace System.Net {
                 }
                 stream = (Stream) result;
                 m_writePending = false;
+#if !MONO
                 success = true;
+#endif
             } catch (Exception exception) {
                 if(Logging.On)Logging.Exception(Logging.Web, this, "EndGetRequestStream", exception);
                 throw;
@@ -338,7 +352,9 @@ namespace System.Net {
             GlobalLog.Enter("FileWebRequest::EndGetResponse");
 
             WebResponse response;
+#if !MONO
             bool success = false;
+#endif
             try {
                 LazyAsyncResult  ar = asyncResult as LazyAsyncResult;
                 if (asyncResult == null || ar == null) {
@@ -354,7 +370,9 @@ namespace System.Net {
                 }
                 response = (WebResponse) result;
                 m_readPending = false;
+#if !MONO
                 success = true;
+#endif
             } catch (Exception exception) {
                 if(Logging.On)Logging.Exception(Logging.Web, this, "EndGetResponse", exception);
                 throw;
index 8fa1b7eea41403f232d32a996504bfe9d9531882..5ae0b4b7f8e32be831ab846e40b66e43067b3611 100644 (file)
@@ -30,7 +30,7 @@ namespace System.Net.Mime
 
         //used when the length of the header name itself is known (i.e. Subject : )
         internal static string EncodeHeaderValue(string value, Encoding encoding, bool base64Encoding, int headerLength) {
-            StringBuilder newString = new StringBuilder();
+//            StringBuilder newString = new StringBuilder();
             
             //no need to encode if it's pure ascii
             if (IsAscii(value, false)) {
index 80acb75ad34e7d3d5b2b24817a568c07b451b34f..510d7922bc73d878c8ae327beff78ae60ae00458 100644 (file)
@@ -1092,7 +1092,11 @@ namespace System.Net {
 
             internal long ContentLength;
             internal long Length;
+#if MONO
+            const int Offset = 0;
+#else
             internal int  Offset;
+#endif
 
 
             internal ProgressData Progress;
@@ -1365,8 +1369,10 @@ namespace System.Net {
                 WebClient = webClient;
             }
 
+#if !MONO
             internal long Length;
             internal int  Offset;
+#endif
 
             internal ProgressData Progress;
 
index fe5858875faa8c20236f15eb604adbe491b20c26..15840cd7022b9729306b19eac0cf0382fbe0f29a 100644 (file)
@@ -504,7 +504,9 @@ namespace System.Net {
 #if MONO
         public static IWebProxy CreateDefaultProxy ()
         {
-#if MONOTOUCH
+#if FEATURE_NO_BSD_SOCKETS
+            throw new PlatformNotSupportedException ();
+#elif MONOTOUCH
             return Mono.Net.CFNetwork.GetDefaultProxy ();
 #elif MONODROID
             // Return the system web proxy.  This only works for ICS+.
index 9f55631246f21d5a8d9579df9422dc10efdc4183..1a587adf4e833b9fe51d569212471200a7005722 100644 (file)
@@ -443,6 +443,11 @@ namespace System {
         {
             Uri result;
 
+#if MONO
+            if (uriKind == UriKind.RelativeOrAbsolute)
+                uriKind = DotNetRelativeOrAbsolute;
+#endif
+
             if (!Uri.TryCreate(uriString, uriKind, out result))
                 return false;
 
index 4675771138671184da9cab61a354f3441eebb24c..8d93ee8c2d0e56ccd2e5054bdf12f1ca0b8c67f8 100644 (file)
@@ -1408,12 +1408,16 @@ namespace System.Text.RegularExpressions {
         /// <devdoc>
         /// </devdoc>
         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
+
+#if MONO
+            /* Mono: Set to false until we investigate  https://bugzilla.xamarin.com/show_bug.cgi?id=25671 */
+            return false;
+#else
             return(roptions & RegexOptions.Compiled) != 0;
+#endif
 #endif
         }
 #endif
index 6f191129671672f5a0d3c58901385525b798814c..6d603688023c9cc7d06bcf48021419eb519cb3c3 100644 (file)
@@ -3033,7 +3033,9 @@ namespace System.Text.RegularExpressions {
 
     internal class RegexTypeCompiler : RegexCompiler {
         private static int _typeCount = 0;
+#if !MONO
         private static LocalDataStoreSlot _moduleSlot = Thread.AllocateDataSlot();
+#endif
 
         private  AssemblyBuilder _assembly;
         private  ModuleBuilder  _module;
index 8cf2d64a9db72d7fbd5253643d7d9e9cb7a25b28..d9c27a4ffec108c1cefd334bc83cec6e89e708ec 100644 (file)
@@ -567,11 +567,11 @@ namespace System.Text.RegularExpressions {
                     // This is code for Posix style properties - [:Ll:] or [:IsTibetan:].
                     // It currently doesn't do anything other than skip the whole thing!
                     if (CharsRight() > 0 && RightChar() == ':' && !inRange) {
-                        String name;
+//                        String name;
                         int savePos = Textpos();
 
                         MoveRight();
-                        name = ScanCapname();
+/*                        name = */ ScanCapname();
                         if (CharsRight() < 2 || MoveRightGetChar() != ':' || MoveRightGetChar() != ']')
                             Textto(savePos);
                         // else lookup name (nyi)
index f5fabc69b61c62caeab800216bb48ca02982fb76..7be029f7e81e27c00a6f6cb479eab8e084d77c7f 100644 (file)
@@ -41,8 +41,10 @@ namespace System.Diagnostics {
         // a user's char[] directly, instead of our internal char[].
         private int _maxCharsPerBuffer;
 
+#pragma warning disable 414
         // Store a backpointer to the process class, to check for user callbacks
         private Process process;
+#pragma warning restore
 
         // Delegate to call user function.
         private UserCallBack userCallBack;
@@ -57,6 +59,11 @@ namespace System.Diagnostics {
         // Cache the last position scanned in sb when searching for lines.
         private int currentLinePos;
                
+#if MONO
+               //users to coordinate between Dispose and BeginReadLine
+               private object syncObject = new Object ();
+#endif
+
         internal AsyncStreamReader(Process process, Stream stream, UserCallBack callback, Encoding encoding) 
             : this(process, stream, callback, encoding, DefaultBufferSize) {
         }
@@ -104,6 +111,9 @@ namespace System.Diagnostics {
 
         protected virtual void Dispose(bool disposing)
         {
+#if MONO
+            lock (syncObject) {
+#endif
             if (disposing) {
                 if (stream != null)
                     stream.Close();
@@ -120,6 +130,9 @@ namespace System.Diagnostics {
                 eofEvent.Close();
                 eofEvent = null;
             }
+#if MONO
+            }
+#endif
         }
         
         public virtual Encoding CurrentEncoding {
@@ -155,6 +168,12 @@ namespace System.Diagnostics {
             int byteLen;
             
             try {
+#if MONO
+                var stream = this.stream;
+                if (stream == null)
+                byteLen = 0;
+                else
+#endif
                 byteLen = stream.EndRead(ar);
             }
             catch (IOException ) {
@@ -171,6 +190,9 @@ namespace System.Diagnostics {
                 byteLen = 0; // Treat this as EOF
             }
                 
+#if MONO
+retry_dispose:
+#endif
             if (byteLen == 0) { 
                 // We're at EOF, we won't call this function again from here on.
                 lock(messageQueue) {
@@ -186,13 +208,45 @@ namespace System.Diagnostics {
                     FlushMessageQueue();
                 }
                 finally {
+#if MONO
+                    lock (syncObject) {
+                        if (eofEvent != null) {
+                            try {
+                                eofEvent.Set ();
+                            } catch (System.ObjectDisposedException) {
+                                // This races with Dispose, it's safe to ignore the error as it comes from a SafeHandle doing its job
+                            }
+                        }
+                    }
+#else
                     eofEvent.Set();
+#endif
                 }
             } else {
+#if MONO
+                lock (syncObject) {
+                    if (decoder == null) { //we got disposed after the EndRead, retry as Diposed
+                        byteLen = 0;
+                        goto retry_dispose;
+                    }
+#endif
                 int charLen = decoder.GetChars(byteBuffer, 0, byteLen, charBuffer, 0);
                 sb.Append(charBuffer, 0, charLen);
+#if MONO
+                }
+#endif
                 GetLinesFromStringBuilder();
+#if MONO
+                lock (syncObject) {
+                    if (stream == null) { //we got disposed after the EndRead, retry as Diposed
+                        byteLen = 0;
+                        goto retry_dispose;
+                    }
+#endif
                 stream.BeginRead(byteBuffer, 0 , byteBuffer.Length,  new AsyncCallback(ReadBuffer), null);
+#if MONO
+                }
+#endif
             }
         }
         
index cbd2456ab966dcad784e6055e16ea4b2a7964721..7c5307fa15513fe46d8c285a36e66b61d73225d7 100644 (file)
@@ -66,16 +66,20 @@ namespace System.Diagnostics {
         ProcessModuleCollection modules;
 #endif // !FEATURE_PAL        
 
+#if !MONO
         bool haveMainWindow;
         IntPtr mainWindowHandle;  // no need to use SafeHandle for window        
         string mainWindowTitle;
+#endif
         
         bool haveWorkingSetLimits;
         IntPtr minWorkingSet;
         IntPtr maxWorkingSet;
-        
+
+#if !MONO
         bool haveProcessorAffinity;
         IntPtr processorAffinity;
+#endif
 
         bool havePriorityClass;
         ProcessPriorityClass priorityClass;
@@ -91,12 +95,14 @@ namespace System.Diagnostics {
                
         DateTime exitTime;
         bool haveExitTime;
-        
+
+#if !MONO
         bool responding;
         bool haveResponding;
         
         bool priorityBoostEnabled;
         bool havePriorityBoostEnabled;
+#endif
         
         bool raisedOnExited;
         RegisteredWaitHandle registeredWaitHandle;
@@ -108,7 +114,9 @@ namespace System.Diagnostics {
         OperatingSystem operatingSystem;
         bool disposed;
         
+#if !MONO
         static object s_CreateProcessLock = new object();
+#endif
         
         // This enum defines the operation mode for redirected process stream.
         // We don't support switching between synchronous mode and asynchronous mode.
@@ -122,6 +130,9 @@ namespace System.Diagnostics {
         StreamReadMode outputStreamReadMode;
         StreamReadMode errorStreamReadMode;
         
+#if MONO
+        StreamReadMode inputStreamReadMode;
+#endif
        
         // Support for asynchrously reading streams
         [Browsable(true), MonitoringDescription(SR.ProcessAssociated)]
@@ -136,8 +147,9 @@ namespace System.Diagnostics {
         internal bool pendingOutputRead;
         internal bool pendingErrorRead;
 
-
+#if !MONO
         private static SafeFileHandle InvalidPipeHandle = new SafeFileHandle(IntPtr.Zero, false);
+#endif
 #if DEBUG
         internal static TraceSwitch processTracing = new TraceSwitch("processTracing", "Controls debug output from Process component");
 #else
@@ -1183,6 +1195,9 @@ namespace System.Diagnostics {
                     throw new InvalidOperationException(SR.GetString(SR.CantGetStandardIn));
                 }
 
+#if MONO
+                inputStreamReadMode = StreamReadMode.syncMode;
+#endif
                 return standardInput;
             }
         }
@@ -1346,6 +1361,40 @@ namespace System.Diagnostics {
                 machineName = ".";
                 raisedOnExited = false;
 
+#if MONO
+                //Call close on streams if the user never saw them.
+                //A stream in the undefined mode was never fetched by the user.
+                //A stream in the async mode is wrapped on a AsyncStreamReader and we should dispose that instead.
+                //  no way for users to get a hand on a AsyncStreamReader.
+                var tmpIn = standardInput;
+                standardInput = null;
+                if (inputStreamReadMode == StreamReadMode.undefined && tmpIn != null)
+                    tmpIn.Close ();
+
+                var tmpOut = standardOutput;
+                standardOutput = null;
+                if (outputStreamReadMode == StreamReadMode.undefined && tmpOut != null)
+                    tmpOut.Close ();
+
+                tmpOut = standardError;
+                standardError = null;
+                if (errorStreamReadMode == StreamReadMode.undefined && tmpOut != null)
+                    tmpOut.Close ();
+
+                var tmpAsync = output;
+                output = null;
+                if (outputStreamReadMode == StreamReadMode.asyncMode && tmpAsync != null) {
+                    tmpAsync.CancelOperation ();
+                    tmpAsync.Close ();
+                }
+
+                tmpAsync = error;
+                error = null;
+                if (errorStreamReadMode == StreamReadMode.asyncMode && tmpAsync != null) {
+                    tmpAsync.CancelOperation ();
+                    tmpAsync.Close ();
+                }
+#else
                 //Don't call close on the Readers and writers
                 //since they might be referenced by somebody else while the 
                 //process is still alive but this method called.
@@ -1356,6 +1405,7 @@ namespace System.Diagnostics {
                 output = null;
                 error = null;
        
+#endif
 
                 Refresh();
             }
@@ -1568,6 +1618,7 @@ namespace System.Diagnostics {
             
             return new Process(machineName, ProcessManager.IsRemoteMachine(machineName), processId, null);
         }
+#endif
 
         /// <devdoc>
         ///    <para>
@@ -1633,6 +1684,7 @@ namespace System.Diagnostics {
             return GetProcesses(".");
         }
 
+#if !MONO
         /// <devdoc>
         ///    <para>
         ///       Creates a new <see cref='System.Diagnostics.Process'/>
@@ -1824,16 +1876,24 @@ namespace System.Diagnostics {
             threads = null;
             modules = null;
 #endif // !FEATURE_PAL            
+#if !MONO
             mainWindowTitle = null;
+#endif
             exited = false;
             signaled = false;
+#if !MONO
             haveMainWindow = false;
+#endif
             haveWorkingSetLimits = false;
+#if !MONO
             haveProcessorAffinity = false;
+#endif
             havePriorityClass = false;
             haveExitTime = false;
+#if !MONO
             haveResponding = false;
             havePriorityBoostEnabled = false;
+#endif
         }
 
         /// <devdoc>
index eae169c364f07c1c70e52b8a7aac444dadda66b0..2ec06ebb237033e4279c08170534ccad8381eac1 100644 (file)
@@ -251,6 +251,9 @@ namespace System.Threading
 #endif
 
         // This exists in WaitHandle, but is oddly ifdefed for some reason...
+#if MONO
+        new
+#endif
         private enum OpenExistingResult
         {
             Success,
@@ -362,7 +365,7 @@ namespace System.Threading
             //Non-Zero return 
 
 #if MONO
-            if (!ReleaseSemaphore_internal(Handle, releaseCount, out previousCount))
+            if (!ReleaseSemaphore_internal(SafeWaitHandle.DangerousGetHandle(), releaseCount, out previousCount))
 #else
             if (!SafeNativeMethods.ReleaseSemaphore(SafeWaitHandle, releaseCount, out previousCount))
 #endif
index 147ef7382e1b349d631e9834a24caebff0d7bdb9..4bfcfea188124d36797966b59cecc4d6dfd0a893 100644 (file)
@@ -1357,8 +1357,9 @@ namespace System.Globalization {
         {
             return NativeInternalInitSortHandle(localeName, out handleOrigin);
         }
+#endif
 
-#if !FEATURE_CORECLR
+#if !FEATURE_CORECLR || MONO
         private const int SORT_VERSION_WHIDBEY = 0x00001000;
         private const int SORT_VERSION_V4 = 0x00060101;
 
@@ -1375,7 +1376,11 @@ namespace System.Globalization {
             [System.Security.SecuritySafeCritical]
             get
             {
+#if MONO
+                return SORT_VERSION_V4;
+#else
                 return InternalGetSortVersion();
+#endif
             }
         }
 
@@ -1389,16 +1394,21 @@ namespace System.Globalization {
             {
                 if(m_SortVersion == null) 
                 {
+#if MONO
+                    m_SortVersion = new SortVersion(SORT_VERSION_V4, new Guid("00000001-57ee-1e5c-00b4-d0000bb1e11e")); // Guid returned by corefx and .NET 4.6
+#else
                     Win32Native.NlsVersionInfoEx v = new Win32Native.NlsVersionInfoEx();
                     v.dwNLSVersionInfoSize = Marshal.SizeOf(typeof(Win32Native.NlsVersionInfoEx));
                     InternalGetNlsVersionEx(m_dataHandle, m_handleOrigin, m_sortName, ref v);
                     m_SortVersion = new SortVersion(v.dwNLSVersion, (v.dwEffectiveId != 0) ? v.dwEffectiveId : LCID, v.guidCustomVersion);
+#endif
                 }
 
                 return m_SortVersion;
             }
         }
-        
+
+#if !MONO
         [System.Security.SecurityCritical]
         [ResourceExposure(ResourceScope.None)]
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
@@ -1412,7 +1422,6 @@ namespace System.Globalization {
         [SuppressUnmanagedCodeSecurity]
         private static extern uint InternalGetSortVersion();
 
-#endif
         [System.Security.SecurityCritical]
         [ResourceExposure(ResourceScope.None)]
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
@@ -1456,6 +1465,8 @@ namespace System.Globalization {
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
         [SuppressUnmanagedCodeSecurity]
         private static extern int InternalGetSortKey(IntPtr handle, IntPtr handleOrigin, String localeName, int flags, String source, int sourceCount, byte[] target, int targetCount);
+#endif
+
 #endif
     }
 }
index 17068f63bc9e4ad9cabf831cfc9067ba21bac739..83a6c0b161dc06d981fb41e8c181b99d62e96dfb 100644 (file)
@@ -522,6 +522,9 @@ namespace System.Runtime.InteropServices{
         
         [System.Runtime.InteropServices.ComVisible(false)]
         HString          = 0x2f,        // Windows Runtime HSTRING
+
+       [System.Runtime.InteropServices.ComVisible(false)]
+        LPUTF8Str        = 0x30,        // UTF8 string
     }
 
 #if !MONO
index b74e4d606b57f0e28c77d31cb059015706e0da26..dd983a383ef6c34e6c4701fd694e9f9ea6dffe6a 100644 (file)
@@ -151,7 +151,13 @@ namespace System.Runtime.InteropServices {
             }
         }
 
-#if FEATURE_COMINTEROP && !MONO
+#if FEATURE_COMINTEROP || MONO
+#if MONO
+        private static IntPtr GetRuntimeInterfaceImpl(Guid clsid, Guid riid)
+        {
+            throw new NotSupportedException();
+        }
+#else
         [System.Security.SecurityCritical]
         [ResourceExposure(ResourceScope.Process)]
         [ResourceConsumption(ResourceScope.Process)]
@@ -160,6 +166,7 @@ namespace System.Runtime.InteropServices {
         private static extern IntPtr GetRuntimeInterfaceImpl(
             [In, MarshalAs(UnmanagedType.LPStruct)] Guid clsid,
             [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid);
+#endif
 
         //
         // This function does the equivalent of calling GetInterface(clsid, riid) on the
index aacf09fdbb1dc4c4c5641f2798a1d2c64c7abf08..79d8a97c4db22670dbac130fce3cbd8a7e12efd9 100644 (file)
@@ -1278,11 +1278,13 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             if (type == null)
                 throw new ArgumentNullException("type");
 
+#if FEATURE_COMINTEROP || MONO_COM
             if (type.IsWindowsRuntimeObject && type.IsImport)
             {
                 return (IActivationFactory)Marshal.GetNativeActivationFactory(type);
             }
             else
+#endif
             {
 #if FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION
                 return GetManagedActivationFactory(type);
index c97acf8e60bef4fd1ebc624a257471ef823acc8d..89877e0add7f11bfb3a72d4148a5df8f9e96a7f6 100644 (file)
@@ -70,6 +70,9 @@ namespace System.Security.Cryptography {
         [System.Security.SecuritySafeCritical]  // auto-generated
         public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV) {
 #if MONO
+            if (m_use40bitSalt)
+                throw new NotImplementedException ("UseSalt=true is not implemented on Mono yet");
+
             return new RC2Transform (this, true, rgbKey, rgbIV);
 #else
             return _NewEncryptor(rgbKey, ModeValue, rgbIV, EffectiveKeySizeValue, 
@@ -80,6 +83,9 @@ namespace System.Security.Cryptography {
         [System.Security.SecuritySafeCritical]  // auto-generated
         public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV) {
 #if MONO
+            if (m_use40bitSalt)
+                throw new NotImplementedException ("UseSalt=true is not implemented on Mono yet");
+
             return new RC2Transform (this, false, rgbKey, rgbIV);
 #else
             return _NewEncryptor(rgbKey, ModeValue, rgbIV, EffectiveKeySizeValue,
index 804eeda9bdac32d93a1173972e7989b8989a6352..63bbb53d3b13d3a79dcc27a74c3f003d6b71b568 100644 (file)
@@ -209,13 +209,15 @@ namespace System.Security.Cryptography {
             m_block++;
             return ret;
         }
-#if !MONO
         [System.Security.SecuritySafeCritical]  // auto-generated
         public byte[] CryptDeriveKey(string algname, string alghashname, int keySize, byte[] rgbIV)
         {
             if (keySize < 0)
                 throw new CryptographicException(Environment.GetResourceString("Cryptography_InvalidKeySize"));
 
+#if MONO
+            throw new NotSupportedException ("CspParameters are not supported by Mono");
+#else
             int algidhash = X509Utils.NameOrOidToAlgId(alghashname, OidGroup.HashAlgorithm);
             if (algidhash == 0)
                 throw new CryptographicException(Environment.GetResourceString("Cryptography_PasswordDerivedBytes_InvalidAlgorithm"));
@@ -233,8 +235,10 @@ namespace System.Security.Cryptography {
                       m_password, m_password.Length, keySize << 16, rgbIV, rgbIV.Length,
                       JitHelpers.GetObjectHandleOnStack(ref key));
             return key;
+#endif
         }
 
+#if !MONO
         [System.Security.SecurityCritical] // auto-generated
         private SafeProvHandle _safeProvHandle = null;
         private SafeProvHandle ProvHandle
index a1b0a7786981ae8a8efedf0f5106156a16c0571a..1cab13c87b3b5c4b686b075db25c5ffdf710fd7a 100644 (file)
@@ -528,7 +528,8 @@ namespace System.Security.Cryptography {
             Contract.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name));
 
 #if MONO
-            throw new NotImplementedException ();
+            var hash = HashAlgorithm.Create (hashAlgorithm.Name);
+            return hash.ComputeHash (data, offset, count);
 #else
             using (SafeHashHandle hashHandle = Utils.CreateHash(Utils.StaticProvHandle, GetAlgorithmId(hashAlgorithm))) {
                 Utils.HashData(hashHandle, data, offset, count);
@@ -544,7 +545,8 @@ namespace System.Security.Cryptography {
             Contract.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name));
 
 #if MONO
-            throw new NotImplementedException ();
+            var hash = HashAlgorithm.Create (hashAlgorithm.Name);
+            return hash.ComputeHash (data);
 #else
             using (SafeHashHandle hashHandle = Utils.CreateHash(Utils.StaticProvHandle, GetAlgorithmId(hashAlgorithm))) {
                 // Read the data 4KB at a time, providing similar read characteristics to a standard HashAlgorithm
index 87f99a67da32e48e877ea0dd67b3c9870853210a..d455031e761f11b233eb55b65ffbbc57c7164458 100644 (file)
@@ -28,6 +28,15 @@ namespace System {
 
     internal sealed class SharedStatics
     {
+#if MONO
+        // TODO: We are using only GetSharedStringMaker for now which is
+        // ok to be AppDomain static
+        static readonly SharedStatics _sharedStatics = new SharedStatics();
+
+        private SharedStatics()
+        {
+        }
+#else
         // this is declared static but is actually forced to be the same object 
         // for each AppDomain at AppDomain create time.
         private static SharedStatics _sharedStatics;
@@ -38,6 +47,7 @@ namespace System {
         {
             BCLDebug.Assert(false, "SharedStatics..ctor() is never called.");
         }
+#endif
 
         private volatile String _Remoting_Identity_IDGuid;
         public static String Remoting_Identity_IDGuid 
index 3f96ac1c00e42170e0153dea36793ab74d142992..e8fe32e54d119a9dffc79131c9a1106c06ab56e2 100644 (file)
@@ -1392,6 +1392,16 @@ namespace System {
 
             return s;
         }
+
+        unsafe internal int GetBytesFromEncoding(byte* pbNativeBuffer, int cbNativeBuffer,Encoding encoding)
+        {
+            // encoding == Encoding.UTF8
+            fixed (char* pwzChar = &this.m_firstChar)
+            {
+                return encoding.GetBytes(pwzChar, m_stringLength, pbNativeBuffer, cbNativeBuffer);
+            }
+        }
+
 #if !MONO
         [System.Security.SecuritySafeCritical]  // auto-generated
         unsafe internal int ConvertToAnsi(byte *pbNativeBuffer, int cbNativeBuffer, bool fBestFit, bool fThrowOnUnmappableChar)
diff --git a/mcs/class/test-helpers/NunitHelpers.cs b/mcs/class/test-helpers/NunitHelpers.cs
new file mode 100644 (file)
index 0000000..f16683e
--- /dev/null
@@ -0,0 +1,112 @@
+using System.IO;
+using System.Collections;
+using NUnit.Framework.Constraints;
+
+namespace NUnit.Framework
+{
+       static class CollectionAssert
+       {
+               public static void DoesNotContain (IEnumerable collection, object val)
+               {
+                        Assert.That(collection, Has.No.Member(val));
+               }
+
+               public static void Contains (IEnumerable collection, object val)
+               {
+                        Assert.That(collection, Has.Member(val));
+               }
+
+               public static void AreEqual (IEnumerable expected, IEnumerable actual, string message = null, params object[] args) 
+               {
+                       Assert.That(actual, Is.EqualTo(expected), message, args);
+               }
+
+               public static void AreEquivalent (IEnumerable expected, IEnumerable actual, string message = null, params object[] args) 
+               {
+                       Assert.That(actual, Is.EquivalentTo(expected), message, args);
+               }
+
+               public static void IsEmpty(IEnumerable collection, string message = null, params object[] args)
+               {
+                       Assert.That(collection, new EmptyCollectionConstraint(), message, args);
+               }
+       }
+
+       static class FileAssert
+       {
+               public static void AreEqual(Stream expected, Stream actual, string message, params object[] args)
+               {
+                       Assert.That(actual, Is.EqualTo(expected), message, args);
+               }
+
+               public static void AreEqual(string expected, string actual, string message, params object[] args)
+               {
+                       using (FileStream exStream = File.OpenRead(expected))
+                       using (FileStream acStream = File.OpenRead(actual))
+                       {
+                               AreEqual(exStream, acStream, message, args);
+                       }
+               }
+       }
+
+       static class StringAssert
+       {
+               public static void Contains(string expected, string actual, string message = null, params object[] args)
+               {
+                       Assert.That(actual, Is.StringContaining (expected), message, args);
+               }
+
+               public static void StartsWith(string expected, string actual, string message = null, params object[] args)
+               {
+                       Assert.IsTrue (actual.StartsWith (expected), message, args);
+               }
+       }
+
+       static class AssertHelper
+       {
+               public static void IsEmpty (string aString, string message = null, params object[] args )
+               {
+                       Assert.That(aString, Is.Empty, message, args);
+               }
+
+               public static void IsNotEmpty (string aString, string message = null, params object[] args )
+               {
+                       Assert.That(aString, Is.Not.Empty, message, args);
+               }
+
+               public static void Less(int arg1, int arg2, string message = null, params object[] args) 
+               {
+                       Assert.That(arg1, Is.LessThan(arg2), message, args);
+               }
+
+               public static void Greater(int arg1, int arg2, string message = null, params object[] args) 
+               {
+                       Assert.That(arg1, Is.GreaterThan(arg2), message, args);
+               }
+
+               public static void Greater(double arg1, double arg2, string message = null, params object[] args) 
+               {
+                       Assert.That(arg1, Is.GreaterThan(arg2), message, args);
+               }
+
+               public static void GreaterOrEqual(int arg1, int arg2, string message = null, params object[] args)
+               {
+                       Assert.That(arg1, Is.GreaterThanOrEqualTo(arg2), message, args);
+               }
+
+               public static void GreaterOrEqual(long arg1, long arg2, string message = null, params object[] args)
+               {
+                       Assert.That(arg1, Is.GreaterThanOrEqualTo(arg2), message, args);
+               }
+
+               public static void LessOrEqual (int arg1, int arg2, string message = null, params object[] args)
+               {
+                       Assert.That(arg1, Is.LessThanOrEqualTo(arg2), message, args);
+               }
+
+               public static void IsNotInstanceOfType(System.Type expected, object actual, string message, params object[] args )
+               {
+                       Assert.IsFalse (actual.GetType ().IsInstanceOfType (expected), message, args);
+               }
+       }
+}
index 118d89410e2efbb38ce56371da9b5012593e7e5a..74e77b0edf0f66df063ca925485701b4a139b671 100644 (file)
@@ -91,8 +91,11 @@ namespace MonoTests.Helpers
                                        listenSocket = tcpListener.AcceptSocket ();
                                        listenSocket.Send (requestHandler (listenSocket));
                                        try {
-                                               listenSocket.Shutdown (SocketShutdown.Receive);
+                                               // On Windows a Receive() is needed here before Shutdown() to consume the data some tests send.
+                                               listenSocket.ReceiveTimeout = 10 * 1000;
+                                               listenSocket.Receive (new byte [0]);
                                                listenSocket.Shutdown (SocketShutdown.Send);
+                                               listenSocket.Shutdown (SocketShutdown.Receive);
                                        } catch {
                                        }
                                } catch (SocketException ex) {
diff --git a/mcs/errors/cs0031-9.cs b/mcs/errors/cs0031-9.cs
new file mode 100644 (file)
index 0000000..ec2b3b9
--- /dev/null
@@ -0,0 +1,7 @@
+// CS0031: Constant value `1.42' cannot be converted to a `int'
+// Line: 6
+
+class X
+{
+       const int val = 1.42f;
+}
\ No newline at end of file
diff --git a/mcs/errors/cs1691-2.cs b/mcs/errors/cs1691-2.cs
deleted file mode 100644 (file)
index 8c09699..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// CS1691: `2' is not a valid warning number
-// Line: 0
-// Compiler options: -warnaserror -warnaserror:1691,2
-
diff --git a/mcs/errors/cs1691-3.cs b/mcs/errors/cs1691-3.cs
deleted file mode 100644 (file)
index c423ebf..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// CS1691: `20' is not a valid warning number
-// Line: 0
-// Compiler options:  -warnaserror -warnaserror-:20
-
diff --git a/mcs/errors/cs1691-4.cs b/mcs/errors/cs1691-4.cs
deleted file mode 100644 (file)
index cd9ce64..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// CS1691: `20' is not a valid warning number
-// Line: 0
-// Compiler options: -warnaserror -nowarn:20
-
diff --git a/mcs/errors/cs1691.cs b/mcs/errors/cs1691.cs
deleted file mode 100644 (file)
index bd3e169..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// CS1691: `1' is not a valid warning number
-// Line: 5
-// Compiler options: -warnaserror
-
-#pragma warning disable 1
-
diff --git a/mcs/errors/cs1744-3.cs b/mcs/errors/cs1744-3.cs
new file mode 100644 (file)
index 0000000..b899816
--- /dev/null
@@ -0,0 +1,18 @@
+// CS1744: Named argument `p1' cannot be used for a parameter which has positional argument specified
+// Line: 8
+
+internal class Program
+{
+       public static void Main ()
+       {
+               Method (1, 2, p1: 3);
+       }
+       
+       static void Method (int p1, int paramNamed, int p2)
+       {
+       }
+       
+       static void Method (int p1, int p2, object paramNamed)
+       {
+       }
+}
diff --git a/mcs/errors/cs1904.cs b/mcs/errors/cs1904.cs
deleted file mode 100644 (file)
index 4417537..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// CS1904: `4013' is not a valid warning number
-// Line: 0
-// Compiler options: -nowarn:4014,4013
-
-class ClassMain {
-        public static void Main () {}
-}
-
diff --git a/mcs/errors/cs8101.cs b/mcs/errors/cs8101.cs
new file mode 100644 (file)
index 0000000..eea62fd
--- /dev/null
@@ -0,0 +1,7 @@
+// CS8101: The pathmap option was incorrectly formatted
+// Line: 0
+// Compiler options: -pathmap:a=
+
+class X
+{
+}
\ No newline at end of file
index cf8834c52c7388a4c1206e7cbc210442c2126415..1b1d6536e8eb3e843512750a0d7c378f8db812a3 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index acec3be3588b60665439f60a90ff92f2e45f933a..c16a0aa1c970df6a48d579c56ce5f32731e29ba6 100644 (file)
@@ -478,7 +478,7 @@ namespace Mono.CSharp {
                        catch
                        {
                                ec.Report.Error (31, loc, "Constant value `{0}' cannot be converted to a `{1}'",
-                                       GetValue ().ToString (), target.GetSignatureForError ());
+                                       GetValueAsLiteral (), target.GetSignatureForError ());
                        }
                }
 
@@ -1697,7 +1697,7 @@ namespace Mono.CSharp {
 
                public override string GetValueAsLiteral ()
                {
-                       return Value.ToString ();
+                       return Value.ToString (CultureInfo.InvariantCulture);
                }
 
                public override long GetValueAsLong ()
@@ -1820,7 +1820,7 @@ namespace Mono.CSharp {
 
                public override string GetValueAsLiteral ()
                {
-                       return Value.ToString ();
+                       return Value.ToString (CultureInfo.InvariantCulture);
                }
 
                public override long GetValueAsLong ()
@@ -2021,7 +2021,7 @@ namespace Mono.CSharp {
 
                public override string GetValueAsLiteral ()
                {
-                       return Value.ToString () + "M";
+                       return Value.ToString (CultureInfo.InvariantCulture) + "M";
                }
 
                public override long GetValueAsLong ()
index 33b05ff809b320ddcb69813f7fbc448007e81153..ddcb149f942a7c818e78b848558ae693882132d1 100644 (file)
@@ -674,13 +674,13 @@ namespace Mono.CSharp
                        if (all_source_files == null) {
                                all_source_files = new Dictionary<string, SourceFile> ();
                                foreach (var source in SourceFiles)
-                                       all_source_files[source.FullPathName] = source;
+                                       all_source_files[source.OriginalFullPathName] = source;
                        }
 
                        string path;
                        if (!Path.IsPathRooted (name)) {
                                var loc = comp_unit.SourceFile;
-                               string root = Path.GetDirectoryName (loc.FullPathName);
+                               string root = Path.GetDirectoryName (loc.OriginalFullPathName);
                                path = Path.GetFullPath (Path.Combine (root, name));
                                var dir = Path.GetDirectoryName (loc.Name);
                                if (!string.IsNullOrEmpty (dir))
index 1915a07240b379fdf4443385f6bd5a0af1e07783..e6a95fe8163a3590acb9f23602cc10d4cdec63dd 100644 (file)
@@ -2465,6 +2465,12 @@ namespace Mono.CSharp
                                case '\"':
                                        ++str_quote;
                                        break;
+                               case '\\':
+                                       // Skip escaped " character
+                                       c = reader.Read ();
+                                       if (c == -1)
+                                               res = false;
+                                       break;
                                case -1:
                                        res = false;
                                        break;
index 2077f26bf2cf99d835fed105bbf4503bfeeae1d5..8475a9e489428c0d98d91267b7b40954a54be3c2 100644 (file)
@@ -4781,12 +4781,18 @@ namespace Mono.CSharp {
 
                                //
                                // A candidate with no default parameters is still better when there
-                               // is no better expression conversion
+                               // is no better expression conversion and does not have more parameters
                                //
                                if (candidate_pd.Count < best_pd.Count) {
-                                       if (!candidate_params && !candidate_pd.FixedParameters [j - 1].HasDefaultValue) {
+                                       if (candidate_params)
+                                               return false;
+                                       
+                                       if (!candidate_pd.FixedParameters [j - 1].HasDefaultValue)
                                                return true;
-                                       }
+
+                                       if (best_pd.FixedParameters [j].HasDefaultValue)
+                                               return true;
+                                       
                                } else if (candidate_pd.Count == best_pd.Count) {
                                        if (candidate_params)
                                                return false;
@@ -5050,7 +5056,7 @@ namespace Mono.CSharp {
 
                                                                // The slot has been taken by positional argument
                                                                if (temp != null && !(temp is NamedArgument))
-                                                                       break;
+                                                                       return NamedArgumentsMismatch - i - 1;
                                                        }
 
                                                        if (!arg_moved) {
@@ -5222,7 +5228,7 @@ namespace Mono.CSharp {
                                                if ((fp.ModFlags & Parameter.Modifier.CallerLineNumber) != 0) {
                                                        e = new IntLiteral (ec.BuiltinTypes, loc.Row, loc);
                                                } else if ((fp.ModFlags & Parameter.Modifier.CallerFilePath) != 0) {
-                                                       e = new StringLiteral (ec.BuiltinTypes, loc.NameFullPath, loc);
+                                                       e = new StringLiteral (ec.BuiltinTypes, loc.SourceFile.GetFullPathName (ec.Module.Compiler.Settings.PathMap), loc);
                                                } else if (ec.MemberContext.CurrentMemberDefinition != null) {
                                                        e = new StringLiteral (ec.BuiltinTypes, ec.MemberContext.CurrentMemberDefinition.GetCallerMemberName (), loc);
                                                }
index 17dc6f8817627126ab4fcd9d4f39b3f1dcd9fd88..14824d136b63f814975bdcedd6be3580593ce98e 100644 (file)
@@ -356,26 +356,23 @@ namespace Mono.CSharp
                        }
 
                        if (version_mismatch != null) {
-                               if (version_mismatch is AssemblyBuilder)
+                               if (is_fx_assembly || version_mismatch is AssemblyBuilder)
                                        return version_mismatch;
 
                                var ref_an = new AssemblyName (refname);
                                var v1 = ref_an.Version;
                                var v2 = version_mismatch.GetName ().Version;
+                               AssemblyReferenceMessageInfo messageInfo;
 
                                if (v1 > v2) {
-                                       var messageInfo = new AssemblyReferenceMessageInfo (ref_an, report => {
+                                       messageInfo = new AssemblyReferenceMessageInfo (ref_an, report => {
                                                report.SymbolRelatedToPreviousError (args.RequestingAssembly.Location);
                                                report.Error (1705, string.Format ("Assembly `{0}' depends on `{1}' which has a higher version number than referenced assembly `{2}'",
                                                                                                                   args.RequestingAssembly.FullName, refname, version_mismatch.GetName ().FullName));
                                        });
 
-                                       AddReferenceVersionMismatch (args.RequestingAssembly.GetName (), messageInfo);
-                                       return version_mismatch;
-                               }
-
-                               if (!is_fx_assembly) {
-                                       var messageInfo = new AssemblyReferenceMessageInfo (ref_an, report => {
+                               } else {
+                                       messageInfo = new AssemblyReferenceMessageInfo (ref_an, report => {
                                                if (v1.Major != v2.Major || v1.Minor != v2.Minor) {
                                                        report.Warning (1701, 2,
                                                                "Assuming assembly reference `{0}' matches assembly `{1}'. You may need to supply runtime policy",
@@ -386,10 +383,10 @@ namespace Mono.CSharp
                                                                refname, version_mismatch.GetName ().FullName);
                                                }
                                        });
-
-                                       AddReferenceVersionMismatch (args.RequestingAssembly.GetName (), messageInfo);
                                }
 
+                               AddReferenceVersionMismatch (args.RequestingAssembly.GetName (), messageInfo);
+
                                return version_mismatch;
                        }
 
index 47919ec8ce2b5fda133bddbb93509096ba9ef671..0b6fc1abf7722452569bed9c6c1ae75ac2815296 100644 (file)
@@ -254,7 +254,7 @@ namespace Mono.CSharp
                        // Special format which encodes original variable name and
                        // it's scope to support lifted variables debugging. This
                        // is same what csc does and allows to correctly set fields
-                       // scope information (like ambiguity, our of scope, etc).
+                       // scope information (like ambiguity, out of scope, etc).
                        //
                        var id = rc.CurrentBlock.Explicit.GetDebugSymbolScopeIndex ();
                        return "<" + local_info.Name + ">__" + id;
@@ -1067,6 +1067,7 @@ namespace Mono.CSharp
 
                        method.Block = new ToplevelBlock (method.Compiler, method.ParameterInfo, loc,
                                ToplevelBlock.Flags.CompilerGenerated | ToplevelBlock.Flags.NoFlowAnalysis);
+
                        method.Block.AddStatement (new TryFinallyBlockProxyStatement (this, block));
 
                        // Cannot it add to storey because it'd be emitted before nested
index 79cee3cbf7db1dc87fb77e5acfa57ccfa3259f10..658f3b765fa4f48f4e9e1bce1787cca9a387e215 100644 (file)
@@ -15,6 +15,7 @@ using System.Collections.Generic;
 using Mono.CompilerServices.SymbolWriter;
 using System.Diagnostics;
 using System.Linq;
+using System.IO;
 
 namespace Mono.CSharp
 {
@@ -55,7 +56,7 @@ namespace Mono.CSharp
                static readonly byte[] MD5Algorith = { 96, 166, 110, 64, 207, 100, 130, 76, 182, 240, 66, 212, 129, 114, 167, 153 };
 
                public readonly string Name;
-               public readonly string FullPathName;
+               public readonly string OriginalFullPathName;
                public readonly int Index;
                public bool AutoGenerated;
 
@@ -67,7 +68,7 @@ namespace Mono.CSharp
                {
                        this.Index = index;
                        this.Name = name;
-                       this.FullPathName = path;
+                       this.OriginalFullPathName = path;
                }
 
                public byte[] Checksum {
@@ -99,21 +100,43 @@ namespace Mono.CSharp
                        this.checksum = checksum;
                }
 
-               public SourceFileEntry CreateSymbolInfo (MonoSymbolFile symwriter)
+               public SourceFileEntry CreateSymbolInfo (MonoSymbolFile symwriter, List<KeyValuePair<string, string>> pathMap)
                {
                        if (hidden_lines != null)
                                hidden_lines.Sort ();
 
-                       file = new SourceFileEntry (symwriter, FullPathName, algGuid, checksum);
+                       file = new SourceFileEntry (symwriter, GetFullPathName (pathMap), OriginalFullPathName, algGuid, checksum);
                        if (AutoGenerated)
                                file.SetAutoGenerated ();
 
                        return file;
                }
 
+               public string GetFullPathName (List<KeyValuePair<string, string>> pathMap)
+               {
+                       var path = OriginalFullPathName;
+                       if (pathMap != null) {
+                               foreach (var map in pathMap) {
+                                       var prefix = map.Key;
+                                       if (path.Length <= prefix.Length)
+                                               continue;
+
+                                       if (path [prefix.Length] != Path.DirectorySeparatorChar)
+                                               continue;
+
+                                       if (!path.StartsWith (prefix, StringComparison.Ordinal))
+                                               continue;
+
+                                       path = map.Value + path.Substring (prefix.Length);
+                               }
+                       }
+
+                       return path;
+               }
+
                public bool Equals (SourceFile other)
                {
-                       return FullPathName == other.FullPathName;
+                       return OriginalFullPathName == other.OriginalFullPathName;
                }
 
                public bool IsHiddenLocation (Location loc)
@@ -142,7 +165,7 @@ namespace Mono.CSharp
 
                public override string ToString ()
                {
-                       return String.Format ("SourceFile ({0}:{1}:{2})", Name, FullPathName, Index);
+                       return String.Format ("SourceFile ({0}:{1}:{2})", Name, OriginalFullPathName, Index);
                }
        }
 
@@ -326,10 +349,10 @@ namespace Mono.CSharp
                public string NameFullPath {
                        get {
                                int index = File;
-                               if (token == 0 || index <= 0)
+                               if (index <= 0)
                                        return null;
 
-                               return source_list[index - 1].FullPathName;
+                               return source_list[index - 1].OriginalFullPathName;
                        }
                }
 
@@ -369,18 +392,6 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format ("
                        }
                }
 
-               // The ISymbolDocumentWriter interface is used by the symbol writer to
-               // describe a single source file - for each source file there's exactly
-               // one corresponding ISymbolDocumentWriter instance.
-               //
-               // This class has an internal hash table mapping source document names
-               // to such ISymbolDocumentWriter instances - so there's exactly one
-               // instance per document.
-               //
-               // This property returns the ISymbolDocumentWriter instance which belongs
-               // to the location's source file.
-               //
-               // If we don't have a symbol writer, this property is always null.
                public SourceFile SourceFile {
                        get {
                                int index = File;
index 46bedb4861240da0ed221219b55b8388781c1602..e55c24010023a99993a9405eab3a4f41de5663d9 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_PROCESS_START;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index b5379056ee7f9ae38bc0166c9c8f191465762f2f..5384ee1368607a30ea61290b5f19610aa15349e0 100644 (file)
@@ -624,8 +624,8 @@ namespace Mono.CSharp {
                        if (include_files == null)
                                include_files = new Dictionary<string, SourceFile> ();
 
-                       if (!include_files.ContainsKey (file.FullPathName))
-                               include_files.Add (file.FullPathName, file);
+                       if (!include_files.ContainsKey (file.OriginalFullPathName))
+                               include_files.Add (file.OriginalFullPathName, file);
                }
 
                public void AddDefine (string value)
@@ -648,7 +648,7 @@ namespace Mono.CSharp {
                {
                        var sw = Module.DeclaringAssembly.SymbolWriter;
                        if (sw != null) {
-                               CreateUnitSymbolInfo (sw);
+                               CreateUnitSymbolInfo (sw, Compiler.Settings.PathMap);
                        }
 
                        base.PrepareEmit ();
@@ -657,14 +657,14 @@ namespace Mono.CSharp {
                //
                // Creates symbol file index in debug symbol file
                //
-               void CreateUnitSymbolInfo (MonoSymbolFile symwriter)
+               void CreateUnitSymbolInfo (MonoSymbolFile symwriter, List<KeyValuePair<string, string>> pathMap)
                {
-                       var si = file.CreateSymbolInfo (symwriter);
+                       var si = file.CreateSymbolInfo (symwriter, pathMap);
                        comp_unit = new CompileUnitEntry (symwriter, si);
 
                        if (include_files != null) {
                                foreach (SourceFile include in include_files.Values) {
-                                       si = include.CreateSymbolInfo (symwriter);
+                                       si = include.CreateSymbolInfo (symwriter, pathMap);
                                        comp_unit.AddFile (si);
                                }
                        }
index 74bbb46c640cf42053a1d096fd4472a61804934b..afa4f75bd84865f72666678e53685c0c31df5462 100644 (file)
@@ -61,12 +61,10 @@ namespace Mono.CSharp {
                        8009, 8094
                };
 
-               static HashSet<int> AllWarningsHashSet;
-
                public Report (CompilerContext context, ReportPrinter printer)
                {
                        if (context == null)
-                               throw new ArgumentNullException ("settings");
+                               throw new ArgumentNullException ("context");
                        if (printer == null)
                                throw new ArgumentNullException ("printer");
 
@@ -175,18 +173,6 @@ namespace Mono.CSharp {
                        extra_information.Add (msg);
                }
 
-               public bool CheckWarningCode (int code, Location loc)
-               {
-                       if (AllWarningsHashSet == null)
-                               AllWarningsHashSet = new HashSet<int> (AllWarnings);
-
-                       if (AllWarningsHashSet.Contains (code))
-                               return true;
-
-                       Warning (1691, 1, loc, "`{0}' is not a valid warning number", code);
-                       return false;
-               }
-
                public void ExtraInformation (Location loc, string msg)
                {
                        extra_information.Add (String.Format ("{0} {1}", loc, msg));
@@ -1109,8 +1095,7 @@ namespace Mono.CSharp {
 
                public void WarningDisable (Location location, int code, Report Report)
                {
-                       if (Report.CheckWarningCode (code, location))
-                               regions.Add (new Disable (location.Row, code));
+                       regions.Add (new Disable (location.Row, code));
                }
 
                public void WarningEnable (int line)
@@ -1120,9 +1105,6 @@ namespace Mono.CSharp {
 
                public void WarningEnable (Location location, int code, CompilerContext context)
                {
-                       if (!context.Report.CheckWarningCode (code, location))
-                               return;
-
                        if (context.Settings.IsWarningDisabledGlobally (code))
                                context.Report.Warning (1635, 1, location, "Cannot restore warning `CS{0:0000}' because it was disabled globally", code);
 
index 5a76b965889697d1462b92b3b08540348942ee71..1393bcd58f35bc0459f771ca8be3d0c9b3f6bb5a 100644 (file)
@@ -87,6 +87,8 @@ namespace Mono.CSharp {
                //
                public List<Tuple<string, string>> AssemblyReferencesAliases;
 
+               public List<KeyValuePair<string, string>> PathMap;
+
                //
                // Modules to be embedded
                //
@@ -581,7 +583,6 @@ namespace Mono.CSharp {
 
                public bool ProcessWarningsList (string text, Action<int> action)
                {
-                       bool valid = true;
                        foreach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) {
                                var warning = wid;
                                if (warning.Length == 6 && warning [0] == 'C' && warning [1] == 'S')
@@ -592,15 +593,10 @@ namespace Mono.CSharp {
                                        continue;
                                }
 
-                               if (report.CheckWarningCode (id, Location.Null)) {
-                                       action (id);
-                               } else {
-                                       report.Error (1904, "`{0}' is not a valid warning number", wid);
-                                       valid = false;
-                               }
+                               action (id);
                        }
 
-                       return valid;
+                       return true;
                }
 
                void Error_RequiresArgument (string option)
@@ -1210,11 +1206,38 @@ namespace Mono.CSharp {
                                settings.RuntimeMetadataVersion = value;
                                return ParseResult.Success;
 
+                       case "/pathmap":
+                               if (value.Length == 0) {
+                                       return ParseResult.Success;
+                               }
+
+                               foreach (var pair in value.Split (',')) {
+                                       var kv = pair.Split ('=');
+                                       if (kv.Length != 2) {
+                                               report.Error (8101, "The pathmap option was incorrectly formatted");
+                                               return ParseResult.Error;
+                                       }
+
+                                       if (settings.PathMap == null)
+                                               settings.PathMap = new List<KeyValuePair<string, string>> ();
+
+                                       var key = kv [0].TrimEnd (Path.DirectorySeparatorChar);
+                                       var path = kv [1].TrimEnd (Path.DirectorySeparatorChar);
+                                       if (key.Length == 0 || path.Length == 0)
+                                               report.Error (8101, "The pathmap option was incorrectly formatted");
+
+                                       settings.PathMap.Add (new KeyValuePair<string, string> (key, path));
+                               }
+
+                               return ParseResult.Success;
+
                        // csc options that we don't support
                        case "/analyzer":
                        case "/appconfig":
                        case "/baseaddress":
                        case "/deterministic":
+                       case "/deterministic+":
+                       case "/deterministic-":
                        case "/errorendlocation":
                        case "/errorlog":
                        case "/features":
@@ -1224,7 +1247,6 @@ namespace Mono.CSharp {
                        case "/link":
                        case "/moduleassemblyname":
                        case "/nowin32manifest":
-                       case "/pathmap":
                        case "/pdb":
                        case "/preferreduilang":
                        case "/publicsign":
@@ -1595,7 +1617,7 @@ namespace Mono.CSharp {
                                "   -help                Lists all compiler options (short: -?)\n" +
                                "   -keycontainer:NAME   The key pair container used to sign the output assembly\n" +
                                "   -keyfile:FILE        The key file used to strongname the ouput assembly\n" +
-                               "   -langversion:TEXT    Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Experimental\n" +
+                               "   -langversion:TEXT    Specifies language version: ISO-1, ISO-2, 3, 4, 5, 6, Default or Experimental\n" +
                                "   -lib:PATH1[,PATHn]   Specifies the location of referenced assemblies\n" +
                                "   -main:CLASS          Specifies the class with the Main method (short: -m)\n" +
                                "   -noconfig            Disables implicitly referenced assemblies\n" +
@@ -1603,6 +1625,7 @@ namespace Mono.CSharp {
                                "   -nowarn:W1[,Wn]      Suppress one or more compiler warnings\n" +
                                "   -optimize[+|-]       Enables advanced compiler optimizations (short: -o)\n" +
                                "   -out:FILE            Specifies output assembly name\n" +
+                               "   -pathmap:K=V[,Kn=Vn] Sets a mapping for source path names used in generated output\n" +
                                "   -pkg:P1[,Pn]         References packages P1..Pn\n" +
                                "   -platform:ARCH       Specifies the target platform of the output assembly\n" +
                                "                        ARCH can be one of: anycpu, anycpu32bitpreferred, arm,\n" +
index eab87d16a17871ef5789fd98503ec70a99708f86..fbb060f52960da9af8218171c9cf6991e8b102cc 100644 (file)
@@ -3245,9 +3245,10 @@ namespace Mono.CSharp {
 
                public override void Emit (EmitContext ec)
                {
-                       if (Parent != null) {
-                               // TODO: It's needed only when scope has variable (normal or lifted)
-                               ec.BeginScope (GetDebugSymbolScopeIndex ());
+                       // TODO: It's needed only when scope has variable (normal or lifted)
+                       var scopeIndex = GetDebugSymbolScopeIndex ();
+                       if (scopeIndex > 0) {
+                               ec.BeginScope (scopeIndex);
                        }
 
                        EmitScopeInitialization (ec);
@@ -3258,7 +3259,7 @@ namespace Mono.CSharp {
 
                        DoEmit (ec);
 
-                       if (Parent != null)
+                       if (scopeIndex > 0)
                                ec.EndScope ();
 
                        if (ec.EmitAccurateDebugInfo && HasReachableClosingBrace && !(this is ParametersBlock) &&
@@ -3451,7 +3452,12 @@ namespace Mono.CSharp {
                        storey.Parent.PartialContainer.AddCompilerGeneratedClass (storey);
                }
 
-               public int GetDebugSymbolScopeIndex ()
+               public void DisableDebugScopeIndex ()
+               {
+                       debug_scope_index = -1;
+               }
+
+               public virtual int GetDebugSymbolScopeIndex ()
                {
                        if (debug_scope_index == 0)
                                debug_scope_index = ++ParametersBlock.debug_scope_index;
@@ -3859,6 +3865,11 @@ namespace Mono.CSharp {
                        return res;
                }
 
+               public override int GetDebugSymbolScopeIndex ()
+               {
+                       return 0;
+               }
+
                public LabeledStatement GetLabel (string name, Block block)
                {
                        //
@@ -8338,15 +8349,14 @@ namespace Mono.CSharp {
                        ec.LoopBegin = ec.DefineLabel ();
                        ec.LoopEnd = ec.DefineLabel ();
 
-                       if (!(Statement is Block))
-                               ec.BeginCompilerScope (variable.Block.Explicit.GetDebugSymbolScopeIndex ());
+                       ec.BeginCompilerScope (variable.Block.Explicit.GetDebugSymbolScopeIndex ());
+                       body.Explicit.DisableDebugScopeIndex ();
 
                        variable.CreateBuilder (ec);
 
                        Statement.Emit (ec);
 
-                       if (!(Statement is Block))
-                               ec.EndScope ();
+                       ec.EndScope ();
 
                        ec.LoopBegin = old_begin;
                        ec.LoopEnd = old_end;
index 23eed1ddb29e9f237ace718da60a5a71f6db7c75..03a62053464fb317d4772e9908df2ffc10af643a 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;MONO;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;MONO;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>MONO;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>MONO;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 4c55206a32b037e0e3f1e0da3e5e4b813702e430..ff2129e0ca0e6d86b79e6bf697e2e02ed95d3de8 100644 (file)
@@ -19,6 +19,9 @@ namespace NUnit.ConsoleRunner
                [STAThread]\r
                public static int Main(string[] args)\r
                {\r
+                       Console.ForegroundColor = ConsoleColor.Red;\r
+                       Console.WriteLine ("Note: nunit-console shipped with Mono is deprecated, please use the NUnit NuGet package or some other form of acquiring NUnit.");\r
+                       Console.ResetColor ();\r
                        return Runner.Main( args );\r
                }\r
        }\r
index 83cb5607a2e41b979e4c805593641f4627d2554b..abcc7acfceda781eec1ef3239f282df650a3f0e6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index ed6ee53d3849be09e094d8c8987e8eb0c8c562b1..62491e1b318175b53b13240c44cfe7f21dc64b21 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;MONO;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;MONO;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>MONO;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>MONO;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e6b70afdcba4369a7a4ecdb09baea2eb89a16d2d..4b503806ab9d1f13d969cb6faff3b19adb692225 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 93d549db2a077a0030573e6f8cf9f82419d68074..b6d6ae1754761bbefbb7f757402d411a83cc3599 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c7352101e5e015f53e45d6a9c4cbc9ed08e20c03..01d141732770fd48e1a7fe5aebe5fbcd2c0b86e8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;StronglyNamedAssembly</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;StronglyNamedAssembly</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;StronglyNamedAssembly</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;StronglyNamedAssembly</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index dc02b28ebcb10437a80bcda33a0ca7f9a55aeec7..f6fa9cfe62a2855abcd745def43477328c416000 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;StronglyNamedAssembly</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;StronglyNamedAssembly</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;StronglyNamedAssembly</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;StronglyNamedAssembly</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index fae60ac6a975c31f1e5b200ff265de11e6803773..2ed6ce9136e5ef5b0812babcb91580876c531b2b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;StronglyNamedAssembly</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;StronglyNamedAssembly</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;StronglyNamedAssembly</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;StronglyNamedAssembly</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 06794aa8b128d0533ecc6aedff760cf286f00f61..9fb55fb9d965b19a5f6b84321738cbd96ff886f9 100644 (file)
@@ -14,6 +14,7 @@ namespace NUnit.Framework
        /// {}\r
        /// </example>\r
        [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=true)]\r
+       [Obsolete ("The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.", true)]\r
        public class TestFixtureAttribute : Attribute\r
        {\r
                private string description;\r
index a032cb9bf230fadf6355f10ee48e6ac07f57003e..48413a8456eee84db44476dded2a8db5206ff909 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>StronglyNamedAssembly;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/tests/gtest-optional-40.cs b/mcs/tests/gtest-optional-40.cs
new file mode 100644 (file)
index 0000000..e554fa7
--- /dev/null
@@ -0,0 +1,19 @@
+using System;
+
+internal class Program
+{
+       public static void Main ()
+       {
+               AttributeOrDefault ("firstItem", null); 
+       }
+       
+       public static string AttributeOrDefault (string attribute, string defaultValue = null)
+       {
+               return "";
+       }
+
+       public static string AttributeOrDefault (string attribute, bool? klass, string defaultValue = null)
+       {
+               throw new ApplicationException ();
+       }
+}
index db740c2456f8f89c415ad5d6ed13f835ade27ad1..d14a377f00fc9f23f40ad4633e7bc5617f6201d7 100644 (file)
       </locals>
       <scopes>
         <entry index="0" start="0x1" end="0x1e" />
-        <entry index="1" start="0xb" end="0x11" />
-        <entry index="2" start="0xf" end="0x10" />
+        <entry index="1" start="0xf" end="0x10" />
       </scopes>
     </method>
     <method token="0x6000019">
       </locals>
       <scopes>
         <entry index="0" start="0x1" end="0x37" />
-        <entry index="1" start="0xe" end="0x18" />
-        <entry index="2" start="0x16" end="0x17" />
+        <entry index="1" start="0x16" end="0x17" />
       </scopes>
     </method>
     <method token="0x600001a">
       </locals>
       <scopes>
         <entry index="0" start="0x1" end="0x3c" />
-        <entry index="1" start="0xf" end="0x18" />
-        <entry index="2" start="0x16" end="0x17" />
+        <entry index="1" start="0x16" end="0x17" />
       </scopes>
     </method>
     <method token="0x600001b">
       </locals>
       <scopes>
         <entry index="0" start="0x1" end="0x4d" />
-        <entry index="1" start="0x24" end="0x31" />
-        <entry index="2" start="0x2f" end="0x30" />
+        <entry index="1" start="0x2f" end="0x30" />
       </scopes>
     </method>
   </methods>
index 3958eb589f82a1a044189259b56b365b575b8d74..41445be8cee95dca28411f414d9893332c8fae87 100644 (file)
@@ -83,7 +83,8 @@
       </sequencepoints>
       <locals />
       <scopes>
-        <entry index="0" start="0x0" end="0xb" />
+        <entry index="0" start="0x0" end="0x0" />
+        <entry index="1" start="0x0" end="0xb" />
       </scopes>
     </method>
   </methods>
index 1038be00dde8b9d78e423fe0197ab430a7661d3e..c823a34e298adbe4cf07c325c957aa767c639503 100644 (file)
@@ -28,9 +28,7 @@
       </locals>
       <scopes>
         <entry index="0" start="0x1" end="0x1c" />
-        <entry index="1" start="0xb" end="0xf" />
-        <entry index="2" start="0x1c" end="0x3f" />
-        <entry index="3" start="0x28" end="0x2e" />
+        <entry index="1" start="0x1c" end="0x3f" />
       </scopes>
     </method>
     <method token="0x6000003">
diff --git a/mcs/tests/test-debug-31-ref.xml b/mcs/tests/test-debug-31-ref.xml
new file mode 100644 (file)
index 0000000..1a77894
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<symbols>
+  <files>
+    <file id="1" name="test-debug-31.cs" checksum="e1579371d047d82b8d90c0dc26393808" />
+  </files>
+  <methods>
+    <method token="0x6000001">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000002">
+      <sequencepoints>
+        <entry il="0x0" row="8" col="3" file_ref="1" hidden="false" />
+        <entry il="0x1" row="9" col="4" file_ref="1" hidden="false" />
+        <entry il="0x20" row="11" col="4" file_ref="1" hidden="false" />
+        <entry il="0x21" row="11" col="25" file_ref="1" hidden="false" />
+        <entry il="0x2a" row="11" col="13" file_ref="1" hidden="false" />
+        <entry il="0x2e" row="12" col="4" file_ref="1" hidden="false" />
+        <entry il="0x2f" row="13" col="5" file_ref="1" hidden="false" />
+        <entry il="0x30" row="13" col="13" file_ref="1" hidden="false" />
+        <entry il="0x35" row="14" col="4" file_ref="1" hidden="false" />
+        <entry il="0x36" row="11" col="25" file_ref="1" hidden="false" />
+        <entry il="0x43" row="16" col="4" file_ref="1" hidden="false" />
+        <entry il="0x44" row="16" col="26" file_ref="1" hidden="false" />
+        <entry il="0x4f" row="16" col="13" file_ref="1" hidden="false" />
+        <entry il="0x56" row="16" col="33" file_ref="1" hidden="false" />
+        <entry il="0x57" row="17" col="5" file_ref="1" hidden="false" />
+        <entry il="0x59" row="17" col="13" file_ref="1" hidden="false" />
+        <entry il="0x5e" row="18" col="4" file_ref="1" hidden="false" />
+        <entry il="0x5f" row="16" col="26" file_ref="1" hidden="false" />
+        <entry il="0x70" row="20" col="4" file_ref="1" hidden="false" />
+        <entry il="0x71" row="20" col="26" file_ref="1" hidden="false" />
+        <entry il="0x7c" row="20" col="13" file_ref="1" hidden="false" />
+        <entry il="0x83" row="20" col="33" file_ref="1" hidden="false" />
+        <entry il="0x84" row="21" col="5" file_ref="1" hidden="false" />
+        <entry il="0x86" row="21" col="13" file_ref="1" hidden="false" />
+        <entry il="0x8b" row="22" col="4" file_ref="1" hidden="false" />
+        <entry il="0x8c" row="20" col="26" file_ref="1" hidden="false" />
+        <entry il="0x9d" row="23" col="3" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals>
+        <entry name="array" il_index="0" scope_ref="0" />
+        <entry name="item" il_index="1" scope_ref="1" />
+        <entry name="item1" il_index="4" scope_ref="3" />
+        <entry name="item2" il_index="7" scope_ref="5" />
+      </locals>
+      <scopes>
+        <entry index="0" start="0x20" end="0x43" />
+        <entry index="1" start="0x2e" end="0x35" />
+        <entry index="2" start="0x43" end="0x70" />
+        <entry index="3" start="0x56" end="0x5e" />
+        <entry index="4" start="0x70" end="0x9d" />
+        <entry index="5" start="0x83" end="0x8b" />
+      </scopes>
+    </method>
+  </methods>
+</symbols>
\ No newline at end of file
diff --git a/mcs/tests/test-debug-31.cs b/mcs/tests/test-debug-31.cs
new file mode 100644 (file)
index 0000000..5a3d55d
--- /dev/null
@@ -0,0 +1,25 @@
+using System;
+
+namespace cp534534
+{
+       class MainClass
+       {
+               public static void Main ()
+               {
+                       var array = new string[] { "a", "b", "c" };
+                       
+                       foreach (var item in array)
+                       {
+                               Console.WriteLine (item);
+                       }
+
+                       foreach (var item1 in array) {
+                               Console.WriteLine (item1);
+                       }
+
+                       foreach (var item2 in array) {
+                               Console.WriteLine (item2);
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/mcs/tests/test-debug-32-ref.xml b/mcs/tests/test-debug-32-ref.xml
new file mode 100644 (file)
index 0000000..acabcfb
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<symbols>
+  <files>
+    <file id="1" name="test-debug-32.cs" checksum="71a5517624c6bd01871fcb9ae65242b7" />
+  </files>
+  <methods>
+    <method token="0x6000001">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000002">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000003">
+      <sequencepoints>
+        <entry il="0x0" row="19" col="2" file_ref="1" hidden="false" />
+        <entry il="0x1" row="20" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000004">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000005">
+      <sequencepoints>
+        <entry il="0x27" row="6" col="2" file_ref="1" hidden="false" />
+        <entry il="0x28" row="7" col="3" file_ref="1" hidden="false" />
+        <entry il="0x43" row="9" col="3" file_ref="1" hidden="false" />
+        <entry il="0x4a" row="10" col="3" file_ref="1" hidden="false" />
+        <entry il="0x59" row="10" col="7" file_ref="1" hidden="false" />
+        <entry il="0x5a" row="11" col="4" file_ref="1" hidden="false" />
+        <entry il="0x7c" row="12" col="3" file_ref="1" hidden="false" />
+        <entry il="0x8d" row="16" col="2" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes>
+        <entry index="0" start="0x59" end="0x7c" />
+      </scopes>
+    </method>
+    <method token="0x6000006">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000007">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000008">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x6000009">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x600000a">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x600000b">
+      <sequencepoints />
+      <locals />
+      <scopes />
+    </method>
+    <method token="0x600000c">
+      <sequencepoints>
+        <entry il="0x0" row="12" col="13" file_ref="1" hidden="false" />
+        <entry il="0x1" row="13" col="4" file_ref="1" hidden="false" />
+        <entry il="0xd" row="13" col="16" file_ref="1" hidden="false" />
+        <entry il="0xe" row="14" col="4" file_ref="1" hidden="false" />
+        <entry il="0xf" row="15" col="3" file_ref="1" hidden="false" />
+      </sequencepoints>
+      <locals />
+      <scopes>
+        <entry index="0" start="0x0" end="0x0" />
+        <entry index="1" start="0x0" end="0xf" />
+        <entry index="2" start="0xd" end="0xe" />
+      </scopes>
+    </method>
+  </methods>
+</symbols>
\ No newline at end of file
diff --git a/mcs/tests/test-debug-32.cs b/mcs/tests/test-debug-32.cs
new file mode 100644 (file)
index 0000000..ba52a10
--- /dev/null
@@ -0,0 +1,21 @@
+using System.Collections.Generic;
+
+class X
+{
+       internal static IEnumerable<int> EnumerateKind ()
+       {
+               yield return 1;
+
+               int h = 3;
+               try {
+                       yield return h;
+               } finally {
+                       if (h != 1) {
+                       }
+               }
+       }
+
+       public static void Main ()
+       {
+       }
+}
\ No newline at end of file
index 3dd99f5f2797f7c0db8b3b033fa08dedab20f9ca..4cf2e64196bd6b4a50cd1036eb0f2225dd3a5036 100644 (file)
@@ -13,6 +13,13 @@ public class ParserTest
                Console.WriteLine($"This should work but the compiler explodes if the string is too long!");            
        }
 
+       void Test3 ()
+       {
+               string field = "";
+               var l1 = $"\"{field.Replace("\"", "gg")}\"";
+               var l2 = $@"""{field.Replace("\"", "gg")}""";
+       }
+
        public static void Main()
        {
        }
diff --git a/mcs/tests/test-named-10.cs b/mcs/tests/test-named-10.cs
new file mode 100644 (file)
index 0000000..6434c83
--- /dev/null
@@ -0,0 +1,18 @@
+using System;
+
+internal class Program
+{
+       public static void Main ()
+       {
+               Method (1, 2, paramNamed: 3);
+       }
+       
+       static void Method (int p1, int paramNamed, int p2)
+       {
+               throw new ApplicationException ();
+       }
+       
+       static void Method (int p1, int p2, object paramNamed)
+       {
+       }
+}
index 0ac3d56b53db124bf9f98bfae87da7b2ecf8f4cc..7df1a90869f6c5f7214af565f80b61175578bc42 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-optional-40.cs">
+    <type name="Program">
+      <method name="Void Main()" attrs="150">
+        <size>14</size>
+      </method>
+      <method name="System.String AttributeOrDefault(System.String, System.String)" attrs="150">
+        <size>14</size>
+      </method>
+      <method name="System.String AttributeOrDefault(System.String, System.Nullable`1[System.Boolean], System.String)" attrs="150">
+        <size>7</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-partial-01.cs">
     <type name="B`1[U]">
       <method name="Void .ctor()" attrs="6278">
       </method>
     </type>
   </test>
+  <test name="test-debug-31.cs">
+    <type name="cp534534.MainClass">
+      <method name="Void Main()" attrs="150">
+        <size>158</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
+  <test name="test-debug-32.cs">
+    <type name="X">
+      <method name="System.Collections.Generic.IEnumerable`1[System.Int32] EnumerateKind()" attrs="147">
+        <size>23</size>
+      </method>
+      <method name="Void Main()" attrs="150">
+        <size>2</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+    <type name="X+&lt;EnumerateKind&gt;c__Iterator0">
+      <method name="Boolean MoveNext()" attrs="486">
+        <size>152</size>
+      </method>
+      <method name="Int32 System.Collections.Generic.IEnumerator&lt;int&gt;.get_Current()" attrs="2529">
+        <size>14</size>
+      </method>
+      <method name="System.Object System.Collections.IEnumerator.get_Current()" attrs="2529">
+        <size>19</size>
+      </method>
+      <method name="Void Dispose()" attrs="486">
+        <size>57</size>
+      </method>
+      <method name="Void Reset()" attrs="486">
+        <size>6</size>
+      </method>
+      <method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
+        <size>14</size>
+      </method>
+      <method name="System.Collections.Generic.IEnumerator`1[System.Int32] System.Collections.Generic.IEnumerable&lt;int&gt;.GetEnumerator()" attrs="481">
+        <size>26</size>
+      </method>
+      <method name="Void &lt;&gt;__Finally0()" attrs="129">
+        <size>17</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-decl-expr-01.cs">
     <type name="DeclarationExpression">
       <method name="Int32 Main()" attrs="150">
       <method name="Void Test2()" attrs="129">
         <size>12</size>
       </method>
+      <method name="Void Test3()" attrs="129">
+        <size>62</size>
+      </method>
     </type>
   </test>
   <test name="test-interpolation-06.cs">
       </method>
     </type>
   </test>
+  <test name="test-named-10.cs">
+    <type name="Program">
+      <method name="Void Main()" attrs="150">
+        <size>15</size>
+      </method>
+      <method name="Void Method(Int32, Int32, Int32)" attrs="145">
+        <size>7</size>
+      </method>
+      <method name="Void Method(Int32, Int32, System.Object)" attrs="145">
+        <size>2</size>
+      </method>
+      <method name="Void .ctor()" attrs="6278">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-nameof-01.cs">
     <type name="X">
       <method name="Int32 Main()" attrs="150">
index 693318cbea7e07fdb27df8413379a15d159e7ac0..60600a30a325741f01915bcfef2b9706338f0267 100644 (file)
@@ -3,7 +3,6 @@ thisdir = tools
 net_4_5_dirs := \
        al              \
        linker          \
-       tuner           \
        culevel         \
        genxs           \
        mkbundle        \
@@ -47,7 +46,8 @@ net_4_5_dirs := \
        mdbrebase       \
        ikdasm          \
        mono-symbolicate        \
-       linker-analyzer
+       linker-analyzer \
+       btls
 
 build_SUBDIRS = gacutil security culevel cil-stringreplacer commoncryptogenerator
 net_4_5_SUBDIRS = gacutil
index 2657ba32963f0bd34039d77c93976da8c731b50f..20582303172ab9a33103073d73b7832fb85e6127 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 40cc077a60fe2237de9af9afc8975635a5f449a8..a9b1e46cba089a277538dad6b3961e245ec14c4f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/tools/btls/AssemblyInfo.cs b/mcs/tools/btls/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..06f8d61
--- /dev/null
@@ -0,0 +1,26 @@
+using System;
+using System.Diagnostics;
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle ("btls-cert-sync")]
+[assembly: AssemblyDescription ("btls-cert-sync")]
+[assembly: AssemblyDefaultAlias ("btls-cert-sync")]
+
+[assembly: AssemblyCompany (Consts.MonoCompany)]
+[assembly: AssemblyProduct (Consts.MonoProduct)]
+[assembly: AssemblyCopyright (Consts.MonoCopyright)]
+[assembly: AssemblyVersion (Consts.FxVersion)]
+[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
+[assembly: SatelliteContractVersion (Consts.FxVersion)]
+[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
+
+[assembly: CLSCompliant (true)]
+[assembly: NeutralResourcesLanguage ("en-US")]
+
+[assembly: ComVisible (false)]
+
+[assembly: AssemblyDelaySign (true)]
+[assembly: AssemblyKeyFile ("../../class/mono.pub")]
diff --git a/mcs/tools/btls/Makefile b/mcs/tools/btls/Makefile
new file mode 100644 (file)
index 0000000..b551fa7
--- /dev/null
@@ -0,0 +1,17 @@
+thisdir = tools/btls
+SUBDIRS = 
+include ../../build/rules.make
+
+LOCAL_MCS_FLAGS =
+LIB_REFS = System Mono.Security Mono.Btls.Interface
+PROGRAM = btls-cert-sync.exe
+
+ifndef HAVE_BTLS
+PROGRAM_NAME = dummy-btls-cert-sync.exe
+NO_INSTALL = yes
+NO_SIGN_ASSEMBLY = yes
+NO_TEST = yes
+NO_BUILD = yes
+endif
+
+include ../../build/executable.make
diff --git a/mcs/tools/btls/btls-cert-sync-net_4_x.csproj b/mcs/tools/btls/btls-cert-sync-net_4_x.csproj
new file mode 100644 (file)
index 0000000..9075734
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\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>{2323EB4F-0DBA-47C7-B4AA-AD38CCD16BF8}</ProjectGuid>\r
+    <OutputType>Exe</OutputType>\r
+    <NoWarn>1699</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
+    \r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>\r
+    </RootNamespace>\r
+    <AssemblyName>btls-cert-sync</AssemblyName>\r
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
+    <FileAlignment>512</FileAlignment>\r
+  </PropertyGroup>\r
+  \r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <NoWarn>1699</NoWarn>\r
+    <Optimize>false</Optimize>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</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</NoWarn>\r
+    <Optimize>true</Optimize>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</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\SR.cs" />\r
+    <Compile Include="AssemblyInfo.cs" />\r
+    <Compile Include="btls-cert-sync.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="../../class/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="../../class/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="../../class/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="../../class/Mono.Btls.Interface/Mono.Btls.Interface-net_4_x.csproj">\r
+      <Project>{BF32D586-8FBB-4A2A-A734-AA17CDAB283F}</Project>\r
+      <Name>Mono.Btls.Interface-net_4_x</Name>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Folder Include="Properties\" />\r
+  </ItemGroup>\r
+</Project>\r
+
diff --git a/mcs/tools/btls/btls-cert-sync.cs b/mcs/tools/btls/btls-cert-sync.cs
new file mode 100644 (file)
index 0000000..fcdc708
--- /dev/null
@@ -0,0 +1,61 @@
+using System;
+using System.IO;
+using System.Text;
+using System.Security.Cryptography.X509Certificates;
+using MNS = Mono.Net.Security;
+
+namespace Mono.Btls
+{
+       static class BtlsCertSync
+       {
+               static void Main (string[] args)
+               {
+                       if (!MNS.MonoTlsProviderFactory.IsBtlsSupported ()) {
+                               Console.Error.WriteLine ("BTLS is not supported in this runtime!");
+                               Environment.Exit (255);
+                       }
+
+                       var configPath = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
+                       configPath = Path.Combine (configPath, ".mono");
+
+                       var oldStorePath = Path.Combine (configPath, "certs", "Trust");
+                       var newStorePath = MonoBtlsX509StoreManager.GetStorePath (MonoBtlsX509StoreType.UserTrustedRoots);
+
+                       if (!Directory.Exists (oldStorePath)) {
+                               Console.WriteLine ("Old trust store {0} does not exist.");
+                               Environment.Exit (255);
+                       }
+
+                       if (Directory.Exists (newStorePath))
+                               Directory.Delete (newStorePath, true);
+                       Directory.CreateDirectory (newStorePath);
+
+                       var oldfiles = Directory.GetFiles (oldStorePath, "*.cer");
+                       Console.WriteLine ("Found {0} files in the old store.", oldfiles.Length);
+
+                       foreach (var file in oldfiles) {
+                               Console.WriteLine ("Converting {0}.", file);
+                               var data = File.ReadAllBytes (file);
+                               using (var x509 = MonoBtlsX509.LoadFromData (data, MonoBtlsX509Format.DER)) {
+                                       ConvertToNewFormat (newStorePath, x509);
+                               }
+                       }
+               }
+
+               static void ConvertToNewFormat (string root, MonoBtlsX509 x509)
+               {
+                       long hash = x509.GetSubjectNameHash ();
+
+                       string newName;
+                       int index = 0;
+                       do {
+                               newName = Path.Combine (root, string.Format ("{0:x8}.{1}", hash, index++));
+                       } while (File.Exists (newName));
+                       Console.WriteLine ("  new name: {0}", newName);
+
+                       using (var stream = new FileStream (newName, FileMode.Create))
+                       using (var bio = MonoBtlsBio.CreateMonoStream (stream))
+                                x509.ExportAsPEM (bio, true);
+               }
+       }
+}
diff --git a/mcs/tools/btls/btls-cert-sync.exe.sources b/mcs/tools/btls/btls-cert-sync.exe.sources
new file mode 100644 (file)
index 0000000..706d78f
--- /dev/null
@@ -0,0 +1,4 @@
+../../build/common/SR.cs
+../../build/common/Consts.cs
+AssemblyInfo.cs
+btls-cert-sync.cs
index ef7c94e26a1775d6b45fec208903de06233f35a6..b5f730ceb01065cf768ed4b3b3d65bd56b88c3a4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 69b39b8665abe053fd1ce5a29c940a3e20918f0b..ae7efa8697c9b0dc85142bc7b6d8bdbbb2a28baa 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index fcac823667655241540db30c26a85efff866f638..96bbd89f8589480f3f36898d94cb989c1c0e8db4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -80,8 +81,8 @@
       <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
       <Name>System-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
+    <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+      <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
       <Name>Mono.Cecil-net_4_x</Name>\r
     </ProjectReference>\r
   </ItemGroup>\r
index 7a24a4cd46a1863b4142b92f75ab495efdde10d2..524b7cec7ad3ec4bfaf0b4d86af141f1d4e388f7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f177c17ef3a5215b60d576381f6959ff3602b474..b9262adae0c7c88c205d58cfc235ed3d615723f7 100644 (file)
@@ -14,7 +14,7 @@ namespace Xamarin {
 
        public static class CommonCryptor {
                
-               static public void Generate (string namespaceName, string typeName, string baseTypeName, string ccAlgorithmName, string feedbackSize = "8", string ctorInitializers = null)
+               static public void Generate (string namespaceName, string typeName, string baseTypeName, string ccAlgorithmName, string feedbackSize = "8", string ctorInitializers = null, string decryptorInitializers = null, string encryptorInitializers = null, string properties = null)
                {
                        string template = @"// Generated file to bind CommonCrypto cipher algorithms - DO NOT EDIT
 //
@@ -38,7 +38,9 @@ namespace %NAMESPACE% {
                        FeedbackSizeValue = %FEEDBACKSIZE%;
                        %CTOR_INIT%
                }
-               
+
+               %PROPERTIES%
+
                public override void GenerateIV ()
                {
                        IVValue = KeyBuilder.IV (BlockSizeValue >> 3);
@@ -51,6 +53,8 @@ namespace %NAMESPACE% {
                
                public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV) 
                {
+                       %CREATEDECRYPTOR_INIT%
+
                        IntPtr decryptor = IntPtr.Zero;
                        switch (Mode) {
                        case CipherMode.CBC:
@@ -74,6 +78,8 @@ namespace %NAMESPACE% {
                
                public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV) 
                {
+                       %CREATEENCRYPTOR_INIT%
+                       
                        IntPtr encryptor = IntPtr.Zero;
                        switch (Mode) {
                        case CipherMode.CBC:
@@ -98,6 +104,9 @@ namespace %NAMESPACE% {
                        
                        File.WriteAllText (typeName + ".g.cs", template.Replace ("%NAMESPACE%", namespaceName).
                                Replace ("%TYPE%", typeName).Replace ("%BASE%", baseTypeName).Replace("%FEEDBACKSIZE%", feedbackSize).Replace ("%CTOR_INIT%", ctorInitializers).
+                               Replace ("%CREATEDECRYPTOR_INIT%", decryptorInitializers).
+                               Replace ("%CREATEENCRYPTOR_INIT%", encryptorInitializers).
+                               Replace ("%PROPERTIES%", properties).
                                Replace ("%CCALGORITHM%", ccAlgorithmName.ToString ()));
                }
        }
index f33343cf5e6ebf08b04253e00df407d6df093393..0ade887e5b1e6d2f582e4dcffa79ec5cea9e6d21 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index a7d13c8cb80c9738d0cd90f07c07eb333f031e62..4fb846fe8f74fa1a879236ddd0c660d9dd84f117 100644 (file)
@@ -42,7 +42,13 @@ namespace Xamarin {
                        // mscorlib replacements
                        CommonCryptor.Generate ("System.Security.Cryptography", "DESCryptoServiceProvider", "DES", "DES");
                        CommonCryptor.Generate ("System.Security.Cryptography", "TripleDESCryptoServiceProvider", "TripleDES", "TripleDES");
-                       CommonCryptor.Generate ("System.Security.Cryptography", "RC2CryptoServiceProvider", "RC2", "RC2", ctorInitializers: "LegalKeySizesValue = new[] { new KeySizes(40, 128, 8) };");
+
+                       const string checkUseSalt = "if (UseSalt) throw new NotImplementedException (\"UseSalt=true is not implemented on Mono yet\");";
+                       CommonCryptor.Generate ("System.Security.Cryptography", "RC2CryptoServiceProvider", "RC2", "RC2",
+                               ctorInitializers: "LegalKeySizesValue = new[] { new KeySizes(40, 128, 8) };",
+                               decryptorInitializers: checkUseSalt,
+                               encryptorInitializers: checkUseSalt,
+                               properties: "public bool UseSalt { get; set; }");
                        // Rijndael supports block sizes that are not available in AES - as such it does not use the same generated code
                        // but has it's own version, using AES (128 bits block size) and falling back to managed (192/256 bits block size)
 
index 22ebee6b91de23e5fedadfe4aca0d5bd1b3f156b..e7ad8f6d4c71a961d1c2fcb02cfd7efe5989bd7b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 5fcf051eccfd77fdf17f66ecda420adea0893e56..2fe5b02961889c70e20ae3870e33f0dce1555732 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -79,8 +80,8 @@
       <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
       <Name>corlib-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
+    <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+      <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
       <Name>Mono.Cecil-net_4_x</Name>\r
     </ProjectReference>\r
     <ProjectReference Include="../../class/System.XML/System.Xml-net_4_x.csproj">\r
index bb93b0e0619a7043094c3271509202193411337d..eacdad812b89f09c4cb9371f32d2469e08689cc3 100644 (file)
@@ -33,9 +33,6 @@
     <Reference Include="System" />\r
     <Reference Include="System.Core" />\r
     <Reference Include="System.Xml" />\r
-    <Reference Include="Mono.Cecil">\r
-      <HintPath>..\..\class\lib\net_4_x\Mono.Cecil.dll</HintPath>\r
-    </Reference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Compile Include="AssemblyResolver.cs" />\r
     <Compile Include="..\..\class\Mono.Options\Mono.Options\Options.cs">\r
       <Link>Options.cs</Link>\r
     </Compile>\r
+\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ArrayType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyFlags.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyHashAlgorithm.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyLinkedResource.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyNameDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyNameReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyReader.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyWriter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\BaseAssemblyResolver.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\CallSite.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\CustomAttribute.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\DefaultAssemblyResolver.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\EmbeddedResource.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\EventAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\EventDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\EventReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ExportedType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FieldAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FieldDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FieldReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FileAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FunctionPointerType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\GenericInstanceMethod.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\GenericInstanceType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\GenericParameter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\GenericParameterAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IConstantProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ICustomAttributeProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IGenericInstance.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IGenericParameterProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMarshalInfoProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMemberDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMetadataScope.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMetadataTokenProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMethodSignature.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\Import.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\LinkedResource.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ManifestResourceAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MarshalInfo.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MemberDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MemberReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MetadataResolver.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MetadataSystem.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodCallingConvention.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodImplAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodReturnType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodSemanticsAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodSpecification.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\Modifiers.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ModuleDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ModuleKind.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ModuleReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\NativeType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ParameterAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ParameterDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ParameterDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ParameterReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PinnedType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PInvokeAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PInvokeInfo.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PointerType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PropertyAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PropertyDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PropertyReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ReferenceType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\Resource.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\SecurityDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\SentinelType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TargetRuntime.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\Treatments.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeParser.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeSpecification.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeSystem.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\VariantType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\WindowsRuntimeProjections.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Collections.Generic\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Security.Cryptography\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono\*.cs" />    \r
   </ItemGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
index 1da92c6446f91a190544a38785d58861cbee36a1..e29fe61a1756bcb8d68764e76ab6a2b77097ed7d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>3021,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>3021,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 75b22b934c83c16f46c9d255ce384d5ab8b53368..567c766e6cb5092bce1e1803a64f8e78e1647eb7 100644 (file)
@@ -55,7 +55,7 @@ namespace Mono {
                        var startup_files = new string [settings.SourceFiles.Count];
                        int i = 0;
                        foreach (var source in settings.SourceFiles)
-                               startup_files [i++] = source.FullPathName;
+                               startup_files [i++] = source.OriginalFullPathName;
                        settings.SourceFiles.Clear ();
 
                        TextWriter agent_stderr = null;
index c28f23987fcefec757b937845481b8ebe524463c..9049faba66a9d15d36cf21b130d19182afc24623 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 28c7350a7c95ef0f55ade2a1a785e2cfc2a900cd..a1907c4617c665f14fd61cff44839ebc5bf7526d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 4d15a18b0e9200cfd4431aba39e22241984a82ce..2d254d6f33d60c7c8b1b35ddaec5f32c731df857 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 01da80aef2a12309fc8c123653817e9414e96448..c5d2c39107df69e30b7f88fbaac04d9d1f559bef 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index fb1472e31a3e280e4fd0c6ad4daeff130b542f04..314a5481ddbd2cb62b4cc212a4a900ea111574f2 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\ikvm\reflect\*.cs" />\r
+    <Compile Include="..\..\..\external\ikvm\reflect\Emit\*.cs" />\r
+    <Compile Include="..\..\..\external\ikvm\reflect\Impl\ITypeOwner.cs" />\r
+    <Compile Include="..\..\..\external\ikvm\reflect\Impl\SymbolSupport.cs" />\r
+    <Compile Include="..\..\..\external\ikvm\reflect\Metadata\*.cs" />\r
+    <Compile Include="..\..\..\external\ikvm\reflect\Reader\*.cs" />\r
+    <Compile Include="..\..\..\external\ikvm\reflect\Writer\*.cs" />\r
     <Compile Include="..\security\StrongNameManager.cs" />\r
     <Compile Include="driver.cs" />\r  </ItemGroup>\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
       <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
       <Name>corlib-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../../class/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="../../class/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="../../class/System.Security/System.Security-net_4_x.csproj">\r
+      <Project>{3ED36717-A9D1-4289-8949-9B7F39766DEB}</Project>\r
+      <Name>System.Security-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index 508aee2f63b8809b1a3c395b65e24bdff7352d26..7cb491a46954009798da0eb0699efe2b8db70511 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7c3ce2b390a7111af0811ec2649f88d0bdaacc23..698e8cd2321e545a18f5f283bd6f05d23ea0aa41 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f8aa6becff009e0dcfece71045761a8231257b6a..766f8249bfb759af45e977d5c2057bf66870c644 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2dfe29a9fa23cf5c6f99f7ddfc90143b2f319f12..522a2afcf0aa47801f947533da531a492ce902d1 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 01cd3e394e3ef1f9be3fe5423bc3377b20729234..4fa01f15b4cb3953bdc9c76bb1502072850ad517 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2c8b983ec80361220d93fd99f10066c3bc2a28fe..938623a3fda720afd039d3bef14589dd0f5831d7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index c417ab01240d00cfaf6f12f99339d9df3647f10f..7c539e9ef51b320292ed9fa39f90944676ef90d4 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/tools/linker/AUTHORS b/mcs/tools/linker/AUTHORS
deleted file mode 100644 (file)
index 4af5896..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Jb Evain <jbevain@novell.com>
index 396acc5a69eb9d4b15cbab8a7e160fe041adcd2a..31764d0efac7e6113a3689c233918c2aed052786 100644 (file)
                <type fullname="System.Reflection.MonoEventInfo" preserve="fields" />
                <type fullname="System.Reflection.MonoField" preserve="fields" />
                <type fullname="System.Reflection.MonoGenericClass" preserve="fields" />
-               <type fullname="System.Reflection.MonoGenericMethod" preserve="fields" />
-               <type fullname="System.Reflection.MonoGenericCMethod" preserve="fields" />
                <type fullname="System.Reflection.MonoMethod" preserve="fields" />
                <type fullname="System.Reflection.MonoMethodInfo" preserve="fields" />
                <type fullname="System.Reflection.MonoPropertyInfo" preserve="fields" />
                <type fullname="System.Reflection.Emit.MethodBuilder" preserve="fields" />
                <type fullname="System.Reflection.Emit.ModuleBuilder" preserve="fields">
                        <method name="Mono_GetGuid" />
+                       <method name="RuntimeResolve" />
                </type>
                <type fullname="System.Reflection.Emit.MonoResource" preserve="fields" />
                <type fullname="System.Reflection.Emit.MonoWin32Resource" preserve="fields" />
diff --git a/mcs/tools/linker/MIT.X11 b/mcs/tools/linker/MIT.X11
deleted file mode 100644 (file)
index d2d78ee..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright (c) 2007 Novell, Inc and the individuals listed on the
-ChangeLog entries.
-
-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.
diff --git a/mcs/tools/linker/Mono.Linker.Steps/BaseStep.cs b/mcs/tools/linker/Mono.Linker.Steps/BaseStep.cs
deleted file mode 100644 (file)
index 13cf468..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// BaseStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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 Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public abstract class BaseStep : IStep {
-
-               private LinkContext _context;
-
-               public LinkContext Context {
-                       get { return _context; }
-               }
-
-               public AnnotationStore Annotations {
-                       get { return _context.Annotations; }
-               }
-
-               public void Process (LinkContext context)
-               {
-                       _context = context;
-
-                       if (!ConditionToProcess ())
-                               return;
-
-                       Process ();
-
-                       foreach (AssemblyDefinition assembly in context.GetAssemblies ())
-                               ProcessAssembly (assembly);
-
-                       EndProcess ();
-               }
-
-               protected virtual bool ConditionToProcess ()
-               {
-                       return true;
-               }
-
-               protected virtual void Process ()
-               {
-               }
-
-               protected virtual void EndProcess ()
-               {
-               }
-
-               protected virtual void ProcessAssembly (AssemblyDefinition assembly)
-               {
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/BlacklistStep.cs b/mcs/tools/linker/Mono.Linker.Steps/BlacklistStep.cs
deleted file mode 100644 (file)
index 6c6344b..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// Blacklist.cs
-//
-// Author:
-//   Jb Evain (jb@nurv.fr)
-//
-// (C) 2007 Novell 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.Linq;
-using System.IO;
-using System.Reflection;
-using System.Xml;
-using System.Xml.XPath;
-
-using Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class BlacklistStep : BaseStep {
-
-               protected override bool ConditionToProcess()
-               {
-                       return Context.CoreAction == AssemblyAction.Link;
-               }
-
-               protected override void Process ()
-               {
-                       foreach (string name in Assembly.GetExecutingAssembly ().GetManifestResourceNames ()) {
-                               if (!name.EndsWith (".xml", StringComparison.OrdinalIgnoreCase) || !IsReferenced (GetAssemblyName (name)))
-                                       continue;
-
-                               try {
-                                       if (Context.LogInternalExceptions)
-                                               Console.WriteLine ("Processing resource linker descriptor: {0}", name);
-                                       Context.Pipeline.AddStepAfter (typeof (TypeMapStep), GetResolveStep (name));
-                               } catch (XmlException ex) {
-                                       /* This could happen if some broken XML file is included. */
-                                       if (Context.LogInternalExceptions)
-                                               Console.WriteLine ("Error processing {0}: {1}", name, ex);
-                               }
-                       }
-
-                       foreach (var asm in Context.GetAssemblies ()) {
-                               foreach (var rsc in asm.Modules
-                                                                       .SelectMany (mod => mod.Resources)
-                                                                       .Where (res => res.ResourceType == ResourceType.Embedded)
-                                                                       .Where (res => res.Name.EndsWith (".xml", StringComparison.OrdinalIgnoreCase))
-                                                                       .Where (res => IsReferenced (GetAssemblyName (res.Name)))
-                                                                       .Cast<EmbeddedResource> ()) {
-                                       try {
-                                               if (Context.LogInternalExceptions)
-                                                       Console.WriteLine ("Processing embedded resource linker descriptor: {0}", rsc.Name);
-
-                                               Context.Pipeline.AddStepAfter (typeof (TypeMapStep), GetExternalResolveStep (rsc, asm));
-                                       } catch (XmlException ex) {
-                                               /* This could happen if some broken XML file is embedded. */
-                                               if (Context.LogInternalExceptions)
-                                                       Console.WriteLine ("Error processing {0}: {1}", rsc.Name, ex);
-                                       }
-                               }
-                       }
-               }
-
-               static string GetAssemblyName (string descriptor)
-               {
-                       int pos = descriptor.LastIndexOf ('.');
-                       if (pos == -1)
-                               return descriptor;
-
-                       return descriptor.Substring (0, pos);
-               }
-
-               bool IsReferenced (string name)
-               {
-                       foreach (AssemblyDefinition assembly in Context.GetAssemblies ())
-                               if (assembly.Name.Name == name)
-                                       return true;
-
-                       return false;
-               }
-
-               static ResolveFromXmlStep GetExternalResolveStep (EmbeddedResource resource, AssemblyDefinition assembly)
-               {
-                       return new ResolveFromXmlStep (GetExternalDescriptor (resource), "resource " + resource.Name + " in " + assembly.FullName);
-               }
-
-               static ResolveFromXmlStep GetResolveStep (string descriptor)
-               {
-                       return new ResolveFromXmlStep (GetDescriptor (descriptor), "descriptor " + descriptor + " from " + Assembly.GetExecutingAssembly ().FullName);
-               }
-
-               static XPathDocument GetExternalDescriptor (EmbeddedResource resource)
-               {
-                       using (var sr = new StreamReader (resource.GetResourceStream ())) {
-                               return new XPathDocument (new StringReader (sr.ReadToEnd ()));
-                       }
-               }
-
-               static XPathDocument GetDescriptor (string descriptor)
-               {
-                       using (StreamReader sr = new StreamReader (GetResource (descriptor))) {
-                               return new XPathDocument (new StringReader (sr.ReadToEnd ()));
-                       }
-               }
-
-               static Stream GetResource (string descriptor)
-               {
-                       return Assembly.GetExecutingAssembly ().GetManifestResourceStream (descriptor);
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/CleanStep.cs b/mcs/tools/linker/Mono.Linker.Steps/CleanStep.cs
deleted file mode 100644 (file)
index ccc34cb..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// CleanStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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;
-
-using Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class CleanStep : BaseStep {
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) == AssemblyAction.Link)
-                               CleanAssembly (assembly);
-               }
-
-               static void CleanAssembly (AssemblyDefinition asm)
-               {
-                       foreach (TypeDefinition type in asm.MainModule.Types)
-                               CleanType (type);
-               }
-
-               static void CleanType (TypeDefinition type)
-               {
-                       if (type.HasProperties)
-                               CleanProperties (type);
-                       if (type.HasEvents)
-                               CleanEvents (type);
-
-                       if (type.HasNestedTypes)
-                               foreach (var nested in type.NestedTypes)
-                                       CleanType (nested);
-               }
-
-               static MethodDefinition CheckMethod (TypeDefinition type, MethodDefinition method)
-               {
-                       if (method == null)
-                               return null;
-
-                       return type.Methods.Contains (method) ? method : null;
-               }
-
-               static void CleanEvents (TypeDefinition type)
-               {
-                       var events = type.Events;
-
-                       for (int i = 0; i < events.Count; i++) {
-                               var evt = events [i];
-                               evt.AddMethod = CheckMethod (type, evt.AddMethod);
-                               evt.InvokeMethod = CheckMethod (type, evt.InvokeMethod);
-                               evt.RemoveMethod = CheckMethod (type, evt.RemoveMethod);
-
-                               if (!IsEventUsed (evt))
-                                       events.RemoveAt (i--);
-                       }
-               }
-
-               static bool IsEventUsed (EventDefinition evt)
-               {
-                       return evt.AddMethod != null || evt.InvokeMethod != null || evt.RemoveMethod != null;
-               }
-
-               static void CleanProperties (TypeDefinition type)
-               {
-                       var properties = type.Properties;
-
-                       for (int i = 0; i < properties.Count; i++) {
-                               var prop = properties [i];
-                               prop.GetMethod = CheckMethod (type, prop.GetMethod);
-                               prop.SetMethod = CheckMethod (type, prop.SetMethod);
-
-                               if (!IsPropertyUsed (prop))
-                                       properties.RemoveAt (i--);
-                       }
-               }
-
-               static bool IsPropertyUsed (PropertyDefinition prop)
-               {
-                       return prop.GetMethod != null || prop.SetMethod != null;
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/IStep.cs b/mcs/tools/linker/Mono.Linker.Steps/IStep.cs
deleted file mode 100644 (file)
index c01ef1e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// IStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.
-//
-
-namespace Mono.Linker.Steps {
-
-       public interface IStep {
-               void Process (LinkContext context);
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs b/mcs/tools/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs
deleted file mode 100644 (file)
index 45ac924..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// LoadI18nAssemblies.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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 Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class LoadI18nAssemblies : BaseStep {
-
-               static readonly byte [] _pktoken = new byte [] {0x07, 0x38, 0xeb, 0x9f, 0x13, 0x2e, 0xd7, 0x56};
-
-               I18nAssemblies _assemblies;
-
-               public LoadI18nAssemblies (I18nAssemblies assemblies)
-               {
-                       _assemblies = assemblies;
-               }
-
-               protected override bool ConditionToProcess ()
-               {
-                       return _assemblies != I18nAssemblies.None &&
-                               Type.GetType ("System.MonoType") != null;
-               }
-
-               protected override void Process()
-               {
-                       LoadAssembly (GetAssemblyName (I18nAssemblies.Base));
-
-                       LoadI18nAssembly (I18nAssemblies.CJK);
-                       LoadI18nAssembly (I18nAssemblies.MidEast);
-                       LoadI18nAssembly (I18nAssemblies.Other);
-                       LoadI18nAssembly (I18nAssemblies.Rare);
-                       LoadI18nAssembly (I18nAssemblies.West);
-               }
-
-               bool ShouldCopyAssembly (I18nAssemblies current)
-               {
-                       return (current & _assemblies) != 0;
-               }
-
-               void LoadI18nAssembly (I18nAssemblies asm)
-               {
-                       if (!ShouldCopyAssembly (asm))
-                               return;
-
-                       AssemblyNameReference name = GetAssemblyName (asm);
-                       LoadAssembly (name);
-               }
-
-               void LoadAssembly (AssemblyNameReference name)
-               {
-                       AssemblyDefinition assembly = Context.Resolve (name);
-                       ResolveFromAssemblyStep.ProcessLibrary (Context, assembly);
-               }
-
-               AssemblyNameReference GetAssemblyName (I18nAssemblies assembly)
-               {
-                       AssemblyNameReference name = new AssemblyNameReference ("I18N", GetCorlibVersion ());
-                       if (assembly != I18nAssemblies.Base)
-                               name.Name += "." + assembly;
-
-                       name.PublicKeyToken = _pktoken;
-                       return name;
-               }
-
-               Version GetCorlibVersion ()
-               {
-                       foreach (AssemblyDefinition assembly in Context.GetAssemblies ())
-                               if (assembly.Name.Name == "mscorlib")
-                                       return assembly.Name.Version;
-
-                       return new Version ();
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/LoadReferencesStep.cs b/mcs/tools/linker/Mono.Linker.Steps/LoadReferencesStep.cs
deleted file mode 100644 (file)
index a55fd1d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// LoadReferencesStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Collections;
-
-using Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class LoadReferencesStep : BaseStep {
-
-               IDictionary _references = new Hashtable ();
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       ProcessReferences (assembly);
-               }
-
-               void ProcessReferences (AssemblyDefinition assembly)
-               {
-                       if (_references.Contains (assembly.Name))
-                               return;
-
-                       _references.Add (assembly.Name, assembly);
-
-                       foreach (AssemblyNameReference reference in assembly.MainModule.AssemblyReferences)
-                               ProcessReferences (Context.Resolve (reference));
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs b/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs
deleted file mode 100644 (file)
index 0c39910..0000000
+++ /dev/null
@@ -1,1152 +0,0 @@
-//
-// MarkStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-// (C) 2007 Novell, 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.Collections;
-using System.Linq;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Linker.Steps {
-
-       public class MarkStep : IStep {
-
-               protected LinkContext _context;
-               protected Queue _methods;
-               protected ArrayList _virtual_methods;
-
-               public AnnotationStore Annotations {
-                       get { return _context.Annotations; }
-               }
-
-               public MarkStep ()
-               {
-                       _methods = new Queue ();
-                       _virtual_methods = new ArrayList ();
-               }
-
-               public virtual void Process (LinkContext context)
-               {
-                       _context = context;
-
-                       Initialize ();
-                       Process ();
-               }
-
-               void Initialize ()
-               {
-                       foreach (AssemblyDefinition assembly in _context.GetAssemblies ())
-                               InitializeAssembly (assembly);
-               }
-
-               protected virtual void InitializeAssembly (AssemblyDefinition assembly)
-               {
-                       MarkAssembly (assembly);
-                       foreach (TypeDefinition type in assembly.MainModule.Types) {
-                               if (!Annotations.IsMarked (type))
-                                       continue;
-
-                               InitializeType (type);
-                       }
-               }
-
-               void InitializeType (TypeDefinition type)
-               {
-                       MarkType (type);
-
-                       if (type.HasFields)
-                               InitializeFields (type);
-                       if (type.HasMethods)
-                               InitializeMethods (type.Methods);
-
-                       if (type.HasNestedTypes) {
-                               foreach (var nested in type.NestedTypes) {
-                                       if (Annotations.IsMarked (nested))
-                                               InitializeType (nested);
-                               }
-                       }
-               }
-
-               void InitializeFields (TypeDefinition type)
-               {
-                       foreach (FieldDefinition field in type.Fields)
-                               if (Annotations.IsMarked (field))
-                                       MarkField (field);
-               }
-
-               void InitializeMethods (ICollection methods)
-               {
-                       foreach (MethodDefinition method in methods)
-                               if (Annotations.IsMarked (method))
-                                       EnqueueMethod (method);
-               }
-
-               void Process ()
-               {
-                       if (QueueIsEmpty ())
-                               throw new InvalidOperationException ("No entry methods");
-
-                       while (!QueueIsEmpty ()) {
-                               ProcessQueue ();
-                               ProcessVirtualMethods ();
-                       }
-               }
-
-               void ProcessQueue ()
-               {
-                       while (!QueueIsEmpty ()) {
-                               MethodDefinition method = (MethodDefinition) _methods.Dequeue ();
-                               Annotations.Push (method);
-                               ProcessMethod (method);
-                               Annotations.Pop ();
-                       }
-               }
-
-               bool QueueIsEmpty ()
-               {
-                       return _methods.Count == 0;
-               }
-
-               protected virtual void EnqueueMethod (MethodDefinition method)
-               {
-                       _methods.Enqueue (method);
-               }
-
-               void ProcessVirtualMethods ()
-               {
-                       foreach (MethodDefinition method in _virtual_methods) {
-                               Annotations.Push (method);
-                               ProcessVirtualMethod (method);
-                               Annotations.Pop ();
-                       }
-               }
-
-               void ProcessVirtualMethod (MethodDefinition method)
-               {
-                       IList overrides = Annotations.GetOverrides (method);
-                       if (overrides == null)
-                               return;
-
-                       foreach (MethodDefinition @override in overrides)
-                               ProcessOverride (@override);
-               }
-
-               void ProcessOverride (MethodDefinition method)
-               {
-                       if (!Annotations.IsMarked (method.DeclaringType))
-                               return;
-
-                       if (Annotations.IsProcessed (method))
-                               return;
-
-                       if (Annotations.IsMarked (method))
-                               return;
-
-                       MarkMethod (method);
-                       ProcessVirtualMethod (method);
-               }
-
-               void MarkMarshalSpec (IMarshalInfoProvider spec)
-               {
-                       if (!spec.HasMarshalInfo)
-                               return;
-
-                       var marshaler = spec.MarshalInfo as CustomMarshalInfo;
-                       if (marshaler == null)
-                               return;
-
-                       MarkType (marshaler.ManagedType);
-               }
-
-               void MarkCustomAttributes (ICustomAttributeProvider provider)
-               {
-                       if (!provider.HasCustomAttributes)
-                               return;
-
-                       foreach (CustomAttribute ca in provider.CustomAttributes)
-                               MarkCustomAttribute (ca);
-               }
-
-               protected virtual void MarkCustomAttribute (CustomAttribute ca)
-               {
-                       Annotations.Push (ca);
-                       MarkMethod (ca.Constructor);
-
-                       MarkCustomAttributeArguments (ca);
-
-                       TypeReference constructor_type = ca.Constructor.DeclaringType;
-                       TypeDefinition type = constructor_type.Resolve ();
-                       if (type == null) {
-                               Annotations.Pop ();
-                               throw new ResolutionException (constructor_type);
-                       }
-
-                       MarkCustomAttributeProperties (ca, type);
-                       MarkCustomAttributeFields (ca, type);
-                       Annotations.Pop ();
-               }
-
-               protected void MarkSecurityDeclarations (ISecurityDeclarationProvider provider)
-               {
-                       // most security declarations are removed (if linked) but user code might still have some
-                       // and if the attribtues references types then they need to be marked too
-                       if ((provider == null) || !provider.HasSecurityDeclarations)
-                               return;
-
-                       foreach (var sd in provider.SecurityDeclarations)
-                               MarkSecurityDeclaration (sd);
-               }
-
-               protected virtual void MarkSecurityDeclaration (SecurityDeclaration sd)
-               {
-                       if (!sd.HasSecurityAttributes)
-                               return;
-                       
-                       foreach (var sa in sd.SecurityAttributes)
-                               MarkSecurityAttribute (sa);
-               }
-
-               protected virtual void MarkSecurityAttribute (SecurityAttribute sa)
-               {
-                       TypeReference security_type = sa.AttributeType;
-                       TypeDefinition type = security_type.Resolve ();
-                       if (type == null)
-                               throw new ResolutionException (security_type);
-                       
-                       MarkType (security_type);
-                       MarkSecurityAttributeProperties (sa, type);
-                       MarkSecurityAttributeFields (sa, type);
-               }
-
-               protected void MarkSecurityAttributeProperties (SecurityAttribute sa, TypeDefinition attribute)
-               {
-                       if (!sa.HasProperties)
-                               return;
-
-                       foreach (var named_argument in sa.Properties)
-                               MarkCustomAttributeProperty (named_argument, attribute);
-               }
-
-               protected void MarkSecurityAttributeFields (SecurityAttribute sa, TypeDefinition attribute)
-               {
-                       if (!sa.HasFields)
-                               return;
-
-                       foreach (var named_argument in sa.Fields)
-                               MarkCustomAttributeField (named_argument, attribute);
-               }
-
-               protected void MarkCustomAttributeProperties (CustomAttribute ca, TypeDefinition attribute)
-               {
-                       if (!ca.HasProperties)
-                               return;
-
-                       foreach (var named_argument in ca.Properties)
-                               MarkCustomAttributeProperty (named_argument, attribute);
-               }
-
-               protected void MarkCustomAttributeProperty (CustomAttributeNamedArgument namedArgument, TypeDefinition attribute)
-               {
-                       PropertyDefinition property = GetProperty (attribute, namedArgument.Name);
-                       Annotations.Push (property);
-                       if (property != null)
-                               MarkMethod (property.SetMethod);
-
-                       MarkIfType (namedArgument.Argument);
-                       Annotations.Pop ();
-               }
-
-               PropertyDefinition GetProperty (TypeDefinition type, string propertyname)
-               {
-                       while (type != null) {
-                               PropertyDefinition property = type.Properties.FirstOrDefault (p => p.Name == propertyname);
-                               if (property != null)
-                                       return property;
-
-                               type = type.BaseType != null ? ResolveTypeDefinition (type.BaseType) : null;
-                       }
-
-                       return null;
-               }
-
-               protected void MarkCustomAttributeFields (CustomAttribute ca, TypeDefinition attribute)
-               {
-                       if (!ca.HasFields)
-                               return;
-
-                       foreach (var named_argument in ca.Fields)
-                               MarkCustomAttributeField (named_argument, attribute);
-               }
-
-               protected void MarkCustomAttributeField (CustomAttributeNamedArgument namedArgument, TypeDefinition attribute)
-               {
-                       FieldDefinition field = GetField (attribute, namedArgument.Name);
-                       if (field != null)
-                               MarkField (field);
-
-                       MarkIfType (namedArgument.Argument);
-               }
-
-               FieldDefinition GetField (TypeDefinition type, string fieldname)
-               {
-                       while (type != null) {
-                               FieldDefinition field = type.Fields.FirstOrDefault (f => f.Name == fieldname);
-                               if (field != null)
-                                       return field;
-
-                               type = type.BaseType != null ? ResolveTypeDefinition (type.BaseType) : null;
-                       }
-
-                       return null;
-               }
-
-               void MarkCustomAttributeArguments (CustomAttribute ca)
-               {
-                       if (!ca.HasConstructorArguments)
-                               return;
-
-                       foreach (var argument in ca.ConstructorArguments)
-                               MarkIfType (argument);
-               }
-
-               void MarkIfType (CustomAttributeArgument argument)
-               {
-                       var at = argument.Type;
-                       if (at.IsArray) {
-                               var et = at.GetElementType ();
-                               if (et.Namespace != "System" || et.Name != "Type")
-                                       return;
-
-                               MarkType (et);
-                               if (argument.Value == null)
-                                       return;
-
-                               foreach (var cac in (CustomAttributeArgument[]) argument.Value)
-                                       MarkWithResolvedScope ((TypeReference) cac.Value);
-                       } else if (at.Namespace == "System" && at.Name == "Type") {
-                               MarkType (argument.Type);
-                               MarkWithResolvedScope ((TypeReference) argument.Value);
-                       }
-               }
-
-               // custom attributes encoding means it's possible to have a scope that will point into a PCL facade
-               // even if we (just before saving) will resolve all type references (bug #26752)
-               void MarkWithResolvedScope (TypeReference type)
-               {
-                       if (type == null)
-                               return;
-
-                       // a GenericInstanceType can could contains generic arguments with scope that
-                       // needs to be updated out of the PCL facade (bug #28823)
-                       var git = (type as GenericInstanceType);
-                       if ((git != null) && git.HasGenericArguments) {
-                               foreach (var ga in git.GenericArguments)
-                                       MarkWithResolvedScope (ga);
-                       }
-                       // we cannot set the Scope of a TypeSpecification but it's element type can be set
-                       // e.g. System.String[] -> System.String
-                       var ts = (type as TypeSpecification);
-                       if (ts != null) {
-                               MarkWithResolvedScope (ts.GetElementType ());
-                               return;
-                       }
-
-                       var td = type.Resolve ();
-                       if (td != null)
-                               type.Scope = td.Scope;
-                       MarkType (type);
-               }
-
-               protected bool CheckProcessed (IMetadataTokenProvider provider)
-               {
-                       if (Annotations.IsProcessed (provider))
-                               return true;
-
-                       Annotations.Processed (provider);
-                       return false;
-               }
-
-               protected void MarkAssembly (AssemblyDefinition assembly)
-               {
-                       if (CheckProcessed (assembly))
-                               return;
-
-                       ProcessModule (assembly);
-
-                       MarkCustomAttributes (assembly);
-                       MarkSecurityDeclarations (assembly);
-
-                       foreach (ModuleDefinition module in assembly.Modules)
-                               MarkCustomAttributes (module);
-               }
-
-               void ProcessModule (AssemblyDefinition assembly)
-               {
-                       // Pre-mark <Module> if there is any methods as they need to be executed 
-                       // at assembly load time
-                       foreach (TypeDefinition type in assembly.MainModule.Types)
-                       {
-                               if (type.Name == "<Module>" && type.HasMethods)
-                               {
-                                       MarkType (type);
-                                       break;
-                               }
-                       }
-               }
-
-               protected void MarkField (FieldReference reference)
-               {
-//                     if (IgnoreScope (reference.DeclaringType.Scope))
-//                             return;
-
-                       if (reference.DeclaringType is GenericInstanceType)
-                               MarkType (reference.DeclaringType);
-
-                       FieldDefinition field = ResolveFieldDefinition (reference);
-
-                       if (field == null)
-                               throw new ResolutionException (reference);
-
-                       if (CheckProcessed (field))
-                               return;
-
-                       MarkType (field.DeclaringType);
-                       MarkType (field.FieldType);
-                       MarkCustomAttributes (field);
-                       MarkMarshalSpec (field);
-
-                       Annotations.Mark (field);
-               }
-
-               protected virtual bool IgnoreScope (IMetadataScope scope)
-               {
-                       AssemblyDefinition assembly = ResolveAssembly (scope);
-                       return Annotations.GetAction (assembly) != AssemblyAction.Link;
-               }
-
-               FieldDefinition ResolveFieldDefinition (FieldReference field)
-               {
-                       FieldDefinition fd = field as FieldDefinition;
-                       if (fd == null)
-                               fd = field.Resolve ();
-
-                       return fd;
-               }
-
-               void MarkScope (IMetadataScope scope)
-               {
-                       var provider = scope as IMetadataTokenProvider;
-                       if (provider == null)
-                               return;
-
-                       Annotations.Mark (provider);
-               }
-
-               protected virtual void MarkSerializable (TypeDefinition type)
-               {
-                       MarkDefaultConstructor (type);
-                       MarkMethodsIf (type.Methods, IsSpecialSerializationConstructorPredicate);
-               }
-
-               protected virtual TypeDefinition MarkType (TypeReference reference)
-               {
-                       if (reference == null)
-                               return null;
-
-                       reference = GetOriginalType (reference);
-
-                       if (reference is GenericParameter)
-                               return null;
-
-//                     if (IgnoreScope (reference.Scope))
-//                             return;
-
-                       TypeDefinition type = ResolveTypeDefinition (reference);
-
-                       if (type == null)
-                               throw new ResolutionException (reference);
-
-                       if (CheckProcessed (type))
-                               return null;
-
-                       Annotations.Push (type);
-
-                       MarkScope (type.Scope);
-                       MarkType (type.BaseType);
-                       MarkType (type.DeclaringType);
-                       MarkCustomAttributes (type);
-                       MarkSecurityDeclarations (type);
-
-                       if (IsMulticastDelegate (type)) {
-                               MarkMethodCollection (type.Methods);
-                       }
-
-                       if (IsSerializable (type))
-                               MarkSerializable (type);
-
-                       MarkTypeSpecialCustomAttributes (type);
-
-                       MarkGenericParameterProvider (type);
-
-                       // keep fields for value-types and for classes with LayoutKind.Sequential or Explicit
-                       if (type.IsValueType || !type.IsAutoLayout)
-                               MarkFields (type, type.IsEnum);
-
-                       if (type.HasInterfaces) {
-                               foreach (var iface in type.Interfaces)
-                                       MarkType (iface.InterfaceType);
-                       }
-
-                       if (type.HasMethods) {
-                               MarkMethodsIf (type.Methods, IsVirtualAndHasPreservedParent);
-                               MarkMethodsIf (type.Methods, IsStaticConstructorPredicate);
-                               MarkMethodsIf (type.Methods, HasSerializationAttribute);
-                       }
-
-                       DoAdditionalTypeProcessing (type);
-
-                       Annotations.Pop ();
-
-                       Annotations.Mark (type);
-
-                       ApplyPreserveInfo (type);
-
-                       return type;
-               }
-
-               // Allow subclassers to mark additional things when marking a method
-               protected virtual void DoAdditionalTypeProcessing (TypeDefinition method)
-               {
-               }
-
-               void MarkTypeSpecialCustomAttributes (TypeDefinition type)
-               {
-                       if (!type.HasCustomAttributes)
-                               return;
-
-                       foreach (CustomAttribute attribute in type.CustomAttributes) {
-                               switch (attribute.Constructor.DeclaringType.FullName) {
-                               case "System.Xml.Serialization.XmlSchemaProviderAttribute":
-                                       MarkXmlSchemaProvider (type, attribute);
-                                       break;
-                               }
-                       }
-               }
-
-               void MarkMethodSpecialCustomAttributes (MethodDefinition method)
-               {
-                       if (!method.HasCustomAttributes)
-                               return;
-
-                       foreach (CustomAttribute attribute in method.CustomAttributes) {
-                               switch (attribute.Constructor.DeclaringType.FullName) {
-                               case "System.Web.Services.Protocols.SoapHeaderAttribute":
-                                       MarkSoapHeader (method, attribute);
-                                       break;
-                               }
-                       }
-               }
-
-               void MarkXmlSchemaProvider (TypeDefinition type, CustomAttribute attribute)
-               {
-                       string method_name;
-                       if (!TryGetStringArgument (attribute, out method_name))
-                               return;
-
-                       MarkNamedMethod (type, method_name);
-               }
-
-               static bool TryGetStringArgument (CustomAttribute attribute, out string argument)
-               {
-                       argument = null;
-
-                       if (attribute.ConstructorArguments.Count < 1)
-                               return false;
-
-                       argument = attribute.ConstructorArguments [0].Value as string;
-
-                       return argument != null;
-               }
-
-               protected int MarkNamedMethod (TypeDefinition type, string method_name)
-               {
-                       if (!type.HasMethods)
-                               return 0;
-
-                       int count = 0;
-                       foreach (MethodDefinition method in type.Methods) {
-                               if (method.Name != method_name)
-                                       continue;
-
-                               MarkMethod (method);
-                               count++;
-                       }
-
-                       return count;
-               }
-
-               void MarkSoapHeader (MethodDefinition method, CustomAttribute attribute)
-               {
-                       string member_name;
-                       if (!TryGetStringArgument (attribute, out member_name))
-                               return;
-
-                       MarkNamedField (method.DeclaringType, member_name);
-                       MarkNamedProperty (method.DeclaringType, member_name);
-               }
-
-               void MarkNamedField (TypeDefinition type, string field_name)
-               {
-                       if (!type.HasFields)
-                               return;
-
-                       foreach (FieldDefinition field in type.Fields) {
-                               if (field.Name != field_name)
-                                       continue;
-
-                               MarkField (field);
-                       }
-               }
-
-               void MarkNamedProperty (TypeDefinition type, string property_name)
-               {
-                       if (!type.HasProperties)
-                               return;
-
-                       foreach (PropertyDefinition property in type.Properties) {
-                               if (property.Name != property_name)
-                                       continue;
-
-                               Annotations.Push (property);
-                               MarkMethod (property.GetMethod);
-                               MarkMethod (property.SetMethod);
-                               Annotations.Pop ();
-                       }
-               }
-
-               void MarkGenericParameterProvider (IGenericParameterProvider provider)
-               {
-                       if (!provider.HasGenericParameters)
-                               return;
-
-                       foreach (GenericParameter parameter in provider.GenericParameters)
-                               MarkGenericParameter (parameter);
-               }
-
-               void MarkGenericParameter (GenericParameter parameter)
-               {
-                       MarkCustomAttributes (parameter);
-                       foreach (TypeReference constraint in parameter.Constraints)
-                               MarkType (constraint);
-               }
-
-               bool IsVirtualAndHasPreservedParent (MethodDefinition method)
-               {
-                       if (!method.IsVirtual)
-                               return false;
-
-                       var base_list = Annotations.GetBaseMethods (method);
-                       if (base_list == null)
-                               return false;
-
-                       foreach (MethodDefinition @base in base_list) {
-                               if (IgnoreScope (@base.DeclaringType.Scope))
-                                       return true;
-
-                               if (IsVirtualAndHasPreservedParent (@base))
-                                       return true;
-                       }
-
-                       return false;
-               }
-
-               static MethodPredicate IsSpecialSerializationConstructorPredicate = new MethodPredicate (IsSpecialSerializationConstructor);
-
-               static bool IsSpecialSerializationConstructor (MethodDefinition method)
-               {
-                       if (!IsConstructor (method))
-                               return false;
-
-                       var parameters = method.Parameters;
-                       if (parameters.Count != 2)
-                               return false;
-
-                       return parameters [0].ParameterType.Name == "SerializationInfo" &&
-                               parameters [1].ParameterType.Name == "StreamingContext";
-               }
-
-               delegate bool MethodPredicate (MethodDefinition method);
-
-               void MarkMethodsIf (ICollection methods, MethodPredicate predicate)
-               {
-                       foreach (MethodDefinition method in methods)
-                               if (predicate (method)) {
-                                       Annotations.Push (predicate);
-                                       MarkMethod (method);
-                                       Annotations.Pop ();
-                               }
-               }
-
-               static MethodPredicate IsDefaultConstructorPredicate = new MethodPredicate (IsDefaultConstructor);
-
-               static bool IsDefaultConstructor (MethodDefinition method)
-               {
-                       return IsConstructor (method) && !method.HasParameters;
-               }
-
-               static bool IsConstructor (MethodDefinition method)
-               {
-                       return method.IsConstructor && !method.IsStatic;
-               }
-
-               protected void MarkDefaultConstructor (TypeDefinition type)
-               {
-                       if ((type == null) || !type.HasMethods)
-                               return;
-
-                       MarkMethodsIf (type.Methods, IsDefaultConstructorPredicate);
-               }
-
-               static MethodPredicate IsStaticConstructorPredicate = new MethodPredicate (IsStaticConstructor);
-
-               static bool IsStaticConstructor (MethodDefinition method)
-               {
-                       return method.IsConstructor && method.IsStatic;
-               }
-
-               static bool HasSerializationAttribute (MethodDefinition method)
-               {
-                       if (!method.HasCustomAttributes)
-                               return false;
-                       foreach (var ca in method.CustomAttributes) {
-                               var cat = ca.AttributeType;
-                               if (cat.Namespace != "System.Runtime.Serialization")
-                                       continue;
-                               switch (cat.Name) {
-                               case "OnDeserializedAttribute":
-                               case "OnDeserializingAttribute":
-                               case "OnSerializedAttribute":
-                               case "OnSerializingAttribute":
-                                       return true;
-                               }
-                       }
-                       return false;
-               }
-
-               static bool IsSerializable (TypeDefinition td)
-               {
-                       return (td.Attributes & TypeAttributes.Serializable) != 0;
-               }
-
-               static bool IsMulticastDelegate (TypeDefinition td)
-               {
-                       return td.BaseType != null && td.BaseType.FullName == "System.MulticastDelegate";
-               }
-
-               protected TypeDefinition ResolveTypeDefinition (TypeReference type)
-               {
-                       TypeDefinition td = type as TypeDefinition;
-                       if (td == null)
-                               td = type.Resolve ();
-
-                       return td;
-               }
-
-               protected TypeReference GetOriginalType (TypeReference type)
-               {
-                       while (type is TypeSpecification) {
-                               GenericInstanceType git = type as GenericInstanceType;
-                               if (git != null)
-                                       MarkGenericArguments (git);
-
-                               var mod = type as IModifierType;
-                               if (mod != null)
-                                       MarkModifierType (mod);
-
-                               type = ((TypeSpecification) type).ElementType;
-                       }
-
-                       return type;
-               }
-
-               void MarkModifierType (IModifierType mod)
-               {
-                       MarkType (mod.ModifierType);
-               }
-
-               void MarkGenericArguments (IGenericInstance instance)
-               {
-                       foreach (TypeReference argument in instance.GenericArguments)
-                               MarkType (argument);
-
-                       MarkGenericArgumentConstructors (instance);
-               }
-
-               void MarkGenericArgumentConstructors (IGenericInstance instance)
-               {
-                       var arguments = instance.GenericArguments;
-
-                       var generic_element = GetGenericProviderFromInstance (instance);
-                       if (generic_element == null)
-                               return;
-
-                       var parameters = generic_element.GenericParameters;
-
-                       if (arguments.Count != parameters.Count)
-                               return;
-
-                       for (int i = 0; i < arguments.Count; i++) {
-                               var argument = arguments [i];
-                               var parameter = parameters [i];
-
-                               if (!parameter.HasDefaultConstructorConstraint)
-                                       continue;
-
-                               var argument_definition = ResolveTypeDefinition (argument);
-                               if (argument_definition == null)
-                                       continue;
-
-                               MarkMethodsIf (argument_definition.Methods, ctor => !ctor.IsStatic && !ctor.HasParameters);
-                       }
-               }
-
-               IGenericParameterProvider GetGenericProviderFromInstance (IGenericInstance instance)
-               {
-                       var method = instance as GenericInstanceMethod;
-                       if (method != null)
-                               return ResolveMethodDefinition (method.ElementMethod);
-
-                       var type = instance as GenericInstanceType;
-                       if (type != null)
-                               return ResolveTypeDefinition (type.ElementType);
-
-                       return null;
-               }
-
-               void ApplyPreserveInfo (TypeDefinition type)
-               {
-                       ApplyPreserveMethods (type);
-
-                       if (!Annotations.IsPreserved (type))
-                               return;
-
-                       switch (Annotations.GetPreserve (type)) {
-                       case TypePreserve.All:
-                               MarkFields (type, true);
-                               MarkMethods (type);
-                               break;
-                       case TypePreserve.Fields:
-                               MarkFields (type, true);
-                               break;
-                       case TypePreserve.Methods:
-                               MarkMethods (type);
-                               break;
-                       }
-               }
-
-               void ApplyPreserveMethods (TypeDefinition type)
-               {
-                       var list = Annotations.GetPreservedMethods (type);
-                       if (list == null)
-                               return;
-
-                       MarkMethodCollection (list);
-               }
-
-               void ApplyPreserveMethods (MethodDefinition method)
-               {
-                       var list = Annotations.GetPreservedMethods (method);
-                       if (list == null)
-                               return;
-
-                       MarkMethodCollection (list);
-               }
-
-               protected void MarkFields (TypeDefinition type, bool includeStatic)
-               {
-                       if (!type.HasFields)
-                               return;
-
-                       foreach (FieldDefinition field in type.Fields) {
-                               if (!includeStatic && field.IsStatic)
-                                       continue;
-                               MarkField (field);
-                       }
-               }
-
-               protected virtual void MarkMethods (TypeDefinition type)
-               {
-                       if (type.HasMethods)
-                               MarkMethodCollection (type.Methods);
-               }
-
-               void MarkMethodCollection (IEnumerable methods)
-               {
-                       foreach (MethodDefinition method in methods)
-                               MarkMethod (method);
-               }
-
-               protected virtual MethodDefinition MarkMethod (MethodReference reference)
-               {
-                       reference = GetOriginalMethod (reference);
-
-                       if (reference.DeclaringType is ArrayType)
-                               return null;
-
-                       Annotations.Push (reference);
-                       if (reference.DeclaringType is GenericInstanceType)
-                               MarkType (reference.DeclaringType);
-
-//                     if (IgnoreScope (reference.DeclaringType.Scope))
-//                             return;
-
-                       MethodDefinition method = ResolveMethodDefinition (reference);
-
-                       if (method == null) {
-                               Annotations.Pop ();
-                               throw new ResolutionException (reference);
-                       }
-
-                       if (Annotations.GetAction (method) == MethodAction.Nothing)
-                               Annotations.SetAction (method, MethodAction.Parse);
-
-                       EnqueueMethod (method);
-
-                       Annotations.Pop ();
-                       Annotations.AddDependency (method);
-
-                       return method;
-               }
-
-               AssemblyDefinition ResolveAssembly (IMetadataScope scope)
-               {
-                       AssemblyDefinition assembly = _context.Resolve (scope);
-                       MarkAssembly (assembly);
-                       return assembly;
-               }
-
-               protected MethodReference GetOriginalMethod (MethodReference method)
-               {
-                       while (method is MethodSpecification) {
-                               GenericInstanceMethod gim = method as GenericInstanceMethod;
-                               if (gim != null)
-                                       MarkGenericArguments (gim);
-
-                               method = ((MethodSpecification) method).ElementMethod;
-                       }
-
-                       return method;
-               }
-
-               MethodDefinition ResolveMethodDefinition (MethodReference method)
-               {
-                       MethodDefinition md = method as MethodDefinition;
-                       if (md == null)
-                               md = method.Resolve ();
-
-                       return md;
-               }
-
-               protected virtual void ProcessMethod (MethodDefinition method)
-               {
-                       if (CheckProcessed (method))
-                               return;
-
-                       Annotations.Push (method);
-                       MarkType (method.DeclaringType);
-                       MarkCustomAttributes (method);
-                       MarkSecurityDeclarations (method);
-
-                       MarkGenericParameterProvider (method);
-
-                       if (IsPropertyMethod (method))
-                               MarkProperty (GetProperty (method));
-                       else if (IsEventMethod (method))
-                               MarkEvent (GetEvent (method));
-
-                       if (method.HasParameters) {
-                               foreach (ParameterDefinition pd in method.Parameters) {
-                                       MarkType (pd.ParameterType);
-                                       MarkCustomAttributes (pd);
-                                       MarkMarshalSpec (pd);
-                               }
-                       }
-
-                       if (method.HasOverrides) {
-                               foreach (MethodReference ov in method.Overrides)
-                                       MarkMethod (ov);
-                       }
-
-                       MarkMethodSpecialCustomAttributes (method);
-
-                       if (method.IsVirtual)
-                               _virtual_methods.Add (method);
-
-                       MarkBaseMethods (method);
-
-                       MarkType (method.ReturnType);
-                       MarkCustomAttributes (method.MethodReturnType);
-                       MarkMarshalSpec (method.MethodReturnType);
-
-                       if (ShouldParseMethodBody (method))
-                               MarkMethodBody (method.Body);
-
-                       DoAdditionalMethodProcessing (method);
-
-                       Annotations.Mark (method);
-
-                       ApplyPreserveMethods (method);
-                       Annotations.Pop ();
-               }
-
-               // Allow subclassers to mark additional things when marking a method
-               protected virtual void DoAdditionalMethodProcessing (MethodDefinition method)
-               {
-               }
-
-               void MarkBaseMethods (MethodDefinition method)
-               {
-                       IList base_methods = Annotations.GetBaseMethods (method);
-                       if (base_methods == null)
-                               return;
-
-                       foreach (MethodDefinition base_method in base_methods) {
-                               if (base_method.DeclaringType.IsInterface && !method.DeclaringType.IsInterface)
-                                       continue;
-
-                               MarkMethod (base_method);
-                               MarkBaseMethods (base_method);
-                       }
-               }
-
-               bool ShouldParseMethodBody (MethodDefinition method)
-               {
-                       if (!method.HasBody)
-                               return false;
-
-                       AssemblyDefinition assembly = ResolveAssembly (method.DeclaringType.Scope);
-                       return (Annotations.GetAction (method) == MethodAction.ForceParse ||
-                               (Annotations.GetAction (assembly) == AssemblyAction.Link && Annotations.GetAction (method) == MethodAction.Parse));
-               }
-
-               static internal bool IsPropertyMethod (MethodDefinition md)
-               {
-                       return (md.SemanticsAttributes & MethodSemanticsAttributes.Getter) != 0 ||
-                               (md.SemanticsAttributes & MethodSemanticsAttributes.Setter) != 0;
-               }
-
-               static bool IsEventMethod (MethodDefinition md)
-               {
-                       return (md.SemanticsAttributes & MethodSemanticsAttributes.AddOn) != 0 ||
-                               (md.SemanticsAttributes & MethodSemanticsAttributes.Fire) != 0 ||
-                               (md.SemanticsAttributes & MethodSemanticsAttributes.RemoveOn) != 0;
-               }
-
-               static internal PropertyDefinition GetProperty (MethodDefinition md)
-               {
-                       TypeDefinition declaringType = (TypeDefinition) md.DeclaringType;
-                       foreach (PropertyDefinition prop in declaringType.Properties)
-                               if (prop.GetMethod == md || prop.SetMethod == md)
-                                       return prop;
-
-                       return null;
-               }
-
-               static EventDefinition GetEvent (MethodDefinition md)
-               {
-                       TypeDefinition declaringType = (TypeDefinition) md.DeclaringType;
-                       foreach (EventDefinition evt in declaringType.Events)
-                               if (evt.AddMethod == md || evt.InvokeMethod == md || evt.RemoveMethod == md)
-                                       return evt;
-
-                       return null;
-               }
-
-               protected void MarkProperty (PropertyDefinition prop)
-               {
-                       MarkCustomAttributes (prop);
-               }
-
-               protected void MarkEvent (EventDefinition evt)
-               {
-                       MarkCustomAttributes (evt);
-                       MarkMethodIfNotNull (evt.AddMethod);
-                       MarkMethodIfNotNull (evt.InvokeMethod);
-                       MarkMethodIfNotNull (evt.RemoveMethod);
-               }
-
-               void MarkMethodIfNotNull (MethodReference method)
-               {
-                       if (method == null)
-                               return;
-
-                       MarkMethod (method);
-               }
-
-               protected virtual void MarkMethodBody (MethodBody body)
-               {
-                       foreach (VariableDefinition var in body.Variables)
-                               MarkType (var.VariableType);
-
-                       foreach (ExceptionHandler eh in body.ExceptionHandlers)
-                               if (eh.HandlerType == ExceptionHandlerType.Catch)
-                                       MarkType (eh.CatchType);
-
-                       foreach (Instruction instruction in body.Instructions)
-                               MarkInstruction (instruction);
-               }
-
-               protected virtual void MarkInstruction (Instruction instruction)
-               {
-                       switch (instruction.OpCode.OperandType) {
-                       case OperandType.InlineField:
-                               MarkField ((FieldReference) instruction.Operand);
-                               break;
-                       case OperandType.InlineMethod:
-                               MarkMethod ((MethodReference) instruction.Operand);
-                               break;
-                       case OperandType.InlineTok:
-                               object token = instruction.Operand;
-                               if (token is TypeReference)
-                                       MarkType ((TypeReference) token);
-                               else if (token is MethodReference)
-                                       MarkMethod ((MethodReference) token);
-                               else
-                                       MarkField ((FieldReference) token);
-                               break;
-                       case OperandType.InlineType:
-                               MarkType ((TypeReference) instruction.Operand);
-                               break;
-                       default:
-                               break;
-                       }
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/OutputStep.cs b/mcs/tools/linker/Mono.Linker.Steps/OutputStep.cs
deleted file mode 100644 (file)
index 0ae94de..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// OutputStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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 Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Linker.Steps {
-
-       public class OutputStep : BaseStep {
-
-               protected override void Process ()
-               {
-                       CheckOutputDirectory ();
-                       Annotations.SaveDependencies ();
-               }
-
-               void CheckOutputDirectory ()
-               {
-                       if (Directory.Exists (Context.OutputDirectory))
-                               return;
-
-                       Directory.CreateDirectory (Context.OutputDirectory);
-               }
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       OutputAssembly (assembly);
-               }
-
-               void OutputAssembly (AssemblyDefinition assembly)
-               {
-                       string directory = Context.OutputDirectory;
-
-                       CopyConfigFileIfNeeded (assembly, directory);
-
-                       switch (Annotations.GetAction (assembly)) {
-                       case AssemblyAction.Save:
-                       case AssemblyAction.Link:
-                               Context.Annotations.AddDependency (assembly);
-                               assembly.Write (GetAssemblyFileName (assembly, directory), SaveSymbols (assembly));
-                               break;
-                       case AssemblyAction.Copy:
-                               Context.Annotations.AddDependency (assembly);
-                               CloseSymbols (assembly);
-                               CopyAssembly (GetOriginalAssemblyFileInfo (assembly), directory, Context.LinkSymbols);
-                               break;
-                       case AssemblyAction.Delete:
-                               CloseSymbols (assembly);
-                               var target = GetAssemblyFileName (assembly, directory);
-                               if (File.Exists (target)) {
-                                       File.Delete (target);
-                                       File.Delete (target + ".mdb");
-                                       File.Delete (GetConfigFile (target));
-                               }
-                               break;
-                       default:
-                               CloseSymbols (assembly);
-                               break;
-                       }
-               }
-
-               void CloseSymbols (AssemblyDefinition assembly)
-               {
-                       Annotations.CloseSymbolReader (assembly);
-               }
-
-               WriterParameters SaveSymbols (AssemblyDefinition assembly)
-               {
-                       var parameters = new WriterParameters ();
-                       if (!Context.LinkSymbols)
-                               return parameters;
-
-                       if (!assembly.MainModule.HasSymbols)
-                               return parameters;
-
-                       if (Context.SymbolWriterProvider != null)
-                               parameters.SymbolWriterProvider = Context.SymbolWriterProvider;
-                       else
-                               parameters.WriteSymbols = true;
-                       return parameters;
-               }
-
-               static void CopyConfigFileIfNeeded (AssemblyDefinition assembly, string directory)
-               {
-                       string config = GetConfigFile (GetOriginalAssemblyFileInfo (assembly).FullName);
-                       if (!File.Exists (config))
-                               return;
-
-                       string target = Path.GetFullPath (GetConfigFile (GetAssemblyFileName (assembly, directory)));
-
-                       if (config == target)
-                               return;
-
-                       File.Copy (config, GetConfigFile (GetAssemblyFileName (assembly, directory)), true);
-               }
-
-               static string GetConfigFile (string assembly)
-               {
-                       return assembly + ".config";
-               }
-
-               static FileInfo GetOriginalAssemblyFileInfo (AssemblyDefinition assembly)
-               {
-                       return new FileInfo (assembly.MainModule.FileName);
-               }
-
-               static void CopyAssembly (FileInfo fi, string directory, bool symbols)
-               {
-                       string target = Path.GetFullPath (Path.Combine (directory, fi.Name));
-                       string source = fi.FullName;
-                       if (source == target)
-                               return;
-
-                       File.Copy (source, target, true);
-
-                       if (!symbols)
-                               return;
-
-                       source += ".mdb";
-                       if (!File.Exists (source))
-                               return;
-                       File.Copy (source, target + ".mdb", true);
-               }
-
-               static string GetAssemblyFileName (AssemblyDefinition assembly, string directory)
-               {
-                       string file = assembly.Name.Name + (assembly.MainModule.Kind == ModuleKind.Dll ? ".dll" : ".exe");
-                       return Path.Combine (directory, file);
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/RegenerateGuidStep.cs b/mcs/tools/linker/Mono.Linker.Steps/RegenerateGuidStep.cs
deleted file mode 100644 (file)
index 6b2558e..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// CleanStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2008 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;
-
-using Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class RegenerateGuidStep : BaseStep {
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) == AssemblyAction.Link)
-                               RegenerateGuid (assembly);
-               }
-
-               static void RegenerateGuid (AssemblyDefinition asm)
-               {
-                       asm.MainModule.Mvid = Guid.NewGuid ();
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs
deleted file mode 100644 (file)
index 6219bc9..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// ResolveFromAssemblyStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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;
-using Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class ResolveFromAssemblyStep : ResolveStep {
-
-               AssemblyDefinition _assembly;
-               string _file;
-
-               public ResolveFromAssemblyStep (string assembly)
-               {
-                       _file = assembly;
-               }
-
-               public ResolveFromAssemblyStep (AssemblyDefinition assembly)
-               {
-                       _assembly = assembly;
-               }
-
-               protected override void Process ()
-               {
-                       if (_assembly != null)
-                               Context.Resolver.CacheAssembly (_assembly);
-
-                       AssemblyDefinition assembly = _assembly ?? Context.Resolve (_file);
-
-                       switch (assembly.MainModule.Kind) {
-                       case ModuleKind.Dll:
-                               ProcessLibrary (Context, assembly);
-                               break;
-                       default:
-                               ProcessExecutable (assembly);
-                               break;
-                       }
-               }
-
-               static void SetAction (LinkContext context, AssemblyDefinition assembly, AssemblyAction action)
-               {
-                       TryReadSymbols (context, assembly);
-
-                       context.Annotations.SetAction (assembly, action);
-               }
-
-               static void TryReadSymbols (LinkContext context, AssemblyDefinition assembly)
-               {
-                       context.SafeReadSymbols (assembly);
-               }
-
-               public static void ProcessLibrary (LinkContext context, AssemblyDefinition assembly)
-               {
-                       SetAction (context, assembly, AssemblyAction.Copy);
-
-                       context.Annotations.Push (assembly);
-
-                       foreach (TypeDefinition type in assembly.MainModule.Types)
-                               MarkType (context, type);
-
-                       context.Annotations.Pop ();
-               }
-
-               static void MarkType (LinkContext context, TypeDefinition type)
-               {
-                       context.Annotations.Mark (type);
-
-                       context.Annotations.Push (type);
-
-                       if (type.HasFields)
-                               MarkFields (context, type.Fields);
-                       if (type.HasMethods)
-                               MarkMethods (context, type.Methods);
-                       if (type.HasNestedTypes)
-                               foreach (var nested in type.NestedTypes)
-                                       MarkType (context, nested);
-
-                       context.Annotations.Pop ();
-               }
-
-               void ProcessExecutable (AssemblyDefinition assembly)
-               {
-                       SetAction (Context, assembly, AssemblyAction.Link);
-
-                       Annotations.Push (assembly);
-
-                       Annotations.Mark (assembly.EntryPoint.DeclaringType);
-                       MarkMethod (Context, assembly.EntryPoint, MethodAction.Parse);
-
-                       Annotations.Pop ();
-               }
-
-               static void MarkFields (LinkContext context, ICollection fields)
-               {
-                       foreach (FieldDefinition field in fields)
-                               context.Annotations.Mark (field);
-               }
-
-               static void MarkMethods (LinkContext context, ICollection methods)
-               {
-                       foreach (MethodDefinition method in methods)
-                               MarkMethod (context, method, MethodAction.ForceParse);
-               }
-
-               static void MarkMethod (LinkContext context, MethodDefinition method, MethodAction action)
-               {
-                       context.Annotations.Mark (method);
-                       context.Annotations.SetAction (method, action);
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs
deleted file mode 100644 (file)
index c4ce86d..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// ResolveFromXApiStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Xml.XPath;
-
-using Mono.Linker;
-
-using Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class ResolveFromXApiStep : ResolveStep, IXApiVisitor {
-
-               static readonly string _name = "name";
-               static readonly string _ns = string.Empty;
-
-               XPathDocument _document;
-
-               public ResolveFromXApiStep (XPathDocument document)
-               {
-                       _document = document;
-               }
-
-               protected override void Process ()
-               {
-                       XApiReader reader = new XApiReader (_document, this);
-                       reader.Process (Context);
-               }
-
-               public void OnAssembly (XPathNavigator nav, AssemblyDefinition assembly)
-               {
-               }
-
-               public void OnAttribute (XPathNavigator nav)
-               {
-                       string name = GetName (nav);
-
-                       TypeDefinition type = Context.GetType (name);
-                       if (type != null)
-                               MarkType (type);
-               }
-
-               public void OnClass (XPathNavigator nav, TypeDefinition type)
-               {
-                       MarkType (type);
-               }
-
-               public void OnInterface (XPathNavigator nav, TypeDefinition type)
-               {
-                       MarkType (type);
-               }
-
-               public void OnField (XPathNavigator nav, FieldDefinition field)
-               {
-                       MarkField (field);
-               }
-
-               public void OnMethod (XPathNavigator nav, MethodDefinition method)
-               {
-                       MarkMethod (method);
-               }
-
-               public void OnConstructor (XPathNavigator nav, MethodDefinition method)
-               {
-                       MarkMethod (method);
-               }
-
-               public void OnProperty (XPathNavigator nav, PropertyDefinition property)
-               {
-               }
-
-               public void OnEvent (XPathNavigator nav, EventDefinition evt)
-               {
-                       if (evt.AddMethod != null)
-                               MarkMethod (evt.AddMethod);
-                       if (evt.InvokeMethod != null)
-                               MarkMethod (evt.InvokeMethod);
-                       if (evt.RemoveMethod != null)
-                               MarkMethod (evt.RemoveMethod);
-               }
-
-               static string GetName (XPathNavigator nav)
-               {
-                       return GetAttribute (nav, _name);
-               }
-
-               static string GetAttribute (XPathNavigator nav, string attribute)
-               {
-                       return nav.GetAttribute (attribute, _ns);
-               }
-
-               void MarkType (TypeDefinition type)
-               {
-                       InternalMark (type);
-               }
-
-               void MarkField (FieldDefinition field)
-               {
-                       InternalMark (field);
-               }
-
-               void InternalMark (IMetadataTokenProvider provider)
-               {
-                       Annotations.Mark (provider);
-                       Annotations.SetPublic (provider);
-               }
-
-               void MarkMethod (MethodDefinition method)
-               {
-                       InternalMark (method);
-                       Annotations.SetAction (method, MethodAction.Parse);
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs
deleted file mode 100644 (file)
index aa4f6af..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-//
-// ResolveFromXmlStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-// (C) 2007 Novell, Inc.
-// Copyright 2013 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 SR = System.Reflection;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Xml.XPath;
-
-using Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class XmlResolutionException : Exception {
-               public XmlResolutionException (string message, Exception innerException)
-                       : base (message, innerException)
-               {
-               }
-       }
-
-       public class ResolveFromXmlStep : ResolveStep {
-
-               static readonly string _signature = "signature";
-               static readonly string _fullname = "fullname";
-               static readonly string _required = "required";
-               static readonly string _preserve = "preserve";
-               static readonly string _ns = string.Empty;
-
-               XPathDocument _document;
-               string _xmlDocumentLocation;
-
-               public ResolveFromXmlStep (XPathDocument document, string xmlDocumentLocation = "<unspecified>")
-               {
-                       _document = document;
-                       _xmlDocumentLocation = xmlDocumentLocation;
-               }
-
-               protected override void Process ()
-               {
-                       XPathNavigator nav = _document.CreateNavigator ();
-                       nav.MoveToFirstChild ();
-
-                       // This step can be created with XML files that aren't necessarily
-                       // linker descriptor files. So bail if we don't have a <linker> element.
-                       if (nav.LocalName != "linker")
-                               return;
-
-                       try {
-                               ProcessAssemblies (Context, nav.SelectChildren ("assembly", _ns));
-                       } catch (Exception ex) {
-                               throw new XmlResolutionException (string.Format ("Failed to process XML description: {0}", _xmlDocumentLocation), ex);
-                       }
-               }
-
-               void ProcessAssemblies (LinkContext context, XPathNodeIterator iterator)
-               {
-                       while (iterator.MoveNext ()) {
-                               AssemblyDefinition assembly = GetAssembly (context, GetFullName (iterator.Current));
-                               ProcessTypes (assembly, iterator.Current.SelectChildren ("type", _ns));
-                               ProcessNamespaces (assembly, iterator.Current.SelectChildren ("namespace", _ns));
-                       }
-               }
-
-               void ProcessNamespaces (AssemblyDefinition assembly, XPathNodeIterator iterator)
-               {
-                       while (iterator.MoveNext ()) {
-                               string fullname = GetFullName (iterator.Current);
-                               foreach (TypeDefinition type in assembly.MainModule.Types) {
-                                       if (type.Namespace != fullname)
-                                               continue;
-
-                                       MarkAndPreserveAll (type);
-                               }
-                       }
-               }
-
-               void MarkAndPreserveAll (TypeDefinition type)
-               {
-                       Annotations.Mark (type);
-                       Annotations.SetPreserve (type, TypePreserve.All);
-
-                       if (!type.HasNestedTypes)
-                               return;
-
-                       foreach (TypeDefinition nested in type.NestedTypes)
-                               MarkAndPreserveAll (nested);
-               }
-
-               void ProcessTypes (AssemblyDefinition assembly, XPathNodeIterator iterator)
-               {
-                       while (iterator.MoveNext ()) {
-                               XPathNavigator nav = iterator.Current;
-                               string fullname = GetFullName (nav);
-
-                               if (IsTypePattern (fullname)) {
-                                       ProcessTypePattern (fullname, assembly, nav);
-                                       continue;
-                               }
-
-                               TypeDefinition type = assembly.MainModule.GetType (fullname);
-                               if (type == null)
-                                       continue;
-
-                               ProcessType (type, nav);
-                       }
-               }
-
-               static bool IsTypePattern (string fullname)
-               {
-                       return fullname.IndexOf ("*") != -1;
-               }
-
-               static Regex CreateRegexFromPattern (string pattern)
-               {
-                       return new Regex (pattern.Replace(".", @"\.").Replace("*", "(.*)"));
-               }
-
-               void MatchType (TypeDefinition type, Regex regex, XPathNavigator nav)
-               {
-                       if (regex.Match (type.FullName).Success)
-                               ProcessType (type, nav);
-
-                       if (!type.HasNestedTypes)
-                               return;
-
-                       foreach (var nt in type.NestedTypes)
-                               MatchType (nt, regex, nav);
-               }
-
-               void ProcessTypePattern (string fullname, AssemblyDefinition assembly, XPathNavigator nav)
-               {
-                       Regex regex = CreateRegexFromPattern (fullname);
-
-                       foreach (TypeDefinition type in assembly.MainModule.Types) {
-                               MatchType (type, regex, nav);
-                       }
-               }
-
-               void ProcessType (TypeDefinition type, XPathNavigator nav)
-               {
-                       TypePreserve preserve = GetTypePreserve (nav);
-
-                       if (!IsRequired (nav)) {
-                               Annotations.SetPreserve (type, preserve);
-                               return;
-                       }
-
-                       Annotations.Mark (type);
-
-                       if (type.IsNested) {
-                               var parent = type;
-                               while (parent.IsNested) {
-                                       parent = parent.DeclaringType;
-                                       Annotations.Mark (parent);
-                               }
-                       }
-
-                       switch (preserve) {
-                       case TypePreserve.Nothing:
-                               if (!nav.HasChildren)
-                                       Annotations.SetPreserve (type, TypePreserve.All);
-                               break;
-                       default:
-                               Annotations.SetPreserve (type, preserve);
-                               break;
-                       }
-
-                       if (nav.HasChildren) {
-                               MarkSelectedFields (nav, type);
-                               MarkSelectedMethods (nav, type);
-                       }
-               }
-
-               void MarkSelectedFields (XPathNavigator nav, TypeDefinition type)
-               {
-                       XPathNodeIterator fields = nav.SelectChildren ("field", _ns);
-                       if (fields.Count == 0)
-                               return;
-
-                       ProcessFields (type, fields);
-               }
-
-               void MarkSelectedMethods (XPathNavigator nav, TypeDefinition type)
-               {
-                       XPathNodeIterator methods = nav.SelectChildren ("method", _ns);
-                       if (methods.Count == 0)
-                               return;
-
-                       ProcessMethods (type, methods);
-               }
-
-               static TypePreserve GetTypePreserve (XPathNavigator nav)
-               {
-                       string attribute = GetAttribute (nav, _preserve);
-                       if (attribute == null || attribute.Length == 0)
-                               return TypePreserve.Nothing;
-
-                       try {
-                               return (TypePreserve) Enum.Parse (typeof (TypePreserve), attribute, true);
-                       } catch {
-                               return TypePreserve.Nothing;
-                       }
-               }
-
-               void ProcessFields (TypeDefinition type, XPathNodeIterator iterator)
-               {
-                       while (iterator.MoveNext ()) {
-                               string value = GetSignature (iterator.Current);
-                               if (!String.IsNullOrEmpty (value))
-                                       ProcessFieldSignature (type, value);
-
-                               value = GetAttribute (iterator.Current, "name");
-                               if (!String.IsNullOrEmpty (value))
-                                       ProcessFieldName (type, value);
-                       }
-               }
-
-               void ProcessFieldSignature (TypeDefinition type, string signature)
-               {
-                       FieldDefinition field = GetField (type, signature);
-                       MarkField (type, field, signature);
-               }
-
-               void MarkField (TypeDefinition type, FieldDefinition field, string signature)
-               {
-                       if (field != null)
-                               Annotations.Mark (field);
-                       else
-                               AddUnresolveMarker (string.Format ("T: {0}; F: {1}", type, signature));
-               }
-
-               void ProcessFieldName (TypeDefinition type, string name)
-               {
-                       if (!type.HasFields)
-                               return;
-
-                       foreach (FieldDefinition field in type.Fields)
-                               if (field.Name == name)
-                                       MarkField (type, field, name);
-               }
-
-               static FieldDefinition GetField (TypeDefinition type, string signature)
-               {
-                       if (!type.HasFields)
-                               return null;
-
-                       foreach (FieldDefinition field in type.Fields)
-                               if (signature == GetFieldSignature (field))
-                                       return field;
-
-                       return null;
-               }
-
-               static string GetFieldSignature (FieldDefinition field)
-               {
-                       return field.FieldType.FullName + " " + field.Name;
-               }
-
-               void ProcessMethods (TypeDefinition type, XPathNodeIterator iterator)
-               {
-                       while (iterator.MoveNext()) {
-                               string value = GetSignature (iterator.Current);
-                               if (!String.IsNullOrEmpty (value))
-                                       ProcessMethodSignature (type, value);
-
-                               value = GetAttribute (iterator.Current, "name");
-                               if (!String.IsNullOrEmpty (value))
-                                       ProcessMethodName (type, value);
-                       }
-               }
-
-               void ProcessMethodSignature (TypeDefinition type, string signature)
-               {
-                       MethodDefinition meth = GetMethod (type, signature);
-                       MarkMethod (type, meth, signature);
-               }
-
-               void MarkMethod (TypeDefinition type, MethodDefinition method, string signature)
-               {
-                       if (method != null) {
-                               Annotations.Mark (method);
-                               Annotations.SetAction (method, MethodAction.Parse);
-                       } else
-                               AddUnresolveMarker (string.Format ("T: {0}; M: {1}", type, signature));
-               }
-
-               void ProcessMethodName (TypeDefinition type, string name)
-               {
-                       if (!type.HasMethods)
-                               return;
-
-                       foreach (MethodDefinition method in type.Methods)
-                               if (name == method.Name)
-                                       MarkMethod (type, method, name);
-               }
-
-               static MethodDefinition GetMethod (TypeDefinition type, string signature)
-               {
-                       if (type.HasMethods)
-                               foreach (MethodDefinition meth in type.Methods)
-                                       if (signature == GetMethodSignature (meth))
-                                               return meth;
-
-                       return null;
-               }
-
-               static string GetMethodSignature (MethodDefinition meth)
-               {
-                       StringBuilder sb = new StringBuilder ();
-                       sb.Append (meth.ReturnType.FullName);
-                       sb.Append (" ");
-                       sb.Append (meth.Name);
-                       sb.Append ("(");
-                       if (meth.HasParameters) {
-                               for (int i = 0; i < meth.Parameters.Count; i++) {
-                                       if (i > 0)
-                                               sb.Append (",");
-
-                                       sb.Append (meth.Parameters [i].ParameterType.FullName);
-                               }
-                       }
-                       sb.Append (")");
-                       return sb.ToString ();
-               }
-
-               static AssemblyDefinition GetAssembly (LinkContext context, string assemblyName)
-               {
-                       AssemblyNameReference reference = AssemblyNameReference.Parse (assemblyName);
-                       AssemblyDefinition assembly;
-
-                       assembly = context.Resolve (reference);
-
-                       ProcessReferences (assembly, context);
-                       return assembly;
-               }
-
-               static void ProcessReferences (AssemblyDefinition assembly, LinkContext context)
-               {
-                       foreach (AssemblyNameReference name in assembly.MainModule.AssemblyReferences)
-                               context.Resolve (name);
-               }
-
-               static bool IsRequired (XPathNavigator nav)
-               {
-                       string attribute = GetAttribute (nav, _required);
-                       if (attribute == null || attribute.Length == 0)
-                               return true;
-
-                       return TryParseBool (attribute);
-               }
-
-               static bool TryParseBool (string s)
-               {
-                       try {
-                               return bool.Parse (s);
-                       } catch {
-                               return false;
-                       }
-               }
-
-               static string GetSignature (XPathNavigator nav)
-               {
-                       return GetAttribute (nav, _signature);
-               }
-
-               static string GetFullName (XPathNavigator nav)
-               {
-                       return GetAttribute (nav, _fullname);
-               }
-
-               static string GetAttribute (XPathNavigator nav, string attribute)
-               {
-                       return nav.GetAttribute (attribute, _ns);
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveStep.cs
deleted file mode 100644 (file)
index b17bf5c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// ResolveStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.
-//
-
-namespace Mono.Linker.Steps {
-
-       using System.Collections;
-
-       public abstract class ResolveStep : BaseStep {
-
-               ArrayList _unResolved;
-
-               internal ResolveStep ()
-               {
-                       _unResolved = new ArrayList ();
-               }
-
-               public bool AllMarkerResolved
-               {
-                       get { return _unResolved.Count == 0; }
-               }
-
-               public string [] GetUnresolvedMarkers ()
-               {
-                       return _unResolved.ToArray (typeof (string)) as string [];
-               }
-
-               protected void AddUnresolveMarker (string signature)
-               {
-                       _unResolved.Add (signature);
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs b/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs
deleted file mode 100644 (file)
index 73c89cc..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// SweepStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-// (C) 2007 Novell, 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.Collections;
-using System.Collections.Generic;
-using Mono.Cecil;
-using Mono.Collections.Generic;
-
-namespace Mono.Linker.Steps {
-
-       public class SweepStep : BaseStep {
-
-               AssemblyDefinition [] assemblies;
-               HashSet<AssemblyDefinition> resolvedTypeReferences;
-
-               protected override void Process ()
-               {
-                       assemblies = Context.GetAssemblies ();
-                       foreach (var assembly in assemblies) {
-                               SweepAssembly (assembly);
-                               if (Annotations.GetAction (assembly) == AssemblyAction.Copy) {
-                                       // Copy assemblies can still contain Type references with
-                                       // type forwarders from Delete assemblies
-                                       // thus try to resolve all the type references and see
-                                       // if some changed the scope. if yes change the action to Save
-                                       if (ResolveAllTypeReferences (assembly))
-                                               Annotations.SetAction (assembly, AssemblyAction.Save);
-                               }
-                       }
-               }
-
-               void SweepAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       if (!IsMarkedAssembly (assembly)) {
-                               RemoveAssembly (assembly);
-                               return;
-                       }
-
-                       var types = new List<TypeDefinition> ();
-
-                       foreach (TypeDefinition type in assembly.MainModule.Types) {
-                               if (Annotations.IsMarked (type)) {
-                                       SweepType (type);
-                                       types.Add (type);
-                                       continue;
-                               }
-
-                               if (type.Name == "<Module>")
-                                       types.Add (type);
-                       }
-
-                       assembly.MainModule.Types.Clear ();
-                       foreach (TypeDefinition type in types)
-                               assembly.MainModule.Types.Add (type);
-               }
-
-               bool IsMarkedAssembly (AssemblyDefinition assembly)
-               {
-                       return Annotations.IsMarked (assembly.MainModule);
-               }
-
-               void RemoveAssembly (AssemblyDefinition assembly)
-               {
-                       Annotations.SetAction (assembly, AssemblyAction.Delete);
-
-                       SweepReferences (assembly);
-               }
-
-               void SweepReferences (AssemblyDefinition target)
-               {
-                       foreach (var assembly in assemblies)
-                               SweepReferences (assembly, target);
-               }
-
-               void SweepReferences (AssemblyDefinition assembly, AssemblyDefinition target)
-               {
-                       if (assembly == target)
-                               return;
-
-                       var references = assembly.MainModule.AssemblyReferences;
-                       for (int i = 0; i < references.Count; i++) {
-                               var reference = references [i];
-                               var r = Context.Resolver.Resolve (reference);
-                               if (!AreSameReference (r.Name, target.Name))
-                                       continue;
-
-                               references.RemoveAt (i);
-                               // Removing the reference does not mean it will be saved back to disk!
-                               // That depends on the AssemblyAction set for the `assembly`
-                               switch (Annotations.GetAction (assembly)) {
-                               case AssemblyAction.Copy:
-                                       // Copy means even if "unlinked" we still want that assembly to be saved back 
-                                       // to disk (OutputStep) without the (removed) reference
-                                       Annotations.SetAction (assembly, AssemblyAction.Save);
-                                       ResolveAllTypeReferences (assembly);
-                                       break;
-
-                               case AssemblyAction.Save:
-                               case AssemblyAction.Link:
-                                       ResolveAllTypeReferences (assembly);
-                                       break;
-                               }
-                               return;
-                       }
-               }
-
-               bool ResolveAllTypeReferences (AssemblyDefinition assembly)
-               {
-                       if (resolvedTypeReferences == null)
-                               resolvedTypeReferences = new HashSet<AssemblyDefinition> ();
-                       if (resolvedTypeReferences.Contains (assembly))
-                               return false;
-                       resolvedTypeReferences.Add (assembly);
-
-                       var hash = new Dictionary<TypeReference,IMetadataScope> ();
-                       bool changes = false;
-
-                       foreach (TypeReference tr in assembly.MainModule.GetTypeReferences ()) {
-                               if (hash.ContainsKey (tr))
-                                       continue;
-                               var td = tr.Resolve ();
-                               IMetadataScope scope = tr.Scope;
-                               // at this stage reference might include things that can't be resolved
-                               // and if it is (resolved) it needs to be kept only if marked (#16213)
-                               if ((td != null) && Annotations.IsMarked (td)) {
-                                       scope = assembly.MainModule.ImportReference (td).Scope;
-                                       if (tr.Scope != scope)
-                                               changes = true;
-                                       hash.Add (tr, scope);
-                               }
-                       }
-                       if (assembly.MainModule.HasExportedTypes) {
-                               foreach (var et in assembly.MainModule.ExportedTypes) {
-                                       var td = et.Resolve ();
-                                       IMetadataScope scope = et.Scope;
-                                       if ((td != null) && Annotations.IsMarked (td)) {
-                                               scope = assembly.MainModule.ImportReference (td).Scope;
-                                               hash.Add (td, scope);
-                                       }
-                               }
-                       }
-
-                       // Resolve everything first before updating scopes.
-                       // If we set the scope to null, then calling Resolve() on any of its
-                       // nested types would crash.
-
-                       foreach (var e in hash) {
-                               e.Key.Scope = e.Value;
-                       }
-
-                       return changes;
-               }
-
-               void SweepType (TypeDefinition type)
-               {
-                       if (type.HasFields)
-                               SweepCollection (type.Fields);
-
-                       if (type.HasMethods)
-                               SweepCollection (type.Methods);
-
-                       if (type.HasNestedTypes)
-                               SweepNestedTypes (type);
-               }
-
-               void SweepNestedTypes (TypeDefinition type)
-               {
-                       for (int i = 0; i < type.NestedTypes.Count; i++) {
-                               var nested = type.NestedTypes [i];
-                               if (Annotations.IsMarked (nested)) {
-                                       SweepType (nested);
-                               } else {
-                                       type.NestedTypes.RemoveAt (i--);
-                               }
-                       }
-               }
-
-               void SweepCollection (IList list)
-               {
-                       for (int i = 0; i < list.Count; i++)
-                               if (!Annotations.IsMarked ((IMetadataTokenProvider) list [i]))
-                                       list.RemoveAt (i--);
-               }
-
-               static bool AreSameReference (AssemblyNameReference a, AssemblyNameReference b)
-               {
-                       if (a == b)
-                               return true;
-
-                       if (a.Name != b.Name)
-                               return false;
-
-                       if (a.Version > b.Version)
-                               return false;
-
-                       return true;
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs b/mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs
deleted file mode 100644 (file)
index 3fe12ae..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-//
-// TypeMapStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-using System.Collections.Generic;
-
-using Mono.Cecil;
-
-namespace Mono.Linker.Steps {
-
-       public class TypeMapStep : BaseStep {
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       foreach (TypeDefinition type in assembly.MainModule.Types)
-                               MapType (type);
-               }
-
-               protected virtual void MapType (TypeDefinition type)
-               {
-                       MapVirtualMethods (type);
-                       MapInterfaceMethodsInTypeHierarchy (type);
-
-                       if (!type.HasNestedTypes)
-                               return;
-
-                       foreach (var nested in type.NestedTypes)
-                               MapType (nested);
-               }
-
-               void MapInterfaceMethodsInTypeHierarchy (TypeDefinition type)
-               {
-                       if (!type.HasInterfaces)
-                               return;
-
-                       foreach (var @interface in type.Interfaces) {
-                               var iface = @interface.InterfaceType.Resolve ();
-                               if (iface == null || !iface.HasMethods)
-                                       continue;
-
-                               foreach (MethodDefinition method in iface.Methods) {
-                                       if (TryMatchMethod (type, method) != null)
-                                               continue;
-
-                                       var @base = GetBaseMethodInTypeHierarchy (type, method);
-                                       if (@base == null)
-                                               continue;
-
-                                       Annotations.AddPreservedMethod (type, @base);
-                               }
-                       }
-               }
-
-               void MapVirtualMethods (TypeDefinition type)
-               {
-                       if (!type.HasMethods)
-                               return;
-
-                       foreach (MethodDefinition method in type.Methods) {
-                               if (!method.IsVirtual)
-                                       continue;
-
-                               MapVirtualMethod (method);
-
-                               if (method.HasOverrides)
-                                       MapOverrides (method);
-                       }
-               }
-
-               void MapVirtualMethod (MethodDefinition method)
-               {
-                       MapVirtualBaseMethod (method);
-                       MapVirtualInterfaceMethod (method);
-               }
-
-               void MapVirtualBaseMethod (MethodDefinition method)
-               {
-                       MethodDefinition @base = GetBaseMethodInTypeHierarchy (method);
-                       if (@base == null)
-                               return;
-
-                       AnnotateMethods (@base, method);
-               }
-
-               void MapVirtualInterfaceMethod (MethodDefinition method)
-               {
-                       foreach (MethodDefinition @base in GetBaseMethodsInInterfaceHierarchy (method))
-                               AnnotateMethods (@base, method);
-               }
-
-               void MapOverrides (MethodDefinition method)
-               {
-                       foreach (MethodReference override_ref in method.Overrides) {
-                               MethodDefinition @override = override_ref.Resolve ();
-                               if (@override == null)
-                                       continue;
-
-                               AnnotateMethods (@override, method);
-                       }
-               }
-
-               void AnnotateMethods (MethodDefinition @base, MethodDefinition @override)
-               {
-                       Annotations.AddBaseMethod (@override, @base);
-                       Annotations.AddOverride (@base, @override);
-               }
-
-               static MethodDefinition GetBaseMethodInTypeHierarchy (MethodDefinition method)
-               {
-                       return GetBaseMethodInTypeHierarchy (method.DeclaringType, method);
-               }
-
-               static MethodDefinition GetBaseMethodInTypeHierarchy (TypeDefinition type, MethodDefinition method)
-               {
-                       TypeDefinition @base = GetBaseType (type);
-                       while (@base != null) {
-                               MethodDefinition base_method = TryMatchMethod (@base, method);
-                               if (base_method != null)
-                                       return base_method;
-
-                               @base = GetBaseType (@base);
-                       }
-
-                       return null;
-               }
-
-               static IEnumerable<MethodDefinition> GetBaseMethodsInInterfaceHierarchy (MethodDefinition method)
-               {
-                       return GetBaseMethodsInInterfaceHierarchy (method.DeclaringType, method);
-               }
-
-               static IEnumerable<MethodDefinition> GetBaseMethodsInInterfaceHierarchy (TypeDefinition type, MethodDefinition method)
-               {
-                       if (!type.HasInterfaces)
-                               yield break;
-
-                       foreach (var interface_ref in type.Interfaces) {
-                               TypeDefinition @interface = interface_ref.InterfaceType.Resolve ();
-                               if (@interface == null)
-                                       continue;
-
-                               MethodDefinition base_method = TryMatchMethod (@interface, method);
-                               if (base_method != null)
-                                       yield return base_method;
-
-                               foreach (MethodDefinition @base in GetBaseMethodsInInterfaceHierarchy (@interface, method))
-                                       yield return @base;
-                       }
-               }
-
-               static MethodDefinition TryMatchMethod (TypeDefinition type, MethodDefinition method)
-               {
-                       if (!type.HasMethods)
-                               return null;
-
-                       Dictionary<string,string> gp = null;
-                       foreach (MethodDefinition candidate in type.Methods) {
-                               if (MethodMatch (candidate, method, ref gp))
-                                       return candidate;
-                               if (gp != null)
-                                       gp.Clear ();
-                       }
-
-                       return null;
-               }
-
-               static bool MethodMatch (MethodDefinition candidate, MethodDefinition method, ref Dictionary<string,string> genericParameters)
-               {
-                       if (!candidate.IsVirtual)
-                               return false;
-
-                       if (candidate.HasParameters != method.HasParameters)
-                               return false;
-
-                       if (candidate.Name != method.Name)
-                               return false;
-
-                       if (candidate.HasGenericParameters != method.HasGenericParameters)
-                               return false;
-
-                       // we need to track what the generic parameter represent - as we cannot allow it to
-                       // differ between the return type or any parameter
-                       if (!TypeMatch (candidate.ReturnType, method.ReturnType, ref genericParameters))
-                               return false;
-
-                       if (!candidate.HasParameters)
-                               return true;
-
-                       var cp = candidate.Parameters;
-                       var mp = method.Parameters;
-                       if (cp.Count != mp.Count)
-                               return false;
-
-                       for (int i = 0; i < cp.Count; i++) {
-                               if (!TypeMatch (cp [i].ParameterType, mp [i].ParameterType, ref genericParameters))
-                                       return false;
-                       }
-
-                       return true;
-               }
-
-               static bool TypeMatch (IModifierType a, IModifierType b, ref Dictionary<string,string> gp)
-               {
-                       if (!TypeMatch (a.ModifierType, b.ModifierType, ref gp))
-                               return false;
-
-                       return TypeMatch (a.ElementType, b.ElementType, ref gp);
-               }
-
-               static bool TypeMatch (TypeSpecification a, TypeSpecification b, ref Dictionary<string,string> gp)
-               {
-                       var gita = a as GenericInstanceType;
-                       if (gita != null)
-                               return TypeMatch (gita, (GenericInstanceType) b, ref gp);
-
-                       var mta = a as IModifierType;
-                       if (mta != null)
-                               return TypeMatch (mta, (IModifierType) b, ref gp);
-
-                       return TypeMatch (a.ElementType, b.ElementType, ref gp);
-               }
-
-               static bool TypeMatch (GenericInstanceType a, GenericInstanceType b, ref Dictionary<string,string> gp)
-               {
-                       if (!TypeMatch (a.ElementType, b.ElementType, ref gp))
-                               return false;
-
-                       if (a.HasGenericArguments != b.HasGenericArguments)
-                               return false;
-
-                       if (!a.HasGenericArguments)
-                               return true;
-
-                       var gaa = a.GenericArguments;
-                       var gab = b.GenericArguments;
-                       if (gaa.Count != gab.Count)
-                               return false;
-
-                       for (int i = 0; i < gaa.Count; i++) {
-                               if (!TypeMatch (gaa [i], gab [i], ref gp))
-                                       return false;
-                       }
-
-                       return true;
-               }
-
-               static bool TypeMatch (TypeReference a, TypeReference b, ref Dictionary<string,string> gp)
-               {
-                       var gpa = a as GenericParameter;
-                       if (gpa != null) {
-                               if (gp == null)
-                                       gp = new Dictionary<string, string> ();
-                               string match;
-                               if (!gp.TryGetValue (gpa.FullName, out match)) {
-                                       // first use, we assume it will always be used this way
-                                       gp.Add (gpa.FullName, b.ToString ());
-                                       return true;
-                               }
-                               // re-use, it should match the previous usage
-                               return match == b.ToString ();
-                       }
-
-                       if (a is TypeSpecification || b is TypeSpecification) {
-                               if (a.GetType () != b.GetType ())
-                                       return false;
-
-                               return TypeMatch ((TypeSpecification) a, (TypeSpecification) b, ref gp);
-                       }
-
-                       return a.FullName == b.FullName;
-               }
-
-               static TypeDefinition GetBaseType (TypeDefinition type)
-               {
-                       if (type == null || type.BaseType == null)
-                               return null;
-
-                       return type.BaseType.Resolve ();
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker.csproj b/mcs/tools/linker/Mono.Linker.csproj
deleted file mode 100644 (file)
index 98f0737..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Mono.Linker</RootNamespace>
-    <AssemblyName>monolinker</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>True</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Mono.Linker.Steps\BaseStep.cs" />
-    <Compile Include="Mono.Linker.Steps\BlacklistStep.cs" />
-    <Compile Include="Mono.Linker.Steps\CleanStep.cs" />
-    <Compile Include="Mono.Linker.Steps\RegenerateGuidStep.cs" />
-    <Compile Include="Mono.Linker.Steps\LoadI18nAssemblies.cs" />
-    <Compile Include="Mono.Linker\IXApiVisitor.cs" />
-    <Compile Include="Mono.Linker\I18nAssemblies.cs" />
-    <Compile Include="Mono.Linker.Steps\IStep.cs" />
-    <Compile Include="Mono.Linker.Steps\LoadReferencesStep.cs" />
-    <Compile Include="Mono.Linker.Steps\MarkStep.cs" />
-    <Compile Include="Mono.Linker.Steps\OutputStep.cs" />
-    <Compile Include="Mono.Linker.Steps\ResolveFromXApiStep.cs" />
-    <Compile Include="Mono.Linker.Steps\ResolveFromAssemblyStep.cs" />
-    <Compile Include="Mono.Linker.Steps\ResolveFromXmlStep.cs" />
-    <Compile Include="Mono.Linker.Steps\ResolveStep.cs" />
-    <Compile Include="Mono.Linker.Steps\SweepStep.cs" />
-    <Compile Include="Mono.Linker\Annotations.cs" />
-    <Compile Include="Mono.Linker\AssemblyAction.cs" />
-    <Compile Include="Mono.Linker\AssemblyInfo.cs" />
-    <Compile Include="Mono.Linker\AssemblyResolver.cs" />
-    <Compile Include="Mono.Linker\Driver.cs" />
-    <Compile Include="Mono.Linker\LinkContext.cs" />
-    <Compile Include="Mono.Linker\MethodAction.cs" />
-    <Compile Include="Mono.Linker\Pipeline.cs" />
-    <Compile Include="Mono.Linker\TypePreserve.cs" />
-    <Compile Include="Mono.Linker\XApiReader.cs" />
-    <Compile Include="Mono.Linker.Steps\TypeMapStep.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Descriptors\mscorlib.xml">
-      <LogicalName>mscorlib.xml</LogicalName>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Descriptors\System.Web.xml">
-      <LogicalName>System.web.xml</LogicalName>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Descriptors\System.xml">
-      <LogicalName>System.xml</LogicalName>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Descriptors\Mono.Posix.xml">
-      <LogicalName>Mono.Posix.xml</LogicalName>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Descriptors\System.Drawing.xml">
-      <LogicalName>System.Drawing.xml</LogicalName>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Descriptors\System.Core.xml">
-      <LogicalName>System.Core.xml</LogicalName>
-    </EmbeddedResource>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Makefile" />
-    <None Include="README" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\external\cecil\Mono.Cecil.csproj">
-      <Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>
-      <Name>Mono.Cecil</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/mcs/tools/linker/Mono.Linker/Annotations.cs b/mcs/tools/linker/Mono.Linker/Annotations.cs
deleted file mode 100644 (file)
index 72c59ba..0000000
+++ /dev/null
@@ -1,329 +0,0 @@
-//
-// Annotations.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Compression;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Linker {
-
-       public class AnnotationStore {
-
-               readonly Dictionary<AssemblyDefinition, AssemblyAction> assembly_actions = new Dictionary<AssemblyDefinition, AssemblyAction> ();
-               readonly Dictionary<MethodDefinition, MethodAction> method_actions = new Dictionary<MethodDefinition, MethodAction> ();
-               readonly HashSet<IMetadataTokenProvider> marked = new HashSet<IMetadataTokenProvider> ();
-               readonly HashSet<IMetadataTokenProvider> processed = new HashSet<IMetadataTokenProvider> ();
-               readonly Dictionary<TypeDefinition, TypePreserve> preserved_types = new Dictionary<TypeDefinition, TypePreserve> ();
-               readonly Dictionary<IMemberDefinition, List<MethodDefinition>> preserved_methods = new Dictionary<IMemberDefinition, List<MethodDefinition>> ();
-               readonly HashSet<IMetadataTokenProvider> public_api = new HashSet<IMetadataTokenProvider> ();
-               readonly Dictionary<MethodDefinition, List<MethodDefinition>> override_methods = new Dictionary<MethodDefinition, List<MethodDefinition>> ();
-               readonly Dictionary<MethodDefinition, List<MethodDefinition>> base_methods = new Dictionary<MethodDefinition, List<MethodDefinition>> ();
-               readonly Dictionary<AssemblyDefinition, ISymbolReader> symbol_readers = new Dictionary<AssemblyDefinition, ISymbolReader> ();
-
-               readonly Dictionary<object, Dictionary<IMetadataTokenProvider, object>> custom_annotations = new Dictionary<object, Dictionary<IMetadataTokenProvider, object>> ();
-
-               Stack<object> dependency_stack;
-               System.Xml.XmlWriter writer;
-               GZipStream zipStream;
-
-               public void PrepareDependenciesDump ()
-               {
-                       PrepareDependenciesDump ("linker-dependencies.xml.gz");
-               }
-
-               public void PrepareDependenciesDump (string filename)
-               {
-                       dependency_stack = new Stack<object> ();
-                       System.Xml.XmlWriterSettings settings = new System.Xml.XmlWriterSettings();
-                       settings.Indent = true;
-                       settings.IndentChars = "\t";
-                       var depsFile = File.OpenWrite (filename);
-                       zipStream = new GZipStream (depsFile, CompressionMode.Compress);
-
-                       writer = System.Xml.XmlWriter.Create (zipStream, settings);
-                       writer.WriteStartDocument ();
-                       writer.WriteStartElement ("dependencies");
-                       writer.WriteStartAttribute ("version");
-                       writer.WriteString ("1.0");
-                       writer.WriteEndAttribute ();
-               }
-
-               public AssemblyAction GetAction (AssemblyDefinition assembly)
-               {
-                       AssemblyAction action;
-                       if (assembly_actions.TryGetValue (assembly, out action))
-                               return action;
-
-                       throw new NotSupportedException ();
-               }
-
-               public MethodAction GetAction (MethodDefinition method)
-               {
-                       MethodAction action;
-                       if (method_actions.TryGetValue (method, out action))
-                               return action;
-
-                       return MethodAction.Nothing;
-               }
-
-               public void SetAction (AssemblyDefinition assembly, AssemblyAction action)
-               {
-                       assembly_actions [assembly] = action;
-               }
-
-               public bool HasAction (AssemblyDefinition assembly)
-               {
-                       return assembly_actions.ContainsKey (assembly);
-               }
-
-               public void SetAction (MethodDefinition method, MethodAction action)
-               {
-                       method_actions [method] = action;
-               }
-
-               public void Mark (IMetadataTokenProvider provider)
-               {
-                       marked.Add (provider);
-                       AddDependency (provider);
-               }
-
-               public bool IsMarked (IMetadataTokenProvider provider)
-               {
-                       return marked.Contains (provider);
-               }
-
-               public void Processed (IMetadataTokenProvider provider)
-               {
-                       processed.Add (provider);
-               }
-
-               public bool IsProcessed (IMetadataTokenProvider provider)
-               {
-                       return processed.Contains (provider);
-               }
-
-               public bool IsPreserved (TypeDefinition type)
-               {
-                       return preserved_types.ContainsKey (type);
-               }
-
-               public void SetPreserve (TypeDefinition type, TypePreserve preserve)
-               {
-                       preserved_types [type] = preserve;
-               }
-
-               public TypePreserve GetPreserve (TypeDefinition type)
-               {
-                       TypePreserve preserve;
-                       if (preserved_types.TryGetValue (type, out preserve))
-                               return preserve;
-
-                       throw new NotSupportedException ();
-               }
-
-               public void SetPublic (IMetadataTokenProvider provider)
-               {
-                       public_api.Add (provider);
-               }
-
-               public bool IsPublic (IMetadataTokenProvider provider)
-               {
-                       return public_api.Contains (provider);
-               }
-
-               public void AddOverride (MethodDefinition @base, MethodDefinition @override)
-               {
-                       var methods = GetOverrides (@base);
-                       if (methods == null) {
-                               methods = new List<MethodDefinition> ();
-                               override_methods [@base] = methods;
-                       }
-
-                       methods.Add (@override);
-               }
-
-               public List<MethodDefinition> GetOverrides (MethodDefinition method)
-               {
-                       List<MethodDefinition> overrides;
-                       if (override_methods.TryGetValue (method, out overrides))
-                               return overrides;
-
-                       return null;
-               }
-
-               public void AddBaseMethod (MethodDefinition method, MethodDefinition @base)
-               {
-                       var methods = GetBaseMethods (method);
-                       if (methods == null) {
-                               methods = new List<MethodDefinition> ();
-                               base_methods [method] = methods;
-                       }
-
-                       methods.Add (@base);
-               }
-
-               public List<MethodDefinition> GetBaseMethods (MethodDefinition method)
-               {
-                       List<MethodDefinition> bases;
-                       if (base_methods.TryGetValue (method, out bases))
-                               return bases;
-
-                       return null;
-               }
-
-               public List<MethodDefinition> GetPreservedMethods (TypeDefinition type)
-               {
-                       return GetPreservedMethods (type as IMemberDefinition);
-               }
-
-               public void AddPreservedMethod (TypeDefinition type, MethodDefinition method)
-               {
-                       AddPreservedMethod (type as IMemberDefinition, method);
-               }
-
-               public List<MethodDefinition> GetPreservedMethods (MethodDefinition method)
-               {
-                       return GetPreservedMethods (method as IMemberDefinition);
-               }
-
-               public void AddPreservedMethod (MethodDefinition key, MethodDefinition method)
-               {
-                       AddPreservedMethod (key as IMemberDefinition, method);
-               }
-
-               List<MethodDefinition> GetPreservedMethods (IMemberDefinition definition)
-               {
-                       List<MethodDefinition> preserved;
-                       if (preserved_methods.TryGetValue (definition, out preserved))
-                               return preserved;
-
-                       return null;
-               }
-
-               void AddPreservedMethod (IMemberDefinition definition, MethodDefinition method)
-               {
-                       var methods = GetPreservedMethods (definition);
-                       if (methods == null) {
-                               methods = new List<MethodDefinition> ();
-                               preserved_methods [definition] = methods;
-                       }
-
-                       methods.Add (method);
-               }
-
-               public void AddSymbolReader (AssemblyDefinition assembly, ISymbolReader symbolReader)
-               {
-                       symbol_readers [assembly] = symbolReader;
-               }
-
-               public void CloseSymbolReader (AssemblyDefinition assembly)
-               {
-                       ISymbolReader symbolReader;
-                       if (!symbol_readers.TryGetValue (assembly, out symbolReader))
-                               return;
-
-                       symbol_readers.Remove (assembly);
-                       symbolReader.Dispose ();
-               }
-
-               public Dictionary<IMetadataTokenProvider, object> GetCustomAnnotations (object key)
-               {
-                       Dictionary<IMetadataTokenProvider, object> slots;
-                       if (custom_annotations.TryGetValue (key, out slots))
-                               return slots;
-
-                       slots = new Dictionary<IMetadataTokenProvider, object> ();
-                       custom_annotations.Add (key, slots);
-                       return slots;
-               }
-
-               public void AddDependency (object o)
-               {
-                       if (writer == null)
-                               return;
-
-                       KeyValuePair<object, object> pair = new KeyValuePair<object, object> (dependency_stack.Count > 0 ? dependency_stack.Peek () : null, o);
-                       writer.WriteStartElement ("edge");
-                       writer.WriteAttributeString ("b", TokenString (pair.Key));
-                       writer.WriteAttributeString ("e", TokenString (pair.Value));
-                       writer.WriteEndElement ();
-               }
-
-               public void Push (object o)
-               {
-                       if (writer == null)
-                               return;
-
-                       if (dependency_stack.Count > 0)
-                               AddDependency (o);
-                       dependency_stack.Push (o);
-               }
-
-               public void Pop ()
-               {
-                       if (writer == null)
-                               return;
-
-                       dependency_stack.Pop ();
-               }
-
-               string TokenString (object o)
-               {
-                       if (o == null)
-                               return "N:null";
-
-                       if (o is IMetadataTokenProvider)
-                               return (o as IMetadataTokenProvider).MetadataToken.TokenType + ":" + o;
-
-                       return "Other:" + o;
-               }
-
-               public void SaveDependencies ()
-               {
-                       if (writer == null)
-                               return;
-
-                       writer.WriteEndElement ();
-                       writer.WriteEndDocument ();
-                       writer.Flush ();
-                       writer.Close ();
-                       zipStream.Close ();
-
-                       writer.Dispose ();
-                       zipStream.Dispose ();
-                       writer = null;
-                       zipStream = null;
-                       dependency_stack = null;
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/AssemblyAction.cs b/mcs/tools/linker/Mono.Linker/AssemblyAction.cs
deleted file mode 100644 (file)
index 14282b3..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// AssemblyAction.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.
-//
-
-namespace Mono.Linker {
-
-       public enum AssemblyAction {
-               // Ignore the assembly
-               Skip,
-               // Copy the existing files, assembly and symbols, into the output destination. E.g. .dll and .mdb
-               // The linker still analyze the assemblies (to know what they require) but does not modify them
-               Copy,
-               // Link the assembly
-               Link,
-               // Remove the assembly from the output
-               Delete,
-               // Save the assembly/symbols in memory without linking it. 
-               // E.g. useful to remove unneeded assembly references (as done in SweepStep), 
-               //  resolving [TypeForwardedTo] attributes (like PCL) to their final location
-               Save
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/AssemblyInfo.cs b/mcs/tools/linker/Mono.Linker/AssemblyInfo.cs
deleted file mode 100644 (file)
index 348e29b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// AssemblyInfo.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.Runtime.InteropServices;
-
-[assembly: AssemblyTitle ("Mono.Linker")]
-[assembly: AssemblyDescription ("Mono CIL Linker")]
-[assembly: AssemblyConfiguration ("")]
-[assembly: AssemblyProduct ("")]
-[assembly: AssemblyCopyright ("(C) 2006, Jb Evain")]
-[assembly: AssemblyCulture ("")]
-
-[assembly: CLSCompliant (false)]
-[assembly: ComVisible (false)]
-
-[assembly: AssemblyVersion ("0.2.0.0")]
diff --git a/mcs/tools/linker/Mono.Linker/AssemblyResolver.cs b/mcs/tools/linker/Mono.Linker/AssemblyResolver.cs
deleted file mode 100644 (file)
index cb0646c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// AssemblyResolver.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Collections;
-using System.IO;
-using Mono.Cecil;
-
-namespace Mono.Linker {
-
-       public class AssemblyResolver : BaseAssemblyResolver {
-
-               IDictionary _assemblies;
-
-               public IDictionary AssemblyCache {
-                       get { return _assemblies; }
-               }
-
-               public AssemblyResolver ()
-                       : this (new Hashtable ())
-               {
-               }
-
-               public AssemblyResolver (IDictionary assembly_cache)
-               {
-                       _assemblies = assembly_cache;
-               }
-
-               public override AssemblyDefinition Resolve (AssemblyNameReference name, ReaderParameters parameters)
-               {
-                       AssemblyDefinition asm = (AssemblyDefinition) _assemblies [name.Name];
-                       if (asm == null) {
-                               asm = base.Resolve (name, parameters);
-                               _assemblies [name.Name] = asm;
-                       }
-
-                       return asm;
-               }
-
-               public void CacheAssembly (AssemblyDefinition assembly)
-               {
-                       _assemblies [assembly.Name.Name] = assembly;
-                       base.AddSearchDirectory (Path.GetDirectoryName (assembly.MainModule.FileName));
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/Driver.cs b/mcs/tools/linker/Mono.Linker/Driver.cs
deleted file mode 100644 (file)
index 7d1963c..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-//
-// Driver.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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;
-using System.IO;
-using SR = System.Reflection;
-using System.Xml.XPath;
-
-using Mono.Linker.Steps;
-
-namespace Mono.Linker {
-
-       public class Driver {
-
-               static readonly string _linker = "Mono CIL Linker";
-
-               public static int Main (string [] args)
-               {
-                       if (args.Length == 0)
-                               Usage ("No parameters specified");
-
-                       try {
-
-                               Driver driver = new Driver (args);
-                               driver.Run ();
-
-                       } catch (Exception e) {
-                               Console.WriteLine ("Fatal error in {0}", _linker);
-                               Console.WriteLine (e);
-                               return 1;
-                       }
-
-                       return 0;
-               }
-
-               Queue _queue;
-
-               public Driver (string [] args)
-               {
-                       _queue = new Queue (args);
-               }
-
-               bool HaveMoreTokens ()
-               {
-                       return _queue.Count > 0;
-               }
-
-               void Run ()
-               {
-                       Pipeline p = GetStandardPipeline ();
-                       LinkContext context = GetDefaultContext (p);
-                       I18nAssemblies assemblies = I18nAssemblies.All;
-                       ArrayList custom_steps = new ArrayList ();
-
-                       bool resolver = false;
-                       while (HaveMoreTokens ()) {
-                               string token = GetParam ();
-                               if (token.Length < 2)
-                                       Usage ("Option is too short");
-
-                               if (! (token [0] == '-' || token [1] == '/'))
-                                       Usage ("Expecting an option, got instead: " + token);
-
-                               if (token [0] == '-' && token [1] == '-') {
-
-                                       if (token.Length < 3)
-                                               Usage ("Option is too short");
-
-                                       switch (token [2]) {
-                                       case 'v':
-                                               Version ();
-                                               break;
-                                       case 'a':
-                                               About ();
-                                               break;
-                                       default:
-                                               Usage (null);
-                                               break;
-                                       }
-                               }
-
-                               switch (token [1]) {
-                               case 'd': {
-                                       DirectoryInfo info = new DirectoryInfo (GetParam ());
-                                       context.Resolver.AddSearchDirectory (info.FullName);
-                                       break;
-                               }
-                               case 'o':
-                                       context.OutputDirectory = GetParam ();
-                                       break;
-                               case 'c':
-                                       context.CoreAction = ParseAssemblyAction (GetParam ());
-                                       break;
-                               case 'p':
-                                       AssemblyAction action = ParseAssemblyAction (GetParam ());
-                                       context.Actions [GetParam ()] = action;
-                                       break;
-                               case 's':
-                                       custom_steps.Add (GetParam ());
-                                       break;
-                               case 'x':
-                                       foreach (string file in GetFiles (GetParam ()))
-                                               p.PrependStep (new ResolveFromXmlStep (new XPathDocument (file)));
-                                       resolver = true;
-                                       break;
-                               case 'a':
-                                       foreach (string file in GetFiles (GetParam ()))
-                                               p.PrependStep (new ResolveFromAssemblyStep (file));
-                                       resolver = true;
-                                       break;
-                               case 'i':
-                                       foreach (string file in GetFiles (GetParam ()))
-                                               p.PrependStep (new ResolveFromXApiStep (new XPathDocument (file)));
-                                       resolver = true;
-                                       break;
-                               case 'l':
-                                       assemblies = ParseI18n (GetParam ());
-                                       break;
-                               case 'm':
-                                       context.SetParameter (GetParam (), GetParam ());
-                                       break;
-                               case 'b':
-                                       context.LinkSymbols = bool.Parse (GetParam ());
-                                       break;
-                               case 'g':
-                                       if (!bool.Parse (GetParam ()))
-                                               p.RemoveStep (typeof (RegenerateGuidStep));
-                                       break;
-                               default:
-                                       Usage ("Unknown option: `" + token [1] + "'");
-                                       break;
-                               }
-                       }
-
-                       if (!resolver)
-                               Usage ("No resolver was created (use -x, -a or -i)");
-
-                       foreach (string custom_step in custom_steps)
-                               AddCustomStep (p, custom_step);
-
-                       p.AddStepAfter (typeof (LoadReferencesStep), new LoadI18nAssemblies (assemblies));
-
-                       p.Process (context);
-               }
-
-               static void AddCustomStep (Pipeline pipeline, string arg)
-               {
-                       int pos = arg.IndexOf (":");
-                       if (pos == -1) {
-                               pipeline.AppendStep (ResolveStep (arg));
-                               return;
-                       }
-
-                       string [] parts = arg.Split (':');
-                       if (parts.Length != 2)
-                               Usage ("Step is specified as TYPE:STEP");
-
-                       if (parts [0].IndexOf (",") > -1)
-                               pipeline.AddStepBefore (FindStep (pipeline, parts [1]), ResolveStep (parts [0]));
-                       else if (parts [1].IndexOf (",") > -1)
-                               pipeline.AddStepAfter (FindStep (pipeline, parts [0]), ResolveStep (parts [1]));
-                       else
-                               Usage ("No comma separator in TYPE or STEP");
-               }
-
-               static Type FindStep (Pipeline pipeline, string name)
-               {
-                       foreach (IStep step in pipeline.GetSteps ()) {
-                               Type t = step.GetType ();
-                               if (t.Name == name)
-                                       return t;
-                       }
-
-                       return null;
-               }
-
-               static IStep ResolveStep (string type)
-               {
-                       Type step = Type.GetType (type, false);
-                       if (step == null)
-                               Usage (String.Format ("Step type '{0}' not found.", type));
-                       if (!typeof (IStep).IsAssignableFrom (step))
-                               Usage (String.Format ("Step type '{0}' does not implement IStep interface.", type));
-                       return (IStep) Activator.CreateInstance (step);
-               }
-
-               static string [] GetFiles (string param)
-               {
-                       if (param.Length < 1 || param [0] != '@')
-                               return new string [] {param};
-
-                       string file = param.Substring (1);
-                       return ReadLines (file);
-               }
-
-               static string [] ReadLines (string file)
-               {
-                       ArrayList lines = new ArrayList ();
-                       using (StreamReader reader = new StreamReader (file)) {
-                               string line;
-                               while ((line = reader.ReadLine ()) != null)
-                                       lines.Add (line);
-                       }
-                       return (string []) lines.ToArray (typeof (string));
-               }
-
-               static I18nAssemblies ParseI18n (string str)
-               {
-                       I18nAssemblies assemblies = I18nAssemblies.None;
-                       string [] parts = str.Split (',');
-                       foreach (string part in parts)
-                               assemblies |= (I18nAssemblies) Enum.Parse (typeof (I18nAssemblies), part.Trim (), true);
-
-                       return assemblies;
-               }
-
-               static AssemblyAction ParseAssemblyAction (string s)
-               {
-                       return (AssemblyAction) Enum.Parse (typeof (AssemblyAction), s, true);
-               }
-
-               string GetParam ()
-               {
-                       if (_queue.Count == 0)
-                               Usage ("Expecting a parameter");
-
-                       return (string) _queue.Dequeue ();
-               }
-
-               static LinkContext GetDefaultContext (Pipeline pipeline)
-               {
-                       LinkContext context = new LinkContext (pipeline);
-                       context.CoreAction = AssemblyAction.Skip;
-                       context.OutputDirectory = "output";
-                       return context;
-               }
-
-               static void Usage (string msg)
-               {
-                       Console.WriteLine (_linker);
-                       if (msg != null)
-                               Console.WriteLine ("Error: " + msg);
-                       Console.WriteLine ("monolinker [options] -x|-a|-i file");
-
-                       Console.WriteLine ("   --about     About the {0}", _linker);
-                       Console.WriteLine ("   --version   Print the version number of the {0}", _linker);
-                       Console.WriteLine ("   -out        Specify the output directory, default to `output'");
-                       Console.WriteLine ("   -c          Action on the core assemblies, skip, copy or link, default to skip");
-                       Console.WriteLine ("   -p          Action per assembly");
-                       Console.WriteLine ("   -s          Add a new step to the pipeline.");
-                       Console.WriteLine ("   -d          Add a directory where the linker will look for assemblies");
-                       Console.WriteLine ("   -b          Generate debug symbols for each linked module (true or false)");
-                       Console.WriteLine ("   -g          Generate a new unique guid for each linked module (true or false)");
-                       Console.WriteLine ("   -l          List of i18n assemblies to copy to the output directory");
-                       Console.WriteLine ("                 separated with a comma: none,all,cjk,mideast,other,rare,west");
-                       Console.WriteLine ("                 default is all");
-                       Console.WriteLine ("   -x          Link from an XML descriptor");
-                       Console.WriteLine ("   -a          Link from a list of assemblies");
-                       Console.WriteLine ("   -i          Link from an mono-api-info descriptor");
-                       Console.WriteLine ("");
-
-                       Environment.Exit (1);
-               }
-
-               static void Version ()
-               {
-                       Console.WriteLine ("{0} Version {1}",
-                               _linker,
-                           System.Reflection.Assembly.GetExecutingAssembly ().GetName ().Version);
-
-                       Environment.Exit(1);
-               }
-
-               static void About ()
-               {
-                       Console.WriteLine ("For more information, visit the project Web site");
-                       Console.WriteLine ("   http://www.mono-project.com/");
-
-                       Environment.Exit(1);
-               }
-
-               static Pipeline GetStandardPipeline ()
-               {
-                       Pipeline p = new Pipeline ();
-                       p.AppendStep (new LoadReferencesStep ());
-                       p.AppendStep (new BlacklistStep ());
-                       p.AppendStep (new TypeMapStep ());
-                       p.AppendStep (new MarkStep ());
-                       p.AppendStep (new SweepStep ());
-                       p.AppendStep (new CleanStep ());
-                       p.AppendStep (new RegenerateGuidStep ());
-                       p.AppendStep (new OutputStep ());
-                       return p;
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/I18nAssemblies.cs b/mcs/tools/linker/Mono.Linker/I18nAssemblies.cs
deleted file mode 100644 (file)
index a14c58f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// I18nAssemblies.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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;
-
-namespace Mono.Linker {
-
-       [Flags]
-       public enum I18nAssemblies {
-
-               None = 0,
-
-               CJK = 1,
-               MidEast = 2,
-               Other = 4,
-               Rare = 8,
-               West = 16,
-
-               All = CJK | MidEast | Other | Rare | West,
-               Base
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/IXApiVisitor.cs b/mcs/tools/linker/Mono.Linker/IXApiVisitor.cs
deleted file mode 100644 (file)
index 204d699..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// XApiVisitor.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Xml.XPath;
-
-using Mono.Cecil;
-
-namespace Mono.Linker {
-
-       public interface IXApiVisitor {
-
-               void OnAssembly (XPathNavigator nav, AssemblyDefinition assembly);
-               void OnAttribute (XPathNavigator nav);
-               void OnClass (XPathNavigator nav, TypeDefinition type);
-               void OnInterface (XPathNavigator nav, TypeDefinition type);
-               void OnField (XPathNavigator nav, FieldDefinition field);
-               void OnMethod (XPathNavigator nav, MethodDefinition method);
-               void OnConstructor (XPathNavigator nav, MethodDefinition method);
-               void OnProperty (XPathNavigator nav, PropertyDefinition property);
-               void OnEvent (XPathNavigator nav, EventDefinition evt);
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/LinkContext.cs b/mcs/tools/linker/Mono.Linker/LinkContext.cs
deleted file mode 100644 (file)
index 7d7908f..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-//
-// LinkContext.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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;
-using System.IO;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Linker {
-
-       public class LinkContext {
-
-               Pipeline _pipeline;
-               AssemblyAction _coreAction;
-               Hashtable _actions;
-               string _outputDirectory;
-               Hashtable _parameters;
-               bool _linkSymbols;
-
-               AssemblyResolver _resolver;
-
-               ReaderParameters _readerParameters;
-               ISymbolReaderProvider _symbolReaderProvider;
-               ISymbolWriterProvider _symbolWriterProvider;
-
-               AnnotationStore _annotations;
-
-               public Pipeline Pipeline {
-                       get { return _pipeline; }
-               }
-
-               public AnnotationStore Annotations {
-                       get { return _annotations; }
-               }
-
-               public string OutputDirectory {
-                       get { return _outputDirectory; }
-                       set { _outputDirectory = value; }
-               }
-
-               public AssemblyAction CoreAction {
-                       get { return _coreAction; }
-                       set { _coreAction = value; }
-               }
-
-               public bool LinkSymbols {
-                       get { return _linkSymbols; }
-                       set { _linkSymbols = value; }
-               }
-
-               public IDictionary Actions {
-                       get { return _actions; }
-               }
-
-               public AssemblyResolver Resolver {
-                       get { return _resolver; }
-               }
-
-               public ISymbolReaderProvider SymbolReaderProvider {
-                       get { return _symbolReaderProvider; }
-                       set { _symbolReaderProvider = value; }
-               }
-
-               public ISymbolWriterProvider SymbolWriterProvider {
-                       get { return _symbolWriterProvider; }
-                       set { _symbolWriterProvider = value; }
-               }
-
-               public bool LogInternalExceptions { get; set; } = false;
-
-               public LinkContext (Pipeline pipeline)
-                       : this (pipeline, new AssemblyResolver ())
-               {
-               }
-
-               public LinkContext (Pipeline pipeline, AssemblyResolver resolver)
-               {
-                       _pipeline = pipeline;
-                       _resolver = resolver;
-                       _actions = new Hashtable ();
-                       _parameters = new Hashtable ();
-                       _annotations = new AnnotationStore ();
-                       _readerParameters = new ReaderParameters {
-                               AssemblyResolver = _resolver,
-                       };
-               }
-
-               public TypeDefinition GetType (string fullName)
-               {
-                       int pos = fullName.IndexOf (",");
-                       fullName = fullName.Replace ("+", "/");
-                       if (pos == -1) {
-                               foreach (AssemblyDefinition asm in GetAssemblies ()) {
-                                       var type = asm.MainModule.GetType (fullName);
-                                       if (type != null)
-                                               return type;
-                               }
-
-                               return null;
-                       }
-
-                       string asmname = fullName.Substring (pos + 1);
-                       fullName = fullName.Substring (0, pos);
-                       AssemblyDefinition assembly = Resolve (AssemblyNameReference.Parse (asmname));
-                       return assembly.MainModule.GetType (fullName);
-               }
-
-               public AssemblyDefinition Resolve (string name)
-               {
-                       if (File.Exists (name)) {
-                               AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly (name, _readerParameters);
-                               _resolver.CacheAssembly (assembly);
-                               return assembly;
-                       }
-
-                       return Resolve (new AssemblyNameReference (name, new Version ()));
-               }
-
-               public AssemblyDefinition Resolve (IMetadataScope scope)
-               {
-                       AssemblyNameReference reference = GetReference (scope);
-                       try {
-                               AssemblyDefinition assembly = _resolver.Resolve (reference, _readerParameters);
-
-                               if (SeenFirstTime (assembly)) {
-                                       SafeReadSymbols (assembly);
-                                       SetAction (assembly);
-                               }
-
-                               return assembly;
-                       }
-                       catch {
-                               throw new AssemblyResolutionException (reference);
-                       }
-               }
-
-               bool SeenFirstTime (AssemblyDefinition assembly)
-               {
-                       return !_annotations.HasAction (assembly);
-               }
-
-               public void SafeReadSymbols (AssemblyDefinition assembly)
-               {
-                       if (!_linkSymbols)
-                               return;
-
-                       if (assembly.MainModule.HasSymbols)
-                               return;
-
-                       try {
-                               if (_symbolReaderProvider != null) {
-                                       var symbolReader = _symbolReaderProvider.GetSymbolReader (
-                                               assembly.MainModule,
-                                               assembly.MainModule.FileName);
-
-                                       _annotations.AddSymbolReader (assembly, symbolReader);
-                                       assembly.MainModule.ReadSymbols (symbolReader);
-                               } else
-                                       assembly.MainModule.ReadSymbols ();
-                       } catch {}
-               }
-
-               static AssemblyNameReference GetReference (IMetadataScope scope)
-               {
-                       AssemblyNameReference reference;
-                       if (scope is ModuleDefinition) {
-                               AssemblyDefinition asm = ((ModuleDefinition) scope).Assembly;
-                               reference = asm.Name;
-                       } else
-                               reference = (AssemblyNameReference) scope;
-
-                       return reference;
-               }
-
-               void SetAction (AssemblyDefinition assembly)
-               {
-                       AssemblyAction action = AssemblyAction.Link;
-
-                       AssemblyNameDefinition name = assembly.Name;
-
-                       if (_actions.Contains (name.Name))
-                               action = (AssemblyAction) _actions [name.Name];
-                       else if (IsCore (name))
-                               action = _coreAction;
-
-                       _annotations.SetAction (assembly, action);
-               }
-
-               static bool IsCore (AssemblyNameReference name)
-               {
-                       switch (name.Name) {
-                       case "mscorlib":
-                       case "Accessibility":
-                       case "Mono.Security":
-                               // WPF
-                       case "PresentationFramework":
-                       case "PresentationCore":
-                       case "WindowsBase":
-                       case "UIAutomationProvider":
-                       case "UIAutomationTypes":
-                       case "PresentationUI":
-                       case "ReachFramework":
-                               return true;
-                       default:
-                               return name.Name.StartsWith ("System")
-                                       || name.Name.StartsWith ("Microsoft");
-                       }
-               }
-
-               public AssemblyDefinition [] GetAssemblies ()
-               {
-                       IDictionary cache = _resolver.AssemblyCache;
-                       AssemblyDefinition [] asms = new AssemblyDefinition [cache.Count];
-                       cache.Values.CopyTo (asms, 0);
-                       return asms;
-               }
-
-               public void SetParameter (string key, string value)
-               {
-                       _parameters [key] = value;
-               }
-
-               public bool HasParameter (string key)
-               {
-                       return _parameters.Contains (key);
-               }
-
-               public string GetParameter (string key)
-               {
-                       return (string) _parameters [key];
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/MethodAction.cs b/mcs/tools/linker/Mono.Linker/MethodAction.cs
deleted file mode 100644 (file)
index f51587e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// MethodAction.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.
-//
-
-namespace Mono.Linker {
-
-       public enum MethodAction {
-               Nothing,
-               Parse,
-               ForceParse
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/Pipeline.cs b/mcs/tools/linker/Mono.Linker/Pipeline.cs
deleted file mode 100644 (file)
index 7ae07d2..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// Pipeline.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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;
-using System.Diagnostics;
-
-using Mono.Linker.Steps;
-
-namespace Mono.Linker {
-
-       public class Pipeline {
-
-               ArrayList _steps;
-
-               public Pipeline ()
-               {
-                       _steps = new ArrayList();
-               }
-
-               public void PrependStep (IStep step)
-               {
-                       _steps.Insert (0, step);
-               }
-
-               public void AppendStep (IStep step)
-               {
-                       _steps.Add (step);
-               }
-
-               public void AddStepBefore (Type target, IStep step)
-               {
-                       for (int i = 0; i < _steps.Count; i++) {
-                               if (target.IsInstanceOfType (_steps [i])) {
-                                       _steps.Insert (i, step);
-                                       return;
-                               }
-                       }
-                       string msg = String.Format ("Step {0} could not be inserted before (not found) {1}", step, target);
-                       throw new InvalidOperationException (msg);
-               }
-
-               public void ReplaceStep (Type target, IStep step)
-               {
-                       AddStepBefore (target, step);
-                       RemoveStep (target);
-               }
-
-               public void AddStepAfter (Type target, IStep step)
-               {
-                       for (int i = 0; i < _steps.Count; i++) {
-                               if (target.IsInstanceOfType (_steps [i])) {
-                                       if (i == _steps.Count - 1)
-                                               _steps.Add (step);
-                                       else
-                                               _steps.Insert (i + 1, step);
-                                       return;
-                               }
-                       }
-                       string msg = String.Format ("Step {0} could not be inserted after (not found) {1}", step, target);
-                       throw new InvalidOperationException (msg);
-               }
-
-               public void AddStepAfter (IStep target, IStep step)
-               {
-                       for (int i = 0; i < _steps.Count; i++) {
-                               if (_steps [i] == target) {
-                                       if (i == _steps.Count - 1)
-                                               _steps.Add (step);
-                                       else
-                                               _steps.Insert (i + 1, step);
-                                       return;
-                               }
-                       }
-               }
-
-               public void RemoveStep (Type target)
-               {
-                       for (int i = 0; i < _steps.Count; i++) {
-                               if (_steps [i].GetType () != target)
-                                       continue;
-
-                               _steps.RemoveAt (i);
-                               break;
-                       }
-               }
-
-               public void Process (LinkContext context)
-               {
-                       while (_steps.Count > 0) {
-                               IStep step = (IStep) _steps [0];
-                               context.Annotations.Push (step);
-                               step.Process (context);
-                               context.Annotations.Pop ();
-                               _steps.Remove (step);
-                       }
-               }
-
-               public IStep [] GetSteps ()
-               {
-                       return (IStep []) _steps.ToArray (typeof (IStep));
-               }
-
-               public bool ContainsStep (Type type)
-               {
-                       foreach (IStep step in _steps)
-                               if (step.GetType () == type)
-                                       return true;
-
-                       return false;
-               }
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/TypePreserve.cs b/mcs/tools/linker/Mono.Linker/TypePreserve.cs
deleted file mode 100644 (file)
index 08e7b96..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// TypePreserve.cs
-//
-// Author:
-//   Jb Evain (jb@nurv.fr)
-//
-// (C) 2007 Novell, 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.
-//
-
-namespace Mono.Linker {
-
-       public enum TypePreserve {
-               Nothing,
-               All,
-               Fields,
-               Methods,
-       }
-}
diff --git a/mcs/tools/linker/Mono.Linker/XApiReader.cs b/mcs/tools/linker/Mono.Linker/XApiReader.cs
deleted file mode 100644 (file)
index bb16e21..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-//
-// XApiReader.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Collections;
-using System.Linq;
-using System.Text;
-using System.Xml.XPath;
-
-using Mono.Cecil;
-
-namespace Mono.Linker {
-
-       public class XApiReader {
-
-               static readonly string _name = "name";
-               static readonly string _ns = string.Empty;
-
-               LinkContext _context;
-               XPathDocument _document;
-               IXApiVisitor _visitor;
-
-               AssemblyDefinition _assembly;
-               string _namespace;
-               Stack _types = new Stack ();
-               StringBuilder _signature;
-
-               public XApiReader (XPathDocument document, IXApiVisitor visitor)
-               {
-                       _document = document;
-                       _visitor = visitor;
-               }
-
-               public void Process (LinkContext context)
-               {
-                       _context = context;
-                       ProcessAssemblies (_document.CreateNavigator ());
-               }
-
-               void OnAssembly (XPathNavigator nav)
-               {
-                       _assembly = GetAssembly (nav);
-
-                       _visitor.OnAssembly (nav, _assembly);
-
-                       ProcessAttributes (nav);
-                       ProcessNamespaces (nav);
-               }
-
-               AssemblyDefinition GetAssembly (XPathNavigator nav)
-               {
-                       AssemblyNameReference name = new AssemblyNameReference (
-                               GetName (nav),
-                               new Version (GetAttribute (nav, "version")));
-
-                       AssemblyDefinition assembly = _context.Resolve (name);
-                       ProcessReferences (assembly);
-                       return assembly;
-               }
-
-               void ProcessReferences (AssemblyDefinition assembly)
-               {
-                       foreach (AssemblyNameReference name in assembly.MainModule.AssemblyReferences)
-                               _context.Resolve (name);
-               }
-
-               void OnAttribute (XPathNavigator nav)
-               {
-                       _visitor.OnAttribute (nav);
-               }
-
-               void PushType (TypeDefinition type)
-               {
-                       _types.Push (type);
-               }
-
-               TypeDefinition PeekType ()
-               {
-                       return (TypeDefinition) _types.Peek ();
-               }
-
-               TypeDefinition PopType ()
-               {
-                       return (TypeDefinition) _types.Pop ();
-               }
-
-               void OnNamespace (XPathNavigator nav)
-               {
-                       _namespace = GetName (nav);
-
-                       ProcessClasses (nav);
-               }
-
-               void OnClass (XPathNavigator nav)
-               {
-                       string name = GetClassName (nav);
-
-                       TypeDefinition type = _assembly.MainModule.GetType (name);
-                       if (type == null)
-                               return;
-
-                       _visitor.OnClass (nav, type);
-
-                       PushType (type);
-
-                       ProcessAttributes (nav);
-                       ProcessInterfaces (nav);
-                       ProcessFields (nav);
-                       ProcessMethods (nav);
-                       ProcessConstructors (nav);
-                       ProcessProperties (nav);
-                       ProcessEvents (nav);
-                       ProcessClasses (nav);
-
-                       PopType ();
-               }
-
-               string GetClassName (XPathNavigator nav)
-               {
-                       if (IsNestedClass ())
-                               return PeekType ().FullName + "/" + GetName (nav);
-
-                       return _namespace + "." + GetName (nav);
-               }
-
-               bool IsNestedClass ()
-               {
-                       return _types.Count > 0;
-               }
-
-               void OnField (XPathNavigator nav)
-               {
-                       TypeDefinition declaring = PeekType ();
-
-                       FieldDefinition field = declaring.Fields.FirstOrDefault (f => f.Name == GetName (nav));
-                       if (field != null)
-                               _visitor.OnField (nav, field);
-
-                       ProcessAttributes (nav);
-               }
-
-               void OnInterface (XPathNavigator nav)
-               {
-                       string name = GetName (nav);
-
-                       TypeDefinition type = _context.GetType (GetTypeName (name));
-                       if (type != null)
-                               _visitor.OnInterface (nav, type);
-               }
-
-               void OnMethod (XPathNavigator nav)
-               {
-                       InitMethodSignature (nav);
-
-                       ProcessParameters (nav);
-
-                       string signature = GetMethodSignature ();
-
-                       MethodDefinition method = GetMethod (signature);
-                       if (method != null)
-                               _visitor.OnMethod (nav, method);
-
-                       ProcessAttributes (nav);
-               }
-
-               MethodDefinition GetMethod (string signature)
-               {
-                       return GetMethod (PeekType ().Methods, signature);
-               }
-
-               static MethodDefinition GetMethod (ICollection methods, string signature)
-               {
-                       foreach (MethodDefinition method in methods)
-                               if (signature == GetSignature (method))
-                                       return method;
-
-                       return null;
-               }
-
-               static string GetSignature (MethodDefinition method)
-               {
-                       return method.ToString ().Replace ("<", "[").Replace (">", "]");
-               }
-
-               string GetMethodSignature ()
-               {
-                       _signature.Append (")");
-                       return _signature.ToString ();
-               }
-
-               void InitMethodSignature (XPathNavigator nav)
-               {
-                       _signature = new StringBuilder ();
-
-                       string returntype = GetAttribute (nav, "returntype");
-                       if (returntype == null || returntype.Length == 0)
-                               returntype = "System.Void";
-
-                       _signature.Append (NormalizeTypeName (returntype));
-                       _signature.Append (" ");
-                       _signature.Append (PeekType ().FullName);
-                       _signature.Append ("::");
-
-                       string name = GetName (nav);
-                       _signature.Append (GetMethodName (name));
-
-                       _signature.Append ("(");
-               }
-
-               static string GetMethodName (string name)
-               {
-                       return GetStringBefore (name, "(");
-               }
-
-               static string NormalizeTypeName (string name)
-               {
-                       return name.Replace ("+", "/").Replace ("<", "[").Replace (">", "]");
-               }
-
-               static string GetTypeName (string name)
-               {
-                       return GetStringBefore (NormalizeTypeName (name), "[");
-               }
-
-               static string GetStringBefore (string str, string marker)
-               {
-                       int pos = str.IndexOf (marker);
-                       if (pos == -1)
-                               return str;
-
-                       return str.Substring (0, pos);
-               }
-
-               void OnParameter (XPathNavigator nav)
-               {
-                       string type = GetAttribute (nav, "type");
-                       int pos = int.Parse (GetAttribute (nav, "position"));
-
-                       if (pos > 0)
-                               _signature.Append (",");
-                       _signature.Append (NormalizeTypeName (type));
-               }
-
-               void OnConstructor (XPathNavigator nav)
-               {
-                       InitMethodSignature (nav);
-
-                       ProcessParameters (nav);
-
-                       string signature = GetMethodSignature ();
-
-                       MethodDefinition ctor = GetMethod (signature);
-                       if (ctor != null)
-                               _visitor.OnConstructor (nav, ctor);
-
-                       ProcessAttributes (nav);
-               }
-
-               void OnProperty (XPathNavigator nav)
-               {
-                       string name = GetName (nav);
-                       TypeDefinition type = PeekType ();
-
-                       var property = type.Properties.FirstOrDefault (p => p.Name == name);
-                       if (property != null)
-                               _visitor.OnProperty (nav, property);
-
-                       ProcessAttributes (nav);
-                       ProcessMethods (nav);
-               }
-
-               void OnEvent (XPathNavigator nav)
-               {
-                       string name = GetName (nav);
-                       TypeDefinition type = PeekType ();
-
-                       EventDefinition evt = type.Events.FirstOrDefault (e => e.Name == name);
-                       if (evt != null)
-                               _visitor.OnEvent (nav, evt);
-
-                       ProcessAttributes (nav);
-               }
-
-               void ProcessAssemblies (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "assemblies//assembly", new OnChildren (OnAssembly));
-               }
-
-               void ProcessAttributes (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "attributes//attribute", new OnChildren (OnAttribute));
-               }
-
-               void ProcessNamespaces (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "namespaces//namespace", new OnChildren (OnNamespace));
-               }
-
-               void ProcessClasses (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "classes//class", new OnChildren (OnClass));
-               }
-
-               void ProcessInterfaces (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "intefaces//interface", new OnChildren (OnInterface));
-               }
-
-               void ProcessFields (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "fields//field", new OnChildren (OnField));
-               }
-
-               void ProcessMethods (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "methods//method", new OnChildren (OnMethod));
-               }
-
-               void ProcessConstructors (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "constructors//constructor", new OnChildren (OnConstructor));
-               }
-
-               void ProcessParameters (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "parameters//parameter", new OnChildren (OnParameter));
-               }
-
-               void ProcessProperties (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "properties//property", new OnChildren (OnProperty));
-               }
-
-               void ProcessEvents (XPathNavigator nav)
-               {
-                       ProcessChildren (nav, "events//event", new OnChildren (OnEvent));
-               }
-
-               static void ProcessChildren (XPathNavigator nav, string children, OnChildren action)
-               {
-                       XPathNodeIterator iterator = nav.Select (children);
-                       while (iterator.MoveNext ())
-                               action (iterator.Current);
-               }
-
-               delegate void OnChildren (XPathNavigator nav);
-
-               static string GetName (XPathNavigator nav)
-               {
-                       return GetAttribute (nav, _name);
-               }
-
-               static string GetAttribute (XPathNavigator nav, string attribute)
-               {
-                       return nav.GetAttribute (attribute, _ns);
-               }
-       }
-}
diff --git a/mcs/tools/linker/README b/mcs/tools/linker/README
deleted file mode 100644 (file)
index 749b775..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-monolinker
-====
-
-monolinker is the Mono CIL Linker.
-
-The linker is a tool one can use to only ship the minimal possible set of
-functions that a set of programs might require to run as opposed to the full
-libraries.
-
-* How does the linker work?
-
-The linker analyses the intermediate code (CIL) produced by every compiler
-targeting the Mono platform like mcs, gmcs, vbnc, booc or others. It will walk
-through all the code that it is given to it, and basically, perform a mark and
-sweep operations on all the code that it is referenced, to only keep what is
-necessary for the source program to run.
-
-* Usage
-
-1) Linking from a source assembly
-
-The command:
-
-monolinker -a Program.exe
-
-will use the assembly Program.exe as a source. That means that the linker will
-walk through all the methods of Program.exe to generate only what is necessary
-for this assembly to run.
-
-2) Linking from an xml descriptor
-
-The command:
-
-monolinker -x desc.xml
-
-will use the XML descriptor as a source. That means that the linker will
-use this file to decide what to link in a set of assemblies. The format of the
-descriptors is described further on in this document.
-
-3) Linking from an api info file
-
-The command:
-
-monolinker -i assembly.info
-
-will use a file produced by mono-api-info as a source. The linker will use
-this file to link only what is necessary to match the public API defined in
-the info file.
-
-4) Actions on the assemblies
-
-You can specify what the linker should do exactly per assembly.
-
-The linker can do 3 things:
-
-       - skip them, and do nothing with them,
-       - copy them to the output directory,
-       - link them, to reduce their size.
-
-You can specify an action per assembly like this:
-
-monolinker -p link Foo
-
-or
-
-monolinker -p skip System.Windows.Forms
-
-Or you can specify what to do for the core assemblies.
-
-Core assemblies are the assemblies that belongs to the base class library,
-like mscorlib.dll, System.dll or System.Windows.Forms.dll.
-
-You can specify what action to do on the core assemblies with the option:
-
--c skip|copy|link
-
-5) The output directory
-
-By default, the linker will create an `output' directory in the current
-directory where it will emit the linked files, to avoid erasing source
-assemblies. You can specify the output directory with the option:
-
--o output_directory
-
-If you specify the directory `.', please ensure that you won't write over
-important assemblies of yours.
-
-* Syntax of a xml descriptor
-
-Here is an example that shows all the possibilities of this format:
-
----
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo" />
-               <type fullname="Bar" preserve="nothing" required="false" />
-               <type fullname="Baz" preserve="fields" required="false" />
-               <type fullname="Gazonk">
-                       <method signature="System.Void .ctor(System.String)" />
-                       <field signature="System.String _blah" />
-               </type>
-       </assembly>
-</linker>
----
-
-In this example, the linker will link the types Foo, Bar, Baz and Gazonk.
-
-The fullname attribute specifies the fullname of the type in the format
-specified by ECMA-335. This is in Mono and certain cases not the same
-as the one reported by Type.FullName (nested classes e.g.).
-
-The preserve attribute ensures that all the fields of the type Baz will be
-always be linked, not matter if they are used or not, but that neither the
-fields or the methods of Bar will be linked if they are not used. Not
-specifying a preserve attribute implies that we are preserving everything in
-the specified type.
-
-The required attribute specifies that if the type is not marked, during the
-mark operation, it will not be linked.
-
-The type Gazonk will be linked, as well as its constructor taking a string as a
-parameter, and it's _blah field.
-
-You can have multiple assembly nodes.
-
-6) The i18n Assemblies
-
-Mono have a few assemblies which contains everything region specific:
-
-    I18N.CJK.dll
-    I18N.MidEast.dll
-    I18N.Other.dll
-    I18N.Rare.dll
-    I18N.West.dll
-
-By default, they will all be copied to the output directory. But you can
-specify which one you want using the command:
-
-monolinker -l choice
-
-Where choice can either be: none, all, cjk, mideast, other, rare or west. You can
-combine the values with a comma.
-
-Example:
-
-monolinker -a assembly -l mideast,cjk
-
-7) Specifying directories where the linker should look for assemblies
-
-By default, the linker will first look for assemblies in the directories `.'
-and `bin'. You can specify
-
-Example:
-
-monoliner -d ../../libs -a program.exe
-
-8) Adding custom steps to the linker.
-
-You can write custom steps for the linker and tell the linker to use them.
-Let's take a simple example:
-
-using System;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-namespace Foo {
-
-       public class FooStep : IStep {
-
-               public void Process (LinkContext context)
-               {
-                       foreach (IStep step in context.Pipeline.GetSteps ()) {
-                               Console.WriteLine (step.GetType ().Name);
-                       }
-               }
-       }
-}
-
-
-That is compiled against the linker to a Foo.dll assembly.
-
-You can ask the linker to add it at the end of the pipeline:
-
-monolinker -s Foo.FooStep,Foo -a program.exe
-
-Or you can ask the linker to add it after a specific step:
-
-monolinker -s MarkStep:Foo.FooStep,Foo -a program.exe
-
-Or before a specific step:
-
-monolinker -s Foo.FooStep,Foo:MarkStep
-
-* Inside the linker
-
-The linker is a quite small piece of code, and it pretty simple to address.
-Its only dependency is Mono.Cecil, that is used to read, modify and write back
-the assemblies.
-
-Everything is located in the namespace Mono.Linker, or in sub namespaces.
-Being a command line utility, its entry point function is in the class Driver.
-
-This class is in charge of analyzing the command line, and to instantiate two
-important objects, a LinkContext, and a Pipeline.
-
-The LinkContext contains all the informations that will be used during the
-linking process, such as the assemblies involved, the output directory and
-probably other useful stuff.
-
-The Pipeline is simply a queue of actions (steps), to be applied to the current
-context. The whole process of linking is split into those differents steps
-that are all located in the Mono.Linker.Steps namespace.
-
-Here are the current steps that are implemented, in the order they are used:
-
-1) ResolveFromAssembly or ResolveFromXml
-
-Those steps are used to initialize the context, and pre-mark the root code
-that will be used as a source for the linker.
-
-Resolving from an assembly or resolving from a xml descriptor is a decision
-taken in the command line parsing.
-
-2) LoadReferences
-
-This step will load all the references of all the assemblies involved in the
-current context.
-
-3) Blacklist
-
-This step is used if and only if you have specified that the core should be
-linked. It will load a bunch of resources from the assemblies, that are
-actually a few XML descriptors, that will ensure that some types and methods
-that are used from inside the runtime are properly linked and not removed.
-
-It is doing so by inserting a ResolveFromXml step per blacklist in the
-pipeline.
-
-4) Mark
-
-This is the most complex step. The linker will get from the context the list
-of types, fields and methods that have been pre-marked in the resolve steps,
-and walk through all of them. For every method, it will analyse the CIL stream,
-to find references to other fields, types, or methods.
-
-When it encounters such a reference, it will resolve the original definition of
-this reference, and add this to the queue of items to be processed. For
-instance, if have in a source assembly a call to Console.WriteLine, the linker
-will resolve the appropriate method WriteLine in the Console type from the
-mscorlib assembly, and add it to the queue. When this WriteLine method will be
-dequeued, and processed, the linker will go through everything that is used in
-it, and add it to the queue, if they have not been processed already.
-
-To know if something have been marked to be linked, or processed, the linker
-is using a functionality of Cecil called annotations. Almost everything in
-Cecil can be annotated. Concretely, it means that almost everything own an
-Hashtable in which you can add what you want, using the keys and the values you
-want.
-
-So the linker will annotate assemblies, types, methods and fields to know
-what should be linked or not, and what have been processed, and how it should
-process them.
-
-This is really useful as we don't have to recreate a full hierarchy of classes
-to encapsulate the different Cecil types to add the few informations we want.
-
-5) Sweep
-
-This simple step will walk through all the elements of an assembly, and based
-on their annotations, remove them or keep them.
-
-6) Clean
-
-This step will clean parts of the assemblies, like properties. If a proprety
-used to have a getter and a setter, and that after the mark & sweep steps,
-only the getter is linked, it will update the property to reflect that.
-
-There is a few things to keep clean like properties has we've seen, events,
-nested classes, and probably a few others.
-
-7) Output
-
-For each assembly in the context, this step will act on the action associated
-to the assembly. If the assembly is marked as skip, it won't do anything,
-if it's marked as copy, it will copy the assembly to the output directory,
-and if it's link, it will save the modified assembly to the output directory.
-
-* Reporting a bug
-
-If you face a bug in the linker, please report it to:
-
-http://bugzilla.ximian.com
-
-Product: Mono tools, Component: linker.
-
-* Mailing lists
-
-You can ask questions about the linker of the cecil Google Group:
-
-http://groups.google.com/group/mono-cecil
-
---
-Jb Evain <jbevain@novell.com>
diff --git a/mcs/tools/linker/Tests/Libs/nunit-console-runner.dll b/mcs/tools/linker/Tests/Libs/nunit-console-runner.dll
deleted file mode 100755 (executable)
index f112e23..0000000
Binary files a/mcs/tools/linker/Tests/Libs/nunit-console-runner.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/Libs/nunit-console.exe b/mcs/tools/linker/Tests/Libs/nunit-console.exe
deleted file mode 100755 (executable)
index 32ca802..0000000
Binary files a/mcs/tools/linker/Tests/Libs/nunit-console.exe and /dev/null differ
diff --git a/mcs/tools/linker/Tests/Libs/nunit-console.exe.config b/mcs/tools/linker/Tests/Libs/nunit-console.exe.config
deleted file mode 100755 (executable)
index 4926127..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<configuration>
-    <!--
-     Application settings for NUnit-console.exe. Do NOT put settings
-        for use by your tests here.
-       -->
-  <appSettings>
-
-       <!--
-        Specify the location to be used by .NET for the cache
-       -->
-    <add key="shadowfiles.path" value="%temp%\nunit20\ShadowCopyCache" />
-
-  </appSettings>
-
-    <!--
-     The startup section may be used to specify the runtime versions
-     supported in the order that they will be used if more than one
-     is present. As supplied, this section is commented out, which
-     causes nunit-console to use the version of the framework with
-     which it was built.
-
-        Since .NET 1.0 does not recognize the <supportedRuntime> elements,
-        a <requiredRuntime> element is used in case it is the only version
-        of the framework that is installed.
-    -->
-    <!--
-  <startup>
-         <supportedRuntime version="v2.0.50727" />
-         <supportedRuntime version="v2.0.50215" />
-         <supportedRuntime version="v2.0.40607" />
-         <supportedRuntime version="v1.1.4322" />
-         <supportedRuntime version="v1.0.3705" />
-
-         <requiredRuntime version="v1.0.3705" />
-  </startup>
-  -->
-
-   <!--
-    The following <runtime> section allows running nunit under
-    .NET 1.0 by redirecting assemblies. The appliesTo attribute
-    causes the section to be ignored except under .NET 1.0version 1
-    on a machine with only the .NET version 1.0 runtime installed.
-    If application and its tests were built for .NET 1.1 you will
-    also need to redirect system assemblies in the test config file.
-   -->
-
- <runtime>
-
-    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
-                       appliesTo="v1.0.3705">
-
-      <dependentAssembly>
-        <assemblyIdentity name="System"
-                          publicKeyToken="b77a5c561934e089"
-                          culture="neutral"/>
-        <bindingRedirect  oldVersion="1.0.5000.0"
-                          newVersion="1.0.3300.0"/>
-      </dependentAssembly>
-
-      <dependentAssembly>
-        <assemblyIdentity name="System.Data"
-                          publicKeyToken="b77a5c561934e089"
-                          culture="neutral"/>
-        <bindingRedirect  oldVersion="1.0.5000.0"
-                          newVersion="1.0.3300.0"/>
-      </dependentAssembly>
-
-      <dependentAssembly>
-        <assemblyIdentity name="System.Drawing"
-                          publicKeyToken="b03f5f7f11d50a3a"
-                          culture="neutral"/>
-        <bindingRedirect  oldVersion="1.0.5000.0"
-                          newVersion="1.0.3300.0"/>
-      </dependentAssembly>
-
-      <dependentAssembly>
-        <assemblyIdentity name="System.Windows.Forms"
-                          publicKeyToken="b77a5c561934e089"
-                          culture="neutral"/>
-        <bindingRedirect  oldVersion="1.0.5000.0"
-                          newVersion="1.0.3300.0"/>
-      </dependentAssembly>
-
-      <dependentAssembly>
-        <assemblyIdentity name="System.Xml"
-                          publicKeyToken="b77a5c561934e089"
-                          culture="neutral"/>
-        <bindingRedirect  oldVersion="1.0.5000.0"
-                          newVersion="1.0.3300.0"/>
-      </dependentAssembly>
-
-    </assemblyBinding>
-
-  </runtime>
-
-</configuration>
\ No newline at end of file
diff --git a/mcs/tools/linker/Tests/Libs/nunit.core.dll b/mcs/tools/linker/Tests/Libs/nunit.core.dll
deleted file mode 100755 (executable)
index df7f905..0000000
Binary files a/mcs/tools/linker/Tests/Libs/nunit.core.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/Libs/nunit.framework.dll b/mcs/tools/linker/Tests/Libs/nunit.framework.dll
deleted file mode 100755 (executable)
index 5316687..0000000
Binary files a/mcs/tools/linker/Tests/Libs/nunit.framework.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/Libs/nunit.util.dll b/mcs/tools/linker/Tests/Libs/nunit.util.dll
deleted file mode 100755 (executable)
index e9e479e..0000000
Binary files a/mcs/tools/linker/Tests/Libs/nunit.util.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/Makefile b/mcs/tools/linker/Tests/Makefile
deleted file mode 100644 (file)
index 8b87256..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-MCS = mcs
-
-all: Mono.Linker.Tests.dll
-
-Mono.Cecil.dll:
-       cp ../Mono.Cecil.dll .
-
-monolinker.exe:
-       cp ../monolinker.exe .
-
-Mono.Linker.Tests.dll.sources:
-       find Mono.Linker.Tests -name "*.cs" > Mono.Linker.Tests.dll.sources
-
-Mono.Linker.Tests.dll: Mono.Cecil.dll monolinker.exe Mono.Linker.Tests.dll.sources
-       $(MCS) /target:library /out:Mono.Linker.Tests.dll /r:nunit.framework.dll /r:Mono.Cecil.dll /r:monolinker.exe @Mono.Linker.Tests.dll.sources
-
-clean:
-       rm -rf Mono.Cecil.dll monolinker.exe Mono.Linker.Tests.dll.sources Mono.Linker.Tests.dll
-
-run-test: all
-       nunit-console Mono.Linker.Tests.dll
diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests.csproj b/mcs/tools/linker/Tests/Mono.Linker.Tests.csproj
deleted file mode 100644 (file)
index a83021f..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{400A1561-B6B6-482D-9E4C-3DDAEDE5BD07}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Mono.Linker.Tests</RootNamespace>
-    <AssemblyName>Mono.Linker.Tests</AssemblyName>
-    <StartupObject>
-    </StartupObject>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-  <ItemGroup>
-    <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>Libs\nunit.framework.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\class\Mono.Cecil\Mono.Cecil.csproj">
-      <Project>{D8F63DFF-5230-43E4-9AB2-DA6E721A1FAE}</Project>
-      <Name>Mono.Cecil</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Mono.Linker.csproj">
-      <Project>{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}</Project>
-      <Name>Mono.Linker</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Mono.Linker.Tests\AbstractLinkingTestFixture.cs" />
-    <Compile Include="Mono.Linker.Tests\AbstractTestFixture.cs" />
-    <Compile Include="Mono.Linker.Tests\AssemblyLinkingTestFixture.cs" />
-    <Compile Include="Mono.Linker.Tests\AssemblyInfo.cs" />
-    <Compile Include="Mono.Linker.Tests\IntegrationTestFixture.cs" />
-    <Compile Include="Mono.Linker.Tests\XmlLinkingTestFixture.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Properties\" />
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractLinkingTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractLinkingTestFixture.cs
deleted file mode 100644 (file)
index 58dc1a5..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// AbstractLinkingTestFixture.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.IO;
-using Mono.Cecil;
-using Mono.Linker.Steps;
-using NUnit.Framework;
-
-namespace Mono.Linker.Tests {
-
-       public abstract class AbstractLinkingTestFixture : AbstractTestFixture {
-
-               [SetUp]
-               public override void SetUp ()
-               {
-                       base.SetUp ();
-
-                       TestCasesRoot = "Linker";
-               }
-
-               [TearDown]
-               public override void TearDown ()
-               {
-                       base.TearDown ();
-
-                       string output = GetOutputPath ();
-                       if (Directory.Exists (output))
-                               Directory.Delete (output, true);
-               }
-
-               protected override Pipeline GetPipeline ()
-               {
-                       Pipeline p = new Pipeline ();
-                       p.AppendStep (new LoadReferencesStep ());
-                       p.AppendStep (new BlacklistStep ());
-                       p.AppendStep (new TypeMapStep ());
-                       p.AppendStep (new MarkStep ());
-                       p.AppendStep (new SweepStep ());
-                       p.AppendStep (new CleanStep ());
-                       p.AppendStep (new OutputStep ());
-                       return p;
-               }
-
-               protected override void RunTest (string testCase)
-               {
-                       base.RunTest (testCase);
-
-                       Prepare ();
-               }
-
-               void Prepare ()
-               {
-                       Context = GetContext ();
-                       string output = GetOutputPath ();
-                       if (Directory.Exists (output))
-                               Directory.Delete (output, true);
-                       Directory.CreateDirectory (output);
-               }
-
-               protected override void Run ()
-               {
-                       base.Run ();
-                       Compare ();
-               }
-
-               void Compare ()
-               {
-                       foreach (AssemblyDefinition assembly in Context.GetAssemblies ()) {
-                               if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                                       continue;
-
-                               string fileName = GetAssemblyFileName (assembly);
-
-                               CompareAssemblies (
-                                       AssemblyFactory.GetAssembly (
-                                               Path.Combine (GetTestCasePath (), fileName)),
-                                       AssemblyFactory.GetAssembly (
-                                               Path.Combine (GetOutputPath (), fileName)));
-                       }
-               }
-
-               static void CompareAssemblies (AssemblyDefinition original, AssemblyDefinition linked)
-               {
-                       foreach (TypeDefinition originalType in original.MainModule.Types) {
-                               TypeDefinition linkedType = linked.MainModule.Types [originalType.FullName];
-                               if (NotLinked (originalType)) {
-                                       Assert.IsNull (linkedType, string.Format ("Type `{0}' should not have been linked", originalType));
-                                       continue;
-                               }
-
-                               Assert.IsNotNull (linkedType, string.Format ("Type `{0}' should have been linked", originalType));
-                               CompareTypes (originalType, linkedType);
-                       }
-               }
-
-               static void CompareTypes (TypeDefinition type, TypeDefinition linkedType)
-               {
-                       foreach (FieldDefinition originalField in type.Fields) {
-                               FieldDefinition linkedField = linkedType.Fields.GetField (originalField.Name);// TODO: also get with the type!
-                               if (NotLinked (originalField)) {
-                                       Assert.IsNull (linkedField, string.Format ("Field `{0}' should not have been linked", originalField));
-                                       continue;
-                               }
-
-                               Assert.IsNotNull (linkedField, string.Format ("Field `{0}' should have been linked", originalField));
-                       }
-
-                       foreach (MethodDefinition originalCtor in type.Constructors) {
-                               MethodDefinition linkedCtor = linkedType.Constructors.GetConstructor (originalCtor.IsStatic, originalCtor.Parameters);
-                               if (NotLinked (originalCtor)) {
-                                       Assert.IsNull (linkedCtor, string.Format ("Constructor `{0}' should not have been linked", originalCtor));
-                                       continue;
-                               }
-
-                               Assert.IsNotNull (linkedCtor, string.Format ("Constructor `{0}' should have been linked", originalCtor));
-                       }
-
-                       foreach (MethodDefinition originalMethod in type.Methods) {
-                               MethodDefinition linkedMethod = linkedType.Methods.GetMethod (originalMethod.Name, originalMethod.Parameters);
-                               if (NotLinked (originalMethod)) {
-                                       Assert.IsNull (linkedMethod, string.Format ("Method `{0}' should not have been linked", originalMethod));
-                                       continue;
-                               }
-
-                               Assert.IsNotNull (linkedMethod, string.Format ("Method `{0}' should have been linked", originalMethod));
-                       }
-               }
-
-               static bool NotLinked(ICustomAttributeProvider provider)
-               {
-                       foreach (CustomAttribute ca in provider.CustomAttributes)
-                               if (ca.Constructor.DeclaringType.Name == "NotLinkedAttribute")
-                                       return true;
-
-                       return false;
-               }
-       }
-}
diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractTestFixture.cs
deleted file mode 100644 (file)
index f4ac2d5..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// AbstractTestFixture.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.
-//
-
-namespace Mono.Linker.Tests {
-
-       using System;
-       using System.IO;
-
-       using Mono.Cecil;
-
-       using NUnit.Framework;
-
-       public abstract class AbstractTestFixture {
-
-               string _testCasesRoot;
-               string _testCase;
-               LinkContext _context;
-               Pipeline _pipeline;
-
-               protected LinkContext Context {
-                       get { return _context; }
-                       set { _context = value; }
-               }
-
-               protected Pipeline Pipeline {
-                       get { return _pipeline; }
-                       set { _pipeline = value; }
-               }
-
-               public string TestCasesRoot {
-                       get { return _testCasesRoot; }
-                       set { _testCasesRoot = value; }
-               }
-
-               public string TestCase {
-                       get { return _testCase; }
-                       set { _testCase = value; }
-               }
-
-               [SetUp]
-               public virtual void SetUp ()
-               {
-                       _pipeline = GetPipeline ();
-               }
-
-               [TearDown]
-               public virtual void TearDown ()
-               {
-               }
-
-               protected virtual Pipeline GetPipeline ()
-               {
-                       return new Pipeline ();
-               }
-
-               protected virtual LinkContext GetContext ()
-               {
-                       LinkContext context = new LinkContext (_pipeline);
-                       context.OutputDirectory = GetOutputPath ();
-                       context.CoreAction = AssemblyAction.Copy;
-                       return context;
-               }
-
-               protected string GetOutputPath ()
-               {
-                       return Path.Combine (
-                               Path.GetTempPath (),
-                               _testCase);
-               }
-
-               protected string GetTestCasePath ()
-               {
-                       return Path.Combine (
-                               Path.Combine (
-#if DEBUG
-                                       Path.Combine (Environment.CurrentDirectory,
-                                               Path.Combine ("..", "..")),
-#else
-                                       Environment.CurrentDirectory,
-#endif
-                                       "TestCases"),
-                               Path.Combine (
-                                       _testCasesRoot,
-                                       _testCase));
-               }
-
-               protected virtual void RunTest (string testCase)
-               {
-                       _testCase = testCase;
-                       _context = GetContext ();
-               }
-
-               protected virtual void Run ()
-               {
-                       string cd = Environment.CurrentDirectory;
-                       Environment.CurrentDirectory = GetTestCasePath ();
-                       try {
-                               _pipeline.Process (_context);
-                       } finally {
-                               Environment.CurrentDirectory = cd;
-                       }
-               }
-
-               protected static string GetAssemblyFileName (AssemblyDefinition asm)
-               {
-                       return asm.Name.Name + (asm.Kind == AssemblyKind.Dll ? ".dll" : ".exe");
-               }
-       }
-}
diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyInfo.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyInfo.cs
deleted file mode 100644 (file)
index 0c169fd..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// AssemblyInfo.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.Runtime.InteropServices;
-
-[assembly: AssemblyTitle ("Mono.Linker.Tests")]
-[assembly: AssemblyDescription ("NUnit tests for Mono's CIL Linker")]
-[assembly: AssemblyConfiguration ("")]
-[assembly: AssemblyProduct ("")]
-[assembly: AssemblyCopyright ("(C) 2006, Jb Evain")]
-[assembly: AssemblyCulture ("")]
-
-[assembly: CLSCompliant (false)]
-[assembly: ComVisible (false)]
-
diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyLinkingTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyLinkingTestFixture.cs
deleted file mode 100644 (file)
index 4810cd1..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// AssemblyLinkingTestFixture.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.IO;
-
-using Mono.Linker.Steps;
-using NUnit.Framework;
-
-namespace Mono.Linker.Tests {
-
-       [TestFixture]
-       public class AssemblyLinkingTestFixture : AbstractLinkingTestFixture {
-
-               [Test]
-               public void TestSimple ()
-               {
-                       RunTest ("Simple");
-               }
-
-               [Test]
-               public void TestVirtualCall ()
-               {
-                       RunTest ("VirtualCall");
-               }
-
-               [Test]
-               public void TestMultipleReferences ()
-               {
-                       RunTest ("MultipleReferences");
-               }
-
-               protected override void RunTest (string testCase)
-               {
-                       base.RunTest (testCase);
-                       Pipeline.PrependStep (
-                               new ResolveFromAssemblyStep (
-                                       Path.Combine (GetTestCasePath (), "Program.exe")));
-
-                       Run ();
-               }
-       }
-}
diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/IntegrationTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/IntegrationTestFixture.cs
deleted file mode 100644 (file)
index f455f65..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// IntegrationTestFixture.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Diagnostics;
-using System.IO;
-using Mono.Linker.Steps;
-using NUnit.Framework;
-
-namespace Mono.Linker.Tests {
-
-       [TestFixture]
-       public class IntegrationTestFixture : AbstractTestFixture {
-
-               [SetUp]
-               public override void SetUp ()
-               {
-                       base.SetUp ();
-
-                       TestCasesRoot = "Integration";
-               }
-
-               [Test]
-               public void TestHelloWorld ()
-               {
-                       RunTest ("HelloWorld");
-               }
-
-               [Test]
-               public void TestCrypto ()
-               {
-                       RunTest ("Crypto");
-               }
-
-               protected override LinkContext GetContext()
-               {
-                       LinkContext context = base.GetContext ();
-                       context.CoreAction = AssemblyAction.Link;
-                       return context;
-               }
-
-               protected override Pipeline GetPipeline ()
-               {
-                       Pipeline p = new Pipeline ();
-                       p.AppendStep (new LoadReferencesStep ());
-                       p.AppendStep (new BlacklistStep ());
-                       p.AppendStep (new TypeMapStep ());
-                       p.AppendStep (new MarkStep ());
-                       p.AppendStep (new SweepStep ());
-                       p.AppendStep (new CleanStep ());
-                       p.AppendStep (new OutputStep ());
-                       return p;
-               }
-
-               protected override void RunTest (string testCase)
-               {
-                       if (!OnMono ())
-                               Assert.Ignore ("Integration tests are only runnable on Mono");
-
-                       base.RunTest (testCase);
-                       string test = Path.Combine (GetTestCasePath (), "Test.exe");
-
-                       string original = Execute (GetTestCasePath (), "Test.exe");
-
-                       Pipeline.PrependStep (
-                               new ResolveFromAssemblyStep (
-                                       test));
-
-                       Run ();
-
-                       string linked = Execute (Context.OutputDirectory, "Test.exe");
-
-                       Assert.AreEqual (original, linked);
-               }
-
-               static bool OnMono ()
-               {
-                       return Type.GetType ("System.MonoType") != null;
-               }
-
-               static string Execute (string directory, string file)
-               {
-                       Process p = new Process ();
-                       p.StartInfo.EnvironmentVariables ["MONO_PATH"] = directory;
-                       p.StartInfo.CreateNoWindow = true;
-                       p.StartInfo.WorkingDirectory = directory;
-                       p.StartInfo.FileName = "mono";
-                       p.StartInfo.Arguments = file;
-                       p.StartInfo.RedirectStandardOutput = true;
-                       p.StartInfo.UseShellExecute = false;
-
-                       p.Start ();
-                       p.WaitForExit ();
-
-                       return p.StandardOutput.ReadToEnd ();
-               }
-       }
-}
diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/XmlLinkingTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/XmlLinkingTestFixture.cs
deleted file mode 100644 (file)
index 1e89290..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// XmlLinkingTestFixture.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// (C) 2006 Jb Evain
-//
-// 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.IO;
-using System.Xml.XPath;
-
-using Mono.Linker.Steps;
-using NUnit.Framework;
-
-
-namespace Mono.Linker.Tests {
-
-       [TestFixture]
-       public class XmlLinkingTestFixture : AbstractLinkingTestFixture {
-
-               [Test]
-               public void TestSimpleXml ()
-               {
-                       RunTest ("SimpleXml");
-               }
-
-               [Test]
-               public void TestInterface ()
-               {
-                       RunTest ("Interface");
-               }
-
-               [Test]
-               public void TestReferenceInVirtualMethod ()
-               {
-                       RunTest ("ReferenceInVirtualMethod");
-               }
-
-               [Test]
-               public void TestGenerics ()
-               {
-                       RunTest ("Generics");
-               }
-
-               [Test]
-               public void TestNestedNested ()
-               {
-                       RunTest ("NestedNested");
-               }
-
-               [Test]
-               public void TestPreserveFieldsRequired ()
-               {
-                       RunTest ("PreserveFieldsRequired");
-               }
-
-               [Test]
-               public void TestReferenceInAttributes ()
-               {
-                       RunTest ("ReferenceInAttributes");
-               }
-
-               [Test]
-               public void TestXmlPattern ()
-               {
-                       RunTest ("XmlPattern");
-               }
-
-               protected override void RunTest (string testCase)
-               {
-                       base.RunTest (testCase);
-                       Pipeline.PrependStep (
-                               new ResolveFromXmlStep (
-                                       new XPathDocument (Path.Combine (GetTestCasePath (), "desc.xml"))));
-
-                       Run ();
-               }
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.cs b/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.cs
deleted file mode 100644 (file)
index 8c38f92..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using System.Security.Cryptography;
-using System.Text;
-
-class Test {
-
-       static void Main ()
-       {
-               byte [] foo = Encoding.UTF8.GetBytes ("foobared");
-
-               HashAlgorithm ha = MD5.Create ();
-               byte [] hash = ha.ComputeHash (foo);
-
-               Console.WriteLine (Encoding.UTF8.GetString (hash));
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.exe b/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.exe
deleted file mode 100755 (executable)
index 2decc49..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.exe and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.cs b/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.cs
deleted file mode 100644 (file)
index 4a65b44..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-class Test {
-
-       static void Main ()
-       {
-               Console.WriteLine ("Hello world!");
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.exe b/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.exe
deleted file mode 100755 (executable)
index 2f4f4c9..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.exe and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.cs
deleted file mode 100644 (file)
index 75fe1ed..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-
-public class Foo {
-
-       void Bar ()
-       {
-               int i = 42;
-               string s = "hey";
-
-               Baz<int> bi = new Baz<int> (i);
-               bi.Gazonk ();
-               bi.Bat<string>(i, s);
-
-               Baz<string> bs = new Baz<string> (s);
-               bs.Gazonk ();
-               bs.Bat<int>(s, i);
-               bs.BiroBiro ();
-
-               bs.Blam<Bang> ();
-       }
-}
-
-public class Baz<T> {
-
-       T _t;
-
-       public Baz (T t)
-       {
-               _t = t;
-       }
-
-       public void Gazonk ()
-       {
-               Console.WriteLine (_t);
-       }
-
-       public void Bat<M> (T t, M m)
-       {
-               Console.WriteLine ("{0}{1}", t, m);
-       }
-
-       public void Blam<M> ()
-       {
-       }
-
-       public T [] BiroBiro ()
-       {
-               return new T [0];
-       }
-}
-
-class Bang {
-
-       [NotLinked] public Bang ()
-       {
-       }
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.dll
deleted file mode 100644 (file)
index fe5cab1..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/Generics/Makefile
deleted file mode 100644 (file)
index 2e5bf5b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Generics/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/Generics/desc.xml
deleted file mode 100644 (file)
index 0dd61b9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.cs
deleted file mode 100644 (file)
index 7aa9394..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-
-public class Foo : IFoo {
-
-       public void Gazonk ()
-       {
-       }
-}
-
-public interface IFoo : IBar {
-}
-
-public interface IBar {
-
-       void Gazonk ();
-}
-
-[NotLinked] public class Baz : IBaz {
-}
-
-[NotLinked] public interface IBaz {
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.dll
deleted file mode 100644 (file)
index 2ae8b92..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Interface/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/Interface/Makefile
deleted file mode 100644 (file)
index 2e5bf5b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Interface/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/Interface/desc.xml
deleted file mode 100644 (file)
index 0dd61b9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.cs b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.cs
deleted file mode 100644 (file)
index c2f0df4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-public class Bar {
-
-       string bang = "bang !";
-
-       public Bar ()
-       {
-       }
-
-       public void Bang ()
-       {
-               Console.WriteLine (bang);
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.dll b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.dll
deleted file mode 100644 (file)
index 159106d..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.cs b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.cs
deleted file mode 100644 (file)
index ab5241c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-public class Baz {
-
-       public void Chain (Foo f)
-       {
-               f.b.Bang ();
-       }
-
-       [NotLinked] public void Lurman ()
-       {
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.dll b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.dll
deleted file mode 100644 (file)
index 977b20f..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.cs b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.cs
deleted file mode 100644 (file)
index 746a2b2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-public class Foo {
-
-       public Bar b;
-
-       public Foo (Bar b)
-       {
-               this.b = b;
-       }
-
-       public void UseBar ()
-       {
-               b.Bang ();
-       }
-
-       [NotLinked] public void Blam ()
-       {
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.dll b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.dll
deleted file mode 100644 (file)
index 54e10fe..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Makefile
deleted file mode 100644 (file)
index 9f56e6e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library NotLinkedAttribute.cs
-       MCS /t:library Bar.cs
-       MCS /t:library /r:Bar.dll /r:NotLinkedAttribute.dll Foo.cs
-       MCS /t:library /r:Foo.dll /r:Bar.dll /r:NotLinkedAttribute.dll Baz.cs
-       MCS /t:library /r:Foo.dll /r:Bar.dll /r:NotLinkedAttribute.dll Baz.cs
-       MCS /r:Foo.dll /r:Bar.dll /r:Baz.dll /r:NotLinkedAttribute Program.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.cs b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.cs
deleted file mode 100644 (file)
index 5290344..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-using System;
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.dll b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.dll
deleted file mode 100644 (file)
index 06929d0..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.cs b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.cs
deleted file mode 100644 (file)
index 4e1debd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-public class Program {
-
-       public static int Main ()
-       {
-               Program p = new Program ();
-               p.Run ();
-
-               return 0;
-       }
-
-       void Run ()
-       {
-               Foo f = new Foo (new Bar ());
-               f.UseBar ();
-
-               Baz b = new Baz ();
-               b.Chain (f);
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.exe b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.exe
deleted file mode 100644 (file)
index c8e7597..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.exe and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.cs
deleted file mode 100644 (file)
index 1391162..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-public class Foo {
-}
-
-[NotLinked] public class Bar {
-
-       [NotLinked] public class Baz {
-
-               [NotLinked] public class Gazonk {
-               }
-       }
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.dll
deleted file mode 100644 (file)
index 49151f1..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Makefile
deleted file mode 100644 (file)
index 2e5bf5b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/desc.xml
deleted file mode 100644 (file)
index 0dd61b9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.cs
deleted file mode 100644 (file)
index 63a5ee7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-
-public class Foo {
-
-       public Foo ()
-       {
-               new NotRequiredButUsedNotPreserved ();
-               new NotRequiredButUsedAndFieldsPreserved ();
-       }
-}
-
-public class NotRequiredButUsedNotPreserved {
-
-       [NotLinked] public int foo;
-       [NotLinked] public int bar;
-}
-
-public class NotRequiredButUsedAndFieldsPreserved {
-
-       public int foo;
-       public int bar;
-
-       [NotLinked] public int FooBar ()
-       {
-               return foo + bar;
-       }
-}
-
-[NotLinked] public class NotRequiredAndNotUsed {
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.dll
deleted file mode 100755 (executable)
index 941d6c3..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Makefile
deleted file mode 100644 (file)
index 2e5bf5b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/desc.xml
deleted file mode 100644 (file)
index 979d4e0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo" />
-               <type fullname="NotRequiredButUsedNotPreserved" preserve="nothing" required="false" />
-               <type fullname="NotRequiredButUsedAndFieldsPreserved" preserve="fields" required="false" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.cs b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.cs
deleted file mode 100644 (file)
index 6ca5a7f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-
-namespace LibLib {
-
-       public class LibLibAttribute : Attribute {
-
-               public Type LibLibType {
-                       [NotLinked] get { return null; }
-                       set {}
-               }
-       }
-
-       public class BilBil {
-
-               [NotLinked] public BilBil ()
-               {
-               }
-       }
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.dll b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.dll
deleted file mode 100755 (executable)
index 2f1e457..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.cs
deleted file mode 100644 (file)
index cb3903f..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-using System;
-using LibLib;
-
-public class BarAttribute : Attribute {
-
-       public BarAttribute ()
-       {
-       }
-
-       public BarAttribute (Type type)
-       {
-       }
-
-       public Type FieldType;
-
-       public Type PropertyType {
-               [NotLinked] get { return null; }
-               set {}
-       }
-}
-
-[Bar (typeof (Guy_A))]
-public class Foo {
-
-       [Bar (FieldType = typeof (Guy_B))]
-       public Foo a;
-
-       [Bar (PropertyType = typeof (Guy_C))]
-       public Foo b;
-
-       [LibLib (LibLibType = typeof (BilBil))]
-       public Foo c;
-
-       [LibLib (LibLibType = typeof (Guy_D))]
-       public Foo d;
-}
-
-public class Guy_A {
-
-       [NotLinked] public Guy_A ()
-       {
-       }
-}
-
-public class Guy_B {
-
-       [NotLinked] public Guy_B ()
-       {
-       }
-}
-
-public class Guy_C {
-
-       [NotLinked] public Guy_C ()
-       {
-       }
-}
-
-public class Guy_D {
-
-       [NotLinked] public Guy_D ()
-       {
-       }
-}
-
-[NotLinked] public class Baz {
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.dll
deleted file mode 100755 (executable)
index 7c5b997..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/desc.xml
deleted file mode 100644 (file)
index 0dd61b9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.cs
deleted file mode 100644 (file)
index 8b840b4..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-
-using System;
-
-public class Foo {
-
-       public void Do ()
-       {
-               Bar b = new Baz ();
-               b.Bang ();
-       }
-}
-
-public class Bar {
-
-       public virtual void Bang ()
-       {
-       }
-}
-
-public class Baz : Bar {
-
-       private string _hey;
-
-       public string Hey {
-               [NotLinked] get { return _hey; }
-               [NotLinked] set { _hey = value; }
-       }
-
-       public override void Bang ()
-       {
-               Console.WriteLine (_hey);
-       }
-}
-
-[NotLinked] public class NotLinkedAttribute : Attribute {}
\ No newline at end of file
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.dll
deleted file mode 100644 (file)
index b56fa60..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Makefile
deleted file mode 100644 (file)
index 2e5bf5b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/desc.xml
deleted file mode 100644 (file)
index 0dd61b9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.cs
deleted file mode 100644 (file)
index 538205a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-
-public class Library {
-
-       private int _pouet;
-       [NotLinked] private int _hey;
-
-       public Library ()
-       {
-               _pouet = 1;
-       }
-
-       [NotLinked] public Library (int pouet)
-       {
-               _pouet = pouet;
-       }
-
-       public int Hello ()
-       {
-               Console.WriteLine ("Hello");
-               return _pouet;
-       }
-
-       [NotLinked] public void Hey (int hey)
-       {
-               _hey = hey;
-               Console.WriteLine (_hey);
-       }
-}
-
-
-[NotLinked] public class Toy {
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.dll
deleted file mode 100644 (file)
index 5225e88..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/Simple/Makefile
deleted file mode 100644 (file)
index 356b529..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
-       MCS /r:Library.dll Program.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.cs b/mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.cs
deleted file mode 100644 (file)
index 6d3adb7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-public class Program {
-
-       public static int Main ()
-       {
-               Program p = new Program ();
-               return p.Run ();
-       }
-
-       int Run ()
-       {
-               Library lib = new Library ();
-               return lib.Hello ();
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.exe b/mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.exe
deleted file mode 100644 (file)
index 1605ce0..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.exe and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.cs
deleted file mode 100644 (file)
index 4e81b42..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-
-public class Foo {
-
-       int _baz;
-       [NotLinked] int _shebang;
-
-       public Foo ()
-       {
-               _baz = 42;
-       }
-
-       public int Baz ()
-       {
-               return _baz;
-       }
-
-       [NotLinked] public int Shebang (int bang)
-       {
-               return _shebang = bang * 2;
-       }
-}
-
-public class Bar {
-
-       int _truc;
-
-       public Bar ()
-       {
-               _truc = 12;
-       }
-
-       public int Truc ()
-       {
-               return _truc;
-       }
-}
-
-[NotLinked] public class Gazonk {
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.dll
deleted file mode 100644 (file)
index c37c059..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Makefile
deleted file mode 100644 (file)
index 2e5bf5b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/desc.xml
deleted file mode 100644 (file)
index 2a20ed3..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo">
-                       <field signature="System.Int32 _baz" />
-                       <method signature="System.Void .ctor()" />
-                       <method signature="System.Int32 Baz()" />
-               </type>
-               <type fullname="Bar" />
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.cs
deleted file mode 100644 (file)
index b9c3f02..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-
-public class Library {
-
-       public Library ()
-       {
-       }
-
-       public int Shebang ()
-       {
-               return Bang ();
-       }
-
-       protected virtual int Bang ()
-       {
-               return 1;
-       }
-}
-
-
-public class PowerFulLibrary : Library {
-
-       protected override int Bang ()
-       {
-               return 0;
-       }
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.dll
deleted file mode 100644 (file)
index 0f2ff3f..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Makefile
deleted file mode 100644 (file)
index 356b529..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
-       MCS /r:Library.dll Program.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.cs b/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.cs
deleted file mode 100644 (file)
index 1d4a64d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-public class Program {
-
-       public static int Main ()
-       {
-               Program p = new Program ();
-               return p.Run ();
-       }
-
-       int Run ()
-       {
-               Library lib = new PowerFulLibrary ();
-               return lib.Shebang ();
-       }
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.exe b/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.exe
deleted file mode 100644 (file)
index f5a9bec..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.exe and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.cs
deleted file mode 100755 (executable)
index 7f14865..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-
-namespace Foo {
-
-       [NotLinked] public class BarBar {
-       }
-
-       public class FooBaz {
-
-               public FooBaz ()
-               {
-               }
-
-               [NotLinked] public void BarBaz ()
-               {
-               }
-       }
-
-       public class TrucBaz {
-
-               public TrucBaz ()
-               {
-               }
-       }
-
-       public class BazBaz {
-
-               public BazBaz ()
-               {
-               }
-       }
-}
-
-[NotLinked, AttributeUsage (AttributeTargets.All)]
-public class NotLinkedAttribute : Attribute {
-}
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.dll
deleted file mode 100755 (executable)
index 80e7ef3..0000000
Binary files a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.dll and /dev/null differ
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Makefile
deleted file mode 100755 (executable)
index 2e5bf5b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../../config.make
-
-all:
-       MCS /t:library Library.cs
diff --git a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/desc.xml
deleted file mode 100755 (executable)
index c8e1e23..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<linker>
-       <assembly fullname="Library">
-               <type fullname="Foo.*Baz">
-                       <method signature="System.Void .ctor()" />
-               </type>
-       </assembly>
-</linker>
diff --git a/mcs/tools/linker/Tests/TestCases/config.make b/mcs/tools/linker/Tests/TestCases/config.make
deleted file mode 100644 (file)
index 8323eb2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-MCS = mcs
-
diff --git a/mcs/tools/linker/configure b/mcs/tools/linker/configure
deleted file mode 100755 (executable)
index 2598cb6..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-VERSION=0.1
-prefix=/usr/local
-while test x$1 != x; do
-        case $1 in
-                --prefix=*)
-                        prefix=`echo $1 | sed 's/--prefix=//'`
-                        ;;
-                --prefix)
-                        echo --prefix needs an argument: --prefix=directory >&2
-                        ;;
-                *)
-                        echo Unknown argument $1 >&2
-        esac
-        shift
-done
-
-echo "prefix=$prefix" > config.make
-echo "RUNTIME=mono" >> config.make
-echo "ASSEMBLY_VERSION=$VERSION.0.0" >> config.make
-echo "VERSION=$VERSION" >> config.make
-
-echo "monolinker has been configure to be installed in $prefix"
index cfff038a83180de83a050e8ef3cf71352ff92d37..fa7f88b573b1afcc9abc69d5a1a7b54e081999db 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
-    <Compile Include=".\Mono.Linker.Steps\BaseStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\BlacklistStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\CleanStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\IStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\LoadI18nAssemblies.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\LoadReferencesStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\MarkStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\OutputStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\RegenerateGuidStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\ResolveFromAssemblyStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\ResolveFromXApiStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\ResolveFromXmlStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\ResolveStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\SweepStep.cs" />\r
-    <Compile Include=".\Mono.Linker.Steps\TypeMapStep.cs" />\r
-    <Compile Include=".\Mono.Linker\Annotations.cs" />\r
-    <Compile Include=".\Mono.Linker\AssemblyAction.cs" />\r
-    <Compile Include=".\Mono.Linker\AssemblyInfo.cs" />\r
-    <Compile Include=".\Mono.Linker\AssemblyResolver.cs" />\r
-    <Compile Include=".\Mono.Linker\Driver.cs" />\r
-    <Compile Include=".\Mono.Linker\I18nAssemblies.cs" />\r
-    <Compile Include=".\Mono.Linker\IXApiVisitor.cs" />\r
-    <Compile Include=".\Mono.Linker\LinkContext.cs" />\r
-    <Compile Include=".\Mono.Linker\MethodAction.cs" />\r
-    <Compile Include=".\Mono.Linker\Pipeline.cs" />\r
-    <Compile Include=".\Mono.Linker\TypePreserve.cs" />\r
-    <Compile Include=".\Mono.Linker\XApiReader.cs" />\r  </ItemGroup>\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\BaseStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\BlacklistStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\CleanStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\IStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\LoadI18nAssemblies.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\LoadReferencesStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\MarkStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\OutputStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\RegenerateGuidStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\ResolveFromAssemblyStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\ResolveFromXApiStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\ResolveFromXmlStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\ResolveStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\SweepStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker.Steps\TypeMapStep.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\Annotations.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\AssemblyAction.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\AssemblyInfo.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\AssemblyResolver.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\Driver.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\I18nAssemblies.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\IXApiVisitor.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\LinkContext.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\MethodAction.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\Pipeline.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\TypePreserve.cs" />\r
+    <Compile Include="..\..\..\external\linker\linker\Mono.Linker\XApiReader.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
       <Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
       <Name>System.Xml-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
+    <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+      <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
       <Name>Mono.Cecil-net_4_x</Name>\r
     </ProjectReference>\r
   </ItemGroup>\r
index 90b8ae0f7de28eb9055f40cbc8ac28d12ca99567..66410e5fe69bddfb2af8f759616b3291a8797308 100644 (file)
@@ -1,27 +1,27 @@
-./Mono.Linker/Pipeline.cs
-./Mono.Linker/AssemblyInfo.cs
-./Mono.Linker/AssemblyResolver.cs
-./Mono.Linker/TypePreserve.cs
-./Mono.Linker/Annotations.cs
-./Mono.Linker/LinkContext.cs
-./Mono.Linker/AssemblyAction.cs
-./Mono.Linker/Driver.cs
-./Mono.Linker/I18nAssemblies.cs
-./Mono.Linker/MethodAction.cs
-./Mono.Linker/XApiReader.cs
-./Mono.Linker/IXApiVisitor.cs
-./Mono.Linker.Steps/BaseStep.cs
-./Mono.Linker.Steps/LoadReferencesStep.cs
-./Mono.Linker.Steps/LoadI18nAssemblies.cs
-./Mono.Linker.Steps/ResolveFromXmlStep.cs
-./Mono.Linker.Steps/SweepStep.cs
-./Mono.Linker.Steps/RegenerateGuidStep.cs
-./Mono.Linker.Steps/ResolveFromXApiStep.cs
-./Mono.Linker.Steps/ResolveFromAssemblyStep.cs
-./Mono.Linker.Steps/ResolveStep.cs
-./Mono.Linker.Steps/CleanStep.cs
-./Mono.Linker.Steps/MarkStep.cs
-./Mono.Linker.Steps/BlacklistStep.cs
-./Mono.Linker.Steps/OutputStep.cs
-./Mono.Linker.Steps/TypeMapStep.cs
-./Mono.Linker.Steps/IStep.cs
+../../../external/linker/linker/Mono.Linker/Pipeline.cs
+../../../external/linker/linker/Mono.Linker/AssemblyInfo.cs
+../../../external/linker/linker/Mono.Linker/AssemblyResolver.cs
+../../../external/linker/linker/Mono.Linker/TypePreserve.cs
+../../../external/linker/linker/Mono.Linker/Annotations.cs
+../../../external/linker/linker/Mono.Linker/LinkContext.cs
+../../../external/linker/linker/Mono.Linker/AssemblyAction.cs
+../../../external/linker/linker/Mono.Linker/Driver.cs
+../../../external/linker/linker/Mono.Linker/I18nAssemblies.cs
+../../../external/linker/linker/Mono.Linker/MethodAction.cs
+../../../external/linker/linker/Mono.Linker/XApiReader.cs
+../../../external/linker/linker/Mono.Linker/IXApiVisitor.cs
+../../../external/linker/linker/Mono.Linker.Steps/BaseStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/LoadReferencesStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs
+../../../external/linker/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/SweepStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/RegenerateGuidStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/ResolveStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/CleanStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/MarkStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/BlacklistStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/OutputStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/TypeMapStep.cs
+../../../external/linker/linker/Mono.Linker.Steps/IStep.cs
diff --git a/mcs/tools/linker/monolinker.in b/mcs/tools/linker/monolinker.in
deleted file mode 100644 (file)
index 55e24cb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-mono $MONO_EXTRA_ARGS @prefix@/lib/mink/mink.exe "$@"
diff --git a/mcs/tools/linker/profiler/Makefile b/mcs/tools/linker/profiler/Makefile
deleted file mode 100644 (file)
index 6a9702b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-SRC = link.c
-OBJ = libmono-profiler-link.so
-
-all:
-       gcc -g -Wall -shared -o $(OBJ) $(SRC) `pkg-config --cflags --libs mono`
-
-clean:
-       rm -f $(OBJ)
diff --git a/mcs/tools/linker/profiler/link.c b/mcs/tools/linker/profiler/link.c
deleted file mode 100644 (file)
index f81e251..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * link.c: a profiler to help the static linker
- *
- * Authors:
- *   Jb Evain (jbevain@novell.com)
- *
- * (C) 2007 Novell, Inc. http://www.novell.com
- *
- */
-#include <glib.h>
-#include <string.h>
-#include <mono/metadata/assembly.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/metadata.h>
-#include <mono/metadata/profiler.h>
-
-struct _MonoProfiler {
-       const char *output_file;
-       GHashTable *images;
-};
-
-typedef struct _LinkedImage {
-       MonoImage *image;
-       GHashTable *types;
-} LinkedImage;
-
-typedef struct _LinkedType {
-       MonoClass *klass;
-       GHashTable *methods;
-} LinkedType;
-
-typedef struct _LinkedMethod {
-       MonoMethod *method;
-} LinkedMethod;
-
-static void
-link_append_class_name (GString *res, MonoClass *klass, gboolean include_namespace)
-{
-       if (!klass) {
-               g_string_append (res, "**unknown**");
-               return;
-       }
-
-       if (mono_class_get_nesting_type (klass)) {
-               link_append_class_name (res, mono_class_get_nesting_type (klass), include_namespace);
-               g_string_append_c (res, '/');
-       }
-
-       if (include_namespace && *(mono_class_get_namespace (klass)))
-               g_string_sprintfa (res, "%s.", mono_class_get_namespace (klass));
-
-       g_string_sprintfa (res, "%s", mono_class_get_name (klass));
-}
-
-static MonoType *
-link_get_element_type (MonoType *type)
-{
-       return mono_class_get_type (mono_class_get_element_class (mono_class_from_mono_type (type)));
-}
-
-static void
-link_type_get_desc (GString *res, MonoType *type, gboolean include_namespace) {
-       switch (mono_type_get_type (type)) {
-       case MONO_TYPE_VOID:
-               g_string_append (res, "System.Void"); break;
-       case MONO_TYPE_CHAR:
-               g_string_append (res, "System.Char"); break;
-       case MONO_TYPE_BOOLEAN:
-               g_string_append (res, "System.Boolean"); break;
-       case MONO_TYPE_U1:
-               g_string_append (res, "System.Byte"); break;
-       case MONO_TYPE_I1:
-               g_string_append (res, "System.SByte"); break;
-       case MONO_TYPE_U2:
-               g_string_append (res, "System.UInt16"); break;
-       case MONO_TYPE_I2:
-               g_string_append (res, "System.Int16"); break;
-       case MONO_TYPE_U4:
-               g_string_append (res, "System.UInt32"); break;
-       case MONO_TYPE_I4:
-               g_string_append (res, "System.Int32"); break;
-       case MONO_TYPE_U8:
-               g_string_append (res, "System.UInt64"); break;
-       case MONO_TYPE_I8:
-               g_string_append (res, "System.Int64"); break;
-       case MONO_TYPE_FNPTR:
-               g_string_append (res, "*()"); break;
-       case MONO_TYPE_U:
-               g_string_append (res, "System.UIntPtr"); break;
-       case MONO_TYPE_I:
-               g_string_append (res, "System.IntPtr"); break;
-       case MONO_TYPE_R4:
-               g_string_append (res, "System.Single"); break;
-       case MONO_TYPE_R8:
-               g_string_append (res, "System.Double"); break;
-       case MONO_TYPE_STRING:
-               g_string_append (res, "System.String"); break;
-       case MONO_TYPE_OBJECT:
-               g_string_append (res, "System.Object"); break;
-       case MONO_TYPE_PTR:
-               link_type_get_desc (res, mono_type_get_ptr_type (type), include_namespace);
-               g_string_append_c (res, '*');
-               break;
-       case MONO_TYPE_ARRAY: {
-               MonoClass *eklass = mono_class_get_element_class (mono_class_from_mono_type (type));
-               link_type_get_desc (res, mono_class_get_type (eklass), include_namespace);
-               g_string_sprintfa (res, "[%d]", mono_class_get_rank (eklass));
-               break;
-       }
-       case MONO_TYPE_SZARRAY:
-               link_type_get_desc (res, link_get_element_type (type), include_namespace);
-               g_string_append (res, "[]");
-               break;
-       case MONO_TYPE_CLASS:
-       case MONO_TYPE_VALUETYPE:
-               link_append_class_name (res, mono_type_get_class (type), include_namespace);
-               break;
-       case MONO_TYPE_GENERICINST:
-               //link_type_get_desc (res, &type->data.generic_class->container_class->byval_arg, include_namespace);  /* ? */
-               break;
-       case MONO_TYPE_VAR:
-       case MONO_TYPE_MVAR:
-               //g_string_append (res, type->data.generic_param->name);  /* ? */
-               break;
-       default:
-               break;
-       }
-       if (mono_type_is_byref (type))
-               g_string_append (res, "&amp;");
-}
-
-static char *
-link_type_full_name (MonoType *type)
-{
-       GString *str;
-       char *res;
-
-       str = g_string_new ("");
-       link_type_get_desc (str, type, TRUE);
-
-       res = g_strdup (str->str);
-       g_string_free (str, TRUE);
-       return res;
-}
-
-static char *
-link_class_full_name (MonoClass *klass)
-{
-       return link_type_full_name (mono_class_get_type (klass));
-}
-
-static char *
-link_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace)
-{
-       int i;
-       char *result;
-       GString *res = g_string_new ("");
-
-       for (i = 0; i < sig->param_count; ++i) {
-               if (i > 0)
-                       g_string_append_c (res, ',');
-               link_type_get_desc (res, sig->params [i], include_namespace);
-       }
-       result = res->str;
-       g_string_free (res, FALSE);
-       return result;
-}
-
-static char *
-link_method_signature (MonoMethod *method)
-{
-       MonoMethodSignature *sig;
-       char *res;
-
-       sig = mono_method_signature (method);
-       char *tmpsig = link_signature_get_desc (sig, TRUE);
-       res = g_strdup_printf ("%s %s(%s)",
-               link_type_full_name (mono_signature_get_return_type (sig)),
-               mono_method_get_name (method), tmpsig);
-       g_free (tmpsig);
-
-       return res;
-}
-
-static char *
-link_image_fullname (MonoImage *image)
-{
-       MonoAssemblyName *name;
-       char *res;
-
-       name = g_new0 (MonoAssemblyName, 1);
-       mono_assembly_fill_assembly_name (image, name);
-       res = mono_stringify_assembly_name (name);
-       g_free (name);
-       return res;
-}
-
-static LinkedType *
-link_get_linked_type (LinkedImage *limage, MonoClass *klass)
-{
-       LinkedType *ltype;
-
-       ltype = (LinkedType *) g_hash_table_lookup (limage->types, klass);
-
-       if (ltype)
-               return ltype;
-
-       ltype = g_new0 (LinkedType, 1);
-       ltype->klass = klass;
-       ltype->methods = g_hash_table_new (NULL, NULL);
-       g_hash_table_insert (limage->types, klass, ltype);
-       return ltype;
-}
-
-static LinkedImage *
-link_get_linked_image (MonoProfiler *prof, MonoImage *image)
-{
-       LinkedImage *limage;
-
-       limage = (LinkedImage *) g_hash_table_lookup (prof->images, image);
-
-       if (limage)
-               return limage;
-
-       limage = g_new0 (LinkedImage, 1);
-       limage->image = image;
-       limage->types = g_hash_table_new (NULL, NULL);
-       g_hash_table_insert (prof->images, image, limage);
-       return limage;
-}
-
-static void
-link_method_leave (MonoProfiler *prof, MonoMethod *method)
-{
-       MonoClass *klass;
-       MonoImage *image;
-
-       LinkedType *ltype;
-       LinkedImage *limage;
-       LinkedMethod *lmethod;
-
-       klass = mono_method_get_class (method);
-       image = mono_class_get_image (klass);
-
-       limage = link_get_linked_image (prof, image);
-       ltype = link_get_linked_type (limage, klass);
-
-       lmethod = (LinkedMethod *) g_hash_table_lookup (ltype->methods, method);
-       if (lmethod)
-               return;
-
-       lmethod = g_new0 (LinkedMethod, 1);
-       lmethod->method = method;
-       g_hash_table_insert (ltype->methods, method, lmethod);
-}
-
-static void
-link_free_member (gpointer key, gpointer value, gpointer data)
-{
-       g_free (value);
-}
-
-static void
-link_free_type (gpointer key, gpointer value, gpointer data)
-{
-       LinkedType *type = (LinkedType *) value;
-
-       g_hash_table_foreach (type->methods, link_free_member, NULL);
-       g_free (type);
-}
-
-static void
-link_free_image (gpointer key, gpointer value, gpointer data)
-{
-       LinkedImage *image = (LinkedImage *) value;
-
-       g_hash_table_foreach (image->types, link_free_type, NULL);
-       g_free (image);
-}
-
-static void
-link_print_method (gpointer key, gpointer value, gpointer data)
-{
-       LinkedMethod *lmethod = (LinkedMethod *) value;
-       FILE *output = (FILE *) data;
-       char *signature;
-
-       signature = link_method_signature (lmethod->method);
-       fprintf (output, "\t\t\t<method signature=\"%s\" />\n", signature);
-       g_free (signature);
-}
-
-static void
-link_print_type (gpointer key, gpointer value, gpointer data)
-{
-       LinkedType *ltype = (LinkedType *) value;
-       FILE *output = (FILE *) data;
-       char *fullname;
-
-       fullname = link_class_full_name (ltype->klass);
-       fprintf (output, "\t\t<type fullname=\"%s\">\n", fullname);
-       g_free (fullname);
-
-       g_hash_table_foreach (ltype->methods, link_print_method, output);
-       fprintf (output, "\t\t</type>\n");
-}
-
-static void
-link_print_image (gpointer key, gpointer value, gpointer data)
-{
-       LinkedImage *limage = (LinkedImage *) value;
-       FILE *output = (FILE *) data;
-       char *fullname;
-
-       fullname = link_image_fullname (limage->image);
-       fprintf (output, "\t<assembly fullname=\"%s\">\n", fullname);
-       g_free (fullname);
-       g_hash_table_foreach (limage->types, link_print_type, output);
-       fprintf (output, "\t</assembly>\n");
-}
-
-static void
-link_print_tree (MonoProfiler *prof)
-{
-       FILE *output;
-
-       output = fopen (prof->output_file, "w");
-       fprintf (output, "<linker>\n");
-       g_hash_table_foreach (prof->images, link_print_image, output);
-       fprintf (output, "</linker>\n");
-       fclose (output);
-}
-
-static void
-link_shutdown (MonoProfiler *prof)
-{
-       link_print_tree (prof);
-       g_hash_table_foreach (prof->images, link_free_image, NULL);
-       g_free (prof);
-}
-
-void
-mono_profiler_startup (const char *desc)
-{
-       MonoProfiler *prof;
-
-       prof = g_new0 (MonoProfiler, 1);
-
-       if (strncmp ("link:", desc, 5) == 0 && desc [5])
-               prof->output_file = g_strdup (desc + 5);
-       else
-               prof->output_file = "link.xml";
-
-       prof->images = g_hash_table_new (NULL, NULL);
-
-       mono_profiler_install (prof, link_shutdown);
-
-       mono_profiler_install_enter_leave (NULL, link_method_leave);
-
-       mono_profiler_set_events (MONO_PROFILE_ENTER_LEAVE);
-}
diff --git a/mcs/tools/linker/standalone.make b/mcs/tools/linker/standalone.make
deleted file mode 100644 (file)
index f444215..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-
-MCS = mcs
-KEY_FILE = ../../class/mono.snk
-MONO.CECIL.DLL = Mono.Cecil.dll
-MCS_FLAGS = -debug -keyfile:$(KEY_FILE) -r:$(MONO.CECIL.DLL) -resource:Descriptors/mscorlib.xml -resource:Descriptors/System.xml -resource:Descriptors/System.Web.xml -resource:Descriptors/Mono.Posix.xml -resource:Descriptors/System.Drawing.xml
-LINKER = monolinker.exe
-
-all: config.make monolinker.exe monolinker
-
-monolinker: monolinker.in Makefile
-       sed "s,@prefix@,$(prefix)," < monolinker.in > monolinker
-       chmod +x monolinker
-
-monolinker.exe: Mono.Cecil.dll
-       $(MCS) $(MCS_FLAGS) @$(LINKER).sources /out:$(LINKER)
-
-Mono.Cecil.dll:
-       if pkg-config --atleast-version=0.5 mono-cecil; then \
-               cp `pkg-config --variable=Libraries mono-cecil` .; \
-       else \
-               echo You must install Mono.Cecil first; \
-               exit 1; \
-       fi
-
-clean:
-       rm -f $(LINKER) $(MONO.CECIL.DLL) monolinker
-
-install: all
-       mkdir -p $(prefix)/bin
-       mkdir -p $(prefix)/lib/monolinker
-       cp $(LINKER) $(MONO.CECIL.DLL) $(prefix)/lib/monolinker
-       cp monolinker $(prefix)/bin
-       cp man/monolinker.1 $(prefix)/share/man/man1
-
-config.make:
-       echo You must run configure first
-       exit 1
-
-include config.make
-
-run-test: all
-       cd ./Tests; \
-       make clean run-test; \
-       cd ..;
index 7d1897587fe4b05a0060720fa1fd32666d7ed0fd..14185713d52b8f96a57ddb6cd5453886e122e0b8 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index b7d609413570369bb804b5d8fa7a9a1dde28f182..a2ba4eb94c9fd23a7fbf679dc11c6bc1787c9215 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 31f5f4795db9f1253db4ca688d58a0fdec746ba6..f0a8a6d0141db3858a44eac384ca7b38b9be6fbd 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index f7074361022d4314aa934b4e5954245d5adacf89..17ed9971f2f90fb1e8cc11851737175932c2d788 100644 (file)
@@ -70,6 +70,13 @@ MONO = \
        MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" \
        $(RUNTIME) $(RUNTIME_FLAGS)
 
+DIFF = diff -rup
+DIFF_QUIET = diff --brief
+ifeq ($(PLATFORM), win32)
+DIFF = diff -rupZ
+DIFF_QUIET = diff --brief -Z
+endif
+
 dist-local: dist-default dist-tests
 
 dist-tests:
@@ -160,7 +167,7 @@ check-monodocer-addNonGeneric: $(PROGRAM)
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-addNonGeneric-v2.dll
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-addNonGeneric-v2.dll
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-addNonGeneric-v2.dll
-       diff -rup Test/en.expected-addNonGeneric Test/en.actual
+       $(DIFF) Test/en.expected-addNonGeneric Test/en.actual
 
 check-monodocer-dropns-classic: $(PROGRAM)
        # tests the simplest --dropns case, a single class where the root namespace was dropped.
@@ -168,7 +175,7 @@ check-monodocer-dropns-classic: $(PROGRAM)
        $(MAKE) Test/DocTest-DropNS-classic.dll
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll --api-style=classic
        $(MAKE) update-monodocer-dropns-unified
-       diff -rup Test/en.expected-dropns-classic-v1 Test/en.actual
+       $(DIFF) Test/en.expected-dropns-classic-v1 Test/en.actual
 
 check-monodocer-dropns-multi: $(PROGRAM)
        -rm -Rf Test/en.actual
@@ -185,7 +192,7 @@ check-monodocer-dropns-multi: $(PROGRAM)
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) --api-style=classic 
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --api-style=unified --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework 
        
-       diff -rup Test/en.expected-dropns-multi Test/en.actual
+       $(DIFF) Test/en.expected-dropns-multi Test/en.actual
 
 
 check-monodocer-dropns-multi-withexisting: $(PROGRAM)
@@ -203,7 +210,7 @@ check-monodocer-dropns-multi-withexisting: $(PROGRAM)
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-CLASSIC) --api-style=classic 
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual $(MULTI-UNIFIED) --api-style=unified --dropns Test/DocTest-DropNS-unified.dll=MyFramework --dropns Test/DocTest-DropNS-unified-multitest.dll=MyFramework 
        
-       diff -rup Test/en.expected-dropns-multi-withexisting Test/en.actual
+       $(DIFF) Test/en.expected-dropns-multi-withexisting Test/en.actual
 
 check-monodocer-dropns-delete: $(PROGRAM)
        -rm -Rf Test/en.actual
@@ -217,7 +224,7 @@ check-monodocer-dropns-delete: $(PROGRAM)
        $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-deletetest.dll --api-style=classic
        $(MAKE) Test/DocTest-DropNS-unified-deletetest-V2.dll
        $(MONO) $(PROGRAM) update --delete --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified-deletetest.dll --api-style=unified --dropns Test/DocTest-DropNS-unified-deletetest.dll=MyFramework
-       diff -rup Test/en.expected-dropns-delete Test/en.actual
+       $(DIFF) Test/en.expected-dropns-delete Test/en.actual
 
 check-monodocer-dropns-classic-withsecondary: $(PROGRAM)
        # tests case where a secondary assembly is included with a --dropns parameter
@@ -226,7 +233,7 @@ check-monodocer-dropns-classic-withsecondary: $(PROGRAM)
        $(MAKE) Test/DocTest-DropNS-classic-secondary.dll
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll Test/DocTest-DropNS-classic-secondary.dll --api-style=classic
        $(MAKE) update-monodocer-dropns-unified-withsecondary
-       diff -rup Test/en.expected-dropns-classic-withsecondary Test/en.actual
+       $(DIFF) Test/en.expected-dropns-classic-withsecondary Test/en.actual
 
 update-monodocer-dropns-unified: $(PROGRAM)
        $(MAKE) Test/DocTest-DropNS-unified.dll
@@ -245,13 +252,13 @@ check-monodocer-internal-interface: $(PROGRAM)
        -rm -Rf Test/en.actual
        $(MAKE) Test/DocTest-InternalInterface.dll
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-InternalInterface.dll
-       diff -rup Test/en.expected-internal-interface Test/en.actual
+       $(DIFF) Test/en.expected-internal-interface Test/en.actual
 
 check-monodocer-enumerations: $(PROGRAM)
        -rm -Rf Test/en.actual
        $(MAKE) Test/DocTest-enumerations.dll
        $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-enumerations.dll
-       diff -rup Test/en.expected-enumerations Test/en.actual
+       $(DIFF) Test/en.expected-enumerations Test/en.actual
 
 check-monodocer-update: $(PROGRAM)
        find Test/en.expected -name \*.xml -exec rm "{}" \;
@@ -262,9 +269,9 @@ check-monodocer: $(PROGRAM)
        -rm -Rf Test/en.actual
        $(MAKE) Test/DocTest.dll-v1
        $(MONO) $(PROGRAM) update --debug --exceptions=all -o Test/en.actual Test/DocTest.dll
-       diff -rup Test/en.expected Test/en.actual
+       $(DIFF) Test/en.expected Test/en.actual
        $(MONO) $(PROGRAM) update --debug --exceptions=all -o Test/en.actual Test/DocTest.dll 
-       diff -rup Test/en.expected Test/en.actual
+       $(DIFF) Test/en.expected Test/en.actual
 
 check-monodocer-since-update: $(PROGRAM)
        find Test/en.expected.since -name \*.xml -exec rm "{}" \;
@@ -281,7 +288,7 @@ check-monodocer-since: $(PROGRAM)
        $(MAKE) Test/DocTest.dll-v2
        $(MONO) $(PROGRAM) --debug update --exceptions=all --since="Version 2.0" \
                -o Test/en.actual Test/DocTest.dll 
-       diff -rup Test/en.expected.since Test/en.actual
+       $(DIFF) Test/en.expected.since Test/en.actual
 
 check-monodocer-delete-update: $(PROGRAM)
        find Test/en.expected.delete -type f -exec rm "{}" \;
@@ -301,7 +308,7 @@ check-monodocer-delete: $(PROGRAM)
        $(MONO) $(PROGRAM) --debug update --exceptions=all -o Test/en.actual Test/DocTest.dll
        $(MAKE) Test/DocTest.dll-v1
        $(MONO) $(PROGRAM) --debug update -fno-assembly-versions --delete --exceptions=all -o Test/en.actual Test/DocTest.dll
-       diff -rup Test/en.expected.delete Test/en.actual
+       $(DIFF) Test/en.expected.delete Test/en.actual
 
 check-monodocer-importslashdoc-update: $(PROGRAM)
        find Test/en.expected.importslashdoc -name \*.xml -exec rm "{}" \;
@@ -314,7 +321,7 @@ check-monodocer-importslashdoc: $(PROGRAM)
        $(MAKE) Test/DocTest.dll-v1 TEST_CSCFLAGS=-doc:Test/DocTest.xml
        $(MONO) $(PROGRAM) --debug update --exceptions=all -i Test/DocTest.xml \
                -o Test/en.actual Test/DocTest.dll 
-       diff -rup Test/en.expected.importslashdoc Test/en.actual
+       $(DIFF) Test/en.expected.importslashdoc Test/en.actual
 
 check-monodocer-importecmadoc-update: $(PROGRAM)
        find Test/en.expected.importecmadoc -name \*.xml -exec rm "{}" \;
@@ -331,7 +338,7 @@ check-monodocer-importecmadoc: $(PROGRAM)
                '--type=System.Action`1' --type=System.AsyncCallback \
                --type=System.Environment --type=System.Array \
                -o Test/en.actual Test/DocTest.dll 
-       diff -rup Test/en.expected.importecmadoc Test/en.actual
+       $(DIFF) Test/en.expected.importecmadoc Test/en.actual
 
 check-mdoc-export-html-update: $(PROGRAM)
        find Test/html.expected -name \*.html -exec rm "{}" \;
@@ -342,7 +349,7 @@ check-mdoc-export-html: check-monodocer $(PROGRAM)
        rm -Rf Test/html.actual
        $(MONO) $(PROGRAM) export-html -o Test/html.actual \
                Test/en.expected.importslashdoc
-       diff -rup Test/html.expected Test/html.actual
+       $(DIFF) Test/html.expected Test/html.actual
 
 check-mdoc-export-html-with-version: $(PROGRAM)
        rm -Rf Test/html.actual.v0 Test/html.actual.since-with-v0 .v0.txt .v2.txt
@@ -352,12 +359,12 @@ check-mdoc-export-html-with-version: $(PROGRAM)
                Test/en.expected.since -with-version 0.0.0.0
        (cd Test/html.actual.v0            && find . -type f) | sort > .v0.txt
        (cd Test/html.actual.since-with-v0 && find . -type f) | sort > .v2.txt
-       diff -rup .v0.txt .v2.txt   # assert no types added
+       $(DIFF) .v0.txt .v2.txt   # assert no types added
 
 check-md-html-dir: $(PROGRAM)
        rm -Rf Test/html.actual
        $(MONO) $(PROGRAM) export-html -dest:Test/html.actual $(DIR) 
-       diff -rup Test/html.expected Test/html.actual
+       $(DIFF) Test/html.expected Test/html.actual
 
 check-mdoc-export-msxdoc-update:
        $(MONO) $(PROGRAM) export-msxdoc -o - Test/en.expected.importslashdoc \
@@ -365,7 +372,7 @@ check-mdoc-export-msxdoc-update:
 
 check-mdoc-export-msxdoc:
        $(MONO) $(PROGRAM) export-msxdoc -o - Test/en.expected.importslashdoc \
-               | diff --brief - Test/msxdoc-expected.importslashdoc.xml
+               | $(DIFF_QUIET) - Test/msxdoc-expected.importslashdoc.xml
 
 my_abs_top_srcdir = $(shell cd . && pwd)
 
@@ -383,13 +390,13 @@ check-mdoc-validate-update: $(PROGRAM)
 check-mdoc-validate: $(PROGRAM)
        $(MONO) $(PROGRAM) validate -f ecma Test/en.expected 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' | \
-               diff - Test/validate.check.monodocer
+               $(DIFF_QUIET) - Test/validate.check.monodocer
        $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.importslashdoc 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' | \
-               diff --brief - Test/validate.check.monodocer.importslashdoc
+               $(DIFF_QUIET) - Test/validate.check.monodocer.importslashdoc
        $(MONO) $(PROGRAM) validate -f ecma Test/en.expected.since 2>&1 | \
                sed 's#file://$(my_abs_top_srcdir)/##g' | \
-               diff --brief - Test/validate.check.monodocer.since
+               $(DIFF_QUIET) - Test/validate.check.monodocer.since
 
 run-test-local: check-doc-tools
 
index 17a06f060891da064887df3eab273b3662e1a723..f6de433088c2ec6019c4fbfdd926ef503182cf7c 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
       <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
       <Name>System.Core-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
+    <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+      <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
       <Name>Mono.Cecil-net_4_x</Name>\r
     </ProjectReference>\r
     <ProjectReference Include="../../class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_x.csproj">\r
index 05faf5e8c685e1ec0ce4d295e848619f974d28c8..64a1b9cbf928bc1824705bdebd3d95049321cb23 100644 (file)
@@ -11,10 +11,23 @@ RESOURCE_FILES = $(OTHER_RES)
 LOCAL_MCS_FLAGS= $(OTHER_RES:%=-resource:%)
 
 LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
-LIB_REFS = System.Xml System System.Core
+LIB_REFS = System.Xml System System.Core System.IO.Compression.FileSystem
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
 
 include ../../build/executable.make
 
 mkbundle.exe: $(RESOURCE_FILES)
+
+test-simple: simple.exe
+       mono --debug $(the_lib) --simple simple.exe -o foo && ./foo
+       mono --debug $(the_lib) --cross default simple.exe -o foo && ./foo
+       mono --debug $(the_lib) --sdk `dirname \`which mono\``/.. simple.exe -o foo && ./foo
+       -rm DEMO.zip
+       mono-package-runtime `dirname \`which mono\``/.. DEMO
+       mkdir -p ~/.mono/targets/DEMO
+       unzip -d ~/.mono/targets/DEMO DEMO.zip
+       mono --debug $(the_lib) --cross DEMO simple.exe -o foo && ./foo
+
+simple.exe: Makefile
+       echo 'class X { static void Main () { System.Console.WriteLine ("OK");}}' > simple.cs && mcs simple.cs
index d8ea3865287329a901f2ff209de6d760d85386d8..1cdfb4653e647bcdeb145806c6a6e538483e2a92 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>STATIC;NO_SYMBOL_WRITER;NO_AUTHENTICODE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
       <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
       <Name>System.Core-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../../class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem-net_4_x.csproj">\r
+      <Project>{9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}</Project>\r
+      <Name>System.IO.Compression.FileSystem-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index 447540860f50024ec14df5685b4cf49d5fc3218d..1ea1d7402455704a22e4b237c25c8fe15f3d3f9b 100755 (executable)
@@ -3,6 +3,16 @@
 //
 // Based on the `make-bundle' Perl script written by Paolo Molaro (lupus@debian.org)
 //
+// TODO:
+//   [x] Rename the paths for the zip file that is downloaded
+//   [x] Update documentation with new flag
+//   [x] Load internationalized assemblies
+//   [x] Dependencies - if System.dll -> include Mono.Security.* (not needed, automatic)
+//   [x] --list-targets should download from a different url
+//   [x] --fetch-target should unpack zip file
+//   [x] Update --cross to use not a runtime, but an SDK
+//   [x] Update --local-targets to show the downloaded SDKs
+//
 // Author:
 //   Miguel de Icaza
 //
@@ -52,6 +62,8 @@ class MakeBundle {
        static bool custom_mode = true;
        static string embedded_options = null;
        static string runtime = null;
+       static string sdk_path = null;
+       static string lib_path = null;
        static Dictionary<string,string> environment = new Dictionary<string,string>();
        static string [] i18n = new string [] {
                "West",
@@ -74,7 +86,7 @@ class MakeBundle {
                link_paths.Add (".");
 
                DetectOS ();
-               
+
                for (int i = 0; i < top; i++){
                        switch (args [i]){
                        case "--help": case "-h": case "-?":
@@ -121,6 +133,8 @@ class MakeBundle {
                                        Help (); 
                                        return 1;
                                }
+                               if (sdk_path != null || runtime != null)
+                                       Error ("You can not specify one of --runtime, --sdk or --cross");
                                custom_mode = false;
                                autodeps = true;
                                cross_target = args [++i];
@@ -146,10 +160,8 @@ class MakeBundle {
                                        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;
-                               }
+                               if (!File.Exists (path))
+                                       Error ($"The specified library file {path} does not exist");
                                libraries [alias] = path;
                                break;
 
@@ -162,10 +174,10 @@ class MakeBundle {
                                break;
 
                        case "--list-targets":
+                               CommandLocalTargets ();
                                var wc = new WebClient ();
-                               var s = wc.DownloadString (new Uri (target_server + "target-list.txt"));
-                               Console.WriteLine ("Cross-compilation targets available:\n" + s);
-                               
+                               var s = wc.DownloadString (new Uri (target_server + "target-sdks.txt"));
+                               Console.WriteLine ("Targets available for download with --fetch-target:\n" + s);
                                return 0;
                                
                        case "--target-server":
@@ -191,11 +203,24 @@ class MakeBundle {
                                }
                                embedded_options = args [++i];
                                break;
+                       case "--sdk":
+                               if (i + 1 == top) {
+                                       Help ();
+                                       return 1;
+                               }
+                               custom_mode = false;
+                               autodeps = true;
+                               sdk_path = args [++i];
+                               if (cross_target != null || runtime != null)
+                                       Error ("You can not specify one of --runtime, --sdk or --cross");
+                               break;
                        case "--runtime":
                                if (i+1 == top){
                                        Help (); 
                                        return 1;
                                }
+                               if (sdk_path != null || cross_target != null)
+                                       Error ("You can only specify one of --runtime, --sdk or --cross");
                                custom_mode = false;
                                autodeps = true;
                                runtime = args [++i];
@@ -283,7 +308,7 @@ class MakeBundle {
                                case "linux":
                                        break;
                                default:
-                                       Console.Error.WriteLine ("Invalid style '{0}' - only 'windows', 'mac' and 'linux' are supported for --style argument", style);
+                                       Error ("Invalid style '{0}' - only 'windows', 'mac' and 'linux' are supported for --style argument", style);
                                        return 1;
                                }
                                        
@@ -328,21 +353,39 @@ class MakeBundle {
                        }
 
                }
+               // Modern bundling starts here
+               if (!custom_mode){
+                       if (runtime != null){
+                               // Nothing to do here, the user has chosen to manually specify --runtime nad libraries
+                       } else if (sdk_path != null) {
+                               VerifySdk (sdk_path);
+                       } else if (cross_target == "default" || cross_target == null){
+                               sdk_path = Path.GetFullPath (Path.Combine (Process.GetCurrentProcess().MainModule.FileName, "..", ".."));
+                               VerifySdk (sdk_path);
+                       } else {
+                               sdk_path = Path.Combine (targets_dir, cross_target);
+                               Console.WriteLine ("From: " + sdk_path);
+                               VerifySdk (sdk_path);
+                       }
+               }
 
                if (fetch_target != null){
-                       var truntime = Path.Combine (targets_dir, fetch_target, "mono");
-                       Directory.CreateDirectory (Path.GetDirectoryName (truntime));
+                       var directory = Path.Combine (targets_dir, fetch_target);
+                       var zip_download = Path.Combine (directory, "sdk.zip");
+                       Directory.CreateDirectory (Path.GetDirectoryName (directory));
                        var wc = new WebClient ();
                        var uri = new Uri ($"{target_server}{fetch_target}");
                        try {
                                if (!quiet){
-                                       Console.WriteLine ($"Downloading runtime {uri} to {truntime}");
+                                       Console.WriteLine ($"Downloading runtime {uri} to {zip_download}");
                                }
                                
-                               wc.DownloadFile (uri, truntime);
+                               wc.DownloadFile (uri, zip_download);
+                               ZipFile.ExtractToDirectory(zip_download, directory);
+                               File.Delete (zip_download);
                        } catch {
                                Console.Error.WriteLine ($"Failure to download the specified runtime from {uri}");
-                               File.Delete (truntime);
+                               File.Delete (zip_download);
                                return 1;
                        }
                        return 0;
@@ -359,48 +402,41 @@ class MakeBundle {
                }
 
                List<string> assemblies = LoadAssemblies (sources);
+               LoadLocalizedAssemblies (assemblies);
                List<string> files = new List<string> ();
                foreach (string file in assemblies)
                        if (!QueueAssembly (files, file))
                                return 1;
                if (custom_mode)
                        GenerateBundles (files);
-               else {
-                       if (cross_target == "default")
-                               runtime = null;
-                       else {
-                               if (runtime == null){
-                                       if (cross_target == null){
-                                               Console.Error.WriteLine ("you should specify either a --runtime or a --cross compilation target");
-                                               Environment.Exit (1);
-                                       }
-                                       runtime = Path.Combine (targets_dir, cross_target, "mono");
-                                       if (!File.Exists (runtime)){
-                                               Console.Error.WriteLine ($"The runtime for the {cross_target} does not exist, use --fetch-target {cross_target} to download first");
-                                               return 1;
-                                       }
-                               } else {
-                                       if (!File.Exists (runtime)){
-                                               Console.Error.WriteLine ($"The Mono runtime specified with --runtime does not exist");
-                                               return 1;
-                                       }
-                               }
-                               
-                       }
+               else 
                        GeneratePackage (files);
-               }
+
                Console.WriteLine ("Generated {0}", output);
 
                return 0;
        }
 
+       static void VerifySdk (string path)
+       {
+               if (!Directory.Exists (path))
+                       Error ($"The specified SDK path does not exist: {path}");
+               runtime = Path.Combine (sdk_path, "bin", "mono");
+               if (!File.Exists (runtime))
+                       Error ($"The SDK location does not contain a {path}/bin/mono runtime");
+               lib_path = Path.Combine (path, "lib", "mono", "4.5");
+               if (!Directory.Exists (lib_path))
+                       Error ($"The SDK location does not contain a {path}/lib/mono/4.5 directory");
+               link_paths.Add (lib_path);
+       }
+
        static string targets_dir = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".mono", "targets");
        
        static void CommandLocalTargets ()
        {
                string [] targets;
 
-               Console.WriteLine ("Available targets:");
+               Console.WriteLine ("Available targets locally:");
                Console.WriteLine ("\tdefault\t- Current System Mono");
                try {
                        targets = Directory.GetDirectories (targets_dir);
@@ -408,7 +444,7 @@ class MakeBundle {
                        return;
                }
                foreach (var target in targets){
-                       var p = Path.Combine (target, "mono");
+                       var p = Path.Combine (target, "bin", "mono");
                        if (File.Exists (p))
                                Console.WriteLine ("\t{0}", Path.GetFileName (target));
                }
@@ -580,7 +616,7 @@ class MakeBundle {
                        return true;
                
                if (!File.Exists (file)){
-                       Console.Error.WriteLine ("The file {0} does not exist", file);
+                       Error ("The file {0} does not exist", file);
                        return false;
                }
                maker.Add (code, file);
@@ -593,17 +629,17 @@ class MakeBundle {
                        if (IsUnix)
                                runtime = Process.GetCurrentProcess().MainModule.FileName;
                        else {
-                               Console.Error.WriteLine ("You must specify at least one runtime with --runtime or --cross");
+                               Error ("You must specify at least one runtime with --runtime or --cross");
                                Environment.Exit (1);
                        }
                }
                if (!File.Exists (runtime)){
-                       Console.Error.WriteLine ($"The specified runtime at {runtime} does not exist");
+                       Error ($"The specified runtime at {runtime} does not exist");
                        Environment.Exit (1);
                }
                
                if (ctor_func != null){
-                       Console.Error.WriteLine ("--static-ctor not supported with package bundling, you must use native compilation for this");
+                       Error ("--static-ctor not supported with package bundling, you must use native compilation for this");
                        return false;
                }
                
@@ -786,7 +822,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                try {
                                        conf = File.OpenRead (config_file);
                                } catch {
-                                       Error (String.Format ("Failure to open {0}", config_file));
+                                       Error ("Failure to open {0}", config_file);
                                        return;
                                }
                                if (!quiet)
@@ -805,7 +841,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                try {
                                        conf = File.OpenRead (machine_config_file);
                                } catch {
-                                       Error (String.Format ("Failure to open {0}", machine_config_file));
+                                       Error ("Failure to open {0}", machine_config_file);
                                        return;
                                }
                                if (!quiet)
@@ -1014,11 +1050,9 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                List<string> assemblies = new List<string> ();
                bool error = false;
 
-               var other = i18n.Select (x=> "I18N." + x + (x.Length > 0 ? "." : "") + "dll");
-               
-               foreach (string name in sources.Concat (other)){
+               foreach (string name in sources){
                        try {
-                               Assembly a = LoadAssembly (name);
+                               Assembly a = LoadAssemblyFile (name);
 
                                if (a == null){
                                        error = true;
@@ -1039,9 +1073,40 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
 
                if (error)
                        Environment.Exit (1);
-
+               
                return assemblies;
        }
+
+       static void LoadLocalizedAssemblies (List<string> assemblies)
+       {
+               var other = i18n.Select (x => "I18N." + x + (x.Length > 0 ? "." : "") + "dll");
+               bool error = false;
+
+               foreach (string name in other) {
+                       try {
+                               Assembly a = LoadAssembly (name);
+
+                               if (a == null) {
+                                       error = true;
+                                       continue;
+                               }
+
+                               assemblies.Add (a.CodeBase);
+                       } catch (Exception) {
+                               if (skip_scan) {
+                                       if (!quiet)
+                                               Console.WriteLine ("File will not be scanned: {0}", name);
+                                       assemblies.Add (new Uri (new FileInfo (name).FullName).ToString ());
+                               } else {
+                                       throw;
+                               }
+                       }
+               }
+
+               if (error)
+                       Environment.Exit (1);
+       }
+
        
        static readonly Universe universe = new Universe ();
        static readonly Dictionary<string, string> loaded_assemblies = new Dictionary<string, string> ();
@@ -1076,7 +1141,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                var name = GetAssemblyName (path);
                string found;
                if (loaded_assemblies.TryGetValue (name, out found)) {
-                       Error (string.Format ("Duplicate assembly name `{0}'. Both `{1}' and `{2}' use same assembly name.", name, path, found));
+                       Error ("Duplicate assembly name `{0}'. Both `{1}' and `{2}' use same assembly name.", name, path, found);
                        return false;
                }
 
@@ -1089,7 +1154,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                        Assembly a = universe.LoadFile (path);
 
                        foreach (AssemblyName an in a.GetReferencedAssemblies ()) {
-                               a = universe.Load (an.FullName);
+                               LoadAssembly (an.FullName);
                                if (!QueueAssembly (files, a.CodeBase))
                                        return false;
                        }
@@ -1101,56 +1166,57 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                return true;
        }
 
-       static Assembly LoadAssembly (string assembly)
+       //
+       // Loads an assembly from a specific path
+       //
+       static Assembly LoadAssemblyFile (string assembly)
        {
-               Assembly a;
+               Assembly a = null;
                
                try {
-                       char[] path_chars = { '/', '\\' };
-                       
-                       if (assembly.IndexOfAny (path_chars) != -1) {
-                               a = universe.LoadFile (assembly);
-                       } else {
-                               string ass = assembly;
-                               if (ass.EndsWith (".dll"))
-                                       ass = assembly.Substring (0, assembly.Length - 4);
-                               a = universe.Load (ass);
-                       }
-                       return a;
+                       a = universe.LoadFile (assembly);
                } catch (FileNotFoundException){
-                       string total_log = "";
-                       
-                       foreach (string dir in link_paths){
-                               string full_path = Path.Combine (dir, assembly);
-                               if (!assembly.EndsWith (".dll") && !assembly.EndsWith (".exe"))
-                                       full_path += ".dll";
-                               
-                               try {
-                                       a = universe.LoadFile (full_path);
-                                       return a;
-                               } catch (FileNotFoundException ff) {
-                                       total_log += ff.FusionLog;
-                                       continue;
-                               }
-                       }
-                       Error ("Cannot find assembly `" + assembly + "'" );
-                       if (!quiet)
-                               Console.WriteLine ("Log: \n" + total_log);
+                       Error ($"Cannot find assembly `{assembly}'");
                } catch (IKVM.Reflection.BadImageFormatException f) {
                        if (skip_scan)
                                throw;
-                       Error ("Cannot load assembly (bad file format) " + f.Message);
+                       Error ($"Cannot load assembly (bad file format) " + f.Message);
                } catch (FileLoadException f){
-                       Error ("Cannot load assembly " + f.Message);
+                       Error ($"Cannot load assembly " + f.Message);
                } catch (ArgumentNullException){
-                       Error("Cannot load assembly (null argument)");
+                       Error( $"Cannot load assembly (null argument)");
                }
-               return null;
+               return a;
        }
 
-       static void Error (string msg)
+       //
+       // Loads an assembly from any of the link directories provided
+       //
+       static Assembly LoadAssembly (string assembly)
+       {
+               string total_log = "";
+               foreach (string dir in link_paths){
+                       string full_path = Path.Combine (dir, assembly);
+                       if (!assembly.EndsWith (".dll") && !assembly.EndsWith (".exe"))
+                               full_path += ".dll";
+                       
+                       try {
+                               var a = universe.LoadFile (full_path);
+                               return a;
+                       } catch (FileNotFoundException ff) {
+                               total_log += ff.FusionLog;
+                               continue;
+                       }
+               }
+               if (!quiet)
+                       Console.WriteLine ("Log: \n" + total_log);
+               return null;
+       }
+       
+       static void Error (string msg, params object [] args)
        {
-               Console.Error.WriteLine ("ERROR: " + msg);
+               Console.Error.WriteLine ("ERROR: {0}", string.Format (msg, args));
+               throw new Exception ();
                Environment.Exit (1);
        }
 
@@ -1172,12 +1238,14 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                   "--simple   Simple mode does not require a C toolchain and can cross compile\n" + 
                                   "    --cross TARGET       Generates a binary for the given TARGET\n"+
                                   "    --env KEY=VALUE      Hardcodes an environment variable for the target\n" +
+                                  "    --fetch-target NAME  Downloads the target SDK from the remote server\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" +
+                                  "    --sdk PATH           Use a Mono SDK root location instead of a target\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" +
@@ -1308,7 +1376,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                        p.WaitForExit ();
                        int ret = p.ExitCode;
                        if (ret != 0){
-                               Error (String.Format("[Fail] {0}", ret));
+                               Error ("[Fail] {0}", ret);
                        }
                }
        }
index ad6b3cdb6f7f042af085c6259ebd40c197137980..1a30e07048d93e1c9fee34c64a56f72a4e30219f 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index e1c55c1f0a52f1e9e7a30de32d7b01b8d08c199a..18aa8cf854f508eb4660b9887f68cf8a8f13e83b 100644 (file)
@@ -2,7 +2,7 @@ thisdir = tools/mono-api-html
 SUBDIRS =
 include ../../build/rules.make
 
-LIB_REFS = Mono.Cecil System.Xml System.Core System System.Xml.Linq
+LIB_REFS = System.Xml System.Core System System.Xml.Linq
 LOCAL_MCS_FLAGS =
 
 PROGRAM = mono-api-html.exe
index 904e60cd013cd2e206b5ccb682ce0a64e63c3df7..09cc201b497b070e0c041748935a7735f6bc19af 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
       <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
       <Name>corlib-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
-      <Name>Mono.Cecil-net_4_x</Name>\r
-    </ProjectReference>\r
     <ProjectReference Include="../../class/System.XML/System.Xml-net_4_x.csproj">\r
       <Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
       <Name>System.Xml-net_4_x</Name>\r
index 30aa8d24d05f25349eee168088262798ed01b5ac..89596db0dae8d1d370fb7e92b7ea410dae5c629d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 53a205e88542fdfec979d9744923fcccc960b7fc..4fdfba521c848a61aa91d7143f921b5eac4b0899 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 0969190f2e3e149e4e77fee92128084a5bd20ea2..95268e9c3b59222c789c351e4df8b856e3eee92d 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 7c9c21434c0c1521b12622537999ccd1bd938b38..d6ac11fff43bc95a3464b9b107d41fdc9e3bd9f7 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 2913fe806d04da0f3a9591c61c0389d0aaf040b9..df2fb2702a3873ac3686354a19d5f0200f233e14 100644 (file)
@@ -26,7 +26,7 @@ SYMBOLICATE_EXPECTED_FILE = Test/symbolicate.expected
 CHECK_DIFF = @\
        $(MONO) $(TEST_EXE) > $(STACKTRACE_FILE); \
        $(MONO) $(LIB_PATH)/$(PROGRAM) $(MSYM_DIR) $(STACKTRACE_FILE) > $(SYMBOLICATE_RAW_FILE); \
-       sed "s/) .* in .*\/mcs\//) in mcs\//" $(SYMBOLICATE_RAW_FILE) | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $(SYMBOLICATE_RESULT_FILE); \
+       cat $(SYMBOLICATE_RAW_FILE) | tr '\\' '/' | sed "s/) .* in .*\/mcs\//) in mcs\//" | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $(SYMBOLICATE_RESULT_FILE); \
        DIFF=$$(diff -up $(SYMBOLICATE_EXPECTED_FILE) $(SYMBOLICATE_RESULT_FILE)); \
        if [ ! -z "$$DIFF" ]; then \
                echo "Symbolicate tests failed."; \
index b147f4866415d828e994703500372f05b750025a..a65ab75b17b9d2e021c606e9340354a89470d323 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NO_AUTHENTICODE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NO_AUTHENTICODE;CECIL;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NO_AUTHENTICODE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NO_AUTHENTICODE;CECIL;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   </PropertyGroup>\r
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil.Cil\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil.Metadata\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil.PE\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ArrayType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyFlags.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyHashAlgorithm.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyLinkedResource.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyNameDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyNameReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyReader.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\AssemblyWriter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\BaseAssemblyResolver.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\CallSite.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\CustomAttribute.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\DefaultAssemblyResolver.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\EmbeddedResource.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\EventAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\EventDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\EventReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ExportedType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FieldAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FieldDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FieldReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FileAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\FunctionPointerType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\GenericInstanceMethod.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\GenericInstanceType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\GenericParameter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\GenericParameterAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IConstantProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ICustomAttributeProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IGenericInstance.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IGenericParameterProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMarshalInfoProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMemberDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMetadataScope.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMetadataTokenProvider.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\IMethodSignature.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\Import.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\LinkedResource.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ManifestResourceAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MarshalInfo.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MemberDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MemberReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MetadataResolver.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MetadataSystem.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodCallingConvention.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodImplAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodReturnType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodSemanticsAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\MethodSpecification.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\Modifiers.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ModuleDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ModuleKind.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ModuleReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\NativeType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ParameterAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ParameterDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ParameterDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ParameterReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PinnedType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PInvokeAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PInvokeInfo.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PointerType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PropertyAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PropertyDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\PropertyReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\ReferenceType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\Resource.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\SecurityDeclaration.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\SentinelType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TargetRuntime.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\Treatments.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeAttributes.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeDefinition.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeDefinitionCollection.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeParser.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeReference.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeSpecification.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\TypeSystem.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\VariantType.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Cecil\WindowsRuntimeProjections.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Collections.Generic\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono.Security.Cryptography\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\Mono\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\MdbReader.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.Cecil.Mdb\MdbWriter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\mdb\Mono.CompilerServices.SymbolWriter\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Microsoft.Cci.Pdb\*.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\ISymUnmanagedDocumentWriter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\ISymUnmanagedWriter2.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\ModuleMetadata.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\PdbHelper.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\PdbReader.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\PdbWriter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\SymDocumentWriter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\symbols\pdb\Mono.Cecil.Pdb\SymWriter.cs" />\r
+    <Compile Include="..\..\..\external\cecil\System.Security.Cryptography\*.cs" />\r
+    <Compile Include="..\..\class\Mono.Options\Mono.Options\Options.cs" />\r
     <Compile Include="LocationProvider.cs" />\r
+    <Compile Include="Logger.cs" />\r
     <Compile Include="SeqPointInfo.cs" />\r
-    <Compile Include="symbolicate.cs" />\r  </ItemGroup>\r
+    <Compile Include="StackFrameData.cs" />\r
+    <Compile Include="symbolicate.cs" />\r
+    <Compile Include="SymbolManager.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
       <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
       <Name>corlib-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
-      <Name>Mono.Cecil-net_4_x</Name>\r
-    </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_x.csproj">\r
-      <Project>{CF14D34A-F69B-47FB-A99C-D25C77198F30}</Project>\r
-      <Name>Mono.Cecil.Mdb-net_4_x</Name>\r
-    </ProjectReference>\r
     <ProjectReference Include="../../class/System.XML/System.Xml-net_4_x.csproj">\r
       <Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
       <Name>System.Xml-net_4_x</Name>\r
index 6aa1cc35a1226279787c4bf35fa2a93e9d5e2302..43a2039703cc7b84380e0f605241e81ab7367276 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index d5f58360be6ba77590a8d426cc0c61e728e66d78..d7bc84b9c55cd7e7b3baf44727aeb4d8beec9eec 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 35ca4e79637f49eeaacf88c7c9cc3ce0ebc4fef9..57dcb4efe27f7a66bad6a6e4cb2dafe0a9d4f535 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NO_AUTHENTICODE;STATIC;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NO_AUTHENTICODE;STATIC;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NO_AUTHENTICODE;STATIC;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NO_AUTHENTICODE;STATIC;NO_SYMBOL_WRITER;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/tools/nunit-lite/NUnitLite/BabysitterSupport.cs b/mcs/tools/nunit-lite/NUnitLite/BabysitterSupport.cs
new file mode 100644 (file)
index 0000000..86c44d9
--- /dev/null
@@ -0,0 +1,113 @@
+//
+// BabysitterSupport.cs: Nunit extensions to support test harness used by Mono.
+//                       See scripts/babysitter in Mono repository.
+//
+// Author:
+//   Andi McClure (andi.mcclure@xamarin.com)
+//
+// Copyright (C) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+
+namespace Xamarin
+{
+       using System;
+       using System.IO;
+       using System.Collections.Generic;
+       using NUnit.Framework.Api;
+       using NUnit.Framework.Internal;
+       using NUnit.Framework.Internal.Filters;
+
+       public class BabysitterSupport
+       {
+               enum OverrideMode {None, Run, Exclude};
+               public static Dictionary<string, bool> OverrideTests = new Dictionary<string, bool>();
+               private static OverrideMode Override = OverrideMode.None;
+               private static string CurrentTestFile = null, RanTestFile = null, FailedTestFile = null;
+
+               private static void DeleteFile(string path)
+               {
+                       try {
+                               File.Delete(path);
+                       } catch (Exception) {}
+               }
+               private static void WriteFile(string path, string contents)
+               {
+                       DeleteFile(path);
+                       File.AppendAllText(path, contents);
+               }
+
+               // Environment variables are available from process start, so safe to do setup in a static constructor
+               static BabysitterSupport()
+               {
+                       string overrideModeString = Environment.GetEnvironmentVariable("MONO_BABYSITTER_NUNIT_RUN_MODE");
+                       string overrideTestString = Environment.GetEnvironmentVariable("MONO_BABYSITTER_NUNIT_RUN_TEST");
+                       if (overrideModeString == "RUN")
+                               Override = OverrideMode.Run;
+                       else if (overrideModeString == "EXCLUDE")
+                               Override = OverrideMode.Exclude;
+                       if (Override != OverrideMode.None)
+                       {
+                               string[] overrideTests = overrideTestString.Split(new char[] {';'}, StringSplitOptions.RemoveEmptyEntries);
+                               foreach (string s in overrideTests)
+                                       OverrideTests[s] = true;
+                       }
+
+                       CurrentTestFile = Environment.GetEnvironmentVariable("MONO_BABYSITTER_NUNIT_CURRENT_TEST_FILE");
+                       RanTestFile = Environment.GetEnvironmentVariable("MONO_BABYSITTER_NUNIT_RAN_TEST_FILE");
+                       FailedTestFile = Environment.GetEnvironmentVariable("MONO_BABYSITTER_NUNIT_FAILED_TEST_FILE");
+               }
+
+               // Entry points
+
+               public static void RecordEnterTest( string testName )
+               {
+                       if (CurrentTestFile != null)
+                               WriteFile(CurrentTestFile, testName);
+                       if (RanTestFile != null)
+                               File.AppendAllText(RanTestFile, testName + Environment.NewLine);
+               }
+
+               public static void RecordLeaveTest( string testName )
+               {
+                       if (CurrentTestFile != null)
+                               DeleteFile(CurrentTestFile);
+               }
+
+               public static void RecordFailedTest( string testName )
+               {
+                       if (FailedTestFile != null)
+                               File.AppendAllText(FailedTestFile, testName + Environment.NewLine);
+               }
+
+               public static ITestFilter AddBabysitterFilter(ITestFilter currentFilter)
+               {
+                       if (Override == OverrideMode.None)
+                               return currentFilter;
+                       return new AndFilter(currentFilter, new BabysitterFilter());
+               }
+
+               [Serializable]
+               private class BabysitterFilter : TestFilter
+               {
+                       public override bool Match(ITest test)
+                       {
+                               if (test.IsSuite) // A suite returning true will automatically run ALL contents, filters ignored
+                                       return false;
+                               bool inList = OverrideTests.ContainsKey(test.FullName);
+                               bool allow = true;
+                               switch (Override)
+                               {
+                                       case OverrideMode.None:
+                                               break;
+                                       case OverrideMode.Run:
+                                               allow = inList;
+                                               break;
+                                       case OverrideMode.Exclude:
+                                               allow = !inList;
+                                               break;
+                               }
+                               return allow;
+                       }
+               }
+       }
+}
\ No newline at end of file
index e205091b942ff3177cecef28d2d4a2e966125d4d..edf8c1283791bde051589c5199693cb6ad1014ba 100644 (file)
 ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/TestCaseData.cs
 ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/TestContext.cs
 ../../../../external/nunit-lite/NUnitLite-1.0.0/src/framework/Throws.cs
+BabysitterSupport.cs
diff --git a/mcs/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config b/mcs/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config
deleted file mode 100644 (file)
index 2ccc2b9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<configuration>\r
- <runtime>\r
- <!-- \r
-   This is necessary to prevent the runner from terminating on\r
-   any unhandled exceptions which occur. We account for unhandled exceptions on\r
-   other threads with an event handler, but would still be terminated using the\r
-   new behavior.\r
- -->\r
-   <legacyUnhandledExceptionPolicy enabled="1" />\r
-  </runtime>\r
-</configuration>\r
diff --git a/mcs/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl b/mcs/tools/nunit-lite/nunit-lite-console/nunit-lite-console.exe.config.tmpl
new file mode 100644 (file)
index 0000000..bc218db
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<configuration>\r
+  <!-- __INSERT_CUSTOM_APP_CONFIG_GLOBAL__ -->\r
+  <runtime>\r
+    <!-- \r
+      This is necessary to prevent the runner from terminating on\r
+      any unhandled exceptions which occur. We account for unhandled exceptions on\r
+      other threads with an event handler, but would still be terminated using the\r
+      new behavior.\r
+    -->\r
+    <legacyUnhandledExceptionPolicy enabled="1" />\r
+    <!-- __INSERT_CUSTOM_APP_CONFIG_RUNTIME__ -->\r
+  </runtime>\r
+</configuration>\r
index 4228feb10cfc9dd4400cf2c0304ed7f8d6c455dd..230652e3f73f9a0ed1a98c157d7be923e712f9de 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 94a03d663e6e02df1c869f91a0869c4cbed95537..ccb79a7f770480121e6f5cf3f8aea456bcdfa09b 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
       <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
       <Name>corlib-net_4_x</Name>\r
     </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
+    <ProjectReference Include="../../class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
+      <Project>{6DE38817-EC25-433A-AE58-0D30C5E6C460}</Project>\r
       <Name>Mono.Cecil-net_4_x</Name>\r
     </ProjectReference>\r
     <ProjectReference Include="../../class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_x.csproj">\r
index fef287ac0901dbf844782504e03650b799b5e022..8b4dd8efb27078fa2fab2aeb81976564d6aeb405 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699,1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699,1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index ac2c2ef82c72d87c20a4c9a4a86869f290bd53b1..56797562e50592fbcf07f610d2bc5b2eed162755 100644 (file)
@@ -50,6 +50,7 @@ namespace Mono.Tools
                static string inputFile;
                static bool quiet;
                static bool userStore;
+               static bool btlsStore = false;
 
                static X509Certificate DecodeCertificate (string s)
                {
@@ -116,14 +117,19 @@ namespace Mono.Tools
                                return 0;
                        }
                                
-                       X509Stores stores = userStore ? X509StoreManager.CurrentUser : X509StoreManager.LocalMachine;
-                       X509CertificateCollection trusted = stores.TrustedRoot.Certificates;
+                       X509Stores stores;
+                       if (userStore)
+                               stores = btlsStore ? X509StoreManager.NewCurrentUser : X509StoreManager.CurrentUser;
+                       else
+                               stores = btlsStore ? X509StoreManager.NewLocalMachine : X509StoreManager.LocalMachine;
+                       X509Store store = stores.TrustedRoot;
+                       X509CertificateCollection trusted = store.Certificates;
                        int additions = 0;
                        WriteLine ("I already trust {0}, your new list has {1}", trusted.Count, roots.Count);
                        foreach (X509Certificate root in roots) {
                                if (!trusted.Contains (root)) {
                                        try {
-                                               stores.TrustedRoot.Import (root);
+                                               store.Import (root);
                                                WriteLine ("Certificate added: {0}", root.SubjectName);
                                                additions++;
                                        } catch (Exception e) {
@@ -145,7 +151,7 @@ namespace Mono.Tools
                                WriteLine ("{0} previously trusted certificates were removed.", removed.Count);
 
                                foreach (X509Certificate old in removed) {
-                                       stores.TrustedRoot.Remove (old);
+                                       store.Remove (old);
                                        WriteLine ("Certificate removed: {0}", old.SubjectName);
                                }
                        }
@@ -173,6 +179,9 @@ namespace Mono.Tools
                                case "--user":
                                        userStore = true;
                                        break;
+                               case "--btls":
+                                       btlsStore = true;
+                                       break;
                                default:
                                        WriteLine ("Unknown option '{0}'.", args[i]);
                                        return false;
@@ -228,4 +237,4 @@ namespace Mono.Tools
                        }
                }
        }
-}
\ No newline at end of file
+}
index 90679a7418624d880f598b0c654a0da6304c0095..40119b2a80b32d822e804eec2982e575d8565c53 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 117a92802b906d3fab1af01815789b0619d9390e..cb8835b5442e815036b67b2cf73e917e37eb67c6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 048153eee248817194fc46d37b367b48fd2a386d..d5422a51f85ae744b3a70e74fc2e5df372e32e42 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -33,7 +34,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;MONO_STRICT;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;MONO_STRICT;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -41,7 +42,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>MONO_STRICT;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>MONO_STRICT;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 88ad1f8d9b5cca744ae8ae233bec051b2a7d20fa..599e039ed97762509ff07b60ab89ee905de8b485 100644 (file)
@@ -1,4 +1,4 @@
-thisdir = tools/SqlSharp
+thisdir = tools/sqlsharp
 SUBDIRS = 
 include ../../build/rules.make
 
index 81e68230553252a3bfb7b98a1ac9bc6b3aa9ed0e..29204d9140ff870ba246931cb673387225bac341 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index ad7320b3108770e61cd4f605cd11d7d2c597f715..d20cf05b23a57896a86c6067dbc1b9fbdc4c6846 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
diff --git a/mcs/tools/tuner/Makefile b/mcs/tools/tuner/Makefile
deleted file mode 100644 (file)
index c364223..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-thisdir = tools/tuner
-SUBDIRS =
-DEP_DIRS = linker
-include ../../build/rules.make
-
-LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/monolinker.exe
-LIB_REFS = System System.Core System.Xml Mono.Cecil
-
-LIBRARY = Mono.Tuner.dll
-
-NO_INSTALL = yes
-NO_TEST = yes
-NO_SIGN_ASSEMBLY = yes
-
-include ../../build/library.make
diff --git a/mcs/tools/tuner/Mono.Tuner-net_4_x.csproj b/mcs/tools/tuner/Mono.Tuner-net_4_x.csproj
deleted file mode 100644 (file)
index 0afcefa..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<?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>{8CCE7044-3466-4599-B09E-9F8E0C2F4614}</ProjectGuid>\r
-    <OutputType>Library</OutputType>\r
-    <NoWarn>1699</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
-    \r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <RootNamespace>\r
-    </RootNamespace>\r
-    <AssemblyName>Mono.Tuner</AssemblyName>\r
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
-    <FileAlignment>512</FileAlignment>\r
-  </PropertyGroup>\r
-  \r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <NoWarn>1699</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</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="Mono.Tuner\AdjustVisibility.cs" />\r
-    <Compile Include="Mono.Tuner\CheckVisibility.cs" />\r
-    <Compile Include="Mono.Tuner\FilterAttributes.cs" />\r
-    <Compile Include="Mono.Tuner\InjectSecurityAttributes.cs" />\r
-    <Compile Include="Mono.Tuner\MoonlightA11yApiMarker.cs" />\r
-    <Compile Include="Mono.Tuner\MoonlightA11yAssemblyStep.cs" />\r
-    <Compile Include="Mono.Tuner\MoonlightA11yDescriptorGenerator.cs" />\r
-    <Compile Include="Mono.Tuner\MoonlightA11yProcessor.cs" />\r
-    <Compile Include="Mono.Tuner\MoonlightA11yUsageInspectionStep.cs" />\r
-    <Compile Include="Mono.Tuner\MoonlightAssemblyStep.cs" />\r
-    <Compile Include="Mono.Tuner\PrintStatus.cs" />\r
-    <Compile Include="Mono.Tuner\RemoveSerialization.cs" />\r
-    <Compile Include="Mono.Tuner\TunerAnnotations.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="../linker/monolinker-net_4_x.csproj">\r
-      <Project>{FA920637-C202-4E75-AC0F-1A8DBD631DF1}</Project>\r
-      <Name>monolinker-net_4_x</Name>\r
-    </ProjectReference>\r
-    <ProjectReference Include="../../class/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="../../class/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="../../class/System.Core/System.Core-net_4_x.csproj">\r
-      <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
-      <Name>System.Core-net_4_x</Name>\r
-    </ProjectReference>\r
-    <ProjectReference Include="../../class/System.XML/System.Xml-net_4_x.csproj">\r
-      <Project>{87FD2F0F-5222-4AE6-BD63-2D4975E11E5B}</Project>\r
-      <Name>System.Xml-net_4_x</Name>\r
-    </ProjectReference>\r
-    <ProjectReference Include="../../class/Mono.Cecil/Mono.Cecil-net_4_x.csproj">\r
-      <Project>{2C0D558F-0B38-4691-967E-A910A1B995C1}</Project>\r
-      <Name>Mono.Cecil-net_4_x</Name>\r
-    </ProjectReference>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Folder Include="Properties\" />\r
-  </ItemGroup>\r
-</Project>\r
-
diff --git a/mcs/tools/tuner/Mono.Tuner.csproj b/mcs/tools/tuner/Mono.Tuner.csproj
deleted file mode 100644 (file)
index fd5e22d..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{E97429BA-279A-4C1D-AE8A-8BD878C661D1}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>Mono.Tuner</RootNamespace>
-    <AssemblyName>Mono.Tuner</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>True</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Mono.Tuner\AdjustVisibility.cs" />
-    <Compile Include="Mono.Tuner\CheckVisibility.cs" />
-    <Compile Include="Mono.Tuner\PrintStatus.cs" />
-    <Compile Include="Mono.Tuner\RemoveSerialization.cs" />
-    <Compile Include="Mono.Tuner\TunerAnnotations.cs" />
-    <Compile Include="Mono.Tuner\InjectSecurityAttributes.cs" />
-    <Compile Include="Mono.Tuner\MoonlightAssemblyStep.cs" />
-    <Compile Include="Mono.Tuner\FilterAttributes.cs" />
-    <Compile Include="Mono.Tuner\MoonlightA11yProcessor.cs" />
-    <Compile Include="Mono.Tuner\MoonlightA11yAssemblyStep.cs" />
-    <Compile Include="Mono.Tuner\MoonlightA11yUsageInspectionStep.cs" />
-    <Compile Include="Mono.Tuner\MoonlightA11yDescriptorGenerator.cs" />
-    <Compile Include="Mono.Tuner\MoonlightA11yApiMarker.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-  <ItemGroup>
-    <None Include="Makefile" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\linker\Mono.Linker.csproj">
-      <Project>{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}</Project>
-      <Name>Mono.Linker</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\external\cecil\Mono.Cecil.csproj">
-      <Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>
-      <Name>Mono.Cecil</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>
\ No newline at end of file
diff --git a/mcs/tools/tuner/Mono.Tuner.dll.sources b/mcs/tools/tuner/Mono.Tuner.dll.sources
deleted file mode 100644 (file)
index cca968b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Mono.Tuner/TunerAnnotations.cs
-Mono.Tuner/PrintStatus.cs
-Mono.Tuner/RemoveSerialization.cs
-Mono.Tuner/AdjustVisibility.cs
-Mono.Tuner/CheckVisibility.cs
-Mono.Tuner/InjectSecurityAttributes.cs
-Mono.Tuner/MoonlightA11yApiMarker.cs
-Mono.Tuner/MoonlightA11yAssemblyStep.cs
-Mono.Tuner/MoonlightA11yDescriptorGenerator.cs
-Mono.Tuner/MoonlightA11yProcessor.cs
-Mono.Tuner/MoonlightA11yUsageInspectionStep.cs
-Mono.Tuner/MoonlightAssemblyStep.cs
-Mono.Tuner/FilterAttributes.cs
diff --git a/mcs/tools/tuner/Mono.Tuner/AdjustVisibility.cs b/mcs/tools/tuner/Mono.Tuner/AdjustVisibility.cs
deleted file mode 100644 (file)
index 6b684b6..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// AdjustVisibilityStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Collections;
-using System.Collections.Generic;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class AdjustVisibility : BaseStep {
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       ProcessTypes (assembly.MainModule.Types);
-               }
-
-               void ProcessTypes (ICollection types)
-               {
-                       foreach (TypeDefinition type in types)
-                               ProcessType (type);
-               }
-
-               void ProcessType (TypeDefinition type)
-               {
-                       if (!IsPublic (type))
-                               return;
-
-                       if (!IsMarkedAsPublic (type)) {
-                               SetInternalVisibility (type);
-                               return;
-                       }
-
-                       if (type.IsEnum)
-                               return;
-
-                       ProcessFields (type.Fields);
-                       ProcessMethods (type.Methods);
-               }
-
-               static bool IsPublic (TypeDefinition type)
-               {
-                       return type.DeclaringType == null ? type.IsPublic : type.IsNestedPublic;
-               }
-
-               void SetInternalVisibility (TypeDefinition type)
-               {
-                       type.Attributes &= ~TypeAttributes.VisibilityMask;
-                       if (type.DeclaringType == null)
-                               type.Attributes |= TypeAttributes.NotPublic;
-                       else
-                               type.Attributes |= TypeAttributes.NestedAssembly;
-
-                       MarkInternalized (type);
-               }
-
-               void ProcessMethods (ICollection methods)
-               {
-                       foreach (MethodDefinition method in methods)
-                               ProcessMethod (method);
-               }
-
-               void ProcessMethod (MethodDefinition method)
-               {
-                       if (IsMarkedAsPublic (method))
-                               return;
-
-                       if (method.IsPublic)
-                               SetInternalVisibility (method);
-                       else if (method.IsFamily || method.IsFamilyOrAssembly)
-                               SetProtectedAndInternalVisibility (method);
-               }
-
-               void SetInternalVisibility (MethodDefinition method)
-               {
-                       method.Attributes &= ~MethodAttributes.MemberAccessMask;
-                       method.Attributes |= MethodAttributes.Assembly;
-
-                       MarkInternalized (method);
-               }
-
-               void SetProtectedAndInternalVisibility (MethodDefinition method)
-               {
-                       method.Attributes &= ~MethodAttributes.MemberAccessMask;
-                       method.Attributes |= MethodAttributes.FamANDAssem;
-
-                       MarkInternalized (method);
-               }
-
-               bool IsMarkedAsPublic (IMetadataTokenProvider provider)
-               {
-                       return Annotations.IsPublic (provider);
-               }
-
-               void ProcessFields (IEnumerable<FieldDefinition> fields)
-               {
-                       foreach (FieldDefinition field in fields)
-                               ProcessField (field);
-               }
-
-               void ProcessField (FieldDefinition field)
-               {
-                       if (IsMarkedAsPublic (field))
-                               return;
-
-                       if (field.IsPublic)
-                               SetInternalVisibility (field);
-                       else if (field.IsFamily || field.IsFamilyOrAssembly)
-                               SetProtectedAndInternalVisibility (field);
-               }
-
-               void SetInternalVisibility (FieldDefinition field)
-               {
-                       field.Attributes &= ~FieldAttributes.FieldAccessMask;
-                       field.Attributes |= FieldAttributes.Assembly;
-
-                       MarkInternalized (field);
-               }
-
-               void SetProtectedAndInternalVisibility (FieldDefinition field)
-               {
-                       field.Attributes &= ~FieldAttributes.FieldAccessMask;
-                       field.Attributes |= FieldAttributes.FamANDAssem;
-
-                       MarkInternalized (field);
-               }
-
-               void MarkInternalized (IMetadataTokenProvider provider)
-               {
-                       TunerAnnotations.Internalized (Context, provider);
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs b/mcs/tools/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs
deleted file mode 100644 (file)
index 6a910a9..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public abstract class ApplyPreserveAttributeBase : BaseSubStep {
-
-               // set 'removeAttribute' to true if you want the preserved attribute to be removed from the final assembly
-               protected abstract bool IsPreservedAttribute (ICustomAttributeProvider provider, CustomAttribute attribute, out bool removeAttribute);
-
-               public override SubStepTargets Targets {
-                       get {
-                               return SubStepTargets.Type
-                                       | SubStepTargets.Field
-                                       | SubStepTargets.Method
-                                       | SubStepTargets.Property
-                                       | SubStepTargets.Event;
-                       }
-               }
-
-               public override bool IsActiveFor (AssemblyDefinition assembly)
-               {
-                       return !Profile.IsSdkAssembly (assembly) && Annotations.GetAction (assembly) == AssemblyAction.Link;
-               }
-
-               public override void ProcessType (TypeDefinition type)
-               {
-                       TryApplyPreserveAttribute (type);
-               }
-
-               public override void ProcessField (FieldDefinition field)
-               {
-                       foreach (var attribute in GetPreserveAttributes (field))
-                               Mark (field, attribute);
-               }
-
-               public override void ProcessMethod (MethodDefinition method)
-               {
-                       MarkMethodIfPreserved (method);
-               }
-
-               public override void ProcessProperty (PropertyDefinition property)
-               {
-                       foreach (var attribute in GetPreserveAttributes (property)) {
-                               MarkMethod (property.GetMethod, attribute);
-                               MarkMethod (property.SetMethod, attribute);
-                       }
-               }
-
-               public override void ProcessEvent (EventDefinition @event)
-               {
-                       foreach (var attribute in GetPreserveAttributes (@event)) {
-                               MarkMethod (@event.AddMethod, attribute);
-                               MarkMethod (@event.InvokeMethod, attribute);
-                               MarkMethod (@event.RemoveMethod, attribute);
-                       }
-               }
-
-               void MarkMethodIfPreserved (MethodDefinition method)
-               {
-                       foreach (var attribute in GetPreserveAttributes (method)) 
-                               MarkMethod (method, attribute);
-               }
-
-               void MarkMethod (MethodDefinition method, CustomAttribute preserve_attribute)
-               {
-                       if (method == null)
-                               return;
-
-                       Mark (method, preserve_attribute);
-                       Annotations.SetAction (method, MethodAction.Parse);
-               }
-
-               void Mark (IMetadataTokenProvider provider, CustomAttribute preserve_attribute)
-               {
-                       if (IsConditionalAttribute (preserve_attribute)) {
-                               PreserveConditional (provider);
-                               return;
-                       }
-
-                       PreserveUnconditional (provider);
-               }
-
-               void PreserveConditional (IMetadataTokenProvider provider)
-               {
-                       var method = provider as MethodDefinition;
-                       if (method == null) {
-                               // workaround to support (uncommon but valid) conditional fields form [Preserve]
-                               PreserveUnconditional (provider);
-                               return;
-                       }
-
-                       Annotations.AddPreservedMethod (method.DeclaringType, method);
-               }
-
-               static bool IsConditionalAttribute (CustomAttribute attribute)
-               {
-                       if (attribute == null)
-                               return false;
-
-                       foreach (var named_argument in attribute.Fields)
-                               if (named_argument.Name == "Conditional")
-                                       return (bool) named_argument.Argument.Value;
-
-                       return false;
-               }
-
-               void PreserveUnconditional (IMetadataTokenProvider provider)
-               {
-                       Annotations.Mark (provider);
-
-                       var member = provider as IMemberDefinition;
-                       if (member == null || member.DeclaringType == null)
-                               return;
-
-                       Mark (member.DeclaringType, null);
-               }
-
-               void TryApplyPreserveAttribute (TypeDefinition type)
-               {
-                       foreach (var attribute in GetPreserveAttributes (type)) {
-                               Annotations.Mark (type);
-
-                               if (!attribute.HasFields)
-                                       continue;
-                               foreach (var named_argument in attribute.Fields)
-                                       if (named_argument.Name == "AllMembers" && (bool)named_argument.Argument.Value)
-                                               Annotations.SetPreserve (type, TypePreserve.All);
-                       }
-               }
-
-               List<CustomAttribute> GetPreserveAttributes (ICustomAttributeProvider provider)
-               {
-                       List<CustomAttribute> attrs = new List<CustomAttribute> ();
-
-                       if (!provider.HasCustomAttributes)
-                               return attrs;
-
-                       var attributes = provider.CustomAttributes;
-
-                       for (int i = attributes.Count - 1; i >= 0; i--) {
-                               var attribute = attributes [i];
-
-                               bool remote_attribute;
-                               if (!IsPreservedAttribute (provider, attribute, out remote_attribute))
-                                       continue;
-
-                               attrs.Add (attribute);
-                               if (remote_attribute)
-                                       attributes.RemoveAt (i);
-                       }
-
-                       return attrs;
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/CecilRocks.cs b/mcs/tools/tuner/Mono.Tuner/CecilRocks.cs
deleted file mode 100644 (file)
index 6995859..0000000
+++ /dev/null
@@ -1,519 +0,0 @@
-//
-// MethodBodyRocks.cs
-//
-// Author:
-//   Jb Evain (jbevain@gmail.com)
-//
-// Copyright (c) 2008 - 2011 Jb Evain
-//
-// 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.Linq;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Tuner {
-
-       public static class MethodBodyRocks {
-
-               public static IEnumerable<TypeDefinition> GetAllTypes (this ModuleDefinition self)
-               {
-                       return self.Types.SelectMany (t => t.GetAllTypes ());
-               }
-
-               static IEnumerable<TypeDefinition> GetAllTypes (this TypeDefinition self)
-               {
-                       yield return self;
-
-                       if (!self.HasNestedTypes)
-                               yield break;
-
-                       foreach (var type in self.NestedTypes.SelectMany (t => t.GetAllTypes ()))
-                               yield return type;
-               }
-
-               public static IEnumerable<MethodDefinition> GetMethods (this TypeDefinition self)
-               {
-                       return self.Methods.Where (m => !m.IsConstructor);
-               }
-
-               public static IEnumerable<MethodDefinition> GetConstructors (this TypeDefinition self)
-               {
-                       return self.Methods.Where (m => m.IsConstructor);
-               }
-
-               public static MethodDefinition GetTypeConstructor (this TypeDefinition self)
-               {
-                       return self.GetConstructors ().FirstOrDefault (c => c.IsStatic);
-               }
-
-               public static void SimplifyMacros (this MethodBody self)
-               {
-                       if (self == null)
-                               throw new ArgumentNullException ("self");
-
-                       foreach (var instruction in self.Instructions) {
-                               if (instruction.OpCode.OpCodeType != OpCodeType.Macro)
-                                       continue;
-
-                               switch (instruction.OpCode.Code) {
-                               case Code.Ldarg_0:
-                                       ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (0));
-                                       break;
-                               case Code.Ldarg_1:
-                                       ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (1));
-                                       break;
-                               case Code.Ldarg_2:
-                                       ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (2));
-                                       break;
-                               case Code.Ldarg_3:
-                                       ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (3));
-                                       break;
-                               case Code.Ldloc_0:
-                                       ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [0]);
-                                       break;
-                               case Code.Ldloc_1:
-                                       ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [1]);
-                                       break;
-                               case Code.Ldloc_2:
-                                       ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [2]);
-                                       break;
-                               case Code.Ldloc_3:
-                                       ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [3]);
-                                       break;
-                               case Code.Stloc_0:
-                                       ExpandMacro (instruction, OpCodes.Stloc, self.Variables [0]);
-                                       break;
-                               case Code.Stloc_1:
-                                       ExpandMacro (instruction, OpCodes.Stloc, self.Variables [1]);
-                                       break;
-                               case Code.Stloc_2:
-                                       ExpandMacro (instruction, OpCodes.Stloc, self.Variables [2]);
-                                       break;
-                               case Code.Stloc_3:
-                                       ExpandMacro (instruction, OpCodes.Stloc, self.Variables [3]);
-                                       break;
-                               case Code.Ldarg_S:
-                                       instruction.OpCode = OpCodes.Ldarg;
-                                       break;
-                               case Code.Ldarga_S:
-                                       instruction.OpCode = OpCodes.Ldarga;
-                                       break;
-                               case Code.Starg_S:
-                                       instruction.OpCode = OpCodes.Starg;
-                                       break;
-                               case Code.Ldloc_S:
-                                       instruction.OpCode = OpCodes.Ldloc;
-                                       break;
-                               case Code.Ldloca_S:
-                                       instruction.OpCode = OpCodes.Ldloca;
-                                       break;
-                               case Code.Stloc_S:
-                                       instruction.OpCode = OpCodes.Stloc;
-                                       break;
-                               case Code.Ldc_I4_M1:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, -1);
-                                       break;
-                               case Code.Ldc_I4_0:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 0);
-                                       break;
-                               case Code.Ldc_I4_1:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 1);
-                                       break;
-                               case Code.Ldc_I4_2:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 2);
-                                       break;
-                               case Code.Ldc_I4_3:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 3);
-                                       break;
-                               case Code.Ldc_I4_4:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 4);
-                                       break;
-                               case Code.Ldc_I4_5:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 5);
-                                       break;
-                               case Code.Ldc_I4_6:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 6);
-                                       break;
-                               case Code.Ldc_I4_7:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 7);
-                                       break;
-                               case Code.Ldc_I4_8:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, 8);
-                                       break;
-                               case Code.Ldc_I4_S:
-                                       ExpandMacro (instruction, OpCodes.Ldc_I4, (int) (sbyte) instruction.Operand);
-                                       break;
-                               case Code.Br_S:
-                                       instruction.OpCode = OpCodes.Br;
-                                       break;
-                               case Code.Brfalse_S:
-                                       instruction.OpCode = OpCodes.Brfalse;
-                                       break;
-                               case Code.Brtrue_S:
-                                       instruction.OpCode = OpCodes.Brtrue;
-                                       break;
-                               case Code.Beq_S:
-                                       instruction.OpCode = OpCodes.Beq;
-                                       break;
-                               case Code.Bge_S:
-                                       instruction.OpCode = OpCodes.Bge;
-                                       break;
-                               case Code.Bgt_S:
-                                       instruction.OpCode = OpCodes.Bgt;
-                                       break;
-                               case Code.Ble_S:
-                                       instruction.OpCode = OpCodes.Ble;
-                                       break;
-                               case Code.Blt_S:
-                                       instruction.OpCode = OpCodes.Blt;
-                                       break;
-                               case Code.Bne_Un_S:
-                                       instruction.OpCode = OpCodes.Bne_Un;
-                                       break;
-                               case Code.Bge_Un_S:
-                                       instruction.OpCode = OpCodes.Bge_Un;
-                                       break;
-                               case Code.Bgt_Un_S:
-                                       instruction.OpCode = OpCodes.Bgt_Un;
-                                       break;
-                               case Code.Ble_Un_S:
-                                       instruction.OpCode = OpCodes.Ble_Un;
-                                       break;
-                               case Code.Blt_Un_S:
-                                       instruction.OpCode = OpCodes.Blt_Un;
-                                       break;
-                               case Code.Leave_S:
-                                       instruction.OpCode = OpCodes.Leave;
-                                       break;
-                               }
-                       }
-               }
-
-               static void ExpandMacro (Instruction instruction, OpCode opcode, object operand)
-               {
-                       instruction.OpCode = opcode;
-                       instruction.Operand = operand;
-               }
-
-               static void MakeMacro (Instruction instruction, OpCode opcode)
-               {
-                       instruction.OpCode = opcode;
-                       instruction.Operand = null;
-               }
-
-               public static void OptimizeMacros (this MethodBody self)
-               {
-                       if (self == null)
-                               throw new ArgumentNullException ("self");
-
-                       var method = self.Method;
-
-                       foreach (var instruction in self.Instructions) {
-                               int index;
-                               switch (instruction.OpCode.Code) {
-                               case Code.Ldarg:
-                                       index = ((ParameterDefinition) instruction.Operand).Index;
-                                       if (index == -1 && instruction.Operand == self.ThisParameter)
-                                               index = 0;
-                                       else if (method.HasThis)
-                                               index++;
-
-                                       switch (index) {
-                                       case 0:
-                                               MakeMacro (instruction, OpCodes.Ldarg_0);
-                                               break;
-                                       case 1:
-                                               MakeMacro (instruction, OpCodes.Ldarg_1);
-                                               break;
-                                       case 2:
-                                               MakeMacro (instruction, OpCodes.Ldarg_2);
-                                               break;
-                                       case 3:
-                                               MakeMacro (instruction, OpCodes.Ldarg_3);
-                                               break;
-                                       default:
-                                               if (index < 256)
-                                                       ExpandMacro (instruction, OpCodes.Ldarg_S, instruction.Operand);
-                                               break;
-                                       }
-                                       break;
-                               case Code.Ldloc:
-                                       index = ((VariableDefinition) instruction.Operand).Index;
-                                       switch (index) {
-                                       case 0:
-                                               MakeMacro (instruction, OpCodes.Ldloc_0);
-                                               break;
-                                       case 1:
-                                               MakeMacro (instruction, OpCodes.Ldloc_1);
-                                               break;
-                                       case 2:
-                                               MakeMacro (instruction, OpCodes.Ldloc_2);
-                                               break;
-                                       case 3:
-                                               MakeMacro (instruction, OpCodes.Ldloc_3);
-                                               break;
-                                       default:
-                                               if (index < 256)
-                                                       ExpandMacro (instruction, OpCodes.Ldloc_S, instruction.Operand);
-                                               break;
-                                       }
-                                       break;
-                               case Code.Stloc:
-                                       index = ((VariableDefinition) instruction.Operand).Index;
-                                       switch (index) {
-                                       case 0:
-                                               MakeMacro (instruction, OpCodes.Stloc_0);
-                                               break;
-                                       case 1:
-                                               MakeMacro (instruction, OpCodes.Stloc_1);
-                                               break;
-                                       case 2:
-                                               MakeMacro (instruction, OpCodes.Stloc_2);
-                                               break;
-                                       case 3:
-                                               MakeMacro (instruction, OpCodes.Stloc_3);
-                                               break;
-                                       default:
-                                               if (index < 256)
-                                                       ExpandMacro (instruction, OpCodes.Stloc_S, instruction.Operand);
-                                               break;
-                                       }
-                                       break;
-                               case Code.Ldarga:
-                                       index = ((ParameterDefinition) instruction.Operand).Index;
-                                       if (index == -1 && instruction.Operand == self.ThisParameter)
-                                               index = 0;
-                                       else if (method.HasThis)
-                                               index++;
-                                       if (index < 256)
-                                               ExpandMacro (instruction, OpCodes.Ldarga_S, instruction.Operand);
-                                       break;
-                               case Code.Ldloca:
-                                       if (((VariableDefinition) instruction.Operand).Index < 256)
-                                               ExpandMacro (instruction, OpCodes.Ldloca_S, instruction.Operand);
-                                       break;
-                               case Code.Ldc_I4:
-                                       int i = (int) instruction.Operand;
-                                       switch (i) {
-                                       case -1:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_M1);
-                                               break;
-                                       case 0:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_0);
-                                               break;
-                                       case 1:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_1);
-                                               break;
-                                       case 2:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_2);
-                                               break;
-                                       case 3:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_3);
-                                               break;
-                                       case 4:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_4);
-                                               break;
-                                       case 5:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_5);
-                                               break;
-                                       case 6:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_6);
-                                               break;
-                                       case 7:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_7);
-                                               break;
-                                       case 8:
-                                               MakeMacro (instruction, OpCodes.Ldc_I4_8);
-                                               break;
-                                       default:
-                                               if (i >= -128 && i < 128)
-                                                       ExpandMacro (instruction, OpCodes.Ldc_I4_S, (sbyte) i);
-                                               break;
-                                       }
-                                       break;
-                               }
-                       }
-
-                       OptimizeBranches (self);
-               }
-
-               static void OptimizeBranches (MethodBody body)
-               {
-                       ComputeOffsets (body);
-
-                       foreach (var instruction in body.Instructions) {
-                               if (instruction.OpCode.OperandType != OperandType.InlineBrTarget)
-                                       continue;
-
-                               if (OptimizeBranch (instruction))
-                                       ComputeOffsets (body);
-                       }
-               }
-
-               static bool OptimizeBranch (Instruction instruction)
-               {
-                       var offset = ((Instruction) instruction.Operand).Offset - (instruction.Offset + instruction.OpCode.Size + 4);
-                       if (!(offset >= -128 && offset <= 127))
-                               return false;
-
-                       switch (instruction.OpCode.Code) {
-                       case Code.Br:
-                               instruction.OpCode = OpCodes.Br_S;
-                               break;
-                       case Code.Brfalse:
-                               instruction.OpCode = OpCodes.Brfalse_S;
-                               break;
-                       case Code.Brtrue:
-                               instruction.OpCode = OpCodes.Brtrue_S;
-                               break;
-                       case Code.Beq:
-                               instruction.OpCode = OpCodes.Beq_S;
-                               break;
-                       case Code.Bge:
-                               instruction.OpCode = OpCodes.Bge_S;
-                               break;
-                       case Code.Bgt:
-                               instruction.OpCode = OpCodes.Bgt_S;
-                               break;
-                       case Code.Ble:
-                               instruction.OpCode = OpCodes.Ble_S;
-                               break;
-                       case Code.Blt:
-                               instruction.OpCode = OpCodes.Blt_S;
-                               break;
-                       case Code.Bne_Un:
-                               instruction.OpCode = OpCodes.Bne_Un_S;
-                               break;
-                       case Code.Bge_Un:
-                               instruction.OpCode = OpCodes.Bge_Un_S;
-                               break;
-                       case Code.Bgt_Un:
-                               instruction.OpCode = OpCodes.Bgt_Un_S;
-                               break;
-                       case Code.Ble_Un:
-                               instruction.OpCode = OpCodes.Ble_Un_S;
-                               break;
-                       case Code.Blt_Un:
-                               instruction.OpCode = OpCodes.Blt_Un_S;
-                               break;
-                       case Code.Leave:
-                               instruction.OpCode = OpCodes.Leave_S;
-                               break;
-                       }
-
-                       return true;
-               }
-
-               static void ComputeOffsets (MethodBody body)
-               {
-                       var offset = 0;
-                       foreach (var instruction in body.Instructions) {
-                               instruction.Offset = offset;
-                               offset += instruction.GetSize ();
-                       }
-               }
-
-               public static ParameterDefinition GetParameter (this MethodBody self, int index)
-               {
-                       var method = self.Method;
-
-                       if (method.HasThis) {
-                               if (index == 0)
-                                       return self.ThisParameter;
-
-                               index--;
-                       }
-
-                       var parameters = method.Parameters;
-
-                       if (index < 0 || index >= parameters.Count)
-                               return null;
-
-                       return parameters [index];
-               }
-
-               public static bool Implements (this TypeReference self, string interfaceName)
-               {
-                       if (interfaceName == null)
-                               throw new ArgumentNullException ("interfaceName");
-                       if (self == null)
-                               return false;
-
-                       TypeDefinition type = self.Resolve ();
-                       if (type == null)
-                               return false;   // not enough information available
-
-                       // special case, check if we implement ourselves
-                       if (type.IsInterface && (type.FullName == interfaceName))
-                               return true;
-
-                       return Implements (type, interfaceName, (interfaceName.IndexOf ('`') >= 0));
-               }
-
-               public static bool Implements (TypeDefinition type, string interfaceName, bool generic)
-               {
-                       while (type != null) {
-                               // does the type implements it itself
-                               if (type.HasInterfaces) {
-                                       foreach (var iface in type.Interfaces) {
-                                               string fullname = (generic) ? iface.InterfaceType.GetElementType ().FullName : iface.InterfaceType.FullName;
-                                               if (fullname == interfaceName)
-                                                       return true;
-                                               //if not, then maybe one of its parent interfaces does
-                                               if (Implements (iface.InterfaceType.Resolve (), interfaceName, generic))
-                                                       return true;
-                                       }
-                               }
-
-                               type = type.BaseType != null ? type.BaseType.Resolve () : null;
-                       }
-                       return false;
-               }
-
-               public static bool Inherits (this TypeReference self, string @namespace, string name)
-               {
-                       if (@namespace == null)
-                               throw new ArgumentNullException ("namespace");
-                       if (name == null)
-                               throw new ArgumentNullException ("name");
-                       if (self == null)
-                               return false;
-                       
-                       TypeReference current = self.Resolve ();
-                       while (current != null) {
-                               if (current.Is (@namespace, name))
-                                       return true;
-                               if (current.Is ("System", "Object"))
-                                       return false;
-                               
-                               TypeDefinition td = current.Resolve ();
-                               if (td == null)
-                                       return false;           // could not resolve type
-                               current = td.BaseType;
-                       }
-                       return false;
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/CheckVisibility.cs b/mcs/tools/tuner/Mono.Tuner/CheckVisibility.cs
deleted file mode 100644 (file)
index df553db..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-//
-// CheckVisibility.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Collections;
-using System.Text;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Tuner {
-
-       public class CheckVisibility : BaseStep {
-
-               bool throw_on_error;
-
-               protected override void Process ()
-               {
-                       throw_on_error = GetThrowOnVisibilityErrorParameter ();
-               }
-
-               bool GetThrowOnVisibilityErrorParameter ()
-               {
-                       try {
-                               return bool.Parse (Context.GetParameter ("throw_on_visibility_error"));
-                       } catch {
-                               return false;
-                       }
-               }
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (assembly.Name.Name == "mscorlib" || assembly.Name.Name == "smcs")
-                               return;
-
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       Report ("in assembly {0}", assembly.Name);
-
-                       foreach (ModuleDefinition module in assembly.Modules)
-                               foreach (TypeDefinition type in module.Types)
-                                       CheckType (type);
-               }
-
-               void CheckType (TypeDefinition type)
-               {
-                       if (!IsVisibleFrom (type, type.BaseType)) {
-                               ReportError ("Base type `{0}` of type `{1}` is not visible",
-                                       type.BaseType, type);
-                       }
-
-                       CheckInterfaces (type);
-
-                       CheckFields (type);
-                       CheckMethods (type);
-               }
-
-               void CheckInterfaces (TypeDefinition type)
-               {
-                       foreach (var iface in type.Interfaces) {
-                               if (!IsVisibleFrom (type, iface.InterfaceType)) {
-                                       ReportError ("Interface `{0}` implemented by `{1}` is not visible",
-                                               iface, type);
-                               }
-                       }
-               }
-
-               static bool IsPublic (TypeDefinition type)
-               {
-                       return (type.DeclaringType == null && type.IsPublic) || type.IsNestedPublic;
-               }
-
-               static bool AreInDifferentAssemblies (TypeDefinition type, TypeDefinition target)
-               {
-                       if (type.Module.Assembly.Name.FullName == target.Module.Assembly.Name.FullName)
-                               return false;
-
-                       return !IsInternalVisibleTo (target.Module.Assembly, type.Module.Assembly);
-               }
-
-               static bool IsInternalVisibleTo (AssemblyDefinition assembly, AssemblyDefinition candidate)
-               {
-                       foreach (CustomAttribute attribute in assembly.CustomAttributes) {
-                               if (!IsInternalsVisibleToAttribute (attribute))
-                                       continue;
-
-                               if (attribute.ConstructorArguments.Count == 0)
-                                       continue;
-
-                               string signature = (string) attribute.ConstructorArguments [0].Value;
-
-                               if (InternalsVisibleToSignatureMatch (signature, candidate.Name))
-                                       return true;
-                       }
-
-                       return false;
-               }
-
-               static bool InternalsVisibleToSignatureMatch (string signature, AssemblyNameReference reference)
-               {
-                       int pos = signature.IndexOf (",");
-                       if (pos == -1)
-                               return signature == reference.Name;
-
-                       string assembly_name = signature.Substring (0, pos);
-
-                       pos = signature.IndexOf ("=");
-                       if (pos == -1)
-                               throw new ArgumentException ();
-
-                       string public_key = signature.Substring (pos + 1).ToLower ();
-
-                       return assembly_name == reference.Name && public_key == ToPublicKeyString (reference.PublicKey);
-               }
-
-               static string ToPublicKeyString (byte [] public_key)
-               {
-                       StringBuilder signature = new StringBuilder (public_key.Length);
-                       for (int i = 0; i < public_key.Length; i++)
-                               signature.Append (public_key [i].ToString ("x2"));
-
-                       return signature.ToString ();
-               }
-
-               static bool IsInternalsVisibleToAttribute (CustomAttribute attribute)
-               {
-                       return attribute.Constructor.DeclaringType.FullName == "System.Runtime.CompilerServices.InternalsVisibleToAttribute";
-               }
-
-               bool IsVisibleFrom (TypeDefinition type, TypeReference reference)
-               {
-                       if (reference == null)
-                               return true;
-
-                       if (reference is GenericParameter || reference.GetElementType () is GenericParameter)
-                               return true;
-
-                       TypeDefinition other = reference.Resolve ();
-                       if (other == null)
-                               return true;
-
-                       if (!AreInDifferentAssemblies (type, other))
-                               return true;
-
-                       if (IsPublic (other))
-                               return true;
-
-                       return false;
-               }
-
-               bool IsVisibleFrom (TypeDefinition type, MethodReference reference)
-               {
-                       if (reference == null)
-                               return true;
-
-                       MethodDefinition meth = reference.Resolve ();
-                       if (meth == null)
-                               return true;
-
-                       TypeDefinition dec = (TypeDefinition) meth.DeclaringType;
-                       if (!IsVisibleFrom (type, dec))
-                               return false;
-
-                       if (meth.IsPublic)
-                               return true;
-
-                       if (type == dec || IsNestedIn (type, dec))
-                               return true;
-
-                       if (meth.IsFamily && InHierarchy (type, dec))
-                               return true;
-
-                       if (meth.IsFamilyOrAssembly && (!AreInDifferentAssemblies (type, dec) || InHierarchy (type, dec)))
-                               return true;
-
-                       if (meth.IsFamilyAndAssembly && (!AreInDifferentAssemblies (type, dec) && InHierarchy (type, dec)))
-                               return true;
-
-                       if (!AreInDifferentAssemblies (type, dec) && meth.IsAssembly)
-                               return true;
-
-                       return false;
-               }
-
-               bool IsVisibleFrom (TypeDefinition type, FieldReference reference)
-               {
-                       if (reference == null)
-                               return true;
-
-                       FieldDefinition field = reference.Resolve ();
-                       if (field == null)
-                               return true;
-
-                       TypeDefinition dec = (TypeDefinition) field.DeclaringType;
-                       if (!IsVisibleFrom (type, dec))
-                               return false;
-
-                       if (field.IsPublic)
-                               return true;
-
-                       if (type == dec || IsNestedIn (type, dec))
-                               return true;
-
-                       if (field.IsFamily && InHierarchy (type, dec))
-                               return true;
-
-                       if (field.IsFamilyOrAssembly && (!AreInDifferentAssemblies (type, dec) || InHierarchy (type, dec)))
-                               return true;
-
-                       if (field.IsFamilyAndAssembly && (!AreInDifferentAssemblies (type, dec) && InHierarchy (type, dec)))
-                               return true;
-
-                       if (!AreInDifferentAssemblies (type, dec) && field.IsAssembly)
-                               return true;
-
-                       return false;
-               }
-
-               static bool IsNestedIn (TypeDefinition type, TypeDefinition other)
-               {
-                       TypeDefinition declaring = type.DeclaringType;
-
-                       if (declaring == null)
-                               return false;
-
-                       if (declaring == other)
-                               return true;
-
-                       if (declaring.DeclaringType == null)
-                               return false;
-
-                       return IsNestedIn (declaring, other);
-               }
-
-               static bool InHierarchy (TypeDefinition type, TypeDefinition other)
-               {
-                       if (type.BaseType == null)
-                               return false;
-
-                       TypeDefinition baseType = type.BaseType.Resolve ();
-
-                       if (baseType == other)
-                               return true;
-
-                       return InHierarchy (baseType, other);
-               }
-
-               static void Report (string pattern, params object [] parameters)
-               {
-                       Console.WriteLine ("[check] " + pattern, parameters);
-               }
-
-               void ReportError (string pattern, params object [] parameters)
-               {
-                       Report (pattern, parameters);
-
-                       if (throw_on_error)
-                               throw new VisibilityErrorException (string.Format (pattern, parameters));
-               }
-
-               void CheckFields (TypeDefinition type)
-               {
-                       foreach (FieldDefinition field in type.Fields) {
-                               if (!IsVisibleFrom (type, field.FieldType)) {
-                                       ReportError ("Field `{0}` of type `{1}` is not visible from `{2}`",
-                                               field.Name, field.FieldType, type);
-                               }
-                       }
-               }
-
-               void CheckMethods (TypeDefinition type)
-               {
-                       CheckMethods (type, type.Methods);
-               }
-
-               void CheckMethods (TypeDefinition type, ICollection methods)
-               {
-                       foreach (MethodDefinition method in methods) {
-                               if (!IsVisibleFrom (type, method.ReturnType)) {
-                                       ReportError ("Method return type `{0}` in method `{1}` is not visible",
-                                               method.ReturnType, method);
-                               }
-
-                               foreach (ParameterDefinition parameter in method.Parameters) {
-                                       if (!IsVisibleFrom (type, parameter.ParameterType)) {
-                                               ReportError ("Parameter `{0}` of type `{1}` in method `{2}` is not visible.",
-                                                       parameter.Index, parameter.ParameterType, method);
-                                       }
-                               }
-
-                               if (method.HasBody)
-                                       CheckBody (method);
-                       }
-               }
-
-               void CheckBody (MethodDefinition method)
-               {
-                       TypeDefinition type = (TypeDefinition) method.DeclaringType;
-
-                       foreach (VariableDefinition variable in method.Body.Variables) {
-                               if (!IsVisibleFrom ((TypeDefinition) method.DeclaringType, variable.VariableType)) {
-                                       ReportError ("Variable `{0}` of type `{1}` from method `{2}` is not visible",
-                                               variable.Index, variable.VariableType, method);
-                               }
-                       }
-
-                       foreach (Instruction instr in method.Body.Instructions) {
-                               switch (instr.OpCode.OperandType) {
-                               case OperandType.InlineType:
-                               case OperandType.InlineMethod:
-                               case OperandType.InlineField:
-                               case OperandType.InlineTok:
-                                       bool error = false;
-                                       TypeReference type_ref = instr.Operand as TypeReference;
-                                       if (type_ref != null)
-                                               error = !IsVisibleFrom (type, type_ref);
-
-                                       MethodReference meth_ref = instr.Operand as MethodReference;
-                                       if (meth_ref != null)
-                                               error = !IsVisibleFrom (type, meth_ref);
-
-                                       FieldReference field_ref = instr.Operand as FieldReference;
-                                       if (field_ref != null)
-                                               error = !IsVisibleFrom (type, field_ref);
-
-                                       if (error) {
-                                               ReportError ("Operand `{0}` of type {1} at offset 0x{2} in method `{3}` is not visible",
-                                                       instr.Operand, instr.OpCode.OperandType, instr.Offset.ToString ("x4"), method);
-                                       }
-
-                                       break;
-                               default:
-                                       continue;
-                               }
-                       }
-               }
-
-               class VisibilityErrorException : Exception {
-
-                       public VisibilityErrorException (string message)
-                               : base (message)
-                       {
-                       }
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/CustomizeActions.cs b/mcs/tools/tuner/Mono.Tuner/CustomizeActions.cs
deleted file mode 100644 (file)
index 1bb6d6f..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Tuner {
-
-       public class CustomizeActions : BaseStep {
-
-               readonly bool link_sdk_only;
-               readonly HashSet<string> skipped_assemblies;
-
-               public CustomizeActions (bool link_sdk_only, IEnumerable<string> skipped_assemblies)
-               {
-                       this.link_sdk_only = link_sdk_only;
-                       this.skipped_assemblies = new HashSet<string> (skipped_assemblies);
-               }
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (!IsSkipped (assembly) && IsLinked (assembly)) {
-                               if (!Annotations.HasAction (assembly)) // stray assembly not picked up when resolving references
-                                       Annotations.SetAction (assembly, AssemblyAction.Link);
-                               return;
-                       }
-                       ProcessUserAssembly (assembly);
-               }
-
-               protected virtual bool IsPreservedAttribute (CustomAttribute attribute)
-               {
-                       // [assembly: Preserve (type)] does not preserve all the code in the assembly, in fact it might
-                       // not preserve anything in _this_ assembly, but something in a separate assembly (reference)
-                       if (attribute.HasConstructorArguments)
-                               return false;
-                       return (attribute.AttributeType.Name == "PreserveAttribute");
-               }
-
-               protected virtual bool IsLinkerSafeAttribute (CustomAttribute attribute)
-               {
-                       return (attribute.AttributeType.Name == "LinkerSafeAttribute");
-               }
-
-               const ModuleAttributes Supported = ModuleAttributes.ILOnly | ModuleAttributes.Required32Bit | 
-                       ModuleAttributes.Preferred32Bit | ModuleAttributes.StrongNameSigned;
-
-               protected virtual bool IsSkipped (AssemblyDefinition assembly)
-               {
-                       // Cecil can't save back mixed-mode assemblies - so we can't link them
-                       if ((assembly.MainModule.Attributes & ~Supported) != 0)
-                               return true;
-
-                       if (assembly.HasCustomAttributes) {
-                               foreach (var ca in assembly.CustomAttributes) {
-                                       if (IsPreservedAttribute (ca))
-                                               return true;
-                               }
-                       }
-                       return skipped_assemblies.Contains (assembly.Name.Name);
-               }
-
-               protected virtual bool IsLinked (AssemblyDefinition assembly)
-               {
-                       // LinkAll
-                       if (!link_sdk_only)
-                               return true;
-                       // Link SDK : applies to BCL/SDK and product assembly (e.g. monotouch.dll)
-                       if (Profile.IsSdkAssembly (assembly))
-                               return true;
-                       if (Profile.IsProductAssembly (assembly))
-                           return true;
-                       // the assembly can be marked with [LinkAssembly]
-                       if (assembly.HasCustomAttributes) {
-                               foreach (var ca in assembly.CustomAttributes) {
-                                       if (IsLinkerSafeAttribute (ca))
-                                               return true;
-                               }
-                       }
-                       return false;
-               }
-
-               protected void ProcessUserAssembly (AssemblyDefinition assembly)
-               {
-                       ResolveFromAssemblyStep.ProcessLibrary (Context, assembly);
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs b/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs
deleted file mode 100644 (file)
index 9dcf5ee..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       [Flags]
-       public enum SubStepTargets {
-               None = 0,
-
-               Assembly = 1,
-               Type = 2,
-               Field = 4,
-               Method = 8,
-               Property = 16,
-               Event = 32,
-       }
-
-       public interface ISubStep {
-
-               SubStepTargets Targets { get; }
-
-               void Initialize (LinkContext context);
-               bool IsActiveFor (AssemblyDefinition assembly);
-
-               void ProcessAssembly (AssemblyDefinition assembly);
-               void ProcessType (TypeDefinition type);
-               void ProcessField (FieldDefinition field);
-               void ProcessMethod (MethodDefinition method);
-               void ProcessProperty (PropertyDefinition property);
-               void ProcessEvent (EventDefinition @event);
-       }
-
-       public abstract class BaseSubStep : ISubStep {
-
-               protected LinkContext context;
-
-               public AnnotationStore Annotations {
-                       get { return context.Annotations; }
-               }
-
-               public abstract SubStepTargets Targets { get; }
-
-               public virtual void Initialize (LinkContext context)
-               {
-                       this.context = context;
-               }
-
-               public virtual bool IsActiveFor (AssemblyDefinition assembly)
-               {
-                       return true;
-               }
-
-               public virtual void ProcessAssembly (AssemblyDefinition assembly)
-               {
-               }
-
-               public virtual void ProcessType (TypeDefinition type)
-               {
-               }
-
-               public virtual void ProcessField (FieldDefinition field)
-               {
-               }
-
-               public virtual void ProcessMethod (MethodDefinition method)
-               {
-               }
-
-               public virtual void ProcessProperty (PropertyDefinition property)
-               {
-               }
-
-               public virtual void ProcessEvent (EventDefinition @event)
-               {
-               }
-       }
-
-       public class SubStepDispatcher : IStep, IEnumerable<ISubStep> {
-
-               List<ISubStep> substeps = new List<ISubStep> ();
-
-               List<ISubStep> on_assemblies;
-               List<ISubStep> on_types;
-               List<ISubStep> on_fields;
-               List<ISubStep> on_methods;
-               List<ISubStep> on_properties;
-               List<ISubStep> on_events;
-
-               public void Add (ISubStep substep)
-               {
-                       substeps.Add (substep);
-               }
-
-               public void Process (LinkContext context)
-               {
-                       InitializeSubSteps (context);
-
-                       BrowseAssemblies (context.GetAssemblies ());
-               }
-
-               static bool HasSubSteps (List<ISubStep> substeps)
-               {
-                       return substeps != null && substeps.Count > 0;
-               }
-
-               void BrowseAssemblies (IEnumerable<AssemblyDefinition> assemblies)
-               {
-                       foreach (var assembly in assemblies) {
-                               CategorizeSubSteps (assembly);
-
-                               if (HasSubSteps (on_assemblies))
-                                       DispatchAssembly (assembly);
-
-                               if (!ShouldDispatchTypes ())
-                                       continue;
-
-                               BrowseTypes (assembly.MainModule.Types);
-                       }
-               }
-
-               bool ShouldDispatchTypes ()
-               {
-                       return HasSubSteps (on_types)
-                               || HasSubSteps (on_fields)
-                               || HasSubSteps (on_methods)
-                               || HasSubSteps (on_properties)
-                               || HasSubSteps (on_events);
-               }
-
-               void BrowseTypes (ICollection types)
-               {
-                       foreach (TypeDefinition type in types) {
-                               DispatchType (type);
-
-                               if (type.HasFields && HasSubSteps (on_fields))
-                                       BrowseFields (type.Fields);
-
-                               if (type.HasMethods && HasSubSteps (on_methods))
-                                       BrowseMethods (type.Methods);
-
-                               if (type.HasProperties && HasSubSteps (on_properties))
-                                       BrowseProperties (type.Properties);
-
-                               if (type.HasEvents && HasSubSteps (on_events))
-                                       BrowseEvents (type.Events);
-
-                               if (type.HasNestedTypes)
-                                       BrowseTypes (type.NestedTypes);
-                       }
-               }
-
-               void BrowseFields (ICollection fields)
-               {
-                       foreach (FieldDefinition field in fields)
-                               DispatchField (field);
-               }
-
-               void BrowseMethods (ICollection methods)
-               {
-                       foreach (MethodDefinition method in methods)
-                               DispatchMethod (method);
-               }
-
-               void BrowseProperties (ICollection properties)
-               {
-                       foreach (PropertyDefinition property in properties)
-                               DispatchProperty (property);
-               }
-
-               void BrowseEvents (ICollection events)
-               {
-                       foreach (EventDefinition @event in events)
-                               DispatchEvent (@event);
-               }
-
-               void DispatchAssembly (AssemblyDefinition assembly)
-               {
-                       foreach (var substep in on_assemblies) {
-                               var bs = substep as BaseSubStep;
-                               if (bs != null)
-                                       bs.Annotations.Push (substep);
-                               substep.ProcessAssembly (assembly);
-                               if (bs != null)
-                                       bs.Annotations.Pop ();
-                       }
-               }
-
-               void DispatchType (TypeDefinition type)
-               {
-                       foreach (var substep in on_types) {
-                               var bs = substep as BaseSubStep;
-                               if (bs != null)
-                                       bs.Annotations.Push (substep);
-                               substep.ProcessType (type);
-                               if (bs != null)
-                                       bs.Annotations.Pop ();
-                       }
-               }
-
-               void DispatchField (FieldDefinition field)
-               {
-                       foreach (var substep in on_fields)
-                               substep.ProcessField (field);
-               }
-
-               void DispatchMethod (MethodDefinition method)
-               {
-                       foreach (var substep in on_methods)
-                               substep.ProcessMethod (method);
-               }
-
-               void DispatchProperty (PropertyDefinition property)
-               {
-                       foreach (var substep in on_properties)
-                               substep.ProcessProperty (property);
-               }
-
-               void DispatchEvent (EventDefinition @event)
-               {
-                       foreach (var substep in on_events)
-                               substep.ProcessEvent (@event);
-               }
-
-               void InitializeSubSteps (LinkContext context)
-               {
-                       foreach (var substep in substeps)
-                               substep.Initialize (context);
-               }
-
-               void CategorizeSubSteps (AssemblyDefinition assembly)
-               {
-                       on_assemblies = null;
-                       on_types = null;
-                       on_fields = null;
-                       on_methods = null;
-                       on_properties = null;
-                       on_events = null;
-
-                       foreach (var substep in substeps)
-                               CategorizeSubStep (substep, assembly);
-               }
-
-               void CategorizeSubStep (ISubStep substep, AssemblyDefinition assembly)
-               {
-                       if (!substep.IsActiveFor (assembly))
-                               return;
-
-                       CategorizeTarget (substep, SubStepTargets.Assembly, ref on_assemblies);
-                       CategorizeTarget (substep, SubStepTargets.Type, ref on_types);
-                       CategorizeTarget (substep, SubStepTargets.Field, ref on_fields);
-                       CategorizeTarget (substep, SubStepTargets.Method, ref on_methods);
-                       CategorizeTarget (substep, SubStepTargets.Property, ref on_properties);
-                       CategorizeTarget (substep, SubStepTargets.Event, ref on_events);
-               }
-
-               static void CategorizeTarget (ISubStep substep, SubStepTargets target, ref List<ISubStep> list)
-               {
-                       if (!Targets (substep, target))
-                               return;
-
-                       if (list == null)
-                               list = new List<ISubStep> ();
-
-                       list.Add (substep);
-               }
-
-               static bool Targets (ISubStep substep, SubStepTargets target)
-               {
-                       return (substep.Targets & target) == target;
-               }
-
-               IEnumerator IEnumerable.GetEnumerator ()
-               {
-                       return GetEnumerator ();
-               }
-
-               public IEnumerator<ISubStep> GetEnumerator ()
-               {
-                       return substeps.GetEnumerator ();
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/Extensions.cs b/mcs/tools/tuner/Mono.Tuner/Extensions.cs
deleted file mode 100644 (file)
index 3e3b312..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Mono.Cecil;
-
-using Mono.Linker;
-
-namespace Mono.Tuner {
-
-       public static partial class Extensions {
-
-               public static bool TryGetLinkedAssembly (this LinkContext context, string name, out AssemblyDefinition assembly)
-               {
-                       assembly = GetAssembly (context, name);
-                       if (assembly == null)
-                               return false;
-
-                       return context.Annotations.GetAction (assembly) == AssemblyAction.Link;
-               }
-
-               public static AssemblyDefinition GetAssembly (this LinkContext context, string assembly_name)
-               {
-                       foreach (var assembly in context.GetAssemblies ())
-                               if (assembly.Name.Name == assembly_name)
-                                       return assembly;
-
-                       return null;
-               }
-
-               // note: direct check, no inheritance
-               public static bool Is (this TypeReference type, string @namespace, string name)
-               {
-                       return ((type != null) && (type.Name == name) && (type.Namespace == @namespace));
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/FilterAttributes.cs b/mcs/tools/tuner/Mono.Tuner/FilterAttributes.cs
deleted file mode 100644 (file)
index 19a334a..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// FilterAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class FilterAttributes : BaseStep {
-
-               static Hashtable attributes = new Hashtable ();
-
-               static FilterAttributes ()
-               {
-                       FilterAttribute ("System.Runtime.InteropServices.ComVisibleAttribute");
-               }
-
-               static void FilterAttribute (string fullname)
-               {
-                       attributes.Add (fullname, null);
-               }
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       Filter (assembly);
-
-                       foreach (ModuleDefinition module in assembly.Modules)
-                               ProcessModule (module);
-               }
-
-               static void ProcessModule (ModuleDefinition module)
-               {
-                       Filter (module);
-
-                       foreach (TypeDefinition type in module.Types)
-                               ProcessType (type);
-               }
-
-               static void ProcessType (TypeDefinition type)
-               {
-                       if (type.HasFields)
-                               ProcessFields (type.Fields);
-
-                       if (type.HasMethods)
-                               ProcessMethods (type.Methods);
-
-                       if (type.HasEvents)
-                               ProcessEvents (type.Events);
-
-                       if (type.HasProperties)
-                               ProcessProperties (type.Properties);
-
-                       ProcessGenericParameters (type);
-               }
-
-               static void ProcessFields (ICollection fields)
-               {
-                       foreach (FieldDefinition field in fields)
-                               Filter (field);
-               }
-
-               static void ProcessMethods (ICollection methods)
-               {
-                       foreach (MethodDefinition method in methods)
-                               ProcessMethod (method);
-               }
-
-               static void ProcessMethod (MethodDefinition method)
-               {
-                       ProcessGenericParameters (method);
-
-                       Filter (method.MethodReturnType);
-
-                       if (method.HasParameters)
-                               ProcessParameters (method.Parameters);
-               }
-
-               static void ProcessParameters (ICollection parameters)
-               {
-                       foreach (ParameterDefinition parameter in parameters)
-                               Filter (parameter);
-               }
-
-               static void ProcessGenericParameters (IGenericParameterProvider provider)
-               {
-                       if (!provider.HasGenericParameters)
-                               return;
-
-                       foreach (GenericParameter parameter in provider.GenericParameters)
-                               Filter (parameter);
-               }
-
-               static void ProcessEvents (ICollection events)
-               {
-                       foreach (EventDefinition @event in events)
-                               Filter (@event);
-               }
-
-               static void ProcessProperties (ICollection properties)
-               {
-                       foreach (PropertyDefinition property in properties)
-                               Filter (property);
-               }
-
-               static void Filter (ICustomAttributeProvider provider)
-               {
-                       if (!provider.HasCustomAttributes)
-                               return;
-
-                       for (int i = 0; i < provider.CustomAttributes.Count; i++) {
-                               CustomAttribute attribute = provider.CustomAttributes [i];
-                               if (!IsFilteredAttribute (attribute))
-                                       continue;
-
-                               provider.CustomAttributes.RemoveAt (i--);
-                       }
-               }
-
-               static bool IsFilteredAttribute (CustomAttribute attribute)
-               {
-                       return attributes.Contains (attribute.Constructor.DeclaringType.FullName);
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/FixModuleFlags.cs b/mcs/tools/tuner/Mono.Tuner/FixModuleFlags.cs
deleted file mode 100644 (file)
index 2bb01ab..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class FixModuleFlags : BaseStep {
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       assembly.MainModule.Attributes = ModuleAttributes.ILOnly;
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/InjectSecurityAttributes.cs b/mcs/tools/tuner/Mono.Tuner/InjectSecurityAttributes.cs
deleted file mode 100644 (file)
index 9489876..0000000
+++ /dev/null
@@ -1,500 +0,0 @@
-//
-// InjectSecurityAttributes.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-using System.IO;
-using System.Linq;
-using System.Text;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Tuner {
-
-       public class InjectSecurityAttributes : BaseStep {
-
-               enum TargetKind {
-                       Type,
-                       Method,
-               }
-
-               protected enum AttributeType {
-                       Critical,
-                       SafeCritical,
-               }
-
-               const string _safe_critical = "System.Security.SecuritySafeCriticalAttribute";
-               const string _critical = "System.Security.SecurityCriticalAttribute";
-               const string _system_void = "System.Void";
-
-               const string sec_attr_folder = "secattrs";
-
-               protected AssemblyDefinition _assembly;
-
-               MethodDefinition _safe_critical_ctor;
-               MethodDefinition _critical_ctor;
-               TypeDefinition _void_type;
-
-               string data_folder;
-
-               protected override bool ConditionToProcess ()
-               {
-                       if (!Context.HasParameter (sec_attr_folder)) {
-                               Console.Error.WriteLine ("Warning: no secattrs folder specified.");
-                               return false;
-                       }
-
-                       data_folder = Context.GetParameter (sec_attr_folder);
-                       return true;
-               }
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       string secattr_file = Path.Combine (
-                               data_folder,
-                               assembly.Name.Name + ".secattr");
-
-                       if (!File.Exists (secattr_file)) {
-                               Console.Error.WriteLine ("Warning: file '{0}' not found, skipping.", secattr_file);
-                               return;
-                       }
-
-                       _assembly = assembly;
-
-                       // remove existing [SecurityCritical] and [SecuritySafeCritical]
-                       RemoveSecurityAttributes ();
-
-                       // add [SecurityCritical] and [SecuritySafeCritical] from the data file
-                       ProcessSecurityAttributeFile (secattr_file);
-               }
-
-               protected void RemoveSecurityAttributes ()
-               {
-                       foreach (TypeDefinition type in _assembly.MainModule.Types) {
-                               if (RemoveSecurityAttributes (type))
-                                       type.HasSecurity = false;
-
-                               if (type.HasMethods) {
-                                       foreach (MethodDefinition method in type.Methods) {
-                                               if (RemoveSecurityAttributes (method))
-                                                       method.HasSecurity = false;
-                                       }
-                               }
-                       }
-               }
-
-               static bool RemoveSecurityDeclarations (ISecurityDeclarationProvider provider)
-               {
-                       // also remove already existing CAS security declarations
-
-                       if (provider == null)
-                               return false;
-
-                       if (!provider.HasSecurityDeclarations)
-                               return false;
-
-                       provider.SecurityDeclarations.Clear ();
-                       return true;
-               }
-
-               static bool RemoveSecurityAttributes (ICustomAttributeProvider provider)
-               {
-                       bool result = RemoveSecurityDeclarations (provider as ISecurityDeclarationProvider);
-
-                       if (!provider.HasCustomAttributes)
-                               return result;
-
-                       var attributes = provider.CustomAttributes;
-                       for (int i = 0; i < attributes.Count; i++) {
-                               CustomAttribute attribute = attributes [i];
-                               switch (attribute.Constructor.DeclaringType.FullName) {
-                               case _safe_critical:
-                               case _critical:
-                                       attributes.RemoveAt (i--);
-                                       break;
-                               }
-                       }
-                       return result;
-               }
-
-               void ProcessSecurityAttributeFile (string file)
-               {
-                       using (StreamReader reader = File.OpenText (file)) {
-                               string line;
-                               while ((line = reader.ReadLine ()) != null)
-                                       ProcessLine (line);
-                       }
-               }
-
-               void ProcessLine (string line)
-               {
-                       if (line == null || line.Length < 6 || line [0] == '#')
-                               return;
-
-                       int sep = line.IndexOf (": ");
-                       if (sep == -1)
-                               return;
-
-                       string marker = line.Substring (0, sep);
-                       string target = line.Substring (sep + 2);
-
-                       ProcessSecurityAttributeEntry (
-                               DecomposeAttributeType (marker),
-                               DecomposeTargetKind (marker),
-                               target);
-               }
-
-               static AttributeType DecomposeAttributeType (string marker)
-               {
-                       if (marker.StartsWith ("SC"))
-                               return AttributeType.Critical;
-                       else if (marker.StartsWith ("SSC"))
-                               return AttributeType.SafeCritical;
-                       else
-                               throw new ArgumentException ();
-               }
-
-               static TargetKind DecomposeTargetKind (string marker)
-               {
-                       switch (marker [marker.Length - 1]) {
-                       case 'T':
-                               return TargetKind.Type;
-                       case 'M':
-                               return TargetKind.Method;
-                       default:
-                               throw new ArgumentException ();
-                       }
-               }
-
-               public static bool NeedsDefaultConstructor (TypeDefinition type)
-               {
-                       if (type.IsInterface)
-                               return false;
-
-                       TypeReference base_type = type.BaseType;
-                       if ((base_type == null) || (base_type.Namespace != "System"))
-                               return true;
-
-                       return ((base_type.Name != "Delegate") && (base_type.Name != "MulticastDelegate"));
-               }
-
-               void ProcessSecurityAttributeEntry (AttributeType type, TargetKind kind, string target)
-               {
-                       ICustomAttributeProvider provider = GetTarget (kind, target);
-                       if (provider == null) {
-                               Console.Error.WriteLine ("Warning: entry '{0}' could not be found", target);
-                               return;
-                       }
-
-                       // we need to be smarter when applying the attributes (mostly SC) to types
-                       if (kind == TargetKind.Type) {
-                               TypeDefinition td = (provider as TypeDefinition);
-                               // ensure [SecurityCritical] types (well most) have a default constructor
-                               if ((type == AttributeType.Critical) && NeedsDefaultConstructor (td)) {
-                                       if (GetDefaultConstructor (td) == null) {
-                                               // Console.Error.WriteLine ("Info: adding default ctor for '{0}'", td);
-                                               td.Methods.Add (CreateDefaultConstructor ());
-                                       }
-                               }
-
-                               // it's easier for some tools (e.g. less false positives in fxcop) 
-                               // and also quicker for the runtime (one less lookup) if all methods gets decorated
-                               foreach (MethodDefinition method in td.Methods) {
-                                       bool skip = false;
-
-                                       AttributeType mtype = type;
-                                       // there are cases where an SC cannot be applied to some methods
-                                       switch (method.Name) {
-                                       // e.g. everything we override from System.Object (which is transparent)
-                                       case "Equals":
-                                               skip = method.Parameters.Count == 1 && method.Parameters [0].ParameterType.FullName == "System.Object";
-                                               break;
-                                       case "Finalize":
-                                       case "GetHashCode":
-                                       case "ToString":
-                                               skip = !method.HasParameters;
-                                               break;
-                                       // e.g. some transparent interfaces, like IDisposable (implicit or explicit)
-                                       // downgrade some SC into SSC to respect the override/inheritance rules
-                                       case "System.IDisposable.Dispose":
-                                       case "Dispose":
-                                               skip = !method.HasParameters;
-                                               break;
-                                       }
-
-                                       if (skip)
-                                               continue;
-
-                                       switch (mtype) {
-                                       case AttributeType.Critical:
-                                               AddCriticalAttribute (method);
-                                               break;
-                                       case AttributeType.SafeCritical:
-                                               AddSafeCriticalAttribute (method);
-                                               break;
-                                       }
-                               }
-                       }
-
-                       switch (type) {
-                       case AttributeType.Critical:
-                               AddCriticalAttribute (provider);
-                               break;
-                       case AttributeType.SafeCritical:
-                               AddSafeCriticalAttribute (provider);
-                               break;
-                       }
-               }
-
-               protected void AddCriticalAttribute (ICustomAttributeProvider provider)
-               {
-                       // a [SecurityCritical] replaces a [SecuritySafeCritical]
-                       if (HasSecurityAttribute (provider, AttributeType.SafeCritical))
-                               RemoveSecurityAttributes (provider);
-
-                       AddSecurityAttribute (provider, AttributeType.Critical);
-               }
-
-               void AddSafeCriticalAttribute (ICustomAttributeProvider provider)
-               {
-                       // a [SecuritySafeCritical] is ignored if a [SecurityCritical] is present
-                       if (HasSecurityAttribute (provider, AttributeType.Critical))
-                               return;
-
-                       AddSecurityAttribute (provider, AttributeType.SafeCritical);
-               }
-
-               void AddSecurityAttribute (ICustomAttributeProvider provider, AttributeType type)
-               {
-                       if (HasSecurityAttribute (provider, type))
-                               return;
-
-                       var attributes = provider.CustomAttributes;
-                       switch (type) {
-                       case AttributeType.Critical:
-                               attributes.Add (CreateCriticalAttribute ());
-                               break;
-                       case AttributeType.SafeCritical:
-                               attributes.Add (CreateSafeCriticalAttribute ());
-                               break;
-                       }
-               }
-
-               protected static bool HasSecurityAttribute (ICustomAttributeProvider provider, AttributeType type)
-               {
-                       if (!provider.HasCustomAttributes)
-                               return false;
-
-                       foreach (CustomAttribute attribute in provider.CustomAttributes) {
-                               switch (attribute.Constructor.DeclaringType.Name) {
-                               case _critical:
-                                       if (type == AttributeType.Critical)
-                                               return true;
-
-                                       break;
-                               case _safe_critical:
-                                       if (type == AttributeType.SafeCritical)
-                                               return true;
-
-                                       break;
-                               }
-                       }
-
-                       return false;
-               }
-
-               ICustomAttributeProvider GetTarget (TargetKind kind, string target)
-               {
-                       switch (kind) {
-                       case TargetKind.Type:
-                               return GetType (target);
-                       case TargetKind.Method:
-                               return GetMethod (target);
-                       default:
-                               throw new ArgumentException ();
-                       }
-               }
-
-               TypeDefinition GetType (string fullname)
-               {
-                       return _assembly.MainModule.GetType (fullname);
-               }
-
-               MethodDefinition GetMethod (string signature)
-               {
-                       int pos = signature.IndexOf (" ");
-                       if (pos == -1)
-                               throw new ArgumentException ();
-
-                       string tmp = signature.Substring (pos + 1);
-
-                       pos = tmp.IndexOf ("::");
-                       if (pos == -1)
-                               throw new ArgumentException ();
-
-                       string type_name = tmp.Substring (0, pos);
-
-                       int parpos = tmp.IndexOf ("(");
-                       if (parpos == -1)
-                               throw new ArgumentException ();
-
-                       string method_name = tmp.Substring (pos + 2, parpos - pos - 2);
-
-                       TypeDefinition type = GetType (type_name);
-                       if (type == null)
-                               return null;
-
-                       return GetMethod (type.Methods, signature);
-               }
-
-               static MethodDefinition GetMethod (IEnumerable methods, string signature)
-               {
-                       foreach (MethodDefinition method in methods)
-                               if (GetFullName (method) == signature)
-                                       return method;
-
-                       return null;
-               }
-
-               static string GetFullName (MethodReference method)
-               {
-                       var sentinel = method.Parameters.FirstOrDefault (p => p.ParameterType.IsSentinel);
-                       var sentinel_pos = -1;
-                       if (sentinel != null)
-                               sentinel_pos = method.Parameters.IndexOf (sentinel);
-
-                       StringBuilder sb = new StringBuilder ();
-                       sb.Append (method.ReturnType.FullName);
-                       sb.Append (" ");
-                       sb.Append (method.DeclaringType.FullName);
-                       sb.Append ("::");
-                       sb.Append (method.Name);
-                       if (method.HasGenericParameters) {
-                               sb.Append ("<");
-                               for (int i = 0; i < method.GenericParameters.Count; i++ ) {
-                                       if (i > 0)
-                                               sb.Append (",");
-                                       sb.Append (method.GenericParameters [i].Name);
-                               }
-                               sb.Append (">");
-                       }
-                       sb.Append ("(");
-                       if (method.HasParameters) {
-                               for (int i = 0; i < method.Parameters.Count; i++) {
-                                       if (i > 0)
-                                               sb.Append (",");
-
-                                       if (i == sentinel_pos)
-                                               sb.Append ("...,");
-
-                                       sb.Append (method.Parameters [i].ParameterType.FullName);
-                               }
-                       }
-                       sb.Append (")");
-                       return sb.ToString ();
-               }
-
-               static MethodDefinition GetDefaultConstructor (TypeDefinition type)
-               {
-                       foreach (MethodDefinition ctor in type.Methods.Where (m => m.IsConstructor))
-                               if (!ctor.IsStatic && !ctor.HasParameters)
-                                       return ctor;
-
-                       return null;
-               }
-
-               MethodDefinition GetSafeCriticalCtor ()
-               {
-                       if (_safe_critical_ctor != null)
-                               return _safe_critical_ctor;
-
-                       TypeDefinition safe_critical_type = Context.GetType (_safe_critical);
-                       if (safe_critical_type == null)
-                               throw new InvalidOperationException (String.Format ("{0} type not found", _safe_critical));
-
-                       _safe_critical_ctor = GetDefaultConstructor (safe_critical_type);
-                       return _safe_critical_ctor;
-               }
-
-               MethodDefinition GetCriticalCtor ()
-               {
-                       if (_critical_ctor != null)
-                               return _critical_ctor;
-
-                       TypeDefinition critical_type = Context.GetType (_critical);
-                       if (critical_type == null)
-                               throw new InvalidOperationException (String.Format ("{0} type not found", _critical));
-
-                       _critical_ctor = GetDefaultConstructor (critical_type);
-                       return _critical_ctor;
-               }
-
-               TypeDefinition GetSystemVoid ()
-               {
-                       if (_void_type != null)
-                               return _void_type;
-
-                       _void_type = Context.GetType (_system_void);
-                       if (_void_type == null)
-                               throw new InvalidOperationException (String.Format ("{0} type not found", _system_void));
-
-                       return _void_type;
-               }
-
-               MethodReference Import (MethodDefinition method)
-               {
-                       return _assembly.MainModule.Import (method);
-               }
-
-               CustomAttribute CreateSafeCriticalAttribute ()
-               {
-                       return new CustomAttribute (Import (GetSafeCriticalCtor ()));
-               }
-
-               CustomAttribute CreateCriticalAttribute ()
-               {
-                       return new CustomAttribute (Import (GetCriticalCtor ()));
-               }
-
-               MethodDefinition CreateDefaultConstructor ()
-               {
-                       MethodDefinition method = new MethodDefinition (".ctor", 
-                               MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, 
-                               GetSystemVoid ());
-                       method.Body.Instructions.Add (Instruction.Create (OpCodes.Ret));
-                       return method;
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/MarkNSObjectsBase.cs b/mcs/tools/tuner/Mono.Tuner/MarkNSObjectsBase.cs
deleted file mode 100644 (file)
index 9d65be1..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// MarkNSObjectsBase.cs
-//
-// Authors:
-//     Jb Evain (jbevain@novell.com)
-//     Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// (C) 2009 Novell, Inc.
-// Copyright (C) 2011 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.Collections;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Tuner;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public abstract class MarkNSObjectsBase : BaseSubStep {
-
-               protected abstract string ExportAttribute { get; }
-
-               public override SubStepTargets Targets {
-                       get { return SubStepTargets.Type; }
-               }
-
-               public override void ProcessType (TypeDefinition type)
-               {
-                       if (!IsProductType (type)) {
-                               Annotations.Mark (type);
-                               Annotations.SetPreserve (type, TypePreserve.All);
-                       } else
-                               PreserveProductType (type);
-               }
-
-               void PreserveProductType (TypeDefinition type)
-               {
-                       PreserveIntPtrConstructor (type);
-                       PreserveExportedMethods (type);
-               }
-
-               void PreserveExportedMethods (TypeDefinition type)
-               {
-                       if (!type.HasMethods)
-                               return;
-
-                       foreach (var method in type.GetMethods ()) {
-                               if (!IsExportedMethod (method))
-                                       continue;
-
-                               if (!IsOverridenInUserCode (method))
-                                       continue;
-
-                               PreserveMethod (type, method);
-                       }
-               }
-
-               bool IsOverridenInUserCode (MethodDefinition method)
-               {
-                       if (!method.IsVirtual)
-                               return false;
-
-                       var overrides = Annotations.GetOverrides (method);
-                       if (overrides == null || overrides.Count == 0)
-                               return false;
-
-                       foreach (MethodDefinition @override in overrides)
-                               if (!IsProductMethod (@override))
-                                       return true;
-
-                       return false;
-               }
-
-               bool IsExportedMethod (MethodDefinition method)
-               {
-                       return HasExportAttribute (method);
-               }
-
-               bool HasExportAttribute (ICustomAttributeProvider provider)
-               {
-                       if (!provider.HasCustomAttributes)
-                               return false;
-
-                       foreach (CustomAttribute attribute in provider.CustomAttributes)
-                               if (attribute.AttributeType.FullName == ExportAttribute)
-                                       return true;
-
-                       return false;
-               }
-
-               void PreserveIntPtrConstructor (TypeDefinition type)
-               {
-                       if (!type.HasMethods)
-                               return;
-
-                       foreach (MethodDefinition constructor in type.GetConstructors ()) {
-                               if (!constructor.HasParameters)
-                                       continue;
-
-                               if (constructor.Parameters.Count != 1 || constructor.Parameters [0].ParameterType.FullName != "System.IntPtr")
-                                       continue;
-
-                               PreserveMethod (type, constructor);
-                               break; // only one .ctor can match this
-                       }
-               }
-
-               void PreserveMethod (TypeDefinition type, MethodDefinition method)
-               {
-                       Annotations.AddPreservedMethod (type, method);
-               }
-
-               static bool IsProductMethod (MethodDefinition method)
-               {
-                       return IsProductType (method.DeclaringType);
-               }
-
-               static bool IsProductType (TypeDefinition type)
-               {
-                       return Profile.IsProductAssembly (type.Module.Assembly);
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yApiMarker.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yApiMarker.cs
deleted file mode 100644 (file)
index fcd61af..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// MoonlightA11yApiMarker.cs
-//
-// Author:
-//   Andrés G. Aragoneses (aaragoneses@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-using System.Xml;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class MoonlightA11yApiMarker : MarkStep {
-
-               bool IsA11yAssembly (AssemblyDefinition assembly)
-               {
-                       return assembly.ToString ().Contains ("DummyEntry") || assembly.ToString ().Contains ("MoonAtkBridge");
-               }
-
-               protected override void InitializeAssembly (AssemblyDefinition assembly)
-               {
-                       if (IsA11yAssembly (assembly))
-                               base.InitializeAssembly (assembly);
-               }
-
-               protected override void EnqueueMethod (MethodDefinition method)
-               {
-                       if (IsA11yAssembly (method.DeclaringType.Module.Assembly))
-                               base.EnqueueMethod (method);
-                       else
-                               Annotations.Mark (method);
-               }
-
-               protected override bool IgnoreScope (IMetadataScope scope)
-               {
-                       return false;
-               }
-
-               protected override TypeDefinition MarkType (TypeReference reference)
-               {
-                       if (reference == null)
-                               throw new ArgumentNullException ("reference");
-
-                       reference = GetOriginalType (reference);
-
-                       if (reference is GenericParameter)
-                               return null;
-
-                       TypeDefinition type = reference.Resolve ();
-
-                       if (type == null)
-                               throw new ResolutionException (reference);
-
-                       if (CheckProcessed (type))
-                               return type;
-
-                       Annotations.Mark (type);
-                       return type;
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yAssemblyStep.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yAssemblyStep.cs
deleted file mode 100644 (file)
index 63a82b2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// MoonlightA11yAssemblyStep.cs
-//
-// Author:
-//   Andrés G. Aragoneses (aaragoneses@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-using System.IO;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class MoonlightA11yAssemblyStep : MoonlightAssemblyStep {
-
-               protected override void CustomizePipeline (Pipeline pipeline)
-               {
-                       pipeline.RemoveStep (typeof (LoadI18nAssemblies));
-                       pipeline.RemoveStep (typeof (BlacklistStep));
-                       pipeline.RemoveStep (typeof (MarkStep));
-                       pipeline.RemoveStep (typeof (SweepStep));
-                       pipeline.RemoveStep (typeof (CleanStep));
-                       pipeline.RemoveStep (typeof (RegenerateGuidStep));
-                       pipeline.AddStepBefore (typeof (OutputStep), new MoonlightA11yProcessor ());
-               }
-
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yDescriptorGenerator.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yDescriptorGenerator.cs
deleted file mode 100644 (file)
index 17db23b..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-//
-// MoonlightA11yDescriptorGenerator.cs
-//
-// Author:
-//   Andrés G. Aragoneses (aaragoneses@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-using System.Collections.Generic;
-
-using System.IO;
-using System.Text.RegularExpressions;
-using System.Text;
-
-using System.Xml;
-using System.Xml.XPath;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class MoonlightA11yDescriptorGenerator : BaseStep {
-
-               XmlTextWriter writer = null;
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (assembly.Name.Name == "MoonAtkBridge" || assembly.Name.Name == "System.Windows" ||
-                           assembly.Name.Name.Contains ("Dummy"))
-                               return;
-
-                       if (writer == null) {
-                               if (!Directory.Exists (Context.OutputDirectory))
-                                       Directory.CreateDirectory (Context.OutputDirectory);
-
-                               string file_name = "descriptors.xml";
-                               string file_path = Path.Combine (Context.OutputDirectory, file_name);
-                               if (File.Exists (file_path))
-                                       File.Delete (file_path);
-                               FileStream xml_file = new FileStream (file_path, FileMode.OpenOrCreate);
-                               Console.WriteLine ("Created file {0}", file_name);
-                               Console.Write ("Writing contents...");
-
-                               writer = new XmlTextWriter (xml_file, System.Text.Encoding.UTF8);
-                               writer.Formatting = Formatting.Indented;
-                               writer.WriteStartElement("linker");
-                       }
-
-                       SortedDictionary <TypeDefinition, IList> types = ScanAssembly (assembly);
-                       if (types != null && types.Count > 0) {
-                               writer.WriteStartElement("assembly");
-                               writer.WriteAttributeString ("fullname", assembly.Name.Name);
-
-                               foreach (TypeDefinition type in types.Keys) {
-                                       IList members = types [type];
-                                       if (members != null && members.Count > 0) {
-                                               writer.WriteStartElement("type");
-                                               writer.WriteAttributeString ("fullname", type.FullName);
-
-                                               foreach (IMetadataTokenProvider member in members) {
-                                                       MethodDefinition method = member as MethodDefinition;
-                                                       if (method != null) {
-                                                               writer.WriteStartElement("method");
-                                                               writer.WriteAttributeString ("signature",
-                                                                                            method.ReturnType.FullName + " " +
-                                                                                            method.Name + GetMethodParams (method));
-                                                               writer.WriteEndElement ();
-                                                               continue;
-                                                       }
-
-                                                       FieldDefinition field = member as FieldDefinition;
-                                                       if (field != null) {
-                                                               writer.WriteStartElement("field");
-                                                               writer.WriteAttributeString ("signature", field.DeclaringType.FullName + " " + field.Name);
-                                                               writer.WriteEndElement ();
-                                                       }
-                                               }
-                                               writer.WriteEndElement ();
-                                       }
-                               }
-
-                               writer.WriteEndElement ();
-                               Console.WriteLine ();
-                       }
-
-               }
-
-               protected override void EndProcess ()
-               {
-                       Console.WriteLine ();
-
-                       foreach (FileStream stream in streams)
-                               stream.Close ();
-
-                       if (writer != null) {
-                               writer.WriteEndElement ();
-                               writer.Close ();
-                               writer = null;
-                       }
-               }
-
-               //this is almost the ToString method of MethodDefinition...
-               private string GetMethodParams (MethodDefinition method)
-               {
-                       string @params = "(";
-                       if (method.HasParameters) {
-                               for (int i = 0; i < method.Parameters.Count; i++) {
-                                       if (i > 0)
-                                               @params += ",";
-
-                                       @params += method.Parameters [i].ParameterType.FullName;
-                               }
-                       }
-                       @params += ")";
-                       return @params;
-               }
-
-               SortedDictionary<TypeDefinition, IList> /*,List<IAnnotationProvider>>*/ ScanAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return null;
-
-                       SortedDictionary<TypeDefinition, IList> members_used = new SortedDictionary<TypeDefinition, IList> (new TypeComparer ());
-                       foreach (TypeDefinition type in assembly.MainModule.Types) {
-                               IList used_providers = FilterPublicMembers (ScanType (type));
-                               if (used_providers.Count > 0)
-                                       members_used [type] = used_providers;
-                               else if (IsInternal (type, true) &&
-                                        Annotations.IsMarked (type))
-                                       throw new NotSupportedException (String.Format ("The type {0} is used while its API is not", type.ToString ()));
-                       }
-                       return members_used;
-               }
-
-               IList ScanType (TypeDefinition type)
-               {
-                       return ExtractUsedProviders (type.Methods, type.Fields);
-               }
-
-               static IList FilterPublicMembers (IList members)
-               {
-                       IList new_list = new ArrayList ();
-                       foreach (MemberReference item in members)
-                               if (IsInternal (item, true))
-                                       new_list.Add (item);
-
-                       return new_list;
-               }
-
-               static string [] master_infos = Directory.GetFiles (Environment.CurrentDirectory, "*.info");
-
-               static string FindMasterInfoFile (string name)
-               {
-                       if (master_infos.Length == 0)
-                               throw new Exception ("No masterinfo files found in current directory");
-
-                       foreach (string file in master_infos) {
-                               if (file.EndsWith (name + ".info"))
-                                       return file;
-                       }
-
-                       return null;
-               }
-
-               const string xpath_init = "assemblies/assembly/namespaces/namespace[@name='{0}']/classes/class[@name='{1}']";
-
-               static string GetXPathSearchForType (TypeDefinition type)
-               {
-                       TypeDefinition parent_type = type;
-                       string xpath = String.Empty;
-                       while (parent_type.DeclaringType != null) {
-                               xpath = String.Format ("/classes/class[@name='{0}']", parent_type.Name) + xpath;
-                               parent_type = parent_type.DeclaringType;
-                       }
-                       return String.Format (xpath_init, parent_type.Namespace, parent_type.Name) + xpath;
-               }
-
-               static bool IsInternal (MemberReference member, bool master_info)
-               {
-                       TypeDefinition type = null;
-                       string master_info_file = null;
-
-                       if (member is TypeDefinition) {
-                               type = member as TypeDefinition;
-                               if (!master_info)
-                                       return (!type.IsNested && !type.IsPublic) ||
-                                              (type.IsNested && (!type.IsNestedPublic || IsInternal (type.DeclaringType, false)));
-
-                               master_info_file = FindMasterInfoFile (type.Module.Assembly.Name.Name);
-                               if (master_info_file == null)
-                                       return IsInternal (member, false);
-
-                               return !NodeExists (master_info_file, GetXPathSearchForType (type));
-                       }
-
-                       type = member.DeclaringType.Resolve ();
-
-                       if (IsInternal (type, master_info))
-                               return true;
-
-                       MethodDefinition method = member as MethodDefinition;
-                       FieldDefinition field = member as FieldDefinition;
-
-                       if (field == null && method == null)
-                               throw new System.NotSupportedException ("Members to scan should be methods or fields");
-
-                       if (!master_info) {
-
-                               if (method != null)
-                                       return !method.IsPublic;
-
-                               return !field.IsPublic;
-                       }
-
-                       master_info_file = FindMasterInfoFile (type.Module.Assembly.Name.Name);
-                       if (master_info_file == null)
-                               return IsInternal (member, false);
-
-                       string xpath_type = GetXPathSearchForType (type);
-                       string name;
-                       if (field != null)
-                               name = field.Name;
-                       else {
-                               name = method.ToString ();
-
-                               //lame, I know...
-                               name = WackyOutArgs (WackyCommas (name.Substring (name.IndexOf ("::") + 2)
-                                                   .Replace ("/", "+") // nested classes
-                                                   .Replace ('<', '[').Replace ('>', ']'))); //generic params
-                       }
-
-                       if (field != null || !IsPropertyMethod (method))
-                               return !NodeExists (master_info_file, xpath_type + String.Format ("/*/*[@name='{0}']", name));
-
-                       return !NodeExists (master_info_file, xpath_type + String.Format ("/properties/*/*/*[@name='{0}']", name));
-               }
-
-               //at some point I want to get rid of this method and ask cecil's maintainer to spew commas in a uniform way...
-               static string WackyCommas (string method)
-               {
-                       string outstring = String.Empty;
-                       bool square_bracket = false;
-                       foreach (char c in method) {
-                               if (c == '[')
-                                       square_bracket = true;
-                               else if (c == ']')
-                                       square_bracket = false;
-
-                               outstring = outstring + c;
-
-                               if (c == ',' && !square_bracket)
-                                       outstring = outstring + " ";
-                       }
-                       return outstring;
-               }
-
-               //ToString() spews & but not 'out' keyword
-               static string WackyOutArgs (string method)
-               {
-                       return Regex.Replace (method, @"\w+&", delegate (Match m) { return "out " + m.ToString (); });
-               }
-
-               //copied from MarkStep (violating DRY unless I can put this in a better place... Cecil?)
-               static bool IsPropertyMethod (MethodDefinition md)
-               {
-                       return (md.SemanticsAttributes & MethodSemanticsAttributes.Getter) != 0 ||
-                               (md.SemanticsAttributes & MethodSemanticsAttributes.Setter) != 0;
-               }
-
-               static Dictionary<string, XPathNavigator> navs = new Dictionary<string, XPathNavigator> ();
-               static List<FileStream> streams = new List<FileStream> ();
-
-               static bool NodeExists (string file, string xpath)
-               {
-                       Console.Write (".");
-                       //Console.WriteLine ("Looking for node {0} in file {1}", xpath, file.Substring (file.LastIndexOf ("/") + 1));
-
-                       XPathNavigator nav = null;
-                       if (!navs.TryGetValue (file, out nav)) {
-                               FileStream stream = new FileStream (file, FileMode.Open);
-                               XPathDocument document = new XPathDocument (stream);
-                               nav = document.CreateNavigator ();
-                               streams.Add (stream);
-                               navs [file] = nav;
-                       }
-                       return nav.SelectSingleNode (xpath) != null;
-               }
-
-               IList /*List<IAnnotationProvider>*/ ExtractUsedProviders (params IList[] members)
-               {
-                       IList used = new ArrayList ();
-                       if (members == null || members.Length == 0)
-                               return used;
-
-                       foreach (IList members_list in members)
-                               foreach (IMetadataTokenProvider provider in members_list)
-                                       if (Annotations.IsMarked (provider))
-                                               used.Add (provider);
-
-                       return used;
-               }
-
-               class TypeComparer : IComparer <TypeDefinition> {
-
-                       public int Compare (TypeDefinition x, TypeDefinition y)
-                       {
-                               return string.Compare (x.ToString (), y.ToString ());
-                       }
-
-               }
-
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yProcessor.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yProcessor.cs
deleted file mode 100644 (file)
index 2971b11..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-//
-// MoonlightA11yProcessor.cs
-//
-// Author:
-//   Andrés G. Aragoneses (aaragoneses@novell.com)
-//
-// (C) 2009 Novell, 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.Linq;
-
-using Mono.Cecil;
-
-using Mono.Linker;
-
-namespace Mono.Tuner {
-
-       public class MoonlightA11yProcessor : InjectSecurityAttributes {
-
-               protected override bool ConditionToProcess ()
-               {
-                       return true;
-               }
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       _assembly = assembly;
-
-                       // remove existing [SecurityCritical] and [SecuritySafeCritical]
-                       RemoveSecurityAttributes ();
-
-                       // add [SecurityCritical]
-                       AddSecurityAttributes ();
-
-                       // convert all public members into internal
-                       MakeApiInternal ();
-               }
-
-               void MakeApiInternal ()
-               {
-                       foreach (TypeDefinition type in _assembly.MainModule.Types) {
-                               if (type.IsPublic)
-                                       type.IsPublic = false;
-
-                               if (type.HasMethods && !type.Name.EndsWith ("Adapter"))
-                                       foreach (MethodDefinition ctor in type.Methods.Where (m => m.IsConstructor))
-                                               if (ctor.IsPublic)
-                                                       ctor.IsAssembly = true;
-
-                               if (type.HasMethods)
-                                       foreach (MethodDefinition method in type.Methods.Where (m => !m.IsConstructor))
-                                               if (method.IsPublic)
-                                                       method.IsAssembly = true;
-                       }
-               }
-
-               void AddSecurityAttributes ()
-               {
-                       foreach (TypeDefinition type in _assembly.MainModule.Types) {
-                               AddCriticalAttribute (type);
-
-                               if (type.HasMethods)
-                                       foreach (MethodDefinition ctor in type.Methods.Where (m => m.IsConstructor))
-                                               AddCriticalAttribute (ctor);
-
-                               if (type.HasMethods)
-                                       foreach (MethodDefinition method in type.Methods.Where (m => !m.IsConstructor)) {
-                                               MethodDefinition parent = null;
-
-                                               //TODO: take in account generic params
-                                               if (!method.HasGenericParameters) {
-
-                                                       /*
-                                                        * we need to scan base methods because the CoreCLR complains about SC attribs added
-                                                        * to overriden methods whose base (virtual or interface) method is not marked as SC
-                                                        * with TypeLoadExceptions
-                                                        */
-                                                       parent = GetBaseMethod (type, method);
-                                               }
-
-                                               //if there's no base method
-                                               if (parent == null ||
-
-                                               //if it's our bridge assembly, we're sure it will (finally, at the end of the linking process) have the SC attrib
-                                                   _assembly.MainModule.Types.Contains (parent.DeclaringType) ||
-
-                                               //if the type is in the moonlight assemblies, check if it has the SC attrib
-                                                   HasSecurityAttribute (parent, AttributeType.Critical))
-
-                                                       AddCriticalAttribute (method);
-                               }
-
-                       }
-               }
-
-               MethodDefinition GetBaseMethod (TypeDefinition finalType, MethodDefinition final)
-               {
-                       // both GetOverridenMethod and GetInterfaceMethod return null if there is no base method
-                       return GetOverridenMethod (finalType, final) ?? GetInterfaceMethod (finalType, final);
-               }
-
-               //note: will not return abstract methods
-               MethodDefinition GetOverridenMethod (TypeDefinition finalType, MethodDefinition final)
-               {
-                       TypeReference baseType = finalType.BaseType;
-                       while (baseType != null && baseType.Resolve () != null) {
-                               foreach (MethodDefinition method in baseType.Resolve ().Methods) {
-                                       if (!method.IsVirtual || method.Name != final.Name)
-                                               continue;
-
-                                       //TODO: should we discard them?
-                                       if (method.IsAbstract)
-                                               continue;
-
-                                       if (HasSameSignature (method, final))
-                                               return method;
-                               }
-                               baseType = baseType.Resolve().BaseType;
-                       }
-                       return null;
-               }
-
-               MethodDefinition GetInterfaceMethod (TypeDefinition finalType, MethodDefinition final)
-               {
-                       TypeDefinition baseType = finalType;
-                       while (baseType != null) {
-                               if (baseType.HasInterfaces)
-                                       foreach (var @interface in baseType.Interfaces)
-                                               foreach (MethodDefinition method in @interface.InterfaceType.Resolve ().Methods)
-                                                       if (method.Name == final.Name && HasSameSignature (method, final))
-                                                               return method;
-
-                               baseType = baseType.BaseType == null ? null : baseType.BaseType.Resolve ();
-                       }
-                       return null;
-               }
-
-               bool HasSameSignature (MethodDefinition method1, MethodDefinition method2)
-               {
-                       if (method1.ReturnType.FullName != method2.ReturnType.FullName)
-                               return false;
-
-                       if (method1.Parameters.Count != method2.Parameters.Count)
-                               return false;
-
-                       for (int i = 0; i < method1.Parameters.Count; i++) {
-                               if (method1.Parameters [i].ParameterType.FullName !=
-                                   method2.Parameters [i].ParameterType.FullName)
-                                       return false;
-                       }
-
-                       return true;
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yUsageInspectionStep.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yUsageInspectionStep.cs
deleted file mode 100644 (file)
index 27aa4a2..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// MoonlightA11yUsageInspectionStep.cs
-//
-// Author:
-//   Andrés G. Aragoneses (aaragoneses@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-using System.IO;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class MoonlightA11yUsageInspectionStep : MoonlightAssemblyStep {
-
-               protected override void CustomizePipeline (Pipeline pipeline)
-               {
-                       pipeline.ReplaceStep (typeof (MarkStep), new MoonlightA11yApiMarker ());
-                       pipeline.ReplaceStep (typeof (SweepStep), new MoonlightA11yDescriptorGenerator ());
-                       pipeline.RemoveStep (typeof (LoadI18nAssemblies));
-                       pipeline.RemoveStep (typeof (CleanStep));
-                       pipeline.RemoveStep (typeof (RegenerateGuidStep));
-                       pipeline.RemoveStep (typeof (OutputStep));
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightAssemblyStep.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightAssemblyStep.cs
deleted file mode 100644 (file)
index fc98536..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// MoonlightAssemblyStep.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-using System.IO;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class MoonlightAssemblyStep : IStep {
-
-               public void Process (LinkContext context)
-               {
-                       CustomizePipeline (context.Pipeline);
-                       ProcessAssemblies (context);
-               }
-
-               static void ProcessAssemblies (LinkContext context)
-               {
-                       foreach (AssemblyDefinition assembly in context.GetAssemblies ())
-                               context.Annotations.SetAction (assembly, AssemblyAction.Link);
-               }
-
-               protected virtual void CustomizePipeline (Pipeline pipeline)
-               {
-                       pipeline.RemoveStep (typeof (LoadI18nAssemblies));
-                       pipeline.RemoveStep (typeof (BlacklistStep));
-                       pipeline.RemoveStep (typeof (TypeMapStep));
-                       pipeline.RemoveStep (typeof (MarkStep));
-                       pipeline.RemoveStep (typeof (SweepStep));
-                       pipeline.RemoveStep (typeof (CleanStep));
-                       pipeline.RemoveStep (typeof (RegenerateGuidStep));
-                       pipeline.AddStepBefore (typeof (OutputStep), new InjectSecurityAttributes ());
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/PreserveCrypto.cs b/mcs/tools/tuner/Mono.Tuner/PreserveCrypto.cs
deleted file mode 100644 (file)
index 18dbe7f..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace Mono.Tuner {
-
-       public class PreserveCrypto : IStep {
-
-               AnnotationStore annotations;
-
-               public void Process (LinkContext context)
-               {
-                       annotations = context.Annotations;
-
-                       ProcessCorlib (context);
-                       ProcessSystemCore (context);
-               }
-
-               void ProcessCorlib (LinkContext context)
-               {
-                       AssemblyDefinition corlib;
-                       if (!context.TryGetLinkedAssembly ("mscorlib", out corlib))
-                               return;
-
-                       AddPreserveInfo (corlib, "DES", "DESCryptoServiceProvider");
-                       AddPreserveInfo (corlib, "DSA", "DSACryptoServiceProvider");
-                       AddPreserveInfo (corlib, "RandomNumberGenerator", "RNGCryptoServiceProvider");
-                       AddPreserveInfo (corlib, "SHA1", "SHA1CryptoServiceProvider");
-                       AddPreserveInfo (corlib, "SHA1", "SHA1Managed");
-                       AddPreserveInfo (corlib, "MD5", "MD5CryptoServiceProvider");
-                       AddPreserveInfo (corlib, "RC2", "RC2CryptoServiceProvider");
-                       AddPreserveInfo (corlib, "TripleDES", "TripleDESCryptoServiceProvider");
-
-                       AddPreserveInfo (corlib, "Rijndael", "RijndaelManaged");
-                       AddPreserveInfo (corlib, "RIPEMD160", "RIPEMD160Managed");
-                       AddPreserveInfo (corlib, "SHA256", "SHA256Managed");
-                       AddPreserveInfo (corlib, "SHA384", "SHA384Managed");
-                       AddPreserveInfo (corlib, "SHA512", "SHA512Managed");
-
-                       AddPreserveInfo (corlib, "HMAC", "HMACMD5");
-                       AddPreserveInfo (corlib, "HMAC", "HMACRIPEMD160");
-                       AddPreserveInfo (corlib, "HMAC", "HMACSHA1");
-                       AddPreserveInfo (corlib, "HMAC", "HMACSHA256");
-                       AddPreserveInfo (corlib, "HMAC", "HMACSHA384");
-                       AddPreserveInfo (corlib, "HMAC", "HMACSHA512");
-
-                       AddPreserveInfo (corlib, "HMACMD5", "MD5CryptoServiceProvider");
-                       AddPreserveInfo (corlib, "HMACRIPEMD160", "RIPEMD160Managed");
-                       AddPreserveInfo (corlib, "HMACSHA1", "SHA1CryptoServiceProvider");
-                       AddPreserveInfo (corlib, "HMACSHA1", "SHA1Managed");
-                       AddPreserveInfo (corlib, "HMACSHA256", "SHA256Managed");
-                       AddPreserveInfo (corlib, "HMACSHA384", "SHA384Managed");
-                       AddPreserveInfo (corlib, "HMACSHA512", "SHA512Managed");
-
-                       TryAddPreserveInfo (corlib, "Aes", "AesManaged");
-
-                       var corlibAes = GetCryptoType (corlib, "Aes");
-                       Preserve (corlibAes, GetCryptoType (corlib, "AesManaged"));
-
-                       AssemblyDefinition syscore;
-                       if (context.TryGetLinkedAssembly ("System.Core", out syscore))
-                               Preserve (corlibAes, GetCryptoType (syscore, "AesCryptoServiceProvider"));
-               }
-
-               void ProcessSystemCore (LinkContext context)
-               {
-                       AssemblyDefinition syscore;
-                       if (!context.TryGetLinkedAssembly ("System.Core", out syscore))
-                               return;
-
-                       // AddPreserveInfo (syscore, "Aes", "AesCryptoServiceProvider");
-                       TryAddPreserveInfo (syscore, "Aes", "AesManaged");
-               }
-
-               bool TryAddPreserveInfo (AssemblyDefinition assembly, string name, string type)
-               {
-                       var marker = GetCryptoType (assembly, name);
-                       if (marker == null)
-                               return false;
-
-                       var implementation = GetCryptoType (assembly, type);
-                       if (implementation == null)
-                               return false;
-
-                       Preserve (marker, implementation);
-                       return true;
-               }
-
-               void AddPreserveInfo (AssemblyDefinition assembly, string name, string type)
-               {
-                       var marker = GetCryptoType (assembly, name);
-                       if (marker == null)
-                               throw new ArgumentException (name);
-
-                       var implementation = GetCryptoType (assembly, type);
-                       if (implementation == null)
-                               throw new ArgumentException (type);
-
-                       Preserve (marker, implementation);
-               }
-
-               void Preserve (TypeDefinition marker, TypeDefinition implementation)
-               {
-                       if (marker == null || implementation == null)
-                               return;
-                       foreach (var constructor in implementation.GetConstructors ())
-                               annotations.AddPreservedMethod (marker, constructor);
-               }
-
-               TypeDefinition GetCryptoType (AssemblyDefinition assembly, string name)
-               {
-                       return assembly.MainModule.GetType ("System.Security.Cryptography." + name);
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/PreserveHttps.cs b/mcs/tools/tuner/Mono.Tuner/PreserveHttps.cs
deleted file mode 100644 (file)
index c3c56c7..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-using System;
-using System.IO;
-using System.Xml.XPath;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class PreserveHttps : BaseStep {
-
-               static string [] types = new [] {
-                       "System.Net.WebRequest",
-                       "System.Net.WebClient",
-                       "System.Net.Security.RemoteCertificateValidationCallback",
-                       "System.Web.Services.Protocols.WebClientProtocol",
-                       "System.Security.Cryptography.X509Certificates.X509Certificate",
-                       "System.ServiceModel.ClientBase`1",
-                       "System.Web.Services.WebServiceBindingAttribute",
-                       "System.Web.Services.Protocols.SoapHttpClientProtocol",
-                       "System.Xml.XmlDocument"
-               };
-
-               bool need_https;
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (need_https)
-                               return;
-
-                       if (Profile.IsSdkAssembly (assembly) || Profile.IsProductAssembly (assembly))
-                               return;
-
-                       if (HasNeededReference (assembly.MainModule))
-                               need_https = true;
-               }
-
-               static bool HasNeededReference (ModuleDefinition module)
-               {
-                       foreach (var type in types)
-                               if (module.HasTypeReference (type))
-                                       return true;
-
-                       return false;
-               }
-
-               protected override void EndProcess ()
-               {
-                       if (!need_https)
-                               return;
-
-                       var mono_security = Context.Resolve ("Mono.Security");
-                       if (mono_security == null)
-                               return;
-
-                       if (Annotations.GetAction (mono_security) != AssemblyAction.Link)
-                               return;
-
-                       var xml_preserve = CreatePreserveStep ();
-                       Context.Pipeline.AddStepAfter (typeof (PreserveHttps), xml_preserve);
-//                     Context.Pipeline.AddStepAfter (xml_preserve, new PreserveCrypto ());
-               }
-
-               static IStep CreatePreserveStep ()
-               {
-                       return new ResolveFromXmlStep (
-                               new XPathDocument (
-                                       new StringReader (descriptor)));
-               }
-
-               const string descriptor = @"<?xml version=""1.0"" encoding=""utf-8"" ?>
-<linker>
-       <assembly fullname=""Mono.Security"">
-               <type fullname=""Mono.Security.Protocol.Tls.HttpsClientStream"" />
-               <type fullname=""Mono.Security.Protocol.Tls.SslClientStream"" />
-               <type fullname=""Mono.Security.Protocol.Tls.SslStreamBase"" />
-       </assembly>
-</linker>
-";
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/PreserveSoapHttpClients.cs b/mcs/tools/tuner/Mono.Tuner/PreserveSoapHttpClients.cs
deleted file mode 100644 (file)
index bdb04a9..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-using System;
-
-using Mono.Linker;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class PreserveSoapHttpClients : BaseSubStep {
-
-               public override SubStepTargets Targets {
-                       get { return SubStepTargets.Type; }
-               }
-
-               public override bool IsActiveFor (AssemblyDefinition assembly)
-               {
-                       return Annotations.GetAction (assembly) == AssemblyAction.Link && !Profile.IsSdkAssembly (assembly);
-               }
-
-               public override void ProcessType (TypeDefinition type)
-               {
-                       if (IsWebServiceClient (type))
-                               PreserveClient (type);
-               }
-
-               void PreserveClient (TypeDefinition type)
-               {
-                       if (!type.HasMethods)
-                               return;
-
-                       foreach (MethodDefinition method in type.Methods) {
-                               string sync_method;
-                               if (!TryExtractSyncMethod (method, out sync_method))
-                                       continue;
-
-                               AddPreservedMethod (method, sync_method);
-                       }
-               }
-
-               void AddPreservedMethod (MethodDefinition target, string methodName)
-               {
-                       foreach (MethodDefinition method in target.DeclaringType.Methods)
-                               if (method.Name == methodName)
-                                       Annotations.AddPreservedMethod (target, method);
-               }
-
-               static bool TryExtractSyncMethod (MethodDefinition method, out string sync_method)
-               {
-                       if (TryExtractPrefixedMethodName ("Begin", method.Name, out sync_method))
-                               return true;
-
-                       if (TryExtractPrefixedMethodName ("End", method.Name, out sync_method))
-                               return true;
-
-                       if (TryExtractSuffixedMethodName ("Async", method.Name, out sync_method))
-                               return true;
-
-                       return false;
-               }
-
-               static bool TryExtractPrefixedMethodName (string prefix, string fullName, out string methodName)
-               {
-                       methodName = null;
-
-                       int pos = fullName.IndexOf (prefix, StringComparison.Ordinal);
-                       if (pos == -1)
-                               return false;
-
-                       methodName = fullName.Substring (prefix.Length);
-                       return true;
-               }
-
-               static bool TryExtractSuffixedMethodName (string suffix, string fullName, out string methodName)
-               {
-                       methodName = null;
-
-                       int pos = fullName.LastIndexOf (suffix, StringComparison.Ordinal);
-                       if (pos == -1)
-                               return false;
-
-                       methodName = fullName.Substring (0, pos);
-                       return true;
-               }
-
-               static bool IsWebServiceClient (TypeDefinition type)
-               {
-                       return type.Inherits ("System.Web.Services.Protocols", "SoapHttpClientProtocol");
-               }
-       }
-}
\ No newline at end of file
diff --git a/mcs/tools/tuner/Mono.Tuner/PrintStatus.cs b/mcs/tools/tuner/Mono.Tuner/PrintStatus.cs
deleted file mode 100644 (file)
index 374395b..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// PrintStatus.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Collections;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class PrintStatus : BaseStep {
-
-               static string display_internalized = "display_internalized";
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       Console.WriteLine ("Assembly `{0}' ({1}) tuned", assembly.Name, assembly.MainModule.FullyQualifiedName);
-
-                       if (!DisplayInternalized ())
-                               return;
-
-                       foreach (TypeDefinition type in assembly.MainModule.Types)
-                               ProcessType (type);
-               }
-
-               bool DisplayInternalized ()
-               {
-                       try {
-                               return bool.Parse (Context.GetParameter (display_internalized));
-                       } catch {
-                               return false;
-                       }
-               }
-
-               void ProcessType (TypeDefinition type)
-               {
-                       ProcessCollection (type.Fields);
-                       ProcessCollection (type.Methods);
-               }
-
-               void ProcessCollection (ICollection collection)
-               {
-                       foreach (IMetadataTokenProvider provider in collection)
-                               ProcessProvider (provider);
-               }
-
-               void ProcessProvider (IMetadataTokenProvider provider)
-               {
-                       if (!TunerAnnotations.IsInternalized (Context, provider))
-                               return;
-
-                       Console.WriteLine ("[internalized] {0}", provider);
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/PrintTypeMap.cs b/mcs/tools/tuner/Mono.Tuner/PrintTypeMap.cs
deleted file mode 100644 (file)
index 8838b1a..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// PrintTypeMap.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2009 Novell, 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.Collections;
-using System.Collections.Generic;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class PrintTypeMap : BaseStep {
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       foreach (TypeDefinition type in assembly.MainModule.GetAllTypes ())
-                               PrintMap (type);
-               }
-
-               void PrintMap (TypeDefinition type)
-               {
-                       if (!type.HasMethods)
-                               return;
-
-                       Console.WriteLine ("Type {0} map", type);
-
-                       foreach (MethodDefinition method in type.Methods) {
-                               if (!method.IsVirtual)
-                                       continue;
-
-                               Console.WriteLine ("  Method {0} map", method);
-
-                               IEnumerable<MethodDefinition> overrides = Annotations.GetOverrides (method);
-                               foreach (var @override in overrides ?? new MethodDefinition [0])
-                                       Console.WriteLine ("    HasOverride {0}", @override);
-
-                               IEnumerable<MethodDefinition> bases = Annotations.GetBaseMethods (method);
-                               foreach (var @base in bases ?? new MethodDefinition [0])
-                                       Console.WriteLine ("    Base {0}", @base);
-                       }
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/Profile.cs b/mcs/tools/tuner/Mono.Tuner/Profile.cs
deleted file mode 100644 (file)
index 54cfffa..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public abstract class Profile {
-
-               static Profile current;
-
-               public static Profile Current {
-                       get {
-                               if (current != null)
-                                       return current;
-
-                               current = CreateProfile ("MonoTouch");
-                               if (current != null)
-                                       return current;
-
-                               current = CreateProfile ("MonoDroid");
-                               if (current != null)
-                                       return current;
-
-                               current = CreateProfile ("MonoMac");
-                               if (current != null)
-                                       return current;
-
-                               throw new NotSupportedException ("No active profile");
-                       }
-                       set {
-                               current = value;
-                       }
-               }
-
-               static Profile CreateProfile (string name)
-               {
-                       var type = Type.GetType (string.Format ("{0}.Tuner.{0}Profile", name));
-                       if (type == null)
-                               return null;
-
-                       return (Profile) Activator.CreateInstance (type);
-               }
-
-               public static bool IsSdkAssembly (AssemblyDefinition assembly)
-               {
-                       return Current.IsSdk (assembly);
-               }
-
-               public static bool IsSdkAssembly (string assemblyName)
-               {
-                       return Current.IsSdk (assemblyName);
-               }
-
-               public static bool IsProductAssembly (AssemblyDefinition assembly)
-               {
-                       return Current.IsProduct (assembly);
-               }
-
-               public static bool IsProductAssembly (string assemblyName)
-               {
-                       return Current.IsProduct (assemblyName);
-               }
-
-               protected virtual bool IsSdk (AssemblyDefinition assembly)
-               {
-                       return IsSdk (assembly.Name.Name);
-               }
-               
-               protected virtual bool IsProduct (AssemblyDefinition assembly)
-               {
-                       return IsProduct (assembly.Name.Name);
-               }
-
-               protected abstract bool IsSdk (string assemblyName);
-               protected abstract bool IsProduct (string assemblyName);
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/RemoveAttributesBase.cs b/mcs/tools/tuner/Mono.Tuner/RemoveAttributesBase.cs
deleted file mode 100644 (file)
index 6110180..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Tuner;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public abstract class RemoveAttributesBase : BaseSubStep {
-
-               public override SubStepTargets Targets {
-                       get {
-                               return SubStepTargets.Assembly
-                                       | SubStepTargets.Type
-                                       | SubStepTargets.Field
-                                       | SubStepTargets.Method
-                                       | SubStepTargets.Property
-                                       | SubStepTargets.Event;
-                       }
-               }
-
-               public override bool IsActiveFor (AssemblyDefinition assembly)
-               {
-                       return Annotations.GetAction (assembly) == AssemblyAction.Link;
-               }
-
-               public override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       ProcessAttributeProvider (assembly);
-                       ProcessAttributeProvider (assembly.MainModule);
-               }
-
-               public override void ProcessType (TypeDefinition type)
-               {
-                       ProcessAttributeProvider (type);
-
-                       if (type.HasGenericParameters)
-                               ProcessAttributeProviderCollection (type.GenericParameters);
-               }
-
-               void ProcessAttributeProviderCollection (IList list)
-               {
-                       for (int i = 0; i < list.Count; i++)
-                               ProcessAttributeProvider ((ICustomAttributeProvider) list [i]);
-               }
-
-               public override void ProcessField (FieldDefinition field)
-               {
-                       ProcessAttributeProvider (field);
-               }
-
-               public override void ProcessMethod (MethodDefinition method)
-               {
-                       ProcessMethodAttributeProvider (method);
-               }
-
-               void ProcessMethodAttributeProvider (MethodDefinition method)
-               {
-                       ProcessAttributeProvider (method);
-                       ProcessAttributeProvider (method.MethodReturnType);
-
-                       if (method.HasParameters)
-                               ProcessAttributeProviderCollection (method.Parameters);
-
-                       if (method.HasGenericParameters)
-                               ProcessAttributeProviderCollection (method.GenericParameters);
-               }
-
-               public override void ProcessProperty (PropertyDefinition property)
-               {
-                       ProcessAttributeProvider (property);
-               }
-
-               public override void ProcessEvent (EventDefinition @event)
-               {
-                       ProcessAttributeProvider (@event);
-               }
-
-               void ProcessAttributeProvider (ICustomAttributeProvider provider)
-               {
-                       if (!provider.HasCustomAttributes)
-                               return;
-
-                       for (int i = 0; i < provider.CustomAttributes.Count; i++) {
-                               var attrib = provider.CustomAttributes [i];
-                               if (!IsRemovedAttribute (attrib))
-                                       continue;
-
-                               WillRemoveAttribute (provider, attrib);
-                               provider.CustomAttributes.RemoveAt (i--);
-                       }
-               }
-
-               protected abstract bool IsRemovedAttribute (CustomAttribute attribute);
-               protected virtual void WillRemoveAttribute (ICustomAttributeProvider provider, CustomAttribute attribute) { }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/RemoveResources.cs b/mcs/tools/tuner/Mono.Tuner/RemoveResources.cs
deleted file mode 100644 (file)
index 7edc44f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-using System;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class RemoveResources : IStep {
-
-               readonly I18nAssemblies assemblies;
-
-               public RemoveResources (I18nAssemblies assemblies)
-               {
-                       this.assemblies = assemblies;
-               }
-
-               public virtual void Process (LinkContext context)
-               {
-                       AssemblyDefinition assembly;
-                       if (!context.TryGetLinkedAssembly ("mscorlib", out assembly))
-                               return;
-
-                       // skip this if we're not linking mscorlib, e.g. --linkskip=mscorlib
-                       if (context.Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       var resources = assembly.MainModule.Resources;
-
-                       for (int i = 0; i < resources.Count; i++) {
-                               var resource = resources [i] as EmbeddedResource;
-                               if (resource == null)
-                                       continue;
-
-                               switch (resource.Name) {
-                               case "collation.core.bin":
-                               case "collation.tailoring.bin":
-                                       continue;
-                               default:
-                                       if (!resource.Name.Contains ("cjk"))
-                                               continue;
-                                       if (IncludeCJK ())
-                                               continue;
-
-                                       resources.RemoveAt (i--);
-                                       break;
-                               }
-                       }
-               }
-
-               bool IncludeCJK ()
-               {
-                       return (assemblies & I18nAssemblies.CJK) != 0;
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/RemoveSecurity.cs b/mcs/tools/tuner/Mono.Tuner/RemoveSecurity.cs
deleted file mode 100644 (file)
index 2704564..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class RemoveSecurity : BaseSubStep {
-
-               public override SubStepTargets Targets {
-                       get {
-                               return SubStepTargets.Assembly
-                                       | SubStepTargets.Type
-                                       | SubStepTargets.Method;
-                       }
-               }
-
-               public override bool IsActiveFor (AssemblyDefinition assembly)
-               {
-                       return Annotations.GetAction (assembly) == AssemblyAction.Link;
-               }
-
-               public override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       ProcessSecurityProvider (assembly);
-               }
-
-               public override void ProcessType (TypeDefinition type)
-               {
-                       ProcessSecurityProvider (type);
-               }
-
-               public override void ProcessMethod (MethodDefinition method)
-               {
-                       ProcessSecurityProvider (method);
-               }
-
-               static void ProcessSecurityProvider (ISecurityDeclarationProvider provider)
-               {
-                       if (!provider.HasSecurityDeclarations)
-                               return;
-
-                       provider.SecurityDeclarations.Clear ();
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/RemoveSerialization.cs b/mcs/tools/tuner/Mono.Tuner/RemoveSerialization.cs
deleted file mode 100644 (file)
index d38aef1..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// RemoveSerialization.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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.Collections;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-
-namespace Mono.Tuner {
-
-       public class RemoveSerialization : BaseStep {
-
-               static readonly string _Serialization = "System.Runtime.Serialization";
-               static readonly string _ISerializable = Concat (_Serialization, "ISerializable");
-               static readonly string _IDeserializationCallback = Concat (_Serialization, "IDeserializationCallback");
-               static readonly string _SerializationInfo = Concat (_Serialization, "SerializationInfo");
-               static readonly string _StreamingContext = Concat (_Serialization, "StreamingContext");
-
-               static readonly string _GetObjectData = "GetObjectData";
-               static readonly string _OnDeserialization = "OnDeserialization";
-
-               static string Concat (string lhs, string rhs)
-               {
-                       return string.Concat (lhs, ".", rhs);
-               }
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (assembly.Name.Name == "mscorlib")
-                               return;
-
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       foreach (ModuleDefinition module in assembly.Modules)
-                               foreach (TypeDefinition type in module.Types)
-                                       ProcessType (type);
-               }
-
-               static void RemoveInterface (TypeDefinition type, string name)
-               {
-                       for (int i = 0; i < type.Interfaces.Count; i++) {
-                               TypeReference iface = type.Interfaces [i].InterfaceType;
-                               if (iface.FullName == name) {
-                                       type.Interfaces.RemoveAt (i);
-                                       return;
-                               }
-                       }
-               }
-
-               static void RemoveSerializableFlag (TypeDefinition type)
-               {
-                       type.Attributes &= ~TypeAttributes.Serializable;
-               }
-
-               static void ProcessType (TypeDefinition type)
-               {
-                       RemoveSerializableFlag (type);
-
-                       RemoveInterface (type, _ISerializable);
-                       RemoveMethod (type, ".ctor", _SerializationInfo, _StreamingContext);
-                       RemoveInterfaceMethod (type, _ISerializable, _GetObjectData, _SerializationInfo, _StreamingContext);
-
-                       RemoveInterface (type, _IDeserializationCallback);
-                       RemoveInterfaceMethod (type, _IDeserializationCallback, _OnDeserialization, "System.Object");
-
-                       RemoveField (type);
-               }
-
-               static void RemoveField (TypeDefinition type)
-               {
-                       for (int i = 0; i < type.Fields.Count; i++) {
-                               FieldDefinition field = type.Fields [i];
-                               if (field.FieldType.FullName == _SerializationInfo) {
-                                       type.Fields.RemoveAt (i);
-                                       break;
-                               }
-                       }
-               }
-
-               static bool ParametersMatch (IMethodSignature meth, string [] parameters)
-               {
-                       for (int i = 0; i < parameters.Length; i++) {
-                               ParameterDefinition param = meth.Parameters [i];
-                               if (param.ParameterType.FullName != parameters [i])
-                                       return false;
-                       }
-
-                       return true;
-               }
-
-               static void RemoveInterfaceMethod (TypeDefinition type, string iface, string method, params string [] parameters)
-               {
-                       RemoveMethod (type, method, parameters);
-                       RemoveMethod (type, Concat (iface, method), parameters);
-               }
-
-               static void RemoveMethod (TypeDefinition type, string name, params string [] parameters)
-               {
-                       RemoveMethod (type.Methods, name, parameters);
-               }
-
-               static void RemoveMethod (IList container, string name, params string [] parameters)
-               {
-                       for (int i = 0; i < container.Count; i++) {
-                               MethodDefinition method = (MethodDefinition) container [i];
-                               if (method.Name != name)
-                                       continue;
-
-                               if (method.Parameters.Count != parameters.Length)
-                                       continue;
-
-                               if (!ParametersMatch (method, parameters))
-                                       continue;
-
-                               container.RemoveAt (i);
-                               return;
-                       }
-               }
-       }
-}
diff --git a/mcs/tools/tuner/Mono.Tuner/TunerAnnotations.cs b/mcs/tools/tuner/Mono.Tuner/TunerAnnotations.cs
deleted file mode 100644 (file)
index 2107ac4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// TunerAnnotations.cs
-//
-// Author:
-//   Jb Evain (jbevain@novell.com)
-//
-// (C) 2007 Novell, 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 Mono.Cecil;
-using Mono.Linker;
-
-namespace Mono.Tuner {
-
-       public class TunerAnnotations {
-
-               static readonly object _internalizedKey = new object ();
-
-               public static void Internalized (LinkContext context, IMetadataTokenProvider provider)
-               {
-                       var annotations = context.Annotations.GetCustomAnnotations (_internalizedKey);
-                       annotations [provider] = _internalizedKey;
-               }
-
-               public static bool IsInternalized (LinkContext context, IMetadataTokenProvider provider)
-               {
-                       var annotations = context.Annotations.GetCustomAnnotations (_internalizedKey);
-
-                       return annotations.ContainsKey (provider);
-               }
-
-               private TunerAnnotations ()
-               {
-               }
-       }
-}
diff --git a/mcs/tools/tuner/MonoMac.Tuner/ApplyPreserveAttribute.cs b/mcs/tools/tuner/MonoMac.Tuner/ApplyPreserveAttribute.cs
deleted file mode 100644 (file)
index d7c49b8..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Tuner;
-
-using Mono.Cecil;
-
-namespace MonoMac.Tuner {
-
-       public class ApplyPreserveAttribute : ApplyPreserveAttributeBase {
-
-               protected override string PreserveAttribute {
-                       get { return "MonoMac.Foundation.PreserveAttribute"; }
-               }
-       }
-}
diff --git a/mcs/tools/tuner/MonoMac.Tuner/Extensions.cs b/mcs/tools/tuner/MonoMac.Tuner/Extensions.cs
deleted file mode 100644 (file)
index ec7fd1f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Mono.Cecil;
-
-using Mono.Linker;
-
-using Mono.Tuner;
-
-namespace MonoMac.Tuner {
-
-       static class Extensions {
-
-               const string NSObject = "MonoMac.Foundation.NSObject";
-               const string INativeObject = "MonoMac.ObjCRuntime.INativeObject";
-
-               public static bool IsNSObject (this TypeDefinition type)
-               {
-                       return type.Inherits (NSObject);
-               }
-
-               public static bool IsNativeObject (this TypeDefinition type)
-               {
-                       return type.Implements (INativeObject);
-               }
-       }
-}
diff --git a/mcs/tools/tuner/MonoMac.Tuner/MarkNSObjects.cs b/mcs/tools/tuner/MonoMac.Tuner/MarkNSObjects.cs
deleted file mode 100644 (file)
index 163decc..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// MarkNSObjects.cs
-//
-// Authors:
-//     Jb Evain (jbevain@novell.com)
-//     Sebastien Pouliot  <sebastien@xamarin.com>
-//
-// (C) 2009 Novell, Inc.
-// Copyright (C) 2011 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 Mono.Tuner;
-
-using Mono.Cecil;
-
-namespace MonoMac.Tuner {
-
-       public class MarkNSObjects : MarkNSObjectsBase {
-
-               protected override string ExportAttribute {
-                       get { return "MonoMac.Foundation.ExportAttribute"; }
-               }
-
-               public override void ProcessType (TypeDefinition type)
-               {
-                       if (!type.IsNSObject () || !type.IsNativeObject ())
-                               return;
-
-                       base.ProcessType (type);
-               }
-       }
-}
diff --git a/mcs/tools/tuner/MonoMac.Tuner/MethodMapInjection.cs b/mcs/tools/tuner/MonoMac.Tuner/MethodMapInjection.cs
deleted file mode 100644 (file)
index ebb2407..0000000
+++ /dev/null
@@ -1,382 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Tuner;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-namespace MonoMac.Tuner {
-
-       public class MethodMapInjection : BaseStep {
-
-               struct ExportedMethod {
-                       public readonly CustomAttribute attribute;
-                       public readonly MethodDefinition method;
-
-                       public ExportedMethod (CustomAttribute attribute, MethodDefinition method)
-                       {
-                               this.attribute = attribute;
-                               this.method = method;
-                       }
-               }
-
-               ModuleDefinition module;
-
-               bool imported;
-               TypeReference void_type;
-               TypeReference dictionary_intptr_methoddesc;
-               MethodReference dictionary_intptr_methoddesc_ctor;
-               MethodReference dictionary_intptr_methoddesc_set_item;
-               MethodReference methoddesc_ctor;
-               MethodReference selector_get_handle;
-               MethodReference methodbase_get_method_from_handle;
-               MethodReference class_register_methods;
-               MethodReference type_get_type_from_handle;
-               FieldReference selector_init;
-
-               protected override void ProcessAssembly (AssemblyDefinition assembly)
-               {
-                       if (Annotations.GetAction (assembly) != AssemblyAction.Link)
-                               return;
-
-                       module = assembly.MainModule;
-
-                       foreach (TypeDefinition type in module.GetAllTypes ()) {
-                               if (!type.IsNSObject ())
-                                       continue;
-
-                               ProcessNSObject (type);
-                       }
-
-                       imported = false;
-               }
-
-               void PrepareImports ()
-               {
-                       if (imported)
-                               return;
-
-                       var corlib = Context.GetAssembly ("mscorlib");
-
-                       void_type = Import (corlib, "System.Void");
-
-                       var monomac = Context.GetAssembly ("MonoMac");
-
-                       var dictionary = Import (corlib, "System.Collections.Generic.Dictionary`2");
-
-                       var intptr = Import (corlib, "System.IntPtr");
-                       var method_desc = Import (monomac, "MonoMac.ObjCRuntime.MethodDescription");
-
-                       var dic_i_md = new GenericInstanceType (dictionary);
-                       dic_i_md.GenericArguments.Add (intptr);
-                       dic_i_md.GenericArguments.Add (method_desc);
-                       dictionary_intptr_methoddesc = dic_i_md;
-
-                       dictionary_intptr_methoddesc_ctor = Import (".ctor", dic_i_md, false, void_type, Import (corlib, "System.Int32"));
-
-                       dictionary_intptr_methoddesc_set_item = Import ("set_Item", dic_i_md, false, void_type,
-                               dictionary.GenericParameters [0],
-                               dictionary.GenericParameters [1]);
-
-                       methoddesc_ctor = Import (".ctor", method_desc, false, void_type,
-                               Import (corlib, "System.Reflection.MethodBase"),
-                               Import (monomac, "MonoMac.ObjCRuntime.ArgumentSemantic"));
-
-                       var selector = Import (monomac, "MonoMac.ObjCRuntime.Selector");
-
-                       selector_get_handle = Import ("GetHandle", selector, true, intptr, Import (corlib, "System.String"));
-                       selector_init = new FieldReference ("Init", selector, intptr);
-
-                       var methodbase = Import (corlib, "System.Reflection.MethodBase");
-
-                       methodbase_get_method_from_handle = Import ("GetMethodFromHandle", methodbase, true, methodbase, Import (corlib, "System.RuntimeMethodHandle"));
-
-                       var type = Import (corlib, "System.Type");
-
-                       type_get_type_from_handle = Import ("GetTypeFromHandle", type, true, type, Import (corlib, "System.RuntimeTypeHandle"));
-
-                       var @class = Import (monomac, "MonoMac.ObjCRuntime.Class");
-
-                       class_register_methods = Import ("RegisterMethods", @class, true, void_type, type, dic_i_md);
-
-                       imported = true;
-               }
-
-               MethodReference Import (string name, TypeReference declaring_type, bool @static, TypeReference return_type, params TypeReference [] parameters_type)
-               {
-                       var reference = new MethodReference (name, return_type, declaring_type) {
-                               HasThis = !@static,
-                               ExplicitThis = false,
-                               CallingConvention = MethodCallingConvention.Default,
-                       };
-
-                       foreach (var parameter_type in parameters_type)
-                               reference.Parameters.Add (new ParameterDefinition (parameter_type));
-
-                       return reference;
-               }
-
-               TypeReference Import (TypeReference type)
-               {
-                       return module.Import (type);
-               }
-
-               TypeReference Import (AssemblyDefinition assembly, string type_name)
-               {
-                       return Import (assembly.MainModule.GetType (type_name));
-               }
-
-               void ProcessNSObject (TypeDefinition type)
-               {
-                       var exported = new List<ExportedMethod> ();
-
-                       if (type.HasMethods) {
-                               ProcessMethods (type, exported);
-                               ProcessConstructors (type, exported);
-                       }
-
-                       if (exported.Count == 0)
-                               return;
-
-                       InjectMethodMap (type, exported);
-               }
-
-               void InjectMethodMap (TypeDefinition type, List<ExportedMethod> exported_methods)
-               {
-                       PrepareImports ();
-
-                       var cctor = GetTypeConstructor (type);
-
-                       var selectors = MapSelectors (cctor);
-
-                       var map = new VariableDefinition (dictionary_intptr_methoddesc);
-                       map.Name = "$method_map";
-                       cctor.Body.Variables.Add (map);
-                       cctor.Body.SimplifyMacros ();
-
-                       var il = cctor.Body.GetILProcessor ();
-
-                       var instructions = new List<Instruction> {
-                               il.Create (OpCodes.Ldc_I4, exported_methods.Count),
-                               il.Create (OpCodes.Newobj, dictionary_intptr_methoddesc_ctor),
-                               il.Create (OpCodes.Stloc, map),
-                       };
-
-                       foreach (var exported in exported_methods) {
-
-                               instructions.Add (il.Create (OpCodes.Ldloc, map));
-
-                               if (!IsDefaultConstructor (exported)) {
-                                       var selector_name = GetSelectorName (exported);
-                                       FieldReference selector;
-
-                                       if (selectors != null && selectors.TryGetValue (selector_name, out selector)) {
-                                               instructions.Add (il.Create (OpCodes.Ldsfld, selector));
-                                       } else {
-                                               instructions.AddRange (new [] {
-                                                       il.Create (OpCodes.Ldstr, selector_name),
-                                                       il.Create (OpCodes.Call, selector_get_handle),
-                                               });
-                                       }
-                               } else
-                                       instructions.Add (il.Create (OpCodes.Ldsfld, selector_init));
-
-                               instructions.AddRange (new [] {
-                                       il.Create (OpCodes.Ldtoken, exported.method),
-                                       il.Create (OpCodes.Call, methodbase_get_method_from_handle),
-                                       il.Create (OpCodes.Ldc_I4, GetArgumentSemantic (exported)),
-                                       il.Create (OpCodes.Newobj, methoddesc_ctor),
-                                       il.Create (OpCodes.Callvirt, dictionary_intptr_methoddesc_set_item),
-                               });
-                       }
-
-                       instructions.AddRange (new [] {
-                               il.Create (OpCodes.Ldtoken, type),
-                               il.Create (OpCodes.Call, type_get_type_from_handle),
-                               il.Create (OpCodes.Ldloc, map),
-                               il.Create (OpCodes.Call, class_register_methods),
-                       });
-
-                       Append (il, instructions);
-
-                       cctor.Body.OptimizeMacros ();
-               }
-
-               static Dictionary<string, FieldReference> MapSelectors (MethodDefinition cctor)
-               {
-                       var instructions = cctor.Body.Instructions;
-                       Dictionary<string, FieldReference> selectors = null;
-
-                       for (int i = 0; i < instructions.Count; i++) {
-                               var instruction = instructions [i];
-
-                               FieldReference field;
-                               if (!IsCreateSelector (instruction, out field))
-                                       continue;
-
-                               if (selectors == null)
-                                       selectors = new Dictionary<string, FieldReference> ();
-
-                               selectors.Add ((string) instruction.Operand, field);
-                       }
-
-                       return selectors;
-               }
-
-               static bool IsCreateSelector (Instruction instruction, out FieldReference field)
-               {
-                       field = null;
-
-                       if (instruction.OpCode != OpCodes.Ldstr)
-                               return false;
-
-                       if (instruction.Next == null)
-                               return false;
-
-                       instruction = instruction.Next;
-
-                       if (instruction.OpCode != OpCodes.Call)
-                               return false;
-
-                       var method = (MethodReference) instruction.Operand;
-                       if (method.DeclaringType.Name != "Selector")
-                               return false;
-
-                       if (method.Name != "GetHandle" && method.Name != "sel_registerName")
-                               return false;
-
-                       if (instruction.Next == null)
-                               return false;
-
-                       instruction = instruction.Next;
-
-                       if (instruction.OpCode != OpCodes.Stsfld)
-                               return false;
-
-                       field = instruction.Operand as FieldReference;
-                       return true;
-               }
-
-               static bool IsDefaultConstructor (ExportedMethod exported)
-               {
-                       return exported.attribute == null && exported.method.IsConstructor && !exported.method.IsStatic;
-               }
-
-               static void Append (ILProcessor il, IEnumerable<Instruction> instructions)
-               {
-                       var method_instructions = il.Body.Instructions;
-                       var last = method_instructions [method_instructions.Count - 1];
-
-                       foreach (var instruction in instructions)
-                               il.InsertBefore (last, instruction);
-               }
-
-               static int GetArgumentSemantic (ExportedMethod exported)
-               {
-                       if (exported.attribute == null)
-                               return 0; // Assign
-
-                       var arguments = exported.attribute.ConstructorArguments;
-
-                       if (arguments.Count == 2)
-                               return (int) arguments [1].Value;
-
-                       if (arguments.Count == 1)
-                               return -1; // None
-
-                       return 0; // Assign
-               }
-
-               static string GetSelectorName (ExportedMethod exported)
-               {
-                       var arguments = exported.attribute.ConstructorArguments;
-
-                       if (arguments.Count == 0)
-                               return exported.method.Name;
-
-                       return (string) arguments [0].Value;
-               }
-
-               MethodDefinition GetTypeConstructor (TypeDefinition type)
-               {
-                       return type.GetTypeConstructor () ?? CreateTypeConstructor (type);
-               }
-
-               MethodDefinition CreateTypeConstructor (TypeDefinition type)
-               {
-                       var cctor = new MethodDefinition (".cctor", MethodAttributes.Private | MethodAttributes.Static | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, void_type);
-                       cctor.Body.GetILProcessor ().Emit (OpCodes.Ret);
-
-                       type.Methods.Add (cctor);
-
-                       return cctor;
-               }
-
-               void ProcessConstructors (TypeDefinition type, List<ExportedMethod> exported)
-               {
-                       foreach (MethodDefinition ctor in type.GetConstructors ()) {
-                               if (!ctor.HasParameters && !ctor.IsStatic) {
-                                       exported.Add (new ExportedMethod (null, ctor));
-                                       continue;
-                               }
-
-                               CustomAttribute export;
-                               if (!TryGetExportAttribute (ctor, out export))
-                                       continue;
-
-                               exported.Add (new ExportedMethod (export, ctor));
-                       }
-               }
-
-               static bool TryGetExportAttribute (MethodDefinition method, out CustomAttribute export)
-               {
-                       export = null;
-
-                       if (!method.HasCustomAttributes)
-                               return false;
-
-                       foreach (CustomAttribute attribute in method.CustomAttributes) {
-                               if (attribute.AttributeType.FullName != "MonoMac.Foundation.ExportAttribute")
-                                       continue;
-
-                               export = attribute;
-                               return true;
-                       }
-
-                       return false;
-               }
-
-               void ProcessMethods (TypeDefinition type, List<ExportedMethod> exported)
-               {
-                       foreach (MethodDefinition method in type.GetMethods ()) {
-                               CustomAttribute attribute;
-                               if (TryGetExportAttribute (method, out attribute)) {
-                                       exported.Add (new ExportedMethod (attribute, method));
-                                       continue;
-                               }
-
-                               if (!method.IsVirtual)
-                                       continue;
-
-                               var bases = Annotations.GetBaseMethods (method);
-                               if (bases == null)
-                                       continue;
-
-                               foreach (MethodDefinition @base in bases) {
-                                       if (@base.DeclaringType.IsInterface)
-                                               continue;
-
-                                       if (TryGetExportAttribute (@base, out attribute)) {
-                                               exported.Add (new ExportedMethod (attribute, method));
-                                               break;
-                                       }
-                               }
-                       }
-               }
-       }
-}
diff --git a/mcs/tools/tuner/MonoMac.Tuner/MonoMac.xml b/mcs/tools/tuner/MonoMac.Tuner/MonoMac.xml
deleted file mode 100644 (file)
index 9a078c8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<linker>
-       <assembly fullname="MonoMac">
-               <namespace fullname="MonoMac.ObjCRuntime" />
-               <!--
-               <type fullname="MonoMac.ObjCRuntime.Runtime" />
-               <type fullname="MonoMac.ObjCRuntime.Class" />
-               <type fullname="MonoMac.ObjCRuntime.Selector" />
-               <type fullname="MonoMac.ObjCRuntime.NativeConstructorBuilder" />
-               <type fullname="MonoMac.ObjCRuntime.NativeImplementationBuilder" />
-               <type fullname="MonoMac.ObjCRuntime.NativeMethodBuilder" />
-               <type fullname="MonoMac.ObjCRuntime.INativeObject" />
-               -->
-               <type fullname="MonoMac.Foundation.NSObject" preserve="fields">
-                       <method name="NativeRelease" />
-                       <method name="NativeRetain" />
-                       <method name="Retain" />
-               </type>
-               <type fullname="MonoMac.Foundation.NSArray" preserve="fields">
-                       <method name="ArrayFromHandle" />
-                       <method name="StringArrayFromHandle" />
-                       <method name="FromNSObjects" />
-                       <method name="FromStrings" />
-               </type>
-               <type fullname="MonoMac.Foundation.ExportAttribute" />
-       </assembly>
-       <assembly fullname="mscorlib">
-               <type fullname="System.Runtime.Serialization.FormatterServices">
-                       <method name="GetUninitializedObject" />
-               </type>
-               <type fullname="System.Runtime.InteropServices.Marshal">
-                       <method name="StructureToPtr" />
-               </type>
-               <type fullname="System.Runtime.InteropServices.MarshalAsAttribute">
-                       <field name="MarshalTypeRef" />
-               </type>
-       </assembly>
-</linker>
diff --git a/mcs/tools/tuner/MonoMac.Tuner/MonoMacProfile.cs b/mcs/tools/tuner/MonoMac.Tuner/MonoMacProfile.cs
deleted file mode 100644 (file)
index 0692e48..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-using Mono.Tuner;
-
-using Mono.Cecil;
-
-namespace MonoMac.Tuner {
-
-       class MonoMacProfile : Profile {
-
-               static readonly HashSet<string> Sdk = new HashSet<string> {
-                       "mscorlib",
-                       "I18N.CJK",
-                       "I18N",
-                       "I18N.MidEast",
-                       "I18N.Other",
-                       "I18N.Rare",
-                       "I18N.West",
-                       "Microsoft.Build.Engine",
-                       "Microsoft.Build.Framework",
-                       "Microsoft.Build.Tasks.v4.0",
-                       "Microsoft.Build.Utilities.v4.0",
-                       "Microsoft.CSharp",
-                       "Microsoft.Web.Infrastructure",
-                       "Mono.C5",
-                       "Mono.Cairo",
-                       "Mono.CodeContracts",
-                       "Mono.CompilerServices.SymbolWriter",
-                       "Mono.Configuration.Crypto",
-                       "Mono.CSharp",
-                       "Mono.Data.Sqlite",
-                       "Mono.Data.Tds",
-                       "Mono.Debugger.Soft",
-                       "Mono.Http",
-                       "Mono.Management",
-                       "Mono.Messaging",
-                       "Mono.Messaging.RabbitMQ",
-                       "Mono.Options",
-                       "Mono.Parallel",
-                       "Mono.Posix",
-                       "Mono.Security",
-                       "Mono.Security.Win32",
-                       "Mono.Simd",
-                       "Mono.Tasklets",
-                       "Mono.Tuner",
-                       "Mono.WebBrowser",
-                       "Mono.Web",
-                       "Novell.Directory.Ldap",
-                       "Npgsql",
-                       "OpenSystem.C",
-                       "PEAPI",
-                       "System.ComponentModel.Composition",
-                       "System.ComponentModel.DataAnnotations",
-                       "System.Configuration",
-                       "System.Configuration.Install",
-                       "System.Core",
-                       "System.Data.DataSetExtensions",
-                       "System.Data",
-                       "System.Data.Linq",
-                       "System.Data.OracleClient",
-                       "System.Data.Services.Client",
-                       "System.Data.Services",
-                       "System.Design",
-                       "System.DirectoryServices",
-                       "System",
-                       "System.Drawing.Design",
-                       "System.Drawing",
-                       "System.Dynamic",
-                       "System.EnterpriseServices",
-                       "System.IdentityModel",
-                       "System.IdentityModel.Selectors",
-                       "System.Management",
-                       "System.Messaging",
-                       "System.Net",
-                       "System.Numerics",
-                       "System.Runtime.Caching",
-                       "System.Runtime.DurableInstancing",
-                       "System.Runtime.Remoting",
-                       "System.Runtime.Serialization",
-                       "System.Runtime.Serialization.Formatters.Soap",
-                       "System.Security",
-                       "System.ServiceModel.Discovery",
-                       "System.ServiceModel",
-                       "System.ServiceModel.Routing",
-                       "System.ServiceModel.Web",
-                       "System.ServiceProcess",
-                       "System.Transactions",
-                       "System.Web.Abstractions",
-                       "System.Web.ApplicationServices",
-                       "System.Web",
-                       "System.Web.DynamicData",
-                       "System.Web.Extensions.Design",
-                       "System.Web.Extensions",
-                       "System.Web.Routing",
-                       "System.Web.Services",
-                       "System.Windows.Forms.DataVisualization",
-                       "System.Windows.Forms",
-                       "System.Xaml",
-                       "System.Xml",
-                       "System.Xml.Linq",
-                       "WebMatrix.Data",
-                       "WindowsBase",
-                       "Microsoft.VisualBasic",
-               };
-
-               protected override bool IsSdk (AssemblyDefinition assembly)
-               {
-                       return Sdk.Contains (assembly.Name.Name);
-               }
-
-               protected override bool IsProduct (AssemblyDefinition assembly)
-               {
-                       return assembly.Name.Name == "MonoMac";
-               }
-       }
-}
diff --git a/mcs/tools/tuner/MonoMac.Tuner/RemoveSelectors.cs b/mcs/tools/tuner/MonoMac.Tuner/RemoveSelectors.cs
deleted file mode 100644 (file)
index 0c201ae..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using Mono.Linker;
-using Mono.Linker.Steps;
-
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-
-using Mono.Tuner;
-
-namespace MonoMac.Tuner {
-
-       public class RemoveSelectors : IStep {
-
-               public void Process (LinkContext context)
-               {
-                       AssemblyDefinition monomac;
-                       if (!context.TryGetLinkedAssembly ("MonoMac", out monomac))
-                               return;
-
-                       foreach (TypeDefinition type in monomac.MainModule.Types) {
-                               if (!type.IsNSObject ())
-                                       continue;
-
-                               ProcessNSObject (type);
-                       }
-               }
-
-               static void ProcessNSObject (TypeDefinition type)
-               {
-                       var selectors = PopulateSelectors (type);
-                       if (selectors == null)
-                               return;
-
-                       foreach (var method in CollectMethods (type))
-                               CheckSelectorUsage (method, selectors);
-
-                       if (selectors.Count == 0)
-                               return;
-
-                       PatchStaticConstructor (type, selectors);
-                       RemoveUnusedSelectors (type, selectors);
-               }
-
-               static void CheckSelectorUsage (MethodDefinition method, HashSet<FieldDefinition> selectors)
-               {
-                       if (!method.HasBody)
-                               return;
-
-                       foreach (Instruction instruction in method.Body.Instructions) {
-                               switch (instruction.OpCode.OperandType) {
-                               case OperandType.InlineTok:
-                               case OperandType.InlineField:
-                                       var field = instruction.Operand as FieldDefinition;
-                                       if (field == null)
-                                               continue;
-
-                                       if (selectors.Contains (field))
-                                               selectors.Remove (field);
-
-                                       break;
-                               }
-                       }
-               }
-
-               static void PatchStaticConstructor (TypeDefinition type, HashSet<FieldDefinition> selectors)
-               {
-                       var cctor = type.GetTypeConstructor ();
-                       if (cctor == null || !cctor.HasBody)
-                               return;
-
-                       var instructions = cctor.Body.Instructions;
-
-                       for (int i = 0; i < instructions.Count; i++) {
-                               var instruction = instructions [i];
-                               if (!IsCreateSelector (instruction, selectors))
-                                       continue;
-
-                               instructions.RemoveAt (i--);
-                               instructions.RemoveAt (i--);
-                               instructions.RemoveAt (i--);
-                       }
-               }
-
-               static bool IsCreateSelector (Instruction instruction, HashSet<FieldDefinition> selectors)
-               {
-                       if (instruction.OpCode != OpCodes.Stsfld)
-                               return false;
-
-                       var field = instruction.Operand as FieldDefinition;
-                       if (field == null)
-                               return false;
-
-                       if (!selectors.Contains (field))
-                               return false;
-
-                       instruction = instruction.Previous;
-                       if (instruction == null)
-                               return false;
-
-                       if (instruction.OpCode != OpCodes.Call)
-                               return false;
-
-                       if (!IsRegisterSelector (instruction.Operand as MethodReference))
-                               return false;
-
-                       instruction = instruction.Previous;
-                       if (instruction == null)
-                               return false;
-
-                       if (instruction.OpCode != OpCodes.Ldstr)
-                               return false;
-
-                       return true;
-               }
-
-               static bool IsRegisterSelector (MethodReference method)
-               {
-                       if (method == null)
-                               return false;
-
-                       if (method.Name != "GetHandle" && method.Name != "sel_registerName")
-                               return false;
-
-                       if (method.DeclaringType.FullName != "MonoMac.ObjCRuntime.Selector")
-                               return false;
-
-                       return true;
-               }
-
-               static void RemoveUnusedSelectors (TypeDefinition type, HashSet<FieldDefinition> selectors)
-               {
-                       var fields = type.Fields;
-
-                       for (int i = 0; i < fields.Count; i++)
-                               if (selectors.Contains (fields [i]))
-                                       fields.RemoveAt (i--);
-               }
-
-               static HashSet<FieldDefinition> PopulateSelectors (TypeDefinition type)
-               {
-                       if (!type.HasFields)
-                               return null;
-
-                       HashSet<FieldDefinition> selectors = null;
-
-                       foreach (FieldDefinition field in type.Fields) {
-                               if (!IsSelector (field))
-                                       continue;
-
-                               if (selectors == null)
-                                       selectors = new HashSet<FieldDefinition> ();
-
-                               selectors.Add (field);
-                       }
-
-                       return selectors;
-               }
-
-               static bool IsSelector (FieldDefinition field)
-               {
-                       if (!field.IsStatic)
-                               return false;
-
-                       if (field.FieldType.FullName != "System.IntPtr")
-                               return false;
-
-                       if (!field.Name.StartsWith ("sel"))
-                               return false;
-
-                       return true;
-               }
-
-               static IEnumerable<MethodDefinition> CollectMethods (TypeDefinition type)
-               {
-                       if (!type.HasMethods)
-                               yield break;
-
-                       foreach (MethodDefinition method in type.Methods) {
-                               if (method.IsStatic && method.IsConstructor)
-                                       continue;
-
-                               yield return method;
-                       }
-               }
-       }
-}
index 72659db89401563655154dfe935af7591ab178d6..22f09af6eabfb7cdf0874a34a713bdb43c7171e6 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
@@ -28,7 +29,7 @@
     <DebugType>full</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
@@ -36,7 +37,7 @@
     <DebugType>pdbonly</DebugType>\r
     <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
index 9d6e914532dad6265dc577dd2bbe6c0e176d5895..ca06717b19b63e665d09a4bf6f15c48bc6b2a605 100644 (file)
@@ -131,6 +131,7 @@ install-pcl5-framework:
 EXTRA_DISTFILES = \
        data/xbuild.rsp \
        data/xbuild.exe.config.in \
+       data/xbuild.exe.config_test.in \
        data/Microsoft.Build.xsd \
        data/2.0/Microsoft.Common.tasks \
        data/3.5/Microsoft.Common.tasks \
diff --git a/mcs/tools/xbuild/data/xbuild.exe.config_test.in b/mcs/tools/xbuild/data/xbuild.exe.config_test.in
new file mode 100644 (file)
index 0000000..a90dbf2
--- /dev/null
@@ -0,0 +1,11 @@
+       <generatePublisherEvidence enabled="false" />
+       <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+               <dependentAssembly>
+                       <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+                       <bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="@ASM_VERSION@" />
+               </dependentAssembly>
+               <dependentAssembly>
+                       <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+                       <bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="@ASM_VERSION@" />
+               </dependentAssembly>
+       </assemblyBinding>
index 9dcf0987ec86b7daeadd7c92e899af2c823b82ea..4c503c060ac3b432270f45b7367477750751875d 100644 (file)
@@ -9,7 +9,7 @@ export XBUILD_FRAMEWORK_FOLDERS_PATH= $(topdir)/class/Microsoft.Build/xbuild-tes
 ifeq (4.0, $(FRAMEWORK_VERSION))
 NO_TEST=true
 else
-test-local: copy-targets $(test_lib).config
+test-local: copy-targets Test/test-config-file-$(PROFILE)
 clean-local: clean-targets clean-test-config
 endif
 
@@ -17,11 +17,11 @@ xbuild-net4-fail:
        @echo "The net_4_0 profile contains reference assemblies only and cannot be installed/tested as an xbuild toolset"
        @exit 1
 
-$(test_lib).config: $(XBUILD_DATA_DIR)/xbuild.exe.config.in
-       sed -e 's/@ASM_VERSION@/$(XBUILD_ASSEMBLY_VERSION)/g' $(XBUILD_DATA_DIR)/xbuild.exe.config.in > $(test_lib).config
+Test/test-config-file-$(PROFILE): $(XBUILD_DATA_DIR)/xbuild.exe.config_test.in
+       sed -e 's/@ASM_VERSION@/$(XBUILD_ASSEMBLY_VERSION)/g' $(XBUILD_DATA_DIR)/xbuild.exe.config_test.in > Test/test-config-file-$(PROFILE)
 
 clean-test-config:
-       rm -f $(test_lib).config
+       rm -f Test/test-config-file-$(PROFILE)
 
 copy-targets: copy-targets-$(XBUILD_VERSION)
 
index 7bf7b5c3dedfa0122abb5dba36dd6120370cb231..651271c25f895fe4a332287feba54f1eed76833f 100644 (file)
@@ -2,11 +2,15 @@ if SUPPORT_SGEN
 sgen_dirs = sgen
 endif
 
+if BTLS
+btls_dirs = btls
+endif
+
 if CROSS_COMPILING
-SUBDIRS = arch utils io-layer cil metadata $(sgen_dirs) mini dis profiler
+SUBDIRS = $(btls_dirs) arch utils io-layer cil metadata $(sgen_dirs) mini dis profiler
 else
 if INSTALL_MONOTOUCH
-SUBDIRS = arch utils io-layer metadata $(sgen_dirs) mini profiler
+SUBDIRS = $(btls_dirs) arch utils io-layer metadata $(sgen_dirs) mini profiler
 
 monotouch-do-build:
        @list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -30,7 +34,7 @@ monotouch-do-clean:
          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
     done;
 else
-SUBDIRS = arch utils io-layer cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
+SUBDIRS = $(btls_dirs) arch utils io-layer cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
 endif
 endif
-DIST_SUBDIRS = arch utils io-layer cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
+DIST_SUBDIRS = btls arch utils io-layer cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
diff --git a/mono/btls/.gitignore b/mono/btls/.gitignore
new file mode 100644 (file)
index 0000000..545f630
--- /dev/null
@@ -0,0 +1,6 @@
+Makefile
+Makefile.in
+build/
+martin-test
+build-shared/
+build-static/
diff --git a/mono/btls/CMakeLists.txt b/mono/btls/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7c3fb3d
--- /dev/null
@@ -0,0 +1,85 @@
+cmake_minimum_required (VERSION 2.8.10)
+
+project (mono-btls)
+
+if(POLICY CMP0026)
+cmake_policy(SET CMP0026 NEW)
+endif()
+if(POLICY CMP0042)
+cmake_policy(SET CMP0042 NEW)
+endif()
+
+enable_language(C)
+enable_language(CXX)
+
+# FIXME: cmake's asm detection is broken when using xcrun.
+set (CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}")
+set (CMAKE_ASM_COMPILER_ARG1 "${CMAKE_C_COMPILER_ARG1}")
+set (CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
+enable_language(ASM)
+
+if (NOT "${BTLS_ARCH}" STREQUAL "")
+       message (WARNING "SET ARCH: ${BTLS_ARCH}")
+       set (CMAKE_SYSTEM_PROCESSOR "${BTLS_ARCH}")
+endif ()
+set (C_CXX_FLAGS "-Wall -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden")
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_CXX_FLAGS} ${BTLS_CFLAGS}")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_CXX_FLAGS} ${BTLS_CFLAGS}")
+set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${BTLS_CFLAGS}")
+set (CMAKE_MACOSX_RPATH 1)
+set (MONO_BTLS 1)
+
+add_subdirectory (${BTLS_ROOT} boringssl)
+
+include_directories (
+       ${SRC_DIR}
+       ${BTLS_ROOT}/include
+)
+
+set (
+       MONO_BTLS_SOURCES
+
+       btls-bio.c
+       btls-bio.h
+       btls-error.c
+       btls-error.h
+       btls-key.c
+       btls-key.h
+       btls-pkcs12.c
+       btls-pkcs12.h
+       btls-ssl-ctx.c
+       btls-ssl-ctx.h
+       btls-ssl.c
+       btls-ssl.h
+       btls-time64.c
+       btls-util.c
+       btls-util.h
+       btls-x509-chain.c
+       btls-x509-chain.h
+       btls-x509-crl.c
+       btls-x509-crl.h
+       btls-x509-lookup.c
+       btls-x509-lookup.h
+       btls-x509-lookup-mono.c
+       btls-x509-lookup-mono.h
+       btls-x509-name.c
+       btls-x509-name.h
+       btls-x509-revoked.c
+       btls-x509-revoked.h
+       btls-x509-store-ctx.c
+       btls-x509-store-ctx.h
+       btls-x509-store.c
+       btls-x509-store.h
+       btls-x509-verify-param.c
+       btls-x509-verify-param.h
+       btls-x509.c
+       btls-x509.h
+
+       ${BORINGSSL_OBJECTS}
+)
+
+if (BUILD_SHARED_LIBS)
+       add_library (mono-btls-shared SHARED ${MONO_BTLS_SOURCES})
+else ()
+       add_library (mono-btls-static STATIC ${MONO_BTLS_SOURCES})
+endif ()
diff --git a/mono/btls/Makefile.am b/mono/btls/Makefile.am
new file mode 100644 (file)
index 0000000..38f879c
--- /dev/null
@@ -0,0 +1,66 @@
+EXTRA_DIST = \
+       btls-bio.c \
+       btls-bio.h \
+       btls-error.c \
+       btls-error.h \
+       btls-key.c \
+       btls-key.h \
+       btls-pkcs12.c \
+       btls-pkcs12.h \
+       btls-ssl.c \
+       btls-ssl-ctx.c \
+       btls-ssl-ctx.h \
+       btls-ssl.h \
+       btls-time64.c \
+       btls-util.c \
+       btls-util.h \
+       btls-x509.c \
+       btls-x509-chain.c \
+       btls-x509-chain.h \
+       btls-x509-crl.c \
+       btls-x509-crl.h \
+       btls-x509.h \
+       btls-x509-lookup.c \
+       btls-x509-lookup.h \
+       btls-x509-lookup-mono.c \
+       btls-x509-lookup-mono.h \
+       btls-x509-name.c \
+       btls-x509-name.h \
+       btls-x509-revoked.c \
+       btls-x509-revoked.h \
+       btls-x509-store.c \
+       btls-x509-store-ctx.c \
+       btls-x509-store-ctx.h \
+       btls-x509-store.h \
+       btls-x509-verify-param.c \
+       btls-x509-verify-param.h \
+       CMakeLists.txt
+
+CMAKE_VERBOSE=$(if $(V),VERBOSE=1,)
+
+CMAKE_ARGS = -D CMAKE_INSTALL_PREFIX:PATH=$(prefix) -D BTLS_ROOT:PATH=$(BTLS_ROOT) \
+       -D SRC_DIR:PATH=$(abs_top_srcdir)/mono/btls -D BTLS_CFLAGS:STRING="$(BTLS_CFLAGS)"
+
+all-local: build-shared/libmono-btls-shared$(libsuffix) build-static/libmono-btls-static.a
+
+build-shared/Makefile:
+       -mkdir -p build-shared
+       (cd build-shared && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_SHARED_LIBS=1 $(abs_top_srcdir)/mono/btls)
+
+build-shared/libmono-btls-shared$(libsuffix): build-shared/Makefile
+       $(MAKE) -C build-shared $(CMAKE_VERBOSE)
+
+build-static/Makefile:
+       -mkdir -p build-static
+       (cd build-static && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) $(abs_top_srcdir)/mono/btls)
+
+build-static/libmono-btls-static.a: build-static/Makefile
+       $(MAKE) -C build-static $(CMAKE_VERBOSE)
+
+clean-local:
+       -rm -rf build-static
+       -rm -rf build-shared
+
+install-exec-local:
+       $(mkinstalldirs) "$(DESTDIR)$(libdir)"
+       $(install_sh) build-shared/libmono-btls-shared.* "$(DESTDIR)$(libdir)"
diff --git a/mono/btls/btls-bio.c b/mono/btls/btls-bio.c
new file mode 100644 (file)
index 0000000..a35582a
--- /dev/null
@@ -0,0 +1,206 @@
+//
+//  btls-bio.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 14/11/15.
+//  Copyright (c) 2015 Xamarin. All rights reserved.
+//
+
+#include <btls-ssl.h>
+#include <btls-bio.h>
+#include <errno.h>
+
+struct MonoBtlsBio {
+       const void *instance;
+       MonoBtlsReadFunc read_func;
+       MonoBtlsWriteFunc write_func;
+       MonoBtlsControlFunc control_func;
+};
+
+#if 0
+static void
+mono_debug (const char *message)
+{
+       BIO *bio_err;
+       bio_err = BIO_new_fp (stderr, BIO_NOCLOSE);
+       fprintf (stderr, "DEBUG: %s\n", message);
+       ERR_print_errors (bio_err);
+}
+#endif
+
+static int
+mono_read (BIO *bio, char *out, int outl)
+{
+       MonoBtlsBio *mono = (MonoBtlsBio *)bio->ptr;
+       int ret, wantMore;
+
+       if (!mono)
+               return -1;
+
+       ret = mono->read_func (mono->instance, out, outl, &wantMore);
+
+       if (ret < 0)
+               return -1;
+       if (ret > 0)
+               return ret;
+
+       if (wantMore) {
+               errno = EAGAIN;
+               BIO_set_retry_read (bio);
+               return -1;
+       }
+
+       return 0;
+}
+
+static int
+mono_write (BIO *bio, const char *in, int inl)
+{
+       MonoBtlsBio *mono = (MonoBtlsBio *)bio->ptr;
+
+       if (!mono)
+               return -1;
+
+       return mono->write_func (mono->instance, in, inl);
+}
+
+static int64_t
+mono_ctrl (BIO *bio, int cmd, int64_t num, void *ptr)
+{
+       MonoBtlsBio *mono = (MonoBtlsBio *)bio->ptr;
+
+       if (!mono)
+               return -1;
+
+       // fprintf (stderr, "mono_ctrl: %x - %lx - %p\n", cmd, num, ptr);
+       switch (cmd) {
+               case BIO_CTRL_FLUSH:
+                       return mono->control_func (mono->instance, MONO_BTLS_CONTROL_COMMAND_FLUSH, 0);
+               default:
+                       return -1;
+       }
+       return -1;
+}
+
+static int
+mono_new (BIO *bio)
+{
+       // mono_debug("mono_new!\n");
+       bio->init = 0;
+       bio->num = -1;
+       bio->flags = 0;
+       return 1;
+}
+
+static int
+mono_free (BIO *bio)
+{
+       // mono_debug ("mono_free!\n");
+       if (bio->ptr) {
+               MonoBtlsBio *mono = (MonoBtlsBio *)bio->ptr;
+
+               bio->ptr = NULL;
+               mono->instance = NULL;
+               mono->read_func = NULL;
+               mono->write_func = NULL;
+               mono->control_func = NULL;
+               free (mono);
+       }
+       return 1;
+}
+
+static const BIO_METHOD mono_method = {
+       BIO_TYPE_NONE, "mono", mono_write, mono_read,
+       NULL, NULL, mono_ctrl, mono_new, mono_free, NULL
+};
+
+MONO_API BIO *
+mono_btls_bio_mono_new (void)
+{
+       BIO *bio;
+       MonoBtlsBio *monoBio;
+
+       bio = BIO_new (&mono_method);
+       if (!bio)
+               return NULL;
+
+       monoBio = calloc (1, sizeof (MonoBtlsBio));
+       if (!monoBio) {
+               BIO_free (bio);
+               return NULL;
+       }
+
+       bio->ptr = monoBio;
+       bio->init = 0;
+
+       return bio;
+}
+
+MONO_API void
+mono_btls_bio_mono_initialize (BIO *bio, const void *instance,
+                             MonoBtlsReadFunc read_func, MonoBtlsWriteFunc write_func,
+                             MonoBtlsControlFunc control_func)
+{
+       MonoBtlsBio *monoBio = bio->ptr;
+
+       monoBio->instance = instance;
+       monoBio->read_func = read_func;
+       monoBio->write_func = write_func;
+       monoBio->control_func = control_func;
+
+       bio->init = 1;
+}
+
+MONO_API int
+mono_btls_bio_read (BIO *bio, void *data, int len)
+{
+       return BIO_read (bio, data, len);
+}
+
+MONO_API int
+mono_btls_bio_write (BIO *bio, const void *data, int len)
+{
+       return BIO_write (bio, data, len);
+}
+
+MONO_API int
+mono_btls_bio_flush (BIO *bio)
+{
+       return BIO_flush (bio);
+}
+
+MONO_API int
+mono_btls_bio_indent (BIO *bio, unsigned indent, unsigned max_indent)
+{
+       return BIO_indent (bio, indent, max_indent);
+}
+
+MONO_API int
+mono_btls_bio_hexdump (BIO *bio, const uint8_t *data, int len, unsigned indent)
+{
+       return BIO_hexdump (bio, data, len, indent);
+}
+
+MONO_API void
+mono_btls_bio_print_errors (BIO *bio)
+{
+       BIO_print_errors (bio);
+}
+
+MONO_API void
+mono_btls_bio_free (BIO *bio)
+{
+       BIO_free (bio);
+}
+
+MONO_API BIO *
+mono_btls_bio_mem_new (void)
+{
+       return BIO_new (BIO_s_mem ());
+}
+
+MONO_API int
+mono_btls_bio_mem_get_data (BIO *bio, void **data)
+{
+       return (int)BIO_get_mem_data (bio, (char**)data);
+}
diff --git a/mono/btls/btls-bio.h b/mono/btls/btls-bio.h
new file mode 100644 (file)
index 0000000..0795ef0
--- /dev/null
@@ -0,0 +1,58 @@
+//
+//  btls-bio.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 14/11/15.
+//  Copyright (c) 2015 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_bio__
+#define __btls__btls_bio__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+
+typedef enum {
+       MONO_BTLS_CONTROL_COMMAND_FLUSH = 1
+} MonoBtlsControlCommand;
+
+typedef int (* MonoBtlsReadFunc) (const void *instance, const void *buf, int size, int *wantMore);
+typedef int (* MonoBtlsWriteFunc) (const void *instance, const void *buf, int size);
+typedef int64_t (* MonoBtlsControlFunc) (const void *instance, MonoBtlsControlCommand command, int64_t arg);
+
+BIO *
+mono_btls_bio_mono_new (void);
+
+void
+mono_btls_bio_mono_initialize (BIO *bio, const void *instance,
+                             MonoBtlsReadFunc read_func, MonoBtlsWriteFunc write_func,
+                             MonoBtlsControlFunc control_func);
+
+int
+mono_btls_bio_read (BIO *bio, void *data, int len);
+
+int
+mono_btls_bio_write (BIO *bio, const void *data, int len);
+
+int
+mono_btls_bio_flush (BIO *bio);
+
+int
+mono_btls_bio_indent (BIO *bio, unsigned indent, unsigned max_indent);
+
+int
+mono_btls_bio_hexdump (BIO *bio, const uint8_t *data, int len, unsigned indent);
+
+void
+mono_btls_bio_print_errors (BIO *bio);
+
+void
+mono_btls_bio_free (BIO *bio);
+
+BIO *
+mono_btls_bio_mem_new (void);
+
+int
+mono_btls_bio_mem_get_data (BIO *bio, void **data);
+
+#endif /* defined(__btls__btls_bio__) */
diff --git a/mono/btls/btls-error.c b/mono/btls/btls-error.c
new file mode 100644 (file)
index 0000000..7525216
--- /dev/null
@@ -0,0 +1,36 @@
+//
+//  btls-error.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 6/19/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-error.h>
+#include <btls-util.h>
+#include <assert.h>
+
+MONO_API int
+mono_btls_error_peek_error (void)
+{
+       return ERR_peek_error ();
+}
+
+MONO_API int
+mono_btls_error_get_error (void)
+{
+       return ERR_get_error ();
+}
+
+MONO_API void
+mono_btls_error_clear_error (void)
+{
+       ERR_clear_error ();
+}
+
+MONO_API void
+mono_btls_error_get_error_string_n (int error, char *buf, int len)
+{
+       ERR_error_string_n (error, buf, len);
+}
+
diff --git a/mono/btls/btls-error.h b/mono/btls/btls-error.h
new file mode 100644 (file)
index 0000000..6f791c3
--- /dev/null
@@ -0,0 +1,29 @@
+//
+//  btls-util.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/23/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_error__
+#define __btls__btls_error__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <openssl/ssl.h>
+
+int
+mono_btls_error_peek_error (void);
+
+int
+mono_btls_error_get_error (void);
+
+void
+mono_btls_error_clear_error (void);
+
+void
+mono_btls_error_get_error_string_n (int error, char *buf, int len);
+
+#endif /* __btls__btls_error__ */
diff --git a/mono/btls/btls-key.c b/mono/btls/btls-key.c
new file mode 100644 (file)
index 0000000..65909a5
--- /dev/null
@@ -0,0 +1,62 @@
+//
+//  btls-key.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/7/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-key.h>
+
+MONO_API void
+mono_btls_key_free (EVP_PKEY *pkey)
+{
+       EVP_PKEY_free (pkey);
+}
+
+MONO_API EVP_PKEY *
+mono_btls_key_up_ref (EVP_PKEY *pkey)
+{
+       return EVP_PKEY_up_ref (pkey);
+}
+
+MONO_API int
+mono_btls_key_get_bits (EVP_PKEY *pkey)
+{
+       return EVP_PKEY_bits (pkey);
+}
+
+MONO_API int
+mono_btls_key_is_rsa (EVP_PKEY *pkey)
+{
+       return pkey->type == EVP_PKEY_RSA;
+}
+
+MONO_API int
+mono_btls_key_get_bytes (EVP_PKEY *pkey, uint8_t **buffer, int *size, int include_private_bits)
+{
+       size_t len;
+       RSA *rsa;
+       int ret;
+
+       *size = 0;
+       *buffer = NULL;
+
+       if (pkey->type != EVP_PKEY_RSA)
+               return 0;
+
+       rsa = EVP_PKEY_get1_RSA (pkey);
+       if (!rsa)
+               return 0;
+
+       if (include_private_bits)
+               ret = RSA_private_key_to_bytes (buffer, &len, rsa);
+       else
+               ret = RSA_public_key_to_bytes (buffer, &len, rsa);
+
+       if (ret != 1)
+               return 0;
+
+       *size = (int)len;
+       return 1;
+}
diff --git a/mono/btls/btls-key.h b/mono/btls/btls-key.h
new file mode 100644 (file)
index 0000000..85ee5b2
--- /dev/null
@@ -0,0 +1,32 @@
+//
+//  btls-key.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/7/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_key__
+#define __btls__btls_key__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509.h>
+
+void
+mono_btls_key_free (EVP_PKEY *pkey);
+
+EVP_PKEY *
+mono_btls_key_up_ref (EVP_PKEY *pkey);
+
+int
+mono_btls_key_get_bits (EVP_PKEY *pkey);
+
+int
+mono_btls_key_is_rsa (EVP_PKEY *pkey);
+
+int
+mono_btls_key_get_bytes (EVP_PKEY *pkey, uint8_t **buffer, int *size, int include_private_bits);
+
+#endif /* __btls__btls_key__ */
+
diff --git a/mono/btls/btls-pkcs12.c b/mono/btls/btls-pkcs12.c
new file mode 100644 (file)
index 0000000..6e1a79e
--- /dev/null
@@ -0,0 +1,101 @@
+//
+//  btls-pkcs12.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/8/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-pkcs12.h>
+#include <openssl/pkcs12.h>
+
+struct MonoBtlsPkcs12 {
+       STACK_OF(X509) *certs;
+       EVP_PKEY *private_key;
+       CRYPTO_refcount_t references;
+};
+
+MONO_API MonoBtlsPkcs12 *
+mono_btls_pkcs12_new (void)
+{
+       MonoBtlsPkcs12 *pkcs12 = (MonoBtlsPkcs12 *)OPENSSL_malloc (sizeof (MonoBtlsPkcs12));
+       if (pkcs12 == NULL)
+               return NULL;
+
+       memset (pkcs12, 0, sizeof(MonoBtlsPkcs12));
+       pkcs12->certs = sk_X509_new_null ();
+       pkcs12->references = 1;
+       return pkcs12;
+}
+
+MONO_API int
+mono_btls_pkcs12_get_count (MonoBtlsPkcs12 *pkcs12)
+{
+       return (int)sk_X509_num (pkcs12->certs);
+}
+
+MONO_API X509 *
+mono_btls_pkcs12_get_cert (MonoBtlsPkcs12 *pkcs12, int index)
+{
+       X509 *cert;
+
+       if ((size_t)index >= sk_X509_num (pkcs12->certs))
+               return NULL;
+       cert = sk_X509_value (pkcs12->certs, index);
+       if (cert)
+               X509_up_ref (cert);
+       return cert;
+}
+
+MONO_API STACK_OF(X509) *
+mono_btls_pkcs12_get_certs (MonoBtlsPkcs12 *pkcs12)
+{
+       return pkcs12->certs;
+}
+
+MONO_API int
+mono_btls_pkcs12_free (MonoBtlsPkcs12 *pkcs12)
+{
+       if (!CRYPTO_refcount_dec_and_test_zero (&pkcs12->references))
+               return 0;
+
+       sk_X509_pop_free (pkcs12->certs, X509_free);
+       OPENSSL_free (pkcs12);
+       return 1;
+}
+
+MONO_API MonoBtlsPkcs12 *
+mono_btls_pkcs12_up_ref (MonoBtlsPkcs12 *pkcs12)
+{
+       CRYPTO_refcount_inc (&pkcs12->references);
+       return pkcs12;
+}
+
+MONO_API void
+mono_btls_pkcs12_add_cert (MonoBtlsPkcs12 *pkcs12, X509 *x509)
+{
+       X509_up_ref (x509);
+       sk_X509_push (pkcs12->certs, x509);
+}
+
+MONO_API int
+mono_btls_pkcs12_import (MonoBtlsPkcs12 *pkcs12, const void *data, int len, const void *password)
+{
+       CBS cbs;
+       CBS_init (&cbs, data, len);
+       return PKCS12_get_key_and_certs (&pkcs12->private_key, pkcs12->certs, &cbs, password);
+}
+
+MONO_API int
+mono_btls_pkcs12_has_private_key (MonoBtlsPkcs12 *pkcs12)
+{
+       return pkcs12->private_key != NULL;
+}
+
+MONO_API EVP_PKEY *
+mono_btls_pkcs12_get_private_key (MonoBtlsPkcs12 *pkcs12)
+{
+       if (!pkcs12->private_key)
+               return NULL;
+       return EVP_PKEY_up_ref (pkcs12->private_key);
+}
diff --git a/mono/btls/btls-pkcs12.h b/mono/btls/btls-pkcs12.h
new file mode 100644 (file)
index 0000000..20c4fd9
--- /dev/null
@@ -0,0 +1,46 @@
+//
+//  btls-pkcs12.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/8/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_pkcs12__
+#define __btls__btls_pkcs12__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509.h>
+
+MonoBtlsPkcs12 *
+mono_btls_pkcs12_new (void);
+
+int
+mono_btls_pkcs12_get_count (MonoBtlsPkcs12 *pkcs12);
+
+X509 *
+mono_btls_pkcs12_get_cert (MonoBtlsPkcs12 *pkcs12, int index);
+
+STACK_OF(X509) *
+mono_btls_pkcs12_get_certs (MonoBtlsPkcs12 *pkcs12);
+
+int
+mono_btls_pkcs12_free (MonoBtlsPkcs12 *pkcs12);
+
+MonoBtlsPkcs12 *
+mono_btls_pkcs12_up_ref (MonoBtlsPkcs12 *pkcs12);
+
+void
+mono_btls_pkcs12_add_cert (MonoBtlsPkcs12 *pkcs12, X509 *x509);
+
+int
+mono_btls_pkcs12_import (MonoBtlsPkcs12 *pkcs12, const void *data, int len, const void *password);
+
+int
+mono_btls_pkcs12_has_private_key (MonoBtlsPkcs12 *pkcs12);
+
+EVP_PKEY *
+mono_btls_pkcs12_get_private_key (MonoBtlsPkcs12 *pkcs12);
+
+#endif /* __btls__btls_pkcs12__ */
diff --git a/mono/btls/btls-ssl-ctx.c b/mono/btls/btls-ssl-ctx.c
new file mode 100644 (file)
index 0000000..1f9d43c
--- /dev/null
@@ -0,0 +1,255 @@
+//
+//  btls-ssl-ctx.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 4/11/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-ssl-ctx.h>
+#include <btls-x509-verify-param.h>
+
+struct MonoBtlsSslCtx {
+       CRYPTO_refcount_t references;
+       SSL_CTX *ctx;
+       BIO *bio;
+       BIO *debug_bio;
+       void *instance;
+       MonoBtlsVerifyFunc verify_func;
+       MonoBtlsSelectFunc select_func;
+};
+
+#define debug_print(ptr,message) \
+do { if (mono_btls_ssl_ctx_is_debug_enabled(ptr)) \
+mono_btls_ssl_ctx_debug_printf (ptr, "%s:%d:%s(): " message, __FILE__, __LINE__, \
+       __func__); } while (0)
+
+#define debug_printf(ptr,fmt, ...) \
+do { if (mono_btls_ssl_ctx_is_debug_enabled(ptr)) \
+mono_btls_ssl_ctx_debug_printf (ptr, "%s:%d:%s(): " fmt, __FILE__, __LINE__, \
+       __func__, __VA_ARGS__); } while (0)
+
+void ssl_cipher_preference_list_free (struct ssl_cipher_preference_list_st *cipher_list);
+
+MONO_API int
+mono_btls_ssl_ctx_is_debug_enabled (MonoBtlsSslCtx *ctx)
+{
+       return ctx->debug_bio != NULL;
+}
+
+MONO_API int
+mono_btls_ssl_ctx_debug_printf (MonoBtlsSslCtx *ctx, const char *format, ...)
+{
+       va_list args;
+       int ret;
+
+       if (!ctx->debug_bio)
+               return 0;
+
+       va_start (args, format);
+       ret = mono_btls_debug_printf (ctx->debug_bio, format, args);
+       va_end (args);
+       return ret;
+}
+
+MONO_API MonoBtlsSslCtx *
+mono_btls_ssl_ctx_new (void)
+{
+       MonoBtlsSslCtx *ctx;
+
+       ctx = OPENSSL_malloc (sizeof (MonoBtlsSslCtx));
+       if (!ctx)
+               return NULL;
+
+       memset (ctx, 0, sizeof (MonoBtlsSslCtx));
+       ctx->references = 1;
+       ctx->ctx = SSL_CTX_new (TLS_method ());
+       return ctx;
+}
+
+MONO_API MonoBtlsSslCtx *
+mono_btls_ssl_ctx_up_ref (MonoBtlsSslCtx *ctx)
+{
+       CRYPTO_refcount_inc (&ctx->references);
+       return ctx;
+}
+
+MONO_API int
+mono_btls_ssl_ctx_free (MonoBtlsSslCtx *ctx)
+{
+       if (!CRYPTO_refcount_dec_and_test_zero (&ctx->references))
+               return 0;
+       SSL_CTX_free (ctx->ctx);
+       ctx->instance = NULL;
+       OPENSSL_free (ctx);
+       return 1;
+}
+
+MONO_API SSL_CTX *
+mono_btls_ssl_ctx_get_ctx (MonoBtlsSslCtx *ctx)
+{
+       return ctx->ctx;
+}
+
+MONO_API void
+mono_btls_ssl_ctx_set_debug_bio (MonoBtlsSslCtx *ctx, BIO *debug_bio)
+{
+       if (debug_bio)
+               ctx->debug_bio = BIO_up_ref(debug_bio);
+       else
+               ctx->debug_bio = NULL;
+}
+
+MONO_API void
+mono_btls_ssl_ctx_initialize (MonoBtlsSslCtx *ctx, void *instance)
+{
+       ctx->instance = instance;
+}
+
+static int
+cert_verify_callback (X509_STORE_CTX *storeCtx, void *arg)
+{
+       MonoBtlsSslCtx *ptr = (MonoBtlsSslCtx*)arg;
+       int ret;
+
+       debug_printf (ptr, "cert_verify_callback(): %p\n", ptr->verify_func);
+       ret = X509_verify_cert (storeCtx);
+       debug_printf (ptr, "cert_verify_callback() #1: %d\n", ret);
+
+       if (ptr->verify_func)
+               ret = ptr->verify_func (ptr->instance, ret, storeCtx);
+
+       return ret;
+}
+
+MONO_API void
+mono_btls_ssl_ctx_set_cert_verify_callback (MonoBtlsSslCtx *ptr, MonoBtlsVerifyFunc func, int cert_required)
+{
+       int mode;
+
+       ptr->verify_func = func;
+       SSL_CTX_set_cert_verify_callback (ptr->ctx, cert_verify_callback, ptr);
+
+       mode = SSL_VERIFY_PEER;
+       if (cert_required)
+               mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+
+       SSL_CTX_set_verify (ptr->ctx, mode, NULL);
+}
+
+static int
+cert_select_callback (SSL *ssl, void *arg)
+{
+       MonoBtlsSslCtx *ptr = (MonoBtlsSslCtx*)arg;
+       int ret = 1;
+
+       debug_printf (ptr, "cert_select_callback(): %p\n", ptr->select_func);
+       if (ptr->select_func)
+               ret = ptr->select_func (ptr->instance);
+       debug_printf (ptr, "cert_select_callback() #1: %d\n", ret);
+
+       return ret;
+}
+
+MONO_API void
+mono_btls_ssl_ctx_set_cert_select_callback (MonoBtlsSslCtx *ptr, MonoBtlsSelectFunc func)
+{
+       ptr->select_func = func;
+       SSL_CTX_set_cert_cb (ptr->ctx, cert_select_callback, ptr);
+}
+
+MONO_API X509_STORE *
+mono_btls_ssl_ctx_peek_store (MonoBtlsSslCtx *ctx)
+{
+       return SSL_CTX_get_cert_store (ctx->ctx);
+}
+
+MONO_API void
+mono_btls_ssl_ctx_set_min_version (MonoBtlsSslCtx *ctx, int version)
+{
+       SSL_CTX_set_min_version (ctx->ctx, version);
+}
+
+MONO_API void
+mono_btls_ssl_ctx_set_max_version (MonoBtlsSslCtx *ctx, int version)
+{
+       SSL_CTX_set_max_version (ctx->ctx, version);
+}
+
+MONO_API int
+mono_btls_ssl_ctx_is_cipher_supported (MonoBtlsSslCtx *ctx, uint16_t value)
+{
+       const SSL_CIPHER *cipher;
+
+       cipher = SSL_get_cipher_by_value (value);
+       return cipher != NULL;
+}
+
+MONO_API int
+mono_btls_ssl_ctx_set_ciphers (MonoBtlsSslCtx *ctx, int count, const uint16_t *data,
+                                  int allow_unsupported)
+{
+       STACK_OF(SSL_CIPHER) *ciphers = NULL;
+       struct ssl_cipher_preference_list_st *pref_list = NULL;
+       uint8_t *in_group_flags = NULL;
+       int i;
+
+       ciphers = sk_SSL_CIPHER_new_null ();
+       if (!ciphers)
+               goto err;
+
+       for (i = 0; i < count; i++) {
+               const SSL_CIPHER *cipher = SSL_get_cipher_by_value (data [i]);
+               if (!cipher) {
+                       debug_printf (ctx, "mono_btls_ssl_ctx_set_ciphers(): unknown cipher %02x", data [i]);
+                       if (!allow_unsupported)
+                               goto err;
+                       continue;
+               }
+               if (!sk_SSL_CIPHER_push (ciphers, cipher))
+                        goto err;
+       }
+
+       pref_list = OPENSSL_malloc (sizeof (struct ssl_cipher_preference_list_st));
+       if (!pref_list)
+               goto err;
+
+       memset (pref_list, 0, sizeof (struct ssl_cipher_preference_list_st));
+       pref_list->ciphers = sk_SSL_CIPHER_dup (ciphers);
+       if (!pref_list->ciphers)
+               goto err;
+       pref_list->in_group_flags = OPENSSL_malloc (sk_SSL_CIPHER_num (ciphers));
+       if (!pref_list->in_group_flags)
+               goto err;
+
+       if (ctx->ctx->cipher_list)
+               ssl_cipher_preference_list_free (ctx->ctx->cipher_list);
+       if (ctx->ctx->cipher_list_by_id)
+               sk_SSL_CIPHER_free (ctx->ctx->cipher_list_by_id);
+       if (ctx->ctx->cipher_list_tls10) {
+               ssl_cipher_preference_list_free (ctx->ctx->cipher_list_tls10);
+               ctx->ctx->cipher_list_tls10 = NULL;
+       }
+       if (ctx->ctx->cipher_list_tls11) {
+               ssl_cipher_preference_list_free (ctx->ctx->cipher_list_tls11);
+               ctx->ctx->cipher_list_tls11 = NULL;
+       }
+
+       ctx->ctx->cipher_list = pref_list;
+       ctx->ctx->cipher_list_by_id = ciphers;
+
+       return (int)sk_SSL_CIPHER_num (ciphers);
+
+err:
+       sk_SSL_CIPHER_free (ciphers);
+       OPENSSL_free (pref_list);
+       OPENSSL_free (in_group_flags);
+       return 0;
+}
+
+MONO_API int
+mono_btls_ssl_ctx_set_verify_param (MonoBtlsSslCtx *ctx, const MonoBtlsX509VerifyParam *param)
+{
+       return SSL_CTX_set1_param (ctx->ctx, mono_btls_x509_verify_param_peek_param (param));
+}
+
diff --git a/mono/btls/btls-ssl-ctx.h b/mono/btls/btls-ssl-ctx.h
new file mode 100644 (file)
index 0000000..0954192
--- /dev/null
@@ -0,0 +1,84 @@
+//
+//  btls-ssl-ctx.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 4/11/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls_ssl_ctx__btls_ssl_ctx__
+#define __btls_ssl_ctx__btls_ssl_ctx__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <openssl/ssl.h>
+#include <btls-util.h>
+
+typedef struct MonoBtlsBio MonoBtlsBio;
+typedef struct MonoBtlsX509Chain MonoBtlsX509Chain;
+typedef struct MonoBtlsX509Crl MonoBtlsX509Crl;
+typedef struct MonoBtlsX509Lookup MonoBtlsX509Lookup;
+typedef struct MonoBtlsX509LookupMono MonoBtlsX509LookupMono;
+typedef struct MonoBtlsX509Name MonoBtlsX509Name;
+typedef struct MonoBtlsX509Store MonoBtlsX509Store;
+typedef struct MonoBtlsX509StoreCtx MonoBtlsX509StoreCtx;
+typedef struct MonoBtlsX509Revoked MonoBtlsX509Revoked;
+typedef struct MonoBtlsX509VerifyParam MonoBtlsX509VerifyParam;
+typedef struct MonoBtlsPkcs12 MonoBtlsPkcs12;
+typedef struct MonoBtlsSsl MonoBtlsSsl;
+typedef struct MonoBtlsSslCtx MonoBtlsSslCtx;
+
+typedef int (* MonoBtlsVerifyFunc) (void *instance, int preverify_ok, X509_STORE_CTX *ctx);
+typedef int (* MonoBtlsSelectFunc) (void *instance);
+
+MonoBtlsSslCtx *
+mono_btls_ssl_ctx_new (void);
+
+MonoBtlsSslCtx *
+mono_btls_ssl_ctx_up_ref (MonoBtlsSslCtx *ctx);
+
+int
+mono_btls_ssl_ctx_free (MonoBtlsSslCtx *ctx);
+
+void
+mono_btls_ssl_ctx_initialize (MonoBtlsSslCtx *ctx, void *instance);
+
+SSL_CTX *
+mono_btls_ssl_ctx_get_ctx (MonoBtlsSslCtx *ctx);
+
+int
+mono_btls_ssl_ctx_debug_printf (MonoBtlsSslCtx *ctx, const char *format, ...);
+
+int
+mono_btls_ssl_ctx_is_debug_enabled (MonoBtlsSslCtx *ctx);
+
+void
+mono_btls_ssl_ctx_set_cert_verify_callback (MonoBtlsSslCtx *ptr, MonoBtlsVerifyFunc func, int cert_required);
+
+void
+mono_btls_ssl_ctx_set_cert_select_callback (MonoBtlsSslCtx *ptr, MonoBtlsSelectFunc func);
+
+void
+mono_btls_ssl_ctx_set_debug_bio (MonoBtlsSslCtx *ctx, BIO *debug_bio);
+
+X509_STORE *
+mono_btls_ssl_ctx_peek_store (MonoBtlsSslCtx *ctx);
+
+void
+mono_btls_ssl_ctx_set_min_version (MonoBtlsSslCtx *ctx, int version);
+
+void
+mono_btls_ssl_ctx_set_max_version (MonoBtlsSslCtx *ctx, int version);
+
+int
+mono_btls_ssl_ctx_is_cipher_supported (MonoBtlsSslCtx *ctx, uint16_t value);
+
+int
+mono_btls_ssl_ctx_set_ciphers (MonoBtlsSslCtx *ctx, int count, const uint16_t *data,
+                                  int allow_unsupported);
+
+int
+mono_btls_ssl_ctx_set_verify_param (MonoBtlsSslCtx *ctx, const MonoBtlsX509VerifyParam *param);
+
+#endif /* __btls_ssl_ctx__btls_ssl_ctx__ */
diff --git a/mono/btls/btls-ssl.c b/mono/btls/btls-ssl.c
new file mode 100644 (file)
index 0000000..f18d6c1
--- /dev/null
@@ -0,0 +1,209 @@
+//
+//  btls-ssl.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 14/11/15.
+//  Copyright (c) 2015 Xamarin. All rights reserved.
+//
+
+#include <btls-ssl.h>
+#include <btls-x509-verify-param.h>
+
+struct MonoBtlsSsl {
+       MonoBtlsSslCtx *ctx;
+       SSL *ssl;
+};
+
+#define debug_print(ptr,message) \
+do { if (mono_btls_ssl_ctx_is_debug_enabled(ptr->ctx)) \
+mono_btls_ssl_ctx_debug_printf (ptr->ctx, "%s:%d:%s(): " message, __FILE__, __LINE__, \
+__func__); } while (0)
+
+#define debug_printf(ptr,fmt, ...) \
+do { if (mono_btls_ssl_ctx_is_debug_enabled(ptr->ctx)) \
+mono_btls_ssl_ctx_debug_printf (ptr->ctx, "%s:%d:%s(): " fmt, __FILE__, __LINE__, \
+__func__, __VA_ARGS__); } while (0)
+
+STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list (SSL *s, const CBS *cbs);
+
+MONO_API MonoBtlsSsl *
+mono_btls_ssl_new (MonoBtlsSslCtx *ctx)
+{
+       MonoBtlsSsl *ptr;
+
+       ptr = calloc (1, sizeof (MonoBtlsSsl));
+
+       ptr->ctx = mono_btls_ssl_ctx_up_ref (ctx);
+       ptr->ssl = SSL_new (mono_btls_ssl_ctx_get_ctx (ptr->ctx));
+
+       SSL_set_options (ptr->ssl, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
+
+       return ptr;
+}
+
+MONO_API void
+mono_btls_ssl_destroy (MonoBtlsSsl *ptr)
+{
+       mono_btls_ssl_close (ptr);
+       if (ptr->ssl) {
+               SSL_free (ptr->ssl);
+               ptr->ssl = NULL;
+       }
+       if (ptr->ctx) {
+               mono_btls_ssl_ctx_free (ptr->ctx);
+               ptr->ctx = NULL;
+       }
+       free (ptr);
+}
+
+MONO_API void
+mono_btls_ssl_close (MonoBtlsSsl *ptr)
+{
+       ;
+}
+
+MONO_API void
+mono_btls_ssl_set_bio (MonoBtlsSsl *ptr, BIO *bio)
+{
+       BIO_up_ref (bio);
+       SSL_set_bio (ptr->ssl, bio, bio);
+}
+
+MONO_API void
+mono_btls_ssl_print_errors_cb (ERR_print_errors_callback_t callback, void *ctx)
+{
+       ERR_print_errors_cb (callback, ctx);
+}
+
+MONO_API int
+mono_btls_ssl_use_certificate (MonoBtlsSsl *ptr, X509 *x509)
+{
+       return SSL_use_certificate (ptr->ssl, x509);
+}
+
+MONO_API int
+mono_btls_ssl_use_private_key (MonoBtlsSsl *ptr, EVP_PKEY *key)
+{
+       return SSL_use_PrivateKey (ptr->ssl, key);
+}
+
+MONO_API int
+mono_btls_ssl_add_chain_certificate (MonoBtlsSsl *ptr, X509 *x509)
+{
+       return SSL_add1_chain_cert (ptr->ssl, x509);
+}
+
+MONO_API int
+mono_btls_ssl_accept (MonoBtlsSsl *ptr)
+{
+       return SSL_accept (ptr->ssl);
+}
+
+MONO_API int
+mono_btls_ssl_connect (MonoBtlsSsl *ptr)
+{
+       return SSL_connect (ptr->ssl);
+}
+
+MONO_API int
+mono_btls_ssl_handshake (MonoBtlsSsl *ptr)
+{
+       return SSL_do_handshake (ptr->ssl);
+}
+
+MONO_API int
+mono_btls_ssl_read (MonoBtlsSsl *ptr, void *buf, int count)
+{
+       return SSL_read (ptr->ssl, buf, count);
+}
+
+MONO_API int
+mono_btls_ssl_write (MonoBtlsSsl *ptr, void *buf, int count)
+{
+       return SSL_write (ptr->ssl, buf, count);
+}
+
+MONO_API int
+mono_btls_ssl_get_version (MonoBtlsSsl *ptr)
+{
+       return SSL_version (ptr->ssl);
+}
+
+MONO_API void
+mono_btls_ssl_set_min_version (MonoBtlsSsl *ptr, int version)
+{
+       SSL_set_min_version (ptr->ssl, version);
+}
+
+MONO_API void
+mono_btls_ssl_set_max_version (MonoBtlsSsl *ptr, int version)
+{
+       SSL_set_max_version (ptr->ssl, version);
+}
+
+MONO_API int
+mono_btls_ssl_get_cipher (MonoBtlsSsl *ptr)
+{
+       const SSL_CIPHER *cipher;
+
+       cipher = SSL_get_current_cipher (ptr->ssl);
+       if (!cipher)
+               return 0;
+       return (uint16_t)SSL_CIPHER_get_id (cipher);
+}
+
+MONO_API int
+mono_btls_ssl_set_cipher_list (MonoBtlsSsl *ptr, const char *str)
+{
+       return SSL_set_cipher_list(ptr->ssl, str);
+}
+
+MONO_API int
+mono_btls_ssl_get_ciphers (MonoBtlsSsl *ptr, uint16_t **data)
+{
+       STACK_OF(SSL_CIPHER) *ciphers;
+       int count, i;
+
+       *data = NULL;
+
+       ciphers = SSL_get_ciphers (ptr->ssl);
+       if (!ciphers)
+               return 0;
+
+       count = (int)sk_SSL_CIPHER_num (ciphers);
+
+       *data = OPENSSL_malloc (2 * count);
+       if (!*data)
+               return 0;
+
+       for (i = 0; i < count; i++) {
+               const SSL_CIPHER *cipher = sk_SSL_CIPHER_value (ciphers, i);
+               (*data) [i] = (uint16_t) SSL_CIPHER_get_id (cipher);
+       }
+
+       return count;
+}
+
+MONO_API X509 *
+mono_btls_ssl_get_peer_certificate (MonoBtlsSsl *ptr)
+{
+       return SSL_get_peer_certificate (ptr->ssl);
+}
+
+MONO_API int
+mono_btls_ssl_get_error (MonoBtlsSsl *ptr, int ret_code)
+{
+       return SSL_get_error (ptr->ssl, ret_code);
+}
+
+MONO_API int
+mono_btls_ssl_set_verify_param (MonoBtlsSsl *ptr, const MonoBtlsX509VerifyParam *param)
+{
+       return SSL_set1_param (ptr->ssl, mono_btls_x509_verify_param_peek_param (param));
+}
+
+MONO_API int
+mono_btls_ssl_set_server_name (MonoBtlsSsl *ptr, const char *name)
+{
+       return SSL_set_tlsext_host_name (ptr->ssl, name);
+}
diff --git a/mono/btls/btls-ssl.h b/mono/btls/btls-ssl.h
new file mode 100644 (file)
index 0000000..10da436
--- /dev/null
@@ -0,0 +1,83 @@
+//
+//  btls-ssl.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 14/11/15.
+//  Copyright (c) 2015 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_ssl__
+#define __btls__btls_ssl__
+
+#include <btls-ssl-ctx.h>
+
+MonoBtlsSsl *
+mono_btls_ssl_new (MonoBtlsSslCtx *ctx);
+
+int
+mono_btls_ssl_use_certificate (MonoBtlsSsl *ptr, X509 *x509);
+
+int
+mono_btls_ssl_use_private_key (MonoBtlsSsl *ptr, EVP_PKEY *key);
+
+int
+mono_btls_ssl_add_chain_certificate (MonoBtlsSsl *ptr, X509 *x509);
+
+int
+mono_btls_ssl_accept (MonoBtlsSsl *ptr);
+
+int
+mono_btls_ssl_connect (MonoBtlsSsl *ptr);
+
+int
+mono_btls_ssl_handshake (MonoBtlsSsl *ptr);
+
+void
+mono_btls_ssl_print_errors_cb (ERR_print_errors_callback_t callback, void *ctx);
+
+void
+mono_btls_ssl_set_bio (MonoBtlsSsl *ptr, BIO *bio);
+
+int
+mono_btls_ssl_read (MonoBtlsSsl *ptr, void *buf, int count);
+
+int
+mono_btls_ssl_write (MonoBtlsSsl *ptr, void *buf, int count);
+
+int
+mono_btls_ssl_get_version (MonoBtlsSsl *ptr);
+
+void
+mono_btls_ssl_set_min_version (MonoBtlsSsl *ptr, int version);
+
+void
+mono_btls_ssl_set_max_version (MonoBtlsSsl *ptr, int version);
+
+int
+mono_btls_ssl_get_cipher (MonoBtlsSsl *ptr);
+
+int
+mono_btls_ssl_set_cipher_list (MonoBtlsSsl *ptr, const char *str);
+
+int
+mono_btls_ssl_get_ciphers (MonoBtlsSsl *ptr, uint16_t **data);
+
+X509 *
+mono_btls_ssl_get_peer_certificate (MonoBtlsSsl *ptr);
+
+void
+mono_btls_ssl_close (MonoBtlsSsl *ptr);
+
+int
+mono_btls_ssl_get_error (MonoBtlsSsl *ptr, int ret_code);
+
+int
+mono_btls_ssl_set_verify_param (MonoBtlsSsl *ptr, const MonoBtlsX509VerifyParam *param);
+
+int
+mono_btls_ssl_set_server_name (MonoBtlsSsl *ptr, const char *name);
+
+void
+mono_btls_ssl_destroy (MonoBtlsSsl *ptr);
+
+#endif /* defined(__btls__btls_ssl__) */
diff --git a/mono/btls/btls-time64.c b/mono/btls/btls-time64.c
new file mode 100644 (file)
index 0000000..5c67546
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+
+Copyright (c) 2007-2008  Michael G Schwern
+
+This software originally derived from Paul Sheer's pivotal_gmtime_r.c.
+
+The MIT License:
+
+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.
+
+*/
+
+/* See http://code.google.com/p/y2038 for this code's origin */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+
+/* Spec says except for stftime() and the _r() functions, these
+   all return static memory.  Stabbings! */
+static struct tm   Static_Return_Date;
+static char        Static_Return_String[35];
+
+static const int days_in_month[2][12] = {
+    {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+    {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+};
+
+static const int julian_days_by_month[2][12] = {
+    {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334},
+    {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335},
+};
+
+static char const wday_name[7][3] = {
+    "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
+static char const mon_name[12][3] = {
+    "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+static const int length_of_year[2] = { 365, 366 };
+
+/* Some numbers relating to the gregorian cycle */
+static const int64_t     years_in_gregorian_cycle   = 400;
+#define               days_in_gregorian_cycle      ((365 * 400) + 100 - 4 + 1)
+static const int64_t seconds_in_gregorian_cycle = days_in_gregorian_cycle * 60LL * 60LL * 24LL;
+
+/* Year range we can trust the time funcitons with */
+#define MAX_SAFE_YEAR 2037
+#define MIN_SAFE_YEAR 1971
+
+/* 28 year Julian calendar cycle */
+#define SOLAR_CYCLE_LENGTH 28
+
+/* Year cycle from MAX_SAFE_YEAR down. */
+static const int safe_years_high[SOLAR_CYCLE_LENGTH] = {
+    2016, 2017, 2018, 2019,
+    2020, 2021, 2022, 2023,
+    2024, 2025, 2026, 2027,
+    2028, 2029, 2030, 2031,
+    2032, 2033, 2034, 2035,
+    2036, 2037, 2010, 2011,
+    2012, 2013, 2014, 2015
+};
+
+/* Year cycle from MIN_SAFE_YEAR up */
+static const int safe_years_low[SOLAR_CYCLE_LENGTH] = {
+    1996, 1997, 1998, 1971,
+    1972, 1973, 1974, 1975,
+    1976, 1977, 1978, 1979,
+    1980, 1981, 1982, 1983,
+    1984, 1985, 1986, 1987,
+    1988, 1989, 1990, 1991,
+    1992, 1993, 1994, 1995,
+};
+
+/* Let's assume people are going to be looking for dates in the future.
+   Let's provide some cheats so you can skip ahead.
+   This has a 4x speed boost when near 2008.
+*/
+/* Number of days since epoch on Jan 1st, 2008 GMT */
+#define CHEAT_DAYS  (1199145600 / 24 / 60 / 60)
+#define CHEAT_YEARS 108
+
+#define IS_LEAP(n)      ((!(((n) + 1900) % 400) || (!(((n) + 1900) % 4) && (((n) + 1900) % 100))) != 0)
+#define WRAP(a,b,m)     ((a) = ((a) <  0  ) ? ((b)--, (a) + (m)) : (a))
+
+/* timegm() is not in the C or POSIX spec, but it is such a useful
+   extension I would be remiss in leaving it out.  Also I need it
+   for localtime64()
+*/
+int64_t btls_timegm64(const struct tm *date) {
+    int64_t days    = 0;
+    int64_t seconds = 0;
+    int64_t     year;
+    int64_t     orig_year = (int64_t)date->tm_year;
+    int      cycles  = 0;
+
+    if( orig_year > 100 ) {
+        cycles = (orig_year - 100) / 400;
+        orig_year -= cycles * 400;
+        days      += (int64_t)cycles * days_in_gregorian_cycle;
+    }
+    else if( orig_year < -300 ) {
+        cycles = (orig_year - 100) / 400;
+        orig_year -= cycles * 400;
+        days      += (int64_t)cycles * days_in_gregorian_cycle;
+    }
+
+    if( orig_year > 70 ) {
+        year = 70;
+        while( year < orig_year ) {
+            days += length_of_year[IS_LEAP(year)];
+            year++;
+        }
+    }
+    else if ( orig_year < 70 ) {
+        year = 69;
+        do {
+            days -= length_of_year[IS_LEAP(year)];
+            year--;
+        } while( year >= orig_year );
+    }
+
+
+    days += julian_days_by_month[IS_LEAP(orig_year)][date->tm_mon];
+    days += date->tm_mday - 1;
+
+    seconds = days * 60 * 60 * 24;
+
+    seconds += date->tm_hour * 60 * 60;
+    seconds += date->tm_min * 60;
+    seconds += date->tm_sec;
+
+    return(seconds);
+}
diff --git a/mono/btls/btls-util.c b/mono/btls/btls-util.c
new file mode 100644 (file)
index 0000000..7c7f4ca
--- /dev/null
@@ -0,0 +1,77 @@
+//
+//  btls-util.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/23/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-util.h>
+#include <assert.h>
+// #include <time.h>
+
+extern int asn1_generalizedtime_to_tm (struct tm *tm, const ASN1_GENERALIZEDTIME *d);
+
+extern int64_t btls_timegm64 (const struct tm *date);
+
+
+MONO_API void
+mono_btls_free (void *data)
+{
+       OPENSSL_free (data);
+}
+
+int64_t
+mono_btls_util_asn1_time_to_ticks (ASN1_TIME *time)
+{
+       ASN1_GENERALIZEDTIME *gtime;
+       struct tm tm;
+       int64_t epoch;
+       int ret;
+       
+       memset (&tm, 0, sizeof (tm));
+
+       gtime = ASN1_TIME_to_generalizedtime (time, NULL);
+       ret = asn1_generalizedtime_to_tm (&tm, gtime);
+       ASN1_GENERALIZEDTIME_free (gtime);
+       epoch = btls_timegm64 (&tm);
+
+       return epoch;
+}
+
+// Copied from crypto/bio/printf.c, takes va_list
+int
+mono_btls_debug_printf (BIO *bio, const char *format, va_list args)
+{
+       char buf[256], *out, out_malloced = 0;
+       int out_len, ret;
+
+       out_len = vsnprintf (buf, sizeof(buf), format, args);
+       if (out_len < 0) {
+               return -1;
+       }
+
+       if ((size_t) out_len >= sizeof(buf)) {
+               const int requested_len = out_len;
+               /* The output was truncated. Note that vsnprintf's return value
+                * does not include a trailing NUL, but the buffer must be sized
+                * for it. */
+               out = OPENSSL_malloc (requested_len + 1);
+               out_malloced = 1;
+               if (out == NULL) {
+                       OPENSSL_PUT_ERROR(BIO, ERR_R_MALLOC_FAILURE);
+                       return -1;
+               }
+               out_len = vsnprintf (out, requested_len + 1, format, args);
+               assert(out_len == requested_len);
+       } else {
+               out = buf;
+       }
+
+       ret = BIO_write(bio, out, out_len);
+       if (out_malloced) {
+               OPENSSL_free(out);
+       }
+
+       return ret;
+}
diff --git a/mono/btls/btls-util.h b/mono/btls/btls-util.h
new file mode 100644 (file)
index 0000000..a1b1652
--- /dev/null
@@ -0,0 +1,45 @@
+//
+//  btls-util.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/23/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_util__
+#define __btls__btls_util__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <openssl/ssl.h>
+
+#ifndef MONO_API
+#if defined(_MSC_VER)
+
+#define MONO_API __declspec(dllexport)
+
+#else
+
+#ifdef __GNUC__
+#define MONO_API __attribute__ ((visibility ("default")))
+#else
+#define MONO_API
+#endif
+
+#endif
+#endif
+
+void
+mono_btls_free (void *data);
+
+int64_t
+mono_btls_util_asn1_time_to_ticks (ASN1_TIME *time);
+
+int
+mono_btls_debug_printf (BIO *bio, const char *format, va_list args);
+
+OPENSSL_EXPORT void CRYPTO_refcount_inc(CRYPTO_refcount_t *count);
+OPENSSL_EXPORT int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count);
+
+#endif /* __btls__btls_util__ */
diff --git a/mono/btls/btls-x509-chain.c b/mono/btls/btls-x509-chain.c
new file mode 100644 (file)
index 0000000..5b7082d
--- /dev/null
@@ -0,0 +1,96 @@
+//
+//  btls-x509-chain.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/3/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-chain.h>
+
+struct MonoBtlsX509Chain {
+       STACK_OF(X509) *certs;
+       CRYPTO_refcount_t references;
+};
+
+MONO_API MonoBtlsX509Chain *
+mono_btls_x509_chain_new (void)
+{
+       MonoBtlsX509Chain *chain = (MonoBtlsX509Chain *)OPENSSL_malloc (sizeof (MonoBtlsX509Chain));
+       if (chain == NULL)
+               return NULL;
+
+       memset(chain, 0, sizeof(MonoBtlsX509Chain));
+       chain->certs = sk_X509_new_null ();
+       chain->references = 1;
+       return chain;
+}
+
+MONO_API MonoBtlsX509Chain *
+mono_btls_x509_chain_from_certs (STACK_OF(X509) *certs)
+{
+       MonoBtlsX509Chain *chain = (MonoBtlsX509Chain *)OPENSSL_malloc (sizeof (MonoBtlsX509Chain));
+       if (chain == NULL)
+               return NULL;
+
+       memset(chain, 0, sizeof(MonoBtlsX509Chain));
+       chain->certs = X509_chain_up_ref(certs);
+       chain->references = 1;
+       return chain;
+}
+
+MONO_API STACK_OF(X509) *
+mono_btls_x509_chain_peek_certs (MonoBtlsX509Chain *chain)
+{
+       return chain->certs;
+}
+
+MONO_API int
+mono_btls_x509_chain_get_count (MonoBtlsX509Chain *chain)
+{
+       return (int)sk_X509_num(chain->certs);
+}
+
+MONO_API X509 *
+mono_btls_x509_chain_get_cert (MonoBtlsX509Chain *chain, int index)
+{
+       X509 *cert;
+
+       if ((size_t)index >= sk_X509_num(chain->certs))
+               return NULL;
+       cert = sk_X509_value(chain->certs, index);
+       if (cert)
+               X509_up_ref(cert);
+       return cert;
+}
+
+MONO_API STACK_OF(X509) *
+mono_btls_x509_chain_get_certs (MonoBtlsX509Chain *chain)
+{
+       return chain->certs;
+}
+
+MONO_API int
+mono_btls_x509_chain_free (MonoBtlsX509Chain *chain)
+{
+       if (!CRYPTO_refcount_dec_and_test_zero(&chain->references))
+               return 0;
+
+       sk_X509_pop_free(chain->certs, X509_free);
+       OPENSSL_free (chain);
+       return 1;
+}
+
+MONO_API MonoBtlsX509Chain *
+mono_btls_x509_chain_up_ref (MonoBtlsX509Chain *chain)
+{
+       CRYPTO_refcount_inc(&chain->references);
+       return chain;
+}
+
+MONO_API void
+mono_btls_x509_chain_add_cert (MonoBtlsX509Chain *chain, X509 *x509)
+{
+       X509_up_ref(x509);
+       sk_X509_push(chain->certs, x509);
+}
diff --git a/mono/btls/btls-x509-chain.h b/mono/btls/btls-x509-chain.h
new file mode 100644 (file)
index 0000000..68ef577
--- /dev/null
@@ -0,0 +1,41 @@
+//
+//  btls-x509-chain.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/3/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_chain__
+#define __btls__btls_x509_chain__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509.h>
+
+MonoBtlsX509Chain *
+mono_btls_x509_chain_new (void);
+
+MonoBtlsX509Chain *
+mono_btls_x509_chain_from_certs (STACK_OF(X509) *certs);
+
+STACK_OF(X509) *
+mono_btls_x509_chain_peek_certs (MonoBtlsX509Chain *chain);
+
+int
+mono_btls_x509_chain_get_count (MonoBtlsX509Chain *chain);
+
+X509 *
+mono_btls_x509_chain_get_cert (MonoBtlsX509Chain *chain, int index);
+
+MonoBtlsX509Chain *
+mono_btls_x509_chain_up_ref (MonoBtlsX509Chain *chain);
+
+int
+mono_btls_x509_chain_free (MonoBtlsX509Chain *chain);
+
+void
+mono_btls_x509_chain_add_cert (MonoBtlsX509Chain *chain, X509 *x509);
+
+#endif /* defined(__btls__btls_x509_chain__) */
+
diff --git a/mono/btls/btls-x509-crl.c b/mono/btls/btls-x509-crl.c
new file mode 100644 (file)
index 0000000..d496c07
--- /dev/null
@@ -0,0 +1,150 @@
+//
+//  btls-x509-crl.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/23/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-crl.h>
+#include <btls-x509-revoked.h>
+
+struct MonoBtlsX509Crl {
+       X509_CRL *crl;
+       CRYPTO_refcount_t references;
+};
+
+MONO_API MonoBtlsX509Crl *
+mono_btls_x509_crl_from_data (const void *buf, int len, MonoBtlsX509Format format)
+{
+       MonoBtlsX509Crl *crl;
+       BIO *bio;
+
+       crl = OPENSSL_malloc (sizeof (MonoBtlsX509Crl));
+       memset (crl, 0, sizeof(MonoBtlsX509Crl));
+       crl->references = 1;
+
+       bio = BIO_new_mem_buf ((void *)buf, len);
+       switch (format) {
+               case MONO_BTLS_X509_FORMAT_DER:
+                       crl->crl = d2i_X509_CRL_bio (bio, NULL);
+                       break;
+               case MONO_BTLS_X509_FORMAT_PEM:
+                       crl->crl = PEM_read_bio_X509_CRL (bio, NULL, NULL, NULL);
+                       break;
+       }
+       BIO_free (bio);
+
+       if (!crl->crl) {
+               OPENSSL_free (crl);
+               return NULL;
+       }
+
+       return crl;
+}
+
+MONO_API MonoBtlsX509Crl *
+mono_btls_x509_crl_ref (MonoBtlsX509Crl *crl)
+{
+       CRYPTO_refcount_inc (&crl->references);
+       return crl;
+}
+
+MONO_API int
+mono_btls_x509_crl_free (MonoBtlsX509Crl *crl)
+{
+       if (!CRYPTO_refcount_dec_and_test_zero (&crl->references))
+               return 0;
+
+       X509_CRL_free (crl->crl);
+       OPENSSL_free (crl);
+       return 1;
+}
+
+MONO_API MonoBtlsX509Revoked *
+mono_btls_x509_crl_get_by_cert (MonoBtlsX509Crl *crl, X509 *x509)
+{
+       X509_REVOKED *revoked;
+       int ret;
+
+       revoked = NULL;
+       ret = X509_CRL_get0_by_cert (crl->crl, &revoked, x509);
+       fprintf (stderr, "mono_btls_x509_crl_get_by_cert: %d - %p\n", ret, revoked);
+
+       if (!ret || !revoked)
+               return NULL;
+
+       return mono_btls_x509_revoked_new (crl, revoked);
+}
+
+MONO_API MonoBtlsX509Revoked *
+mono_btls_x509_crl_get_by_serial (MonoBtlsX509Crl *crl, void *serial, int len)
+{
+       ASN1_INTEGER si;
+       X509_REVOKED *revoked;
+       int ret;
+
+       si.type = V_ASN1_INTEGER;
+       si.length = len;
+       si.data = serial;
+
+       revoked = NULL;
+       ret = X509_CRL_get0_by_serial (crl->crl, &revoked, &si);
+       fprintf (stderr, "mono_btls_x509_crl_get_by_serial: %d - %p\n", ret, revoked);
+
+       if (!ret || !revoked)
+               return NULL;
+
+       return mono_btls_x509_revoked_new (crl, revoked);
+}
+
+MONO_API int
+mono_btls_x509_crl_get_revoked_count (MonoBtlsX509Crl *crl)
+{
+       STACK_OF(X509_REVOKED) *stack;
+
+       stack = X509_CRL_get_REVOKED (crl->crl);
+       return (int)sk_X509_REVOKED_num (stack);
+}
+
+MONO_API MonoBtlsX509Revoked *
+mono_btls_x509_crl_get_revoked (MonoBtlsX509Crl *crl, int index)
+{
+       STACK_OF(X509_REVOKED) *stack;
+       X509_REVOKED *revoked;
+
+       stack = X509_CRL_get_REVOKED (crl->crl);
+       if ((size_t)index >= sk_X509_REVOKED_num (stack))
+               return NULL;
+
+       revoked = sk_X509_REVOKED_value (stack, index);
+       if (!revoked)
+               return NULL;
+
+       return mono_btls_x509_revoked_new (crl, revoked);
+}
+
+MONO_API int64_t
+mono_btls_x509_crl_get_last_update (MonoBtlsX509Crl *crl)
+{
+       return mono_btls_util_asn1_time_to_ticks (X509_CRL_get_lastUpdate (crl->crl));
+}
+
+MONO_API int64_t
+mono_btls_x509_crl_get_next_update (MonoBtlsX509Crl *crl)
+{
+       return mono_btls_util_asn1_time_to_ticks (X509_CRL_get_nextUpdate (crl->crl));
+}
+
+MONO_API int64_t
+mono_btls_x509_crl_get_version (MonoBtlsX509Crl *crl)
+{
+       return X509_CRL_get_version (crl->crl);
+}
+
+MONO_API MonoBtlsX509Name *
+mono_btls_x509_crl_get_issuer (MonoBtlsX509Crl *crl)
+{
+       return mono_btls_x509_name_copy (X509_CRL_get_issuer (crl->crl));
+}
+
diff --git a/mono/btls/btls-x509-crl.h b/mono/btls/btls-x509-crl.h
new file mode 100644 (file)
index 0000000..625037d
--- /dev/null
@@ -0,0 +1,49 @@
+//
+//  btls-x509-crl.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/23/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_crl__
+#define __btls__btls_x509_crl__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509.h>
+
+MonoBtlsX509Crl *
+mono_btls_x509_crl_from_data (const void *buf, int len, MonoBtlsX509Format format);
+
+MonoBtlsX509Crl *
+mono_btls_x509_crl_ref (MonoBtlsX509Crl *crl);
+
+int
+mono_btls_x509_crl_free (MonoBtlsX509Crl *crl);
+
+MonoBtlsX509Revoked *
+mono_btls_x509_crl_get_by_cert (MonoBtlsX509Crl *crl, X509 *x509);
+
+MonoBtlsX509Revoked *
+mono_btls_x509_crl_get_by_serial (MonoBtlsX509Crl *crl, void *serial, int len);
+
+int
+mono_btls_x509_crl_get_revoked_count (MonoBtlsX509Crl *crl);
+
+MonoBtlsX509Revoked *
+mono_btls_x509_crl_get_revoked (MonoBtlsX509Crl *crl, int index);
+
+int64_t
+mono_btls_x509_crl_get_last_update (MonoBtlsX509Crl *crl);
+
+int64_t
+mono_btls_x509_crl_get_next_update (MonoBtlsX509Crl *crl);
+
+int64_t
+mono_btls_x509_crl_get_version (MonoBtlsX509Crl *crl);
+
+MonoBtlsX509Name *
+mono_btls_x509_crl_get_issuer (MonoBtlsX509Crl *crl);
+
+#endif /* __btls__btls_x509_crl__ */
diff --git a/mono/btls/btls-x509-lookup-mono.c b/mono/btls/btls-x509-lookup-mono.c
new file mode 100644 (file)
index 0000000..6d9d69a
--- /dev/null
@@ -0,0 +1,228 @@
+//
+//  btls-x509-lookup-mono.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/6/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-lookup.h>
+#include <btls-x509-lookup-mono.h>
+#include <openssl/stack.h>
+
+// random high number
+#define MONO_BTLS_X509_L_MONO_ADD      36292
+
+typedef struct MonoLookupNode MonoLookupNode;
+struct MonoLookupNode {
+       MonoBtlsX509LookupMono *mono;
+       MonoLookupNode *next;
+};
+
+typedef struct {
+       MonoLookupNode *nodes;
+} MonoLookup;
+
+struct MonoBtlsX509LookupMono {
+       const void *instance;
+       MonoBtlsX509LookupMono_BySubject by_subject_func;
+       MonoLookup *lookup;
+};
+
+MONO_API MonoBtlsX509LookupMono *
+mono_btls_x509_lookup_mono_new (void)
+{
+       MonoBtlsX509LookupMono *mono;
+
+       mono = OPENSSL_malloc (sizeof (MonoBtlsX509LookupMono));
+       if (!mono)
+               return NULL;
+
+       memset (mono, 0, sizeof (MonoBtlsX509LookupMono));
+       return mono;
+}
+
+MONO_API void
+mono_btls_x509_lookup_mono_init (MonoBtlsX509LookupMono *mono, const void *instance,
+                                MonoBtlsX509LookupMono_BySubject by_subject_func)
+{
+       mono->instance = instance;
+       mono->by_subject_func = by_subject_func;
+}
+
+static int
+mono_lookup_install (MonoLookup *lookup, MonoBtlsX509LookupMono *mono)
+{
+       MonoLookupNode *node;
+
+       node = OPENSSL_malloc (sizeof (MonoLookupNode));
+       if (!node)
+               return 0;
+
+       memset (node, 0, sizeof (MonoLookupNode));
+       mono->lookup = lookup;
+       node->mono = mono;
+       node->next = lookup->nodes;
+       lookup->nodes = node;
+       return 1;
+}
+
+static int
+mono_lookup_uninstall (MonoBtlsX509LookupMono *mono)
+{
+       MonoLookupNode **ptr;
+
+       if (!mono->lookup)
+               return 0;
+
+       for (ptr = &mono->lookup->nodes; *ptr; ptr = &(*ptr)->next) {
+               if ((*ptr)->mono == mono) {
+                       *ptr = (*ptr)->next;
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
+MONO_API int
+mono_btls_x509_lookup_mono_free (MonoBtlsX509LookupMono *mono)
+{
+       mono->instance = NULL;
+       mono->by_subject_func = NULL;
+
+       if (mono->lookup) {
+               if (!mono_lookup_uninstall (mono))
+                       return 0;
+       }
+
+       mono->lookup = NULL;
+
+       OPENSSL_free (mono);
+       return 1;
+}
+
+static int
+mono_lookup_ctrl (X509_LOOKUP *ctx, int cmd, const char *argp, int64_t argl, char **ret)
+{
+       MonoLookup *lookup = (MonoLookup*)ctx->method_data;
+       MonoBtlsX509LookupMono *mono = (MonoBtlsX509LookupMono*)argp;
+
+       if (!lookup || cmd != MONO_BTLS_X509_L_MONO_ADD)
+               return 0;
+       if (!mono || mono->lookup)
+               return 0;
+
+       return mono_lookup_install (lookup, mono);
+}
+
+static int
+mono_lookup_new (X509_LOOKUP *ctx)
+{
+       MonoLookup *data;
+
+       data = OPENSSL_malloc (sizeof (MonoLookup));
+       if (!data)
+               return 0;
+
+       memset (data, 0, sizeof (MonoLookup));
+       ctx->method_data = (void *)data;
+       return 1;
+}
+
+static void
+mono_lookup_free (X509_LOOKUP *ctx)
+{
+       MonoLookup *lookup;
+       MonoLookupNode *ptr;
+
+       lookup = (MonoLookup *)ctx->method_data;
+       ctx->method_data = NULL;
+       if (!lookup)
+               return;
+
+       ptr = lookup->nodes;
+       lookup->nodes = NULL;
+
+       while (ptr) {
+               MonoLookupNode *node = ptr;
+               ptr = ptr->next;
+
+               if (node->mono)
+                       node->mono->lookup = NULL;
+               node->mono = NULL;
+               node->next = NULL;
+               OPENSSL_free (node);
+       }
+
+       OPENSSL_free (lookup);
+}
+
+static int
+mono_lookup_get_by_subject (X509_LOOKUP *ctx, int type, X509_NAME *name, X509_OBJECT *obj_ret)
+{
+       MonoLookup *lookup;
+       MonoBtlsX509Name *name_obj;
+       MonoLookupNode *node;
+       X509 *x509 = NULL;
+       int ret = 0;
+
+       lookup = (MonoLookup *)ctx->method_data;
+
+       if (!lookup || !lookup->nodes)
+               return 0;
+       if (type != X509_LU_X509)
+               return 0;
+
+       name_obj = mono_btls_x509_name_from_name (name);
+       x509 = NULL;
+
+       for (node = lookup->nodes; node; node = node->next) {
+               if (!node->mono || !node->mono->by_subject_func)
+                       continue;
+               ret = (* node->mono->by_subject_func) (node->mono->instance, name_obj, &x509);
+               if (ret)
+                       break;
+       }
+
+       mono_btls_x509_name_free (name_obj);
+
+       if (!ret) {
+               if (x509)
+                       X509_free(x509);
+               return 0;
+       }
+
+       obj_ret->type = X509_LU_X509;
+       obj_ret->data.x509 = x509;
+       return 1;
+}
+
+static X509_LOOKUP_METHOD mono_lookup_method = {
+       "Mono lookup method",
+       mono_lookup_new,                /* new */
+       mono_lookup_free,               /* free */
+       NULL,                           /* init */
+       NULL,                           /* shutdown */
+       mono_lookup_ctrl,               /* ctrl */
+       mono_lookup_get_by_subject,     /* get_by_subject */
+       NULL,                           /* get_by_issuer_serial */
+       NULL,                           /* get_by_fingerprint */
+       NULL,                           /* get_by_alias */
+};
+
+MONO_API X509_LOOKUP_METHOD *
+mono_btls_x509_lookup_mono_method (void)
+{
+       return &mono_lookup_method;
+}
+
+MONO_API int
+mono_btls_x509_lookup_add_mono (MonoBtlsX509Lookup *lookup, MonoBtlsX509LookupMono *mono)
+{
+       if (mono_btls_x509_lookup_get_type (lookup) != MONO_BTLS_X509_LOOKUP_TYPE_MONO)
+               return 0;
+       return X509_LOOKUP_ctrl (mono_btls_x509_lookup_peek_lookup (lookup),
+                                MONO_BTLS_X509_L_MONO_ADD,
+                                (void*)mono, 0, NULL);
+}
diff --git a/mono/btls/btls-x509-lookup-mono.h b/mono/btls/btls-x509-lookup-mono.h
new file mode 100644 (file)
index 0000000..06df552
--- /dev/null
@@ -0,0 +1,36 @@
+//
+//  btls-x509-lookup-mono.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/3/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_lookup_mono__
+#define __btls__btls_x509_lookup_mono__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509.h>
+#include <btls-x509-store.h>
+
+typedef int (* MonoBtlsX509LookupMono_BySubject) (const void *instance, MonoBtlsX509Name *name, X509 **ret);
+
+MonoBtlsX509LookupMono *
+mono_btls_x509_lookup_mono_new (void);
+
+int
+mono_btls_x509_lookup_mono_free (MonoBtlsX509LookupMono *mono);
+
+void
+mono_btls_x509_lookup_mono_init (MonoBtlsX509LookupMono *mono, const void *instance,
+                                MonoBtlsX509LookupMono_BySubject by_subject_func);
+
+int
+mono_btls_x509_lookup_add_mono (MonoBtlsX509Lookup *lookup, MonoBtlsX509LookupMono *mono);
+
+X509_LOOKUP_METHOD *
+mono_btls_x509_lookup_mono_method (void);
+
+#endif /* defined(__btls__btls_x509_lookup_mono__) */
+
diff --git a/mono/btls/btls-x509-lookup.c b/mono/btls/btls-x509-lookup.c
new file mode 100644 (file)
index 0000000..567d19c
--- /dev/null
@@ -0,0 +1,160 @@
+//
+//  btls-x509-lookup.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/6/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-lookup.h>
+#include <btls-x509-lookup-mono.h>
+
+struct MonoBtlsX509Lookup {
+       MonoBtlsX509LookupType type;
+       X509_LOOKUP *lookup;
+       int owns_lookup;
+       MonoBtlsX509Store *store;
+       CRYPTO_refcount_t references;
+};
+
+static X509_LOOKUP_METHOD *
+get_lookup_method (MonoBtlsX509LookupType type)
+{
+       switch (type) {
+       case MONO_BTLS_X509_LOOKUP_TYPE_FILE:
+               return X509_LOOKUP_file ();
+       case MONO_BTLS_X509_LOOKUP_TYPE_HASH_DIR:
+               return X509_LOOKUP_hash_dir ();
+       case MONO_BTLS_X509_LOOKUP_TYPE_MONO:
+               return mono_btls_x509_lookup_mono_method ();
+       default:
+               return NULL;
+       }
+}
+
+MONO_API MonoBtlsX509Lookup *
+mono_btls_x509_lookup_new (MonoBtlsX509Store *store, MonoBtlsX509LookupType type)
+{
+       MonoBtlsX509Lookup *lookup;
+       X509_LOOKUP *store_lookup;
+       X509_LOOKUP_METHOD *method;
+
+       method = get_lookup_method (type);
+       if (!method)
+               return NULL;
+
+       lookup = OPENSSL_malloc (sizeof(MonoBtlsX509Lookup));
+       if (!lookup)
+               return NULL;
+
+       store_lookup = X509_STORE_add_lookup (mono_btls_x509_store_peek_store (store), method);
+       if (!store_lookup)
+               return NULL;
+
+       memset (lookup, 0, sizeof(MonoBtlsX509Lookup));
+       // The X509_STORE owns the X509_LOOKUP.
+       lookup->store = mono_btls_x509_store_up_ref (store);
+       lookup->lookup = store_lookup;
+       lookup->owns_lookup = 0;
+       lookup->references = 1;
+       lookup->type = type;
+       return lookup;
+}
+
+MONO_API int
+mono_btls_x509_lookup_load_file (MonoBtlsX509Lookup *lookup, const char *file, MonoBtlsX509FileType type)
+{
+       return X509_LOOKUP_load_file (lookup->lookup, file, type);
+}
+
+MONO_API int
+mono_btls_x509_lookup_add_dir (MonoBtlsX509Lookup *lookup, const char *dir, MonoBtlsX509FileType type)
+{
+       return X509_LOOKUP_add_dir (lookup->lookup, dir, type);
+}
+
+MONO_API MonoBtlsX509Lookup *
+mono_btls_x509_lookup_up_ref (MonoBtlsX509Lookup *lookup)
+{
+       CRYPTO_refcount_inc (&lookup->references);
+       return lookup;
+}
+
+MONO_API int
+mono_btls_x509_lookup_free (MonoBtlsX509Lookup *lookup)
+{
+       if (!CRYPTO_refcount_dec_and_test_zero (&lookup->references))
+               return 0;
+
+       if (lookup->store) {
+               mono_btls_x509_store_free (lookup->store);
+               lookup->store = NULL;
+       }
+
+       if (lookup->lookup) {
+               if (lookup->owns_lookup)
+                       X509_LOOKUP_free (lookup->lookup);
+               lookup->lookup = NULL;
+       }
+
+       OPENSSL_free (lookup);
+       return 1;
+}
+
+MONO_API int
+mono_btls_x509_lookup_init (MonoBtlsX509Lookup *lookup)
+{
+       return X509_LOOKUP_init (lookup->lookup);
+}
+
+MONO_API int
+mono_btls_x509_lookup_shutdown (MonoBtlsX509Lookup *lookup)
+{
+       return X509_LOOKUP_shutdown (lookup->lookup);
+}
+
+MONO_API MonoBtlsX509LookupType
+mono_btls_x509_lookup_get_type (MonoBtlsX509Lookup *lookup)
+{
+       return lookup->type;
+}
+
+MONO_API X509_LOOKUP *
+mono_btls_x509_lookup_peek_lookup (MonoBtlsX509Lookup *lookup)
+{
+       return lookup->lookup;
+}
+
+MONO_API X509 *
+mono_btls_x509_lookup_by_subject (MonoBtlsX509Lookup *lookup, MonoBtlsX509Name *name)
+{
+       X509_OBJECT obj;
+       X509 *x509;
+       int ret;
+
+       ret = X509_LOOKUP_by_subject (lookup->lookup, X509_LU_X509, mono_btls_x509_name_peek_name (name), &obj);
+       if (ret != X509_LU_X509) {
+               X509_OBJECT_free_contents (&obj);
+               return NULL;
+       }
+
+       x509 = X509_up_ref (obj.data.x509);
+       return x509;
+}
+
+MONO_API X509 *
+mono_btls_x509_lookup_by_fingerprint (MonoBtlsX509Lookup *lookup, unsigned char *bytes, int len)
+{
+       X509_OBJECT obj;
+       X509 *x509;
+       int ret;
+
+       ret = X509_LOOKUP_by_fingerprint (lookup->lookup, X509_LU_X509, bytes, len, &obj);
+       if (ret != X509_LU_X509) {
+               X509_OBJECT_free_contents (&obj);
+               return NULL;
+       }
+
+       x509 = X509_up_ref (obj.data.x509);
+       return x509;
+}
diff --git a/mono/btls/btls-x509-lookup.h b/mono/btls/btls-x509-lookup.h
new file mode 100644 (file)
index 0000000..df3d37f
--- /dev/null
@@ -0,0 +1,58 @@
+//
+//  btls-x509-lookup.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/3/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_lookup__
+#define __btls__btls_x509_lookup__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509.h>
+#include <btls-x509-store.h>
+
+typedef enum {
+       MONO_BTLS_X509_LOOKUP_TYPE_UNKNOWN = 0,
+       MONO_BTLS_X509_LOOKUP_TYPE_FILE,
+       MONO_BTLS_X509_LOOKUP_TYPE_HASH_DIR,
+       MONO_BTLS_X509_LOOKUP_TYPE_MONO
+} MonoBtlsX509LookupType;
+
+MonoBtlsX509Lookup *
+mono_btls_x509_lookup_new (MonoBtlsX509Store *store, MonoBtlsX509LookupType type);
+
+int
+mono_btls_x509_lookup_load_file (MonoBtlsX509Lookup *lookup, const char *file, MonoBtlsX509FileType type);
+
+int
+mono_btls_x509_lookup_add_dir (MonoBtlsX509Lookup *lookup, const char *dir, MonoBtlsX509FileType type);
+
+MonoBtlsX509Lookup *
+mono_btls_x509_lookup_up_ref (MonoBtlsX509Lookup *lookup);
+
+int
+mono_btls_x509_lookup_free (MonoBtlsX509Lookup *lookup);
+
+int
+mono_btls_x509_lookup_init (MonoBtlsX509Lookup *lookup);
+
+MonoBtlsX509LookupType
+mono_btls_x509_lookup_get_type (MonoBtlsX509Lookup *lookup);
+
+X509_LOOKUP *
+mono_btls_x509_lookup_peek_lookup (MonoBtlsX509Lookup *lookup);
+
+int
+mono_btls_x509_lookup_shutdown (MonoBtlsX509Lookup *lookup);
+
+X509 *
+mono_btls_x509_lookup_by_subject (MonoBtlsX509Lookup *lookup, MonoBtlsX509Name *name);
+
+X509 *
+mono_btls_x509_lookup_by_fingerprint (MonoBtlsX509Lookup *lookup, unsigned char *bytes, int len);
+
+#endif /* defined(__btls__btls_x509_lookup__) */
+
diff --git a/mono/btls/btls-x509-name.c b/mono/btls/btls-x509-name.c
new file mode 100644 (file)
index 0000000..7f98758
--- /dev/null
@@ -0,0 +1,296 @@
+//
+//  btls-x509-name.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/5/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-name.h>
+
+struct MonoBtlsX509Name {
+       int owns;
+       X509_NAME *name;
+};
+
+MONO_API MonoBtlsX509Name *
+mono_btls_x509_name_from_name (X509_NAME *xn)
+{
+       MonoBtlsX509Name *name;
+
+       name = OPENSSL_malloc (sizeof (MonoBtlsX509Name));
+       if (!name)
+               return NULL;
+
+       memset(name, 0, sizeof(MonoBtlsX509Name));
+       name->name = xn;
+       return name;
+}
+
+MONO_API MonoBtlsX509Name *
+mono_btls_x509_name_copy (X509_NAME *xn)
+{
+       MonoBtlsX509Name *name;
+
+       name = OPENSSL_malloc (sizeof (MonoBtlsX509Name));
+       if (!name)
+               return NULL;
+
+       memset(name, 0, sizeof(MonoBtlsX509Name));
+       name->name = X509_NAME_dup(xn);
+       name->owns = 1;
+       return name;
+}
+
+MONO_API void
+mono_btls_x509_name_free (MonoBtlsX509Name *name)
+{
+       if (name->owns) {
+               if (name->name) {
+                       X509_NAME_free(name->name);
+                       name->name = NULL;
+               }
+       }
+       OPENSSL_free(name);
+}
+
+MONO_API X509_NAME *
+mono_btls_x509_name_peek_name (MonoBtlsX509Name *name)
+{
+       return name->name;
+}
+
+MONO_API int
+mono_btls_x509_name_print_bio (MonoBtlsX509Name *name, BIO *bio)
+{
+       return X509_NAME_print_ex (bio, name->name, 0, ASN1_STRFLGS_RFC2253 | XN_FLAG_FN_SN | XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_DN_REV);
+}
+
+MONO_API int
+mono_btls_x509_name_get_raw_data (MonoBtlsX509Name *name, void **buffer, int use_canon_enc)
+{
+       int len;
+       void *ptr;
+
+       if (use_canon_enc) {
+               // make sure canon_enc is initialized.
+               i2d_X509_NAME (name->name, NULL);
+
+               len = name->name->canon_enclen;
+               ptr = name->name->canon_enc;
+       } else {
+               len = (int)name->name->bytes->length;
+               ptr = name->name->bytes->data;
+       }
+
+       *buffer = OPENSSL_malloc (len);
+       if (!*buffer)
+               return 0;
+
+       memcpy (*buffer, ptr, len);
+       return len;
+}
+
+MONO_API MonoBtlsX509Name *
+mono_btls_x509_name_from_data (const void *data, int len, int use_canon_enc)
+{
+       MonoBtlsX509Name *name;
+       uint8_t *buf;
+       const unsigned char *ptr;
+       X509_NAME *ret;
+
+       name = OPENSSL_malloc (sizeof (MonoBtlsX509Name));
+       if (!name)
+               return NULL;
+
+       memset (name, 0, sizeof(MonoBtlsX509Name));
+       name->owns = 1;
+
+       name->name = X509_NAME_new ();
+       if (!name->name) {
+               OPENSSL_free (name);
+               return NULL;
+       }
+
+       if (use_canon_enc) {
+               CBB cbb, contents;
+               size_t buf_len;
+
+               // re-add ASN1 SEQUENCE header.
+               CBB_init(&cbb, 0);
+               if (!CBB_add_asn1(&cbb, &contents, 0x30) ||
+                   !CBB_add_bytes(&contents, data, len) ||
+                   !CBB_finish(&cbb, &buf, &buf_len)) {
+                       CBB_cleanup (&cbb);
+                       mono_btls_x509_name_free (name);
+                       return NULL;
+               }
+
+               ptr = buf;
+               len = (int)buf_len;
+       } else {
+               ptr = data;
+               buf = NULL;
+       }
+
+       ret = d2i_X509_NAME (&name->name, &ptr, len);
+
+       if (buf)
+               OPENSSL_free (buf);
+
+       if (ret != name->name) {
+               mono_btls_x509_name_free (name);
+               return NULL;
+       }
+
+       return name;
+}
+
+MONO_API int
+mono_btls_x509_name_print_string (MonoBtlsX509Name *name, char *buffer, int size)
+{
+       *buffer = 0;
+       return X509_NAME_oneline (name->name, buffer, size) != NULL;
+}
+
+MONO_API int64_t
+mono_btls_x509_name_hash (MonoBtlsX509Name *name)
+{
+       return X509_NAME_hash (name->name);
+}
+
+MONO_API int64_t
+mono_btls_x509_name_hash_old (MonoBtlsX509Name *name)
+{
+       return X509_NAME_hash_old (name->name);
+}
+
+MONO_API int
+mono_btls_x509_name_get_entry_count (MonoBtlsX509Name *name)
+{
+       return X509_NAME_entry_count (name->name);
+}
+
+static MonoBtlsX509NameEntryType
+nid2mono (int nid)
+{
+       switch (nid) {
+       case NID_countryName:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_COUNTRY_NAME;
+       case NID_organizationName:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_ORGANIZATION_NAME;
+       case NID_organizationalUnitName:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_ORGANIZATIONAL_UNIT_NAME;
+       case NID_commonName:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_COMMON_NAME;
+       case NID_localityName:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_LOCALITY_NAME;
+       case NID_stateOrProvinceName:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_STATE_OR_PROVINCE_NAME;
+       case NID_streetAddress:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_STREET_ADDRESS;
+       case NID_serialNumber:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_SERIAL_NUMBER;
+       case NID_domainComponent:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_DOMAIN_COMPONENT;
+       case NID_userId:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_USER_ID;
+       case NID_dnQualifier:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_DN_QUALIFIER;
+       case NID_title:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_TITLE;
+       case NID_surname:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_SURNAME;
+       case NID_givenName:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_GIVEN_NAME;
+       case NID_initials:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_INITIAL;
+       default:
+               return MONO_BTLS_X509_NAME_ENTRY_TYPE_UNKNOWN;
+       }
+}
+
+MONO_API MonoBtlsX509NameEntryType
+mono_btls_x509_name_get_entry_type (MonoBtlsX509Name *name, int index)
+{
+       X509_NAME_ENTRY *entry;
+       ASN1_OBJECT *obj;
+
+       if (index >= X509_NAME_entry_count (name->name))
+               return -1;
+
+       entry = X509_NAME_get_entry (name->name, index);
+       if (!entry)
+               return -1;
+
+       obj = X509_NAME_ENTRY_get_object (entry);
+       if (!obj)
+               return -1;
+
+       return nid2mono (OBJ_obj2nid (obj));
+}
+
+MONO_API int
+mono_btls_x509_name_get_entry_oid (MonoBtlsX509Name *name, int index, char *buffer, int size)
+{
+       X509_NAME_ENTRY *entry;
+       ASN1_OBJECT *obj;
+
+       if (index >= X509_NAME_entry_count (name->name))
+               return 0;
+
+       entry = X509_NAME_get_entry (name->name, index);
+       if (!entry)
+               return 0;
+
+       obj = X509_NAME_ENTRY_get_object (entry);
+       if (!obj)
+               return 0;
+
+       return OBJ_obj2txt (buffer, size, obj, 1);
+}
+
+MONO_API int
+mono_btls_x509_name_get_entry_oid_data (MonoBtlsX509Name *name, int index, const void **data)
+{
+       X509_NAME_ENTRY *entry;
+       ASN1_OBJECT *obj;
+
+       if (index >= X509_NAME_entry_count (name->name))
+               return -1;
+
+       entry = X509_NAME_get_entry (name->name, index);
+       if (!entry)
+               return -1;
+
+       obj = X509_NAME_ENTRY_get_object (entry);
+       if (!obj)
+               return -1;
+
+       *data = obj->data;
+       return obj->length;
+}
+
+MONO_API int
+mono_btls_x509_name_get_entry_value (MonoBtlsX509Name *name, int index, int *tag, unsigned char **str)
+{
+       X509_NAME_ENTRY *entry;
+       ASN1_STRING *data;
+
+       *str = NULL;
+       *tag = 0;
+
+       if (index >= X509_NAME_entry_count (name->name))
+               return 0;
+
+       entry = X509_NAME_get_entry (name->name, index);
+       if (!entry)
+               return 0;
+
+       data = X509_NAME_ENTRY_get_data (entry);
+       if (!data)
+               return 0;
+
+       *tag = data->type;
+       return ASN1_STRING_to_UTF8 (str, data);
+}
diff --git a/mono/btls/btls-x509-name.h b/mono/btls/btls-x509-name.h
new file mode 100644 (file)
index 0000000..9d43bc6
--- /dev/null
@@ -0,0 +1,80 @@
+//
+//  btls-x509-name.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/5/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_name__
+#define __btls__btls_x509_name__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+
+typedef enum {
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_UNKNOWN = 0,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_COUNTRY_NAME,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_ORGANIZATION_NAME,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_ORGANIZATIONAL_UNIT_NAME,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_COMMON_NAME,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_LOCALITY_NAME,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_STATE_OR_PROVINCE_NAME,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_STREET_ADDRESS,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_SERIAL_NUMBER,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_DOMAIN_COMPONENT,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_USER_ID,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_EMAIL,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_DN_QUALIFIER,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_TITLE,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_SURNAME,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_GIVEN_NAME,
+       MONO_BTLS_X509_NAME_ENTRY_TYPE_INITIAL
+} MonoBtlsX509NameEntryType;
+
+MonoBtlsX509Name *
+mono_btls_x509_name_from_name (X509_NAME *name);
+
+MonoBtlsX509Name *
+mono_btls_x509_name_copy (X509_NAME *xn);
+
+void
+mono_btls_x509_name_free (MonoBtlsX509Name *name);
+
+X509_NAME *
+mono_btls_x509_name_peek_name (MonoBtlsX509Name *name);
+
+MonoBtlsX509Name *
+mono_btls_x509_name_from_data (const void *data, int len, int use_canon_enc);
+
+int
+mono_btls_x509_name_print_bio (MonoBtlsX509Name *name, BIO *bio);
+
+int
+mono_btls_x509_name_print_string (MonoBtlsX509Name *name, char *buffer, int size);
+
+int
+mono_btls_x509_name_get_raw_data (MonoBtlsX509Name *name, void **buffer, int use_canon_enc);
+
+int64_t
+mono_btls_x509_name_hash (MonoBtlsX509Name *name);
+
+int64_t
+mono_btls_x509_name_hash_old (MonoBtlsX509Name *name);
+
+int
+mono_btls_x509_name_get_entry_count (MonoBtlsX509Name *name);
+
+MonoBtlsX509NameEntryType
+mono_btls_x509_name_get_entry_type (MonoBtlsX509Name *name, int index);
+
+int
+mono_btls_x509_name_get_entry_oid (MonoBtlsX509Name *name, int index, char *buffer, int size);
+
+int
+mono_btls_x509_name_get_entry_oid_data (MonoBtlsX509Name *name, int index, const void **data);
+
+int
+mono_btls_x509_name_get_entry_value (MonoBtlsX509Name *name, int index, int *tag, unsigned char **str);
+
+#endif /* __btls__btls_x509_name__ */
diff --git a/mono/btls/btls-x509-revoked.c b/mono/btls/btls-x509-revoked.c
new file mode 100644 (file)
index 0000000..bf9af79
--- /dev/null
@@ -0,0 +1,72 @@
+//
+//  btls-x509-revoked.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/23/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-revoked.h>
+
+struct MonoBtlsX509Revoked {
+       MonoBtlsX509Crl *owner;
+       X509_REVOKED *revoked;
+};
+
+MONO_API MonoBtlsX509Revoked *
+mono_btls_x509_revoked_new (MonoBtlsX509Crl *owner, X509_REVOKED *revoked)
+{
+       MonoBtlsX509Revoked *instance;
+
+       instance = OPENSSL_malloc (sizeof (MonoBtlsX509Revoked));
+       memset (instance, 0, sizeof (MonoBtlsX509Revoked));
+
+       instance->owner = mono_btls_x509_crl_ref (owner);
+       instance->revoked = revoked;
+       return instance;
+}
+
+MONO_API void
+mono_btls_x509_revoked_free (MonoBtlsX509Revoked *revoked)
+{
+       mono_btls_x509_crl_free (revoked->owner);
+       OPENSSL_free (revoked);
+}
+
+MONO_API int
+mono_btls_x509_revoked_get_serial_number (MonoBtlsX509Revoked *revoked, char *buffer, int size)
+{
+       ASN1_INTEGER *serial;
+
+       serial = revoked->revoked->serialNumber;
+       if (serial->length == 0 || serial->length+1 > size)
+               return 0;
+
+       memcpy (buffer, serial->data, serial->length);
+       return serial->length;
+}
+
+MONO_API int64_t
+mono_btls_x509_revoked_get_revocation_date (MonoBtlsX509Revoked *revoked)
+{
+       ASN1_TIME *date;
+
+       date = revoked->revoked->revocationDate;
+       if (!date)
+               return 0;
+
+       return mono_btls_util_asn1_time_to_ticks (date);
+}
+
+MONO_API int
+mono_btls_x509_revoked_get_reason (MonoBtlsX509Revoked *revoked)
+{
+       return revoked->revoked->reason;
+}
+
+MONO_API int
+mono_btls_x509_revoked_get_sequence (MonoBtlsX509Revoked *revoked)
+{
+       return revoked->revoked->sequence;
+}
+
diff --git a/mono/btls/btls-x509-revoked.h b/mono/btls/btls-x509-revoked.h
new file mode 100644 (file)
index 0000000..592fc93
--- /dev/null
@@ -0,0 +1,34 @@
+//
+//  btls-x509-revoked.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/23/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_revoked__
+#define __btls__btls_x509_revoked__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509-crl.h>
+
+MonoBtlsX509Revoked *
+mono_btls_x509_revoked_new (MonoBtlsX509Crl *owner, X509_REVOKED *revoked);
+
+void
+mono_btls_x509_revoked_free (MonoBtlsX509Revoked *revoked);
+
+int
+mono_btls_x509_revoked_get_serial_number (MonoBtlsX509Revoked *revoked, char *buffer, int size);
+
+int64_t
+mono_btls_x509_revoked_get_revocation_date (MonoBtlsX509Revoked *revoked);
+
+int
+mono_btls_x509_revoked_get_reason (MonoBtlsX509Revoked *revoked);
+
+int
+mono_btls_x509_revoked_get_sequence (MonoBtlsX509Revoked *revoked);
+
+#endif /* __btls__btls_x509_revoked__ */
diff --git a/mono/btls/btls-x509-store-ctx.c b/mono/btls/btls-x509-store-ctx.c
new file mode 100644 (file)
index 0000000..8bbb732
--- /dev/null
@@ -0,0 +1,217 @@
+//
+//  btls-x509-store-ctx.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/5/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-store-ctx.h>
+
+struct MonoBtlsX509StoreCtx {
+       int owns;
+       X509_STORE_CTX *ctx;
+       CRYPTO_refcount_t references;
+       MonoBtlsX509Store *store;
+       MonoBtlsX509Chain *chain;
+};
+
+MONO_API MonoBtlsX509StoreCtx *
+mono_btls_x509_store_ctx_from_ptr (X509_STORE_CTX *ptr)
+{
+       MonoBtlsX509StoreCtx *ctx;
+
+       ctx = OPENSSL_malloc (sizeof(MonoBtlsX509StoreCtx));
+       if (!ctx)
+               return NULL;
+
+       memset (ctx, 0, sizeof (MonoBtlsX509StoreCtx));
+       ctx->ctx = ptr;
+       ctx->references = 1;
+       return ctx;
+}
+
+MONO_API MonoBtlsX509StoreCtx *
+mono_btls_x509_store_ctx_new (void)
+{
+       MonoBtlsX509StoreCtx *ctx;
+
+       ctx = OPENSSL_malloc (sizeof(MonoBtlsX509StoreCtx));
+       if (!ctx)
+               return NULL;
+
+       memset (ctx, 0, sizeof (MonoBtlsX509StoreCtx));
+       ctx->ctx = X509_STORE_CTX_new ();
+       ctx->references = 1;
+       ctx->owns = 1;
+       return ctx;
+}
+
+MONO_API MonoBtlsX509StoreCtx *
+mono_btls_x509_store_ctx_up_ref (MonoBtlsX509StoreCtx *ctx)
+{
+       CRYPTO_refcount_inc (&ctx->references);
+       return ctx;
+}
+
+MONO_API int
+mono_btls_x509_store_ctx_free (MonoBtlsX509StoreCtx *ctx)
+{
+       if (!CRYPTO_refcount_dec_and_test_zero (&ctx->references))
+               return 0;
+
+       if (ctx->owns) {
+               X509_STORE_CTX_cleanup (ctx->ctx);
+               X509_STORE_CTX_free (ctx->ctx);
+               ctx->owns = 0;
+       }
+       if (ctx->store) {
+               mono_btls_x509_store_free (ctx->store);
+               ctx->store = NULL;
+       }
+       if (ctx->chain) {
+               mono_btls_x509_chain_free (ctx->chain);
+               ctx->chain = NULL;
+       }
+       OPENSSL_free (ctx);
+       return 1;
+}
+
+MONO_API int
+mono_btls_x509_store_ctx_get_error (MonoBtlsX509StoreCtx *ctx, const char **error_string)
+{
+       int error;
+
+       error = X509_STORE_CTX_get_error (ctx->ctx);
+       if (error_string)
+               *error_string = X509_verify_cert_error_string (error);
+       return error;
+}
+
+MONO_API int
+mono_btls_x509_store_ctx_get_error_depth (MonoBtlsX509StoreCtx *ctx)
+{
+       return X509_STORE_CTX_get_error_depth (ctx->ctx);
+}
+
+MONO_API MonoBtlsX509Chain *
+mono_btls_x509_store_ctx_get_chain (MonoBtlsX509StoreCtx *ctx)
+{
+       STACK_OF(X509) *certs;
+
+       certs = X509_STORE_CTX_get_chain (ctx->ctx);
+       if (!certs)
+               return NULL;
+
+       return mono_btls_x509_chain_from_certs (certs);
+}
+
+MONO_API MonoBtlsX509Chain *
+mono_btls_x509_store_ctx_get_untrusted (MonoBtlsX509StoreCtx *ctx)
+{
+       STACK_OF(X509) *untrusted;
+
+       /*
+        * Unfortunately, there is no accessor function for this.
+        *
+        * This is the set of certificate that's passed in by
+        * X509_STORE_CTX_init() and X509_STORE_CTX_set_chain().
+        */
+       untrusted = ctx->ctx->untrusted;
+       if (!untrusted)
+               return NULL;
+
+       return mono_btls_x509_chain_from_certs (untrusted);
+}
+
+MONO_API int
+mono_btls_x509_store_ctx_init (MonoBtlsX509StoreCtx *ctx,
+                                  MonoBtlsX509Store *store, MonoBtlsX509Chain *chain)
+{
+       STACK_OF(X509) *certs;
+       X509 *leaf;
+       int ret;
+
+       if (ctx->store)
+               return 0;
+
+       certs = mono_btls_x509_chain_peek_certs (chain);
+       if (!certs || !sk_X509_num (certs))
+               return 0;
+
+       ctx->store = mono_btls_x509_store_up_ref(store);
+       ctx->chain = mono_btls_x509_chain_up_ref(chain);
+
+       leaf = sk_X509_value (certs, 0);
+       ret = X509_STORE_CTX_init (ctx->ctx, mono_btls_x509_store_peek_store (store), leaf, certs);
+       if (ret != 1)
+               return ret;
+
+       X509_STORE_CTX_set_app_data (ctx->ctx, ctx);
+       return 1;
+}
+
+MONO_API int
+mono_btls_x509_store_ctx_set_param (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509VerifyParam *param)
+{
+       return X509_VERIFY_PARAM_set1 (X509_STORE_CTX_get0_param (ctx->ctx), mono_btls_x509_verify_param_peek_param (param));
+}
+
+MONO_API int
+mono_btls_x509_store_ctx_verify_cert (MonoBtlsX509StoreCtx *ctx)
+{
+       return X509_verify_cert (ctx->ctx);
+}
+
+MONO_API X509 *
+mono_btls_x509_store_ctx_get_by_subject (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509Name *name)
+{
+       X509_OBJECT obj;
+       X509 *x509;
+       int ret;
+
+       ret = X509_STORE_get_by_subject (ctx->ctx, X509_LU_X509, mono_btls_x509_name_peek_name (name), &obj);
+       if (ret != X509_LU_X509) {
+               X509_OBJECT_free_contents (&obj);
+               return NULL;
+       }
+
+       x509 = X509_up_ref (obj.data.x509);
+       return x509;
+}
+
+MONO_API X509 *
+mono_btls_x509_store_ctx_get_current_cert (MonoBtlsX509StoreCtx *ctx)
+{
+       X509 *x509 = X509_STORE_CTX_get_current_cert (ctx->ctx);
+       if (!x509)
+               return NULL;
+       return X509_up_ref (x509);
+}
+
+MONO_API X509 *
+mono_btls_x509_store_ctx_get_current_issuer (MonoBtlsX509StoreCtx *ctx)
+{
+       X509 *x509 = X509_STORE_CTX_get0_current_issuer (ctx->ctx);
+       if (!x509)
+               return NULL;
+       return X509_up_ref (x509);
+}
+
+MONO_API MonoBtlsX509VerifyParam *
+mono_btls_x509_store_ctx_get_verify_param (MonoBtlsX509StoreCtx *ctx)
+{
+       X509_VERIFY_PARAM *param;
+
+       param = X509_STORE_CTX_get0_param (ctx->ctx);
+       if (!param)
+               return NULL;
+
+       return mono_btls_x509_verify_param_from_store_ctx (ctx, param);
+}
+
+MONO_API int
+mono_btls_x509_store_ctx_get_foo (MonoBtlsX509StoreCtx *ctx)
+{
+       return 0;
+}
diff --git a/mono/btls/btls-x509-store-ctx.h b/mono/btls/btls-x509-store-ctx.h
new file mode 100644 (file)
index 0000000..188092e
--- /dev/null
@@ -0,0 +1,66 @@
+//
+//  btls-x509-store-ctx.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/3/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_store_ctx__
+#define __btls__btls_x509_store_ctx__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509-chain.h>
+#include <btls-x509-name.h>
+#include <btls-x509-store.h>
+#include <btls-x509-verify-param.h>
+
+MonoBtlsX509StoreCtx *
+mono_btls_x509_store_ctx_from_ptr (X509_STORE_CTX *ptr);
+
+MonoBtlsX509StoreCtx *
+mono_btls_x509_store_ctx_new (void);
+
+MonoBtlsX509StoreCtx *
+mono_btls_x509_store_ctx_up_ref (MonoBtlsX509StoreCtx *ctx);
+
+int
+mono_btls_x509_store_ctx_free (MonoBtlsX509StoreCtx *ctx);
+
+int
+mono_btls_x509_store_ctx_get_error (MonoBtlsX509StoreCtx *ctx, const char **error_string);
+
+int
+mono_btls_x509_store_ctx_get_error_depth (MonoBtlsX509StoreCtx *ctx);
+
+MonoBtlsX509Chain *
+mono_btls_x509_store_ctx_get_chain (MonoBtlsX509StoreCtx *ctx);
+
+X509 *
+mono_btls_x509_store_ctx_get_current_cert (MonoBtlsX509StoreCtx *ctx);
+
+X509 *
+mono_btls_x509_store_ctx_get_current_issuer (MonoBtlsX509StoreCtx *ctx);
+
+int
+mono_btls_x509_store_ctx_init (MonoBtlsX509StoreCtx *ctx,
+                                  MonoBtlsX509Store *store, MonoBtlsX509Chain *chain);
+
+int
+mono_btls_x509_store_ctx_set_param (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509VerifyParam *param);
+
+X509 *
+mono_btls_x509_store_ctx_get_by_subject (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509Name *name);
+
+int
+mono_btls_x509_store_ctx_verify_cert (MonoBtlsX509StoreCtx *ctx);
+
+MonoBtlsX509VerifyParam *
+mono_btls_x509_store_ctx_get_verify_param (MonoBtlsX509StoreCtx *ctx);
+
+MonoBtlsX509Chain *
+mono_btls_x509_store_ctx_get_untrusted (MonoBtlsX509StoreCtx *ctx);
+
+#endif /* defined(__btls__btls_x509_store_ctx__) */
+
diff --git a/mono/btls/btls-x509-store.c b/mono/btls/btls-x509-store.c
new file mode 100644 (file)
index 0000000..3534739
--- /dev/null
@@ -0,0 +1,110 @@
+//
+//  btls-x509-store.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/3/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-store.h>
+
+struct MonoBtlsX509Store {
+       X509_STORE *store;
+       CRYPTO_refcount_t references;
+};
+
+MONO_API MonoBtlsX509Store *
+mono_btls_x509_store_from_store (X509_STORE *ctx)
+{
+       MonoBtlsX509Store *store;
+
+       store = OPENSSL_malloc (sizeof(MonoBtlsX509Store));
+       if (!store)
+               return NULL;
+
+       memset (store, 0, sizeof(MonoBtlsX509Store));
+       store->store = ctx;
+       CRYPTO_refcount_inc (&store->store->references);
+       store->references = 1;
+       return store;
+}
+
+MONO_API MonoBtlsX509Store *
+mono_btls_x509_store_from_ctx (X509_STORE_CTX *ctx)
+{
+       return mono_btls_x509_store_from_store (ctx->ctx);
+}
+
+MONO_API MonoBtlsX509Store *
+mono_btls_x509_store_new (void)
+{
+       MonoBtlsX509Store *store;
+
+       store = OPENSSL_malloc (sizeof(MonoBtlsX509Store));
+       if (!store)
+               return NULL;
+
+       memset (store, 0, sizeof(MonoBtlsX509Store));
+       store->store = X509_STORE_new ();
+       store->references = 1;
+       return store;
+}
+
+MONO_API X509_STORE *
+mono_btls_x509_store_peek_store (MonoBtlsX509Store *store)
+{
+       return store->store;
+}
+
+MONO_API MonoBtlsX509Store *
+mono_btls_x509_store_from_ssl_ctx (MonoBtlsSslCtx *ctx)
+{
+       X509_STORE *store = mono_btls_ssl_ctx_peek_store (ctx);
+       return mono_btls_x509_store_from_store (store);
+}
+
+MONO_API int
+mono_btls_x509_store_free (MonoBtlsX509Store *store)
+{
+       if (!CRYPTO_refcount_dec_and_test_zero(&store->references))
+               return 0;
+
+       if (store->store) {
+               X509_STORE_free (store->store);
+               store->store = NULL;
+       }
+       OPENSSL_free (store);
+       return 1;
+}
+
+MONO_API MonoBtlsX509Store *
+mono_btls_x509_store_up_ref (MonoBtlsX509Store *store)
+{
+       CRYPTO_refcount_inc (&store->references);
+       return store;
+}
+
+MONO_API int
+mono_btls_x509_store_add_cert (MonoBtlsX509Store *store, X509 *cert)
+{
+       return X509_STORE_add_cert (store->store, cert);
+}
+
+MONO_API int
+mono_btls_x509_store_load_locations (MonoBtlsX509Store *store, const char *file, const char *path)
+{
+       return X509_STORE_load_locations (store->store, file, path);
+}
+
+MONO_API int
+mono_btls_x509_store_set_default_paths (MonoBtlsX509Store *store)
+{
+       return X509_STORE_set_default_paths (store->store);
+}
+
+MONO_API int
+mono_btls_x509_store_get_count (MonoBtlsX509Store *store)
+{
+       return (int)sk_X509_OBJECT_num (store->store->objs);
+}
+
diff --git a/mono/btls/btls-x509-store.h b/mono/btls/btls-x509-store.h
new file mode 100644 (file)
index 0000000..67ffe00
--- /dev/null
@@ -0,0 +1,46 @@
+//
+//  btls-x509-store.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/3/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_store__
+#define __btls__btls_x509_store__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+
+MonoBtlsX509Store *
+mono_btls_x509_store_new (void);
+
+MonoBtlsX509Store *
+mono_btls_x509_store_from_ctx (X509_STORE_CTX *ctx);
+
+MonoBtlsX509Store *
+mono_btls_x509_store_from_ssl_ctx (MonoBtlsSslCtx *ctx);
+
+MonoBtlsX509Store *
+mono_btls_x509_store_up_ref (MonoBtlsX509Store *store);
+
+int
+mono_btls_x509_store_free (MonoBtlsX509Store *store);
+
+X509_STORE *
+mono_btls_x509_store_peek_store (MonoBtlsX509Store *store);
+
+int
+mono_btls_x509_store_add_cert (MonoBtlsX509Store *store, X509 *cert);
+
+int
+mono_btls_x509_store_load_locations (MonoBtlsX509Store *store, const char *file, const char *path);
+
+int
+mono_btls_x509_store_set_default_paths (MonoBtlsX509Store *store);
+
+int
+mono_btls_x509_store_get_count (MonoBtlsX509Store *store);
+
+#endif /* defined(__btls__btls_x509_store__) */
+
diff --git a/mono/btls/btls-x509-verify-param.c b/mono/btls/btls-x509-verify-param.c
new file mode 100644 (file)
index 0000000..24be3da
--- /dev/null
@@ -0,0 +1,221 @@
+//
+//  btls-x509-verify-param.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/5/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#include <btls-x509-verify-param.h>
+#include <btls-x509-store-ctx.h>
+
+struct MonoBtlsX509VerifyParam {
+       int owns;
+       MonoBtlsX509StoreCtx *owner;
+       X509_VERIFY_PARAM *param;
+};
+
+MONO_API MonoBtlsX509VerifyParam *
+mono_btls_x509_verify_param_new (void)
+{
+       MonoBtlsX509VerifyParam *param;
+
+       param = OPENSSL_malloc (sizeof(MonoBtlsX509VerifyParam));
+       if (!param)
+               return NULL;
+       memset (param, 0, sizeof (MonoBtlsX509VerifyParam));
+       param->param = X509_VERIFY_PARAM_new();
+       param->owns = 1;
+       return param;
+}
+
+MONO_API MonoBtlsX509VerifyParam *
+mono_btls_x509_verify_param_from_store_ctx (MonoBtlsX509StoreCtx *ctx, X509_VERIFY_PARAM *param)
+{
+       MonoBtlsX509VerifyParam *instance;
+
+       instance = OPENSSL_malloc (sizeof(MonoBtlsX509VerifyParam));
+       if (!instance)
+               return NULL;
+       memset (instance, 0, sizeof (MonoBtlsX509VerifyParam));
+       instance->param = param;
+       instance->owner = mono_btls_x509_store_ctx_up_ref (ctx);
+       return instance;
+}
+
+MONO_API MonoBtlsX509VerifyParam *
+mono_btls_x509_verify_param_copy (const MonoBtlsX509VerifyParam *from)
+{
+       MonoBtlsX509VerifyParam *param;
+
+       param = mono_btls_x509_verify_param_new ();
+       if (!param)
+               return NULL;
+
+       X509_VERIFY_PARAM_set1 (param->param, from->param);
+       return param;
+}
+
+MONO_API const X509_VERIFY_PARAM *
+mono_btls_x509_verify_param_peek_param (const MonoBtlsX509VerifyParam *param)
+{
+       return param->param;
+}
+
+MONO_API int
+mono_btls_x509_verify_param_can_modify (MonoBtlsX509VerifyParam *param)
+{
+       return param->owns;
+}
+
+MONO_API MonoBtlsX509VerifyParam *
+mono_btls_x509_verify_param_lookup (const char *name)
+{
+       MonoBtlsX509VerifyParam *param;
+       const X509_VERIFY_PARAM *p;
+
+       p = X509_VERIFY_PARAM_lookup(name);
+       if (!p)
+               return NULL;
+
+       param = OPENSSL_malloc (sizeof(MonoBtlsX509VerifyParam));
+       if (!param)
+               return NULL;
+       memset (param, 0, sizeof (MonoBtlsX509VerifyParam));
+       param->param = (X509_VERIFY_PARAM *)p;
+       return param;
+}
+
+MONO_API void
+mono_btls_x509_verify_param_free (MonoBtlsX509VerifyParam *param)
+{
+       if (param->owns) {
+               if (param->param) {
+                       X509_VERIFY_PARAM_free (param->param);
+                       param->param = NULL;
+               }
+       }
+       if (param->owner) {
+               mono_btls_x509_store_ctx_free (param->owner);
+               param->owner = NULL;
+       }
+       OPENSSL_free (param);
+}
+
+MONO_API int
+mono_btls_x509_verify_param_set_name (MonoBtlsX509VerifyParam *param, const char *name)
+{
+       if (!param->owns)
+               return -1;
+       return X509_VERIFY_PARAM_set1_name (param->param, name);
+}
+
+MONO_API int
+mono_btls_x509_verify_param_set_host (MonoBtlsX509VerifyParam *param, const char *host, int namelen)
+{
+       if (!param->owns)
+               return -1;
+       return X509_VERIFY_PARAM_set1_host (param->param, host, namelen);
+}
+
+MONO_API int
+mono_btls_x509_verify_param_add_host (MonoBtlsX509VerifyParam *param, const char *host, int namelen)
+{
+       if (!param->owns)
+               return -1;
+       return X509_VERIFY_PARAM_set1_host (param->param, host, namelen);
+}
+
+MONO_API uint64_t
+mono_btls_x509_verify_param_get_flags (MonoBtlsX509VerifyParam *param)
+{
+       return X509_VERIFY_PARAM_get_flags (param->param);
+}
+
+MONO_API int
+mono_btls_x509_verify_param_set_flags (MonoBtlsX509VerifyParam *param, uint64_t flags)
+{
+       if (!param->owns)
+               return -1;
+       return X509_VERIFY_PARAM_set_flags (param->param, flags);
+}
+
+MONO_API MonoBtlsX509VerifyFlags
+mono_btls_x509_verify_param_get_mono_flags (MonoBtlsX509VerifyParam *param)
+{
+       MonoBtlsX509VerifyFlags current;
+       uint64_t flags;
+
+       if (!param->owns)
+               return -1;
+
+       current = 0;
+       flags = X509_VERIFY_PARAM_get_flags (param->param);
+
+       if (flags & X509_V_FLAG_CRL_CHECK)
+               current |= MONO_BTLS_X509_VERIFY_FLAGS_CRL_CHECK;
+       if (flags & X509_V_FLAG_CRL_CHECK_ALL)
+               current |= MONO_BTLS_X509_VERIFY_FLAGS_CRL_CHECK_ALL;
+       if (flags & X509_V_FLAG_X509_STRICT)
+               current |= MONO_BTLS_X509_VERIFY_FLAGS_X509_STRICT;
+
+       return current;
+}
+
+MONO_API int
+mono_btls_x509_verify_param_set_mono_flags (MonoBtlsX509VerifyParam *param, MonoBtlsX509VerifyFlags flags)
+{
+       uint64_t current;
+
+       if (!param->owns)
+               return -1;
+
+       current = X509_VERIFY_PARAM_get_flags (param->param);
+       if (flags & MONO_BTLS_X509_VERIFY_FLAGS_CRL_CHECK)
+               current |= X509_V_FLAG_CRL_CHECK;
+       if (flags & MONO_BTLS_X509_VERIFY_FLAGS_CRL_CHECK_ALL)
+               current |= X509_V_FLAG_CRL_CHECK_ALL;
+       if (flags & MONO_BTLS_X509_VERIFY_FLAGS_X509_STRICT)
+               current |= X509_V_FLAG_X509_STRICT;
+
+       return X509_VERIFY_PARAM_set_flags (param->param, current);
+}
+
+MONO_API int
+mono_btls_x509_verify_param_set_purpose (MonoBtlsX509VerifyParam *param, MonoBtlsX509Purpose purpose)
+{
+       if (!param->owns)
+               return -1;
+       return X509_VERIFY_PARAM_set_purpose (param->param, purpose);
+}
+
+MONO_API int
+mono_btls_x509_verify_param_get_depth (MonoBtlsX509VerifyParam *param)
+{
+       return X509_VERIFY_PARAM_get_depth (param->param);
+}
+
+MONO_API int
+mono_btls_x509_verify_param_set_depth (MonoBtlsX509VerifyParam *param, int depth)
+{
+       if (!param->owns)
+               return -1;
+       X509_VERIFY_PARAM_set_depth (param->param, depth);
+       return 1;
+}
+
+MONO_API int
+mono_btls_x509_verify_param_set_time (MonoBtlsX509VerifyParam *param, int64_t time)
+{
+       if (!param->owns)
+               return -1;
+       X509_VERIFY_PARAM_set_time (param->param, time);
+       return 1;
+}
+
+MONO_API char *
+mono_btls_x509_verify_param_get_peername (MonoBtlsX509VerifyParam *param)
+{
+       char *peer = X509_VERIFY_PARAM_get0_peername (param->param);
+       return peer;
+}
diff --git a/mono/btls/btls-x509-verify-param.h b/mono/btls/btls-x509-verify-param.h
new file mode 100644 (file)
index 0000000..e85d547
--- /dev/null
@@ -0,0 +1,81 @@
+//
+//  btls-x509-verify-param.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 3/3/16.
+//  Copyright © 2016 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509_verify_param__
+#define __btls__btls_x509_verify_param__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509.h>
+
+typedef enum {
+       MONO_BTLS_X509_VERIFY_FLAGS_DEFAULT             = 0,
+       MONO_BTLS_X509_VERIFY_FLAGS_CRL_CHECK   = 1,
+       MONO_BTLS_X509_VERIFY_FLAGS_CRL_CHECK_ALL       = 2,
+       MONO_BTLS_X509_VERIFY_FLAGS_X509_STRICT = 4
+} MonoBtlsX509VerifyFlags;
+
+MonoBtlsX509VerifyParam *
+mono_btls_x509_verify_param_new (void);
+
+MonoBtlsX509VerifyParam *
+mono_btls_x509_verify_param_from_store_ctx (MonoBtlsX509StoreCtx *ctx, X509_VERIFY_PARAM *param);
+
+MonoBtlsX509VerifyParam *
+mono_btls_x509_verify_param_copy (const MonoBtlsX509VerifyParam *from);
+
+void
+mono_btls_x509_verify_param_free (MonoBtlsX509VerifyParam *param);
+
+const X509_VERIFY_PARAM *
+mono_btls_x509_verify_param_peek_param (const MonoBtlsX509VerifyParam *param);
+
+int
+mono_btls_x509_verify_param_can_modify (MonoBtlsX509VerifyParam *param);
+
+MonoBtlsX509VerifyParam *
+mono_btls_x509_verify_param_lookup (const char *name);
+
+int
+mono_btls_x509_verify_param_set_name (MonoBtlsX509VerifyParam *param, const char *name);
+
+int
+mono_btls_x509_verify_param_set_host (MonoBtlsX509VerifyParam *param, const char *host, int namelen);
+
+int
+mono_btls_x509_verify_param_add_host (MonoBtlsX509VerifyParam *param, const char *host, int namelen);
+
+uint64_t
+mono_btls_x509_verify_param_get_flags (MonoBtlsX509VerifyParam *param);
+
+int
+mono_btls_x509_verify_param_set_flags (MonoBtlsX509VerifyParam *param, uint64_t flags);
+
+MonoBtlsX509VerifyFlags
+mono_btls_x509_verify_param_get_mono_flags (MonoBtlsX509VerifyParam *param);
+
+int
+mono_btls_x509_verify_param_set_mono_flags (MonoBtlsX509VerifyParam *param, MonoBtlsX509VerifyFlags flags);
+
+int
+mono_btls_x509_verify_param_set_purpose (MonoBtlsX509VerifyParam *param, MonoBtlsX509Purpose purpose);
+
+int
+mono_btls_x509_verify_param_get_depth (MonoBtlsX509VerifyParam *param);
+
+int
+mono_btls_x509_verify_param_set_depth (MonoBtlsX509VerifyParam *param, int depth);
+
+int
+mono_btls_x509_verify_param_set_time (MonoBtlsX509VerifyParam *param, int64_t time);
+
+char *
+mono_btls_x509_verify_param_get_peername (MonoBtlsX509VerifyParam *param);
+
+#endif /* defined(__btls__btls_x509_verify_param__) */
+
diff --git a/mono/btls/btls-x509.c b/mono/btls/btls-x509.c
new file mode 100644 (file)
index 0000000..473d94f
--- /dev/null
@@ -0,0 +1,441 @@
+//
+//  btls-x509.c
+//  MonoBtls
+//
+//  Created by Martin Baulig on 14/11/15.
+//  Copyright (c) 2015 Xamarin. All rights reserved.
+//
+
+#include <btls-x509.h>
+#include <openssl/x509v3.h>
+#include <openssl/pkcs12.h>
+
+MONO_API X509 *
+mono_btls_x509_from_data (const void *buf, int len, MonoBtlsX509Format format)
+{
+       BIO *bio;
+       X509 *cert = NULL;
+
+       bio = BIO_new_mem_buf ((void *)buf, len);
+       switch (format) {
+               case MONO_BTLS_X509_FORMAT_DER:
+                       cert = d2i_X509_bio (bio, NULL);
+                       break;
+               case MONO_BTLS_X509_FORMAT_PEM:
+                       cert = PEM_read_bio_X509 (bio, NULL, NULL, NULL);
+                       break;
+       }
+       BIO_free (bio);
+       return cert;
+}
+
+MONO_API X509 *
+mono_btls_x509_up_ref (X509 *x509)
+{
+       X509_up_ref (x509);
+       return x509;
+}
+
+MONO_API void
+mono_btls_x509_free (X509 *x509)
+{
+       X509_free (x509);
+}
+
+MONO_API X509 *
+mono_btls_x509_dup (X509 *x509)
+{
+       return X509_dup (x509);
+}
+
+MONO_API MonoBtlsX509Name *
+mono_btls_x509_get_subject_name (X509 *x509)
+{
+       return mono_btls_x509_name_copy (X509_get_subject_name (x509));
+}
+
+MONO_API MonoBtlsX509Name *
+mono_btls_x509_get_issuer_name (X509 *x509)
+{
+       return mono_btls_x509_name_copy (X509_get_issuer_name (x509));
+}
+
+MONO_API int
+mono_btls_x509_get_subject_name_string (X509 *name, char *buffer, int size)
+{
+       *buffer = 0;
+       return X509_NAME_oneline (X509_get_subject_name (name), buffer, size) != NULL;
+}
+
+MONO_API int
+mono_btls_x509_get_issuer_name_string (X509 *name, char *buffer, int size)
+{
+       *buffer = 0;
+       return X509_NAME_oneline (X509_get_issuer_name (name), buffer, size) != NULL;
+}
+
+MONO_API int
+mono_btls_x509_get_raw_data (X509 *x509, BIO *bio, MonoBtlsX509Format format)
+{
+       switch (format) {
+               case MONO_BTLS_X509_FORMAT_DER:
+                       return i2d_X509_bio (bio, x509);
+               case MONO_BTLS_X509_FORMAT_PEM:
+                       return PEM_write_bio_X509 (bio, x509);
+               default:
+                       return 0;
+       }
+}
+
+MONO_API int
+mono_btls_x509_cmp (const X509 *a, const X509 *b)
+{
+       return X509_cmp (a, b);
+}
+
+MONO_API int
+mono_btls_x509_get_hash (X509 *x509, const void **data)
+{
+       X509_check_purpose (x509, -1, 0);
+       *data = x509->sha1_hash;
+       return SHA_DIGEST_LENGTH;
+}
+
+MONO_API int64_t
+mono_btls_x509_get_not_before (X509 *x509)
+{
+       return mono_btls_util_asn1_time_to_ticks (X509_get_notBefore (x509));
+}
+
+MONO_API int64_t
+mono_btls_x509_get_not_after (X509 *x509)
+{
+       return mono_btls_util_asn1_time_to_ticks (X509_get_notAfter (x509));
+}
+
+MONO_API int
+mono_btls_x509_get_public_key (X509 *x509, BIO *bio)
+{
+       EVP_PKEY *pkey;
+       uint8_t *data = NULL;
+       int ret;
+
+       pkey = X509_get_pubkey (x509);
+       if (!pkey)
+               return -1;
+
+       ret = i2d_PublicKey (pkey, &data);
+
+       if (ret > 0 && data) {
+               ret = BIO_write (bio, data, ret);
+               OPENSSL_free (data);
+       }
+
+       EVP_PKEY_free (pkey);
+       return ret;
+}
+
+MONO_API int
+mono_btls_x509_get_serial_number (X509 *x509, char *buffer, int size, int mono_style)
+{
+       ASN1_INTEGER *serial;
+       unsigned char *temp, *p;
+       int len, idx;
+
+       serial = X509_get_serialNumber (x509);
+       if (serial->length == 0 || serial->length+1 > size)
+               return 0;
+
+       if (!mono_style) {
+               memcpy (buffer, serial->data, serial->length);
+               return serial->length;
+       }
+
+       temp = OPENSSL_malloc (serial->length + 1);
+       if (!temp)
+               return 0;
+
+       p = temp;
+       len = i2c_ASN1_INTEGER (serial, &p);
+
+       if (!len) {
+               OPENSSL_free (temp);
+               return 0;
+       }
+
+       for (idx = 0; idx < len; idx++) {
+               buffer [idx] = *(--p);
+       }
+       buffer [len] = 0;
+
+       OPENSSL_free (temp);
+       return len;
+}
+
+MONO_API int
+mono_btls_x509_get_public_key_algorithm (X509 *x509, char *buffer, int size)
+{
+       X509_PUBKEY *pkey;
+       ASN1_OBJECT *ppkalg;
+       int ret;
+
+       *buffer = 0;
+       pkey = X509_get_X509_PUBKEY (x509);
+       if (!pkey)
+               return 0;
+
+       ret = X509_PUBKEY_get0_param (&ppkalg, NULL, NULL, NULL, pkey);
+       if (!ret || !ppkalg)
+               return ret;
+
+       return OBJ_obj2txt (buffer, size, ppkalg, 1);
+}
+
+MONO_API int
+mono_btls_x509_get_version (X509 *x509)
+{
+       return (int)X509_get_version (x509) + 1;
+}
+
+MONO_API int
+mono_btls_x509_get_signature_algorithm (X509 *x509, char *buffer, int size)
+{
+       const ASN1_OBJECT *obj;
+       int nid;
+
+       *buffer = 0;
+
+       nid = X509_get_signature_nid (x509);
+
+       obj = OBJ_nid2obj (nid);
+       if (!obj)
+               return 0;
+
+       return OBJ_obj2txt (buffer, size, obj, 1);
+}
+
+MONO_API int
+mono_btls_x509_get_public_key_asn1 (X509 *x509, char *out_oid, int oid_len, uint8_t **buffer, int *size)
+{
+       X509_PUBKEY *pkey;
+       ASN1_OBJECT *ppkalg;
+       const unsigned char *pk;
+       int pk_len;
+       int ret;
+
+       if (out_oid)
+               *out_oid = 0;
+
+       pkey = X509_get_X509_PUBKEY (x509);
+       if (!pkey || !pkey->public_key)
+               return 0;
+
+       ret = X509_PUBKEY_get0_param (&ppkalg, &pk, &pk_len, NULL, pkey);
+       if (ret != 1 || !ppkalg || !pk)
+               return 0;
+
+       if (out_oid) {
+               OBJ_obj2txt (out_oid, oid_len, ppkalg, 1);
+       }
+
+       if (buffer) {
+               *size = pk_len;
+               *buffer = OPENSSL_malloc (pk_len);
+               if (!*buffer)
+                       return 0;
+
+               memcpy (*buffer, pk, pk_len);
+       }
+
+       return 1;
+
+}
+
+MONO_API int
+mono_btls_x509_get_public_key_parameters (X509 *x509, char *out_oid, int oid_len, uint8_t **buffer, int *size)
+{
+       X509_PUBKEY *pkey;
+       X509_ALGOR *algor;
+       ASN1_OBJECT *paobj;
+       int ptype;
+       void *pval;
+       int ret;
+
+       if (out_oid)
+               *out_oid = 0;
+
+       pkey = X509_get_X509_PUBKEY (x509);
+
+       ret = X509_PUBKEY_get0_param (NULL, NULL, NULL, &algor, pkey);
+       if (ret != 1 || !algor)
+               return 0;
+
+       X509_ALGOR_get0 (&paobj, &ptype, &pval, algor);
+
+       if (ptype != V_ASN1_NULL && ptype != V_ASN1_SEQUENCE)
+               return 0;
+
+       if (ptype == V_ASN1_NULL) {
+               uint8_t *ptr;
+
+               *size = 2;
+               *buffer = OPENSSL_malloc (2);
+               if (!*buffer)
+                       return 0;
+
+               ptr = *buffer;
+               *ptr++ = 0x05;
+               *ptr++ = 0x00;
+
+               if (out_oid)
+                       OBJ_obj2txt (out_oid, oid_len, paobj, 1);
+
+               return 1;
+       } else if (ptype == V_ASN1_SEQUENCE) {
+               ASN1_STRING *pstr = pval;
+
+               *size = pstr->length;
+               *buffer = OPENSSL_malloc (pstr->length);
+               if (!*buffer)
+                       return 0;
+
+               memcpy (*buffer, pstr->data, pstr->length);
+
+               if (out_oid)
+                       OBJ_obj2txt (out_oid, oid_len, paobj, 1);
+
+               return 1;
+       } else {
+               return 0;
+       }
+}
+
+MONO_API EVP_PKEY *
+mono_btls_x509_get_pubkey (X509 *x509)
+{
+       return X509_get_pubkey (x509);
+}
+
+MONO_API int
+mono_btls_x509_get_subject_key_identifier (X509 *x509, uint8_t **buffer, int *size)
+{
+       ASN1_OCTET_STRING *skid;
+
+       *size = 0;
+       *buffer = NULL;
+
+       if (X509_get_version (x509) != 2)
+               return 0;
+
+       skid = X509_get_ext_d2i (x509, NID_subject_key_identifier, NULL, NULL);
+       if (!skid)
+               return 0;
+
+       *size = skid->length;
+       *buffer = OPENSSL_malloc (*size);
+       if (!*buffer)
+               return 0;
+
+       memcpy (*buffer, skid->data, *size);
+       return 1;
+}
+
+MONO_API int
+mono_btls_x509_print (X509 *x509, BIO *bio)
+{
+       return X509_print_ex (bio, x509, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
+}
+
+static int
+get_trust_nid (MonoBtlsX509Purpose purpose)
+{
+       switch (purpose) {
+               case MONO_BTLS_X509_PURPOSE_SSL_CLIENT:
+                       return NID_client_auth;
+               case MONO_BTLS_X509_PURPOSE_SSL_SERVER:
+                       return NID_server_auth;
+               default:
+                       return 0;
+       }
+}
+
+MONO_API int
+mono_btls_x509_add_trust_object (X509 *x509, MonoBtlsX509Purpose purpose)
+{
+       ASN1_OBJECT *trust;
+       int nid;
+
+       nid = get_trust_nid (purpose);
+       if (!nid)
+               return 0;
+
+       trust = ASN1_OBJECT_new ();
+       if (!trust)
+               return 0;
+
+       trust->nid = nid;
+       return X509_add1_trust_object (x509, trust);
+}
+
+MONO_API int
+mono_btls_x509_add_reject_object (X509 *x509, MonoBtlsX509Purpose purpose)
+{
+       ASN1_OBJECT *reject;
+       int nid;
+
+       nid = get_trust_nid (purpose);
+       if (!nid)
+               return 0;
+
+       reject = ASN1_OBJECT_new ();
+       if (!reject)
+               return 0;
+
+       reject->nid = nid;
+       return X509_add1_reject_object (x509, reject);
+}
+
+MONO_API int
+mono_btls_x509_add_explicit_trust (X509 *x509, MonoBtlsX509TrustKind kind)
+{
+       int ret = 0;
+
+       if ((kind & MONO_BTLS_X509_TRUST_KIND_REJECT_ALL) != 0)
+               kind |= MONO_BTLS_X509_TRUST_KIND_REJECT_CLIENT | MONO_BTLS_X509_TRUST_KIND_REJECT_SERVER;
+
+       if ((kind & MONO_BTLS_X509_TRUST_KIND_TRUST_ALL) != 0)
+               kind |= MONO_BTLS_X509_TRUST_KIND_TRUST_CLIENT | MONO_BTLS_X509_TRUST_KIND_TRUST_SERVER;
+
+
+       if ((kind & MONO_BTLS_X509_TRUST_KIND_REJECT_CLIENT) != 0) {
+               ret = mono_btls_x509_add_reject_object (x509, MONO_BTLS_X509_PURPOSE_SSL_CLIENT);
+               if (!ret)
+                       return ret;
+       }
+
+       if ((kind & MONO_BTLS_X509_TRUST_KIND_REJECT_SERVER) != 0) {
+               ret = mono_btls_x509_add_reject_object (x509, MONO_BTLS_X509_PURPOSE_SSL_SERVER);
+               if (!ret)
+                       return ret;
+       }
+
+       if (ret) {
+               // Ignore any MONO_BTLS_X509_TRUST_KIND_TRUST_* settings if we added
+               // any kind of MONO_BTLS_X509_TRUST_KIND_REJECT_* before.
+               return ret;
+       }
+
+       if ((kind & MONO_BTLS_X509_TRUST_KIND_TRUST_CLIENT) != 0) {
+               ret = mono_btls_x509_add_trust_object (x509, MONO_BTLS_X509_PURPOSE_SSL_CLIENT);
+               if (!ret)
+                       return ret;
+       }
+
+       if ((kind & MONO_BTLS_X509_TRUST_KIND_TRUST_SERVER) != 0) {
+               ret = mono_btls_x509_add_trust_object (x509, MONO_BTLS_X509_PURPOSE_SSL_SERVER);
+               if (!ret)
+                       return ret;
+       }
+
+       return ret;
+}
diff --git a/mono/btls/btls-x509.h b/mono/btls/btls-x509.h
new file mode 100644 (file)
index 0000000..d913743
--- /dev/null
@@ -0,0 +1,127 @@
+//
+//  btls-x509.h
+//  MonoBtls
+//
+//  Created by Martin Baulig on 14/11/15.
+//  Copyright (c) 2015 Xamarin. All rights reserved.
+//
+
+#ifndef __btls__btls_x509__
+#define __btls__btls_x509__
+
+#include <stdio.h>
+#include <btls-ssl.h>
+#include <btls-x509-name.h>
+
+typedef enum {
+       MONO_BTLS_X509_FORMAT_DER = 1,
+       MONO_BTLS_X509_FORMAT_PEM = 2
+} MonoBtlsX509Format;
+
+typedef enum {
+       MONO_BTLS_x509_FILE_TYPE_PEM = 1,               // X509_FILETYPE_PEM
+       MONO_BTLS_x509_FILE_TYPE_ASN1 = 2,              // X509_FILETYPE_ASN1
+       MONO_BTLS_x509_FILE_TYPE_DEFAULT = 3,   // X509_FILETYPE_DEFAULT
+} MonoBtlsX509FileType;
+
+typedef enum {
+       MONO_BTLS_X509_PURPOSE_SSL_CLIENT               = 1,
+       MONO_BTLS_X509_PURPOSE_SSL_SERVER               = 2,
+       MONO_BTLS_X509_PURPOSE_NS_SSL_SERVER    = 3,
+       MONO_BTLS_X509_PURPOSE_SMIME_SIGN               = 4,
+       MONO_BTLS_X509_PURPOSE_SMIME_ENCRYPT    = 5,
+       MONO_BTLS_X509_PURPOSE_CRL_SIGN         = 6,
+       MONO_BTLS_X509_PURPOSE_ANY                      = 7,
+       MONO_BTLS_X509_PURPOSE_OCSP_HELPER              = 8,
+       MONO_BTLS_X509_PURPOSE_TIMESTAMP_SIGN   = 9,
+} MonoBtlsX509Purpose;
+
+typedef enum {
+       MONO_BTLS_X509_TRUST_KIND_DEFAULT               = 0,
+       MONO_BTLS_X509_TRUST_KIND_TRUST_CLIENT  = 1,
+       MONO_BTLS_X509_TRUST_KIND_TRUST_SERVER  = 2,
+       MONO_BTLS_X509_TRUST_KIND_TRUST_ALL             = 4,
+       MONO_BTLS_X509_TRUST_KIND_REJECT_CLIENT = 32,
+       MONO_BTLS_X509_TRUST_KIND_REJECT_SERVER = 64,
+       MONO_BTLS_X509_TRUST_KIND_REJECT_ALL    = 128
+} MonoBtlsX509TrustKind;
+
+X509 *
+mono_btls_x509_from_data (const void *buf, int len, MonoBtlsX509Format format);
+
+X509 *
+mono_btls_x509_up_ref (X509 *x509);
+
+void
+mono_btls_x509_free (X509 *x509);
+
+X509 *
+mono_btls_x509_dup (X509 *x509);
+
+MonoBtlsX509Name *
+mono_btls_x509_get_subject_name (X509 *x509);
+
+MonoBtlsX509Name *
+mono_btls_x509_get_issuer_name (X509 *x509);
+
+int
+mono_btls_x509_get_subject_name_string (X509 *name, char *buffer, int size);
+
+int
+mono_btls_x509_get_issuer_name_string (X509 *name, char *buffer, int size);
+
+int
+mono_btls_x509_get_raw_data (X509 *x509, BIO *bio, MonoBtlsX509Format format);
+
+int
+mono_btls_x509_cmp (const X509 *a, const X509 *b);
+
+int
+mono_btls_x509_get_hash (X509 *x509, const void **data);
+
+int64_t
+mono_btls_x509_get_not_before (X509 *x509);
+
+int64_t
+mono_btls_x509_get_not_after (X509 *x509);
+
+int
+mono_btls_x509_get_public_key (X509 *x509, BIO *bio);
+
+int
+mono_btls_x509_get_public_key_parameters (X509 *x509, char *out_oid, int oid_len, uint8_t **buffer, int *size);
+
+int
+mono_btls_x509_get_serial_number (X509 *x509, char *buffer, int size, int mono_style);
+
+int
+mono_btls_x509_get_public_key_algorithm (X509 *x509, char *buffer, int size);
+
+int
+mono_btls_x509_get_version (X509 *x509);
+
+int
+mono_btls_x509_get_signature_algorithm (X509 *x509, char *buffer, int size);
+
+int
+mono_btls_x509_get_public_key_asn1 (X509 *x509, char *out_oid, int oid_len, uint8_t **buffer, int *size);
+
+EVP_PKEY *
+mono_btls_x509_get_pubkey (X509 *x509);
+
+int
+mono_btls_x509_get_subject_key_identifier (X509 *x509, uint8_t **buffer, int *size);
+
+int
+mono_btls_x509_print (X509 *x509, BIO *bio);
+
+int
+mono_btls_x509_add_trust_object (X509 *x509, MonoBtlsX509Purpose purpose);
+
+int
+mono_btls_x509_add_reject_object (X509 *x509, MonoBtlsX509Purpose purpose);
+
+int
+mono_btls_x509_add_explicit_trust (X509 *x509, MonoBtlsX509TrustKind kind);
+
+#endif /* defined(__btls__btls_x509__) */
diff --git a/mono/btls/create-object-library.sh b/mono/btls/create-object-library.sh
new file mode 100755 (executable)
index 0000000..8ceda08
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+DIR=$1; shift
+FILELIST=$1; shift
+LOFILELIST=$1 ; shift
+TARGET=$1; shift
+STATIC=$1; shift
+AR=$1; shift
+RANLIB=$1; shift
+
+HEADER="# Generated by Martin's tool $0, not libtool"
+
+test -f $TARGET && exit 0
+
+rm -f $FILELIST
+rm -f $LOFILELIST
+
+while [ "$1" != "--" ]; do
+       file=$1; shift
+       filename=`basename $file`
+       LOFILE=$file.lo
+       echo "$HEADER" > $LOFILE
+       if [ "$STATIC" = "static" ]; then
+               echo "non_pic_object='$filename'" >> $LOFILE
+       else
+               echo "pic_object='$filename'" >> $LOFILE
+       fi
+       echo "$DIR/$file " >> $FILELIST
+       echo "$DIR/$LOFILE " >> $LOFILELIST
+done
+
+(cd $DIR && $AR cr $TARGET `cat $FILELIST` && $RANLIB $TARGET)
+
index f3724e4384debca76a5eae810a91e4dc8333e278..ca9c92e0ae60cdb0a808a654ade306a8d2565c70 100755 (executable)
@@ -1103,8 +1103,8 @@ dis_stringify_object_with_class (MonoImage *m, MonoClass *c, gboolean prefix, gb
 
        esname = get_escaped_class_name (c);
 
-       if (c->generic_class) {
-               MonoGenericClass *gclass = c->generic_class;
+       if (mono_class_is_ginst (c)) {
+               MonoGenericClass *gclass = mono_class_get_generic_class (c);
                MonoGenericInst *inst = gclass->context.class_inst;
                GString *str = g_string_new ("");
                int i;
@@ -1847,7 +1847,7 @@ get_memberref_container (MonoImage *m, guint32 mrp_token, MonoGenericContainer *
        case 4: /* TypeSpec */
                klass = mono_class_get_full (m, MONO_TOKEN_TYPE_SPEC | idx, (MonoGenericContext *) container);
                g_assert (klass);
-               return klass->generic_class ? klass->generic_class->container_class->generic_container : NULL;
+               return mono_class_is_ginst (klass) ? mono_class_get_generic_container (mono_class_get_generic_class (klass)->container_class) : NULL;
        }
        g_assert_not_reached ();
        return NULL;
@@ -3108,7 +3108,7 @@ get_method_override (MonoImage *m, guint32 token, MonoGenericContainer *containe
                        MonoMethod *mh = NULL;
                        mh = mono_get_method_checked (m, decl, NULL, (MonoGenericContext *) container, &error);
 
-                       if (mh && (mh->klass && (mh->klass->generic_class || mh->klass->generic_container))) {
+                       if (mh && (mh->klass && (mono_class_is_ginst (mh->klass) || mono_class_is_gtd (mh->klass)))) {
                                char *meth_str;
                                char *ret;
                                
index dfb60a16c827e5db876948193eef80196708b887..934ed07b7293d62a3d769ac4e3146079a50aeb79 100644 (file)
@@ -11,8 +11,6 @@ AM_CPPFLAGS = \
 libwapiincludedir = $(includedir)/mono-$(API_VER)/mono/io-layer
 
 OTHER_H = \
-       access.h        \
-       context.h       \
        error.h         \
        io.h            \
        io-trace.h      \
@@ -20,7 +18,6 @@ OTHER_H = \
        io-portability.h        \
        macros.h        \
        messages.h      \
-       processes.h     \
        security.h      \
        sockets.h       \
        status.h        \
@@ -33,9 +30,6 @@ OTHER_H = \
        wapi-remap.h
 
 OTHER_SRC = \
-       access.h                \
-       context.c               \
-       context.h               \
        error.c                 \
        error.h                 \
        io.c                    \
@@ -49,9 +43,6 @@ OTHER_SRC = \
        messages.c              \
        messages.h              \
        posix.c                 \
-       processes.c             \
-       processes.h             \
-       process-private.h       \
        security.c              \
        security.h              \
        sockets.c               \
@@ -61,7 +52,6 @@ OTHER_SRC = \
        status.h                \
        timefuncs.c             \
        timefuncs.h             \
-       timefuncs-private.h     \
        types.h                 \
        uglify.h                \
        versioninfo.c           \
diff --git a/mono/io-layer/access.h b/mono/io-layer/access.h
deleted file mode 100644 (file)
index 2cb48b3..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * access.h:  Access control definitions
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_ACCESS_H_
-#define _WAPI_ACCESS_H_
-
-#include <glib.h>
-
-#include <mono/io-layer/wapi.h>
-
-#define SYNCHRONIZE                    0x00100000
-#define STANDARD_RIGHTS_REQUIRED       0x000f0000
-
-#endif /* _WAPI_ACCESS_H_ */
diff --git a/mono/io-layer/context.c b/mono/io-layer/context.c
deleted file mode 100644 (file)
index 75155a4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * context.c:  Processor-specific register contexts
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <pthread.h>
-
-#include "mono/io-layer/wapi.h"
-
-gboolean GetThreadContext(gpointer handle G_GNUC_UNUSED, WapiContext *context G_GNUC_UNUSED)
-{
-       return(FALSE);
-}
-
-
-
diff --git a/mono/io-layer/context.h b/mono/io-layer/context.h
deleted file mode 100644 (file)
index 2d0e814..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * context.h:  Processor-specific register contexts
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_CONTEXT_H_
-#define _WAPI_CONTEXT_H_
-
-#include <glib.h>
-
-#include "mono/io-layer/wapi.h"
-
-/* This part is x86-specific.  MSDN states that CONTEXT is defined
- * also for MIPS, Alpha and PPC processors.
- */
-
-#define SIZE_OF_80387_REGISTERS 80
-
-#define CONTEXT_i386 0x00010000
-#define CONTEXT_i486 0x00010000
-
-#define CONTEXT_CONTROL                        (CONTEXT_i386 | 0x00000001L)
-#define CONTEXT_INTEGER                        (CONTEXT_i386 | 0x00000002L)
-#define CONTEXT_SEGMENTS               (CONTEXT_i386 | 0x00000004L)
-#define CONTEXT_FLOATING_POINT         (CONTEXT_i386 | 0x00000008L)
-#define CONTEXT_DEBUG_REGISTERS                (CONTEXT_i386 | 0x00000010L)
-#define CONTEXT_EXTENDED_REGISTERS     (CONTEXT_i386 | 0x00000020L)
-
-#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS)
-
-#define MAXIMUM_SUPPORTED_EXTENSION 512
-
-typedef struct 
-{
-       guint32 ControlWord;
-       guint32 StatusWord;
-       guint32 TagWord;
-       guint32 ErrorOffset;
-       guint32 ErrorSelector;
-       guint32 DataOffset;
-       guint32 DataSelector;
-       guint8 RegisterArea[SIZE_OF_80387_REGISTERS];
-       guint32 Cr0NpxState;
-} WapiFloatingSaveArea;
-
-typedef struct 
-{
-       guint32 ContextFlags;
-       guint32 Dr0;
-       guint32 Dr1;
-       guint32 Dr2;
-       guint32 Dr3;
-       guint32 Dr6;
-       guint32 Dr7;
-       
-       WapiFloatingSaveArea FloatSave;
-       
-       guint32 SegGs;
-       guint32 SegFs;
-       guint32 SegEs;
-       guint32 SegDs;
-       
-       guint32 Edi;
-       guint32 Esi;
-       guint32 Ebx;
-       guint32 Edx;
-       guint32 Ecx;
-       guint32 Eax;
-       
-       guint32 Ebp;
-       guint32 Eip;
-       guint32 SegCs;
-       guint32 EFlags;
-       guint32 Esp;
-       guint32 SegSs;
-       
-       guint8 ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
-} WapiContext;
-
-G_BEGIN_DECLS
-
-extern gboolean GetThreadContext(gpointer handle, WapiContext *context);
-
-G_END_DECLS
-
-#endif /* _WAPI_COMPEX_H_ */
index db128be5c72a6c3948f3056f915c02284e5461ca..bc884c3d8d9f14f8f97385b51ff70fae3f3bc713 100644 (file)
 
 #include "mono/io-layer/wapi.h"
 #include "mono/io-layer/wapi-private.h"
-#include "mono/utils/mono-once.h"
+#include "mono/utils/mono-lazy-init.h"
 
 static pthread_key_t error_key;
-static mono_once_t error_key_once=MONO_ONCE_INIT;
+static mono_lazy_init_t error_key_once = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
 
 static void error_init(void)
 {
@@ -28,7 +28,7 @@ static void error_init(void)
        g_assert (ret == 0);
 }
 
-void _wapi_error_cleanup (void)
+static void error_cleanup (void)
 {
        int ret;
 
@@ -36,6 +36,11 @@ void _wapi_error_cleanup (void)
        g_assert (ret == 0);
 }
 
+void _wapi_error_cleanup (void)
+{
+       mono_lazy_cleanup (&error_key_once, error_cleanup);
+}
+
 /**
  * GetLastError:
  *
@@ -51,7 +56,7 @@ guint32 GetLastError(void)
 
        if (_wapi_has_shut_down)
                return 0;
-       mono_once(&error_key_once, error_init);
+       mono_lazy_initialize(&error_key_once, error_init);
        errptr=pthread_getspecific(error_key);
        err=GPOINTER_TO_UINT(errptr);
        
@@ -71,7 +76,7 @@ void SetLastError(guint32 code)
        if (_wapi_has_shut_down)
                return;
        /* Set the thread-local error code */
-       mono_once(&error_key_once, error_init);
+       mono_lazy_initialize(&error_key_once, error_init);
        ret = pthread_setspecific(error_key, GUINT_TO_POINTER(code));
        g_assert (ret == 0);
 }
index a3cbe2abfee3419be56e504891aa2e749f9ed3cf..e9096e25580ee216938e36854d2668b6325b4a45 100755 (executable)
@@ -11,6 +11,9 @@
 #ifndef _MONO_IOLAYER_IOLAYER_H_
 #define _MONO_IOLAYER_IOLAYER_H_
 
+#include <config.h>
+#include <glib.h>
+
 #if defined(__WIN32__) || defined(_WIN32)
 /* Native win32 */
 #define __USE_W32_SOCKETS
@@ -25,8 +28,8 @@
 #include <ws2tcpip.h>
 #endif
 #include <psapi.h>
-#include <shlobj.h>
-/*
+
+ /*
  * Workaround for missing WSAPOLLFD typedef in mingw's winsock2.h that is required for mswsock.h below.
  * Remove once http://sourceforge.net/p/mingw/bugs/1980/ is fixed.
  */
@@ -37,7 +40,11 @@ typedef struct pollfd {
   short  revents;
 } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
 #endif
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 #include <mswsock.h>
+#endif
+
 #else  /* EVERYONE ELSE */
 #include "mono/io-layer/wapi.h"
 #include "mono/io-layer/uglify.h"
index 7efbfde591785b65ce45b968411813db261d0018..70a374557dd3a9a16f32956790699accd6efdfb7 100644 (file)
 #include <mono/io-layer/wapi.h>
 #include <mono/io-layer/wapi-private.h>
 #include <mono/io-layer/io-private.h>
-#include <mono/io-layer/timefuncs-private.h>
+#include <mono/io-layer/timefuncs.h>
 #include <mono/io-layer/io-portability.h>
 #include <mono/io-layer/io-trace.h>
 #include <mono/utils/strenc.h>
 #include <mono/utils/mono-once.h>
 #include <mono/utils/mono-logger-internals.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 
 /*
  * If SHM is disabled, this will point to a hash of _WapiFileShare structures, otherwise
@@ -2918,7 +2918,6 @@ gboolean FindNextFile (gpointer handle, WapiFindData *find_data)
        gunichar2 *utf16_basename;
        time_t create_time;
        glong bytes;
-       int thr_ret;
        gboolean ret = FALSE;
        
        ok=mono_w32handle_lookup (handle, MONO_W32HANDLE_FIND,
@@ -2930,8 +2929,7 @@ gboolean FindNextFile (gpointer handle, WapiFindData *find_data)
                return(FALSE);
        }
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
        
 retry:
        if (find_handle->count >= find_handle->num) {
@@ -3037,8 +3035,7 @@ retry:
        g_free (utf16_basename);
 
 cleanup:
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
        
        return(ret);
 }
@@ -3055,7 +3052,6 @@ gboolean FindClose (gpointer handle)
 {
        struct _WapiHandle_find *find_handle;
        gboolean ok;
-       int thr_ret;
 
        if (handle == NULL) {
                SetLastError (ERROR_INVALID_HANDLE);
@@ -3071,14 +3067,12 @@ gboolean FindClose (gpointer handle)
                return(FALSE);
        }
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
        
        g_strfreev (find_handle->namelist);
        g_free (find_handle->dir_part);
 
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
        
        mono_w32handle_unref (handle);
        
index 001df9bef7e9273d726f2999880915377f1cb9ef..86eb864365f043d173bf1e344414a56610491cdd 100644 (file)
@@ -18,7 +18,7 @@
 #include <mono/io-layer/io-private.h>
 #include <mono/io-layer/io-trace.h>
 #include <mono/utils/mono-logger-internals.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 
 gboolean
 _wapi_lock_file_region (int fd, off_t offset, off_t length)
index fe350c8b8660e59da13d8a2646a62f49db2fb2d9..995795bb32614fa12c11936e497f01991ef1c231 100644 (file)
@@ -25,7 +25,7 @@
 #include <mono/io-layer/io-private.h>
 #include <mono/io-layer/io-trace.h>
 #include <mono/utils/mono-logger-internals.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 
 static guint32
 convert_from_flags(int flags)
diff --git a/mono/io-layer/process-private.h b/mono/io-layer/process-private.h
deleted file mode 100644 (file)
index a17de8a..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * process-private.h: Private definitions for process handles
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002-2006 Novell, Inc.
- */
-
-#ifndef _WAPI_PROCESS_PRIVATE_H_
-#define _WAPI_PROCESS_PRIVATE_H_
-
-#include <config.h>
-#include <glib.h>
-
-#include <mono/utils/mono-os-semaphore.h>
-
-/* There doesn't seem to be a defined symbol for this */
-#define _WAPI_PROCESS_CURRENT (gpointer)0xFFFFFFFF
-
-/*
- * Handles > _WAPI_PROCESS_UNHANDLED are pseudo handles which represent processes
- * not started by the runtime.
- */
-/* This marks a system process that we don't have a handle on */
-/* FIXME: Cope with PIDs > sizeof guint */
-#define _WAPI_PROCESS_UNHANDLED (1 << (8*sizeof(pid_t)-1))
-#define _WAPI_PROCESS_UNHANDLED_PID_MASK (-1 & ~_WAPI_PROCESS_UNHANDLED)
-#define WAPI_IS_PSEUDO_PROCESS_HANDLE(handle) ((GPOINTER_TO_UINT(handle) & _WAPI_PROCESS_UNHANDLED) == _WAPI_PROCESS_UNHANDLED)
-#define WAPI_PID_TO_HANDLE(pid) GINT_TO_POINTER (_WAPI_PROCESS_UNHANDLED + (pid))
-#define WAPI_HANDLE_TO_PID(handle) (GPOINTER_TO_UINT ((handle)) - _WAPI_PROCESS_UNHANDLED)
-
-void _wapi_processes_init (void);
-extern gpointer _wapi_process_duplicate (void);
-extern void wapi_processes_cleanup (void);
-
-/*
- * MonoProcess describes processes we create.
- * It contains a semaphore that can be waited on in order to wait
- * for process termination. It's accessed in our SIGCHLD handler,
- * when status is updated (and pid cleared, to not clash with 
- * subsequent processes that may get executed).
- */
-struct MonoProcess {
-       pid_t pid; /* the pid of the process. This value is only valid until the process has exited. */
-       MonoSemType exit_sem; /* this semaphore will be released when the process exits */
-       int status; /* the exit status */
-       gint32 handle_count; /* the number of handles to this mono_process instance */
-       /* we keep a ref to the creating _WapiHandle_process handle until
-        * the process has exited, so that the information there isn't lost.
-        */
-       gpointer handle;
-       gboolean freeable;
-       struct MonoProcess *next;
-};
-
-typedef struct MonoProcess MonoProcess;
-
-/*
- * _WapiHandle_process is a structure containing all the required information
- * for process handling.
- */
-struct _WapiHandle_process
-{
-       pid_t id;
-       guint32 exitstatus;
-       gpointer main_thread;
-       WapiFileTime create_time;
-       WapiFileTime exit_time;
-       char *proc_name;
-       size_t min_working_set;
-       size_t max_working_set;
-       gboolean exited;
-       struct MonoProcess *mono_process;
-};
-
-typedef struct _WapiHandle_process WapiHandle_process;
-
-#endif /* _WAPI_PROCESS_PRIVATE_H_ */
diff --git a/mono/io-layer/processes.c b/mono/io-layer/processes.c
deleted file mode 100644 (file)
index 35cd67e..0000000
+++ /dev/null
@@ -1,2865 +0,0 @@
-/*
- * processes.c:  Process handles
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002-2011 Novell, Inc.
- * Copyright 2011 Xamarin Inc
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <sched.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <sys/time.h>
-#include <fcntl.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#include <ctype.h>
-
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-
-#ifdef HAVE_SYS_MKDEV_H
-#include <sys/mkdev.h>
-#endif
-
-#ifdef HAVE_UTIME_H
-#include <utime.h>
-#endif
-
-/* sys/resource.h (for rusage) is required when using osx 10.3 (but not 10.4) */
-#ifdef __APPLE__
-#include <TargetConditionals.h>
-#include <sys/resource.h>
-#ifdef HAVE_LIBPROC_H
-/* proc_name */
-#include <libproc.h>
-#endif
-#endif
-
-#if defined(PLATFORM_MACOSX)
-#define USE_OSX_LOADER
-#endif
-
-#if ( defined(__OpenBSD__) || defined(__FreeBSD__) ) && defined(HAVE_LINK_H)
-#define USE_BSD_LOADER
-#endif
-
-#if defined(__HAIKU__)
-#define USE_HAIKU_LOADER
-#endif
-
-#if defined(USE_OSX_LOADER) || defined(USE_BSD_LOADER)
-#include <sys/proc.h>
-#include <sys/sysctl.h>
-#  if !defined(__OpenBSD__)
-#    include <sys/utsname.h>
-#  endif
-#  if defined(__FreeBSD__)
-#    include <sys/user.h>  /* struct kinfo_proc */
-#  endif
-#endif
-
-#ifdef PLATFORM_SOLARIS
-/* procfs.h cannot be included if this define is set, but it seems to work fine if it is undefined */
-#if _FILE_OFFSET_BITS == 64
-#undef _FILE_OFFSET_BITS
-#include <procfs.h>
-#define _FILE_OFFSET_BITS 64
-#else
-#include <procfs.h>
-#endif
-#endif
-
-#ifdef __HAIKU__
-#include <KernelKit.h>
-#endif
-
-#include <mono/io-layer/wapi.h>
-#include <mono/io-layer/wapi-private.h>
-#include <mono/io-layer/process-private.h>
-#include <mono/io-layer/io-trace.h>
-#include <mono/utils/strenc.h>
-#include <mono/utils/mono-path.h>
-#include <mono/io-layer/timefuncs-private.h>
-#include <mono/utils/mono-time.h>
-#include <mono/utils/mono-membar.h>
-#include <mono/utils/mono-os-mutex.h>
-#include <mono/utils/mono-signal-handler.h>
-#include <mono/utils/mono-proclib.h>
-#include <mono/utils/mono-once.h>
-#include <mono/utils/mono-logger-internals.h>
-#include <mono/utils/w32handle.h>
-
-#define STILL_ACTIVE STATUS_PENDING
-
-/* The process' environment strings */
-#if defined(__APPLE__)
-#if defined (TARGET_OSX)
-/* Apple defines this in crt_externs.h but doesn't provide that header for 
- * arm-apple-darwin9.  We'll manually define the symbol on Apple as it does
- * in fact exist on all implementations (so far) 
- */
-gchar ***_NSGetEnviron(void);
-#define environ (*_NSGetEnviron())
-#else
-static char *mono_environ[1] = { NULL };
-#define environ mono_environ
-#endif /* defined (TARGET_OSX) */
-#else
-extern char **environ;
-#endif
-
-static guint32 process_wait (gpointer handle, guint32 timeout, gboolean *alerted);
-static void process_close (gpointer handle, gpointer data);
-static void process_details (gpointer data);
-static const gchar* process_typename (void);
-static gsize process_typesize (void);
-static gboolean is_pid_valid (pid_t pid);
-
-#if !(defined(USE_OSX_LOADER) || defined(USE_BSD_LOADER) || defined(USE_HAIKU_LOADER))
-static FILE *
-open_process_map (int pid, const char *mode);
-#endif
-
-static MonoW32HandleOps _wapi_process_ops = {
-       process_close,          /* close_shared */
-       NULL,                           /* signal */
-       NULL,                           /* own */
-       NULL,                           /* is_owned */
-       process_wait,                   /* special_wait */
-       NULL,                           /* prewait */
-       process_details,        /* details */
-       process_typename,       /* typename */
-       process_typesize,       /* typesize */
-};
-
-#if HAVE_SIGACTION
-static struct sigaction previous_chld_sa;
-#endif
-static mono_once_t process_sig_chld_once = MONO_ONCE_INIT;
-static void process_add_sigchld_handler (void);
-
-/* The signal-safe logic to use mono_processes goes like this:
- * - The list must be safe to traverse for the signal handler at all times.
- *   It's safe to: prepend an entry (which is a single store to 'mono_processes'),
- *   unlink an entry (assuming the unlinked entry isn't freed and doesn't 
- *   change its 'next' pointer so that it can still be traversed).
- * When cleaning up we first unlink an entry, then we verify that
- * the read lock isn't locked. Then we can free the entry, since
- * we know that nobody is using the old version of the list (including
- * the unlinked entry).
- * We also need to lock when adding and cleaning up so that those two
- * operations don't mess with eachother. (This lock is not used in the
- * signal handler)
- */
-static struct MonoProcess *mono_processes = NULL;
-static volatile gint32 mono_processes_cleaning_up = 0;
-static mono_mutex_t mono_processes_mutex;
-static void mono_processes_cleanup (void);
-
-static gpointer current_process;
-static char *cli_launcher;
-
-static WapiHandle_process *
-lookup_process_handle (gpointer handle)
-{
-       WapiHandle_process *process_data;
-       gboolean ret;
-
-       ret = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS,
-                                                          (gpointer *)&process_data);
-       if (!ret)
-               return NULL;
-       return process_data;
-}
-
-/* Check if a pid is valid - i.e. if a process exists with this pid. */
-static gboolean
-is_pid_valid (pid_t pid)
-{
-       gboolean result = FALSE;
-
-#if defined(HOST_WATCHOS)
-       result = TRUE; // TODO: Rewrite using sysctl
-#elif defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
-       if (((kill(pid, 0) == 0) || (errno == EPERM)) && pid != 0)
-               result = TRUE;
-#elif defined(__HAIKU__)
-       team_info teamInfo;
-       if (get_team_info ((team_id)pid, &teamInfo) == B_OK)
-               result = TRUE;
-#else
-       char *dir = g_strdup_printf ("/proc/%d", pid);
-       if (!access (dir, F_OK))
-               result = TRUE;
-       g_free (dir);
-#endif
-       
-       return result;
-}
-
-static void
-process_set_defaults (WapiHandle_process *process_handle)
-{
-       /* These seem to be the defaults on w2k */
-       process_handle->min_working_set = 204800;
-       process_handle->max_working_set = 1413120;
-       
-       _wapi_time_t_to_filetime (time (NULL), &process_handle->create_time);
-}
-
-static int
-len16 (const gunichar2 *str)
-{
-       int len = 0;
-       
-       while (*str++ != 0)
-               len++;
-
-       return len;
-}
-
-static gunichar2 *
-utf16_concat (const gunichar2 *first, ...)
-{
-       va_list args;
-       int total = 0, i;
-       const gunichar2 *s;
-       gunichar2 *ret;
-
-       va_start (args, first);
-       total += len16 (first);
-        for (s = va_arg (args, gunichar2 *); s != NULL; s = va_arg(args, gunichar2 *)){
-               total += len16 (s);
-        }
-       va_end (args);
-
-       ret = g_new (gunichar2, total + 1);
-       if (ret == NULL)
-               return NULL;
-
-       ret [total] = 0;
-       i = 0;
-       for (s = first; *s != 0; s++)
-               ret [i++] = *s;
-       va_start (args, first);
-       for (s = va_arg (args, gunichar2 *); s != NULL; s = va_arg (args, gunichar2 *)){
-               const gunichar2 *p;
-               
-               for (p = s; *p != 0; p++)
-                       ret [i++] = *p;
-       }
-       va_end (args);
-       
-       return ret;
-}
-
-static const gunichar2 utf16_space_bytes [2] = { 0x20, 0 };
-static const gunichar2 *utf16_space = utf16_space_bytes; 
-static const gunichar2 utf16_quote_bytes [2] = { 0x22, 0 };
-static const gunichar2 *utf16_quote = utf16_quote_bytes;
-
-#ifdef DEBUG_ENABLED
-/* Useful in gdb */
-void
-print_utf16 (gunichar2 *str)
-{
-       char *res;
-
-       res = g_utf16_to_utf8 (str, -1, NULL, NULL, NULL);
-       g_print ("%s\n", res);
-       g_free (res);
-}
-#endif
-
-/* Implemented as just a wrapper around CreateProcess () */
-gboolean
-ShellExecuteEx (WapiShellExecuteInfo *sei)
-{
-       gboolean ret;
-       WapiProcessInformation process_info;
-       gunichar2 *args;
-       
-       if (sei == NULL) {
-               /* w2k just segfaults here, but we can do better than
-                * that
-                */
-               SetLastError (ERROR_INVALID_PARAMETER);
-               return FALSE;
-       }
-
-       if (sei->lpFile == NULL)
-               /* w2k returns TRUE for this, for some reason. */
-               return TRUE;
-       
-       /* Put both executable and parameters into the second argument
-        * to CreateProcess (), so it searches $PATH.  The conversion
-        * into and back out of utf8 is because there is no
-        * g_strdup_printf () equivalent for gunichar2 :-(
-        */
-       args = utf16_concat (utf16_quote, sei->lpFile, utf16_quote, sei->lpParameters == NULL ? NULL : utf16_space, sei->lpParameters, NULL);
-       if (args == NULL) {
-               SetLastError (ERROR_INVALID_DATA);
-               return FALSE;
-       }
-       ret = CreateProcess (NULL, args, NULL, NULL, TRUE,
-                            CREATE_UNICODE_ENVIRONMENT, NULL,
-                            sei->lpDirectory, NULL, &process_info);
-       g_free (args);
-
-       if (!ret && GetLastError () == ERROR_OUTOFMEMORY)
-               return ret;
-       
-       if (!ret) {
-               static char *handler;
-               static gunichar2 *handler_utf16;
-               
-               if (handler_utf16 == (gunichar2 *)-1)
-                       return FALSE;
-
-#ifdef PLATFORM_MACOSX
-               handler = g_strdup ("/usr/bin/open");
-#else
-               /*
-                * On Linux, try: xdg-open, the FreeDesktop standard way of doing it,
-                * if that fails, try to use gnome-open, then kfmclient
-                */
-               handler = g_find_program_in_path ("xdg-open");
-               if (handler == NULL){
-                       handler = g_find_program_in_path ("gnome-open");
-                       if (handler == NULL){
-                               handler = g_find_program_in_path ("kfmclient");
-                               if (handler == NULL){
-                                       handler_utf16 = (gunichar2 *) -1;
-                                       return FALSE;
-                               } else {
-                                       /* kfmclient needs exec argument */
-                                       char *old = handler;
-                                       handler = g_strconcat (old, " exec",
-                                                              NULL);
-                                       g_free (old);
-                               }
-                       }
-               }
-#endif
-               handler_utf16 = g_utf8_to_utf16 (handler, -1, NULL, NULL, NULL);
-               g_free (handler);
-
-               /* Put quotes around the filename, in case it's a url
-                * that contains #'s (CreateProcess() calls
-                * g_shell_parse_argv(), which deliberately throws
-                * away anything after an unquoted #).  Fixes bug
-                * 371567.
-                */
-               args = utf16_concat (handler_utf16, utf16_space, utf16_quote,
-                                    sei->lpFile, utf16_quote,
-                                    sei->lpParameters == NULL ? NULL : utf16_space,
-                                    sei->lpParameters, NULL);
-               if (args == NULL) {
-                       SetLastError (ERROR_INVALID_DATA);
-                       return FALSE;
-               }
-               ret = CreateProcess (NULL, args, NULL, NULL, TRUE,
-                                    CREATE_UNICODE_ENVIRONMENT, NULL,
-                                    sei->lpDirectory, NULL, &process_info);
-               g_free (args);
-               if (!ret) {
-                       if (GetLastError () != ERROR_OUTOFMEMORY)
-                               SetLastError (ERROR_INVALID_DATA);
-                       return FALSE;
-               }
-               /* Shell exec should not return a process handle when it spawned a GUI thing, like a browser. */
-               CloseHandle (process_info.hProcess);
-               process_info.hProcess = NULL;
-       }
-       
-       if (sei->fMask & SEE_MASK_NOCLOSEPROCESS)
-               sei->hProcess = process_info.hProcess;
-       else
-               CloseHandle (process_info.hProcess);
-       
-       return ret;
-}
-
-static gboolean
-is_managed_binary (const char *filename)
-{
-       int original_errno = errno;
-#if defined(HAVE_LARGE_FILE_SUPPORT) && defined(O_LARGEFILE)
-       int file = open (filename, O_RDONLY | O_LARGEFILE);
-#else
-       int file = open (filename, O_RDONLY);
-#endif
-       off_t new_offset;
-       unsigned char buffer[8];
-       off_t file_size, optional_header_offset;
-       off_t pe_header_offset;
-       gboolean managed = FALSE;
-       int num_read;
-       guint32 first_word, second_word;
-       
-       /* If we are unable to open the file, then we definitely
-        * can't say that it is managed. The child mono process
-        * probably wouldn't be able to open it anyway.
-        */
-       if (file < 0) {
-               errno = original_errno;
-               return FALSE;
-       }
-
-       /* Retrieve the length of the file for future sanity checks. */
-       file_size = lseek (file, 0, SEEK_END);
-       lseek (file, 0, SEEK_SET);
-
-       /* We know we need to read a header field at offset 60. */
-       if (file_size < 64)
-               goto leave;
-
-       num_read = read (file, buffer, 2);
-
-       if ((num_read != 2) || (buffer[0] != 'M') || (buffer[1] != 'Z'))
-               goto leave;
-
-       new_offset = lseek (file, 60, SEEK_SET);
-
-       if (new_offset != 60)
-               goto leave;
-       
-       num_read = read (file, buffer, 4);
-
-       if (num_read != 4)
-               goto leave;
-       pe_header_offset =  buffer[0]
-               | (buffer[1] <<  8)
-               | (buffer[2] << 16)
-               | (buffer[3] << 24);
-       
-       if (pe_header_offset + 24 > file_size)
-               goto leave;
-
-       new_offset = lseek (file, pe_header_offset, SEEK_SET);
-
-       if (new_offset != pe_header_offset)
-               goto leave;
-
-       num_read = read (file, buffer, 4);
-
-       if ((num_read != 4) || (buffer[0] != 'P') || (buffer[1] != 'E') || (buffer[2] != 0) || (buffer[3] != 0))
-               goto leave;
-
-       /*
-        * Verify that the header we want in the optional header data
-        * is present in this binary.
-        */
-       new_offset = lseek (file, pe_header_offset + 20, SEEK_SET);
-
-       if (new_offset != pe_header_offset + 20)
-               goto leave;
-
-       num_read = read (file, buffer, 2);
-
-       if ((num_read != 2) || ((buffer[0] | (buffer[1] << 8)) < 216))
-               goto leave;
-
-       /* Read the CLR header address and size fields. These will be
-        * zero if the binary is not managed.
-        */
-       optional_header_offset = pe_header_offset + 24;
-       new_offset = lseek (file, optional_header_offset + 208, SEEK_SET);
-
-       if (new_offset != optional_header_offset + 208)
-               goto leave;
-
-       num_read = read (file, buffer, 8);
-       
-       /* We are not concerned with endianness, only with
-        * whether it is zero or not.
-        */
-       first_word = *(guint32 *)&buffer[0];
-       second_word = *(guint32 *)&buffer[4];
-       
-       if ((num_read != 8) || (first_word == 0) || (second_word == 0))
-               goto leave;
-       
-       managed = TRUE;
-
-leave:
-       close (file);
-       errno = original_errno;
-       return managed;
-}
-
-gboolean
-CreateProcessWithLogonW (const gunichar2 *username,
-                                                const gunichar2 *domain,
-                                                const gunichar2 *password,
-                                                const guint32 logonFlags,
-                                                const gunichar2 *appname,
-                                                const gunichar2 *cmdline,
-                                                guint32 create_flags,
-                                                gpointer env,
-                                                const gunichar2 *cwd,
-                                                WapiStartupInfo *startup,
-                                                WapiProcessInformation *process_info)
-{
-       /* FIXME: use user information */
-       return CreateProcess (appname, cmdline, NULL, NULL, FALSE, create_flags, env, cwd, startup, process_info);
-}
-
-static gboolean
-is_readable_or_executable (const char *prog)
-{
-       struct stat buf;
-       int a = access (prog, R_OK);
-       int b = access (prog, X_OK);
-       if (a != 0 && b != 0)
-               return FALSE;
-       if (stat (prog, &buf))
-               return FALSE;
-       if (S_ISREG (buf.st_mode))
-               return TRUE;
-       return FALSE;
-}
-
-static gboolean
-is_executable (const char *prog)
-{
-       struct stat buf;
-       if (access (prog, X_OK) != 0)
-               return FALSE;
-       if (stat (prog, &buf))
-               return FALSE;
-       if (S_ISREG (buf.st_mode))
-               return TRUE;
-       return FALSE;
-}
-
-static void
-switch_dir_separators (char *path)
-{
-       size_t i, pathLength = strlen(path);
-       
-       /* Turn all the slashes round the right way, except for \' */
-       /* There are probably other characters that need to be excluded as well. */
-       for (i = 0; i < pathLength; i++) {
-               if (path[i] == '\\' && i < pathLength - 1 && path[i+1] != '\'' )
-                       path[i] = '/';
-       }
-}
-
-gboolean CreateProcess (const gunichar2 *appname, const gunichar2 *cmdline,
-                       WapiSecurityAttributes *process_attrs G_GNUC_UNUSED,
-                       WapiSecurityAttributes *thread_attrs G_GNUC_UNUSED,
-                       gboolean inherit_handles, guint32 create_flags,
-                       gpointer new_environ, const gunichar2 *cwd,
-                       WapiStartupInfo *startup,
-                       WapiProcessInformation *process_info)
-{
-#if defined (HAVE_FORK) && defined (HAVE_EXECVE)
-       char *cmd = NULL, *prog = NULL, *full_prog = NULL, *args = NULL, *args_after_prog = NULL;
-       char *dir = NULL, **env_strings = NULL, **argv = NULL;
-       guint32 i, env_count = 0;
-       gboolean ret = FALSE;
-       gpointer handle = NULL;
-       WapiHandle_process process_handle = {0}, *process_handle_data;
-       GError *gerr = NULL;
-       int in_fd, out_fd, err_fd;
-       pid_t pid = 0;
-       int startup_pipe [2] = {-1, -1};
-       int dummy;
-       struct MonoProcess *mono_process;
-       gboolean fork_failed = FALSE;
-
-       mono_once (&process_sig_chld_once, process_add_sigchld_handler);
-
-       /* appname and cmdline specify the executable and its args:
-        *
-        * If appname is not NULL, it is the name of the executable.
-        * Otherwise the executable is the first token in cmdline.
-        *
-        * Executable searching:
-        *
-        * If appname is not NULL, it can specify the full path and
-        * file name, or else a partial name and the current directory
-        * will be used.  There is no additional searching.
-        *
-        * If appname is NULL, the first whitespace-delimited token in
-        * cmdline is used.  If the name does not contain a full
-        * directory path, the search sequence is:
-        *
-        * 1) The directory containing the current process
-        * 2) The current working directory
-        * 3) The windows system directory  (Ignored)
-        * 4) The windows directory (Ignored)
-        * 5) $PATH
-        *
-        * Just to make things more interesting, tokens can contain
-        * white space if they are surrounded by quotation marks.  I'm
-        * beginning to understand just why windows apps are generally
-        * so crap, with an API like this :-(
-        */
-       if (appname != NULL) {
-               cmd = mono_unicode_to_external (appname);
-               if (cmd == NULL) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unicode conversion returned NULL",
-                                  __func__);
-
-                       SetLastError (ERROR_PATH_NOT_FOUND);
-                       goto free_strings;
-               }
-
-               switch_dir_separators(cmd);
-       }
-       
-       if (cmdline != NULL) {
-               args = mono_unicode_to_external (cmdline);
-               if (args == NULL) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unicode conversion returned NULL", __func__);
-
-                       SetLastError (ERROR_PATH_NOT_FOUND);
-                       goto free_strings;
-               }
-       }
-
-       if (cwd != NULL) {
-               dir = mono_unicode_to_external (cwd);
-               if (dir == NULL) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unicode conversion returned NULL", __func__);
-
-                       SetLastError (ERROR_PATH_NOT_FOUND);
-                       goto free_strings;
-               }
-
-               /* Turn all the slashes round the right way */
-               switch_dir_separators(dir);
-       }
-       
-
-       /* We can't put off locating the executable any longer :-( */
-       if (cmd != NULL) {
-               char *unquoted;
-               if (g_ascii_isalpha (cmd[0]) && (cmd[1] == ':')) {
-                       /* Strip off the drive letter.  I can't
-                        * believe that CP/M holdover is still
-                        * visible...
-                        */
-                       g_memmove (cmd, cmd+2, strlen (cmd)-2);
-                       cmd[strlen (cmd)-2] = '\0';
-               }
-
-               unquoted = g_shell_unquote (cmd, NULL);
-               if (unquoted[0] == '/') {
-                       /* Assume full path given */
-                       prog = g_strdup (unquoted);
-
-                       /* Executable existing ? */
-                       if (!is_readable_or_executable (prog)) {
-                               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find executable %s",
-                                          __func__, prog);
-                               g_free (unquoted);
-                               SetLastError (ERROR_FILE_NOT_FOUND);
-                               goto free_strings;
-                       }
-               } else {
-                       /* Search for file named by cmd in the current
-                        * directory
-                        */
-                       char *curdir = g_get_current_dir ();
-
-                       prog = g_strdup_printf ("%s/%s", curdir, unquoted);
-                       g_free (curdir);
-
-                       /* And make sure it's readable */
-                       if (!is_readable_or_executable (prog)) {
-                               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find executable %s",
-                                          __func__, prog);
-                               g_free (unquoted);
-                               SetLastError (ERROR_FILE_NOT_FOUND);
-                               goto free_strings;
-                       }
-               }
-               g_free (unquoted);
-
-               args_after_prog = args;
-       } else {
-               char *token = NULL;
-               char quote;
-               
-               /* Dig out the first token from args, taking quotation
-                * marks into account
-                */
-
-               /* First, strip off all leading whitespace */
-               args = g_strchug (args);
-               
-               /* args_after_prog points to the contents of args
-                * after token has been set (otherwise argv[0] is
-                * duplicated)
-                */
-               args_after_prog = args;
-
-               /* Assume the opening quote will always be the first
-                * character
-                */
-               if (args[0] == '\"' || args [0] == '\'') {
-                       quote = args [0];
-                       for (i = 1; args[i] != '\0' && args[i] != quote; i++);
-                       if (args [i + 1] == '\0' || g_ascii_isspace (args[i+1])) {
-                               /* We found the first token */
-                               token = g_strndup (args+1, i-1);
-                               args_after_prog = g_strchug (args + i + 1);
-                       } else {
-                               /* Quotation mark appeared in the
-                                * middle of the token.  Just give the
-                                * whole first token, quotes and all,
-                                * to exec.
-                                */
-                       }
-               }
-               
-               if (token == NULL) {
-                       /* No quote mark, or malformed */
-                       for (i = 0; args[i] != '\0'; i++) {
-                               if (g_ascii_isspace (args[i])) {
-                                       token = g_strndup (args, i);
-                                       args_after_prog = args + i + 1;
-                                       break;
-                               }
-                       }
-               }
-
-               if (token == NULL && args[0] != '\0') {
-                       /* Must be just one token in the string */
-                       token = g_strdup (args);
-                       args_after_prog = NULL;
-               }
-               
-               if (token == NULL) {
-                       /* Give up */
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find what to exec", __func__);
-
-                       SetLastError (ERROR_PATH_NOT_FOUND);
-                       goto free_strings;
-               }
-               
-               /* Turn all the slashes round the right way. Only for
-                * the prg. name
-                */
-               switch_dir_separators(token);
-
-               if (g_ascii_isalpha (token[0]) && (token[1] == ':')) {
-                       /* Strip off the drive letter.  I can't
-                        * believe that CP/M holdover is still
-                        * visible...
-                        */
-                       g_memmove (token, token+2, strlen (token)-2);
-                       token[strlen (token)-2] = '\0';
-               }
-
-               if (token[0] == '/') {
-                       /* Assume full path given */
-                       prog = g_strdup (token);
-                       
-                       /* Executable existing ? */
-                       if (!is_readable_or_executable (prog)) {
-                               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find executable %s",
-                                          __func__, token);
-                               g_free (token);
-                               SetLastError (ERROR_FILE_NOT_FOUND);
-                               goto free_strings;
-                       }
-               } else {
-                       char *curdir = g_get_current_dir ();
-
-                       /* FIXME: Need to record the directory
-                        * containing the current process, and check
-                        * that for the new executable as the first
-                        * place to look
-                        */
-
-                       prog = g_strdup_printf ("%s/%s", curdir, token);
-                       g_free (curdir);
-
-                       /* I assume X_OK is the criterion to use,
-                        * rather than F_OK
-                        *
-                        * X_OK is too strict *if* the target is a CLR binary
-                        */
-                       if (!is_readable_or_executable (prog)) {
-                               g_free (prog);
-                               prog = g_find_program_in_path (token);
-                               if (prog == NULL) {
-                                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find executable %s", __func__, token);
-
-                                       g_free (token);
-                                       SetLastError (ERROR_FILE_NOT_FOUND);
-                                       goto free_strings;
-                               }
-                       }
-               }
-
-               g_free (token);
-       }
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Exec prog [%s] args [%s]", __func__, prog,
-                  args_after_prog);
-       
-       /* Check for CLR binaries; if found, we will try to invoke
-        * them using the same mono binary that started us.
-        */
-       if (is_managed_binary (prog)) {
-               gunichar2 *newapp = NULL, *newcmd;
-               gsize bytes_ignored;
-
-               if (cli_launcher)
-                       newapp = mono_unicode_from_external (cli_launcher, &bytes_ignored);
-               else
-                       newapp = mono_unicode_from_external ("mono", &bytes_ignored);
-
-               if (newapp != NULL) {
-                       if (appname != NULL) {
-                               newcmd = utf16_concat (utf16_quote, newapp, utf16_quote, utf16_space,
-                                                      appname, utf16_space,
-                                                      cmdline, NULL);
-                       } else {
-                               newcmd = utf16_concat (utf16_quote, newapp, utf16_quote, utf16_space,
-                                                      cmdline, NULL);
-                       }
-                       
-                       g_free ((gunichar2 *)newapp);
-                       
-                       if (newcmd != NULL) {
-                               ret = CreateProcess (NULL, newcmd,
-                                                    process_attrs,
-                                                    thread_attrs,
-                                                    inherit_handles,
-                                                    create_flags, new_environ,
-                                                    cwd, startup,
-                                                    process_info);
-                               
-                               g_free ((gunichar2 *)newcmd);
-                               
-                               goto free_strings;
-                       }
-               }
-       } else {
-               if (!is_executable (prog)) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Executable permisson not set on %s", __func__, prog);
-                       SetLastError (ERROR_ACCESS_DENIED);
-                       goto free_strings;
-               }
-       }
-
-       if (args_after_prog != NULL && *args_after_prog) {
-               char *qprog;
-
-               qprog = g_shell_quote (prog);
-               full_prog = g_strconcat (qprog, " ", args_after_prog, NULL);
-               g_free (qprog);
-       } else {
-               full_prog = g_shell_quote (prog);
-       }
-
-       ret = g_shell_parse_argv (full_prog, NULL, &argv, &gerr);
-       if (ret == FALSE) {
-               g_message ("CreateProcess: %s\n", gerr->message);
-               g_error_free (gerr);
-               gerr = NULL;
-               goto free_strings;
-       }
-
-       if (startup != NULL && startup->dwFlags & STARTF_USESTDHANDLES) {
-               in_fd = GPOINTER_TO_UINT (startup->hStdInput);
-               out_fd = GPOINTER_TO_UINT (startup->hStdOutput);
-               err_fd = GPOINTER_TO_UINT (startup->hStdError);
-       } else {
-               in_fd = GPOINTER_TO_UINT (GetStdHandle (STD_INPUT_HANDLE));
-               out_fd = GPOINTER_TO_UINT (GetStdHandle (STD_OUTPUT_HANDLE));
-               err_fd = GPOINTER_TO_UINT (GetStdHandle (STD_ERROR_HANDLE));
-       }
-       
-       process_handle.proc_name = g_strdup (prog);
-
-       process_set_defaults (&process_handle);
-       
-       handle = mono_w32handle_new (MONO_W32HANDLE_PROCESS, &process_handle);
-       if (handle == INVALID_HANDLE_VALUE) {
-               g_warning ("%s: error creating process handle", __func__);
-
-               ret = FALSE;
-               SetLastError (ERROR_OUTOFMEMORY);
-               goto free_strings;
-       }
-
-       /* new_environ is a block of NULL-terminated strings, which
-        * is itself NULL-terminated. Of course, passing an array of
-        * string pointers would have made things too easy :-(
-        *
-        * If new_environ is not NULL it specifies the entire set of
-        * environment variables in the new process.  Otherwise the
-        * new process inherits the same environment.
-        */
-       if (new_environ) {
-               gunichar2 *new_environp;
-
-               /* Count the number of strings */
-               for (new_environp = (gunichar2 *)new_environ; *new_environp;
-                    new_environp++) {
-                       env_count++;
-                       while (*new_environp) {
-                               new_environp++;
-                       }
-               }
-
-               /* +2: one for the process handle value, and the last
-                * one is NULL
-                */
-               env_strings = g_new0 (char *, env_count + 2);
-               
-               /* Copy each environ string into 'strings' turning it
-                * into utf8 (or the requested encoding) at the same
-                * time
-                */
-               env_count = 0;
-               for (new_environp = (gunichar2 *)new_environ; *new_environp;
-                    new_environp++) {
-                       env_strings[env_count] = mono_unicode_to_external (new_environp);
-                       env_count++;
-                       while (*new_environp) {
-                               new_environp++;
-                       }
-               }
-       } else {
-               for (i = 0; environ[i] != NULL; i++)
-                       env_count++;
-
-               /* +2: one for the process handle value, and the last
-                * one is NULL
-                */
-               env_strings = g_new0 (char *, env_count + 2);
-               
-               /* Copy each environ string into 'strings' turning it
-                * into utf8 (or the requested encoding) at the same
-                * time
-                */
-               env_count = 0;
-               for (i = 0; environ[i] != NULL; i++) {
-                       env_strings[env_count] = g_strdup (environ[i]);
-                       env_count++;
-               }
-       }
-
-       /* Create a pipe to make sure the child doesn't exit before 
-        * we can add the process to the linked list of mono_processes */
-       if (pipe (startup_pipe) == -1) {
-               /* Could not create the pipe to synchroniz process startup. We'll just not synchronize.
-                * This is just for a very hard to hit race condition in the first place */
-               startup_pipe [0] = startup_pipe [1] = -1;
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: new process startup not synchronized. We may not notice if the newly created process exits immediately.", __func__);
-       }
-
-       switch (pid = fork ()) {
-       case -1: /* Error */ {
-               SetLastError (ERROR_OUTOFMEMORY);
-               ret = FALSE;
-               fork_failed = TRUE;
-               break;
-       }
-       case 0: /* Child */ {
-               if (startup_pipe [0] != -1) {
-                       /* Wait until the parent has updated it's internal data */
-                       ssize_t _i G_GNUC_UNUSED = read (startup_pipe [0], &dummy, 1);
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: child: parent has completed its setup", __func__);
-                       close (startup_pipe [0]);
-                       close (startup_pipe [1]);
-               }
-               
-               /* should we detach from the process group? */
-
-               /* Connect stdin, stdout and stderr */
-               dup2 (in_fd, 0);
-               dup2 (out_fd, 1);
-               dup2 (err_fd, 2);
-
-               if (inherit_handles != TRUE) {
-                       /* FIXME: do something here */
-               }
-               
-               /* Close all file descriptors */
-               for (i = mono_w32handle_fd_reserve - 1; i > 2; i--)
-                       close (i);
-
-#ifdef DEBUG_ENABLED
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: exec()ing [%s] in dir [%s]", __func__, cmd,
-                          dir == NULL?".":dir);
-               for (i = 0; argv[i] != NULL; i++)
-                       g_message ("arg %d: [%s]", i, argv[i]);
-               
-               for (i = 0; env_strings[i] != NULL; i++)
-                       g_message ("env %d: [%s]", i, env_strings[i]);
-#endif
-
-               /* set cwd */
-               if (dir != NULL && chdir (dir) == -1) {
-                       /* set error */
-                       _exit (-1);
-               }
-               
-               /* exec */
-               execve (argv[0], argv, env_strings);
-               
-               /* set error */
-               _exit (-1);
-
-               break;
-       }
-       default: /* Parent */ {
-               process_handle_data = lookup_process_handle (handle);
-               if (!process_handle_data) {
-                       g_warning ("%s: error looking up process handle %p", __func__, handle);
-                       mono_w32handle_unref (handle);
-               } else {
-                       process_handle_data->id = pid;
-
-                       /* Add our mono_process into the linked list of mono_processes */
-                       mono_process = (struct MonoProcess *) g_malloc0 (sizeof (struct MonoProcess));
-                       mono_process->pid = pid;
-                       mono_process->handle_count = 1;
-                       mono_os_sem_init (&mono_process->exit_sem, 0);
-
-                       /* Keep the process handle artificially alive until the process
-                        * exits so that the information in the handle isn't lost. */
-                       mono_w32handle_ref (handle);
-                       mono_process->handle = handle;
-
-                       process_handle_data->mono_process = mono_process;
-
-                       mono_os_mutex_lock (&mono_processes_mutex);
-                       mono_process->next = mono_processes;
-                       mono_processes = mono_process;
-                       mono_os_mutex_unlock (&mono_processes_mutex);
-
-                       if (process_info != NULL) {
-                               process_info->hProcess = handle;
-                               process_info->dwProcessId = pid;
-
-                               /* FIXME: we might need to handle the thread info some day */
-                               process_info->hThread = INVALID_HANDLE_VALUE;
-                               process_info->dwThreadId = 0;
-                       }
-               }
-
-               break;
-       }
-       }
-
-       if (fork_failed)
-               mono_w32handle_unref (handle);
-
-       if (startup_pipe [1] != -1) {
-               /* Write 1 byte, doesn't matter what */
-               ssize_t _i G_GNUC_UNUSED = write (startup_pipe [1], startup_pipe, 1);
-               close (startup_pipe [0]);
-               close (startup_pipe [1]);
-       }
-
-free_strings:
-       if (cmd)
-               g_free (cmd);
-       if (full_prog)
-               g_free (full_prog);
-       if (prog)
-               g_free (prog);
-       if (args)
-               g_free (args);
-       if (dir)
-               g_free (dir);
-       if (env_strings)
-               g_strfreev (env_strings);
-       if (argv)
-               g_strfreev (argv);
-       
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning handle %p for pid %d", __func__, handle, pid);
-
-       /* Check if something needs to be cleaned up. */
-       mono_processes_cleanup ();
-       
-       return ret;
-#else
-       SetLastError (ERROR_NOT_SUPPORTED);
-       return FALSE;
-#endif // defined (HAVE_FORK) && defined (HAVE_EXECVE)
-}
-               
-static void
-process_set_name (WapiHandle_process *process_handle)
-{
-       char *progname, *utf8_progname, *slash;
-       
-       progname = g_get_prgname ();
-       utf8_progname = mono_utf8_from_external (progname);
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: using [%s] as prog name", __func__, progname);
-
-       if (utf8_progname) {
-               slash = strrchr (utf8_progname, '/');
-               if (slash)
-                       process_handle->proc_name = g_strdup (slash+1);
-               else
-                       process_handle->proc_name = g_strdup (utf8_progname);
-               g_free (utf8_progname);
-       }
-}
-
-void
-_wapi_processes_init (void)
-{
-       pid_t pid = wapi_getpid ();
-       WapiHandle_process process_handle = {0};
-
-       mono_w32handle_register_ops (MONO_W32HANDLE_PROCESS, &_wapi_process_ops);
-
-       mono_w32handle_register_capabilities (MONO_W32HANDLE_PROCESS,
-               (MonoW32HandleCapability)(MONO_W32HANDLE_CAP_WAIT | MONO_W32HANDLE_CAP_SPECIAL_WAIT));
-       
-       process_handle.id = pid;
-
-       process_set_defaults (&process_handle);
-       process_set_name (&process_handle);
-
-       current_process = mono_w32handle_new (MONO_W32HANDLE_PROCESS,
-                                           &process_handle);
-       g_assert (current_process);
-
-       mono_os_mutex_init (&mono_processes_mutex);
-}
-
-gpointer
-_wapi_process_duplicate (void)
-{
-       mono_w32handle_ref (current_process);
-       
-       return current_process;
-}
-
-/* Returns a pseudo handle that doesn't need to be closed afterwards */
-gpointer
-GetCurrentProcess (void)
-{
-       return _WAPI_PROCESS_CURRENT;
-}
-
-guint32
-GetProcessId (gpointer handle)
-{
-       WapiHandle_process *process_handle;
-
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle))
-               /* This is a pseudo handle */
-               return WAPI_HANDLE_TO_PID (handle);
-       
-       process_handle = lookup_process_handle (handle);
-       if (!process_handle) {
-               SetLastError (ERROR_INVALID_HANDLE);
-               return 0;
-       }
-       
-       return process_handle->id;
-}
-
-static gboolean
-process_open_compare (gpointer handle, gpointer user_data)
-{
-       pid_t wanted_pid;
-       WapiHandle_process *process_handle;
-       pid_t checking_pid;
-
-       g_assert (!WAPI_IS_PSEUDO_PROCESS_HANDLE (handle));
-       
-       process_handle = lookup_process_handle (handle);
-       g_assert (process_handle);
-       
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: looking at process %d", __func__, process_handle->id);
-
-       checking_pid = process_handle->id;
-
-       if (checking_pid == 0)
-               return FALSE;
-       
-       wanted_pid = GPOINTER_TO_UINT (user_data);
-
-       /* It's possible to have more than one process handle with the
-        * same pid, but only the one running process can be
-        * unsignalled
-        */
-       if (checking_pid == wanted_pid &&
-           !mono_w32handle_issignalled (handle)) {
-               /* If the handle is blown away in the window between
-                * returning TRUE here and mono_w32handle_search pinging
-                * the timestamp, the search will continue
-                */
-               return TRUE;
-       } else {
-               return FALSE;
-       }
-}
-
-gboolean
-CloseProcess (gpointer handle)
-{
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (handle))
-               return TRUE;
-       return CloseHandle (handle);
-}
-
-/*
- * The caller owns the returned handle and must call CloseProcess () on it to clean it up.
- */
-gpointer
-OpenProcess (guint32 req_access G_GNUC_UNUSED, gboolean inherit G_GNUC_UNUSED, guint32 pid)
-{
-       /* Find the process handle that corresponds to pid */
-       gpointer handle = NULL;
-       
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: looking for process %d", __func__, pid);
-
-       handle = mono_w32handle_search (MONO_W32HANDLE_PROCESS,
-                                     process_open_compare,
-                                     GUINT_TO_POINTER (pid), NULL, TRUE);
-       if (handle == 0) {
-               if (is_pid_valid (pid)) {
-                       /* Return a pseudo handle for processes we
-                        * don't have handles for
-                        */
-                       return WAPI_PID_TO_HANDLE (pid);
-               } else {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find pid %d", __func__, pid);
-
-                       SetLastError (ERROR_PROC_NOT_FOUND);
-       
-                       return NULL;
-               }
-       }
-
-       /* mono_w32handle_search () already added a ref */
-       return handle;
-}
-
-gboolean
-GetExitCodeProcess (gpointer process, guint32 *code)
-{
-       WapiHandle_process *process_handle;
-       guint32 pid = -1;
-       gboolean alerted;
-       
-       if (!code)
-               return FALSE;
-       
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               pid = WAPI_HANDLE_TO_PID (process);
-               /* This is a pseudo handle, so we don't know what the
-                * exit code was, but we can check whether it's alive or not
-                */
-               if (is_pid_valid (pid)) {
-                       *code = STILL_ACTIVE;
-                       return TRUE;
-               } else {
-                       *code = -1;
-                       return TRUE;
-               }
-       }
-
-       process_handle = lookup_process_handle (process);
-       if (!process_handle) {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-               
-               return FALSE;
-       }
-
-       if (process_handle->id == wapi_getpid ()) {
-               *code = STILL_ACTIVE;
-               return TRUE;
-       }
-
-       /* A process handle is only signalled if the process has exited
-        * and has been waited for */
-
-       /* Make sure any process exit has been noticed, before
-        * checking if the process is signalled.  Fixes bug 325463.
-        */
-       process_wait (process, 0, &alerted);
-       
-       if (mono_w32handle_issignalled (process))
-               *code = process_handle->exitstatus;
-       else
-               *code = STILL_ACTIVE;
-       
-       return TRUE;
-}
-
-gboolean
-GetProcessTimes (gpointer process, WapiFileTime *create_time,
-                                WapiFileTime *exit_time, WapiFileTime *kernel_time,
-                                WapiFileTime *user_time)
-{
-       WapiHandle_process *process_handle;
-       gboolean ku_times_set = FALSE;
-       
-       if (create_time == NULL || exit_time == NULL || kernel_time == NULL ||
-               user_time == NULL)
-               /* Not sure if w32 allows NULLs here or not */
-               return FALSE;
-       
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               gpointer pid = GINT_TO_POINTER (WAPI_HANDLE_TO_PID(process));
-               gint64 start_ticks, user_ticks, kernel_ticks;
-
-               mono_process_get_times (pid, &start_ticks, &user_ticks, &kernel_ticks);
-
-               _wapi_guint64_to_filetime (start_ticks, create_time);
-               _wapi_guint64_to_filetime (user_ticks, kernel_time);
-               _wapi_guint64_to_filetime (kernel_ticks, user_time);
-
-               return TRUE;
-       }
-
-       process_handle = lookup_process_handle (process);
-       if (!process_handle) {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-               
-               return FALSE;
-       }
-       
-       *create_time = process_handle->create_time;
-
-       /* A process handle is only signalled if the process has
-        * exited.  Otherwise exit_time isn't set
-        */
-       if (mono_w32handle_issignalled (process))
-               *exit_time = process_handle->exit_time;
-
-#ifdef HAVE_GETRUSAGE
-       if (process_handle->id == getpid ()) {
-               struct rusage time_data;
-               if (getrusage (RUSAGE_SELF, &time_data) == 0) {
-                       guint64 tick_val;
-                       ku_times_set = TRUE;
-                       tick_val = (guint64)time_data.ru_utime.tv_sec * 10000000 + (guint64)time_data.ru_utime.tv_usec * 10;
-                       _wapi_guint64_to_filetime (tick_val, user_time);
-                       tick_val = (guint64)time_data.ru_stime.tv_sec * 10000000 + (guint64)time_data.ru_stime.tv_usec * 10;
-                       _wapi_guint64_to_filetime (tick_val, kernel_time);
-               }
-       }
-#endif
-       if (!ku_times_set) {
-               memset (kernel_time, 0, sizeof (WapiFileTime));
-               memset (user_time, 0, sizeof (WapiFileTime));
-       }
-
-       return TRUE;
-}
-
-typedef struct
-{
-       gpointer address_start;
-       gpointer address_end;
-       char *perms;
-       gpointer address_offset;
-       guint64 device;
-       guint64 inode;
-       char *filename;
-} WapiProcModule;
-
-static void free_procmodule (WapiProcModule *mod)
-{
-       if (mod->perms != NULL) {
-               g_free (mod->perms);
-       }
-       if (mod->filename != NULL) {
-               g_free (mod->filename);
-       }
-       g_free (mod);
-}
-
-static gint find_procmodule (gconstpointer a, gconstpointer b)
-{
-       WapiProcModule *want = (WapiProcModule *)a;
-       WapiProcModule *compare = (WapiProcModule *)b;
-       
-       if ((want->device == compare->device) &&
-           (want->inode == compare->inode)) {
-               return(0);
-       } else {
-               return(1);
-       }
-}
-
-#if defined(USE_OSX_LOADER)
-#include <mach-o/dyld.h>
-#include <mach-o/getsect.h>
-
-static GSList *load_modules (void)
-{
-       GSList *ret = NULL;
-       WapiProcModule *mod;
-       uint32_t count = _dyld_image_count ();
-       int i = 0;
-
-       for (i = 0; i < count; i++) {
-#if SIZEOF_VOID_P == 8
-               const struct mach_header_64 *hdr;
-               const struct section_64 *sec;
-#else
-               const struct mach_header *hdr;
-               const struct section *sec;
-#endif
-               const char *name;
-
-               name = _dyld_get_image_name (i);
-#if SIZEOF_VOID_P == 8
-               hdr = (const struct mach_header_64*)_dyld_get_image_header (i);
-               sec = getsectbynamefromheader_64 (hdr, SEG_DATA, SECT_DATA);
-#else
-               hdr = _dyld_get_image_header (i);
-               sec = getsectbynamefromheader (hdr, SEG_DATA, SECT_DATA);
-#endif
-
-               /* Some dynlibs do not have data sections on osx (#533893) */
-               if (sec == 0) {
-                       continue;
-               }
-                       
-               mod = g_new0 (WapiProcModule, 1);
-               mod->address_start = GINT_TO_POINTER (sec->addr);
-               mod->address_end = GINT_TO_POINTER (sec->addr+sec->size);
-               mod->perms = g_strdup ("r--p");
-               mod->address_offset = 0;
-               mod->device = makedev (0, 0);
-               mod->inode = i;
-               mod->filename = g_strdup (name); 
-               
-               if (g_slist_find_custom (ret, mod, find_procmodule) == NULL) {
-                       ret = g_slist_prepend (ret, mod);
-               } else {
-                       free_procmodule (mod);
-               }
-       }
-
-       ret = g_slist_reverse (ret);
-       
-       return(ret);
-}
-#elif defined(USE_BSD_LOADER)
-#include <link.h>
-static int load_modules_callback (struct dl_phdr_info *info, size_t size, void *ptr)
-{
-       if (size < offsetof (struct dl_phdr_info, dlpi_phnum)
-           + sizeof (info->dlpi_phnum))
-               return (-1);
-
-       struct dl_phdr_info *cpy = g_calloc (1, sizeof(struct dl_phdr_info));
-       if (!cpy)
-               return (-1);
-
-       memcpy(cpy, info, sizeof(*info));
-
-       g_ptr_array_add ((GPtrArray *)ptr, cpy);
-
-       return (0);
-}
-
-static GSList *load_modules (void)
-{
-       GSList *ret = NULL;
-       WapiProcModule *mod;
-       GPtrArray *dlarray = g_ptr_array_new();
-       int i;
-
-       if (dl_iterate_phdr(load_modules_callback, dlarray) < 0)
-               return (ret);
-
-       for (i = 0; i < dlarray->len; i++) {
-               struct dl_phdr_info *info = g_ptr_array_index (dlarray, i);
-
-               mod = g_new0 (WapiProcModule, 1);
-               mod->address_start = (gpointer)(info->dlpi_addr + info->dlpi_phdr[0].p_vaddr);
-               mod->address_end = (gpointer)(info->dlpi_addr +
-                                       info->dlpi_phdr[info->dlpi_phnum - 1].p_vaddr);
-               mod->perms = g_strdup ("r--p");
-               mod->address_offset = 0;
-               mod->inode = i;
-               mod->filename = g_strdup (info->dlpi_name); 
-
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: inode=%d, filename=%s, address_start=%p, address_end=%p", __func__,
-                                  mod->inode, mod->filename, mod->address_start, mod->address_end);
-
-               g_free (info);
-
-               if (g_slist_find_custom (ret, mod, find_procmodule) == NULL) {
-                       ret = g_slist_prepend (ret, mod);
-               } else {
-                       free_procmodule (mod);
-               }
-       }
-
-       g_ptr_array_free (dlarray, TRUE);
-
-       ret = g_slist_reverse (ret);
-
-       return(ret);
-}
-#elif defined(USE_HAIKU_LOADER)
-
-static GSList *load_modules (void)
-{
-       GSList *ret = NULL;
-       WapiProcModule *mod;
-       int32 cookie = 0;
-       image_info imageInfo;
-
-       while (get_next_image_info (B_CURRENT_TEAM, &cookie, &imageInfo) == B_OK) {
-               mod = g_new0 (WapiProcModule, 1);
-               mod->device = imageInfo.device;
-               mod->inode = imageInfo.node;
-               mod->filename = g_strdup (imageInfo.name);
-               mod->address_start = MIN (imageInfo.text, imageInfo.data);
-               mod->address_end = MAX ((uint8_t*)imageInfo.text + imageInfo.text_size,
-                       (uint8_t*)imageInfo.data + imageInfo.data_size);
-               mod->perms = g_strdup ("r--p");
-               mod->address_offset = 0;
-
-               if (g_slist_find_custom (ret, mod, find_procmodule) == NULL) {
-                       ret = g_slist_prepend (ret, mod);
-               } else {
-                       free_procmodule (mod);
-               }
-       }
-
-       ret = g_slist_reverse (ret);
-
-       return ret;
-}
-#else
-static GSList *load_modules (FILE *fp)
-{
-       GSList *ret = NULL;
-       WapiProcModule *mod;
-       char buf[MAXPATHLEN + 1], *p, *endp;
-       char *start_start, *end_start, *prot_start, *offset_start;
-       char *maj_dev_start, *min_dev_start, *inode_start, prot_buf[5];
-       gpointer address_start, address_end, address_offset;
-       guint32 maj_dev, min_dev;
-       guint64 inode;
-       guint64 device;
-       
-       while (fgets (buf, sizeof(buf), fp)) {
-               p = buf;
-               while (g_ascii_isspace (*p)) ++p;
-               start_start = p;
-               if (!g_ascii_isxdigit (*start_start)) {
-                       continue;
-               }
-               address_start = (gpointer)strtoul (start_start, &endp, 16);
-               p = endp;
-               if (*p != '-') {
-                       continue;
-               }
-               
-               ++p;
-               end_start = p;
-               if (!g_ascii_isxdigit (*end_start)) {
-                       continue;
-               }
-               address_end = (gpointer)strtoul (end_start, &endp, 16);
-               p = endp;
-               if (!g_ascii_isspace (*p)) {
-                       continue;
-               }
-               
-               while (g_ascii_isspace (*p)) ++p;
-               prot_start = p;
-               if (*prot_start != 'r' && *prot_start != '-') {
-                       continue;
-               }
-               memcpy (prot_buf, prot_start, 4);
-               prot_buf[4] = '\0';
-               while (!g_ascii_isspace (*p)) ++p;
-               
-               while (g_ascii_isspace (*p)) ++p;
-               offset_start = p;
-               if (!g_ascii_isxdigit (*offset_start)) {
-                       continue;
-               }
-               address_offset = (gpointer)strtoul (offset_start, &endp, 16);
-               p = endp;
-               if (!g_ascii_isspace (*p)) {
-                       continue;
-               }
-               
-               while(g_ascii_isspace (*p)) ++p;
-               maj_dev_start = p;
-               if (!g_ascii_isxdigit (*maj_dev_start)) {
-                       continue;
-               }
-               maj_dev = strtoul (maj_dev_start, &endp, 16);
-               p = endp;
-               if (*p != ':') {
-                       continue;
-               }
-               
-               ++p;
-               min_dev_start = p;
-               if (!g_ascii_isxdigit (*min_dev_start)) {
-                       continue;
-               }
-               min_dev = strtoul (min_dev_start, &endp, 16);
-               p = endp;
-               if (!g_ascii_isspace (*p)) {
-                       continue;
-               }
-               
-               while (g_ascii_isspace (*p)) ++p;
-               inode_start = p;
-               if (!g_ascii_isxdigit (*inode_start)) {
-                       continue;
-               }
-               inode = (guint64)strtol (inode_start, &endp, 10);
-               p = endp;
-               if (!g_ascii_isspace (*p)) {
-                       continue;
-               }
-
-               device = makedev ((int)maj_dev, (int)min_dev);
-               if ((device == 0) &&
-                   (inode == 0)) {
-                       continue;
-               }
-               
-               while(g_ascii_isspace (*p)) ++p;
-               /* p now points to the filename */
-
-               mod = g_new0 (WapiProcModule, 1);
-               mod->address_start = address_start;
-               mod->address_end = address_end;
-               mod->perms = g_strdup (prot_buf);
-               mod->address_offset = address_offset;
-               mod->device = device;
-               mod->inode = inode;
-               mod->filename = g_strdup (g_strstrip (p));
-               
-               if (g_slist_find_custom (ret, mod, find_procmodule) == NULL) {
-                       ret = g_slist_prepend (ret, mod);
-               } else {
-                       free_procmodule (mod);
-               }
-       }
-
-       ret = g_slist_reverse (ret);
-       
-       return(ret);
-}
-#endif
-
-static gboolean match_procname_to_modulename (char *procname, char *modulename)
-{
-       char* lastsep = NULL;
-       char* lastsep2 = NULL;
-       char* pname = NULL;
-       char* mname = NULL;
-       gboolean result = FALSE;
-
-       if (procname == NULL || modulename == NULL)
-               return (FALSE);
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: procname=\"%s\", modulename=\"%s\"", __func__, procname, modulename);
-       pname = mono_path_resolve_symlinks (procname);
-       mname = mono_path_resolve_symlinks (modulename);
-
-       if (!strcmp (pname, mname))
-               result = TRUE;
-
-       if (!result) {
-               lastsep = strrchr (mname, '/');
-               if (lastsep)
-                       if (!strcmp (lastsep+1, pname))
-                               result = TRUE;
-               if (!result) {
-                       lastsep2 = strrchr (pname, '/');
-                       if (lastsep2){
-                               if (lastsep) {
-                                       if (!strcmp (lastsep+1, lastsep2+1))
-                                               result = TRUE;
-                               } else {
-                                       if (!strcmp (mname, lastsep2+1))
-                                               result = TRUE;
-                               }
-                       }
-               }
-       }
-
-       g_free (pname);
-       g_free (mname);
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: result is %d", __func__, result);
-       return result;
-}
-
-#if !(defined(USE_OSX_LOADER) || defined(USE_BSD_LOADER) || defined(USE_HAIKU_LOADER))
-static FILE *
-open_process_map (int pid, const char *mode)
-{
-       FILE *fp = NULL;
-       const char *proc_path[] = {
-               "/proc/%d/maps",        /* GNU/Linux */
-               "/proc/%d/map",         /* FreeBSD */
-               NULL
-       };
-       int i;
-       char *filename;
-
-       for (i = 0; fp == NULL && proc_path [i]; i++) {
-               filename = g_strdup_printf (proc_path[i], pid);
-               fp = fopen (filename, mode);
-               g_free (filename);
-       }
-
-       return fp;
-}
-#endif
-
-static char *get_process_name_from_proc (pid_t pid);
-
-gboolean EnumProcessModules (gpointer process, gpointer *modules,
-                            guint32 size, guint32 *needed)
-{
-       WapiHandle_process *process_handle;
-#if !defined(USE_OSX_LOADER) && !defined(USE_BSD_LOADER)
-       FILE *fp;
-#endif
-       GSList *mods = NULL;
-       WapiProcModule *module;
-       guint32 count, avail = size / sizeof(gpointer);
-       int i;
-       pid_t pid;
-       char *proc_name = NULL;
-       
-       /* Store modules in an array of pointers (main module as
-        * modules[0]), using the load address for each module as a
-        * token.  (Use 'NULL' as an alternative for the main module
-        * so that the simple implementation can just return one item
-        * for now.)  Get the info from /proc/<pid>/maps on linux,
-        * /proc/<pid>/map on FreeBSD, other systems will have to
-        * implement /dev/kmem reading or whatever other horrid
-        * technique is needed.
-        */
-       if (size < sizeof(gpointer))
-               return FALSE;
-
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               pid = WAPI_HANDLE_TO_PID (process);
-               proc_name = get_process_name_from_proc (pid);
-       } else {
-               process_handle = lookup_process_handle (process);
-               if (!process_handle) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-               
-                       return FALSE;
-               }
-               pid = process_handle->id;
-               proc_name = g_strdup (process_handle->proc_name);
-       }
-       
-#if defined(USE_OSX_LOADER) || defined(USE_BSD_LOADER) || defined(USE_HAIKU_LOADER)
-       mods = load_modules ();
-       if (!proc_name) {
-               modules[0] = NULL;
-               *needed = sizeof(gpointer);
-               return TRUE;
-       }
-#else
-       fp = open_process_map (pid, "r");
-       if (!fp) {
-               /* No /proc/<pid>/maps so just return the main module
-                * shortcut for now
-                */
-               modules[0] = NULL;
-               *needed = sizeof(gpointer);
-               g_free (proc_name);
-               return TRUE;
-       }
-       mods = load_modules (fp);
-       fclose (fp);
-#endif
-       count = g_slist_length (mods);
-               
-       /* count + 1 to leave slot 0 for the main module */
-       *needed = sizeof(gpointer) * (count + 1);
-
-       /*
-        * Use the NULL shortcut, as the first line in
-        * /proc/<pid>/maps isn't the executable, and we need
-        * that first in the returned list. Check the module name 
-        * to see if it ends with the proc name and substitute 
-        * the first entry with it.  FIXME if this turns out to 
-        * be a problem.
-        */
-       modules[0] = NULL;
-       for (i = 0; i < (avail - 1) && i < count; i++) {
-               module = (WapiProcModule *)g_slist_nth_data (mods, i);
-               if (modules[0] != NULL)
-                       modules[i] = module->address_start;
-               else if (match_procname_to_modulename (proc_name, module->filename))
-                       modules[0] = module->address_start;
-               else
-                       modules[i + 1] = module->address_start;
-       }
-               
-       for (i = 0; i < count; i++) {
-               free_procmodule ((WapiProcModule *)g_slist_nth_data (mods, i));
-       }
-       g_slist_free (mods);
-       g_free (proc_name);
-       
-       return TRUE;
-}
-
-static char *
-get_process_name_from_proc (pid_t pid)
-{
-#if defined(USE_BSD_LOADER)
-       int mib [6];
-       size_t size;
-       struct kinfo_proc *pi;
-#elif defined(USE_OSX_LOADER)
-#if !(!defined (__mono_ppc__) && defined (TARGET_OSX))
-       size_t size;
-       struct kinfo_proc *pi;
-       int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };
-#endif
-#else
-       FILE *fp;
-       char *filename = NULL;
-#endif
-       char buf[256];
-       char *ret = NULL;
-
-#if defined(PLATFORM_SOLARIS)
-       filename = g_strdup_printf ("/proc/%d/psinfo", pid);
-       if ((fp = fopen (filename, "r")) != NULL) {
-               struct psinfo info;
-               int nread;
-
-               nread = fread (&info, sizeof (info), 1, fp);
-               if (nread == 1) {
-                       ret = g_strdup (info.pr_fname);
-               }
-
-               fclose (fp);
-       }
-       g_free (filename);
-#elif defined(USE_OSX_LOADER)
-#if !defined (__mono_ppc__) && defined (TARGET_OSX)
-       /* No proc name on OSX < 10.5 nor ppc nor iOS */
-       memset (buf, '\0', sizeof(buf));
-       proc_name (pid, buf, sizeof(buf));
-
-       // Fixes proc_name triming values to 15 characters #32539
-       if (strlen (buf) >= MAXCOMLEN - 1) {
-               char path_buf [PROC_PIDPATHINFO_MAXSIZE];
-               char *name_buf;
-               int path_len;
-
-               memset (path_buf, '\0', sizeof(path_buf));
-               path_len = proc_pidpath (pid, path_buf, sizeof(path_buf));
-
-               if (path_len > 0 && path_len < sizeof(path_buf)) {
-                       name_buf = path_buf + path_len;
-                       for(;name_buf > path_buf; name_buf--) {
-                               if (name_buf [0] == '/') {
-                                       name_buf++;
-                                       break;
-                               }
-                       }
-
-                       if (memcmp (buf, name_buf, MAXCOMLEN - 1) == 0)
-                               ret = g_strdup (name_buf);
-               }
-       }
-
-       if (ret == NULL && strlen (buf) > 0)
-               ret = g_strdup (buf);
-#else
-       if (sysctl(mib, 4, NULL, &size, NULL, 0) < 0)
-               return(ret);
-
-       if ((pi = g_malloc (size)) == NULL)
-               return(ret);
-
-       if (sysctl (mib, 4, pi, &size, NULL, 0) < 0) {
-               if (errno == ENOMEM) {
-                       g_free (pi);
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Didn't allocate enough memory for kproc info", __func__);
-               }
-               return(ret);
-       }
-
-       if (strlen (pi->kp_proc.p_comm) > 0)
-               ret = g_strdup (pi->kp_proc.p_comm);
-
-       g_free (pi);
-#endif
-#elif defined(USE_BSD_LOADER)
-#if defined(__FreeBSD__)
-       mib [0] = CTL_KERN;
-       mib [1] = KERN_PROC;
-       mib [2] = KERN_PROC_PID;
-       mib [3] = pid;
-       if (sysctl(mib, 4, NULL, &size, NULL, 0) < 0) {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: sysctl() failed: %d", __func__, errno);
-               return(ret);
-       }
-
-       if ((pi = g_malloc (size)) == NULL)
-               return(ret);
-
-       if (sysctl (mib, 4, pi, &size, NULL, 0) < 0) {
-               if (errno == ENOMEM) {
-                       g_free (pi);
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Didn't allocate enough memory for kproc info", __func__);
-               }
-               return(ret);
-       }
-
-       if (strlen (pi->ki_comm) > 0)
-               ret = g_strdup (pi->ki_comm);
-       g_free (pi);
-#elif defined(__OpenBSD__)
-       mib [0] = CTL_KERN;
-       mib [1] = KERN_PROC;
-       mib [2] = KERN_PROC_PID;
-       mib [3] = pid;
-       mib [4] = sizeof(struct kinfo_proc);
-       mib [5] = 0;
-
-retry:
-       if (sysctl(mib, 6, NULL, &size, NULL, 0) < 0) {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: sysctl() failed: %d", __func__, errno);
-               return(ret);
-       }
-
-       if ((pi = g_malloc (size)) == NULL)
-               return(ret);
-
-       mib[5] = (int)(size / sizeof(struct kinfo_proc));
-
-       if ((sysctl (mib, 6, pi, &size, NULL, 0) < 0) ||
-               (size != sizeof (struct kinfo_proc))) {
-               if (errno == ENOMEM) {
-                       g_free (pi);
-                       goto retry;
-               }
-               return(ret);
-       }
-
-       if (strlen (pi->p_comm) > 0)
-               ret = g_strdup (pi->p_comm);
-
-       g_free (pi);
-#endif
-#elif defined(USE_HAIKU_LOADER)
-       image_info imageInfo;
-       int32 cookie = 0;
-
-       if (get_next_image_info ((team_id)pid, &cookie, &imageInfo) == B_OK) {
-               ret = g_strdup (imageInfo.name);
-       }
-#else
-       memset (buf, '\0', sizeof(buf));
-       filename = g_strdup_printf ("/proc/%d/exe", pid);
-       if (readlink (filename, buf, 255) > 0) {
-               ret = g_strdup (buf);
-       }
-       g_free (filename);
-
-       if (ret != NULL) {
-               return(ret);
-       }
-
-       filename = g_strdup_printf ("/proc/%d/cmdline", pid);
-       if ((fp = fopen (filename, "r")) != NULL) {
-               if (fgets (buf, 256, fp) != NULL) {
-                       ret = g_strdup (buf);
-               }
-               
-               fclose (fp);
-       }
-       g_free (filename);
-
-       if (ret != NULL) {
-               return(ret);
-       }
-       
-       filename = g_strdup_printf ("/proc/%d/stat", pid);
-       if ((fp = fopen (filename, "r")) != NULL) {
-               if (fgets (buf, 256, fp) != NULL) {
-                       char *start, *end;
-                       
-                       start = strchr (buf, '(');
-                       if (start != NULL) {
-                               end = strchr (start + 1, ')');
-                               
-                               if (end != NULL) {
-                                       ret = g_strndup (start + 1,
-                                                        end - start - 1);
-                               }
-                       }
-               }
-               
-               fclose (fp);
-       }
-       g_free (filename);
-#endif
-
-       return ret;
-}
-
-/*
- * wapi_process_get_path:
- *
- *   Return the full path of the executable of the process PID, or NULL if it cannot be determined.
- * Returns malloc-ed memory.
- */
-char*
-wapi_process_get_path (pid_t pid)
-{
-#if defined(PLATFORM_MACOSX) && !defined(__mono_ppc__) && defined(TARGET_OSX)
-       char buf [PROC_PIDPATHINFO_MAXSIZE];
-       int res;
-
-       res = proc_pidpath (pid, buf, sizeof (buf));
-       if (res <= 0)
-               return NULL;
-       if (buf [0] == '\0')
-               return NULL;
-       return g_strdup (buf);
-#else
-       return get_process_name_from_proc (pid);
-#endif
-}
-
-/*
- * wapi_process_set_cli_launcher:
- *
- *   Set the full path of the runtime executable used to launch managed exe's.
- */
-void
-wapi_process_set_cli_launcher (char *path)
-{
-       g_free (cli_launcher);
-       cli_launcher = path ? g_strdup (path) : NULL;
-}
-
-static guint32
-get_module_name (gpointer process, gpointer module,
-                                gunichar2 *basename, guint32 size,
-                                gboolean base)
-{
-       WapiHandle_process *process_handle;
-       pid_t pid;
-       gunichar2 *procname;
-       char *procname_ext = NULL;
-       glong len;
-       gsize bytes;
-#if !defined(USE_OSX_LOADER) && !defined(USE_BSD_LOADER)
-       FILE *fp;
-#endif
-       GSList *mods = NULL;
-       WapiProcModule *found_module;
-       guint32 count;
-       int i;
-       char *proc_name = NULL;
-       
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Getting module base name, process handle %p module %p",
-                  __func__, process, module);
-
-       size = size * sizeof (gunichar2); /* adjust for unicode characters */
-
-       if (basename == NULL || size == 0)
-               return 0;
-       
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               /* This is a pseudo handle */
-               pid = (pid_t)WAPI_HANDLE_TO_PID (process);
-               proc_name = get_process_name_from_proc (pid);
-       } else {
-               process_handle = lookup_process_handle (process);
-               if (!process_handle) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__,
-                                  process);
-                       
-                       return 0;
-               }
-               pid = process_handle->id;
-               proc_name = g_strdup (process_handle->proc_name);
-       }
-
-       /* Look up the address in /proc/<pid>/maps */
-#if defined(USE_OSX_LOADER) || defined(USE_BSD_LOADER) || defined(USE_HAIKU_LOADER)
-       mods = load_modules ();
-#else
-       fp = open_process_map (pid, "r");
-       if (fp == NULL) {
-               if (errno == EACCES && module == NULL && base == TRUE) {
-                       procname_ext = get_process_name_from_proc (pid);
-               } else {
-                       /* No /proc/<pid>/maps, so just return failure
-                        * for now
-                        */
-                       g_free (proc_name);
-                       return 0;
-               }
-       } else {
-               mods = load_modules (fp);
-               fclose (fp);
-       }
-#endif
-       count = g_slist_length (mods);
-
-       /* If module != NULL compare the address.
-        * If module == NULL we are looking for the main module.
-        * The best we can do for now check it the module name end with the process name.
-        */
-       for (i = 0; i < count; i++) {
-               found_module = (WapiProcModule *)g_slist_nth_data (mods, i);
-               if (procname_ext == NULL &&
-                       ((module == NULL && match_procname_to_modulename (proc_name, found_module->filename)) ||
-                        (module != NULL && found_module->address_start == module))) {
-                       if (base)
-                               procname_ext = g_path_get_basename (found_module->filename);
-                       else
-                               procname_ext = g_strdup (found_module->filename);
-               }
-
-               free_procmodule (found_module);
-       }
-
-       if (procname_ext == NULL) {
-               /* If it's *still* null, we might have hit the
-                * case where reading /proc/$pid/maps gives an
-                * empty file for this user.
-                */
-               procname_ext = get_process_name_from_proc (pid);
-       }
-
-       g_slist_free (mods);
-       g_free (proc_name);
-
-       if (procname_ext) {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Process name is [%s]", __func__,
-                          procname_ext);
-
-               procname = mono_unicode_from_external (procname_ext, &bytes);
-               if (procname == NULL) {
-                       /* bugger */
-                       g_free (procname_ext);
-                       return 0;
-               }
-               
-               len = (bytes / 2);
-               
-               /* Add the terminator */
-               bytes += 2;
-               
-               if (size < bytes) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d smaller than needed (%ld); truncating", __func__, size, bytes);
-
-                       memcpy (basename, procname, size);
-               } else {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d larger than needed (%ld)",
-                                  __func__, size, bytes);
-
-                       memcpy (basename, procname, bytes);
-               }
-               
-               g_free (procname);
-               g_free (procname_ext);
-               
-               return len;
-       }
-       
-       return 0;
-}
-
-static guint32
-get_module_filename (gpointer process, gpointer module,
-                                        gunichar2 *basename, guint32 size)
-{
-       int pid, len;
-       gsize bytes;
-       char *path;
-       gunichar2 *proc_path;
-       
-       size *= sizeof (gunichar2); /* adjust for unicode characters */
-
-       if (basename == NULL || size == 0)
-               return 0;
-
-       pid = GetProcessId (process);
-
-       path = wapi_process_get_path (pid);
-       if (path == NULL)
-               return 0;
-
-       proc_path = mono_unicode_from_external (path, &bytes);
-       g_free (path);
-
-       if (proc_path == NULL)
-               return 0;
-
-       len = (bytes / 2);
-       
-       /* Add the terminator */
-       bytes += 2;
-
-       if (size < bytes) {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d smaller than needed (%ld); truncating", __func__, size, bytes);
-
-               memcpy (basename, proc_path, size);
-       } else {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d larger than needed (%ld)",
-                          __func__, size, bytes);
-
-               memcpy (basename, proc_path, bytes);
-       }
-
-       g_free (proc_path);
-
-       return len;
-}
-
-guint32
-GetModuleBaseName (gpointer process, gpointer module,
-                                  gunichar2 *basename, guint32 size)
-{
-       return get_module_name (process, module, basename, size, TRUE);
-}
-
-guint32
-GetModuleFileNameEx (gpointer process, gpointer module,
-                                        gunichar2 *filename, guint32 size)
-{
-       return get_module_filename (process, module, filename, size);
-}
-
-gboolean
-GetModuleInformation (gpointer process, gpointer module,
-                                         WapiModuleInfo *modinfo, guint32 size)
-{
-       WapiHandle_process *process_handle;
-       pid_t pid;
-#if !defined(USE_OSX_LOADER) && !defined(USE_BSD_LOADER)
-       FILE *fp;
-#endif
-       GSList *mods = NULL;
-       WapiProcModule *found_module;
-       guint32 count;
-       int i;
-       gboolean ret = FALSE;
-       char *proc_name = NULL;
-       
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Getting module info, process handle %p module %p",
-                  __func__, process, module);
-
-       if (modinfo == NULL || size < sizeof (WapiModuleInfo))
-               return FALSE;
-       
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               pid = (pid_t)WAPI_HANDLE_TO_PID (process);
-               proc_name = get_process_name_from_proc (pid);
-       } else {
-               process_handle = lookup_process_handle (process);
-               if (!process_handle) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__,
-                                  process);
-                       
-                       return FALSE;
-               }
-               pid = process_handle->id;
-               proc_name = g_strdup (process_handle->proc_name);
-       }
-
-#if defined(USE_OSX_LOADER) || defined(USE_BSD_LOADER) || defined(USE_HAIKU_LOADER)
-       mods = load_modules ();
-#else
-       /* Look up the address in /proc/<pid>/maps */
-       if ((fp = open_process_map (pid, "r")) == NULL) {
-               /* No /proc/<pid>/maps, so just return failure
-                * for now
-                */
-               g_free (proc_name);
-               return FALSE;
-       }
-       mods = load_modules (fp);
-       fclose (fp);
-#endif
-       count = g_slist_length (mods);
-
-       /* If module != NULL compare the address.
-        * If module == NULL we are looking for the main module.
-        * The best we can do for now check it the module name end with the process name.
-        */
-       for (i = 0; i < count; i++) {
-                       found_module = (WapiProcModule *)g_slist_nth_data (mods, i);
-                       if (ret == FALSE &&
-                               ((module == NULL && match_procname_to_modulename (proc_name, found_module->filename)) ||
-                                (module != NULL && found_module->address_start == module))) {
-                               modinfo->lpBaseOfDll = found_module->address_start;
-                               modinfo->SizeOfImage = (gsize)(found_module->address_end) - (gsize)(found_module->address_start);
-                               modinfo->EntryPoint = found_module->address_offset;
-                               ret = TRUE;
-                       }
-
-                       free_procmodule (found_module);
-       }
-
-       g_slist_free (mods);
-       g_free (proc_name);
-
-       return ret;
-}
-
-gboolean
-GetProcessWorkingSetSize (gpointer process, size_t *min, size_t *max)
-{
-       WapiHandle_process *process_handle;
-       
-       if (min == NULL || max == NULL)
-               /* Not sure if w32 allows NULLs here or not */
-               return FALSE;
-       
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process))
-               /* This is a pseudo handle, so just fail for now */
-               return FALSE;
-       
-       process_handle = lookup_process_handle (process);
-       if (!process_handle) {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-               
-               return FALSE;
-       }
-
-       *min = process_handle->min_working_set;
-       *max = process_handle->max_working_set;
-       
-       return TRUE;
-}
-
-gboolean
-SetProcessWorkingSetSize (gpointer process, size_t min, size_t max)
-{
-       WapiHandle_process *process_handle;
-
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process))
-               /* This is a pseudo handle, so just fail for now
-                */
-               return FALSE;
-
-       process_handle = lookup_process_handle (process);
-       if (!process_handle) {
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-               
-               return FALSE;
-       }
-
-       process_handle->min_working_set = min;
-       process_handle->max_working_set = max;
-       
-       return TRUE;
-}
-
-
-gboolean
-TerminateProcess (gpointer process, gint32 exitCode)
-{
-#if defined(HAVE_KILL)
-       WapiHandle_process *process_handle;
-       int signo;
-       int ret;
-       pid_t pid;
-       
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               /* This is a pseudo handle */
-               pid = (pid_t)WAPI_HANDLE_TO_PID (process);
-       } else {
-               process_handle = lookup_process_handle (process);
-               if (!process_handle) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
-                       SetLastError (ERROR_INVALID_HANDLE);
-                       return FALSE;
-               }
-               pid = process_handle->id;
-       }
-
-       signo = (exitCode == -1) ? SIGKILL : SIGTERM;
-       ret = kill (pid, signo);
-       if (ret == -1) {
-               switch (errno) {
-               case EINVAL:
-                       SetLastError (ERROR_INVALID_PARAMETER);
-                       break;
-               case EPERM:
-                       SetLastError (ERROR_ACCESS_DENIED);
-                       break;
-               case ESRCH:
-                       SetLastError (ERROR_PROC_NOT_FOUND);
-                       break;
-               default:
-                       SetLastError (ERROR_GEN_FAILURE);
-               }
-       }
-       
-       return (ret == 0);
-#else
-       g_error ("kill() is not supported by this platform");
-       return FALSE;
-#endif
-}
-
-guint32
-GetPriorityClass (gpointer process)
-{
-#ifdef HAVE_GETPRIORITY
-       WapiHandle_process *process_handle;
-       int ret;
-       pid_t pid;
-       
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               /* This is a pseudo handle */
-               pid = (pid_t)WAPI_HANDLE_TO_PID (process);
-       } else {
-               process_handle = lookup_process_handle (process);
-               if (!process_handle) {
-                       SetLastError (ERROR_INVALID_HANDLE);
-                       return FALSE;
-               }
-               pid = process_handle->id;
-       }
-
-       errno = 0;
-       ret = getpriority (PRIO_PROCESS, pid);
-       if (ret == -1 && errno != 0) {
-               switch (errno) {
-               case EPERM:
-               case EACCES:
-                       SetLastError (ERROR_ACCESS_DENIED);
-                       break;
-               case ESRCH:
-                       SetLastError (ERROR_PROC_NOT_FOUND);
-                       break;
-               default:
-                       SetLastError (ERROR_GEN_FAILURE);
-               }
-               return FALSE;
-       }
-
-       if (ret == 0)
-               return NORMAL_PRIORITY_CLASS;
-       else if (ret < -15)
-               return REALTIME_PRIORITY_CLASS;
-       else if (ret < -10)
-               return HIGH_PRIORITY_CLASS;
-       else if (ret < 0)
-               return ABOVE_NORMAL_PRIORITY_CLASS;
-       else if (ret > 10)
-               return IDLE_PRIORITY_CLASS;
-       else if (ret > 0)
-               return BELOW_NORMAL_PRIORITY_CLASS;
-
-       return NORMAL_PRIORITY_CLASS;
-#else
-       SetLastError (ERROR_NOT_SUPPORTED);
-       return 0;
-#endif
-}
-
-gboolean
-SetPriorityClass (gpointer process, guint32  priority_class)
-{
-#ifdef HAVE_SETPRIORITY
-       WapiHandle_process *process_handle;
-       int ret;
-       int prio;
-       pid_t pid;
-       
-       if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
-               /* This is a pseudo handle */
-               pid = (pid_t)WAPI_HANDLE_TO_PID (process);
-       } else {
-               process_handle = lookup_process_handle (process);
-               if (!process_handle) {
-                       SetLastError (ERROR_INVALID_HANDLE);
-                       return FALSE;
-               }
-               pid = process_handle->id;
-       }
-
-       switch (priority_class) {
-       case IDLE_PRIORITY_CLASS:
-               prio = 19;
-               break;
-       case BELOW_NORMAL_PRIORITY_CLASS:
-               prio = 10;
-               break;
-       case NORMAL_PRIORITY_CLASS:
-               prio = 0;
-               break;
-       case ABOVE_NORMAL_PRIORITY_CLASS:
-               prio = -5;
-               break;
-       case HIGH_PRIORITY_CLASS:
-               prio = -11;
-               break;
-       case REALTIME_PRIORITY_CLASS:
-               prio = -20;
-               break;
-       default:
-               SetLastError (ERROR_INVALID_PARAMETER);
-               return FALSE;
-       }
-
-       ret = setpriority (PRIO_PROCESS, pid, prio);
-       if (ret == -1) {
-               switch (errno) {
-               case EPERM:
-               case EACCES:
-                       SetLastError (ERROR_ACCESS_DENIED);
-                       break;
-               case ESRCH:
-                       SetLastError (ERROR_PROC_NOT_FOUND);
-                       break;
-               default:
-                       SetLastError (ERROR_GEN_FAILURE);
-               }
-       }
-
-       return ret == 0;
-#else
-       SetLastError (ERROR_NOT_SUPPORTED);
-       return FALSE;
-#endif
-}
-
-static void
-mono_processes_cleanup (void)
-{
-       struct MonoProcess *mp;
-       struct MonoProcess *prev = NULL;
-       GSList *finished = NULL;
-       GSList *l;
-       gpointer unref_handle;
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s", __func__);
-
-       /* Ensure we're not in here in multiple threads at once, nor recursive. */
-       if (InterlockedCompareExchange (&mono_processes_cleaning_up, 1, 0) != 0)
-               return;
-
-       for (mp = mono_processes; mp; mp = mp->next) {
-               if (mp->pid == 0 && mp->handle) {
-                       /* This process has exited and we need to remove the artifical ref
-                        * on the handle */
-                       mono_os_mutex_lock (&mono_processes_mutex);
-                       unref_handle = mp->handle;
-                       mp->handle = NULL;
-                       mono_os_mutex_unlock (&mono_processes_mutex);
-                       if (unref_handle)
-                               mono_w32handle_unref (unref_handle);
-               }
-       }
-
-       /*
-        * Remove processes which exited from the mono_processes list.
-        * We need to synchronize with the sigchld handler here, which runs
-        * asynchronously. The handler requires that the mono_processes list
-        * remain valid.
-        */
-       mono_os_mutex_lock (&mono_processes_mutex);
-
-       mp = mono_processes;
-       while (mp) {
-               if (mp->handle_count == 0 && mp->freeable) {
-                       /*
-                        * Unlink the entry.
-                        * This code can run parallel with the sigchld handler, but the
-                        * modifications it makes are safe.
-                        */
-                       if (mp == mono_processes)
-                               mono_processes = mp->next;
-                       else
-                               prev->next = mp->next;
-                       finished = g_slist_prepend (finished, mp);
-
-                       mp = mp->next;
-               } else {
-                       prev = mp;
-                       mp = mp->next;
-               }
-       }
-
-       mono_memory_barrier ();
-
-       for (l = finished; l; l = l->next) {
-               /*
-                * All the entries in the finished list are unlinked from mono_processes, and
-                * they have the 'finished' flag set, which means the sigchld handler is done
-                * accessing them.
-                */
-               mp = (MonoProcess *)l->data;
-               mono_os_sem_destroy (&mp->exit_sem);
-               g_free (mp);
-       }
-       g_slist_free (finished);
-
-       mono_os_mutex_unlock (&mono_processes_mutex);
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s done", __func__);
-
-       InterlockedDecrement (&mono_processes_cleaning_up);
-}
-
-static void
-process_close (gpointer handle, gpointer data)
-{
-       WapiHandle_process *process_handle;
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s", __func__);
-
-       process_handle = (WapiHandle_process *) data;
-       g_free (process_handle->proc_name);
-       process_handle->proc_name = NULL;
-       if (process_handle->mono_process)
-               InterlockedDecrement (&process_handle->mono_process->handle_count);
-       mono_processes_cleanup ();
-}
-
-static void process_details (gpointer data)
-{
-       WapiHandle_process *process_handle = (WapiHandle_process *) data;
-       g_print ("id: %d, exited: %s, exitstatus: %d",
-               process_handle->id, process_handle->exited ? "true" : "false", process_handle->exitstatus);
-}
-
-static const gchar* process_typename (void)
-{
-       return "Process";
-}
-
-static gsize process_typesize (void)
-{
-       return sizeof (WapiHandle_process);
-}
-
-#if HAVE_SIGACTION
-MONO_SIGNAL_HANDLER_FUNC (static, mono_sigchld_signal_handler, (int _dummy, siginfo_t *info, void *context))
-{
-       int status;
-       int pid;
-       struct MonoProcess *p;
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "SIG CHILD handler for pid: %i\n", info->si_pid);
-
-       do {
-               do {
-                       pid = waitpid (-1, &status, WNOHANG);
-               } while (pid == -1 && errno == EINTR);
-
-               if (pid <= 0)
-                       break;
-
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "child ended: %i", pid);
-
-               /*
-                * This can run concurrently with the code in the rest of this module.
-                */
-               for (p = mono_processes; p; p = p->next) {
-                       if (p->pid == pid) {
-                               break;
-                       }
-               }
-               if (p) {
-                       p->pid = 0; /* this pid doesn't exist anymore, clear it */
-                       p->status = status;
-                       mono_os_sem_post (&p->exit_sem);
-                       mono_memory_barrier ();
-                       /* Mark this as freeable, the pointer becomes invalid afterwards */
-                       p->freeable = TRUE;
-               }
-       } while (1);
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "SIG CHILD handler: done looping.");
-}
-
-#endif
-
-static void
-process_add_sigchld_handler (void)
-{
-#if HAVE_SIGACTION
-       struct sigaction sa;
-
-       sa.sa_sigaction = mono_sigchld_signal_handler;
-       sigemptyset (&sa.sa_mask);
-       sa.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
-       g_assert (sigaction (SIGCHLD, &sa, &previous_chld_sa) != -1);
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "Added SIGCHLD handler");
-#endif
-}
-
-static guint32
-process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
-{
-       WapiHandle_process *process_handle;
-       pid_t pid G_GNUC_UNUSED, ret;
-       int status;
-       gint64 start, now;
-       struct MonoProcess *mp;
-
-       /* FIXME: We can now easily wait on processes that aren't our own children,
-        * but WaitFor*Object won't call us for pseudo handles. */
-       g_assert ((GPOINTER_TO_UINT (handle) & _WAPI_PROCESS_UNHANDLED) != _WAPI_PROCESS_UNHANDLED);
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u)", __func__, handle, timeout);
-
-       if (alerted)
-               *alerted = FALSE;
-
-       process_handle = lookup_process_handle (handle);
-       if (!process_handle) {
-               g_warning ("%s: error looking up process handle %p", __func__, handle);
-               return WAIT_FAILED;
-       }
-
-       if (process_handle->exited) {
-               /* We've already done this one */
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Process already exited", __func__, handle, timeout);
-               return WAIT_OBJECT_0;
-       }
-
-       pid = process_handle->id;
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): PID: %d", __func__, handle, timeout, pid);
-
-       /* We don't need to lock mono_processes here, the entry
-        * has a handle_count > 0 which means it will not be freed. */
-       mp = process_handle->mono_process;
-       if (!mp) {
-               pid_t res;
-
-               if (pid == mono_process_current_pid ()) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on current process", __func__, handle, timeout);
-                       return WAIT_TIMEOUT;
-               }
-
-               /* This path is used when calling Process.HasExited, so
-                * it is only used to poll the state of the process, not
-                * to actually wait on it to exit */
-               g_assert (timeout == 0);
-
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on non-child process", __func__, handle, timeout);
-
-               res = waitpid (pid, &status, WNOHANG);
-               if (res == 0) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process WAIT_TIMEOUT", __func__, handle, timeout);
-                       return WAIT_TIMEOUT;
-               }
-               if (res > 0) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process waited successfully", __func__, handle, timeout);
-                       return WAIT_OBJECT_0;
-               }
-
-               MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process WAIT_FAILED, error : %s (%d))", __func__, handle, timeout, g_strerror (errno), errno);
-               return WAIT_FAILED;
-       }
-
-       start = mono_msec_ticks ();
-       now = start;
-
-       while (1) {
-               if (timeout != INFINITE) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on semaphore for %li ms...", 
-                                  __func__, handle, timeout, (timeout - (now - start)));
-                       ret = mono_os_sem_timedwait (&mp->exit_sem, (timeout - (now - start)), alerted ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE);
-               } else {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on semaphore forever...", 
-                                  __func__, handle, timeout);
-                       ret = mono_os_sem_wait (&mp->exit_sem, alerted ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE);
-               }
-
-               if (ret == MONO_SEM_TIMEDWAIT_RET_SUCCESS) {
-                       /* Success, process has exited */
-                       mono_os_sem_post (&mp->exit_sem);
-                       break;
-               }
-
-               if (ret == MONO_SEM_TIMEDWAIT_RET_TIMEDOUT) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): WAIT_TIMEOUT (timeout = 0)", __func__, handle, timeout);
-                       return WAIT_TIMEOUT;
-               }
-
-               now = mono_msec_ticks ();
-               if (now - start >= timeout) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): WAIT_TIMEOUT", __func__, handle, timeout);
-                       return WAIT_TIMEOUT;
-               }
-               
-               if (alerted && ret == MONO_SEM_TIMEDWAIT_RET_ALERTED) {
-                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): WAIT_IO_COMPLETION", __func__, handle, timeout);
-                       *alerted = TRUE;
-                       return WAIT_IO_COMPLETION;
-               }
-       }
-
-       /* Process must have exited */
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Waited successfully", __func__, handle, timeout);
-
-       status = mp ? mp->status : 0;
-       if (WIFSIGNALED (status))
-               process_handle->exitstatus = 128 + WTERMSIG (status);
-       else
-               process_handle->exitstatus = WEXITSTATUS (status);
-       _wapi_time_t_to_filetime (time (NULL), &process_handle->exit_time);
-
-       process_handle->exited = TRUE;
-
-       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Setting pid %d signalled, exit status %d",
-                  __func__, handle, timeout, process_handle->id, process_handle->exitstatus);
-
-       mono_w32handle_set_signal_state (handle, TRUE, TRUE);
-
-       return WAIT_OBJECT_0;
-}
-
-void
-wapi_processes_cleanup (void)
-{
-       g_free (cli_launcher);
-}
diff --git a/mono/io-layer/processes.h b/mono/io-layer/processes.h
deleted file mode 100644 (file)
index c4da3ec..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * processes.h:  Process handles
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_PROCESSES_H_
-#define _WAPI_PROCESSES_H_
-
-#include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <glib.h>
-
-#include <mono/io-layer/access.h>
-#include <mono/io-layer/versioninfo.h>
-
-G_BEGIN_DECLS
-
-typedef enum {
-       STARTF_USESHOWWINDOW=0x001,
-       STARTF_USESIZE=0x002,
-       STARTF_USEPOSITION=0x004,
-       STARTF_USECOUNTCHARS=0x008,
-       STARTF_USEFILLATTRIBUTE=0x010,
-       STARTF_RUNFULLSCREEN=0x020,
-       STARTF_FORCEONFEEDBACK=0x040,
-       STARTF_FORCEOFFFEEDBACK=0x080,
-       STARTF_USESTDHANDLES=0x100
-} WapiStartupFlags;
-
-
-typedef struct _WapiStartupInfo WapiStartupInfo;
-
-struct _WapiStartupInfo 
-{
-       guint32 cb;
-       guchar *lpReserved;
-       guchar *lpDesktop;
-       guchar *lpTitle;
-       guint32 dwX;
-       guint32 dwY;
-       guint32 dwXSize;
-       guint32 dwYSize;
-       guint32 dwXCountChars;
-       guint32 dwYCountChars;
-       guint32 dwFillAttribute;
-       WapiStartupFlags dwFlags;
-       guint16 wShowWindow;
-       guint16 cbReserved2;
-       guint8 *lpReserved2;
-       gpointer hStdInput;
-       gpointer hStdOutput;
-       gpointer hStdError;
-};
-
-typedef struct _WapiProcessInformation WapiProcessInformation;
-
-struct _WapiProcessInformation 
-{
-       gpointer hProcess;
-       gpointer hThread;
-       guint32 dwProcessId;
-       guint32 dwThreadId;
-};
-
-typedef enum {
-       SEE_MASK_CLASSNAME      = 0x01,
-       SEE_MASK_CLASSKEY       = 0x03,
-       SEE_MASK_IDLIST         = 0x04,
-       SEE_MASK_INVOKEIDLIST   = 0x0c,
-       SEE_MASK_ICON           = 0x10,
-       SEE_MASK_HOTKEY         = 0x20,
-       SEE_MASK_NOCLOSEPROCESS = 0x40,
-       SEE_MASK_CONNECTNETDRV  = 0x80,
-       SEE_MASK_FLAG_DDEWAIT   = 0x100,
-       SEE_MASK_DOENVSUBST     = 0x200,
-       SEE_MASK_FLAG_NO_UI     = 0x400,
-       SEE_MASK_NO_CONSOLE     = 0x8000,
-       SEE_MASK_UNICODE        = 0x10000,
-       SEE_MASK_HMONITOR       = 0x200000,
-       /*SEE_MASK_FLAG_LOG_USAGE,*/
-       /*SEE_MASK_NOZONECHECKS,*/
-} WapiShellExecuteInfoFlags;
-
-typedef enum {
-       SW_HIDE = 0,
-       SW_SHOWNORMAL = 1,
-       SW_SHOWMINIMIZED = 2,
-       SW_MAXIMIZE = 3,
-       SW_SHOWMAXIMIZED = 3,
-       SW_SHOWNOACTIVATE = 4,
-       SW_SHOW = 5,
-       SW_MINIMIZE = 6,
-       SW_SHOWMINNOACTIVE = 7,
-       SW_SHOWNA = 8,
-       SW_RESTORE = 9,
-       SW_SHOWDEFAULT = 10,
-} WapiShellExecuteShowFlags;
-
-typedef struct _WapiShellExecuteInfo WapiShellExecuteInfo;
-
-struct _WapiShellExecuteInfo
-{
-       guint32 cbSize;
-       gulong fMask;
-       gpointer hwnd;
-       const gunichar2 *lpVerb;
-       const gunichar2 *lpFile;
-       const gunichar2 *lpParameters;
-       const gunichar2 *lpDirectory;
-       gulong nShow;
-       gpointer hInstApp;
-       gpointer lpIDList;
-       const gunichar2 *lpClass;
-       gpointer hkeyClass;
-       guint32 dwHotKey;
-       union 
-       {
-               gpointer hIcon;
-               gpointer hMonitor;
-       } u;
-       gpointer hProcess;
-};
-
-       
-#define DEBUG_PROCESS 0x00000001
-#define DEBUG_ONLY_THIS_PROCESS 0x00000002
-#define DETACHED_PROCESS 0x00000008
-#define CREATE_NEW_CONSOLE 0x00000010
-#define NORMAL_PRIORITY_CLASS 0x00000020
-#define IDLE_PRIORITY_CLASS 0x00000040
-#define HIGH_PRIORITY_CLASS 0x00000080
-#define REALTIME_PRIORITY_CLASS 0x00000100
-#define CREATE_NEW_PROCESS_GROUP 0x00000200
-#define CREATE_UNICODE_ENVIRONMENT 0x00000400
-#define CREATE_SEPARATE_WOW_VDM 0x00000800
-#define CREATE_SHARED_WOW_VDM 0x00001000
-#define CREATE_FORCEDOS 0x00002000
-#define BELOW_NORMAL_PRIORITY_CLASS 0x00004000
-#define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
-#define CREATE_BREAKAWAY_FROM_JOB 0x01000000
-#define CREATE_WITH_USERPROFILE 0x02000000
-#define CREATE_DEFAULT_ERROR_MODE 0x04000000
-#define CREATE_NO_WINDOW 0x08000000
-
-#ifdef NEW_STUFF
-#define CREATE_PRESERVE_CODE_AUTHZ_LEVEL find out the value for this one...
-#endif
-
-#define        PROCESS_TERMINATE               0x0001
-#define        PROCESS_CREATE_THREAD           0x0002
-#define        PROCESS_SET_SESSIONID           0x0004
-#define        PROCESS_VM_OPERATION            0x0008
-#define        PROCESS_VM_READ                 0x0010
-#define        PROCESS_VM_WRITE                0x0020
-#define        PROCESS_DUP_HANDLE              0x0040
-#define        PROCESS_CREATE_PROCESS          0x0080
-#define        PROCESS_SET_QUOTA               0x0100
-#define        PROCESS_SET_INFORMATION         0x0200
-#define        PROCESS_QUERY_INFORMATION       0x0400
-#define        PROCESS_ALL_ACCESS              (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xfff)
-
-extern gboolean ShellExecuteEx (WapiShellExecuteInfo *sei);
-extern gboolean CreateProcess (const gunichar2 *appname,
-                              const gunichar2 *cmdline,
-                              WapiSecurityAttributes *process_attrs,
-                              WapiSecurityAttributes *thread_attrs,
-                              gboolean inherit_handles, guint32 create_flags,
-                              gpointer environ, const gunichar2 *cwd,
-                              WapiStartupInfo *startup,
-                              WapiProcessInformation *process_info);
-extern gboolean CreateProcessWithLogonW (const gunichar2 *username,
-                                        const gunichar2 *domain,
-                                        const gunichar2 *password,
-                                        const guint32 logonFlags,
-                                        const gunichar2 *appname,
-                                        const gunichar2 *cmdline,
-                                        guint32 create_flags,
-                                        gpointer environ,
-                                        const gunichar2 *cwd,
-                                        WapiStartupInfo *startup,
-                                        WapiProcessInformation *process_info);
-#define LOGON_WITH_PROFILE 0x00000001
-#define LOGON_NETCREDENTIALS_ONLY 0x00000002
-
-extern gpointer GetCurrentProcess (void);
-extern guint32 GetProcessId (gpointer handle);
-extern gboolean CloseProcess (gpointer handle);
-extern gpointer OpenProcess (guint32 access, gboolean inherit, guint32 pid);
-extern gboolean GetExitCodeProcess (gpointer process, guint32 *code);
-extern gboolean GetProcessTimes (gpointer process, WapiFileTime *create_time,
-                                WapiFileTime *exit_time,
-                                WapiFileTime *kernel_time,
-                                WapiFileTime *user_time);
-extern gboolean EnumProcessModules (gpointer process, gpointer *modules,
-                                   guint32 size, guint32 *needed);
-extern guint32 GetModuleBaseName (gpointer process, gpointer module,
-                                 gunichar2 *basename, guint32 size);
-extern guint32 GetModuleFileNameEx (gpointer process, gpointer module,
-                                   gunichar2 *filename, guint32 size);
-extern gboolean GetModuleInformation (gpointer process, gpointer module,
-                                     WapiModuleInfo *modinfo, guint32 size);
-extern gboolean GetProcessWorkingSetSize (gpointer process, size_t *min,
-                                         size_t *max);
-extern gboolean SetProcessWorkingSetSize (gpointer process, size_t min,
-                                         size_t max);
-
-extern gboolean TerminateProcess (gpointer process, gint32 exitCode);
-
-extern guint32 GetPriorityClass (gpointer process);
-extern gboolean SetPriorityClass (gpointer process, guint32  priority_class);
-
-gchar* wapi_process_get_path (pid_t pid);
-
-void wapi_process_set_cli_launcher (char *path);
-
-G_END_DECLS
-
-#endif /* _WAPI_PROCESSES_H_ */
index 05012d26fbbb505967a484272cb4ed1c99f6bad7..d98ac677a2e22047432a89a717ad9b1a849f37ed 100644 (file)
@@ -44,7 +44,7 @@
 #include <mono/utils/mono-poll.h>
 #include <mono/utils/mono-once.h>
 #include <mono/utils/mono-logger-internals.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 
 #include <netinet/in.h>
 #include <netinet/tcp.h>
@@ -130,7 +130,7 @@ static gboolean
 cleanup_close (gpointer handle, gpointer data, gpointer user_data)
 {
        if (mono_w32handle_get_type (handle) == MONO_W32HANDLE_SOCKET)
-               mono_w32handle_ops_close (handle, data);
+               mono_w32handle_force_close (handle, data);
 
        return FALSE;
 }
diff --git a/mono/io-layer/timefuncs-private.h b/mono/io-layer/timefuncs-private.h
deleted file mode 100644 (file)
index ff00879..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * timefuncs-private.h:  performance timer and other time private functions
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_TIMEFUNCS_PRIVATE_H_
-#define _WAPI_TIMEFUNCS_PRIVATE_H_
-
-#include <config.h>
-#include <glib.h>
-#include <sys/time.h>
-
-extern void _wapi_time_t_to_filetime (time_t timeval, WapiFileTime *filetime);
-extern void _wapi_guint64_to_filetime (guint64 ticks, WapiFileTime *filetime);
-
-#endif /* _WAPI_TIMEFUNCS_PRIVATE_H_ */
index 0528ae6946df59b7bd1f55f2e07b5062d2f3d8aa..7ec8e4a8ee72a8ae43922dd6cb794c5c2d2e41cf 100644 (file)
@@ -14,7 +14,7 @@
 #include <stdio.h>
 
 #include <mono/io-layer/wapi.h>
-#include <mono/io-layer/timefuncs-private.h>
+#include <mono/io-layer/timefuncs.h>
 #include "mono/utils/mono-time.h"
 
 #undef DEBUG
@@ -27,9 +27,3 @@ void _wapi_time_t_to_filetime (time_t timeval, WapiFileTime *filetime)
        filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
        filetime->dwHighDateTime = ticks >> 32;
 }
-
-void _wapi_guint64_to_filetime (guint64 ticks, WapiFileTime *filetime)
-{
-       filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
-       filetime->dwHighDateTime = ticks >> 32;
-}
index d24800229f22aef11724cd81700cf58fe1ed352b..2b43396931b0db51e8401ad0372c249efaf72e45 100644 (file)
@@ -12,6 +12,8 @@
 
 #include <glib.h>
 
+#include <sys/time.h>
+
 #include "mono/io-layer/wapi.h"
 
 G_BEGIN_DECLS
@@ -30,5 +32,7 @@ typedef struct
 #endif
 } WapiFileTime;
 
+extern void _wapi_time_t_to_filetime (time_t timeval, WapiFileTime *filetime);
+
 G_END_DECLS
 #endif /* _WAPI_TIME_H_ */
index 5176da07ea7f2aa98f284fbf665d6f7d1cd2d629..ff5a53c21bdeda2c285f75e1796d9b4ffdb4fab2 100644 (file)
@@ -62,17 +62,10 @@ typedef WapiLargeInteger LARGE_INTEGER;
 typedef WapiLargeInteger *PLARGE_INTEGER;
 typedef WapiULargeInteger ULARGE_INTEGER;
 typedef WapiULargeInteger *PULARGE_INTEGER;
-typedef WapiFloatingSaveArea FLOATING_SAVE_AREA;
-typedef WapiFloatingSaveArea *PFLOATING_SAVE_AREA;
-typedef WapiContext CONTEXT;
-typedef WapiContext *PCONTEXT;
 typedef WapiFindData WIN32_FIND_DATA;
 typedef WapiFindData *LPWIN32_FIND_DATA;
 typedef WapiFileAttributesData WIN32_FILE_ATTRIBUTE_DATA;
 typedef WapiGetFileExInfoLevels GET_FILEEX_INFO_LEVELS;
-typedef WapiStartupInfo STARTUPINFO;
-typedef WapiStartupInfo *LPSTARTUPINFO;
-typedef WapiProcessInformation PROCESS_INFORMATION;
 typedef WapiFixedFileInfo VS_FIXEDFILEINFO;
 typedef WapiModuleInfo MODULEINFO;
 typedef WapiModuleInfo *LPMODULEINFO;
@@ -102,8 +95,6 @@ typedef WapiImageResourceDirectoryEntry IMAGE_RESOURCE_DIRECTORY_ENTRY;
 typedef WapiImageResourceDirectoryEntry *PIMAGE_RESOURCE_DIRECTORY_ENTRY;
 typedef WapiImageResourceDataEntry IMAGE_RESOURCE_DATA_ENTRY;
 typedef WapiImageResourceDataEntry *PIMAGE_RESOURCE_DATA_ENTRY;
-typedef WapiShellExecuteInfo SHELLEXECUTEINFO;
-typedef WapiShellExecuteInfo *LPSHELLEXECUTEINFO;
 typedef WapiTransmitFileBuffers TRANSMIT_FILE_BUFFERS;
 typedef WapiTransmitFileBuffers *PTRANSMIT_FILE_BUFFERS;
 typedef WapiTransmitFileBuffers *LPTRANSMIT_FILE_BUFFERS;
index aa58ea1614f76dde7cc51478b3cc0a73b7991b40..b7ff4684263846776bd3ff0f2ac346ed23cfcf8d 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <mono/io-layer/wapi.h>
 #include <mono/io-layer/wapi-private.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 
 /**
  * WaitForSingleObjectEx:
index b1fef4b1479361fd065bc19bf43bae631003f823..cbbf5d68203b93857d3da19886db35de93ef873e 100644 (file)
@@ -11,7 +11,7 @@
 #define _WAPI_WAIT_H_
 
 #include "mono/io-layer/status.h"
-#include "mono/utils/w32handle.h"
+#include "mono/metadata/w32handle.h"
 
 G_BEGIN_DECLS
 
index 8b82b609d1976be0cf356e0d13904f970aa8b585..9be764c15218771e3bb46150829b67b85286ca1d 100644 (file)
@@ -26,8 +26,7 @@ extern gboolean _wapi_has_shut_down;
 
 #include <mono/io-layer/io-private.h>
 #include <mono/io-layer/socket-private.h>
-#include <mono/io-layer/process-private.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 
 struct _WapiHandle_shared_ref
 {
index 935d257722557872189afa90b439e60a2d57ff99..b19465c7c68e0a12ca403bf774ff8019513e2649 100644 (file)
@@ -15,7 +15,6 @@
 #define GetLastError wapi_GetLastError
 #define SetLastError wapi_SetLastError
 #define TransmitFile wapi_TransmitFile
-#define GetThreadContext wapi_GetThreadContext
 #define CloseHandle wapi_CloseHandle 
 #define DuplicateHandle wapi_DuplicateHandle 
 #define CreateFile wapi_CreateFile
 #define UnlockFile wapi_UnlockFile 
 #define GetVolumeInformation wapi_GetVolumeInformation 
 #define FormatMessage wapi_FormatMessage 
-#define ShellExecuteEx wapi_ShellExecuteEx 
-#define CreateProcess wapi_CreateProcess 
-#define CreateProcessWithLogonW wapi_CreateProcessWithLogonW 
-#define GetCurrentProcess wapi_GetCurrentProcess 
-#define GetProcessId wapi_GetProcessId 
-#define CloseProcess wapi_CloseProcess 
-#define OpenProcess wapi_OpenProcess 
-#define GetExitCodeProcess wapi_GetExitCodeProcess 
-#define GetProcessTimes wapi_GetProcessTimes 
-#define EnumProcessModules wapi_EnumProcessModules 
-#define GetModuleBaseName wapi_GetModuleBaseName 
-#define GetModuleFileNameEx wapi_GetModuleFileNameEx 
-#define GetModuleInformation wapi_GetModuleInformation 
-#define GetProcessWorkingSetSize wapi_GetProcessWorkingSetSize 
-#define SetProcessWorkingSetSize wapi_SetProcessWorkingSetSize 
-#define TerminateProcess wapi_TerminateProcess 
-#define GetPriorityClass wapi_GetPriorityClass 
-#define SetPriorityClass wapi_SetPriorityClass 
 #define ImpersonateLoggedOnUser wapi_ImpersonateLoggedOnUser 
 #define RevertToSelf wapi_RevertToSelf 
 #define WSASetLastError wapi_WSASetLastError
index f1674179d9a194f0d2dcb4d992acbf5bb6926d3c..f162b0bb45cad926593816f8e28366fcfd034dd7 100644 (file)
@@ -3,11 +3,10 @@
 
 #include "io-trace.h"
 #include "io.h"
-#include "process-private.h"
 #include "socket-private.h"
 
 #include "mono/utils/mono-lazy-init.h"
-#include "mono/utils/w32handle.h"
+#include "mono/metadata/w32handle.h"
 
 gboolean _wapi_has_shut_down = FALSE;
 
@@ -15,7 +14,6 @@ void
 wapi_init (void)
 {
        _wapi_io_init ();
-       _wapi_processes_init ();
        _wapi_socket_init ();
 }
 
@@ -26,7 +24,6 @@ wapi_cleanup (void)
        _wapi_has_shut_down = TRUE;
 
        _wapi_error_cleanup ();
-       wapi_processes_cleanup ();
        _wapi_io_cleanup ();
 }
 
@@ -54,19 +51,8 @@ gboolean
 DuplicateHandle (gpointer srcprocess, gpointer src, gpointer targetprocess, gpointer *target,
        guint32 access G_GNUC_UNUSED, gboolean inherit G_GNUC_UNUSED, guint32 options G_GNUC_UNUSED)
 {
-       if (srcprocess != _WAPI_PROCESS_CURRENT || targetprocess != _WAPI_PROCESS_CURRENT) {
-               /* Duplicating other process's handles is not supported */
-               SetLastError (ERROR_INVALID_HANDLE);
-               return FALSE;
-       }
-
-       if (src == _WAPI_PROCESS_CURRENT) {
-               *target = _wapi_process_duplicate ();
-       } else {
-               mono_w32handle_ref (src);
-               *target = src;
-       }
-
+       mono_w32handle_ref (src);
+       *target = src;
        return TRUE;
 }
 
index c56622ea91c003c548288148cf8c49f9998c22bd..520bb2f7ac673d699b71b886f518492407c98036 100644 (file)
 #ifndef _WAPI_WAPI_H_
 #define _WAPI_WAPI_H_
 
+#include <sys/types.h>
+
 #include <mono/io-layer/wapi-remap.h>
 #include <mono/io-layer/types.h>
 #include <mono/io-layer/macros.h>
 #include <mono/io-layer/io.h>
-#include <mono/io-layer/access.h>
-#include <mono/io-layer/context.h>
 #include <mono/io-layer/error.h>
 #include <mono/io-layer/messages.h>
-#include <mono/io-layer/processes.h>
 #include <mono/io-layer/security.h>
 #include <mono/io-layer/sockets.h>
 #include <mono/io-layer/status.h>
index d541472ada7a675f588cbd457f4b44b5887ed3ee..bc369533a3f86bdc79f4d09e1c21cce51c292667 100644 (file)
@@ -1,9 +1,21 @@
 if HOST_WIN32
 win32_sources = \
        console-win32.c \
+       console-win32-internals.h \
+       file-io-windows.c \
+       file-io-windows-internals.h \
+       icall-windows.c \
+       icall-windows-internals.h \
+       marshal-windows.c \
+       marshal-windows-internals.h \
+       mono-security-windows.c \
+       mono-security-windows-internals.h \
        w32mutex-win32.c \
        w32semaphore-win32.c \
-       w32event-win32.c
+       w32event-win32.c \
+       w32process-win32.c \
+       w32process-win32-internals.h \
+       socket-io-windows.c
 
 platform_sources = $(win32_sources)
 
@@ -29,7 +41,13 @@ unix_sources = \
        console-unix.c \
        w32mutex-unix.c \
        w32semaphore-unix.c \
-       w32event-unix.c
+       w32event-unix.c \
+       w32process-unix.c \
+       w32process-unix-internals.h \
+       w32process-unix-osx.c \
+       w32process-unix-bsd.c \
+       w32process-unix-haiku.c \
+       w32process-unix-default.c
 
 platform_sources = $(unix_sources)
 endif
@@ -88,7 +106,7 @@ mono-config-dirs.lo: Makefile
 libmonoruntime_config_la_SOURCES = \
        mono-config-dirs.h              \
        mono-config-dirs.c
-libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
+libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" -DMONO_RELOC_LIBDIR=\"../$(reloc_libdir)\"
 
 CLEANFILES = mono-bundle.stamp
 
@@ -107,11 +125,14 @@ common_sources = \
        cil-coff.h              \
        class.c                 \
        class-internals.h       \
+       class-inlines.h         \
+       class-accessors.c       \
        cominterop.c            \
        cominterop.h            \
        console-io.h            \
        coree.c                 \
        coree.h                 \
+       coree-internals.h \
        culture-info.h          \
        culture-info-tables.h   \
        debug-helpers.c         \
@@ -129,10 +150,12 @@ common_sources = \
        exception-internals.h   \
        file-io.c               \
        file-io.h               \
+       file-io-internals.h \
        filewatcher.c           \
        filewatcher.h           \
        gc-internals.h          \
        icall.c                 \
+       icall-internals.h \
        icall-def.h             \
        image.c                 \
        image-internals.h       \
@@ -144,6 +167,7 @@ common_sources = \
        lock-tracer.h           \
        marshal.c               \
        marshal.h               \
+       marshal-internals.h \
        mempool.c               \
        mempool.h               \
        mempool-internals.h     \
@@ -177,10 +201,13 @@ common_sources = \
        number-ms.h             \
        object-internals.h      \
        opcodes.c               \
+       property-bag.h  \
+       property-bag.c  \
        socket-io.c             \
        socket-io.h             \
-       process.c               \
-       process.h               \
+       w32process.c            \
+       w32process.h            \
+       w32process-internals.h          \
        profiler.c              \
        profiler-private.h      \
        rand.h                  \
@@ -229,7 +256,9 @@ common_sources = \
        w32semaphore.h  \
        w32event.h      \
        w32handle-namespace.h   \
-       w32handle-namespace.c
+       w32handle-namespace.c   \
+       w32handle.h     \
+       w32handle.c
 
 # These source files have compile time dependencies on GC code
 gc_dependent_sources = \
@@ -252,10 +281,6 @@ boehm_sources = \
        boehm-gc.c
 
 sgen_sources = \
-       sgen-os-posix.c         \
-       sgen-os-mach.c          \
-       sgen-os-win32.c         \
-       sgen-os-coop.c          \
        sgen-bridge.c           \
        sgen-bridge.h           \
        sgen-bridge-internals.h \
@@ -279,12 +304,12 @@ libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
 libmonoruntime_static_la_LDFLAGS = -static
 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
-libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
+libmonoruntime_static_la_LIBADD = $(bundle_obj) libmonoruntime-config.la
 
 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
 libmonoruntimesgen_static_la_LDFLAGS = -static
 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
-libmonoruntimesgen_static_la_LIBADD = $(libmonoruntimesgen_la_LIBADD)
+libmonoruntimesgen_static_la_LIBADD = libmonoruntime-config.la
 
 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
 
index 0608394ff10b1db34d66b3aefc98aee657cf0cb1..e18c3febebd07edd09e3849f6e6e77856ca4315a 100644 (file)
@@ -68,7 +68,7 @@
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/mono-threads.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 #ifdef HOST_WIN32
 #include <direct.h>
 #endif
@@ -84,7 +84,7 @@
  * Changes which are already detected at runtime, like the addition
  * of icalls, do not require an increment.
  */
-#define MONO_CORLIB_VERSION 157
+#define MONO_CORLIB_VERSION 163
 
 typedef struct
 {
@@ -1415,7 +1415,12 @@ shadow_copy_sibling (gchar *src, gint srclen, const char *extension, gchar *targ
        dest = g_utf8_to_utf16 (target, strlen (target), NULL, NULL, NULL);
        
        DeleteFile (dest);
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
        copy_result = CopyFile (orig, dest, FALSE);
+#else
+       copy_result = SUCCEEDED (CopyFile2 (orig, dest, NULL));
+#endif
 
        /* Fix for bug #556884 - make sure the files have the correct mode so that they can be
         * overwritten when updated in their original locations. */
@@ -1743,7 +1748,11 @@ mono_make_shadow_copy (const char *filename, MonoError *oerror)
                return (char *)filename;
        }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
        copy_result = CopyFile (orig, dest, FALSE);
+#else
+       copy_result = SUCCEEDED (CopyFile2 (orig, dest, NULL));
+#endif
 
        /* Fix for bug #556884 - make sure the files have the correct mode so that they can be
         * overwritten when updated in their original locations. */
@@ -1949,37 +1958,37 @@ ves_icall_System_Reflection_Assembly_LoadFrom (MonoString *fname, MonoBoolean re
        MonoDomain *domain = mono_domain_get ();
        char *name, *filename;
        MonoImageOpenStatus status = MONO_IMAGE_OK;
-       MonoAssembly *ass;
+       MonoAssembly *ass = NULL;
+
+       name = NULL;
+       result = NULL;
+
+       mono_error_init (&error);
 
        if (fname == NULL) {
-               MonoException *exc = mono_get_exception_argument_null ("assemblyFile");
-               mono_set_pending_exception (exc);
-               return NULL;
+               mono_error_set_argument_null (&error, "assemblyFile", "");
+               goto leave;
        }
                
        name = filename = mono_string_to_utf8_checked (fname, &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
+       if (!is_ok (&error))
+               goto leave;
        
        ass = mono_assembly_open_full (filename, &status, refOnly);
        
        if (!ass) {
-               MonoException *exc;
-
                if (status == MONO_IMAGE_IMAGE_INVALID)
-                       exc = mono_get_exception_bad_image_format2 (NULL, fname);
+                       mono_error_set_bad_image_name (&error, name, "");
                else
-                       exc = mono_get_exception_file_not_found2 (NULL, fname);
-               g_free (name);
-               mono_set_pending_exception (exc);
-               return NULL;
+                       mono_error_set_exception_instance (&error, mono_get_exception_file_not_found2 (NULL, fname));
+               goto leave;
        }
 
-       g_free (name);
-
        result = mono_assembly_get_object_checked (domain, ass, &error);
-       if (!result)
-               mono_error_set_pending_exception (&error);
+
+leave:
+       mono_error_set_pending_exception (&error);
+       g_free (name);
        return result;
 }
 
@@ -2031,7 +2040,7 @@ ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad,  MonoString *assRef,
        MonoAssembly *ass;
        MonoAssemblyName aname;
        MonoReflectionAssembly *refass = NULL;
-       gchar *name;
+       gchar *name = NULL;
        gboolean parsed;
 
        g_assert (assRef);
@@ -2040,16 +2049,13 @@ ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad,  MonoString *assRef,
        if (mono_error_set_pending_exception (&error))
                return NULL;
        parsed = mono_assembly_name_parse (name, &aname);
-       g_free (name);
 
        if (!parsed) {
                /* This is a parse error... */
                if (!refOnly) {
                        refass = mono_try_assembly_resolve (domain, assRef, NULL, refOnly, &error);
-                       if (!mono_error_ok (&error)) {
-                               mono_error_set_pending_exception (&error);
-                               return NULL;
-                       }
+                       if (!is_ok (&error))
+                               goto leave;
                }
                return refass;
        }
@@ -2061,25 +2067,28 @@ ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad,  MonoString *assRef,
                /* MS.NET doesn't seem to call the assembly resolve handler for refonly assemblies */
                if (!refOnly) {
                        refass = mono_try_assembly_resolve (domain, assRef, NULL, refOnly, &error);
-                       if (!mono_error_ok (&error)) {
-                               mono_error_set_pending_exception (&error);
-                               return NULL;
-                       }
+                       if (!is_ok (&error))
+                               goto leave;
                }
                else
                        refass = NULL;
-               if (!refass) {
-                       return NULL;
-               }
+               if (!refass)
+                       goto leave;
+               ass = refass->assembly;
        }
 
-       if (refass == NULL)
+       g_assert (ass);
+       if (refass == NULL) {
                refass = mono_assembly_get_object_checked (domain, ass, &error);
+               if (!is_ok (&error))
+                       goto leave;
+       }
 
-       if (refass == NULL)
-               mono_error_set_pending_exception (&error);
-       else
-               MONO_OBJECT_SETREF (refass, evidence, evidence);
+       MONO_OBJECT_SETREF (refass, evidence, evidence);
+
+leave:
+       g_free (name);
+       mono_error_set_pending_exception (&error);
        return refass;
 }
 
@@ -2471,13 +2480,13 @@ mono_domain_unload (MonoDomain *domain)
        mono_domain_try_unload (domain, &exc);
 }
 
-static guint32
-guarded_wait (HANDLE handle, guint32 timeout, gboolean alertable)
+static MonoThreadInfoWaitRet
+guarded_wait (MonoThreadHandle *thread_handle, guint32 timeout, gboolean alertable)
 {
-       guint32 result;
+       MonoThreadInfoWaitRet result;
 
        MONO_ENTER_GC_SAFE;
-       result = WaitForSingleObjectEx (handle, timeout, alertable);
+       result = mono_thread_info_wait_one_handle (thread_handle, timeout, alertable);
        MONO_EXIT_GC_SAFE;
 
        return result;
@@ -2506,7 +2515,7 @@ void
 mono_domain_try_unload (MonoDomain *domain, MonoObject **exc)
 {
        MonoError error;
-       HANDLE thread_handle;
+       MonoThreadHandle *thread_handle;
        MonoAppDomainState prev_state;
        MonoMethod *method;
        unload_data *thread_data;
@@ -2568,12 +2577,12 @@ mono_domain_try_unload (MonoDomain *domain, MonoObject **exc)
         * First we create a separate thread for unloading, since
         * we might have to abort some threads, including the current one.
         */
-       thread_handle = mono_threads_create_thread (unload_thread_main, thread_data, 0, &tid);
+       thread_handle = mono_threads_create_thread (unload_thread_main, thread_data, NULL, &tid);
        if (thread_handle == NULL)
                return;
 
        /* Wait for the thread */       
-       while (!thread_data->done && guarded_wait (thread_handle, INFINITE, TRUE) == WAIT_IO_COMPLETION) {
+       while (!thread_data->done && guarded_wait (thread_handle, INFINITE, TRUE) == MONO_THREAD_INFO_WAIT_RET_ALERTED) {
                if (mono_thread_internal_has_appdomain_ref (mono_thread_internal_current (), domain) && (mono_thread_interruption_requested ())) {
                        /* The unload thread tries to abort us */
                        /* The icall wrapper will execute the abort */
index 64d1000bbb63b8f896164af207e176969b6ece3c..cae45aa64abde017a5223bcb5ecbc25dda2fa3da 100644 (file)
@@ -22,6 +22,7 @@
 #include "object-internals.h"
 #include <mono/metadata/loader.h>
 #include <mono/metadata/tabledefs.h>
+#include <mono/metadata/custom-attrs-internals.h>
 #include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/class-internals.h>
@@ -205,8 +206,6 @@ static GSList *loaded_assembly_bindings = NULL;
 
 /* Class lazy loading functions */
 static GENERATE_TRY_GET_CLASS_WITH_CACHE (internals_visible, System.Runtime.CompilerServices, InternalsVisibleToAttribute)
-static GENERATE_TRY_GET_CLASS_WITH_CACHE (reference_assembly, System.Runtime.CompilerServices, ReferenceAssemblyAttribute)
-
 static MonoAssembly*
 mono_assembly_invoke_search_hook_internal (MonoAssemblyName *aname, MonoAssembly *requesting, gboolean refonly, gboolean postload);
 static MonoAssembly*
@@ -214,6 +213,9 @@ mono_assembly_load_full_internal (MonoAssemblyName *aname, MonoAssembly *request
 static MonoBoolean
 mono_assembly_is_in_gac (const gchar *filanem);
 
+static MonoAssembly*
+prevent_reference_assembly_from_running (MonoAssembly* candidate, gboolean refonly);
+
 static gchar*
 encode_public_tok (const guchar *token, gint32 len)
 {
@@ -559,6 +561,21 @@ mono_assembly_getrootdir (void)
        return default_path [0];
 }
 
+/**
+ * mono_native_getrootdir:
+ * 
+ * Obtains the root directory used for looking up native libs (.so, .dylib).
+ *
+ * Returns: a string with the directory, this string should be freed by
+ * the caller.
+ */
+gchar *
+mono_native_getrootdir (void)
+{
+       gchar* fullpath = g_build_path (G_DIR_SEPARATOR_S, mono_assembly_getrootdir (), mono_config_get_reloc_lib_dir(), NULL);
+       return fullpath;
+}
+
 /**
  * mono_set_dirs:
  * @assembly_dir: the base directory for assemblies
@@ -1193,6 +1210,7 @@ mono_assembly_load_reference (MonoImage *image, int index)
                                   aname.major, aname.minor, aname.build, aname.revision,
                                   strlen ((char*)aname.public_key_token) == 0 ? "(none)" : (char*)aname.public_key_token, extra_msg);
                g_free (extra_msg);
+
        }
 
        mono_assemblies_lock ();
@@ -1749,7 +1767,7 @@ mono_assembly_load_friends (MonoAssembly* ass)
        if (ass->friend_assembly_names_inited)
                return;
 
-       attrs = mono_custom_attrs_from_assembly_checked (ass, &error);
+       attrs = mono_custom_attrs_from_assembly_checked (ass, FALSE, &error);
        mono_error_assert_ok (&error);
        if (!attrs) {
                mono_assemblies_lock ();
@@ -1809,9 +1827,27 @@ mono_assembly_load_friends (MonoAssembly* ass)
        mono_assemblies_unlock ();
 }
 
+struct HasReferenceAssemblyAttributeIterData {
+       gboolean has_attr;
+};
+
+static gboolean
+has_reference_assembly_attribute_iterator (MonoImage *image, guint32 typeref_scope_token, const char *nspace, const char *name, guint32 method_token, gpointer user_data)
+{
+       gboolean stop_scanning = FALSE;
+       struct HasReferenceAssemblyAttributeIterData *iter_data = (struct HasReferenceAssemblyAttributeIterData*)user_data;
+
+       if (!strcmp (name, "ReferenceAssemblyAttribute") && !strcmp (nspace, "System.Runtime.CompilerServices")) {
+               /* Note we don't check the assembly name, same as coreCLR. */
+               iter_data->has_attr = TRUE;
+               stop_scanning = TRUE;
+       }
+
+       return stop_scanning;
+}
 
 /**
- * mono_assembly_get_reference_assembly_attribute:
+ * mono_assembly_has_reference_assembly_attribute:
  * @assembly: a MonoAssembly
  * @error: set on error.
  *
@@ -1819,25 +1855,20 @@ mono_assembly_load_friends (MonoAssembly* ass)
  * On error returns FALSE and sets @error.
  */
 gboolean
-mono_assembly_get_reference_assembly_attribute (MonoAssembly *assembly, MonoError *error)
+mono_assembly_has_reference_assembly_attribute (MonoAssembly *assembly, MonoError *error)
 {
        mono_error_init (error);
 
-       MonoCustomAttrInfo *attrs = mono_custom_attrs_from_assembly_checked (assembly, error);
-       return_val_if_nok (error, FALSE);
-       if (!attrs)
-               return FALSE;
-       MonoClass *ref_asm_class = mono_class_try_get_reference_assembly_class ();
-       gboolean result = FALSE;
-       for (int i = 0; i < attrs->num_attrs; ++i) {
-               MonoCustomAttrEntry *attr = &attrs->attrs [i];
-               if (attr->ctor && attr->ctor->klass && attr->ctor->klass == ref_asm_class) {
-                       result = TRUE;
-                       break;
-               }
-       }
-       mono_custom_attrs_free (attrs);
-       return result;
+       /*
+        * This might be called during assembly loading, so do everything using the low-level
+        * metadata APIs.
+        */
+
+       struct HasReferenceAssemblyAttributeIterData iter_data = { FALSE };
+
+       mono_assembly_metadata_foreach_custom_attr (assembly, &has_reference_assembly_attribute_iterator, &iter_data);
+
+       return iter_data.has_attr;
 }
 
 /**
@@ -1959,10 +1990,30 @@ mono_assembly_load_from_full (MonoImage *image, const char*fname,
                }
        }
 
+       /* We need to check for ReferenceAssmeblyAttribute before we
+        * mark the assembly as loaded and before we fire the load
+        * hook. Otherwise mono_domain_fire_assembly_load () in
+        * appdomain.c will cache a mapping from the assembly name to
+        * this image and we won't be able to look for a different
+        * candidate. */
+
+       if (!refonly) {
+               MonoError refasm_error;
+               if (mono_assembly_has_reference_assembly_attribute (ass, &refasm_error)) {
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Image for assembly '%s' (%s) has ReferenceAssemblyAttribute, skipping", ass->aname.name, image->name);
+                       g_free (ass);
+                       g_free (base_dir);
+                       mono_image_close (image);
+                       *status = MONO_IMAGE_IMAGE_INVALID;
+                       return NULL;
+               }
+               mono_error_cleanup (&refasm_error);
+       }
+
        mono_assemblies_lock ();
 
        if (image->assembly) {
-               /* 
+               /*
                 * This means another thread has already loaded the assembly, but not yet
                 * called the load hooks so the search hook can't find the assembly.
                 */
@@ -1975,6 +2026,8 @@ mono_assembly_load_from_full (MonoImage *image, const char*fname,
                return ass2;
        }
 
+       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Prepared to set up assembly '%s' (%s)", ass->aname.name, image->name);
+
        image->assembly = ass;
 
        loaded_assemblies = g_list_prepend (loaded_assemblies, ass);
@@ -3178,6 +3231,19 @@ return_corlib_and_facades:
        return corlib;
 }
 
+static MonoAssembly*
+prevent_reference_assembly_from_running (MonoAssembly* candidate, gboolean refonly)
+{
+       MonoError refasm_error;
+       mono_error_init (&refasm_error);
+       if (candidate && !refonly && mono_assembly_has_reference_assembly_attribute (candidate, &refasm_error)) {
+               candidate = NULL;
+       }
+       mono_error_cleanup (&refasm_error);
+       return candidate;
+}
+
+
 MonoAssembly*
 mono_assembly_load_full_nosearch (MonoAssemblyName *aname, 
                                                                  const char       *basedir, 
@@ -3259,9 +3325,11 @@ mono_assembly_load_full_internal (MonoAssemblyName *aname, MonoAssembly *request
 {
        MonoAssembly *result = mono_assembly_load_full_nosearch (aname, basedir, status, refonly);
 
-       if (!result)
+       if (!result) {
                /* Try a postload search hook */
                result = mono_assembly_invoke_search_hook_internal (aname, requesting, refonly, TRUE);
+               result = prevent_reference_assembly_from_running (result, refonly);
+       }
        return result;
 }
 
index b414971e171dd40e479f0a4e7198fdf1691fbf0b..0cde65a2b5b1d244f5ae0e5818ee303180332e75 100644 (file)
@@ -37,7 +37,8 @@ MONO_RT_EXTERNAL_ONLY MONO_API MonoImage*    mono_assembly_load_module (MonoAsse
 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_API void        mono_assembly_foreach    (MonoFunc func, void* user_data);
+MONO_API char         *mono_native_getrootdir (void);
+MONO_API void         mono_assembly_foreach    (MonoFunc func, void* user_data);
 MONO_API void          mono_assembly_set_main   (MonoAssembly *assembly);
 MONO_API MonoAssembly *mono_assembly_get_main   (void);
 MONO_API MonoImage    *mono_assembly_get_image  (MonoAssembly *assembly);
index ea7fa289a3899b91b7917f21311f394b2726788f..2c4372ba4b493fed8b441d6704c31c88a713da4c 100644 (file)
@@ -94,7 +94,7 @@ static char *ipc_filename;
 
 static char *server_uri;
 
-static HANDLE receiver_thread_handle;
+static MonoThreadHandle *receiver_thread_handle;
 
 static gboolean stop_receiver_thread;
 
@@ -260,7 +260,7 @@ mono_attach_cleanup (void)
 
        /* Wait for the receiver thread to exit */
        if (receiver_thread_handle)
-               WaitForSingleObjectEx (receiver_thread_handle, 0, FALSE);
+               mono_thread_info_wait_one_handle (receiver_thread_handle, 0, FALSE);
 }
 
 static int
@@ -480,7 +480,7 @@ transport_start_receive (void)
        if (!listen_fd)
                return;
 
-       receiver_thread_handle = mono_threads_create_thread (receiver_thread, NULL, 0, NULL);
+       receiver_thread_handle = mono_threads_create_thread (receiver_thread, NULL, NULL, NULL);
        g_assert (receiver_thread_handle);
 }
 
index e7ee0517dd22bc28555975281b8c4820f4dd7f8d..aed903cc6a91b1f7db483af69afb4c1f19a47eae 100644 (file)
@@ -33,6 +33,7 @@
 #include <mono/utils/gc_wrapper.h>
 #include <mono/utils/mono-os-mutex.h>
 #include <mono/utils/mono-counters.h>
+#include <mono/utils/mono-compiler.h>
 
 #if HAVE_BOEHM_GC
 
@@ -99,6 +100,9 @@ mono_gc_warning (char *msg, GC_word arg)
        mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_GC, msg, (unsigned long)arg);
 }
 
+static void on_gc_notification (GC_EventType event);
+static void on_gc_heap_resize (size_t new_size);
+
 void
 mono_gc_base_init (void)
 {
@@ -251,7 +255,8 @@ mono_gc_base_init (void)
 
        mono_thread_info_attach (&dummy);
 
-       mono_gc_enable_events ();
+       GC_set_on_collection_event (on_gc_notification);
+       GC_on_heap_resize = on_gc_heap_resize;
 
        MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_NORMAL].entries, MONO_ROOT_SOURCE_GC_HANDLE, "gc handles table");
        MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_PINNED].entries, MONO_ROOT_SOURCE_GC_HANDLE, "gc handles table");
@@ -523,21 +528,6 @@ on_gc_heap_resize (size_t new_size)
        mono_profiler_gc_heap_resize (new_size);
 }
 
-void
-mono_gc_enable_events (void)
-{
-       GC_set_on_collection_event (on_gc_notification);
-       GC_on_heap_resize = on_gc_heap_resize;
-}
-
-static gboolean alloc_events = FALSE;
-
-void
-mono_gc_enable_alloc_events (void)
-{
-       alloc_events = TRUE;
-}
-
 int
 mono_gc_register_root (char *start, size_t size, void *descr, MonoGCRootSource source, const char *msg)
 {
@@ -679,7 +669,7 @@ mono_gc_alloc_obj (MonoVTable *vtable, size_t size)
                obj->vtable = vtable;
        }
 
-       if (G_UNLIKELY (alloc_events))
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS))
                mono_profiler_allocation (obj);
 
        return obj;
@@ -713,7 +703,7 @@ mono_gc_alloc_vector (MonoVTable *vtable, size_t size, uintptr_t max_length)
 
        obj->max_length = max_length;
 
-       if (G_UNLIKELY (alloc_events))
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS))
                mono_profiler_allocation (&obj->obj);
 
        return obj;
@@ -750,7 +740,7 @@ mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uint
        if (bounds_size)
                obj->bounds = (MonoArrayBounds *) ((char *) obj + size - bounds_size);
 
-       if (G_UNLIKELY (alloc_events))
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS))
                mono_profiler_allocation (&obj->obj);
 
        return obj;
@@ -768,7 +758,7 @@ mono_gc_alloc_string (MonoVTable *vtable, size_t size, gint32 len)
        obj->length = len;
        obj->chars [len] = 0;
 
-       if (G_UNLIKELY (alloc_events))
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS))
                mono_profiler_allocation (&obj->object);
 
        return obj;
@@ -1126,7 +1116,7 @@ create_allocator (int atype, int tls_key, gboolean slowpath)
 static MonoMethod* alloc_method_cache [ATYPE_NUM];
 static MonoMethod* slowpath_alloc_method_cache [ATYPE_NUM];
 
-static G_GNUC_UNUSED gboolean
+gboolean
 mono_gc_is_critical_method (MonoMethod *method)
 {
        int i;
@@ -1245,7 +1235,7 @@ mono_gc_get_write_barrier (void)
 
 #else
 
-static G_GNUC_UNUSED gboolean
+gboolean
 mono_gc_is_critical_method (MonoMethod *method)
 {
        return FALSE;
@@ -1363,11 +1353,6 @@ mono_gc_get_nursery (int *shift_bits, size_t *size)
        return NULL;
 }
 
-void
-mono_gc_set_current_thread_appdomain (MonoDomain *domain)
-{
-}
-
 gboolean
 mono_gc_precise_stack_mark_enabled (void)
 {
@@ -1380,6 +1365,16 @@ mono_gc_get_logfile (void)
        return NULL;
 }
 
+void
+mono_gc_params_set (const char* options)
+{
+}
+
+void
+mono_gc_debug_set (const char* options)
+{
+}
+
 void
 mono_gc_conservatively_scan_area (void *start, void *end)
 {
@@ -1943,8 +1938,6 @@ mono_gchandle_free_domain (MonoDomain *domain)
 
 }
 #else
-       #ifdef _MSC_VER
-               // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-               void __mono_win32_boehm_gc_quiet_lnk4221(void) {}
-       #endif
+
+MONO_EMPTY_SOURCE_FILE (boehm_gc);
 #endif /* no Boehm GC */
diff --git a/mono/metadata/class-accessors.c b/mono/metadata/class-accessors.c
new file mode 100644 (file)
index 0000000..1ea2597
--- /dev/null
@@ -0,0 +1,285 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/tabledefs.h>
+
+
+enum InfrequentDataKind {
+       PROP_MARSHAL_INFO = 1, /* MonoMarshalType */
+       PROP_EXT = 2, /* MonoClassExt */
+       PROP_REF_INFO_HANDLE = 3, /* gchandle */
+};
+
+/* Accessors based on class kind*/
+
+/*
+* mono_class_get_generic_class:
+*
+*   Return the MonoGenericClass of @klass, which MUST be a generic instance.
+*/
+MonoGenericClass*
+mono_class_get_generic_class (MonoClass *klass)
+{
+       g_assert (mono_class_is_ginst (klass));
+       return ((MonoClassGenericInst*)klass)->generic_class;
+}
+
+/*
+* mono_class_try_get_generic_class:
+*
+*   Return the MonoGenericClass if @klass is a ginst, NULL otherwise
+*/
+MonoGenericClass*
+mono_class_try_get_generic_class (MonoClass *klass)
+{
+       if (mono_class_is_ginst (klass))
+               return ((MonoClassGenericInst*)klass)->generic_class;
+       return NULL;
+}
+
+/**
+ * mono_class_get_flags:
+ * @klass: the MonoClass to act on
+ *
+ * Return the TypeAttributes flags of @klass.
+ * See the TYPE_ATTRIBUTE_* definitions on tabledefs.h for the different values.
+ *
+ * Returns: The type flags
+ */
+guint32
+mono_class_get_flags (MonoClass *klass)
+{
+       switch (klass->class_kind) {
+       case MONO_CLASS_DEF:
+       case MONO_CLASS_GTD:
+               return ((MonoClassDef*)klass)->flags;
+       case MONO_CLASS_GINST:
+               return mono_class_get_flags (((MonoClassGenericInst*)klass)->generic_class->container_class);
+       case MONO_CLASS_GPARAM:
+               return TYPE_ATTRIBUTE_PUBLIC;
+       case MONO_CLASS_ARRAY:
+               /* all arrays are marked serializable and sealed, bug #42779 */
+               return TYPE_ATTRIBUTE_CLASS | TYPE_ATTRIBUTE_SERIALIZABLE | TYPE_ATTRIBUTE_SEALED | TYPE_ATTRIBUTE_PUBLIC;
+       case MONO_CLASS_POINTER:
+               return TYPE_ATTRIBUTE_CLASS | (mono_class_get_flags (klass->element_class) & TYPE_ATTRIBUTE_VISIBILITY_MASK);
+       }
+       g_assert_not_reached ();
+}
+
+void
+mono_class_set_flags (MonoClass *klass, guint32 flags)
+{
+       g_assert (klass->class_kind == MONO_CLASS_DEF || klass->class_kind == MONO_CLASS_GTD);
+       ((MonoClassDef*)klass)->flags = flags;
+}
+
+/*
+ * mono_class_get_generic_container:
+ *
+ *   Return the generic container of KLASS which should be a generic type definition.
+ */
+MonoGenericContainer*
+mono_class_get_generic_container (MonoClass *klass)
+{
+       g_assert (mono_class_is_gtd (klass));
+
+       return ((MonoClassGtd*)klass)->generic_container;
+}
+
+MonoGenericContainer*
+mono_class_try_get_generic_container (MonoClass *klass)
+{
+       if (mono_class_is_gtd (klass))
+               return ((MonoClassGtd*)klass)->generic_container;
+       return NULL;
+}
+
+
+void
+mono_class_set_generic_container (MonoClass *klass, MonoGenericContainer *container)
+{
+       g_assert (mono_class_is_gtd (klass));
+
+       ((MonoClassGtd*)klass)->generic_container = container;
+}
+
+/*
+ * mono_class_get_first_method_idx:
+ *
+ *   Return the table index of the first method for metadata classes.
+ */
+guint32
+mono_class_get_first_method_idx (MonoClass *klass)
+{
+       g_assert (mono_class_has_static_metadata (klass));
+
+       return ((MonoClassDef*)klass)->first_method_idx;
+}
+
+void
+mono_class_set_first_method_idx (MonoClass *klass, guint32 idx)
+{
+       g_assert (mono_class_has_static_metadata (klass));
+
+       ((MonoClassDef*)klass)->first_method_idx = idx;
+}
+
+guint32
+mono_class_get_first_field_idx (MonoClass *klass)
+{
+       if (mono_class_is_ginst (klass))
+               return mono_class_get_first_field_idx (mono_class_get_generic_class (klass)->container_class);
+
+       g_assert (mono_class_has_static_metadata (klass));
+
+       return ((MonoClassDef*)klass)->first_field_idx;
+}
+
+void
+mono_class_set_first_field_idx (MonoClass *klass, guint32 idx)
+{
+       g_assert (mono_class_has_static_metadata (klass));
+
+       ((MonoClassDef*)klass)->first_field_idx = idx;
+}
+
+guint32
+mono_class_get_method_count (MonoClass *klass)
+{
+       switch (klass->class_kind) {
+       case MONO_CLASS_DEF:
+       case MONO_CLASS_GTD:
+               return ((MonoClassDef*)klass)->method_count;
+       case MONO_CLASS_GINST:
+               return mono_class_get_method_count (((MonoClassGenericInst*)klass)->generic_class->container_class);
+       case MONO_CLASS_GPARAM:
+               return 0;
+       case MONO_CLASS_ARRAY:
+               return ((MonoClassArray*)klass)->method_count;
+       case MONO_CLASS_POINTER:
+               return 0;
+       default:
+               g_assert_not_reached ();
+               return 0;
+       }
+}
+
+void
+mono_class_set_method_count (MonoClass *klass, guint32 count)
+{
+       switch (klass->class_kind) {
+       case MONO_CLASS_DEF:
+       case MONO_CLASS_GTD:
+               ((MonoClassDef*)klass)->method_count = count;
+               break;
+       case MONO_CLASS_GINST:
+               break;
+       case MONO_CLASS_GPARAM:
+       case MONO_CLASS_POINTER:
+               g_assert (count == 0);
+               break;
+       case MONO_CLASS_ARRAY:
+               ((MonoClassArray*)klass)->method_count = count;
+               break;
+       default:
+               g_assert_not_reached ();
+               break;
+       }
+}
+
+guint32
+mono_class_get_field_count (MonoClass *klass)
+{
+       switch (klass->class_kind) {
+       case MONO_CLASS_DEF:
+       case MONO_CLASS_GTD:
+               return ((MonoClassDef*)klass)->field_count;
+       case MONO_CLASS_GINST:
+               return mono_class_get_field_count (((MonoClassGenericInst*)klass)->generic_class->container_class);
+       case MONO_CLASS_GPARAM:
+       case MONO_CLASS_ARRAY:
+       case MONO_CLASS_POINTER:
+               return 0;
+       default:
+               g_assert_not_reached ();
+               return 0;
+       }
+}
+
+void
+mono_class_set_field_count (MonoClass *klass, guint32 count)
+{
+       switch (klass->class_kind) {
+       case MONO_CLASS_DEF:
+       case MONO_CLASS_GTD:
+               ((MonoClassDef*)klass)->field_count = count;
+               break;
+       case MONO_CLASS_GINST:
+               break;
+       case MONO_CLASS_GPARAM:
+       case MONO_CLASS_ARRAY:
+       case MONO_CLASS_POINTER:
+               g_assert (count == 0);
+               break;
+       default:
+               g_assert_not_reached ();
+               break;
+       }
+}
+
+MonoMarshalType*
+mono_class_get_marshal_info (MonoClass *class)
+{
+       return mono_property_bag_get (&class->infrequent_data, PROP_MARSHAL_INFO);
+}
+
+void
+mono_class_set_marshal_info (MonoClass *class, MonoMarshalType *marshal_info)
+{
+       marshal_info->head.tag = PROP_MARSHAL_INFO;
+       mono_property_bag_add (&class->infrequent_data, marshal_info);
+}
+
+MonoClassExt*
+mono_class_get_ext (MonoClass *class)
+{
+       return mono_property_bag_get (&class->infrequent_data, PROP_EXT);
+}
+
+void
+mono_class_set_ext (MonoClass *class, MonoClassExt *ext)
+{
+       ext->head.tag = PROP_EXT;
+       mono_property_bag_add (&class->infrequent_data, ext);
+}
+
+typedef struct {
+       MonoPropertyBagItem head;
+       guint32 value;
+} Uint32Property;
+
+guint32
+mono_class_get_ref_info_handle (MonoClass *class)
+{
+       Uint32Property *prop = mono_property_bag_get (&class->infrequent_data, PROP_REF_INFO_HANDLE);
+       return prop ? prop->value : 0;
+}
+
+guint32
+mono_class_set_ref_info_handle (MonoClass *class, guint32 value)
+{
+       if (!value) {
+               Uint32Property *prop = mono_property_bag_get (&class->infrequent_data, PROP_REF_INFO_HANDLE);
+               if (prop)
+                       prop->value = 0;
+               return 0;
+       }
+
+       Uint32Property *prop = mono_class_alloc (class, sizeof (Uint32Property));
+       prop->head.tag = PROP_REF_INFO_HANDLE;
+       prop->value = value;
+       prop = mono_property_bag_add (&class->infrequent_data, prop);
+       return prop->value;
+}
diff --git a/mono/metadata/class-inlines.h b/mono/metadata/class-inlines.h
new file mode 100644 (file)
index 0000000..2e884ba
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_CLASS_INLINES_H__
+#define __MONO_METADATA_CLASS_INLINES_H__
+
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/tabledefs.h>
+
+static inline gboolean
+mono_class_is_def (MonoClass *klass)
+{
+       return klass->class_kind == MONO_CLASS_DEF;
+}
+
+static inline gboolean
+mono_class_is_gtd (MonoClass *klass)
+{
+       return klass->class_kind == MONO_CLASS_GTD;
+}
+
+static inline gboolean
+mono_class_is_ginst (MonoClass *klass)
+{
+       return klass->class_kind == MONO_CLASS_GINST;
+}
+
+static inline gboolean
+mono_class_is_gparam (MonoClass *klass)
+{
+       return klass->class_kind == MONO_CLASS_GPARAM;
+}
+
+static inline gboolean
+mono_class_is_array (MonoClass *klass)
+{
+       return klass->class_kind == MONO_CLASS_ARRAY;
+}
+
+static inline gboolean
+mono_class_is_pointer (MonoClass *klass)
+{
+       return klass->class_kind == MONO_CLASS_POINTER;
+}
+
+static inline gboolean
+mono_class_is_abstract (MonoClass *klass)
+{
+       return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_ABSTRACT;
+}
+
+static inline gboolean
+mono_class_is_interface (MonoClass *klass)
+{
+       return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_INTERFACE;
+}
+
+static inline gboolean
+mono_class_is_sealed (MonoClass *klass)
+{
+       return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_SEALED;
+}
+
+static inline gboolean
+mono_class_is_before_field_init (MonoClass *klass)
+{
+       return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT;
+}
+
+static inline gboolean
+mono_class_is_auto_layout (MonoClass *klass)
+{
+       return (mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT;
+}
+
+static inline gboolean
+mono_class_is_explicit_layout (MonoClass *klass)
+{
+       return (mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT;
+}
+
+static inline gboolean
+mono_class_is_public (MonoClass *klass)
+{
+       return mono_class_get_flags (klass) & TYPE_ATTRIBUTE_PUBLIC;
+}
+
+static inline gboolean
+mono_class_has_static_metadata (MonoClass *klass)
+{
+       return klass->type_token && !klass->image->dynamic && !mono_class_is_ginst (klass);
+}
+
+#endif
index a8e73da2776eadca38a16ba93e64332eccce2750..40a8780dbbdd228d24efcaba92c53aa823c47779 100644 (file)
@@ -9,6 +9,7 @@
 #include <mono/metadata/object.h>
 #include <mono/metadata/mempool.h>
 #include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/property-bag.h>
 #include <mono/io-layer/io-layer.h>
 #include "mono/utils/mono-compiler.h"
 #include "mono/utils/mono-error.h"
@@ -16,7 +17,7 @@
 
 #define MONO_CLASS_IS_ARRAY(c) ((c)->rank)
 
-#define MONO_CLASS_HAS_STATIC_METADATA(klass) ((klass)->type_token && !(klass)->image->dynamic && !(klass)->generic_class)
+#define MONO_CLASS_HAS_STATIC_METADATA(klass) ((klass)->type_token && !(klass)->image->dynamic && !mono_class_is_ginst (klass))
 
 #define MONO_DEFAULT_SUPERTABLE_SIZE 6
 
@@ -164,6 +165,8 @@ typedef struct {
 } MonoMarshalField;
 
 typedef struct {
+       MonoPropertyBagItem head;
+
        guint32 native_size, min_align;
        guint32 num_fields;
        MonoMethod *ptr_to_str;
@@ -194,7 +197,7 @@ struct _MonoEvent {
 };
 
 /* type of exception being "on hold" for later processing (see exception_type) */
-enum {
+typedef enum {
        MONO_EXCEPTION_NONE = 0,
        MONO_EXCEPTION_INVALID_PROGRAM = 3,
        MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
@@ -211,7 +214,7 @@ enum {
        MONO_EXCEPTION_INLINE_FAILED = 15,
        MONO_EXCEPTION_MONO_ERROR = 16,
        /* add other exception type */
-};
+} MonoExceptionType;
 
 /* This struct collects the info needed for the runtime use of a class,
  * like the vtables for a domain, the GC descriptor, etc.
@@ -232,6 +235,8 @@ typedef struct {
  * be used for fields which are only used in like 5% of all classes.
  */
 typedef struct {
+       MonoPropertyBagItem head;
+
        struct {
 #if MONO_SMALL_CONFIG
                guint16 first, count;
@@ -256,6 +261,15 @@ typedef struct {
        GList      *nested_classes;
 } MonoClassExt;
 
+typedef enum {
+       MONO_CLASS_DEF = 1, /* non-generic type */
+       MONO_CLASS_GTD, /* generic type definition */
+       MONO_CLASS_GINST, /* generic instantiation */
+       MONO_CLASS_GPARAM, /* generic parameter */
+       MONO_CLASS_ARRAY, /* vector or array, bounded or not */
+       MONO_CLASS_POINTER, /* pointer of function pointer*/
+} MonoTypeKind;
+
 struct _MonoClass {
        /* element class for arrays and enum basetype for enums */
        MonoClass *element_class; 
@@ -272,8 +286,6 @@ struct _MonoClass {
        int        instance_size; /* object instance size */
 
        guint inited          : 1;
-       /* We use init_pending to detect cyclic calls to mono_class_init */
-       guint init_pending    : 1;
 
        /* A class contains static and non static data. Static data can be
         * of the same type as the class itselfs, but it does not influence
@@ -317,19 +329,12 @@ struct _MonoClass {
        guint nested_classes_inited : 1; /* Whenever nested_class is initialized */
 
        /* next byte*/
+       guint class_kind : 3; /* One of the values from MonoTypeKind */
        guint interfaces_inited : 1; /* interfaces is initialized */
        guint simd_type : 1; /* class is a simd intrinsic type */
-       guint is_generic : 1; /* class is a generic type definition */
-       guint is_inflated : 1; /* class is a generic instance */
        guint has_finalize_inited    : 1; /* has_finalize is initialized */
-       guint fields_inited : 1; /* fields is initialized */
-       guint setup_fields_called : 1; /* to prevent infinite loops in setup_fields */
-
-       guint8     exception_type;      /* MONO_EXCEPTION_* */
-
-       /* Additional information about the exception */
-       /* Stored as property MONO_CLASS_PROP_EXCEPTION_DATA */
-       //void       *exception_data;
+       guint fields_inited : 1; /* setup_fields () has finished */
+       guint has_failure : 1; /* See MONO_CLASS_PROP_EXCEPTION_DATA for a MonoErrorBoxed with the details */
 
        MonoClass  *parent;
        MonoClass  *nested_in;
@@ -342,8 +347,8 @@ struct _MonoClass {
        int        vtable_size; /* number of slots */
 
        guint16     interface_count;
-       guint16     interface_id;        /* unique inderface id (for interfaces) */
-       guint16     max_interface_id;
+       guint32     interface_id;        /* unique inderface id (for interfaces) */
+       guint32     max_interface_id;
        
        guint16     interface_offsets_count;
        MonoClass **interfaces_packed;
@@ -362,24 +367,6 @@ struct _MonoClass {
                int generic_param_token; /* for generic param types, both var and mvar */
        } sizes;
 
-       /*
-        * From the TypeDef table
-        */
-       guint32    flags;
-       struct {
-#if MONO_SMALL_CONFIG
-               guint16 first, count;
-#else
-               guint32 first, count;
-#endif
-       } field, method;
-
-       /* A GC handle pointing to the corresponding type builder/generic param builder */
-       guint32 ref_info_handle;
-
-       /* loaded on demand */
-       MonoMarshalType *marshal_info;
-
        /*
         * Field information: Type and location from object base
         */
@@ -391,23 +378,53 @@ struct _MonoClass {
        MonoType this_arg;
        MonoType byval_arg;
 
-       MonoGenericClass *generic_class;
-       MonoGenericContainer *generic_container;
-
        MonoGCDescriptor gc_descr;
 
        MonoClassRuntimeInfo *runtime_info;
 
-       /* next element in the class_cache hash list (in MonoImage) */
-       MonoClass *next_class_cache;
-
        /* Generic vtable. Initialized by a call to mono_class_setup_vtable () */
        MonoMethod **vtable;
 
-       /* Rarely used fields of classes */
-       MonoClassExt *ext;
+       /* Infrequently used items. See class-accessors.c: InfrequentDataKind for what goes into here. */
+       MonoPropertyBag infrequent_data;
 };
 
+typedef struct {
+       MonoClass class;
+       guint32 flags;
+       /*
+        * From the TypeDef table
+        */
+       guint32 first_method_idx;
+       guint32 first_field_idx;
+       guint32 method_count, field_count;
+       /* next element in the class_cache hash list (in MonoImage) */
+       MonoClass *next_class_cache;
+} MonoClassDef;
+
+typedef struct {
+       MonoClassDef class;
+       MonoGenericContainer *generic_container;
+} MonoClassGtd;
+
+typedef struct {
+       MonoClass class;
+       MonoGenericClass *generic_class;
+} MonoClassGenericInst;
+
+typedef struct {
+       MonoClass class;
+} MonoClassGenericParam;
+
+typedef struct {
+       MonoClass class;
+       guint32 method_count;
+} MonoClassArray;
+
+typedef struct {
+       MonoClass class;
+} MonoClassPointer;
+
 #ifdef COMPRESSED_INTERFACE_BITMAP
 int mono_compress_bitmap (uint8_t *dest, const uint8_t *bitmap, int size);
 int mono_class_interface_match (const uint8_t *bitmap, int id);
@@ -456,7 +473,7 @@ struct MonoVTable {
        MonoDomain *domain;  /* each object/vtable belongs to exactly one domain */
         gpointer    type; /* System.Type type for klass */
        guint8     *interface_bitmap;
-       guint16     max_interface_id;
+       guint32     max_interface_id;
        guint8      rank;
        guint remote          : 1; /* class is remotely activated */
        guint initialized     : 1; /* cctor has been run */
@@ -712,7 +729,7 @@ void
 mono_class_setup_supertypes (MonoClass *klass);
 
 void
-mono_class_setup_fields_locking (MonoClass *klass);
+mono_class_setup_fields (MonoClass *klass);
 
 /* WARNING
  * Only call this function if you can ensure both @klass and @parent
@@ -916,7 +933,7 @@ void
 mono_classes_cleanup (void);
 
 void
-mono_class_layout_fields   (MonoClass *klass, int instance_size);
+mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_size, gboolean sre);
 
 void
 mono_class_setup_interface_offsets (MonoClass *klass);
@@ -1258,10 +1275,7 @@ const char*
 mono_lookup_jit_icall_symbol (const char *name);
 
 gboolean
-mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data);
-
-gpointer
-mono_class_get_exception_data (MonoClass *klass);
+mono_class_set_type_load_failure (MonoClass *klass, const char * fmt, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
 
 MonoException*
 mono_class_get_exception_for_failure (MonoClass *klass);
@@ -1347,9 +1361,6 @@ mono_class_setup_interface_id (MonoClass *klass);
 MonoGenericContainer*
 mono_class_get_generic_container (MonoClass *klass);
 
-MonoGenericClass*
-mono_class_get_generic_class (MonoClass *klass);
-
 gpointer
 mono_class_alloc (MonoClass *klass, int size);
 
@@ -1437,20 +1448,70 @@ MonoClass*
 mono_class_try_load_from_name (MonoImage *image, const char* name_space, const char *name);
 
 void
-mono_error_set_for_class_failure (MonoError *orerror, MonoClass *klass);
+mono_error_set_for_class_failure (MonoError *orerror, const MonoClass *klass);
 
-static inline guint8
-mono_class_get_failure (MonoClass *klass)
-{
-       g_assert (klass != NULL);
-       return klass->exception_type;
-}
+gboolean
+mono_class_has_failure (const MonoClass *klass);
 
-static inline gboolean
-mono_class_has_failure (MonoClass *klass)
-{
-       g_assert (klass != NULL);
-       return mono_class_get_failure (klass) != MONO_EXCEPTION_NONE;
-}
+/* Kind specific accessors */
+MonoGenericClass*
+mono_class_get_generic_class (MonoClass *klass);
+
+MonoGenericClass*
+mono_class_try_get_generic_class (MonoClass *klass);
+
+void
+mono_class_set_flags (MonoClass *klass, guint32 flags);
+
+MonoGenericContainer*
+mono_class_try_get_generic_container (MonoClass *klass);
+
+void
+mono_class_set_generic_container (MonoClass *klass, MonoGenericContainer *container);
+
+guint32
+mono_class_get_first_method_idx (MonoClass *klass);
+
+void
+mono_class_set_first_method_idx (MonoClass *klass, guint32 idx);
+
+guint32
+mono_class_get_first_field_idx (MonoClass *klass);
+
+void
+mono_class_set_first_field_idx (MonoClass *klass, guint32 idx);
+
+guint32
+mono_class_get_method_count (MonoClass *klass);
+
+void
+mono_class_set_method_count (MonoClass *klass, guint32 count);
+
+guint32
+mono_class_get_field_count (MonoClass *klass);
+
+void
+mono_class_set_field_count (MonoClass *klass, guint32 count);
+
+MonoMarshalType*
+mono_class_get_marshal_info (MonoClass *class);
+
+void
+mono_class_set_marshal_info (MonoClass *class, MonoMarshalType *marshal_info);
+
+MonoClassExt*
+mono_class_get_ext (MonoClass *class);
+
+void
+mono_class_set_ext (MonoClass *class, MonoClassExt *ext);
+
+guint32
+mono_class_get_ref_info_handle (MonoClass *class);
+
+guint32
+mono_class_set_ref_info_handle (MonoClass *class, guint32 value);
+
+/*Now that everything has been defined, let's include the inline functions */
+#include <mono/metadata/class-inlines.h>
 
 #endif /* __MONO_METADATA_CLASS_INTERNALS_H__ */
index e1fc5acb86b5ff998a7b098a507f737ff248e88b..3f54ba7397c04d4e32e998a530b0d2a32b7bfd1c 100644 (file)
@@ -54,8 +54,9 @@ gboolean mono_print_vtable = FALSE;
 gboolean mono_align_small_structs = FALSE;
 
 /* Statistics */
-guint32 inflated_classes, inflated_classes_size, inflated_methods_size;
-guint32 classes_size, class_ext_size;
+guint32 inflated_classes_size, inflated_methods_size;
+guint32 classes_size, class_ext_size, class_ext_count;
+guint32 class_def_count, class_gtd_count, class_ginst_count, class_gparam_count, class_array_count, class_pointer_count;
 
 /* Low level lock which protects data structures in this module */
 static mono_mutex_t classes_mutex;
@@ -77,6 +78,10 @@ static guint32 mono_field_resolve_flags (MonoClassField *field);
 static void mono_class_setup_vtable_full (MonoClass *klass, GList *in_setup);
 static void mono_generic_class_setup_parent (MonoClass *klass, MonoClass *gklass);
 
+static gboolean mono_class_set_failure (MonoClass *klass, MonoErrorBoxed *boxed_error);
+static gpointer mono_class_get_exception_data (const MonoClass *klass);
+
+
 /*
 We use gclass recording to allow recursive system f types to be referenced by a parent.
 
@@ -104,6 +109,11 @@ static int record_gclass_instantiation;
 static GSList *gclass_recorded_list;
 typedef gboolean (*gclass_record_func) (MonoClass*, void*);
 
+/* This TLS variable points to a GSList of classes which have setup_fields () executing */
+static MonoNativeTlsKey setup_fields_tls_id;
+
+static MonoNativeTlsKey init_pending_tls_id;
+
 static inline void
 classes_lock (void)
 {
@@ -235,9 +245,10 @@ mono_class_from_typeref_checked (MonoImage *image, guint32 type_token, MonoError
                enclosing = mono_class_from_typeref_checked (image, MONO_TOKEN_TYPE_REF | idx, error); 
                return_val_if_nok (error, NULL);
 
-               if (enclosing->nested_classes_inited && enclosing->ext) {
+               MonoClassExt *ext = mono_class_get_ext (enclosing);
+               if (enclosing->nested_classes_inited && ext) {
                        /* Micro-optimization: don't scan the metadata tables if enclosing is already inited */
-                       for (tmp = enclosing->ext->nested_classes; tmp; tmp = tmp->next) {
+                       for (tmp = ext->nested_classes; tmp; tmp = tmp->next) {
                                res = (MonoClass *)tmp->data;
                                if (strcmp (res->name, name) == 0)
                                        return res;
@@ -497,8 +508,8 @@ mono_type_get_name_recurse (MonoType *type, GString *str, gboolean is_recursed,
                }
                if (is_recursed)
                        break;
-               if (klass->generic_class) {
-                       MonoGenericClass *gclass = klass->generic_class;
+               if (mono_class_is_ginst (klass)) {
+                       MonoGenericClass *gclass = mono_class_get_generic_class (klass);
                        MonoGenericInst *inst = gclass->context.class_inst;
                        MonoTypeNameFormat nested_format;
                        int i;
@@ -527,7 +538,7 @@ mono_type_get_name_recurse (MonoType *type, GString *str, gboolean is_recursed,
                                g_string_append_c (str, '>');
                        else
                                g_string_append_c (str, ']');
-               } else if (klass->generic_container &&
+               } else if (mono_class_is_gtd (klass) &&
                           (format != MONO_TYPE_NAME_FORMAT_FULL_NAME) &&
                           (format != MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED)) {
                        int i;
@@ -536,10 +547,10 @@ mono_type_get_name_recurse (MonoType *type, GString *str, gboolean is_recursed,
                                g_string_append_c (str, '<');
                        else
                                g_string_append_c (str, '[');
-                       for (i = 0; i < klass->generic_container->type_argc; i++) {
+                       for (i = 0; i < mono_class_get_generic_container (klass)->type_argc; i++) {
                                if (i)
                                        g_string_append_c (str, ',');
-                               g_string_append (str, mono_generic_container_get_param_info (klass->generic_container, i)->name);
+                               g_string_append (str, mono_generic_container_get_param_info (mono_class_get_generic_container (klass), i)->name);
                        }
                        if (format == MONO_TYPE_NAME_FORMAT_IL) 
                                g_string_append_c (str, '>');
@@ -658,7 +669,7 @@ mono_class_is_open_constructed_type (MonoType *t)
                return t->data.generic_class->context.class_inst->is_open;
        case MONO_TYPE_CLASS:
        case MONO_TYPE_VALUETYPE:
-               return t->data.klass->generic_container != NULL;
+               return mono_class_is_gtd (t->data.klass);
        default:
                return FALSE;
        }
@@ -781,7 +792,7 @@ inflate_generic_type (MonoImage *image, MonoType *type, MonoGenericContext *cont
        case MONO_TYPE_CLASS:
        case MONO_TYPE_VALUETYPE: {
                MonoClass *klass = type->data.klass;
-               MonoGenericContainer *container = klass->generic_container;
+               MonoGenericContainer *container = mono_class_try_get_generic_container (klass);
                MonoGenericInst *inst;
                MonoGenericClass *gclass = NULL;
                MonoType *nt;
@@ -818,33 +829,8 @@ mono_generic_class_get_context (MonoGenericClass *gclass)
 MonoGenericContext *
 mono_class_get_context (MonoClass *klass)
 {
-       return klass->generic_class ? mono_generic_class_get_context (klass->generic_class) : NULL;
-}
-
-/*
- * mono_class_get_generic_container:
- *
- *   Return the generic container of KLASS which should be a generic type definition.
- */
-MonoGenericContainer*
-mono_class_get_generic_container (MonoClass *klass)
-{
-       g_assert (klass->is_generic);
-
-       return klass->generic_container;
-}
-
-/*
- * mono_class_get_generic_class:
- *
- *   Return the MonoGenericClass of KLASS, which should be a generic instance.
- */
-MonoGenericClass*
-mono_class_get_generic_class (MonoClass *klass)
-{
-       g_assert (klass->is_inflated);
-
-       return klass->generic_class;
+       MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
+       return gklass ? mono_generic_class_get_context (gklass) : NULL;
 }
 
 /*
@@ -1075,7 +1061,7 @@ mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *k
         * 
         */
        if (!((method->is_generic && context->method_inst) || 
-               (method->klass->generic_container && context->class_inst)))
+               (mono_class_is_gtd (method->klass) && context->class_inst)))
                return method;
 
        iresult = g_new0 (MonoMethodInflated, 1);
@@ -1086,14 +1072,12 @@ mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *k
                iresult->context.method_inst = mono_method_get_generic_container (method)->context.method_inst;
 
        if (!context->class_inst) {
-               g_assert (!iresult->declaring->klass->generic_class);
-               if (iresult->declaring->klass->generic_container)
-                       iresult->context.class_inst = iresult->declaring->klass->generic_container->context.class_inst;
-               else if (iresult->declaring->klass->generic_class)
-                       iresult->context.class_inst = iresult->declaring->klass->generic_class->context.class_inst;
+               g_assert (!mono_class_is_ginst (iresult->declaring->klass));
+               if (mono_class_is_gtd (iresult->declaring->klass))
+                       iresult->context.class_inst = mono_class_get_generic_container (iresult->declaring->klass)->context.class_inst;
        }
        /* This can happen with some callers like mono_object_get_virtual_method () */
-       if (!iresult->declaring->klass->generic_container && !iresult->declaring->klass->generic_class)
+       if (!mono_class_is_gtd (iresult->declaring->klass) && !mono_class_is_ginst (iresult->declaring->klass))
                iresult->context.class_inst = NULL;
 
        MonoImageSet *set = mono_metadata_get_image_set_for_method (iresult);
@@ -1151,12 +1135,13 @@ mono_class_inflate_generic_method_full_checked (MonoMethod *method, MonoClass *k
                }
        }
 
-       if (!klass_hint || !klass_hint->generic_class ||
-           klass_hint->generic_class->container_class != method->klass ||
-           klass_hint->generic_class->context.class_inst != context->class_inst)
-               klass_hint = NULL;
+       if (klass_hint) {
+               MonoGenericClass *gklass_hint = mono_class_try_get_generic_class (klass_hint);
+               if (gklass_hint && (gklass_hint->container_class != method->klass || gklass_hint->context.class_inst != context->class_inst))
+                       klass_hint = NULL;
+       }
 
-       if (method->klass->generic_container)
+       if (mono_class_is_gtd (method->klass))
                result->klass = klass_hint;
 
        if (!result->klass) {
@@ -1231,8 +1216,8 @@ mono_method_get_context_general (MonoMethod *method, gboolean uninflated)
                return NULL;
        if (method->is_generic)
                return &(mono_method_get_generic_container (method)->context);
-       if (method->klass->generic_container)
-               return &method->klass->generic_container->context;
+       if (mono_class_is_gtd (method->klass))
+               return &mono_class_get_generic_container (method->klass)->context;
        return NULL;
 }
 
@@ -1296,32 +1281,32 @@ mono_class_find_enum_basetype (MonoClass *klass, MonoError *error)
 {
        MonoGenericContainer *container = NULL;
        MonoImage *m = klass->image;
-       const int top = klass->field.count;
-       int i;
+       const int top = mono_class_get_field_count (klass);
+       int i, first_field_idx;
 
        g_assert (klass->enumtype);
 
        mono_error_init (error);
 
-       if (klass->generic_container)
-               container = klass->generic_container;
-       else if (klass->generic_class) {
-               MonoClass *gklass = klass->generic_class->container_class;
+       container = mono_class_try_get_generic_container (klass);
+       if (mono_class_is_ginst (klass)) {
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
-               container = gklass->generic_container;
+               container = mono_class_get_generic_container (gklass);
                g_assert (container);
        }
 
        /*
         * Fetch all the field information.
         */
+       first_field_idx = mono_class_get_first_field_idx (klass);
        for (i = 0; i < top; i++){
                const char *sig;
                guint32 cols [MONO_FIELD_SIZE];
-               int idx = klass->field.first + i;
+               int idx = first_field_idx + i;
                MonoType *ftype;
 
-               /* klass->field.first and idx points into the fieldptr table */
+               /* first_field_idx and idx points into the fieldptr table */
                mono_metadata_decode_table_row (m, MONO_TABLE_FIELD, idx, cols, MONO_FIELD_SIZE);
 
                if (cols [MONO_FIELD_FLAGS] & FIELD_ATTRIBUTE_STATIC) //no need to decode static fields
@@ -1344,7 +1329,7 @@ mono_class_find_enum_basetype (MonoClass *klass, MonoError *error)
                if (!ftype)
                        goto fail;
 
-               if (klass->generic_class) {
+               if (mono_class_is_ginst (klass)) {
                        //FIXME do we leak here?
                        ftype = mono_class_inflate_generic_type_checked (ftype, mono_class_get_context (klass), error);
                        if (!mono_error_ok (error))
@@ -1361,7 +1346,7 @@ fail:
 }
 
 /*
- * Checks for MonoClass::exception_type without resolving all MonoType's into MonoClass'es
+ * Checks for MonoClass::has_failure without resolving all MonoType's into MonoClass'es
  */
 static gboolean
 mono_type_has_exceptions (MonoType *type)
@@ -1381,26 +1366,11 @@ mono_type_has_exceptions (MonoType *type)
 }
 
 void
-mono_error_set_for_class_failure (MonoError *oerror, MonoClass *klass)
+mono_error_set_for_class_failure (MonoError *oerror, const MonoClass *klass)
 {
-       gpointer exception_data = mono_class_get_exception_data (klass);
-
-       switch (mono_class_get_failure(klass)) {
-       case MONO_EXCEPTION_TYPE_LOAD: {
-               mono_error_set_type_load_class (oerror, klass, "Error Loading class");
-               return;
-       }
-       case MONO_EXCEPTION_INVALID_PROGRAM: {
-               mono_error_set_invalid_program (oerror, (const char *)exception_data);
-               return;
-       }
-       case MONO_EXCEPTION_MISSING_METHOD:
-       case MONO_EXCEPTION_MISSING_FIELD:
-       case MONO_EXCEPTION_FILE_NOT_FOUND:
-       case MONO_EXCEPTION_BAD_IMAGE:
-       default:
-               g_assert_not_reached ();
-       }
+       g_assert (mono_class_has_failure (klass));
+       MonoErrorBoxed *box = (MonoErrorBoxed*)mono_class_get_exception_data (klass);
+       mono_error_set_from_boxed (oerror, box);
 }
 
 
@@ -1413,8 +1383,9 @@ mono_error_set_for_class_failure (MonoError *oerror, MonoClass *klass)
 gpointer
 mono_class_alloc (MonoClass *klass, int size)
 {
-       if (klass->generic_class)
-               return mono_image_set_alloc (klass->generic_class->owner, size);
+       MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
+       if (gklass)
+               return mono_image_set_alloc (gklass->owner, size);
        else
                return mono_image_alloc (klass->image, size);
 }
@@ -1436,13 +1407,18 @@ mono_class_alloc0 (MonoClass *klass, int size)
  * mono_class_setup_basic_field_info:
  * @class: The class to initialize
  *
- * Initializes the klass->fields.
- * LOCKING: Assumes the loader lock is held.
+ * Initializes the following fields in MonoClass:
+ * * klass->fields (only field->parent and field->name)
+ * * klass->field.count
+ * * klass->first_field_idx
+ * LOCKING: Acquires the loader lock
  */
 static void
 mono_class_setup_basic_field_info (MonoClass *klass)
 {
+       MonoGenericClass *gklass;
        MonoClassField *field;
+       MonoClassField *fields;
        MonoClass *gtd;
        MonoImage *image;
        int i, top;
@@ -1450,11 +1426,12 @@ mono_class_setup_basic_field_info (MonoClass *klass)
        if (klass->fields)
                return;
 
-       gtd = klass->generic_class ? mono_class_get_generic_type_definition (klass) : NULL;
+       gklass = mono_class_try_get_generic_class (klass);
+       gtd = gklass ? mono_class_get_generic_type_definition (klass) : NULL;
        image = klass->image;
-       top = klass->field.count;
 
-       if (klass->generic_class && image_is_dynamic (klass->generic_class->container_class->image) && !klass->generic_class->container_class->wastypebuilder) {
+
+       if (gklass && image_is_dynamic (gklass->container_class->image) && !gklass->container_class->wastypebuilder) {
                /*
                 * This happens when a generic instance of an unfinished generic typebuilder
                 * is used as an element type for creating an array type. We can't initialize
@@ -1467,105 +1444,103 @@ mono_class_setup_basic_field_info (MonoClass *klass)
        if (gtd) {
                mono_class_setup_basic_field_info (gtd);
 
-               top = gtd->field.count;
-               klass->field.first = gtd->field.first;
-               klass->field.count = gtd->field.count;
+               mono_loader_lock ();
+               mono_class_set_field_count (klass, mono_class_get_field_count (gtd));
+               mono_loader_unlock ();
        }
 
-       klass->fields = (MonoClassField *)mono_class_alloc0 (klass, sizeof (MonoClassField) * top);
+       top = mono_class_get_field_count (klass);
+
+       fields = (MonoClassField *)mono_class_alloc0 (klass, sizeof (MonoClassField) * top);
 
        /*
         * Fetch all the field information.
         */
-       for (i = 0; i < top; i++){
-               field = &klass->fields [i];
+       int first_field_idx = mono_class_has_static_metadata (klass) ? mono_class_get_first_field_idx (klass) : 0;
+       for (i = 0; i < top; i++) {
+               field = &fields [i];
                field->parent = klass;
 
                if (gtd) {
                        field->name = mono_field_get_name (&gtd->fields [i]);
                } else {
-                       int idx = klass->field.first + i;
-                       /* klass->field.first and idx points into the fieldptr table */
+                       int idx = first_field_idx + i;
+                       /* first_field_idx and idx points into the fieldptr table */
                        guint32 name_idx = mono_metadata_decode_table_row_col (image, MONO_TABLE_FIELD, idx, MONO_FIELD_NAME);
                        /* The name is needed for fieldrefs */
                        field->name = mono_metadata_string_heap (image, name_idx);
                }
        }
+
+       mono_memory_barrier ();
+
+       mono_loader_lock ();
+       if (!klass->fields)
+               klass->fields = fields;
+       mono_loader_unlock ();
+}
+
+/**
+ * mono_class_set_failure_causedby_class:
+ * @klass: the class that is failing
+ * @caused_by: the class that caused the failure
+ * @msg: Why @klass is failing.
+ * 
+ * If @caused_by has a failure, sets a TypeLoadException failure on
+ * @klass with message "@msg, due to: {@caused_by message}".
+ *
+ * Returns: TRUE if a failiure was set, or FALSE if @caused_by doesn't have a failure.
+ */
+static gboolean
+mono_class_set_type_load_failure_causedby_class (MonoClass *klass, const MonoClass *caused_by, const gchar* msg)
+{
+       if (mono_class_has_failure (caused_by)) {
+               MonoError cause_error;
+               mono_error_init (&cause_error);
+               mono_error_set_for_class_failure (&cause_error, caused_by);
+               mono_class_set_type_load_failure (klass, "%s, due to: %s", msg, mono_error_get_message (&cause_error));
+               mono_error_cleanup (&cause_error);
+               return TRUE;
+       } else {
+               return FALSE;
+       }
 }
 
+
 /** 
  * mono_class_setup_fields:
- * @class: The class to initialize
+ * @klass: The class to initialize
+ *
+ * Initializes klass->fields, computes class layout and sizes.
+ * typebuilder_setup_fields () is the corresponding function for dynamic classes.
+ * Sets the following fields in @klass:
+ *  - all the fields initialized by mono_class_init_sizes ()
+ *  - element_class/cast_class (for enums)
+ *  - field->type/offset for all fields
+ *  - fields_inited
  *
- * Initializes the klass->fields.
- * LOCKING: Assumes the loader lock is held.
+ * LOCKING: Acquires the loader lock.
  */
-static void
+void
 mono_class_setup_fields (MonoClass *klass)
 {
        MonoError error;
        MonoImage *m = klass->image;
        int top;
-       guint32 layout = klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
-       int i, blittable = TRUE;
+       guint32 layout = mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK;
+       int i;
        guint32 real_size = 0;
        guint32 packing_size = 0;
        int instance_size;
        gboolean explicit_size;
        MonoClassField *field;
-       MonoGenericContainer *container = NULL;
-       MonoClass *gtd = klass->generic_class ? mono_class_get_generic_type_definition (klass) : NULL;
+       MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
+       MonoClass *gtd = gklass ? mono_class_get_generic_type_definition (klass) : NULL;
 
-       /*
-        * FIXME: We have a race condition here.  It's possible that this function returns
-        * to its caller with `instance_size` set to `0` instead of the actual size.  This
-        * is not a problem when the function is called recursively on the same class,
-        * because the size will be initialized by the outer invocation.  What follows is a
-        * description of how it can occur in other cases, too.  There it is a problem,
-        * because it can lead to the GC being asked to allocate an object of size `0`,
-        * which SGen chokes on.  The race condition is triggered infrequently by
-        * `tests/sgen-suspend.cs`.
-        *
-        * This function is called for a class whenever one of its subclasses is inited.
-        * For example, it's called for every subclass of Object.  What it does is this:
-        *
-        *     if (klass->setup_fields_called)
-        *         return;
-        *     ...
-        *     klass->instance_size = 0;
-        *     ...
-        *     klass->setup_fields_called = 1;
-        *     ... critical point
-        *     klass->instance_size = actual_instance_size;
-        *
-        * The last two steps are sometimes reversed, but that only changes the way in which
-        * the race condition works.
-        *
-        * Assume thread A goes through this function and makes it to the critical point.
-        * Now thread B runs the function and, since `setup_fields_called` is set, returns
-        * immediately, but `instance_size` is incorrect.
-        *
-        * The other case looks like this:
-        *
-        *     if (klass->setup_fields_called)
-        *         return;
-        *     ... critical point X
-        *     klass->instance_size = 0;
-        *     ... critical point Y
-        *     klass->instance_size = actual_instance_size;
-        *     ...
-        *     klass->setup_fields_called = 1;
-        *
-        * Assume thread A goes through the function and makes it to critical point X.  Now
-        * thread B runs through the whole of the function, returning, assuming
-        * `instance_size` is set.  At that point thread A gets to run and makes it to
-        * critical point Y, at which time `instance_size` is `0` again, invalidating thread
-        * B's assumption.
-        */
-       if (klass->setup_fields_called)
+       if (klass->fields_inited)
                return;
 
-       if (klass->generic_class && image_is_dynamic (klass->generic_class->container_class->image) && !klass->generic_class->container_class->wastypebuilder) {
+       if (gklass && image_is_dynamic (gklass->container_class->image) && !gklass->container_class->wastypebuilder) {
                /*
                 * This happens when a generic instance of an unfinished generic typebuilder
                 * is used as an element type for creating an array type. We can't initialize
@@ -1576,103 +1551,55 @@ mono_class_setup_fields (MonoClass *klass)
        }
 
        mono_class_setup_basic_field_info (klass);
-       top = klass->field.count;
+       top = mono_class_get_field_count (klass);
 
        if (gtd) {
                mono_class_setup_fields (gtd);
-               if (mono_class_has_failure (gtd)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               if (mono_class_set_type_load_failure_causedby_class (klass, gtd, "Generic type definition failed"))
                        return;
-               }
        }
 
        instance_size = 0;
-       if (!klass->rank)
-               klass->sizes.class_size = 0;
-
        if (klass->parent) {
                /* For generic instances, klass->parent might not have been initialized */
                mono_class_init (klass->parent);
-               if (!klass->parent->size_inited) {
-                       mono_class_setup_fields (klass->parent);
-                       if (mono_class_has_failure (klass->parent)) {
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
-                               return;
-                       }
-               }
-               instance_size += klass->parent->instance_size;
-               klass->min_align = klass->parent->min_align;
-               /* we use |= since it may have been set already */
-               klass->has_references |= klass->parent->has_references;
-               blittable = klass->parent->blittable;
+               mono_class_setup_fields (klass->parent);
+               if (mono_class_set_type_load_failure_causedby_class (klass, klass->parent, "Could not set up parent class"))
+                       return;
+               instance_size = klass->parent->instance_size;
        } else {
                instance_size = sizeof (MonoObject);
-               klass->min_align = 1;
        }
 
-       /* We can't really enable 16 bytes alignment until the GC supports it.
-       The whole layout/instance size code must be reviewed because we do alignment calculation in terms of the
-       boxed instance, which leads to unexplainable holes at the beginning of an object embedding a simd type.
-       Bug #506144 is an example of this issue.
-
-        if (klass->simd_type)
-               klass->min_align = 16;
-        */
        /* Get the real size */
        explicit_size = mono_metadata_packing_from_typedef (klass->image, klass->type_token, &packing_size, &real_size);
+       if (explicit_size)
+               instance_size += real_size;
 
-       if (explicit_size) {
-               if ((packing_size & 0xffffff00) != 0) {
-                       char *err_msg = g_strdup_printf ("Could not load struct '%s' with packing size %d >= 256", klass->name, packing_size);
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
-                       return;
-               }
-               klass->packing_size = packing_size;
-               real_size += instance_size;
-       }
-
-       if (!top) {
-               if (explicit_size && real_size) {
-                       instance_size = MAX (real_size, instance_size);
-               }
-               klass->blittable = blittable;
-               if (!klass->instance_size)
-                       klass->instance_size = instance_size;
-               mono_memory_barrier ();
-               klass->size_inited = 1;
-               klass->fields_inited = 1;
-               klass->setup_fields_called = 1;
+       /*
+        * This function can recursively call itself.
+        * Prevent infinite recursion by using a list in TLS.
+        */
+       GSList *init_list = (GSList *)mono_native_tls_get_value (setup_fields_tls_id);
+       if (g_slist_find (init_list, klass))
                return;
-       }
-
-       if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT && !(mono_is_corlib_image (klass->image) && !strcmp (klass->name_space, "System") && !strcmp (klass->name, "ValueType")))
-               blittable = FALSE;
-
-       /* Prevent infinite loops if the class references itself */
-       klass->setup_fields_called = 1;
-
-       if (klass->generic_container) {
-               container = klass->generic_container;
-       } else if (gtd) {
-               container = gtd->generic_container;
-               g_assert (container);
-       }
+       init_list = g_slist_prepend (init_list, klass);
+       mono_native_tls_set_value (setup_fields_tls_id, init_list);
 
        /*
         * Fetch all the field information.
         */
-       for (i = 0; i < top; i++){
-               int idx = klass->field.first + i;
+       int first_field_idx = mono_class_has_static_metadata (klass) ? mono_class_get_first_field_idx (klass) : 0;
+       for (i = 0; i < top; i++) {
+               int idx = first_field_idx + i;
                field = &klass->fields [i];
 
-               field->parent = klass;
-
                if (!field->type) {
                        mono_field_resolve_type (field, &error);
                        if (!mono_error_ok (&error)) {
                                /*mono_field_resolve_type already failed class*/
                                mono_error_cleanup (&error);
-                               return;
+                               break;
                        }
                        if (!field->type)
                                g_error ("could not resolve %s:%s\n", mono_type_get_full_name(klass), field->name);
@@ -1681,58 +1608,29 @@ mono_class_setup_fields (MonoClass *klass)
 
                if (mono_field_is_deleted (field))
                        continue;
-               if (gtd) {
-                       MonoClassField *gfield = &gtd->fields [i];
-                       field->offset = gfield->offset;
-               } else {
-                       if (layout == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) {
-                               guint32 offset;
-                               mono_metadata_field_info (m, idx, &offset, NULL, NULL);
-                               field->offset = offset;
+               if (layout == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) {
+                       guint32 uoffset;
+                       mono_metadata_field_info (m, idx, &uoffset, NULL, NULL);
+                       int offset = uoffset;
 
-                               if (field->offset == (guint32)-1 && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Missing field layout info for %s", field->name));
-                                       break;
-                               }
-                               if (field->offset < -1) { /*-1 is used to encode special static fields */
-                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Invalid negative field offset %d for %s", field->offset, field->name));
-                                       break;
-                               }
-                               if (klass->generic_container) {
-                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Generic class cannot have explicit layout."));
-                                       break;
-                               }
+                       if (offset == (guint32)-1 && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
+                               mono_class_set_type_load_failure (klass, "Missing field layout info for %s", field->name);
+                               break;
                        }
-               }
-
-               /* Only do these checks if we still think this type is blittable */
-               if (blittable && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                       if (field->type->byref || MONO_TYPE_IS_REFERENCE (field->type)) {
-                               blittable = FALSE;
-                       } else {
-                               MonoClass *field_class = mono_class_from_mono_type (field->type);
-                               if (field_class) {
-                                       mono_class_setup_fields (field_class);
-                                       if (mono_class_has_failure (field_class)) {
-                                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
-                                               break;
-                                       }
-                               }
-                               if (!field_class || !field_class->blittable)
-                                       blittable = FALSE;
+                       if (offset < -1) { /*-1 is used to encode special static fields */
+                               mono_class_set_type_load_failure (klass, "Field '%s' has a negative offset %d", field->name, offset);
+                               break;
+                       }
+                       if (mono_class_is_gtd (klass)) {
+                               mono_class_set_type_load_failure (klass, "Generic class cannot have explicit layout.");
+                               break;
                        }
                }
-
-               if (klass->enumtype && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                       klass->cast_class = klass->element_class = mono_class_from_mono_type (field->type);
-                       blittable = klass->element_class->blittable;
-               }
-
                if (mono_type_has_exceptions (field->type)) {
                        char *class_name = mono_type_get_full_name (klass);
                        char *type_name = mono_type_full_name (field->type);
 
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_type_load_failure (klass, "");
                        g_warning ("Invalid type %s for instance field %s:%s", type_name, class_name, field->name);
                        g_free (class_name);
                        g_free (type_name);
@@ -1741,66 +1639,58 @@ mono_class_setup_fields (MonoClass *klass)
                /* The def_value of fields is compute lazily during vtable creation */
        }
 
-       if (klass == mono_defaults.string_class)
-               blittable = FALSE;
+       if (!mono_class_has_failure (klass))
+               mono_class_layout_fields (klass, instance_size, packing_size, FALSE);
 
-       klass->blittable = blittable;
+       init_list = g_slist_remove (init_list, klass);
+       mono_native_tls_set_value (setup_fields_tls_id, init_list);
+}
 
-       if (klass->enumtype && !mono_class_enum_basetype (klass)) {
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
-               return;
+static void
+init_sizes_with_info (MonoClass *klass, MonoCachedClassInfo *cached_info)
+{
+       if (cached_info) {
+               klass->instance_size = cached_info->instance_size;
+               klass->sizes.class_size = cached_info->class_size;
+               klass->packing_size = cached_info->packing_size;
+               klass->min_align = cached_info->min_align;
+               klass->blittable = cached_info->blittable;
+               klass->has_references = cached_info->has_references;
+               klass->has_static_refs = cached_info->has_static_refs;
+               klass->no_special_static_fields = cached_info->no_special_static_fields;
        }
-       if (explicit_size && real_size) {
-               instance_size = MAX (real_size, instance_size);
+       else {
+               if (!klass->size_inited)
+                       mono_class_setup_fields (klass);
        }
-
-       if (mono_class_has_failure (klass))
-               return;
-       mono_class_layout_fields (klass, instance_size);
-
-       /*valuetypes can't be neither bigger than 1Mb or empty. */
-       if (klass->valuetype && (klass->instance_size <= 0 || klass->instance_size > (0x100000 + sizeof (MonoObject))))
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
-
-       mono_memory_barrier ();
-       klass->fields_inited = 1;
 }
+/*
 
-/** 
- * mono_class_setup_fields_locking:
- * @class: The class to initialize
+ * mono_class_init_sizes:
  *
- * Initializes the klass->fields array of fields.
- * Aquires the loader lock.
- */
-void
-mono_class_setup_fields_locking (MonoClass *klass)
-{
-       /* This can be checked without locks */
-       if (klass->fields_inited)
-               return;
-       mono_loader_lock ();
-       mono_class_setup_fields (klass);
-       mono_loader_unlock ();
-}
-
-/*
- * mono_class_has_references:
+ *   Initializes the size related fields of @klass without loading all field data if possible.
+ * Sets the following fields in @klass:
+ * - instance_size
+ * - sizes.class_size
+ * - packing_size
+ * - min_align
+ * - blittable
+ * - has_references
+ * - has_static_refs
+ * - size_inited
+ * Can fail the class.
  *
- *   Returns whenever @klass->has_references is set, initializing it if needed.
- * Aquires the loader lock.
+ * LOCKING: Acquires the loader lock.
  */
-static gboolean
-mono_class_has_references (MonoClass *klass)
+static void
+mono_class_init_sizes (MonoClass *klass)
 {
-       if (klass->init_pending) {
-               /* Be conservative */
-               return TRUE;
-       } else {
-               mono_class_init (klass);
+       MonoCachedClassInfo cached_info;
+       gboolean has_cached_info;
 
-               return klass->has_references;
-       }
+       has_cached_info = mono_class_get_cached_class_info (klass, &cached_info);
+
+       init_sizes_with_info (klass, has_cached_info ? &cached_info : NULL);
 }
 
 /*
@@ -1820,16 +1710,29 @@ mono_type_get_basic_type_from_generic (MonoType *type)
        return type;
 }
 
+static gboolean
+class_has_references (MonoClass *klass)
+{
+       mono_class_init_sizes (klass);
+
+       /*
+        * has_references is not set if this is called recursively, but this is not a problem since this is only used
+        * during field layout, and instance fields are initialized before static fields, and instance fields can't
+        * embed themselves.
+        */
+       return klass->has_references;
+}
+
 static gboolean
 type_has_references (MonoClass *klass, MonoType *ftype)
 {
-       if (MONO_TYPE_IS_REFERENCE (ftype) || IS_GC_REFERENCE (klass, ftype) || ((MONO_TYPE_ISSTRUCT (ftype) && mono_class_has_references (mono_class_from_mono_type (ftype)))))
+       if (MONO_TYPE_IS_REFERENCE (ftype) || IS_GC_REFERENCE (klass, ftype) || ((MONO_TYPE_ISSTRUCT (ftype) && class_has_references (mono_class_from_mono_type (ftype)))))
                return TRUE;
        if (!ftype->byref && (ftype->type == MONO_TYPE_VAR || ftype->type == MONO_TYPE_MVAR)) {
                MonoGenericParam *gparam = ftype->data.generic_param;
 
                if (gparam->gshared_constraint)
-                       return mono_class_has_references (mono_class_from_mono_type (gparam->gshared_constraint));
+                       return class_has_references (mono_class_from_mono_type (gparam->gshared_constraint));
        }
        return FALSE;
 }
@@ -1837,28 +1740,59 @@ type_has_references (MonoClass *klass, MonoType *ftype)
 /*
  * mono_class_layout_fields:
  * @class: a class
- * @instance_size: base instance size
+ * @base_instance_size: base instance size
+ * @packing_size:
  *
- * Compute the placement of fields inside an object or struct, according to
- * the layout rules and set the following fields in @class:
- *  - has_references (if the class contains instance references firled or structs that contain references)
- *  - has_static_refs (same, but for static fields)
- *  - instance_size (size of the object in memory)
- *  - class_size (size needed for the static fields)
- *  - size_inited (flag set when the instance_size is set)
+ * This contains the common code for computing the layout of classes and sizes.
+ * This should only be called from mono_class_setup_fields () and
+ * typebuilder_setup_fields ().
  *
- * LOCKING: this is supposed to be called with the loader lock held.
+ * LOCKING: Acquires the loader lock
  */
 void
-mono_class_layout_fields (MonoClass *klass, int instance_size)
+mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_size, gboolean sre)
 {
        int i;
-       const int top = klass->field.count;
-       guint32 layout = klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
+       const int top = mono_class_get_field_count (klass);
+       guint32 layout = mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK;
        guint32 pass, passes, real_size;
        gboolean gc_aware_layout = FALSE;
        gboolean has_static_fields = FALSE;
+       gboolean has_references = FALSE;
+       gboolean has_static_refs = FALSE;
        MonoClassField *field;
+       gboolean blittable;
+       int instance_size = base_instance_size;
+       int class_size, min_align;
+       int *field_offsets;
+
+       /*
+        * We want to avoid doing complicated work inside locks, so we compute all the required
+        * information and write it to @klass inside a lock.
+        */
+       if (klass->fields_inited)
+               return;
+
+       if ((packing_size & 0xffffff00) != 0) {
+               mono_class_set_type_load_failure (klass, "Could not load struct '%s' with packing size %d >= 256", klass->name, packing_size);
+               return;
+       }
+
+       if (klass->parent) {
+               min_align = klass->parent->min_align;
+               /* we use | since it may have been set already */
+               has_references = klass->has_references | klass->parent->has_references;
+       } else {
+               min_align = 1;
+       }
+       /* We can't really enable 16 bytes alignment until the GC supports it.
+       The whole layout/instance size code must be reviewed because we do alignment calculation in terms of the
+       boxed instance, which leads to unexplainable holes at the beginning of an object embedding a simd type.
+       Bug #506144 is an example of this issue.
+
+        if (klass->simd_type)
+               min_align = 16;
+        */
 
        /*
         * When we do generic sharing we need to have layout
@@ -1867,6 +1801,21 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
         * container), so we don't return in that case anymore.
         */
 
+       if (klass->enumtype) {
+               for (i = 0; i < top; i++) {
+                       field = &klass->fields [i];
+                       if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
+                               klass->cast_class = klass->element_class = mono_class_from_mono_type (field->type);
+                               break;
+                       }
+               }
+
+               if (!mono_class_enum_basetype (klass)) {
+                       mono_class_set_type_load_failure (klass, "The enumeration's base type is invalid.");
+                       return;
+               }
+       }
+
        /*
         * Enable GC aware auto layout: in this mode, reference
         * fields are grouped together inside objects, increasing collector 
@@ -1882,59 +1831,73 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
                        gc_aware_layout = TRUE;
        }
 
-       /* Compute klass->has_references */
-       /* 
-        * Process non-static fields first, since static fields might recursively
-        * refer to the class itself.
-        */
+       /* Compute klass->blittable */
+       blittable = TRUE;
+       if (klass->parent)
+               blittable = klass->parent->blittable;
+       if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT && !(mono_is_corlib_image (klass->image) && !strcmp (klass->name_space, "System") && !strcmp (klass->name, "ValueType")) && top)
+               blittable = FALSE;
        for (i = 0; i < top; i++) {
-               MonoType *ftype;
-
                field = &klass->fields [i];
 
-               if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                       ftype = mono_type_get_underlying_type (field->type);
-                       ftype = mono_type_get_basic_type_from_generic (ftype);
-                       if (type_has_references (klass, ftype))
-                               klass->has_references = TRUE;
+               if (mono_field_is_deleted (field))
+                       continue;
+               if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
+                       continue;
+               if (blittable) {
+                       if (field->type->byref || MONO_TYPE_IS_REFERENCE (field->type)) {
+                               blittable = FALSE;
+                       } else {
+                               MonoClass *field_class = mono_class_from_mono_type (field->type);
+                               if (field_class) {
+                                       mono_class_setup_fields (field_class);
+                                       if (mono_class_has_failure (field_class)) {
+                                               MonoError field_error;
+                                               mono_error_init (&field_error);
+                                               mono_error_set_for_class_failure (&field_error, field_class);
+                                               mono_class_set_type_load_failure (klass, "Could not set up field '%s' due to: %s", field->name, mono_error_get_message (&field_error));
+                                               mono_error_cleanup (&field_error);
+                                               break;
+                                       }
+                               }
+                               if (!field_class || !field_class->blittable)
+                                       blittable = FALSE;
+                       }
                }
+               if (klass->enumtype)
+                       blittable = klass->element_class->blittable;
        }
+       if (mono_class_has_failure (klass))
+               return;
+       if (klass == mono_defaults.string_class)
+               blittable = FALSE;
 
+       /* Compute klass->has_references */
+       /* 
+        * Process non-static fields first, since static fields might recursively
+        * refer to the class itself.
+        */
        for (i = 0; i < top; i++) {
                MonoType *ftype;
 
                field = &klass->fields [i];
 
-               if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) {
+               if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
                        ftype = mono_type_get_underlying_type (field->type);
                        ftype = mono_type_get_basic_type_from_generic (ftype);
                        if (type_has_references (klass, ftype))
-                               klass->has_static_refs = TRUE;
-               }
-       }
-
-       for (i = 0; i < top; i++) {
-               MonoType *ftype;
-
-               field = &klass->fields [i];
-
-               ftype = mono_type_get_underlying_type (field->type);
-               ftype = mono_type_get_basic_type_from_generic (ftype);
-               if (type_has_references (klass, ftype)) {
-                       if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
-                               klass->has_static_refs = TRUE;
-                       else
-                               klass->has_references = TRUE;
+                               has_references = TRUE;
                }
        }
 
        /*
         * Compute field layout and total size (not considering static fields)
         */
+       field_offsets = g_new0 (int, top);
+       int first_field_idx = mono_class_has_static_metadata (klass) ? mono_class_get_first_field_idx (klass) : 0;
        switch (layout) {
        case TYPE_ATTRIBUTE_AUTO_LAYOUT:
        case TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT:
-
                if (gc_aware_layout)
                        passes = 2;
                else
@@ -1945,10 +1908,8 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
 
                if (klass->parent) {
                        mono_class_setup_fields (klass->parent);
-                       if (mono_class_has_failure (klass->parent)) {
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       if (mono_class_set_type_load_failure_causedby_class (klass, klass->parent, "Cannot initialize parent class"))
                                return;
-                       }
                        real_size = klass->parent->instance_size;
                } else {
                        real_size = sizeof (MonoObject);
@@ -1979,7 +1940,7 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
                                        }
                                }
 
-                               if ((top == 1) && (klass->instance_size == sizeof (MonoObject)) &&
+                               if ((top == 1) && (instance_size == sizeof (MonoObject)) &&
                                        (strcmp (mono_field_get_name (field), "$PRIVATE$") == 0)) {
                                        /* This field is a hack inserted by MCS to empty structures */
                                        continue;
@@ -1988,29 +1949,29 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
                                size = mono_type_size (field->type, &align);
                        
                                /* FIXME (LAMESPEC): should we also change the min alignment according to pack? */
-                               align = klass->packing_size ? MIN (klass->packing_size, align): align;
+                               align = packing_size ? MIN (packing_size, align): align;
                                /* if the field has managed references, we need to force-align it
                                 * see bug #77788
                                 */
                                if (type_has_references (klass, ftype))
                                        align = MAX (align, sizeof (gpointer));
 
-                               klass->min_align = MAX (align, klass->min_align);
-                               field->offset = real_size;
+                               min_align = MAX (align, min_align);
+                               field_offsets [i] = real_size;
                                if (align) {
-                                       field->offset += align - 1;
-                                       field->offset &= ~(align - 1);
+                                       field_offsets [i] += align - 1;
+                                       field_offsets [i] &= ~(align - 1);
                                }
                                /*TypeBuilders produce all sort of weird things*/
-                               g_assert (image_is_dynamic (klass->image) || field->offset > 0);
-                               real_size = field->offset + size;
+                               g_assert (image_is_dynamic (klass->image) || field_offsets [i] > 0);
+                               real_size = field_offsets [i] + size;
                        }
 
                        instance_size = MAX (real_size, instance_size);
        
-                       if (instance_size & (klass->min_align - 1)) {
-                               instance_size += klass->min_align - 1;
-                               instance_size &= ~(klass->min_align - 1);
+                       if (instance_size & (min_align - 1)) {
+                               instance_size += min_align - 1;
+                               instance_size &= ~(min_align - 1);
                        }
                }
                break;
@@ -2035,28 +1996,30 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
                                continue;
 
                        size = mono_type_size (field->type, &align);
-                       align = klass->packing_size ? MIN (klass->packing_size, align): align;
-                       klass->min_align = MAX (align, klass->min_align);
+                       align = packing_size ? MIN (packing_size, align): align;
+                       min_align = MAX (align, min_align);
 
-                       /*
-                        * When we get here, field->offset is already set by the
-                        * loader (for either runtime fields or fields loaded from metadata).
-                        * The offset is from the start of the object: this works for both
-                        * classes and valuetypes.
-                        */
-                       field->offset += sizeof (MonoObject);
+                       if (sre) {
+                               /* Already set by typebuilder_setup_fields () */
+                               field_offsets [i] = field->offset + sizeof (MonoObject);
+                       } else {
+                               int idx = first_field_idx + i;
+                               guint32 offset;
+                               mono_metadata_field_info (klass->image, idx, &offset, NULL, NULL);
+                               field_offsets [i] = offset + sizeof (MonoObject);
+                       }
                        ftype = mono_type_get_underlying_type (field->type);
                        ftype = mono_type_get_basic_type_from_generic (ftype);
                        if (type_has_references (klass, ftype)) {
-                               if (field->offset % sizeof (gpointer)) {
-                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                               if (field_offsets [i] % sizeof (gpointer)) {
+                                       mono_class_set_type_load_failure (klass, "Reference typed field '%s' has explicit offset that is not pointer-size aligned.", field->name);
                                }
                        }
 
                        /*
                         * Calc max size.
                         */
-                       real_size = MAX (real_size, size + field->offset);
+                       real_size = MAX (real_size, size + field_offsets [i]);
                }
 
                if (klass->has_references) {
@@ -2074,7 +2037,7 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
                                        continue;
                                ftype = mono_type_get_underlying_type (field->type);
                                if (MONO_TYPE_IS_REFERENCE (ftype))
-                                       ref_bitmap [field->offset / sizeof (gpointer)] = 1;
+                                       ref_bitmap [field_offsets [i] / sizeof (gpointer)] = 1;
                        }
                        for (i = 0; i < top; i++) {
                                field = &klass->fields [i];
@@ -2086,9 +2049,8 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
 
                                // FIXME: Too much code does this
 #if 0
-                               if (!MONO_TYPE_IS_REFERENCE (field->type) && ref_bitmap [field->offset / sizeof (gpointer)]) {
-                                       char *err_msg = mono_image_strdup_printf (klass->image, "Could not load type '%s' because it contains an object field at offset %d that is incorrectly aligned or overlapped by a non-object field.", klass->name, field->offset);
-                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                               if (!MONO_TYPE_IS_REFERENCE (field->type) && ref_bitmap [field_offsets [i] / sizeof (gpointer)]) {
+                                       mono_class_set_type_load_failure (klass, "Could not load type '%s' because it contains an object field at offset %d that is incorrectly aligned or overlapped by a non-object field.", klass->name, field_offsets [i]);
                                }
 #endif
                        }
@@ -2096,9 +2058,9 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
                }
 
                instance_size = MAX (real_size, instance_size);
-               if (instance_size & (klass->min_align - 1)) {
-                       instance_size += klass->min_align - 1;
-                       instance_size &= ~(klass->min_align - 1);
+               if (instance_size & (min_align - 1)) {
+                       instance_size += min_align - 1;
+                       instance_size &= ~(min_align - 1);
                }
                break;
        }
@@ -2113,25 +2075,46 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
                 * performance, and since the JIT memset/memcpy code assumes this and generates 
                 * unaligned accesses otherwise. See #78990 for a testcase.
                 */
-               if (mono_align_small_structs) {
+               if (mono_align_small_structs && top) {
                        if (instance_size <= sizeof (MonoObject) + sizeof (gpointer))
-                               klass->min_align = MAX (klass->min_align, instance_size - sizeof (MonoObject));
+                               min_align = MAX (min_align, instance_size - sizeof (MonoObject));
                }
        }
 
+       if (klass->byval_arg.type == MONO_TYPE_VAR || klass->byval_arg.type == MONO_TYPE_MVAR)
+               instance_size = sizeof (MonoObject) + mono_type_stack_size_internal (&klass->byval_arg, NULL, TRUE);
+       else if (klass->byval_arg.type == MONO_TYPE_PTR)
+               instance_size = sizeof (MonoObject) + sizeof (gpointer);
+
+       /* Publish the data */
+       mono_loader_lock ();
        if (klass->instance_size && !klass->image->dynamic) {
                /* Might be already set using cached info */
                g_assert (klass->instance_size == instance_size);
        } else {
                klass->instance_size = instance_size;
        }
+       klass->blittable = blittable;
+       klass->has_references = has_references;
+       klass->packing_size = packing_size;
+       klass->min_align = min_align;
+       for (i = 0; i < top; ++i) {
+               field = &klass->fields [i];
+               if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC))
+                       klass->fields [i].offset = field_offsets [i];
+       }
+
        mono_memory_barrier ();
        klass->size_inited = 1;
+       mono_loader_unlock ();
 
        /*
         * Compute static field layout and size
+        * Static fields can reference the class itself, so this has to be
+        * done after instance_size etc. are initialized.
         */
-       for (i = 0; i < top; i++){
+       class_size = 0;
+       for (i = 0; i < top; i++) {
                gint32 align;
                guint32 size;
 
@@ -2143,23 +2126,60 @@ mono_class_layout_fields (MonoClass *klass, int instance_size)
                        continue;
 
                if (mono_type_has_exceptions (field->type)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_type_load_failure (klass, "Field '%s' has an invalid type.", field->name);
                        break;
                }
 
                has_static_fields = TRUE;
 
                size = mono_type_size (field->type, &align);
-               field->offset = klass->sizes.class_size;
+               field_offsets [i] = class_size;
                /*align is always non-zero here*/
-               field->offset += align - 1;
-               field->offset &= ~(align - 1);
-               klass->sizes.class_size = field->offset + size;
+               field_offsets [i] += align - 1;
+               field_offsets [i] &= ~(align - 1);
+               class_size = field_offsets [i] + size;
        }
 
-       if (has_static_fields && klass->sizes.class_size == 0)
+       if (has_static_fields && class_size == 0)
                /* Simplify code which depends on class_size != 0 if the class has static fields */
-               klass->sizes.class_size = 8;
+               class_size = 8;
+
+       /* Compute klass->has_static_refs */
+       has_static_refs = FALSE;
+       for (i = 0; i < top; i++) {
+               MonoType *ftype;
+
+               field = &klass->fields [i];
+
+               if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) {
+                       ftype = mono_type_get_underlying_type (field->type);
+                       ftype = mono_type_get_basic_type_from_generic (ftype);
+                       if (type_has_references (klass, ftype))
+                               has_static_refs = TRUE;
+               }
+       }
+
+       /*valuetypes can't be neither bigger than 1Mb or empty. */
+       if (klass->valuetype && (klass->instance_size <= 0 || klass->instance_size > (0x100000 + sizeof (MonoObject))))
+               mono_class_set_type_load_failure (klass, "Value type instance size (%d) cannot be zero, negative, or bigger than 1Mb", klass->instance_size);
+
+       /* Publish the data */
+       mono_loader_lock ();
+       if (!klass->rank)
+               klass->sizes.class_size = class_size;
+       klass->has_static_refs = has_static_refs;
+       for (i = 0; i < top; ++i) {
+               field = &klass->fields [i];
+
+               if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
+                       field->offset = field_offsets [i];
+       }
+
+       mono_memory_barrier ();
+       klass->fields_inited = 1;
+       mono_loader_unlock ();
+
+       g_free (field_offsets);
 }
 
 static MonoMethod*
@@ -2193,7 +2213,7 @@ create_array_method (MonoClass *klass, const char *name, MonoMethodSignature *si
  * Methods belonging to an interface are assigned a sequential slot starting
  * from 0.
  *
- * On failure this function sets klass->exception_type
+ * On failure this function sets klass->has_failure and stores a MonoErrorBoxed with details
  */
 void
 mono_class_setup_methods (MonoClass *klass)
@@ -2204,21 +2224,18 @@ mono_class_setup_methods (MonoClass *klass)
        if (klass->methods)
                return;
 
-       if (klass->generic_class) {
+       if (mono_class_is_ginst (klass)) {
                MonoError error;
-               MonoClass *gklass = klass->generic_class->container_class;
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
                mono_class_init (gklass);
                if (!mono_class_has_failure (gklass))
                        mono_class_setup_methods (gklass);
-               if (mono_class_has_failure (gklass)) {
-                       /* FIXME make exception_data less opaque so it's possible to dup it here */
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Generic type definition failed to load"));
+               if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Generic type definition failed to load"))
                        return;
-               }
 
                /* The + 1 makes this always non-NULL to pass the check in mono_class_setup_methods () */
-               count = gklass->method.count;
+               count = mono_class_get_method_count (gklass);
                methods = (MonoMethod **)mono_class_alloc0 (klass, sizeof (MonoMethod*) * (count + 1));
 
                for (i = 0; i < count; i++) {
@@ -2226,7 +2243,7 @@ mono_class_setup_methods (MonoClass *klass)
                                gklass->methods [i], klass, mono_class_get_context (klass), &error);
                        if (!mono_error_ok (&error)) {
                                char *method = mono_method_full_name (gklass->methods [i], TRUE);
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Could not inflate method %s due to %s", method, mono_error_get_message (&error)));
+                               mono_class_set_type_load_failure (klass, "Could not inflate method %s due to %s", method, mono_error_get_message (&error));
 
                                g_free (method);
                                mono_error_cleanup (&error);
@@ -2248,7 +2265,7 @@ mono_class_setup_methods (MonoClass *klass)
 
                if (klass->rank == 1 && klass->element_class->rank) {
                        jagged_ctor = TRUE;
-                       klass->method.count ++;
+                       count ++;
                }
 
                if (klass->interface_count) {
@@ -2323,19 +2340,23 @@ mono_class_setup_methods (MonoClass *klass)
 
                for (i = 0; i < klass->interface_count; i++)
                        setup_generic_array_ifaces (klass, klass->interfaces [i], methods, first_generic + i * count_generic);
-       } else {
+       } else if (mono_class_has_static_metadata (klass)) {
                MonoError error;
+               int first_idx = mono_class_get_first_method_idx (klass);
 
-               count = klass->method.count;
+               count = mono_class_get_method_count (klass);
                methods = (MonoMethod **)mono_class_alloc (klass, sizeof (MonoMethod*) * count);
                for (i = 0; i < count; ++i) {
-                       int idx = mono_metadata_translate_token_index (klass->image, MONO_TABLE_METHOD, klass->method.first + i + 1);
+                       int idx = mono_metadata_translate_token_index (klass->image, MONO_TABLE_METHOD, first_idx + i + 1);
                        methods [i] = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | idx, klass, NULL, &error);
                        if (!methods [i]) {
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Could not load method %d due to %s", i, mono_error_get_message (&error)));
+                               mono_class_set_type_load_failure (klass, "Could not load method %d due to %s", i, mono_error_get_message (&error));
                                mono_error_cleanup (&error);
                        }
                }
+       } else {
+               methods = (MonoMethod **)mono_class_alloc (klass, sizeof (MonoMethod*) * 1);
+               count = 0;
        }
 
        if (MONO_CLASS_IS_INTERFACE (klass)) {
@@ -2350,7 +2371,7 @@ mono_class_setup_methods (MonoClass *klass)
        mono_image_lock (klass->image);
 
        if (!klass->methods) {
-               klass->method.count = count;
+               mono_class_set_method_count (klass, count);
 
                /* Needed because of the double-checking locking pattern */
                mono_memory_barrier ();
@@ -2372,13 +2393,14 @@ MonoMethod*
 mono_class_get_method_by_index (MonoClass *klass, int index)
 {
        MonoError error;
+
+       MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
        /* Avoid calling setup_methods () if possible */
-       if (klass->generic_class && !klass->methods) {
-               MonoClass *gklass = klass->generic_class->container_class;
+       if (gklass && !klass->methods) {
                MonoMethod *m;
 
                m = mono_class_inflate_generic_method_full_checked (
-                               gklass->methods [index], klass, mono_class_get_context (klass), &error);
+                               gklass->container_class->methods [index], klass, mono_class_get_context (klass), &error);
                g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
                /*
                 * If setup_methods () is called later for this class, no duplicates are created,
@@ -2394,7 +2416,7 @@ mono_class_get_method_by_index (MonoClass *klass, int index)
                mono_class_setup_methods (klass);
                if (mono_class_has_failure (klass)) /*FIXME do proper error handling*/
                        return NULL;
-               g_assert (index >= 0 && index < klass->method.count);
+               g_assert (index >= 0 && index < mono_class_get_method_count (klass));
                return klass->methods [index];
        }
 }      
@@ -2408,15 +2430,16 @@ mono_class_get_method_by_index (MonoClass *klass, int index)
 MonoMethod*
 mono_class_get_inflated_method (MonoClass *klass, MonoMethod *method)
 {
-       MonoClass *gklass = klass->generic_class->container_class;
-       int i;
+       MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
+       int i, mcount;
 
        g_assert (method->klass == gklass);
 
        mono_class_setup_methods (gklass);
        g_assert (!mono_class_has_failure (gklass)); /*FIXME do proper error handling*/
 
-       for (i = 0; i < gklass->method.count; ++i) {
+       mcount = mono_class_get_method_count (gklass);
+       for (i = 0; i < mcount; ++i) {
                if (gklass->methods [i] == method) {
                        if (klass->methods) {
                                return klass->methods [i];
@@ -2453,9 +2476,9 @@ mono_class_get_vtable_entry (MonoClass *klass, int offset)
                        return klass->parent->vtable [offset];
        }
 
-       if (klass->generic_class) {
+       if (mono_class_is_ginst (klass)) {
                MonoError error;
-               MonoClass *gklass = klass->generic_class->container_class;
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
                mono_class_setup_vtable (gklass);
                m = gklass->vtable [offset];
 
@@ -2501,26 +2524,26 @@ mono_class_setup_properties (MonoClass *klass)
        guint32 last;
        int first, count;
 
-       if (klass->ext && klass->ext->properties)
+       MonoClassExt *ext = mono_class_get_ext (klass);
+       if (ext && ext->properties)
                return;
 
-       if (klass->generic_class) {
-               MonoClass *gklass = klass->generic_class->container_class;
+       if (mono_class_is_ginst (klass)) {
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
                mono_class_init (gklass);
                mono_class_setup_properties (gklass);
-               if (mono_class_has_failure (gklass)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Generic type definition failed to load"));
+               if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Generic type definition failed to load"))
                        return;
-               }
 
-               properties = mono_class_new0 (klass, MonoProperty, gklass->ext->property.count + 1);
+               MonoClassExt *gext = mono_class_get_ext (gklass);
+               properties = mono_class_new0 (klass, MonoProperty, gext->property.count + 1);
 
-               for (i = 0; i < gklass->ext->property.count; i++) {
+               for (i = 0; i < gext->property.count; i++) {
                        MonoError error;
                        MonoProperty *prop = &properties [i];
 
-                       *prop = gklass->ext->properties [i];
+                       *prop = gext->properties [i];
 
                        if (prop->get)
                                prop->get = mono_class_inflate_generic_method_full_checked (
@@ -2533,8 +2556,8 @@ mono_class_setup_properties (MonoClass *klass)
                        prop->parent = klass;
                }
 
-               first = gklass->ext->property.first;
-               count = gklass->ext->property.count;
+               first = gext->property.first;
+               count = gext->property.count;
        } else {
                first = mono_metadata_properties_from_typedef (klass->image, mono_metadata_token_index (klass->type_token) - 1, &last);
                count = last - first;
@@ -2553,6 +2576,7 @@ mono_class_setup_properties (MonoClass *klass)
                        properties [i - first].name = mono_metadata_string_heap (klass->image, cols [MONO_PROPERTY_NAME]);
 
                        startm = mono_metadata_methods_from_property (klass->image, i, &endm);
+                       int first_idx = mono_class_get_first_method_idx (klass);
                        for (j = startm; j < endm; ++j) {
                                MonoMethod *method;
 
@@ -2564,7 +2588,7 @@ mono_class_setup_properties (MonoClass *klass)
                                        method = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | cols [MONO_METHOD_SEMA_METHOD], klass, NULL, &error);
                                        mono_error_cleanup (&error); /* FIXME don't swallow this error */
                                } else {
-                                       method = klass->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - klass->method.first];
+                                       method = klass->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - first_idx];
                                }
 
                                switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
@@ -2582,23 +2606,24 @@ mono_class_setup_properties (MonoClass *klass)
        }
 
        mono_class_alloc_ext (klass);
+       ext = mono_class_get_ext (klass);
 
        mono_image_lock (klass->image);
 
-       if (klass->ext->properties) {
+       if (ext->properties) {
                /* We leak 'properties' which was allocated from the image mempool */
                mono_image_unlock (klass->image);
                return;
        }
 
-       klass->ext->property.first = first;
-       klass->ext->property.count = count;
+       ext->property.first = first;
+       ext->property.count = count;
 
        /* Flush any pending writes as we do double checked locking on klass->ext->properties */
        mono_memory_barrier ();
 
        /* Leave this assignment as the last op in the function */
-       klass->ext->properties = properties;
+       ext->properties = properties;
 
        mono_image_unlock (klass->image);
 }
@@ -2634,21 +2659,21 @@ mono_class_setup_events (MonoClass *klass)
        guint32 last;
        MonoEvent *events;
 
-       if (klass->ext && klass->ext->events)
+       MonoClassExt *ext = mono_class_get_ext (klass);
+       if (ext && ext->events)
                return;
 
-       if (klass->generic_class) {
-               MonoClass *gklass = klass->generic_class->container_class;
+       if (mono_class_is_ginst (klass)) {
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
                MonoGenericContext *context = NULL;
 
                mono_class_setup_events (gklass);
-               if (mono_class_has_failure (gklass)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Generic type definition failed to load"));
+               if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Generic type definition failed to load"))
                        return;
-               }
 
-               first = gklass->ext->event.first;
-               count = gklass->ext->event.count;
+               MonoClassExt *gext = mono_class_get_ext (gklass);
+               first = gext->event.first;
+               count = gext->event.count;
 
                events = mono_class_new0 (klass, MonoEvent, count);
 
@@ -2658,7 +2683,7 @@ mono_class_setup_events (MonoClass *klass)
                for (i = 0; i < count; i++) {
                        MonoError error;
                        MonoEvent *event = &events [i];
-                       MonoEvent *gevent = &gklass->ext->events [i];
+                       MonoEvent *gevent = &gext->events [i];
 
                        mono_error_init (&error); //since we do conditional calls, we must ensure the default value is ok
 
@@ -2683,7 +2708,6 @@ mono_class_setup_events (MonoClass *klass)
                if (count) {
                        mono_class_setup_methods (klass);
                        if (mono_class_has_failure (klass)) {
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Generic type definition failed to load"));
                                return;
                        }
                }
@@ -2698,6 +2722,7 @@ mono_class_setup_events (MonoClass *klass)
                        event->name = mono_metadata_string_heap (klass->image, cols [MONO_EVENT_NAME]);
 
                        startm = mono_metadata_methods_from_event (klass->image, i, &endm);
+                       int first_idx = mono_class_get_first_method_idx (klass);
                        for (j = startm; j < endm; ++j) {
                                MonoMethod *method;
 
@@ -2709,7 +2734,7 @@ mono_class_setup_events (MonoClass *klass)
                                        method = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | cols [MONO_METHOD_SEMA_METHOD], klass, NULL, &error);
                                        mono_error_cleanup (&error); /* FIXME don't swallow this error */
                                } else {
-                                       method = klass->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - klass->method.first];
+                                       method = klass->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - first_idx];
                                }
 
                                switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
@@ -2747,22 +2772,23 @@ mono_class_setup_events (MonoClass *klass)
        }
 
        mono_class_alloc_ext (klass);
+       ext = mono_class_get_ext (klass);
 
        mono_image_lock (klass->image);
 
-       if (klass->ext->events) {
+       if (ext->events) {
                mono_image_unlock (klass->image);
                return;
        }
 
-       klass->ext->event.first = first;
-       klass->ext->event.count = count;
+       ext->event.first = first;
+       ext->event.count = count;
 
        /* Flush any pending writes as we do double checked locking on klass->ext.events */
        mono_memory_barrier ();
 
        /* Leave this assignment as the last op in the function */
-       klass->ext->events = events;
+       ext->events = events;
 
        mono_image_unlock (klass->image);
 }
@@ -2808,7 +2834,7 @@ mono_unload_interface_id (MonoClass *klass)
  * LOCKING: Acquires the classes lock.
  * Returns: The new ID.
  */
-static guint
+static guint32
 mono_get_unique_iid (MonoClass *klass)
 {
        int iid;
@@ -2831,7 +2857,7 @@ mono_get_unique_iid (MonoClass *klass)
        }
        mono_bitset_set (global_interface_bitset, iid);
        /* set the bit also in the per-image set */
-       if (!klass->generic_class) {
+       if (!mono_class_is_ginst (klass)) {
                if (klass->image->interface_bitset) {
                        if (iid >= mono_bitset_size (klass->image->interface_bitset)) {
                                MonoBitSet *new_set = mono_bitset_clone (klass->image->interface_bitset, iid + 1);
@@ -2850,8 +2876,9 @@ mono_get_unique_iid (MonoClass *klass)
        if (mono_print_vtable) {
                int generic_id;
                char *type_name = mono_type_full_name (&klass->byval_arg);
-               if (klass->generic_class && !klass->generic_class->context.class_inst->is_open) {
-                       generic_id = klass->generic_class->context.class_inst->id;
+               MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
+               if (gklass && !gklass->context.class_inst->is_open) {
+                       generic_id = gklass->context.class_inst->id;
                        g_assert (generic_id != 0);
                } else {
                        generic_id = 0;
@@ -2861,7 +2888,9 @@ mono_get_unique_iid (MonoClass *klass)
        }
 #endif
 
-       g_assert (iid <= 65535);
+       /* I've confirmed iids safe past 16 bits, however bitset code uses a signed int while testing.
+        * Once this changes, it should be safe for us to allow 2^32-1 interfaces, until then 2^31-2 is the max. */
+       g_assert (iid < INT_MAX);
        return iid;
 }
 
@@ -2975,7 +3004,7 @@ print_implemented_interfaces (MonoClass *klass) {
                printf ("  [%03d][UUID %03d][SLOT %03d][SIZE  %03d] interface %s.%s\n", i,
                                klass->interfaces_packed [i]->interface_id,
                                klass->interface_offsets_packed [i],
-                               klass->interfaces_packed [i]->method.count,
+                               mono_class_get_method_count (klass->interfaces_packed [i]),
                                klass->interfaces_packed [i]->name_space,
                                klass->interfaces_packed [i]->name );
        printf ("Interface flags: ");
@@ -3014,7 +3043,7 @@ print_implemented_interfaces (MonoClass *klass) {
                                printf ("  [%03d][UUID %03d][SLOT %03d][SIZE  %03d] interface %s.%s\n", i,
                                                ic->interface_id,
                                                mono_class_interface_offset (klass, ic),
-                                               ic->method.count,
+                                               mono_class_get_method_count (ic),
                                                ic->name_space,
                                                ic->name );
                        }
@@ -3064,6 +3093,12 @@ fill_valuetype_array_derived_types (MonoClass **valuetype_types, MonoClass *ecla
                valuetype_types [1] = mono_class_from_mono_type (mono_class_enum_basetype (eclass));
 }
 
+static GENERATE_GET_CLASS_WITH_CACHE (generic_icollection, System.Collections.Generic, ICollection`1)
+static GENERATE_GET_CLASS_WITH_CACHE (generic_ienumerable, System.Collections.Generic, IEnumerable`1)
+static GENERATE_GET_CLASS_WITH_CACHE (generic_ienumerator, System.Collections.Generic, IEnumerator`1)
+static GENERATE_GET_CLASS_WITH_CACHE (generic_ireadonlylist, System.Collections.Generic, IReadOnlyList`1)
+static GENERATE_GET_CLASS_WITH_CACHE (generic_ireadonlycollection, System.Collections.Generic, IReadOnlyCollection`1)
+
 /* this won't be needed once bug #325495 is completely fixed
  * though we'll need something similar to know which interfaces to allow
  * in arrays when they'll be lazyly created
@@ -3081,11 +3116,11 @@ static MonoClass**
 get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enumerator)
 {
        MonoClass *eclass = klass->element_class;
-       static MonoClass* generic_icollection_class = NULL;
-       static MonoClass* generic_ienumerable_class = NULL;
-       static MonoClass* generic_ienumerator_class = NULL;
-       static MonoClass* generic_ireadonlylist_class = NULL;
-       static MonoClass* generic_ireadonlycollection_class = NULL;
+       MonoClass* generic_icollection_class;
+       MonoClass* generic_ienumerable_class;
+       MonoClass* generic_ienumerator_class;
+       MonoClass* generic_ireadonlylist_class;
+       MonoClass* generic_ireadonlycollection_class;
        MonoClass *valuetype_types[2] = { NULL, NULL };
        MonoClass **interfaces = NULL;
        int i, nifaces, interface_count, real_count, original_rank;
@@ -3101,11 +3136,12 @@ get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enume
        eclass_is_valuetype = FALSE;
        original_rank = eclass->rank;
        if (klass->byval_arg.type != MONO_TYPE_SZARRAY) {
-               if (klass->generic_class && klass->nested_in == mono_defaults.array_class && strcmp (klass->name, "InternalEnumerator`1") == 0)  {
+               MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
+               if (gklass && klass->nested_in == mono_defaults.array_class && strcmp (klass->name, "InternalEnumerator`1") == 0)        {
                        /*
                         * For a Enumerator<T[]> we need to get the list of interfaces for T.
                         */
-                       eclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+                       eclass = mono_class_from_mono_type (gklass->context.class_inst->type_argv [0]);
                        original_rank = eclass->rank;
                        if (!eclass->rank)
                                eclass = eclass->element_class;
@@ -3123,18 +3159,11 @@ get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enume
         */
        all_interfaces = eclass->rank && eclass->element_class->rank? FALSE: TRUE;
 
-       if (!generic_icollection_class) {
-               generic_icollection_class = mono_class_load_from_name (mono_defaults.corlib,
-                       "System.Collections.Generic", "ICollection`1");
-               generic_ienumerable_class = mono_class_load_from_name (mono_defaults.corlib,
-                       "System.Collections.Generic", "IEnumerable`1");
-               generic_ienumerator_class = mono_class_load_from_name (mono_defaults.corlib,
-                       "System.Collections.Generic", "IEnumerator`1");
-               generic_ireadonlylist_class = mono_class_load_from_name (mono_defaults.corlib,
-                       "System.Collections.Generic", "IReadOnlyList`1");
-               generic_ireadonlycollection_class = mono_class_load_from_name (mono_defaults.corlib,
-                       "System.Collections.Generic", "IReadOnlyCollection`1");
-       }
+       generic_icollection_class = mono_class_get_generic_icollection_class ();
+       generic_ienumerable_class = mono_class_get_generic_ienumerable_class ();
+       generic_ienumerator_class = mono_class_get_generic_ienumerator_class ();
+       generic_ireadonlylist_class = mono_class_get_generic_ireadonlylist_class ();
+       generic_ireadonlycollection_class = mono_class_get_generic_ireadonlycollection_class ();
 
        mono_class_init (eclass);
 
@@ -3310,7 +3339,7 @@ find_array_interface (MonoClass *klass, const char *name)
 static int
 count_virtual_methods (MonoClass *klass)
 {
-       int i, count = 0;
+       int i, mcount, vcount = 0;
        guint32 flags;
        klass = mono_class_get_generic_type_definition (klass); /*We can find this information by looking at the GTD*/
 
@@ -3319,20 +3348,23 @@ count_virtual_methods (MonoClass *klass)
                if (mono_class_has_failure (klass))
                        return -1;
 
-               for (i = 0; i < klass->method.count; ++i) {
+               mcount = mono_class_get_method_count (klass);
+               for (i = 0; i < mcount; ++i) {
                        flags = klass->methods [i]->flags;
                        if (flags & METHOD_ATTRIBUTE_VIRTUAL)
-                               ++count;
+                               ++vcount;
                }
        } else {
-               for (i = 0; i < klass->method.count; ++i) {
-                       flags = mono_metadata_decode_table_row_col (klass->image, MONO_TABLE_METHOD, klass->method.first + i, MONO_METHOD_FLAGS);
+               int first_idx = mono_class_get_first_method_idx (klass);
+               mcount = mono_class_get_method_count (klass);
+               for (i = 0; i < mcount; ++i) {
+                       flags = mono_metadata_decode_table_row_col (klass->image, MONO_TABLE_METHOD, first_idx + i, MONO_METHOD_FLAGS);
 
                        if (flags & METHOD_ATTRIBUTE_VIRTUAL)
-                               ++count;
+                               ++vcount;
                }
        }
-       return count;
+       return vcount;
 }
 
 static int
@@ -3500,15 +3532,16 @@ mono_class_interface_match (const uint8_t *bitmap, int id)
 #endif
 
 /*
- * LOCKING: this is supposed to be called with the loader lock held.
- * Return -1 on failure and set exception_type
+ * Return -1 on failure and set klass->has_failure and store a MonoErrorBoxed with the details.
+ * LOCKING: Acquires the loader lock.
  */
 static int
 setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
 {
        MonoError error;
        MonoClass *k, *ic;
-       int i, j, max_iid, num_ifaces;
+       int i, j, num_ifaces;
+       guint32 max_iid;
        MonoClass **interfaces_full = NULL;
        int *interface_offsets_full = NULL;
        GPtrArray *ifaces;
@@ -3518,6 +3551,8 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
        int num_array_interfaces;
        int is_enumerator = FALSE;
 
+       mono_loader_lock ();
+
        mono_class_setup_supertypes (klass);
        /* 
         * get the implicit generic interfaces for either the arrays or for System.Array/InternalEnumerator<T>
@@ -3532,12 +3567,12 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
        ifaces_array = g_new0 (GPtrArray *, klass->idepth);
        for (j = 0; j < klass->idepth; j++) {
                k = klass->supertypes [j];
+               g_assert (k);
                num_ifaces += k->interface_count;
                for (i = 0; i < k->interface_count; i++) {
                        ic = k->interfaces [i];
 
-                       if (!ic->inited)
-                               mono_class_init (ic);
+                       mono_class_init (ic);
 
                        if (max_iid < ic->interface_id)
                                max_iid = ic->interface_id;
@@ -3545,7 +3580,7 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
                ifaces = mono_class_get_implemented_interfaces (k, &error);
                if (!mono_error_ok (&error)) {
                        char *name = mono_type_get_full_name (k);
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Error getting the interfaces of %s due to %s", name, mono_error_get_message (&error)));
+                       mono_class_set_type_load_failure (klass, "Error getting the interfaces of %s due to %s", name, mono_error_get_message (&error));
                        g_free (name);
                        mono_error_cleanup (&error);
                        cur_slot = -1;
@@ -3574,14 +3609,13 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
                if (max_iid < klass->interface_id)
                        max_iid = klass->interface_id;
        }
-       klass->max_interface_id = max_iid;
+
        /* compute vtable offset for interfaces */
        interfaces_full = (MonoClass **)g_malloc0 (sizeof (MonoClass*) * num_ifaces);
        interface_offsets_full = (int *)g_malloc (sizeof (int) * num_ifaces);
 
-       for (i = 0; i < num_ifaces; i++) {
+       for (i = 0; i < num_ifaces; i++)
                interface_offsets_full [i] = -1;
-       }
 
        /* skip the current class */
        for (j = 0; j < klass->idepth - 1; j++) {
@@ -3612,7 +3646,7 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
                        count = count_virtual_methods (ic);
                        if (count == -1) {
                                char *name = mono_type_get_full_name (ic);
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Error calculating interface offset of %s", name));
+                               mono_class_set_type_load_failure (klass, "Error calculating interface offset of %s", name);
                                g_free (name);
                                cur_slot = -1;
                                goto end;
@@ -3655,7 +3689,7 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
                        for (i = 0; i < num_array_interfaces; ++i) {
                                int offset;
                                ic = array_interfaces [i];
-                               if (ic->generic_class->container_class == mono_defaults.generic_ilist_class)
+                               if (mono_class_get_generic_class (ic)->container_class == mono_defaults.generic_ilist_class)
                                        offset = ilist_offset;
                                else if (strcmp (ic->name, "ICollection`1") == 0)
                                        offset = icollection_offset;
@@ -3674,11 +3708,12 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
        }
 
        for (interface_offsets_count = 0, i = 0; i < num_ifaces; i++) {
-               if (interface_offsets_full [i] != -1) {
+               if (interface_offsets_full [i] != -1)
                        interface_offsets_count ++;
-               }
        }
 
+       /* Publish the data */
+       klass->max_interface_id = max_iid;
        /*
         * We might get called multiple times:
         * - mono_class_init ()
@@ -3703,7 +3738,7 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
                bitmap = (uint8_t *)mono_class_alloc0 (klass, bsize);
 #endif
                for (i = 0; i < interface_offsets_count; i++) {
-                       int id = interfaces_full [i]->interface_id;
+                       guint32 id = interfaces_full [i]->interface_id;
                        bitmap [id >> 3] |= (1 << (id & 7));
                        klass->interfaces_packed [i] = interfaces_full [i];
                        klass->interface_offsets_packed [i] = interface_offsets_full [i];
@@ -3719,8 +3754,9 @@ setup_interface_offsets (MonoClass *klass, int cur_slot, gboolean overwrite)
                klass->interface_bitmap = bitmap;
 #endif
        }
-
 end:
+       mono_loader_unlock ();
+
        g_free (interfaces_full);
        g_free (interface_offsets_full);
        g_free (array_interfaces);
@@ -3733,7 +3769,7 @@ end:
        
        //printf ("JUST DONE: ");
        //print_implemented_interfaces (klass);
+
        return cur_slot;
 }
 
@@ -3751,11 +3787,7 @@ end:
 void
 mono_class_setup_interface_offsets (MonoClass *klass)
 {
-       mono_loader_lock ();
-
        setup_interface_offsets (klass, 0, FALSE);
-
-       mono_loader_unlock ();
 }
 
 /*Checks if @klass has @parent as one of it's parents type gtd
@@ -3782,18 +3814,17 @@ mono_class_check_vtable_constraints (MonoClass *klass, GList *in_setup)
 {
        MonoGenericInst *ginst;
        int i;
-       if (!klass->generic_class) {
+
+       if (!mono_class_is_ginst (klass)) {
                mono_class_setup_vtable_full (klass, in_setup);
                return !mono_class_has_failure (klass);
        }
 
        mono_class_setup_vtable_full (mono_class_get_generic_type_definition (klass), in_setup);
-       if (mono_class_has_failure (klass->generic_class->container_class)) {
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Failed to load generic definition vtable"));
+       if (mono_class_set_type_load_failure_causedby_class (klass, mono_class_get_generic_class (klass)->container_class, "Failed to load generic definition vtable"))
                return FALSE;
-       }
 
-       ginst = klass->generic_class->context.class_inst;
+       ginst = mono_class_get_generic_class (klass)->context.class_inst;
        for (i = 0; i < ginst->type_argc; ++i) {
                MonoClass *arg;
                if (ginst->type_argv [i]->type != MONO_TYPE_GENERICINST)
@@ -3803,7 +3834,7 @@ mono_class_check_vtable_constraints (MonoClass *klass, GList *in_setup)
                if (mono_class_has_gtd_parent (klass, arg) || mono_class_has_gtd_parent (arg, klass))
                        continue;
                if (!mono_class_check_vtable_constraints (arg, in_setup)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Failed to load generic parameter %d", i));
+                       mono_class_set_type_load_failure (klass, "Failed to load generic parameter %d", i);
                        return FALSE;
                }
        }
@@ -3818,7 +3849,8 @@ mono_class_check_vtable_constraints (MonoClass *klass, GList *in_setup)
  * - vtable
  * - vtable_size
  * Plus all the fields initialized by setup_interface_offsets ().
- * If there is an error during vtable construction, klass->exception_type is set.
+ * If there is an error during vtable construction, klass->has_failure
+ * is set and details are stored in a MonoErrorBoxed.
  *
  * LOCKING: Acquires the loader lock.
  */
@@ -3863,7 +3895,7 @@ mono_class_setup_vtable_full (MonoClass *klass, GList *in_setup)
        mono_stats.generic_vtable_count ++;
        in_setup = g_list_prepend (in_setup, klass);
 
-       if (klass->generic_class) {
+       if (mono_class_is_ginst (klass)) {
                if (!mono_class_check_vtable_constraints (klass, in_setup)) {
                        mono_loader_unlock ();
                        g_list_remove (in_setup, klass);
@@ -3871,9 +3903,9 @@ mono_class_setup_vtable_full (MonoClass *klass, GList *in_setup)
                }
 
                context = mono_class_get_context (klass);
-               type_token = klass->generic_class->container_class->type_token;
+               type_token = mono_class_get_generic_class (klass)->container_class->type_token;
        } else {
-               context = (MonoGenericContext *) klass->generic_container;
+               context = (MonoGenericContext *) mono_class_try_get_generic_container (klass); //FIXME is this a case of a try?
                type_token = klass->type_token;
        }
 
@@ -3886,7 +3918,7 @@ mono_class_setup_vtable_full (MonoClass *klass, GList *in_setup)
                if (!is_ok (&error)) {
                        mono_loader_unlock ();
                        g_list_remove (in_setup, klass);
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf(klass->image, "Could not load list of method overrides due to %s", mono_error_get_message (&error)));
+                       mono_class_set_type_load_failure (klass, "Could not load list of method overrides due to %s", mono_error_get_message (&error));
                        mono_error_cleanup (&error);
                        return;
                }
@@ -3899,7 +3931,7 @@ mono_class_setup_vtable_full (MonoClass *klass, GList *in_setup)
        if (ok)
                mono_class_setup_vtable_general (klass, overrides, onum, in_setup);
        else
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Could not load list of method overrides"));
+               mono_class_set_type_load_failure (klass, "Could not load list of method overrides");
                
        g_free (overrides);
 
@@ -4015,7 +4047,7 @@ check_interface_method_override (MonoClass *klass, MonoMethod *im, MonoMethod *c
                cmsig = mono_method_signature (cm);
                imsig = mono_method_signature (im);
                if (!cmsig || !imsig) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Could not resolve the signature of a virtual method"));
+                       mono_class_set_type_load_failure (klass, "Could not resolve the signature of a virtual method");
                        return FALSE;
                }
 
@@ -4033,7 +4065,7 @@ check_interface_method_override (MonoClass *klass, MonoMethod *im, MonoMethod *c
                if (is_wcf_hack_disabled () && !mono_method_can_access_method_full (cm, im, NULL)) {
                        char *body_name = mono_method_full_name (cm, TRUE);
                        char *decl_name = mono_method_full_name (im, TRUE);
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Method %s overrides method '%s' which is not accessible", body_name, decl_name));
+                       mono_class_set_type_load_failure (klass, "Method %s overrides method '%s' which is not accessible", body_name, decl_name);
                        g_free (body_name);
                        g_free (decl_name);
                        return FALSE;
@@ -4057,7 +4089,7 @@ check_interface_method_override (MonoClass *klass, MonoMethod *im, MonoMethod *c
                cmsig = mono_method_signature (cm);
                imsig = mono_method_signature (im);
                if (!cmsig || !imsig) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Could not resolve the signature of a virtual method"));
+                       mono_class_set_type_load_failure (klass, "Could not resolve the signature of a virtual method");
                        return FALSE;
                }
 
@@ -4114,7 +4146,7 @@ check_interface_method_override (MonoClass *klass, MonoMethod *im, MonoMethod *c
                if (is_wcf_hack_disabled () && !mono_method_can_access_method_full (cm, im, NULL)) {
                        char *body_name = mono_method_full_name (cm, TRUE);
                        char *decl_name = mono_method_full_name (im, TRUE);
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Method %s overrides method '%s' which is not accessible", body_name, decl_name));
+                       mono_class_set_type_load_failure (klass, "Method %s overrides method '%s' which is not accessible", body_name, decl_name);
                        g_free (body_name);
                        g_free (decl_name);
                        return FALSE;
@@ -4192,7 +4224,7 @@ mono_method_try_get_vtable_index (MonoMethod *method)
 static void
 mono_class_verify_vtable (MonoClass *klass)
 {
-       int i;
+       int i, count;
        char *full_name = mono_type_full_name (&klass->byval_arg);
 
        printf ("*** Verifying VTable of class '%s' \n", full_name);
@@ -4202,7 +4234,8 @@ mono_class_verify_vtable (MonoClass *klass)
        if (!klass->methods)
                return;
 
-       for (i = 0; i < klass->method.count; ++i) {
+       count = mono_class_method_count (klass);
+       for (i = 0; i < count; ++i) {
                MonoMethod *cm = klass->methods [i];
                int slot;
 
@@ -4232,8 +4265,9 @@ mono_class_verify_vtable (MonoClass *klass)
 #endif
 
 static void
-print_unimplemented_interface_method_info (MonoClass *klass, MonoClass *ic, MonoMethod *im, int im_slot, MonoMethod **overrides, int onum) {
-       int index;
+print_unimplemented_interface_method_info (MonoClass *klass, MonoClass *ic, MonoMethod *im, int im_slot, MonoMethod **overrides, int onum)
+{
+       int index, mcount;
        char *method_signature;
        char *type_name;
        
@@ -4254,7 +4288,8 @@ print_unimplemented_interface_method_info (MonoClass *klass, MonoClass *ic, Mono
                g_free (name);
                return;
        }
-       for (index = 0; index < klass->method.count; ++index) {
+       mcount = mono_class_get_method_count (klass);
+       for (index = 0; index < mcount; ++index) {
                MonoMethod *cm = klass->methods [index];
                method_signature = mono_signature_get_desc (mono_method_signature (cm), TRUE);
 
@@ -4281,28 +4316,28 @@ verify_class_overrides (MonoClass *klass, MonoMethod **overrides, int onum)
                MonoMethod *body = overrides [i * 2 + 1];
 
                if (mono_class_get_generic_type_definition (body->klass) != mono_class_get_generic_type_definition (klass)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Method belongs to a different class than the declared one"));
+                       mono_class_set_type_load_failure (klass, "Method belongs to a different class than the declared one");
                        return FALSE;
                }
 
                if (!(body->flags & METHOD_ATTRIBUTE_VIRTUAL) || (body->flags & METHOD_ATTRIBUTE_STATIC)) {
                        if (body->flags & METHOD_ATTRIBUTE_STATIC)
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Method must not be static to override a base type"));
+                               mono_class_set_type_load_failure (klass, "Method must not be static to override a base type");
                        else
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Method must be virtual to override a base type"));
+                               mono_class_set_type_load_failure (klass, "Method must be virtual to override a base type");
                        return FALSE;
                }
 
                if (!(decl->flags & METHOD_ATTRIBUTE_VIRTUAL) || (decl->flags & METHOD_ATTRIBUTE_STATIC)) {
                        if (body->flags & METHOD_ATTRIBUTE_STATIC)
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Cannot override a static method in a base type"));
+                               mono_class_set_type_load_failure (klass, "Cannot override a static method in a base type");
                        else
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Cannot override a non virtual method in a base type"));
+                               mono_class_set_type_load_failure (klass, "Cannot override a non virtual method in a base type");
                        return FALSE;
                }
 
                if (!mono_class_is_assignable_from_slow (decl->klass, klass)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Method overrides a class or interface that is not extended or implemented by this type"));
+                       mono_class_set_type_load_failure (klass, "Method overrides a class or interface that is not extended or implemented by this type");
                        return FALSE;
                }
 
@@ -4312,7 +4347,7 @@ verify_class_overrides (MonoClass *klass, MonoMethod **overrides, int onum)
                if (is_wcf_hack_disabled () && !mono_method_can_access_method_full (body, decl, NULL)) {
                        char *body_name = mono_method_full_name (body, TRUE);
                        char *decl_name = mono_method_full_name (decl, TRUE);
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Method %s overrides method '%s' which is not accessible", body_name, decl_name));
+                       mono_class_set_type_load_failure (klass, "Method %s overrides method '%s' which is not accessible", body_name, decl_name);
                        g_free (body_name);
                        g_free (decl_name);
                        return FALSE;
@@ -4336,7 +4371,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
        MonoError error;
        MonoClass *k, *ic;
        MonoMethod **vtable;
-       int i, max_vtsize = 0, max_iid, cur_slot = 0;
+       int i, max_vtsize = 0, cur_slot = 0;
+       guint32 max_iid;
        GPtrArray *ifaces = NULL;
        GHashTable *override_map = NULL;
        MonoMethod *cm;
@@ -4355,14 +4391,14 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
        ifaces = mono_class_get_implemented_interfaces (klass, &error);
        if (!mono_error_ok (&error)) {
                char *name = mono_type_get_full_name (klass);
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Could not resolve %s interfaces due to %s", name, mono_error_get_message (&error)));
+               mono_class_set_type_load_failure (klass, "Could not resolve %s interfaces due to %s", name, mono_error_get_message (&error));
                g_free (name);
                mono_error_cleanup (&error);
                return;
        } else if (ifaces) {
                for (i = 0; i < ifaces->len; i++) {
                        MonoClass *ic = (MonoClass *)g_ptr_array_index (ifaces, i);
-                       max_vtsize += ic->method.count;
+                       max_vtsize += mono_class_get_method_count (ic);
                }
                g_ptr_array_free (ifaces, TRUE);
                ifaces = NULL;
@@ -4372,18 +4408,14 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                mono_class_init (klass->parent);
                mono_class_setup_vtable_full (klass->parent, in_setup);
 
-               if (mono_class_has_failure (klass->parent)) {
-                       char *name = mono_type_get_full_name (klass->parent);
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Parent %s failed to load", name));
-                       g_free (name);
+               if (mono_class_set_type_load_failure_causedby_class (klass, klass->parent, "Parent class failed to load"))
                        return;
-               }
 
                max_vtsize += klass->parent->vtable_size;
                cur_slot = klass->parent->vtable_size;
        }
 
-       max_vtsize += klass->method.count;
+       max_vtsize += mono_class_get_method_count (klass);
 
        /*Array have a slot for stelemref*/
        if (mono_class_need_stelemref_method (klass)) {
@@ -4405,16 +4437,14 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
        DEBUG_INTERFACE_VTABLE (first_non_interface_slot = cur_slot);
 
        /* Optimized version for generic instances */
-       if (klass->generic_class) {
+       if (mono_class_is_ginst (klass)) {
                MonoError error;
-               MonoClass *gklass = klass->generic_class->container_class;
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
                MonoMethod **tmp;
 
                mono_class_setup_vtable_full (gklass, in_setup);
-               if (mono_class_has_failure (gklass)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Could not load generic definition"))
                        return;
-               }
 
                tmp = (MonoMethod **)mono_class_alloc0 (klass, sizeof (gpointer) * gklass->vtable_size);
                klass->vtable_size = gklass->vtable_size;
@@ -4422,8 +4452,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                        if (gklass->vtable [i]) {
                                MonoMethod *inflated = mono_class_inflate_generic_method_full_checked (gklass->vtable [i], klass, mono_class_get_context (klass), &error);
                                if (!mono_error_ok (&error)) {
-                                       char *err_msg = mono_image_strdup_printf (klass->image, "Could not inflate method due to %s", mono_error_get_message (&error));
-                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                                       mono_class_set_type_load_failure (klass, "Could not inflate method due to %s", mono_error_get_message (&error));
                                        mono_error_cleanup (&error);
                                        return;
                                }
@@ -4435,7 +4464,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
 
                /* Have to set method->slot for abstract virtual methods */
                if (klass->methods && gklass->methods) {
-                       for (i = 0; i < klass->method.count; ++i)
+                       int mcount = mono_class_get_method_count (klass);
+                       for (i = 0; i < mcount; ++i)
                                if (klass->methods [i]->slot == -1)
                                        klass->methods [i]->slot = gklass->methods [i]->slot;
                }
@@ -4466,7 +4496,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                                
                                mono_class_setup_methods (parent_interface); /*FIXME Just kill this whole chunk of dead code*/
                                TRACE_INTERFACE_VTABLE (printf ("    +++ Inheriting interface %s.%s\n", parent_interface->name_space, parent_interface->name));
-                               for (j = 0; j < parent_interface->method.count && !mono_class_has_failure (klass); j++) {
+                               int mcount = mono_class_get_method_count (parent_interface);
+                               for (j = 0; j < mcount && !mono_class_has_failure (klass); j++) {
                                        vtable [interface_offset + j] = parent->vtable [parent_interface_offset + j];
                                        TRACE_INTERFACE_VTABLE (printf ("    --- Inheriting: [%03d][(%03d)+(%03d)] => [%03d][(%03d)+(%03d)]\n",
                                                        parent_interface_offset + j, parent_interface_offset, j,
@@ -4496,7 +4527,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                        int dslot;
                        dslot = mono_method_get_vtable_slot (decl);
                        if (dslot == -1) {
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                               mono_class_set_type_load_failure (klass, "");
                                return;
                        }
 
@@ -4561,7 +4592,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                }
                
                // Loop on all interface methods...
-               for (im_index = 0; im_index < ic->method.count; im_index++) {
+               int mcount = mono_class_get_method_count (ic);
+               for (im_index = 0; im_index < mcount; im_index++) {
                        MonoMethod *im = ic->methods [im_index];
                        int im_slot = ic_offset + im->slot;
                        MonoMethod *override_im = (override_map != NULL) ? (MonoMethod *)g_hash_table_lookup (override_map, im) : NULL;
@@ -4627,7 +4659,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
        // it can happen (for injected generic array interfaces) that the same slot is
        // processed multiple times (those interfaces have overlapping slots), and it
        // will not always be the first pass the one that fills the slot.
-       if (! (klass->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
+       if (!mono_class_is_abstract (klass)) {
                for (i = 0; i < klass->interface_offsets_count; i++) {
                        int ic_offset;
                        int im_index;
@@ -4635,7 +4667,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                        ic = klass->interfaces_packed [i];
                        ic_offset = mono_class_interface_offset (klass, ic);
                        
-                       for (im_index = 0; im_index < ic->method.count; im_index++) {
+                       int mcount = mono_class_get_method_count (ic);
+                       for (im_index = 0; im_index < mcount; im_index++) {
                                MonoMethod *im = ic->methods [im_index];
                                int im_slot = ic_offset + im->slot;
                                
@@ -4673,7 +4706,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                                        m1sig = mono_method_signature (m1);
 
                                        if (!cmsig || !m1sig) {
-                                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                                               /* FIXME proper error message */
+                                               mono_class_set_type_load_failure (klass, "");
                                                return;
                                        }
 
@@ -4690,7 +4724,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                                                if (is_wcf_hack_disabled () && !mono_method_can_access_method_full (cm, m1, NULL)) {
                                                        char *body_name = mono_method_full_name (cm, TRUE);
                                                        char *decl_name = mono_method_full_name (m1, TRUE);
-                                                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Method %s overrides method '%s' which is not accessible", body_name, decl_name));
+                                                       mono_class_set_type_load_failure (klass, "Method %s overrides method '%s' which is not accessible", body_name, decl_name);
                                                        g_free (body_name);
                                                        g_free (decl_name);
                                                        goto fail;
@@ -4770,12 +4804,12 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
        virt_methods = NULL;
 
        /* Ensure that all vtable slots are filled with concrete instance methods */
-       if (!(klass->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
+       if (!mono_class_is_abstract (klass)) {
                for (i = 0; i < cur_slot; ++i) {
                        if (vtable [i] == NULL || (vtable [i]->flags & (METHOD_ATTRIBUTE_ABSTRACT | METHOD_ATTRIBUTE_STATIC))) {
                                char *type_name = mono_type_get_full_name (klass);
                                char *method_name = vtable [i] ? mono_method_full_name (vtable [i], TRUE) : g_strdup ("none");
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Type %s has invalid vtable method slot %d with method %s", type_name, i, method_name));
+                               mono_class_set_type_load_failure (klass, "Type %s has invalid vtable method slot %d with method %s", type_name, i, method_name);
                                g_free (type_name);
                                g_free (method_name);
                                return;
@@ -4783,8 +4817,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
                }
        }
 
-       if (klass->generic_class) {
-               MonoClass *gklass = klass->generic_class->container_class;
+       if (mono_class_is_ginst (klass)) {
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
                mono_class_init (gklass);
 
@@ -4859,7 +4893,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o
 fail:
        {
        char *name = mono_type_get_full_name (klass);
-       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "VTable setup of type %s failed", name));
+       mono_class_set_type_load_failure (klass, "VTable setup of type %s failed", name);
        g_free (name);
        if (override_map)
                g_hash_table_destroy (override_map);
@@ -4885,23 +4919,24 @@ mono_method_get_vtable_slot (MonoMethod *method)
                        return -1;
                if (method->slot == -1) {
                        MonoClass *gklass;
-                       int i;
+                       int i, mcount;
 
-                       if (!method->klass->generic_class) {
+                       if (!mono_class_is_ginst (method->klass)) {
                                g_assert (method->is_inflated);
                                return mono_method_get_vtable_slot (((MonoMethodInflated*)method)->declaring);
                        }
 
                        /* This can happen for abstract methods of generic instances due to the shortcut code in mono_class_setup_vtable_general (). */
-                       g_assert (method->klass->generic_class);
-                       gklass = method->klass->generic_class->container_class;
+                       g_assert (mono_class_is_ginst (method->klass));
+                       gklass = mono_class_get_generic_class (method->klass)->container_class;
                        mono_class_setup_methods (method->klass);
                        g_assert (method->klass->methods);
-                       for (i = 0; i < method->klass->method.count; ++i) {
+                       mcount = mono_class_get_method_count (method->klass);
+                       for (i = 0; i < mcount; ++i) {
                                if (method->klass->methods [i] == method)
                                        break;
                        }
-                       g_assert (i < method->klass->method.count);
+                       g_assert (i < mcount);
                        g_assert (gklass->methods);
                        method->slot = gklass->methods [i]->slot;
                }
@@ -4972,13 +5007,14 @@ static GenericArrayMethodInfo *generic_array_method_info = NULL;
 static int
 generic_array_methods (MonoClass *klass)
 {
-       int i, count_generic = 0;
+       int i, count_generic = 0, mcount;
        GList *list = NULL, *tmp;
        if (generic_array_method_num)
                return generic_array_method_num;
        mono_class_setup_methods (klass->parent); /*This is setting up System.Array*/
        g_assert (!mono_class_has_failure (klass->parent)); /*So hitting this assert is a huge problem*/
-       for (i = 0; i < klass->parent->method.count; i++) {
+       mcount = mono_class_get_method_count (klass->parent);
+       for (i = 0; i < mcount; i++) {
                MonoMethod *m = klass->parent->methods [i];
                if (!strncmp (m->name, "InternalArray__", 15)) {
                        count_generic++;
@@ -5035,7 +5071,7 @@ setup_generic_array_ifaces (MonoClass *klass, MonoClass *iface, MonoMethod **met
        int i;
 
        tmp_context.class_inst = NULL;
-       tmp_context.method_inst = iface->generic_class->context.class_inst;
+       tmp_context.method_inst = mono_class_get_generic_class (iface)->context.class_inst;
        //g_print ("setting up array interface: %s\n", mono_type_get_name_full (&iface->byval_arg, 0));
 
        for (i = 0; i < generic_array_method_num; i++) {
@@ -5065,21 +5101,30 @@ concat_two_strings_with_zero (MonoImage *image, const char *s1, const char *s2)
 
 /**
  * mono_class_init:
- * @class: the class to initialize
+ * @klass: the class to initialize
  *
  *   Compute the instance_size, class_size and other infos that cannot be 
  * computed at mono_class_get() time. Also compute vtable_size if possible. 
  * Returns TRUE on success or FALSE if there was a problem in loading
- * the type (incorrect assemblies, missing assemblies, methods, etc). 
+ * the type (incorrect assemblies, missing assemblies, methods, etc).
+ * Initializes the following fields in @klass:
+ * - all the fields initialized by mono_class_init_sizes ()
+ * - has_cctor
+ * - ghcimpl
+ * - inited
  *
  * LOCKING: Acquires the loader lock.
  */
 gboolean
 mono_class_init (MonoClass *klass)
 {
-       int i;
+       int i, vtable_size = 0, array_method_count = 0;
        MonoCachedClassInfo cached_info;
        gboolean has_cached_info;
+       gboolean locked = FALSE;
+       gboolean ghcimpl = FALSE;
+       gboolean has_cctor = FALSE;
+       int first_iface_slot = 0;
        
        g_assert (klass);
 
@@ -5089,59 +5134,45 @@ mono_class_init (MonoClass *klass)
 
        /*g_print ("Init class %s\n", mono_type_get_full_name (klass));*/
 
-       /* We do everything inside the lock to prevent races */
-       mono_loader_lock ();
-
-       if (klass->inited || mono_class_has_failure (klass)) {
-               mono_loader_unlock ();
-               /* Somebody might have gotten in before us */
-               return !mono_class_has_failure (klass);
-       }
-
-       if (klass->init_pending) {
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Recursive type definition detected"));
+       /*
+        * This function can recursively call itself.
+        */
+       GSList *init_list = (GSList *)mono_native_tls_get_value (init_pending_tls_id);
+       if (g_slist_find (init_list, klass)) {
+               mono_class_set_type_load_failure (klass, "Recursive type definition detected");
                goto leave;
        }
+       init_list = g_slist_prepend (init_list, klass);
+       mono_native_tls_set_value (init_pending_tls_id, init_list);
 
-       klass->init_pending = 1;
+       /*
+        * We want to avoid doing complicated work inside locks, so we compute all the required
+        * information and write it to @klass inside a lock.
+        */
 
        if (mono_verifier_is_enabled_for_class (klass) && !mono_verifier_verify_class (klass)) {
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, concat_two_strings_with_zero (klass->image, klass->name, klass->image->assembly_name));
+               mono_class_set_type_load_failure (klass, "%s", concat_two_strings_with_zero (klass->image, klass->name, klass->image->assembly_name));
                goto leave;
        }
 
-
        if (klass->byval_arg.type == MONO_TYPE_ARRAY || klass->byval_arg.type == MONO_TYPE_SZARRAY) {
                MonoClass *element_class = klass->element_class;
                if (!element_class->inited) 
                        mono_class_init (element_class);
-               if (mono_class_has_failure (element_class)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               if (mono_class_set_type_load_failure_causedby_class (klass, element_class, "Could not load array element class"))
                        goto leave;
-               }
        }
 
        mono_stats.initialized_class_count++;
 
-       if (klass->generic_class && !klass->generic_class->is_dynamic) {
-               MonoClass *gklass = klass->generic_class->container_class;
-
-               mono_stats.generic_class_count++;
-
-               klass->method = gklass->method;
-               klass->field = gklass->field;
+       if (mono_class_is_ginst (klass) && !mono_class_get_generic_class (klass)->is_dynamic) {
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
                mono_class_init (gklass);
-               // FIXME: Why is this needed ?
-               if (!mono_class_has_failure (gklass))
-                       mono_class_setup_methods (gklass);
-               if (mono_class_has_failure (gklass)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Generic Type Defintion failed to init"));
+               if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Generic Type Definition failed to init"))
                        goto leave;
-               }
 
-               if (MONO_CLASS_IS_INTERFACE (klass))
-                       klass->interface_id = mono_get_unique_iid (klass);
+               mono_class_setup_interface_id (klass);
        }
 
        if (klass->parent && !klass->parent->inited)
@@ -5149,38 +5180,10 @@ mono_class_init (MonoClass *klass)
 
        has_cached_info = mono_class_get_cached_class_info (klass, &cached_info);
 
-       if (klass->generic_class || image_is_dynamic (klass->image) || !klass->type_token || (has_cached_info && !cached_info.has_nested_classes))
-               klass->nested_classes_inited = TRUE;
-
-       /*
-        * Computes the size used by the fields, and their locations
-        */
-       if (has_cached_info) {
-               klass->instance_size = cached_info.instance_size;
-               klass->sizes.class_size = cached_info.class_size;
-               klass->packing_size = cached_info.packing_size;
-               klass->min_align = cached_info.min_align;
-               klass->blittable = cached_info.blittable;
-               klass->has_references = cached_info.has_references;
-               klass->has_static_refs = cached_info.has_static_refs;
-               klass->no_special_static_fields = cached_info.no_special_static_fields;
-       }
-       else
-               if (!klass->size_inited){
-                       mono_class_setup_fields (klass);
-                       if (mono_class_has_failure (klass))
-                               goto leave;
-               }
-                               
-       /* Initialize arrays */
-       if (klass->rank) {
-               klass->method.count = 3 + (klass->rank > 1? 2: 1);
-
-               if (klass->interface_count) {
-                       int count_generic = generic_array_methods (klass);
-                       klass->method.count += klass->interface_count * count_generic;
-               }
-       }
+       /* Compute instance size etc. */
+       init_sizes_with_info (klass, has_cached_info ? &cached_info : NULL);
+       if (mono_class_has_failure (klass))
+               goto leave;
 
        mono_class_setup_supertypes (klass);
 
@@ -5194,11 +5197,9 @@ mono_class_init (MonoClass *klass)
         */
        if (has_cached_info) {
                /* AOT case */
-               klass->vtable_size = cached_info.vtable_size;
-               klass->has_finalize = cached_info.has_finalize;
-               klass->has_finalize_inited = TRUE;
-               klass->ghcimpl = cached_info.ghcimpl;
-               klass->has_cctor = cached_info.has_cctor;
+               vtable_size = cached_info.vtable_size;
+               ghcimpl = cached_info.ghcimpl;
+               has_cctor = cached_info.has_cctor;
        } else if (klass->rank == 1 && klass->byval_arg.type == MONO_TYPE_SZARRAY) {
                /* SZARRAY can have 2 vtable layouts, with and without the stelemref method.
                 * The first slot if for array with.
@@ -5211,23 +5212,22 @@ mono_class_init (MonoClass *klass)
                if (!szarray_vtable_size [slot]) {
                        mono_class_setup_vtable (klass);
                        szarray_vtable_size [slot] = klass->vtable_size;
+                       vtable_size = klass->vtable_size;
                } else {
-                       klass->vtable_size = szarray_vtable_size[slot];
+                       vtable_size = szarray_vtable_size[slot];
                }
-       } else if (klass->generic_class && !MONO_CLASS_IS_INTERFACE (klass)) {
-               MonoClass *gklass = klass->generic_class->container_class;
+       } else if (mono_class_is_ginst (klass) && !MONO_CLASS_IS_INTERFACE (klass)) {
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
                /* Generic instance case */
-               klass->ghcimpl = gklass->ghcimpl;
-               klass->has_cctor = gklass->has_cctor;
+               ghcimpl = gklass->ghcimpl;
+               has_cctor = gklass->has_cctor;
 
                mono_class_setup_vtable (gklass);
-               if (mono_class_has_failure (gklass)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               if (mono_class_set_type_load_failure_causedby_class (klass, gklass, "Generic type definition failed to init"))
                        goto leave;
-               }
 
-               klass->vtable_size = gklass->vtable_size;
+               vtable_size = gklass->vtable_size;
        } else {
                /* General case */
 
@@ -5247,21 +5247,28 @@ mono_class_init (MonoClass *klass)
                if (!MONO_CLASS_IS_INTERFACE (klass) || klass->image != mono_defaults.corlib) {
                        MonoMethod *cmethod = NULL;
 
-                       if (klass->type_token && !image_is_dynamic(klass->image)) {
+                       if (mono_class_is_ginst (klass)) {
+                               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
+
+                               /* Generic instance case */
+                               ghcimpl = gklass->ghcimpl;
+                               has_cctor = gklass->has_cctor;
+                       } else if (klass->type_token && !image_is_dynamic(klass->image)) {
                                cmethod = find_method_in_metadata (klass, ".cctor", 0, METHOD_ATTRIBUTE_SPECIAL_NAME);
                                /* The find_method function ignores the 'flags' argument */
                                if (cmethod && (cmethod->flags & METHOD_ATTRIBUTE_SPECIAL_NAME))
-                                       klass->has_cctor = 1;
+                                       has_cctor = 1;
                        } else {
                                mono_class_setup_methods (klass);
                                if (mono_class_has_failure (klass))
                                        goto leave;
 
-                               for (i = 0; i < klass->method.count; ++i) {
+                               int mcount = mono_class_get_method_count (klass);
+                               for (i = 0; i < mcount; ++i) {
                                        MonoMethod *method = klass->methods [i];
                                        if ((method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) && 
                                                (strcmp (".cctor", method->name) == 0)) {
-                                               klass->has_cctor = 1;
+                                               has_cctor = 1;
                                                break;
                                        }
                                }
@@ -5269,45 +5276,79 @@ mono_class_init (MonoClass *klass)
                }
        }
 
-       if (klass->parent) {
-               int first_iface_slot;
-               /* This will compute klass->parent->vtable_size for some classes */
-               mono_class_init (klass->parent);
-               if (mono_class_has_failure (klass->parent)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
-                       goto leave;
+       if (klass->rank) {
+               array_method_count = 3 + (klass->rank > 1? 2: 1);
+
+               if (klass->interface_count) {
+                       int count_generic = generic_array_methods (klass);
+                       array_method_count += klass->interface_count * count_generic;
                }
-               if (!klass->parent->vtable_size) {
-                       /* FIXME: Get rid of this somehow */
+       }
+
+       if (klass->parent) {
+               if (!klass->parent->vtable_size)
                        mono_class_setup_vtable (klass->parent);
-                       if (mono_class_has_failure (klass->parent)) {
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
-                               goto leave;
-                       }
-               }
+               if (mono_class_set_type_load_failure_causedby_class (klass, klass->parent, "Parent class vtable failed to initialize"))
+                       goto leave;
+               g_assert (klass->parent->vtable_size);
                first_iface_slot = klass->parent->vtable_size;
                if (mono_class_need_stelemref_method (klass))
                        ++first_iface_slot;
-               setup_interface_offsets (klass, first_iface_slot, TRUE);
-       } else {
-               setup_interface_offsets (klass, 0, TRUE);
        }
 
+       /*
+        * Do the actual changes to @klass inside the loader lock
+        */
+       mono_loader_lock ();
+       locked = TRUE;
+
+       if (klass->inited || mono_class_has_failure (klass)) {
+               mono_loader_unlock ();
+               /* Somebody might have gotten in before us */
+               return !mono_class_has_failure (klass);
+       }
+
+       mono_stats.initialized_class_count++;
+
+       if (mono_class_is_ginst (klass) && !mono_class_get_generic_class (klass)->is_dynamic)
+               mono_stats.generic_class_count++;
+
+       if (mono_class_is_ginst (klass) || image_is_dynamic (klass->image) || !klass->type_token || (has_cached_info && !cached_info.has_nested_classes))
+               klass->nested_classes_inited = TRUE;
+       klass->ghcimpl = ghcimpl;
+       klass->has_cctor = has_cctor;
+       if (vtable_size)
+               klass->vtable_size = vtable_size;
+       if (has_cached_info) {
+               klass->has_finalize = cached_info.has_finalize;
+               klass->has_finalize_inited = TRUE;
+       }
+       if (klass->rank)
+               mono_class_set_method_count (klass, array_method_count);
+
+       mono_loader_unlock ();
+       locked = FALSE;
+
+       setup_interface_offsets (klass, first_iface_slot, TRUE);
+
        if (mono_security_core_clr_enabled ())
                mono_security_core_clr_check_inheritance (klass);
 
-       if (klass->generic_class && !mono_verifier_class_is_valid_generic_instantiation (klass))
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Invalid generic instantiation"));
+       if (mono_class_is_ginst (klass) && !mono_verifier_class_is_valid_generic_instantiation (klass))
+               mono_class_set_type_load_failure (klass, "Invalid generic instantiation");
 
        goto leave;
 
  leave:
+       init_list = g_slist_remove (init_list, klass);
+       mono_native_tls_set_value (init_pending_tls_id, init_list);
+
        /* Because of the double-checking locking pattern */
        mono_memory_barrier ();
        klass->inited = 1;
-       klass->init_pending = 0;
 
-       mono_loader_unlock ();
+       if (locked)
+               mono_loader_unlock ();
 
        return !mono_class_has_failure (klass);
 }
@@ -5331,8 +5372,8 @@ mono_class_has_finalizer (MonoClass *klass)
                MonoMethod *cmethod = NULL;
 
                if (klass->rank == 1 && klass->byval_arg.type == MONO_TYPE_SZARRAY) {
-               } else if (klass->generic_class) {
-                       MonoClass *gklass = klass->generic_class->container_class;
+               } else if (mono_class_is_ginst (klass)) {
+                       MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
                        has_finalize = mono_class_has_finalizer (gklass);
                } else if (klass->parent && klass->parent->has_finalize) {
@@ -5380,11 +5421,7 @@ mono_class_has_finalizer (MonoClass *klass)
 gboolean
 mono_is_corlib_image (MonoImage *image)
 {
-       /* FIXME: allow the dynamic case for our compilers and with full trust */
-       if (image_is_dynamic (image))
-               return image->assembly && !strcmp (image->assembly->aname.name, "mscorlib");
-       else
-               return image == mono_defaults.corlib;
+       return image == mono_defaults.corlib;
 }
 
 /*
@@ -5513,7 +5550,6 @@ mono_class_setup_mono_type (MonoClass *klass)
 
        if (MONO_CLASS_IS_INTERFACE (klass))
                klass->interface_id = mono_get_unique_iid (klass);
-
 }
 
 #ifndef DISABLE_COM
@@ -5533,7 +5569,7 @@ init_com_from_comimport (MonoClass *klass)
                        /* but it can not be made available for application (i.e. user code) since all COM calls
                         * are considered native calls. In this case we fail with a TypeLoadException (just like
                         * Silverlight 2 does */
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_type_load_failure (klass, "");
                        return;
                }
        }
@@ -5577,12 +5613,13 @@ mono_class_setup_parent (MonoClass *klass, MonoClass *parent)
                if (!parent) {
                        /* set the parent to something useful and safe, but mark the type as broken */
                        parent = mono_defaults.object_class;
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_type_load_failure (klass, "");
+                       g_assert (parent);
                }
 
                klass->parent = parent;
 
-               if (parent->generic_class && !parent->name) {
+               if (mono_class_is_ginst (parent) && !parent->name) {
                        /*
                         * If the parent is a generic instance, we may get
                         * called before it is fully initialized, especially
@@ -5642,12 +5679,12 @@ mono_class_setup_parent (MonoClass *klass, MonoClass *parent)
  *  - supertypes: array of classes: each element has a class in the hierarchy
  *    starting from @class up to System.Object
  * 
- * LOCKING: This function is atomic, in case of contention we waste memory.
+ * LOCKING: Acquires the loader lock.
  */
 void
 mono_class_setup_supertypes (MonoClass *klass)
 {
-       int ms;
+       int ms, idepth;
        MonoClass **supertypes;
 
        mono_atomic_load_acquire (supertypes, MonoClass **, &klass->supertypes);
@@ -5657,15 +5694,15 @@ mono_class_setup_supertypes (MonoClass *klass)
        if (klass->parent && !klass->parent->supertypes)
                mono_class_setup_supertypes (klass->parent);
        if (klass->parent)
-               klass->idepth = klass->parent->idepth + 1;
+               idepth = klass->parent->idepth + 1;
        else
-               klass->idepth = 1;
+               idepth = 1;
 
-       ms = MAX (MONO_DEFAULT_SUPERTABLE_SIZE, klass->idepth);
+       ms = MAX (MONO_DEFAULT_SUPERTABLE_SIZE, idepth);
        supertypes = (MonoClass **)mono_class_alloc0 (klass, sizeof (MonoClass *) * ms);
 
        if (klass->parent) {
-               CHECKED_METADATA_WRITE_PTR ( supertypes [klass->idepth - 1] , klass );
+               CHECKED_METADATA_WRITE_PTR ( supertypes [idepth - 1] , klass );
 
                int supertype_idx;
                for (supertype_idx = 0; supertype_idx < klass->parent->idepth; supertype_idx++)
@@ -5674,7 +5711,14 @@ mono_class_setup_supertypes (MonoClass *klass)
                CHECKED_METADATA_WRITE_PTR ( supertypes [0] , klass );
        }
 
-       CHECKED_METADATA_WRITE_PTR_ATOMIC ( klass->supertypes , supertypes );
+       mono_memory_barrier ();
+
+       mono_loader_lock ();
+       klass->idepth = idepth;
+       /* Needed so idepth is visible before supertypes is set */
+       mono_memory_barrier ();
+       klass->supertypes = supertypes;
+       mono_loader_unlock ();
 }
 
 static gboolean
@@ -5682,7 +5726,7 @@ fix_gclass_incomplete_instantiation (MonoClass *gclass, void *user_data)
 {
        MonoClass *gtd = (MonoClass*)user_data;
        /* Only try to fix generic instances of @gtd */
-       if (gclass->generic_class->container_class != gtd)
+       if (mono_class_get_generic_class (gclass)->container_class != gtd)
                return FALSE;
 
        /* Check if the generic instance has no parent. */
@@ -5695,8 +5739,8 @@ fix_gclass_incomplete_instantiation (MonoClass *gclass, void *user_data)
 static void
 mono_class_set_failure_and_error (MonoClass *klass, MonoError *error, const char *msg)
 {
-       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, msg));
-       mono_error_set_type_load_class (error, klass, msg);
+       mono_class_set_type_load_failure (klass, "%s", msg);
+       mono_error_set_type_load_class (error, klass, "%s", msg);
 }
 
 /**
@@ -5744,7 +5788,17 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
        name = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAME]);
        nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]);
 
-       klass = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClass));
+       if (mono_metadata_has_generic_params (image, type_token)) {
+               klass = mono_image_alloc0 (image, sizeof (MonoClassGtd));
+               klass->class_kind = MONO_CLASS_GTD;
+               classes_size += sizeof (MonoClassGtd);
+               ++class_gtd_count;
+       } else {
+               klass = mono_image_alloc0 (image, sizeof (MonoClassDef));
+               klass->class_kind = MONO_CLASS_DEF;
+               classes_size += sizeof (MonoClassDef);
+               ++class_def_count;
+       }
 
        klass->name = name;
        klass->name_space = nspace;
@@ -5753,25 +5807,21 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
        klass->image = image;
        klass->type_token = type_token;
-       klass->flags = cols [MONO_TYPEDEF_FLAGS];
+       mono_class_set_flags (klass, cols [MONO_TYPEDEF_FLAGS]);
 
        mono_internal_hash_table_insert (&image->class_cache, GUINT_TO_POINTER (type_token), klass);
 
-       classes_size += sizeof (MonoClass);
-
        /*
         * Check whether we're a generic type definition.
         */
-       klass->generic_container = mono_metadata_load_generic_params (image, klass->type_token, NULL);
-       if (klass->generic_container) {
-               klass->is_generic = 1;
-               klass->generic_container->owner.klass = klass;
-               klass->generic_container->is_anonymous = FALSE; // Owner class is now known, container is no longer anonymous
-               context = &klass->generic_container->context;
-       }
-
-       if (klass->generic_container)
+       if (mono_class_is_gtd (klass)) {
+               MonoGenericContainer *generic_container = mono_metadata_load_generic_params (image, klass->type_token, NULL);
+               generic_container->owner.klass = klass;
+               generic_container->is_anonymous = FALSE; // Owner class is now known, container is no longer anonymous
+               context = &generic_container->context;
+               mono_class_set_generic_container (klass, generic_container);
                enable_gclass_recording ();
+       }
 
        if (cols [MONO_TYPEDEF_EXTENDS]) {
                MonoClass *tmp;
@@ -5790,7 +5840,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                        parent = mono_class_inflate_generic_class_checked (parent, context, error);
 
                if (parent == NULL) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, mono_error_get_message (error)));
+                       mono_class_set_type_load_failure (klass, "%s", mono_error_get_message (error));
                        goto parent_failure;
                }
 
@@ -5799,7 +5849,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                                mono_class_set_failure_and_error (klass, error, "Cycle found while resolving parent");
                                goto parent_failure;
                        }
-                       if (klass->generic_container && tmp->generic_class && tmp->generic_class->container_class == klass) {
+                       if (mono_class_is_gtd (klass) && mono_class_is_ginst (tmp) && mono_class_get_generic_class (tmp)->container_class == klass) {
                                mono_class_set_failure_and_error (klass, error, "Parent extends generic instance of this type");
                                goto parent_failure;
                        }
@@ -5811,7 +5861,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
        /* uses ->valuetype, which is initialized by mono_class_setup_parent above */
        mono_class_setup_mono_type (klass);
 
-       if (klass->generic_container)
+       if (mono_class_is_gtd (klass))
                disable_gclass_recording (fix_gclass_incomplete_instantiation, klass);
 
        /* 
@@ -5822,18 +5872,18 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                klass->nested_in = mono_class_create_from_typedef (image, nesting_tokeen, error);
                if (!mono_error_ok (error)) {
                        /*FIXME implement a mono_class_set_failure_from_mono_error */
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, mono_error_get_message (error)));
+                       mono_class_set_type_load_failure (klass, "%s",  mono_error_get_message (error));
                        mono_loader_unlock ();
                        mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
                        return NULL;
                }
        }
 
-       if ((klass->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_UNICODE_CLASS)
+       if ((mono_class_get_flags (klass) & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_UNICODE_CLASS)
                klass->unicode = 1;
 
 #ifdef HOST_WIN32
-       if ((klass->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_AUTO_CLASS)
+       if ((mono_class_get_flags (klass) & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_AUTO_CLASS)
                klass->unicode = 1;
 #endif
 
@@ -5843,12 +5893,15 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                if (!mono_metadata_interfaces_from_typedef_full (
                            image, type_token, &interfaces, &icount, FALSE, context, error)){
 
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, mono_error_get_message (error)));
+                       mono_class_set_type_load_failure (klass, "%s", mono_error_get_message (error));
                        mono_loader_unlock ();
                        mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
                        return NULL;
                }
 
+               /* This is required now that it is possible for more than 2^16 interfaces to exist. */
+               g_assert(icount <= 65535);
+
                klass->interfaces = interfaces;
                klass->interface_count = icount;
                klass->interfaces_inited = 1;
@@ -5859,8 +5912,10 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
        /*
         * Compute the field and method lists
         */
-       klass->field.first  = cols [MONO_TYPEDEF_FIELD_LIST] - 1;
-       klass->method.first = cols [MONO_TYPEDEF_METHOD_LIST] - 1;
+       int first_field_idx = cols [MONO_TYPEDEF_FIELD_LIST] - 1;
+       mono_class_set_first_field_idx (klass, first_field_idx);
+       int first_method_idx = cols [MONO_TYPEDEF_METHOD_LIST] - 1;
+       mono_class_set_first_method_idx (klass, first_method_idx);
 
        if (tt->rows > tidx){           
                mono_metadata_decode_row (tt, tidx, cols_next, MONO_TYPEDEF_SIZE);
@@ -5873,19 +5928,14 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
 
        if (cols [MONO_TYPEDEF_FIELD_LIST] && 
            cols [MONO_TYPEDEF_FIELD_LIST] <= image->tables [MONO_TABLE_FIELD].rows)
-               klass->field.count = field_last - klass->field.first;
-       else
-               klass->field.count = 0;
-
+               mono_class_set_field_count (klass, field_last - first_field_idx);
        if (cols [MONO_TYPEDEF_METHOD_LIST] <= image->tables [MONO_TABLE_METHOD].rows)
-               klass->method.count = method_last - klass->method.first;
-       else
-               klass->method.count = 0;
+               mono_class_set_method_count (klass, method_last - first_method_idx);
 
        /* reserve space to store vector pointer in arrays */
        if (mono_is_corlib_image (image) && !strcmp (nspace, "System") && !strcmp (name, "Array")) {
                klass->instance_size += 2 * sizeof (gpointer);
-               g_assert (klass->field.count == 0);
+               g_assert (mono_class_get_field_count (klass) == 0);
        }
 
        if (klass->enumtype) {
@@ -5893,7 +5943,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
                if (!enum_basetype) {
                        /*set it to a default value as the whole runtime can't handle this to be null*/
                        klass->cast_class = klass->element_class = mono_defaults.int32_class;
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, mono_error_get_message (error)));
+                       mono_class_set_type_load_failure (klass, "%s", mono_error_get_message (error));
                        mono_loader_unlock ();
                        mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
                        return NULL;
@@ -5906,8 +5956,8 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError
         * We must do this after the class has been constructed to make certain recursive scenarios
         * work.
         */
-       if (klass->generic_container && !mono_metadata_load_generic_param_constraints_checked (image, type_token, klass->generic_container, error)) {
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup_printf (klass->image, "Could not load generic parameter constrains due to %s", mono_error_get_message (error)));
+       if (mono_class_is_gtd (klass) && !mono_metadata_load_generic_param_constraints_checked (image, type_token, mono_class_get_generic_container (klass), error)) {
+               mono_class_set_type_load_failure (klass, "Could not load generic parameter constrains due to %s", mono_error_get_message (error));
                mono_loader_unlock ();
                mono_profiler_class_loaded (klass, MONO_PROFILE_FAILED);
                return NULL;
@@ -5935,8 +5985,8 @@ parent_failure:
 gboolean
 mono_class_is_nullable (MonoClass *klass)
 {
-       return klass->generic_class != NULL &&
-               klass->generic_class->container_class == mono_defaults.generic_nullable_class;
+       MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
+       return gklass && gklass->container_class == mono_defaults.generic_nullable_class;
 }
 
 
@@ -5945,7 +5995,7 @@ MonoClass*
 mono_class_get_nullable_param (MonoClass *klass)
 {
        g_assert (mono_class_is_nullable (klass));
-       return mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+       return mono_class_from_mono_type (mono_class_get_generic_class (klass)->context.class_inst->type_argv [0]);
 }
 
 static void
@@ -5953,13 +6003,13 @@ mono_generic_class_setup_parent (MonoClass *klass, MonoClass *gtd)
 {
        if (gtd->parent) {
                MonoError error;
-               MonoGenericClass *gclass = klass->generic_class;
+               MonoGenericClass *gclass = mono_class_get_generic_class (klass);
 
                klass->parent = mono_class_inflate_generic_class_checked (gtd->parent, mono_generic_class_get_context (gclass), &error);
                if (!mono_error_ok (&error)) {
                        /*Set parent to something safe as the runtime doesn't handle well this kind of failure.*/
                        klass->parent = mono_defaults.object_class;
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_type_load_failure (klass, "Parent is a generic type instantiation that failed due to: %s", mono_error_get_message (&error));
                        mono_error_cleanup (&error);
                }
        }
@@ -5991,7 +6041,7 @@ mono_generic_class_get_class (MonoGenericClass *gclass)
                return gclass->cached_class;
        }
 
-       klass = (MonoClass *)mono_image_set_alloc0 (gclass->owner, sizeof (MonoClass));
+       klass = (MonoClass *)mono_image_set_alloc0 (gclass->owner, sizeof (MonoClassGenericInst));
 
        gklass = gclass->container_class;
 
@@ -6009,12 +6059,11 @@ mono_generic_class_get_class (MonoGenericClass *gclass)
        mono_profiler_class_event (klass, MONO_PROFILE_START_LOAD);
        
        klass->image = gklass->image;
-       klass->flags = gklass->flags;
        klass->type_token = gklass->type_token;
-       klass->field.count = gklass->field.count;
 
-       klass->is_inflated = 1;
-       klass->generic_class = gclass;
+       klass->class_kind = MONO_CLASS_GINST;
+       //FIXME add setter
+       ((MonoClassGenericInst*)klass)->generic_class = gclass;
 
        klass->byval_arg.type = MONO_TYPE_GENERICINST;
        klass->this_arg.type = klass->byval_arg.type;
@@ -6064,8 +6113,8 @@ mono_generic_class_get_class (MonoGenericClass *gclass)
 
        mono_profiler_class_loaded (klass, MONO_PROFILE_OK);
 
-       inflated_classes ++;
-       inflated_classes_size += sizeof (MonoClass);
+       ++class_ginst_count;
+       inflated_classes_size += sizeof (MonoClassGenericInst);
        
        mono_loader_unlock ();
 
@@ -6126,8 +6175,10 @@ make_generic_param_class (MonoGenericParam *param, MonoGenericParamInfo *pinfo)
        gboolean is_mvar = container->is_method;
        gboolean is_anonymous = container->is_anonymous;
 
-       klass = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClass));
-       classes_size += sizeof (MonoClass);
+       klass = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClassGenericParam));
+       klass->class_kind = MONO_CLASS_GPARAM;
+       classes_size += sizeof (MonoClassGenericParam);
+       ++class_gparam_count;
 
        if (pinfo) {
                CHECKED_METADATA_WRITE_PTR_EXEMPT ( klass->name , pinfo->name );
@@ -6177,7 +6228,6 @@ make_generic_param_class (MonoGenericParam *param, MonoGenericParamInfo *pinfo)
        klass->inited = TRUE;
        CHECKED_METADATA_WRITE_PTR_LOCAL ( klass->cast_class ,    klass );
        CHECKED_METADATA_WRITE_PTR_LOCAL ( klass->element_class , klass );
-       klass->flags = TYPE_ATTRIBUTE_PUBLIC;
 
        klass->byval_arg.type = is_mvar ? MONO_TYPE_MVAR : MONO_TYPE_VAR;
        klass->this_arg.type = klass->byval_arg.type;
@@ -6197,14 +6247,13 @@ make_generic_param_class (MonoGenericParam *param, MonoGenericParamInfo *pinfo)
        klass->instance_size = sizeof (MonoObject) + mono_type_stack_size_internal (&klass->byval_arg, NULL, TRUE);
        mono_memory_barrier ();
        klass->size_inited = 1;
-       klass->setup_fields_called = 1;
 
        mono_class_setup_supertypes (klass);
 
        if (count - pos > 0) {
                mono_class_setup_vtable (klass->parent);
                if (mono_class_has_failure (klass->parent))
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Failed to setup parent interfaces"));
+                       mono_class_set_type_load_failure (klass, "Failed to setup parent interfaces");
                else
                        setup_interface_offsets (klass, klass->parent->vtable_size, TRUE);
        }
@@ -6404,23 +6453,23 @@ mono_ptr_class_get (MonoType *type)
        }
        mono_image_unlock (image);
        
-       result = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClass));
+       result = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClassPointer));
 
-       classes_size += sizeof (MonoClass);
+       classes_size += sizeof (MonoClassPointer);
+       ++class_pointer_count;
 
        result->parent = NULL; /* no parent for PTR types */
        result->name_space = el_class->name_space;
        name = g_strdup_printf ("%s*", el_class->name);
        result->name = mono_image_strdup (image, name);
+       result->class_kind = MONO_CLASS_POINTER;
        g_free (name);
 
        mono_profiler_class_event (result, MONO_PROFILE_START_LOAD);
 
        result->image = el_class->image;
        result->inited = TRUE;
-       result->flags = TYPE_ATTRIBUTE_CLASS | (el_class->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK);
-       /* Can pointers get boxed? */
-       result->instance_size = sizeof (gpointer);
+       result->instance_size = sizeof (MonoObject) + sizeof (gpointer);
        result->cast_class = result->element_class = el_class;
        result->blittable = TRUE;
 
@@ -6469,17 +6518,19 @@ mono_fnptr_class_get (MonoMethodSignature *sig)
        }
        result = g_new0 (MonoClass, 1);
 
+       classes_size += sizeof (MonoClassPointer);
+       ++class_pointer_count;
+
        result->parent = NULL; /* no parent for PTR types */
        result->name_space = "System";
        result->name = "MonoFNPtrFakeClass";
+       result->class_kind = MONO_CLASS_POINTER;
 
        mono_profiler_class_event (result, MONO_PROFILE_START_LOAD);
 
        result->image = mono_defaults.corlib; /* need to fix... */
        result->inited = TRUE;
-       result->flags = TYPE_ATTRIBUTE_CLASS; /* | (el_class->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK); */
-       /* Can pointers get boxed? */
-       result->instance_size = sizeof (gpointer);
+       result->instance_size = sizeof (MonoObject) + sizeof (gpointer);
        result->cast_class = result->element_class = result;
        result->blittable = TRUE;
 
@@ -6640,7 +6691,6 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
        GSList *list, *rootlist = NULL;
        int nsize;
        char *name;
-       gboolean corlib_type = FALSE;
 
        g_assert (rank <= 255);
 
@@ -6682,20 +6732,16 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
                }
        }
 
-       /* for the building corlib use System.Array from it */
-       if (image->assembly && assembly_is_dynamic (image->assembly) && image->assembly_name && strcmp (image->assembly_name, "mscorlib") == 0) {
-               parent = mono_class_load_from_name (image, "System", "Array");
-               corlib_type = TRUE;
-       } else {
-               parent = mono_defaults.array_class;
-               if (!parent->inited)
-                       mono_class_init (parent);
-       }
+       parent = mono_defaults.array_class;
+       if (!parent->inited)
+               mono_class_init (parent);
 
-       klass = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClass));
+       klass = (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClassArray));
 
        klass->image = image;
        klass->name_space = eclass->name_space;
+       klass->class_kind = MONO_CLASS_ARRAY;
+
        nsize = strlen (eclass->name);
        name = (char *)g_malloc (nsize + 2 + rank + 1);
        memcpy (name, eclass->name, nsize);
@@ -6711,21 +6757,25 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
 
        mono_profiler_class_event (klass, MONO_PROFILE_START_LOAD);
 
-       classes_size += sizeof (MonoClass);
+       classes_size += sizeof (MonoClassArray);
+       ++class_array_count;
 
        klass->type_token = 0;
-       /* all arrays are marked serializable and sealed, bug #42779 */
-       klass->flags = TYPE_ATTRIBUTE_CLASS | TYPE_ATTRIBUTE_SERIALIZABLE | TYPE_ATTRIBUTE_SEALED | TYPE_ATTRIBUTE_PUBLIC;
        klass->parent = parent;
        klass->instance_size = mono_class_instance_size (klass->parent);
 
        if (eclass->byval_arg.type == MONO_TYPE_TYPEDBYREF || eclass->byval_arg.type == MONO_TYPE_VOID) {
                /*Arrays of those two types are invalid.*/
-               mono_class_set_failure (klass, MONO_EXCEPTION_INVALID_PROGRAM, NULL);
+               MonoError prepared_error;
+               mono_error_init (&prepared_error);
+               mono_error_set_invalid_program (&prepared_error, "Arrays of void or System.TypedReference types are invalid.");
+               mono_class_set_failure (klass, mono_error_box (&prepared_error, klass->image));
+               mono_error_cleanup (&prepared_error);
        } else if (eclass->enumtype && !mono_class_enum_basetype (eclass)) {
-               if (!eclass->ref_info_handle || eclass->wastypebuilder) {
+               guint32 ref_info_handle = mono_class_get_ref_info_handle (eclass);
+               if (!ref_info_handle || eclass->wastypebuilder) {
                        g_warning ("Only incomplete TypeBuilder objects are allowed to be an enum without base_type");
-                       g_assert (eclass->ref_info_handle && !eclass->wastypebuilder);
+                       g_assert (ref_info_handle && !eclass->wastypebuilder);
                }
                /* element_size -1 is ok as this is not an instantitable type*/
                klass->sizes.element_size = -1;
@@ -6734,12 +6784,12 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
 
        mono_class_setup_supertypes (klass);
 
-       if (eclass->generic_class)
+       if (mono_class_is_ginst (eclass))
                mono_class_init (eclass);
        if (!eclass->size_inited)
                mono_class_setup_fields (eclass);
-       if (mono_class_has_failure (eclass)) /*FIXME we fail the array type, but we have to let other fields be set.*/
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+       mono_class_set_type_load_failure_causedby_class (klass, eclass, "Could not load array element type");
+       /*FIXME we fail the array type, but we have to let other fields be set.*/
 
        klass->has_references = MONO_TYPE_IS_REFERENCE (&eclass->byval_arg) || eclass->has_references? TRUE: FALSE;
 
@@ -6790,11 +6840,9 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
        }
        klass->this_arg = klass->byval_arg;
        klass->this_arg.byref = 1;
-       if (corlib_type) {
-               klass->inited = 1;
-       }
 
-       klass->generic_container = eclass->generic_container;
+       //WTF was this? it's wrong
+       // klass->generic_container = eclass->generic_container;
 
        if (rank == 1 && !bounded) {
                MonoClass *prev_class;
@@ -6856,7 +6904,7 @@ mono_class_instance_size (MonoClass *klass)
  *
  * Use to get the computed minimum alignment requirements for the specified class.
  *
- * Returns: minimm alignment requirements 
+ * Returns: minimum alignment requirements
  */
 gint32
 mono_class_min_align (MonoClass *klass)
@@ -6877,7 +6925,7 @@ mono_class_min_align (MonoClass *klass)
  * Returns: the size of a value of kind @klass
  */
 gint32
-mono_class_value_size      (MonoClass *klass, guint32 *align)
+mono_class_value_size (MonoClass *klass, guint32 *align)
 {
        gint32 size;
 
@@ -6907,7 +6955,7 @@ mono_class_data_size (MonoClass *klass)
                mono_class_init (klass);
        /* This can happen with dynamically created types */
        if (!klass->fields_inited)
-               mono_class_setup_fields_locking (klass);
+               mono_class_setup_fields (klass);
 
        /* in arrays, sizes.class_size is unioned with element_size
         * and arrays have no static fields
@@ -6925,28 +6973,30 @@ mono_class_data_size (MonoClass *klass)
 static MonoClassField *
 mono_class_get_field_idx (MonoClass *klass, int idx)
 {
-       mono_class_setup_fields_locking (klass);
+       mono_class_setup_fields (klass);
        if (mono_class_has_failure (klass))
                return NULL;
 
        while (klass) {
+               int first_field_idx = mono_class_get_first_field_idx (klass);
+               int fcount = mono_class_get_field_count (klass);
                if (klass->image->uncompressed_metadata) {
                        /* 
-                        * klass->field.first points to the FieldPtr table, while idx points into the
+                        * first_field_idx points to the FieldPtr table, while idx points into the
                         * Field table, so we have to do a search.
                         */
                        /*FIXME this is broken for types with multiple fields with the same name.*/
                        const char *name = mono_metadata_string_heap (klass->image, mono_metadata_decode_row_col (&klass->image->tables [MONO_TABLE_FIELD], idx, MONO_FIELD_NAME));
                        int i;
 
-                       for (i = 0; i < klass->field.count; ++i)
+                       for (i = 0; i < fcount; ++i)
                                if (mono_field_get_name (&klass->fields [i]) == name)
                                        return &klass->fields [i];
                        g_assert_not_reached ();
                } else {                        
-                       if (klass->field.count) {
-                               if ((idx >= klass->field.first) && (idx < klass->field.first + klass->field.count)){
-                                       return &klass->fields [idx - klass->field.first];
+                       if (fcount) {
+                               if ((idx >= first_field_idx) && (idx < first_field_idx + fcount)){
+                                       return &klass->fields [idx - first_field_idx];
                                }
                        }
                }
@@ -7007,12 +7057,13 @@ mono_class_get_field_from_name_full (MonoClass *klass, const char *name, MonoTyp
 {
        int i;
 
-       mono_class_setup_fields_locking (klass);
+       mono_class_setup_fields (klass);
        if (mono_class_has_failure (klass))
                return NULL;
 
        while (klass) {
-               for (i = 0; i < klass->field.count; ++i) {
+               int fcount = mono_class_get_field_count (klass);
+               for (i = 0; i < fcount; ++i) {
                        MonoClassField *field = &klass->fields [i];
 
                        if (strcmp (name, mono_field_get_name (field)) != 0)
@@ -7045,14 +7096,16 @@ mono_class_get_field_token (MonoClassField *field)
        MonoClass *klass = field->parent;
        int i;
 
-       mono_class_setup_fields_locking (klass);
+       mono_class_setup_fields (klass);
 
        while (klass) {
                if (!klass->fields)
                        return 0;
-               for (i = 0; i < klass->field.count; ++i) {
+               int first_field_idx = mono_class_get_first_field_idx (klass);
+               int fcount = mono_class_get_field_count (klass);
+               for (i = 0; i < fcount; ++i) {
                        if (&klass->fields [i] == field) {
-                               int idx = klass->field.first + i + 1;
+                               int idx = first_field_idx + i + 1;
 
                                if (klass->image->uncompressed_metadata)
                                        idx = mono_metadata_translate_token_index (klass->image, MONO_TABLE_FIELD, idx);
@@ -7070,8 +7123,7 @@ static int
 mono_field_get_index (MonoClassField *field)
 {
        int index = field - field->parent->fields;
-
-       g_assert (index >= 0 && index < field->parent->field.count);
+       g_assert (index >= 0 && index < mono_class_get_field_count (field->parent));
 
        return index;
 }
@@ -7091,23 +7143,25 @@ mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_typ
 
        g_assert (field->type->attrs & FIELD_ATTRIBUTE_HAS_DEFAULT);
 
-       if (!klass->ext || !klass->ext->field_def_values) {
+       MonoClassExt *ext = mono_class_get_ext (klass);
+       if (!ext || !ext->field_def_values) {
                MonoFieldDefaultValue *def_values;
 
                mono_class_alloc_ext (klass);
+               ext = mono_class_get_ext (klass);
 
-               def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count);
+               def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * mono_class_get_field_count (klass));
 
                mono_image_lock (klass->image);
                mono_memory_barrier ();
-               if (!klass->ext->field_def_values)
-                       klass->ext->field_def_values = def_values;
+               if (!ext->field_def_values)
+                       ext->field_def_values = def_values;
                mono_image_unlock (klass->image);
        }
 
        field_index = mono_field_get_index (field);
                
-       if (!klass->ext->field_def_values [field_index].data) {
+       if (!ext->field_def_values [field_index].data) {
                cindex = mono_metadata_get_constant_index (field->parent->image, mono_class_get_field_token (field), 0);
                if (!cindex)
                        return NULL;
@@ -7115,20 +7169,21 @@ mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_typ
                g_assert (!(field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA));
 
                mono_metadata_decode_row (&field->parent->image->tables [MONO_TABLE_CONSTANT], cindex - 1, constant_cols, MONO_CONSTANT_SIZE);
-               klass->ext->field_def_values [field_index].def_type = (MonoTypeEnum)constant_cols [MONO_CONSTANT_TYPE];
-               klass->ext->field_def_values [field_index].data = (const char *)mono_metadata_blob_heap (field->parent->image, constant_cols [MONO_CONSTANT_VALUE]);
+               ext->field_def_values [field_index].def_type = (MonoTypeEnum)constant_cols [MONO_CONSTANT_TYPE];
+               ext->field_def_values [field_index].data = (const char *)mono_metadata_blob_heap (field->parent->image, constant_cols [MONO_CONSTANT_VALUE]);
        }
 
-       *def_type = klass->ext->field_def_values [field_index].def_type;
-       return klass->ext->field_def_values [field_index].data;
+       *def_type = ext->field_def_values [field_index].def_type;
+       return ext->field_def_values [field_index].data;
 }
 
 static int
 mono_property_get_index (MonoProperty *prop)
 {
-       int index = prop - prop->parent->ext->properties;
+       MonoClassExt *ext = mono_class_get_ext (prop->parent);
+       int index = prop - ext->properties;
 
-       g_assert (index >= 0 && index < prop->parent->ext->property.count);
+       g_assert (index >= 0 && index < ext->property.count);
 
        return index;
 }
@@ -7153,10 +7208,11 @@ mono_class_get_property_default_value (MonoProperty *property, MonoTypeEnum *def
         */
 
        if (image_is_dynamic (klass->image)) {
+               MonoClassExt *ext = mono_class_get_ext (klass);
                int prop_index = mono_property_get_index (property);
-               if (klass->ext->prop_def_values && klass->ext->prop_def_values [prop_index].data) {
-                       *def_type = klass->ext->prop_def_values [prop_index].def_type;
-                       return klass->ext->prop_def_values [prop_index].data;
+               if (ext->prop_def_values && ext->prop_def_values [prop_index].data) {
+                       *def_type = ext->prop_def_values [prop_index].def_type;
+                       return ext->prop_def_values [prop_index].data;
                }
                return NULL;
        }
@@ -7176,10 +7232,11 @@ mono_class_get_event_token (MonoEvent *event)
        int i;
 
        while (klass) {
-               if (klass->ext) {
-                       for (i = 0; i < klass->ext->event.count; ++i) {
-                               if (&klass->ext->events [i] == event)
-                                       return mono_metadata_make_token (MONO_TABLE_EVENT, klass->ext->event.first + i + 1);
+               MonoClassExt *ext = mono_class_get_ext (klass);
+               if (ext) {
+                       for (i = 0; i < ext->event.count; ++i) {
+                               if (&ext->events [i] == event)
+                                       return mono_metadata_make_token (MONO_TABLE_EVENT, ext->event.first + i + 1);
                        }
                }
                klass = klass->parent;
@@ -7227,9 +7284,10 @@ mono_class_get_property_token (MonoProperty *prop)
                MonoProperty* p;
                int i = 0;
                gpointer iter = NULL;
+               MonoClassExt *ext = mono_class_get_ext (klass);
                while ((p = mono_class_get_properties (klass, &iter))) {
-                       if (&klass->ext->properties [i] == prop)
-                               return mono_metadata_make_token (MONO_TABLE_PROPERTY, klass->ext->property.first + i + 1);
+                       if (&ext->properties [i] == prop)
+                               return mono_metadata_make_token (MONO_TABLE_PROPERTY, ext->property.first + i + 1);
                        
                        i ++;
                }
@@ -8096,10 +8154,10 @@ mono_class_has_variant_generic_params (MonoClass *klass)
        int i;
        MonoGenericContainer *container;
 
-       if (!klass->generic_class)
+       if (!mono_class_is_ginst (klass))
                return FALSE;
 
-       container = klass->generic_class->container_class->generic_container;
+       container = mono_class_get_generic_container (mono_class_get_generic_class (klass)->container_class);
 
        for (i = 0; i < container->type_argc; ++i)
                if (mono_generic_container_get_param_info (container, i)->flags & (MONO_GEN_PARAM_VARIANT|MONO_GEN_PARAM_COVARIANT))
@@ -8143,7 +8201,7 @@ mono_class_is_variant_compatible (MonoClass *klass, MonoClass *oklass, gboolean
        int j;
        MonoType **klass_argv, **oklass_argv;
        MonoClass *klass_gtd = mono_class_get_generic_type_definition (klass);
-       MonoGenericContainer *container = klass_gtd->generic_container;
+       MonoGenericContainer *container = mono_class_get_generic_container (klass_gtd);
 
        if (klass == oklass)
                return TRUE;
@@ -8152,8 +8210,8 @@ mono_class_is_variant_compatible (MonoClass *klass, MonoClass *oklass, gboolean
        if (mono_class_get_generic_type_definition (oklass) != klass_gtd || oklass == klass_gtd)
                return FALSE;
 
-       klass_argv = &klass->generic_class->context.class_inst->type_argv [0];
-       oklass_argv = &oklass->generic_class->context.class_inst->type_argv [0];
+       klass_argv = &mono_class_get_generic_class (klass)->context.class_inst->type_argv [0];
+       oklass_argv = &mono_class_get_generic_class (oklass)->context.class_inst->type_argv [0];
 
        for (j = 0; j < container->type_argc; ++j) {
                MonoClass *param1_class = mono_class_from_mono_type (klass_argv [j]);
@@ -8326,7 +8384,7 @@ mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass)
                }
 
                /* interface_offsets might not be set for dynamic classes */
-               if (oklass->ref_info_handle && !oklass->interface_bitmap) {
+               if (mono_class_get_ref_info_handle (oklass) && !oklass->interface_bitmap) {
                        /* 
                         * oklass might be a generic type parameter but they have 
                         * interface_offsets set.
@@ -8408,14 +8466,14 @@ mono_class_is_variant_compatible_slow (MonoClass *klass, MonoClass *oklass)
        int j;
        MonoType **klass_argv, **oklass_argv;
        MonoClass *klass_gtd = mono_class_get_generic_type_definition (klass);
-       MonoGenericContainer *container = klass_gtd->generic_container;
+       MonoGenericContainer *container = mono_class_get_generic_container (klass_gtd);
 
        /*Viable candidates are instances of the same generic interface*/
        if (mono_class_get_generic_type_definition (oklass) != klass_gtd || oklass == klass_gtd)
                return FALSE;
 
-       klass_argv = &klass->generic_class->context.class_inst->type_argv [0];
-       oklass_argv = &oklass->generic_class->context.class_inst->type_argv [0];
+       klass_argv = &mono_class_get_generic_class (klass)->context.class_inst->type_argv [0];
+       oklass_argv = &mono_class_get_generic_class (oklass)->context.class_inst->type_argv [0];
 
        for (j = 0; j < container->type_argc; ++j) {
                MonoClass *param1_class = mono_class_from_mono_type (klass_argv [j]);
@@ -8592,8 +8650,8 @@ mono_class_get_cctor (MonoClass *klass)
                return result;
        }
 
-       if (klass->generic_class && !klass->methods)
-               return mono_class_get_inflated_method (klass, mono_class_get_cctor (klass->generic_class->container_class));
+       if (mono_class_is_ginst (klass) && !klass->methods)
+               return mono_class_get_inflated_method (klass, mono_class_get_cctor (mono_class_get_generic_class (klass)->container_class));
 
        return mono_class_get_method_from_name_flags (klass, ".cctor", -1, METHOD_ATTRIBUTE_SPECIAL_NAME);
 }
@@ -8974,22 +9032,6 @@ mono_class_get_rank (MonoClass *klass)
        return klass->rank;
 }
 
-/**
- * mono_class_get_flags:
- * @klass: the MonoClass to act on
- *
- * The type flags from the TypeDef table from the metadata.
- * see the TYPE_ATTRIBUTE_* definitions on tabledefs.h for the
- * different values.
- *
- * Returns: The flags from the TypeDef table.
- */
-guint32
-mono_class_get_flags (MonoClass *klass)
-{
-       return klass->flags;
-}
-
 /**
  * mono_class_get_name
  * @klass: the MonoClass to act on
@@ -9063,7 +9105,7 @@ mono_class_get_byref_type (MonoClass *klass)
 int
 mono_class_num_fields (MonoClass *klass)
 {
-       return klass->field.count;
+       return mono_class_get_field_count (klass);
 }
 
 /**
@@ -9075,7 +9117,7 @@ mono_class_num_fields (MonoClass *klass)
 int
 mono_class_num_methods (MonoClass *klass)
 {
-       return klass->method.count;
+       return mono_class_get_method_count (klass);
 }
 
 /**
@@ -9089,7 +9131,7 @@ mono_class_num_properties (MonoClass *klass)
 {
        mono_class_setup_properties (klass);
 
-       return klass->ext->property.count;
+       return mono_class_get_ext (klass)->property.count;
 }
 
 /**
@@ -9103,7 +9145,7 @@ mono_class_num_events (MonoClass *klass)
 {
        mono_class_setup_events (klass);
 
-       return klass->ext->event.count;
+       return mono_class_get_ext (klass)->event.count;
 }
 
 /**
@@ -9125,11 +9167,11 @@ mono_class_get_fields (MonoClass* klass, gpointer *iter)
        if (!iter)
                return NULL;
        if (!*iter) {
-               mono_class_setup_fields_locking (klass);
+               mono_class_setup_fields (klass);
                if (mono_class_has_failure (klass))
                        return NULL;
                /* start from the first */
-               if (klass->field.count) {
+               if (mono_class_get_field_count (klass)) {
                        *iter = &klass->fields [0];
                        return &klass->fields [0];
                } else {
@@ -9139,7 +9181,7 @@ mono_class_get_fields (MonoClass* klass, gpointer *iter)
        }
        field = (MonoClassField *)*iter;
        field++;
-       if (field < &klass->fields [klass->field.count]) {
+       if (field < &klass->fields [mono_class_get_field_count (klass)]) {
                *iter = field;
                return field;
        }
@@ -9174,7 +9216,7 @@ mono_class_get_methods (MonoClass* klass, gpointer *iter)
                if (!klass->methods)
                        return NULL;
                /* start from the first */
-               if (klass->method.count) {
+               if (mono_class_get_method_count (klass)) {
                        *iter = &klass->methods [0];
                        return klass->methods [0];
                } else {
@@ -9184,7 +9226,7 @@ mono_class_get_methods (MonoClass* klass, gpointer *iter)
        }
        method = (MonoMethod **)*iter;
        method++;
-       if (method < &klass->methods [klass->method.count]) {
+       if (method < &klass->methods [mono_class_get_method_count (klass)]) {
                *iter = method;
                return *method;
        }
@@ -9219,12 +9261,13 @@ mono_class_get_virtual_methods (MonoClass* klass, gpointer *iter)
                        method = (MonoMethod **)*iter;
                        method++;
                }
-               while (method < &klass->methods [klass->method.count]) {
+               int mcount = mono_class_get_method_count (klass);
+               while (method < &klass->methods [mcount]) {
                        if (*method && ((*method)->flags & METHOD_ATTRIBUTE_VIRTUAL))
                                break;
                        method ++;
                }
-               if (method < &klass->methods [klass->method.count]) {
+               if (method < &klass->methods [mcount]) {
                        *iter = method;
                        return *method;
                } else {
@@ -9241,19 +9284,21 @@ mono_class_get_virtual_methods (MonoClass* klass, gpointer *iter)
                        start_index = GPOINTER_TO_UINT (*iter);
                }
 
-               for (i = start_index; i < klass->method.count; ++i) {
+               int first_idx = mono_class_get_first_method_idx (klass);
+               int mcount = mono_class_get_method_count (klass);
+               for (i = start_index; i < mcount; ++i) {
                        guint32 flags;
 
-                       /* klass->method.first points into the methodptr table */
-                       flags = mono_metadata_decode_table_row_col (klass->image, MONO_TABLE_METHOD, klass->method.first + i, MONO_METHOD_FLAGS);
+                       /* first_idx points into the methodptr table */
+                       flags = mono_metadata_decode_table_row_col (klass->image, MONO_TABLE_METHOD, first_idx + i, MONO_METHOD_FLAGS);
 
                        if (flags & METHOD_ATTRIBUTE_VIRTUAL)
                                break;
                }
 
-               if (i < klass->method.count) {
+               if (i < mcount) {
                        MonoError error;
-                       res = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | (klass->method.first + i + 1), klass, NULL, &error);
+                       res = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | (first_idx + i + 1), klass, NULL, &error);
                        mono_error_cleanup (&error); /* FIXME don't swallow the error */
 
                        /* Add 1 here so the if (*iter) check fails */
@@ -9285,9 +9330,10 @@ mono_class_get_properties (MonoClass* klass, gpointer *iter)
                return NULL;
        if (!*iter) {
                mono_class_setup_properties (klass);
+               MonoClassExt *ext = mono_class_get_ext (klass);
                /* start from the first */
-               if (klass->ext->property.count) {
-                       *iter = &klass->ext->properties [0];
+               if (ext->property.count) {
+                       *iter = &ext->properties [0];
                        return (MonoProperty *)*iter;
                } else {
                        /* no fields */
@@ -9296,7 +9342,8 @@ mono_class_get_properties (MonoClass* klass, gpointer *iter)
        }
        property = (MonoProperty *)*iter;
        property++;
-       if (property < &klass->ext->properties [klass->ext->property.count]) {
+       MonoClassExt *ext = mono_class_get_ext (klass);
+       if (property < &ext->properties [ext->property.count]) {
                *iter = property;
                return (MonoProperty *)*iter;
        }
@@ -9323,9 +9370,10 @@ mono_class_get_events (MonoClass* klass, gpointer *iter)
                return NULL;
        if (!*iter) {
                mono_class_setup_events (klass);
+               MonoClassExt *ext = mono_class_get_ext (klass);
                /* start from the first */
-               if (klass->ext->event.count) {
-                       *iter = &klass->ext->events [0];
+               if (ext->event.count) {
+                       *iter = &ext->events [0];
                        return (MonoEvent *)*iter;
                } else {
                        /* no fields */
@@ -9334,7 +9382,8 @@ mono_class_get_events (MonoClass* klass, gpointer *iter)
        }
        event = (MonoEvent *)*iter;
        event++;
-       if (event < &klass->ext->events [klass->ext->event.count]) {
+       MonoClassExt *ext = mono_class_get_ext (klass);
+       if (event < &ext->events [ext->event.count]) {
                *iter = event;
                return (MonoEvent *)*iter;
        }
@@ -9432,7 +9481,7 @@ setup_nested_types (MonoClass *klass)
 
        mono_memory_barrier ();
        if (!klass->nested_classes_inited) {
-               klass->ext->nested_classes = nested_classes;
+               mono_class_get_ext (klass)->nested_classes = nested_classes;
                mono_memory_barrier ();
                klass->nested_classes_inited = TRUE;
        }
@@ -9464,10 +9513,11 @@ mono_class_get_nested_types (MonoClass* klass, gpointer *iter)
                setup_nested_types (klass);
 
        if (!*iter) {
+               MonoClassExt *ext = mono_class_get_ext (klass);
                /* start from the first */
-               if (klass->ext && klass->ext->nested_classes) {
-                       *iter = klass->ext->nested_classes;
-                       return (MonoClass *)klass->ext->nested_classes->data;
+               if (ext && ext->nested_classes) {
+                       *iter = ext->nested_classes;
+                       return (MonoClass *)ext->nested_classes->data;
                } else {
                        /* no nested types */
                        return NULL;
@@ -9606,27 +9656,30 @@ mono_field_get_rva (MonoClassField *field)
 
        g_assert (field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA);
 
-       if (!klass->ext || !klass->ext->field_def_values) {
+       MonoClassExt *ext = mono_class_get_ext (klass);
+       if (!ext || !ext->field_def_values) {
                mono_class_alloc_ext (klass);
+               ext = mono_class_get_ext (klass);
 
-               field_def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count);
+               field_def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * mono_class_get_field_count (klass));
 
                mono_image_lock (klass->image);
-               if (!klass->ext->field_def_values)
-                       klass->ext->field_def_values = field_def_values;
+               if (!ext->field_def_values)
+                       ext->field_def_values = field_def_values;
                mono_image_unlock (klass->image);
        }
 
        field_index = mono_field_get_index (field);
                
-       if (!klass->ext->field_def_values [field_index].data && !image_is_dynamic (klass->image)) {
-               mono_metadata_field_info (field->parent->image, klass->field.first + field_index, NULL, &rva, NULL);
+       if (!ext->field_def_values [field_index].data && !image_is_dynamic (klass->image)) {
+               int first_field_idx = mono_class_get_first_field_idx (klass);
+               mono_metadata_field_info (field->parent->image, first_field_idx + field_index, NULL, &rva, NULL);
                if (!rva)
                        g_warning ("field %s in %s should have RVA data, but hasn't", mono_field_get_name (field), field->parent->name);
-               klass->ext->field_def_values [field_index].data = mono_image_rva_map (field->parent->image, rva);
+               ext->field_def_values [field_index].data = mono_image_rva_map (field->parent->image, rva);
        }
 
-       return klass->ext->field_def_values [field_index].data;
+       return ext->field_def_values [field_index].data;
 }
 
 /**
@@ -9810,17 +9863,19 @@ find_method_in_metadata (MonoClass *klass, const char *name, int param_count, in
        int i;
 
        /* Search directly in the metadata to avoid calling setup_methods () */
-       for (i = 0; i < klass->method.count; ++i) {
+       int first_idx = mono_class_get_first_method_idx (klass);
+       int mcount = mono_class_get_method_count (klass);
+       for (i = 0; i < mcount; ++i) {
                MonoError error;
                guint32 cols [MONO_METHOD_SIZE];
                MonoMethod *method;
                MonoMethodSignature *sig;
 
-               /* klass->method.first points into the methodptr table */
-               mono_metadata_decode_table_row (klass->image, MONO_TABLE_METHOD, klass->method.first + i, cols, MONO_METHOD_SIZE);
+               /* first_idx points into the methodptr table */
+               mono_metadata_decode_table_row (klass->image, MONO_TABLE_METHOD, first_idx + i, cols, MONO_METHOD_SIZE);
 
                if (!strcmp (mono_metadata_string_heap (klass->image, cols [MONO_METHOD_NAME]), name)) {
-                       method = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | (klass->method.first + i + 1), klass, NULL, &error);
+                       method = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | (first_idx + i + 1), klass, NULL, &error);
                        if (!method) {
                                mono_error_cleanup (&error); /* FIXME don't swallow the error */
                                continue;
@@ -9862,8 +9917,8 @@ mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int p
 
        mono_class_init (klass);
 
-       if (klass->generic_class && !klass->methods) {
-               res = mono_class_get_method_from_name_flags (klass->generic_class->container_class, name, param_count, flags);
+       if (mono_class_is_ginst (klass) && !klass->methods) {
+               res = mono_class_get_method_from_name_flags (mono_class_get_generic_class (klass)->container_class, name, param_count, flags);
                if (res) {
                        MonoError error;
                        res = mono_class_inflate_generic_method_full_checked (res, klass, mono_class_get_context (klass), &error);
@@ -9882,7 +9937,8 @@ mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int p
                 */
                if (!klass->methods)
                        return NULL;
-               for (i = 0; i < klass->method.count; ++i) {
+               int mcount = mono_class_get_method_count (klass);
+               for (i = 0; i < mcount; ++i) {
                        MonoMethod *method = klass->methods [i];
 
                        if (method->name[0] == name [0] && 
@@ -9912,21 +9968,63 @@ mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int p
  *
  * LOCKING: Acquires the loader lock.
  */
-gboolean
-mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data)
+static gboolean
+mono_class_set_failure (MonoClass *klass, MonoErrorBoxed *boxed_error)
 {
+       g_assert (boxed_error != NULL);
+
        if (mono_class_has_failure (klass))
                return FALSE;
 
        mono_loader_lock ();
-       klass->exception_type = ex_type;
-       if (ex_data)
-               mono_image_property_insert (klass->image, klass, MONO_CLASS_PROP_EXCEPTION_DATA, ex_data);
+       klass->has_failure = 1;
+       mono_image_property_insert (klass->image, klass, MONO_CLASS_PROP_EXCEPTION_DATA, boxed_error);
        mono_loader_unlock ();
 
        return TRUE;
 }
 
+gboolean
+mono_class_has_failure (const MonoClass *klass)
+{
+       g_assert (klass != NULL);
+       return klass->has_failure != 0;
+}
+
+
+/**
+ * mono_class_set_type_load_failure:
+ * @klass: class in which the failure was detected
+ * @fmt: Printf-style error message string.
+ *
+ * Collect detected failure informaion in the class for later processing.
+ * The error is stored as a MonoErrorBoxed as with mono_error_set_type_load_class ()
+ * Note that only the first failure is kept.
+ *
+ * Returns FALSE if a failure was already set on the class, or TRUE otherwise.
+ *
+ * LOCKING: Acquires the loader lock.
+ */
+gboolean
+mono_class_set_type_load_failure (MonoClass *klass, const char * fmt, ...)
+{
+       MonoError prepare_error;
+       va_list args;
+
+       if (mono_class_has_failure (klass))
+               return FALSE;
+       
+       mono_error_init (&prepare_error);
+       
+       va_start (args, fmt);
+       mono_error_vset_type_load_class (&prepare_error, klass, fmt, args);
+       va_end (args);
+
+       MonoErrorBoxed *box = mono_error_box (&prepare_error, klass->image);
+       mono_error_cleanup (&prepare_error);
+       return mono_class_set_failure (klass, box);
+}
+
 /*
  * mono_class_get_exception_data:
  *
@@ -9934,10 +10032,10 @@ mono_class_set_failure (MonoClass *klass, guint32 ex_type, void *ex_data)
  *
  * LOCKING: Acquires the loader lock.
  */
-gpointer
-mono_class_get_exception_data (MonoClass *klass)
+static gpointer
+mono_class_get_exception_data (const MonoClass *klass)
 {
-       return mono_image_property_lookup (klass->image, klass, MONO_CLASS_PROP_EXCEPTION_DATA);
+       return mono_image_property_lookup (klass->image, (MonoClass*)klass, MONO_CLASS_PROP_EXCEPTION_DATA);
 }
 
 /**
@@ -9950,16 +10048,32 @@ mono_classes_init (void)
 {
        mono_os_mutex_init (&classes_mutex);
 
+       mono_native_tls_alloc (&setup_fields_tls_id, NULL);
+       mono_native_tls_alloc (&init_pending_tls_id, NULL);
+
+       mono_counters_register ("MonoClassDef count",
+                                                       MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_def_count);
+       mono_counters_register ("MonoClassGtd count",
+                                                       MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_gtd_count);
+       mono_counters_register ("MonoClassGenericInst count",
+                                                       MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_ginst_count);
+       mono_counters_register ("MonoClassGenericParam count",
+                                                       MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_gparam_count);
+       mono_counters_register ("MonoClassArray count",
+                                                       MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_array_count);
+       mono_counters_register ("MonoClassPointer count",
+                                                       MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_pointer_count);
        mono_counters_register ("Inflated methods size",
                                                        MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &inflated_methods_size);
-       mono_counters_register ("Inflated classes",
-                                                       MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &inflated_classes);
        mono_counters_register ("Inflated classes size",
                                                        MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &inflated_classes_size);
        mono_counters_register ("MonoClass size",
                                                        MONO_COUNTER_METADATA | MONO_COUNTER_INT, &classes_size);
        mono_counters_register ("MonoClassExt size",
                                                        MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_ext_size);
+
+       mono_counters_register ("MonoClassExt count",
+                                                       MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_ext_count);
 }
 
 /**
@@ -9970,6 +10084,9 @@ mono_classes_init (void)
 void
 mono_classes_cleanup (void)
 {
+       mono_native_tls_free (setup_fields_tls_id);
+       mono_native_tls_free (init_pending_tls_id);
+
        if (global_interface_bitset)
                mono_bitset_free (global_interface_bitset);
        global_interface_bitset = NULL;
@@ -9987,55 +10104,12 @@ mono_classes_cleanup (void)
 MonoException*
 mono_class_get_exception_for_failure (MonoClass *klass)
 {
-       gpointer exception_data = mono_class_get_exception_data (klass);
-
-       switch (mono_class_get_failure(klass)) {
-       case MONO_EXCEPTION_TYPE_LOAD: {
-               MonoString *name;
-               MonoException *ex;
-               char *str = mono_type_get_full_name (klass);
-               char *astr = klass->image->assembly? mono_stringify_assembly_name (&klass->image->assembly->aname): NULL;
-               name = mono_string_new (mono_domain_get (), str);
-               g_free (str);
-               ex = mono_get_exception_type_load (name, astr);
-               g_free (astr);
-               return ex;
-       }
-       case MONO_EXCEPTION_MISSING_METHOD: {
-               char *class_name = (char *)exception_data;
-               char *assembly_name = class_name + strlen (class_name) + 1;
-
-               return mono_get_exception_missing_method (class_name, assembly_name);
-       }
-       case MONO_EXCEPTION_MISSING_FIELD: {
-               char *class_name = (char *)exception_data;
-               char *member_name = class_name + strlen (class_name) + 1;
-
-               return mono_get_exception_missing_field (class_name, member_name);
-       }
-       case MONO_EXCEPTION_FILE_NOT_FOUND: {
-               char *msg_format = (char *)exception_data;
-               char *assembly_name = msg_format + strlen (msg_format) + 1;
-               char *msg = g_strdup_printf (msg_format, assembly_name);
-               MonoException *ex;
-
-               ex = mono_get_exception_file_not_found2 (msg, mono_string_new (mono_domain_get (), assembly_name));
-
-               g_free (msg);
-
-               return ex;
-       }
-       case MONO_EXCEPTION_BAD_IMAGE: {
-               return mono_get_exception_bad_image_format ((const char *)exception_data);
-       }
-       case MONO_EXCEPTION_INVALID_PROGRAM: {
-               return mono_exception_from_name_msg (mono_defaults.corlib, "System", "InvalidProgramException", "");
-       }
-       default: {
-               /* TODO - handle other class related failures */
-               return mono_get_exception_execution_engine ("Unknown class failure");
-       }
-       }
+       if (!mono_class_has_failure (klass))
+               return NULL;
+       MonoError unboxed_error;
+       mono_error_init (&unboxed_error);
+       mono_error_set_for_class_failure (&unboxed_error, klass);
+       return mono_error_convert_to_exception (&unboxed_error);
 }
 
 static gboolean
@@ -10054,7 +10128,8 @@ is_nesting_type (MonoClass *outer_klass, MonoClass *inner_klass)
 MonoClass *
 mono_class_get_generic_type_definition (MonoClass *klass)
 {
-       return klass->generic_class ? klass->generic_class->container_class : klass;
+       MonoGenericClass *gklass =  mono_class_try_get_generic_class (klass);
+       return gklass ? gklass->container_class : klass;
 }
 
 /*
@@ -10151,8 +10226,9 @@ static MonoClass*
 get_generic_definition_class (MonoClass *klass)
 {
        while (klass) {
-               if (klass->generic_class && klass->generic_class->container_class)
-                       return klass->generic_class->container_class;
+               MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
+               if (gklass && gklass->container_class)
+                       return gklass->container_class;
                klass = klass->parent;
        }
        return NULL;
@@ -10206,12 +10282,12 @@ can_access_type (MonoClass *access_klass, MonoClass *member_klass)
        if (member_klass->element_class && !member_klass->enumtype)
                member_klass = member_klass->element_class;
 
-       access_level = member_klass->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK;
+       access_level = mono_class_get_flags (member_klass) & TYPE_ATTRIBUTE_VISIBILITY_MASK;
 
        if (member_klass->byval_arg.type == MONO_TYPE_VAR || member_klass->byval_arg.type == MONO_TYPE_MVAR)
                return TRUE;
 
-       if (member_klass->generic_class && !can_access_instantiation (access_klass, member_klass->generic_class->context.class_inst))
+       if (mono_class_is_ginst (member_klass) && !can_access_instantiation (access_klass, mono_class_get_generic_class (member_klass)->context.class_inst))
                return FALSE;
 
        if (is_nesting_type (access_klass, member_klass) || (access_klass->nested_in && is_nesting_type (access_klass->nested_in, member_klass)))
@@ -10262,15 +10338,16 @@ can_access_member (MonoClass *access_klass, MonoClass *member_klass, MonoClass*
        if (access_klass->image->assembly && access_klass->image->assembly->corlib_internal)
                return TRUE;
 
-       if (((access_klass->generic_class && access_klass->generic_class->container_class) ||
-                                       access_klass->generic_container) && 
+       MonoGenericClass *access_gklass = mono_class_try_get_generic_class (access_klass);
+       if (((access_gklass && access_gklass->container_class) ||
+                                       mono_class_is_gtd (access_klass)) && 
                        (member_generic_def = get_generic_definition_class (member_klass))) {
                MonoClass *access_container;
 
-               if (access_klass->generic_container)
+               if (mono_class_is_gtd (access_klass))
                        access_container = access_klass;
                else
-                       access_container = access_klass->generic_class->container_class;
+                       access_container = access_gklass->container_class;
 
                if (can_access_member (access_container, member_generic_def, context_klass, access_level))
                        return TRUE;
@@ -10508,7 +10585,9 @@ gboolean mono_type_is_valid_enum_basetype (MonoType * type) {
  * FIXME: enum types are not allowed to have a cctor, but mono_reflection_create_runtime_class sets has_cctor to 1 for all types
  * FIXME: TypeBuilder enums can have any kind of static fields, but the spec is very explicit about that (P II 14.3)
  */
-gboolean mono_class_is_valid_enum (MonoClass *klass) {
+gboolean
+mono_class_is_valid_enum (MonoClass *klass)
+{
        MonoClassField * field;
        gpointer iter = NULL;
        gboolean found_base_field = FALSE;
@@ -10519,7 +10598,7 @@ gboolean mono_class_is_valid_enum (MonoClass *klass) {
                return FALSE;
        }
 
-       if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) != TYPE_ATTRIBUTE_AUTO_LAYOUT)
+       if (!mono_class_is_auto_layout (klass))
                return FALSE;
 
        while ((field = mono_class_get_fields (klass, &iter))) {
@@ -10535,7 +10614,7 @@ gboolean mono_class_is_valid_enum (MonoClass *klass) {
        if (!found_base_field)
                return FALSE;
 
-       if (klass->method.count > 0) 
+       if (mono_class_get_method_count (klass) > 0)
                return FALSE;
 
        return TRUE;
@@ -10544,7 +10623,7 @@ gboolean mono_class_is_valid_enum (MonoClass *klass) {
 gboolean
 mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass)
 {
-       return gklass->context.class_inst == gklass->container_class->generic_container->context.class_inst;
+       return gklass->context.class_inst == mono_class_get_generic_container (gklass->container_class)->context.class_inst;
 }
 
 /*
@@ -10573,15 +10652,16 @@ mono_class_alloc_ext (MonoClass *klass)
 {
        MonoClassExt *ext;
 
-       if (klass->ext)
+       if (mono_class_get_ext (klass))
                return;
 
        ext = (MonoClassExt *)mono_class_alloc0 (klass, sizeof (MonoClassExt));
        mono_image_lock (klass->image);
        mono_memory_barrier ();
-       if (!klass->ext)
-               klass->ext = ext;
+       if (!mono_class_get_ext (klass))
+               mono_class_set_ext (klass, ext);
        class_ext_size += sizeof (MonoClassExt);
+       ++class_ext_count;
        mono_image_unlock (klass->image);
 }
 
@@ -10616,21 +10696,21 @@ mono_class_setup_interfaces (MonoClass *klass, MonoError *error)
                if (interface_count > 1)
                        interfaces [1] = mono_class_bind_generic_parameters (
                           mono_defaults.generic_ireadonlylist_class, 1, args, FALSE);
-       } else if (klass->generic_class) {
-               MonoClass *gklass = klass->generic_class->container_class;
+       } else if (mono_class_is_ginst (klass)) {
+               MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
                mono_class_setup_interfaces (gklass, error);
                if (!mono_error_ok (error)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Could not setup the interfaces"));
+                       mono_class_set_type_load_failure (klass, "Could not setup the interfaces");
                        return;
                }
 
                interface_count = gklass->interface_count;
                interfaces = mono_class_new0 (klass, MonoClass *, interface_count);
                for (i = 0; i < interface_count; i++) {
-                       interfaces [i] = mono_class_inflate_generic_class_checked (gklass->interfaces [i], mono_generic_class_get_context (klass->generic_class), error);
+                       interfaces [i] = mono_class_inflate_generic_class_checked (gklass->interfaces [i], mono_generic_class_get_context (mono_class_get_generic_class (klass)), error);
                        if (!mono_error_ok (error)) {
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, "Could not setup the interfaces"));
+                               mono_class_set_type_load_failure (klass, "Could not setup the interfaces");
                                return;
                        }
                }
@@ -10658,7 +10738,8 @@ mono_field_resolve_type (MonoClassField *field, MonoError *error)
 {
        MonoClass *klass = field->parent;
        MonoImage *image = klass->image;
-       MonoClass *gtd = klass->generic_class ? mono_class_get_generic_type_definition (klass) : NULL;
+       MonoClass *gtd = mono_class_is_ginst (klass) ? mono_class_get_generic_type_definition (klass) : NULL;
+       MonoType *ftype;
        int field_idx = field - klass->fields;
 
        mono_error_init (error);
@@ -10667,37 +10748,41 @@ mono_field_resolve_type (MonoClassField *field, MonoError *error)
                MonoClassField *gfield = &gtd->fields [field_idx];
                MonoType *gtype = mono_field_get_type_checked (gfield, error);
                if (!mono_error_ok (error)) {
-                       char *err_msg = mono_image_strdup_printf (klass->image, "Could not load field %d type due to: %s", field_idx, mono_error_get_message (error));
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                       char *full_name = mono_type_get_full_name (gtd);
+                       mono_class_set_type_load_failure (klass, "Could not load generic type of field '%s:%s' (%d) due to: %s", full_name, gfield->name, field_idx, mono_error_get_message (error));
+                       g_free (full_name);
                }
 
-               field->type = mono_class_inflate_generic_type_no_copy (image, gtype, mono_class_get_context (klass), error);
+               ftype = mono_class_inflate_generic_type_no_copy (image, gtype, mono_class_get_context (klass), error);
                if (!mono_error_ok (error)) {
-                       char *err_msg = mono_image_strdup_printf (klass->image, "Could not load field %d type due to: %s", field_idx, mono_error_get_message (error));
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+                       char *full_name = mono_type_get_full_name (klass);
+                       mono_class_set_type_load_failure (klass, "Could not load instantiated type of field '%s:%s' (%d) due to: %s", full_name, field->name, field_idx, mono_error_get_message (error));
+                       g_free (full_name);
                }
        } else {
                const char *sig;
                guint32 cols [MONO_FIELD_SIZE];
                MonoGenericContainer *container = NULL;
-               int idx = klass->field.first + field_idx;
+               int idx = mono_class_get_first_field_idx (klass) + field_idx;
 
                /*FIXME, in theory we do not lazy load SRE fields*/
                g_assert (!image_is_dynamic (image));
 
-               if (klass->generic_container) {
-                       container = klass->generic_container;
+               if (mono_class_is_gtd (klass)) {
+                       container = mono_class_get_generic_container (klass);
                } else if (gtd) {
-                       container = gtd->generic_container;
+                       container = mono_class_get_generic_container (gtd);
                        g_assert (container);
                }
 
-               /* klass->field.first and idx points into the fieldptr table */
+               /* first_field_idx and idx points into the fieldptr table */
                mono_metadata_decode_table_row (image, MONO_TABLE_FIELD, idx, cols, MONO_FIELD_SIZE);
 
                if (!mono_verifier_verify_field_signature (image, cols [MONO_FIELD_SIGNATURE], NULL)) {
-                       mono_error_set_type_load_class (error, klass, "Could not verify field %s signature", field->name);;
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, mono_error_get_message (error)));
+                       char *full_name = mono_type_get_full_name (klass);
+                       mono_error_set_type_load_class (error, klass, "Could not verify field '%s:%s' signature", full_name, field->name);;
+                       mono_class_set_type_load_failure (klass, "%s", mono_error_get_message (error));
+                       g_free (full_name);
                        return;
                }
 
@@ -10707,12 +10792,15 @@ mono_field_resolve_type (MonoClassField *field, MonoError *error)
                /* FIELD signature == 0x06 */
                g_assert (*sig == 0x06);
 
-               field->type = mono_metadata_parse_type_checked (image, container, cols [MONO_FIELD_FLAGS], FALSE, sig + 1, &sig, error);
-               if (!field->type) {
-                       char *err_msg = mono_image_strdup_printf (klass->image, "Could not load field %d type due to: %s", field_idx, mono_error_get_message (error));
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
+               ftype = mono_metadata_parse_type_checked (image, container, cols [MONO_FIELD_FLAGS], FALSE, sig + 1, &sig, error);
+               if (!ftype) {
+                       char *full_name = mono_type_get_full_name (klass);
+                       mono_class_set_type_load_failure (klass, "Could not load type of field '%s:%s' (%d) due to: %s", full_name, field->name, field_idx, mono_error_get_message (error));
+                       g_free (full_name);
                }
        }
+       mono_memory_barrier ();
+       field->type = ftype;
 }
 
 static guint32
@@ -10720,7 +10808,7 @@ mono_field_resolve_flags (MonoClassField *field)
 {
        MonoClass *klass = field->parent;
        MonoImage *image = klass->image;
-       MonoClass *gtd = klass->generic_class ? mono_class_get_generic_type_definition (klass) : NULL;
+       MonoClass *gtd = mono_class_is_ginst (klass) ? mono_class_get_generic_type_definition (klass) : NULL;
        int field_idx = field - klass->fields;
 
 
@@ -10728,7 +10816,7 @@ mono_field_resolve_flags (MonoClassField *field)
                MonoClassField *gfield = &gtd->fields [field_idx];
                return mono_field_get_flags (gfield);
        } else {
-               int idx = klass->field.first + field_idx;
+               int idx = mono_class_get_first_field_idx (klass) + field_idx;
 
                /*FIXME, in theory we do not lazy load SRE fields*/
                g_assert (!image_is_dynamic (image));
@@ -10737,21 +10825,6 @@ mono_field_resolve_flags (MonoClassField *field)
        }
 }
 
-/**
- * mono_class_setup_basic_field_info:
- * @class: The class to initialize
- *
- * Initializes the klass->fields array of fields.
- * Aquires the loader lock.
- */
-static void
-mono_class_setup_basic_field_info_locking (MonoClass *klass)
-{
-       mono_loader_lock ();
-       mono_class_setup_basic_field_info (klass);
-       mono_loader_unlock ();
-}
-
 /**
  * mono_class_get_fields_lazy:
  * @klass: the MonoClass to act on
@@ -10773,11 +10846,11 @@ mono_class_get_fields_lazy (MonoClass* klass, gpointer *iter)
        if (!iter)
                return NULL;
        if (!*iter) {
-               mono_class_setup_basic_field_info_locking (klass);
+               mono_class_setup_basic_field_info (klass);
                if (!klass->fields)
                        return NULL;
                /* start from the first */
-               if (klass->field.count) {
+               if (mono_class_get_field_count (klass)) {
                        *iter = &klass->fields [0];
                        return (MonoClassField *)*iter;
                } else {
@@ -10787,7 +10860,7 @@ mono_class_get_fields_lazy (MonoClass* klass, gpointer *iter)
        }
        field = (MonoClassField *)*iter;
        field++;
-       if (field < &klass->fields [klass->field.count]) {
+       if (field < &klass->fields [mono_class_get_field_count (klass)]) {
                *iter = field;
                return (MonoClassField *)*iter;
        }
index bedd740079bfdc160e07c76ae65b67134f7af777..cf61058a3a7525b92fa2ad8c0f355db5b1289bd0 100644 (file)
 #include <string.h>
 #include <errno.h>
 
+#if defined(HOST_WIN32)
+#include <oleauto.h>
+#endif
+
 /*
 Code shared between the DISABLE_COM and !DISABLE_COM
 */
@@ -356,7 +360,8 @@ cominterop_get_method_interface (MonoMethod* method)
                                gboolean found = FALSE;
                                ic = (MonoClass *)g_ptr_array_index (ifaces, i);
                                offset = mono_class_interface_offset (method->klass, ic);
-                               for (j = 0; j < ic->method.count; ++j) {
+                               int mcount = mono_class_get_method_count (ic);
+                               for (j = 0; j < mcount; ++j) {
                                        if (method->klass->vtable [j + offset] == method) {
                                                found = TRUE;
                                                break;
@@ -396,7 +401,8 @@ cominterop_get_com_slot_for_method (MonoMethod* method)
                ic = cominterop_get_method_interface (method);
                offset = mono_class_interface_offset (method->klass, ic);
                g_assert(offset >= 0);
-               for(i = 0; i < ic->method.count; ++i) {
+               int mcount = mono_class_get_method_count (ic);
+               for(i = 0; i < mcount; ++i) {
                        if (method->klass->vtable [i + offset] == method)
                        {
                                slot = ic->methods[i]->slot;
@@ -1502,7 +1508,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_ReleaseInternal (gpointer pUnk)
 
 static gboolean cominterop_can_support_dispatch (MonoClass* klass)
 {
-       if (!(klass->flags & TYPE_ATTRIBUTE_PUBLIC) )
+       if (!mono_class_is_public (klass))
                return FALSE;
 
        if (!cominterop_com_visible (klass))
@@ -2018,7 +2024,7 @@ cominterop_get_ccw_checked (MonoObject* object, MonoClass* itf, MonoError *error
                start_slot = 7;
        }
        else {
-               method_count += iface->method.count;
+               method_count += mono_class_get_method_count (iface);
                start_slot = cominterop_get_com_slot_begin (iface);
                iface = NULL;
        }
@@ -2033,7 +2039,7 @@ cominterop_get_ccw_checked (MonoObject* object, MonoClass* itf, MonoError *error
                        memcpy (vtable+3, idispatch, sizeof (idispatch));
 
                iface = itf;
-               for (i = iface->method.count-1; i >= 0;i--) {
+               for (i = mono_class_get_method_count (iface) - 1; i >= 0; i--) {
                        int param_index = 0;
                        MonoMethodBuilder *mb;
                        MonoMarshalSpec ** mspecs;
diff --git a/mono/metadata/console-win32-internals.h b/mono/metadata/console-win32-internals.h
new file mode 100644 (file)
index 0000000..e0cd222
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_CONSOLE_WIN32_INTERNALS_H__
+#define __MONO_CONSOLE_WIN32_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#include "mono/metadata/object.h"
+#include "mono/metadata/object-internals.h"
+#include "mono/utils/mono-error.h"
+#include "mono/utils/mono-error-internals.h"
+#include <mono/metadata/console-io.h>
+
+#endif /* __MONO_CONSOLE_WIN32_INTERNALS_H__ */
+
diff --git a/mono/metadata/console-win32-uwp.c b/mono/metadata/console-win32-uwp.c
new file mode 100644 (file)
index 0000000..938ef80
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * console-win32-uwp.c: UWP console support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include "mono/metadata/console-win32-internals.h"
+
+MonoBoolean
+ves_icall_System_ConsoleDriver_Isatty (HANDLE handle)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("Console");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+MonoBoolean
+ves_icall_System_ConsoleDriver_SetEcho (MonoBoolean want_echo)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("Console");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+MonoBoolean
+ves_icall_System_ConsoleDriver_SetBreak (MonoBoolean want_break)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("Console");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+gint32
+ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("Console");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+MonoBoolean
+ves_icall_System_ConsoleDriver_TtySetup (MonoString *keypad, MonoString *teardown, MonoArray **control_chars, int **size)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("Console");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (console_win32_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
index c7c8c49017b6182ee292e7d2d9fc373621384b22..06a0244477e1afd5e3a0ba40d4fddcd4c8e56ed1 100644 (file)
@@ -41,11 +41,11 @@ mono_console_handle_async_ops (void)
 {
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 MonoBoolean
 ves_icall_System_ConsoleDriver_Isatty (HANDLE handle)
 {
        DWORD mode;
-
        return GetConsoleMode (handle, &mode) != 0;
 }
 
@@ -72,3 +72,4 @@ ves_icall_System_ConsoleDriver_TtySetup (MonoString *keypad, MonoString *teardow
 {
        return FALSE;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
diff --git a/mono/metadata/coree-internals.h b/mono/metadata/coree-internals.h
new file mode 100644 (file)
index 0000000..393ad77
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_COREE_INTERNALS_H__
+#define __MONO_COREE_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include <windows.h>
+
+BOOL STDMETHODCALLTYPE
+_CorDllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved);
+
+__int32 STDMETHODCALLTYPE
+_CorExeMain (void);
+
+void STDMETHODCALLTYPE
+CorExitProcess (int exitCode);
+
+STDAPI
+_CorValidateImage (PVOID *ImageBase, LPCWSTR FileName);
+
+STDAPI_(VOID)
+_CorImageUnloading (PVOID ImageBase);
+
+STDAPI
+CorBindToRuntimeEx (LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor,
+                   DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);
+
+STDAPI
+CorBindToRuntime (LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor,
+                 REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);
+
+HMODULE WINAPI
+MonoLoadImage (LPCWSTR FileName);
+
+void mono_coree_set_act_ctx (const char *file_name);
+#endif /* HOST_WIN32 */
+
+#endif /* __MONO_COREE_INTERNALS_H__ */
+
diff --git a/mono/metadata/coree-windows-uwp.c b/mono/metadata/coree-windows-uwp.c
new file mode 100644 (file)
index 0000000..d756607
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * coree-windows-uwp.c: UWP coree support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include "mono/metadata/coree-internals.h"
+
+BOOL STDMETHODCALLTYPE
+_CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved)
+{
+       g_unsupported_api ("_CorDllMain");
+       return FALSE;
+}
+
+__int32 STDMETHODCALLTYPE
+_CorExeMain(void)
+{
+       g_unsupported_api ("_CorExeMain");
+       ExitProcess (EXIT_FAILURE);
+}
+
+STDAPI
+_CorValidateImage(PVOID *ImageBase, LPCWSTR FileName)
+{
+       g_unsupported_api ("_CorValidateImage");
+       return E_UNEXPECTED;
+}
+
+HMODULE WINAPI
+MonoLoadImage(LPCWSTR FileName)
+{
+       g_unsupported_api ("MonoLoadImage");
+       return NULL;
+}
+
+void
+mono_coree_set_act_ctx (const char *file_name)
+{
+       g_unsupported_api ("CreateActCtx, ActivateActCtx");
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (coree_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
index 4436229376e10101b1d16f827601c72f466d2328..428fb9b989f80b6fea16ac5b54aad5cdf52cceb3 100644 (file)
@@ -12,8 +12,8 @@
 
 #ifdef HOST_WIN32
 
-#include <string.h>
 #include <glib.h>
+#include <string.h>
 #include <mono/io-layer/io-layer.h>
 #include <mono/utils/mono-path.h>
 #include "cil-coff.h"
 #include "threads.h"
 #include "environment.h"
 #include "coree.h"
+#include "coree-internals.h"
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 #include <shellapi.h>
+#endif
 
 HMODULE coree_module_handle = NULL;
 
@@ -68,6 +71,7 @@ mono_get_module_file_name (HMODULE module_handle)
 }
 
 /* Entry point called by LdrLoadDll of ntdll.dll after _CorValidateImage. */
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 BOOL STDMETHODCALLTYPE _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved)
 {
        MonoAssembly* assembly;
@@ -134,8 +138,10 @@ BOOL STDMETHODCALLTYPE _CorDllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpRes
 
        return TRUE;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 /* Called by ntdll.dll reagardless of entry point after _CorValidateImage. */
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 __int32 STDMETHODCALLTYPE _CorExeMain(void)
 {
        MonoError error;
@@ -207,6 +213,7 @@ __int32 STDMETHODCALLTYPE _CorExeMain(void)
        /* return does not terminate the process. */
        ExitProcess (mono_environment_exitcode_get ());
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 /* Called by msvcrt.dll when shutting down. */
 void STDMETHODCALLTYPE CorExitProcess(int exitCode)
@@ -223,6 +230,7 @@ void STDMETHODCALLTYPE CorExitProcess(int exitCode)
 }
 
 /* Called by ntdll.dll before _CorDllMain and _CorExeMain. */
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 STDAPI _CorValidateImage(PVOID *ImageBase, LPCWSTR FileName)
 {
        IMAGE_DOS_HEADER* DosHeader;
@@ -385,6 +393,7 @@ STDAPI _CorValidateImage(PVOID *ImageBase, LPCWSTR FileName)
 
        return STATUS_SUCCESS;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 /* Called by ntdll.dll. */
 STDAPI_(VOID) _CorImageUnloading(PVOID ImageBase)
@@ -406,6 +415,7 @@ STDAPI CorBindToRuntime(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, REFCLSID r
        return CorBindToRuntimeEx (pwszVersion, pwszBuildFlavor, 0, rclsid, riid, ppv);
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 HMODULE WINAPI MonoLoadImage(LPCWSTR FileName)
 {
        HANDLE FileHandle;
@@ -482,6 +492,7 @@ CloseFile:
        CloseHandle(FileHandle);
        return NULL;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 typedef struct _EXPORT_FIXUP
 {
@@ -499,14 +510,14 @@ typedef struct _EXPORT_FIXUP
 
 /* Has to be binary ordered. */
 static const EXPORT_FIXUP ExportFixups[] = {
-       {"CorBindToRuntime", &CorBindToRuntime},
-       {"CorBindToRuntimeEx", &CorBindToRuntimeEx},
-       {"CorExitProcess", &CorExitProcess},
-       {"_CorDllMain", &_CorDllMain},
-       {"_CorExeMain", &_CorExeMain},
-       {"_CorImageUnloading", &_CorImageUnloading},
-       {"_CorValidateImage", &_CorValidateImage},
-       {NULL, NULL}
+       {"CorBindToRuntime", {&CorBindToRuntime}},
+       {"CorBindToRuntimeEx", {&CorBindToRuntimeEx}},
+       {"CorExitProcess", {&CorExitProcess}},
+       {"_CorDllMain", {&_CorDllMain}},
+       {"_CorExeMain", {&_CorExeMain}},
+       {"_CorImageUnloading", {&_CorImageUnloading}},
+       {"_CorValidateImage", {&_CorValidateImage}},
+       {NULL, {NULL}}
 };
 
 #define EXPORT_FIXUP_COUNT (sizeof(ExportFixups) / sizeof(EXPORT_FIXUP) - 1)
@@ -795,7 +806,15 @@ STDAPI MonoFixupExe(HMODULE ModuleHandle)
                        ImportDesc = (IMAGE_IMPORT_DESCRIPTOR*)((DWORD_PTR)DosHeader + ImportDir->VirtualAddress);
                        while (ImportDesc->Name && ImportDesc->OriginalFirstThunk)
                        {
-                               ImportModuleHandle = LoadLibraryA((PCSTR)((DWORD_PTR)DosHeader + ImportDesc->Name));
+                               gchar *file_utf8 = (gchar *)((DWORD_PTR)DosHeader + ImportDesc->Name);
+
+                               gunichar2 *file_utf16 = g_utf8_to_utf16 (file_utf8, (glong)strlen (file_utf8), NULL, NULL, NULL);
+                               ImportModuleHandle = NULL;
+                               if (file_utf16 != NULL) {
+                                       ImportModuleHandle = LoadLibraryW(file_utf16);
+                                       g_free (file_utf16);
+                               }
+
                                if (ImportModuleHandle == NULL)
                                        return E_FAIL;
 
@@ -828,8 +847,9 @@ STDAPI MonoFixupExe(HMODULE ModuleHandle)
        return S_OK;
 }
 
-static void
-mono_set_act_ctx (const char* file_name)
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+void
+mono_coree_set_act_ctx (const char* file_name)
 {
        typedef HANDLE (WINAPI* CREATEACTCTXW_PROC) (PCACTCTXW pActCtx);
        typedef BOOL (WINAPI* ACTIVATEACTCTX_PROC) (HANDLE hActCtx, ULONG_PTR* lpCookie);
@@ -888,6 +908,7 @@ mono_set_act_ctx (const char* file_name)
        if (handle != INVALID_HANDLE_VALUE)
                ActivateActCtx_proc (handle, &cookie);
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 void
 mono_load_coree (const char* exe_file_name)
@@ -901,7 +922,7 @@ mono_load_coree (const char* exe_file_name)
                return;
 
        if (!init_from_coree && exe_file_name)
-               mono_set_act_ctx (exe_file_name);
+               mono_coree_set_act_ctx (exe_file_name);
 
        /* ntdll.dll loads mscoree.dll from the system32 directory. */
        required_size = GetSystemDirectory (NULL, 0);
index 2f93fecc8779134312080d1cc3e3026a8526ef9b..76bd1c21d8c1d94472af2886d8acc519d5afba0b 100644 (file)
@@ -7,4 +7,9 @@
 MonoCustomAttrInfo*
 mono_custom_attrs_from_builders (MonoImage *alloc_img, MonoImage *image, MonoArray *cattrs);
 
+typedef gboolean (*MonoAssemblyMetadataCustomAttrIterFunc) (MonoImage *image, guint32 typeref_scope_token, const gchar* nspace, const gchar* name, guint32 method_token, gpointer user_data);
+
+void
+mono_assembly_metadata_foreach_custom_attr (MonoAssembly *assembly, MonoAssemblyMetadataCustomAttrIterFunc func, gpointer user_data);
+
 #endif  /* __MONO_METADATA_REFLECTION_CUSTOM_ATTRS_INTERNALS_H__ */
index a1d48eb3d4431fdb2792d47eae84c5644cd9489f..8e56148ab1cb8fd8994f2233b11deb542b1df47d 100644 (file)
@@ -12,6 +12,7 @@
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 #include <config.h>
+#include "mono/metadata/assembly.h"
 #include "mono/metadata/gc-internals.h"
 #include "mono/metadata/mono-endian.h"
 #include "mono/metadata/object-internals.h"
@@ -69,7 +70,7 @@ custom_attr_visible (MonoImage *image, MonoReflectionCustomAttr *cattr)
 
        /* FIXME: Need to do more checks */
        if (cattr->ctor->method && (cattr->ctor->method->klass->image != image)) {
-               int visibility = cattr->ctor->method->klass->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK;
+               int visibility = mono_class_get_flags (cattr->ctor->method->klass) & TYPE_ATTRIBUTE_VISIBILITY_MASK;
 
                if ((visibility != TYPE_ATTRIBUTE_PUBLIC) && (visibility != TYPE_ATTRIBUTE_NESTED_PUBLIC))
                        return FALSE;
@@ -119,9 +120,10 @@ static guint32
 find_field_index (MonoClass *klass, MonoClassField *field) {
        int i;
 
-       for (i = 0; i < klass->field.count; ++i) {
+       int fcount = mono_class_get_field_count (klass);
+       for (i = 0; i < fcount; ++i) {
                if (field == &klass->fields [i])
-                       return klass->field.first + 1 + i;
+                       return mono_class_get_first_field_idx (klass) + 1 + i;
        }
        return 0;
 }
@@ -132,10 +134,11 @@ find_field_index (MonoClass *klass, MonoClassField *field) {
 static guint32
 find_property_index (MonoClass *klass, MonoProperty *property) {
        int i;
+       MonoClassExt *ext = mono_class_get_ext (klass);
 
-       for (i = 0; i < klass->ext->property.count; ++i) {
-               if (property == &klass->ext->properties [i])
-                       return klass->ext->property.first + 1 + i;
+       for (i = 0; i < ext->property.count; ++i) {
+               if (property == &ext->properties [i])
+                       return ext->property.first + 1 + i;
        }
        return 0;
 }
@@ -146,10 +149,11 @@ find_property_index (MonoClass *klass, MonoProperty *property) {
 static guint32
 find_event_index (MonoClass *klass, MonoEvent *event) {
        int i;
+       MonoClassExt *ext = mono_class_get_ext (klass);
 
-       for (i = 0; i < klass->ext->event.count; ++i) {
-               if (event == &klass->ext->events [i])
-                       return klass->ext->event.first + 1 + i;
+       for (i = 0; i < ext->event.count; ++i) {
+               if (event == &ext->events [i])
+                       return ext->event.first + 1 + i;
        }
        return 0;
 }
@@ -1072,7 +1076,7 @@ MonoCustomAttrInfo*
 mono_custom_attrs_from_index (MonoImage *image, guint32 idx)
 {
        MonoError error;
-       MonoCustomAttrInfo *result = mono_custom_attrs_from_index_checked (image, idx, &error);
+       MonoCustomAttrInfo *result = mono_custom_attrs_from_index_checked (image, idx, FALSE, &error);
        mono_error_cleanup (&error);
        return result;
 }
@@ -1082,7 +1086,7 @@ mono_custom_attrs_from_index (MonoImage *image, guint32 idx)
  * Returns: NULL if no attributes are found.  On error returns NULL and sets @error.
  */
 MonoCustomAttrInfo*
-mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, MonoError *error)
+mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, gboolean ignore_missing, MonoError *error)
 {
        guint32 mtoken, i, len;
        guint32 cols [MONO_CUSTOM_ATTR_SIZE];
@@ -1129,10 +1133,15 @@ mono_custom_attrs_from_index_checked (MonoImage *image, guint32 idx, MonoError *
                attr = &ainfo->attrs [i - 1];
                attr->ctor = mono_get_method_checked (image, mtoken, NULL, NULL, error);
                if (!attr->ctor) {
-                       g_warning ("Can't find custom attr constructor image: %s mtoken: 0x%08x due to %s", image->name, mtoken, mono_error_get_message (error));
-                       g_list_free (list);
-                       g_free (ainfo);
-                       return NULL;
+                       g_warning ("Can't find custom attr constructor image: %s mtoken: 0x%08x due to: %s", image->name, mtoken, mono_error_get_message (error));
+                       if (ignore_missing) {
+                               mono_error_cleanup (error);
+                               mono_error_init (error);
+                       } else {
+                               g_list_free (list);
+                               g_free (ainfo);
+                               return NULL;
+                       }
                }
 
                if (!mono_verifier_verify_cattr_blob (image, cols [MONO_CUSTOM_ATTR_VALUE], NULL)) {
@@ -1186,7 +1195,7 @@ mono_custom_attrs_from_method_checked (MonoMethod *method, MonoError *error)
        idx = mono_method_get_index (method);
        idx <<= MONO_CUSTOM_ATTR_BITS;
        idx |= MONO_CUSTOM_ATTR_METHODDEF;
-       return mono_custom_attrs_from_index_checked (method->klass->image, idx, error);
+       return mono_custom_attrs_from_index_checked (method->klass->image, idx, FALSE, error);
 }
 
 MonoCustomAttrInfo*
@@ -1205,8 +1214,8 @@ mono_custom_attrs_from_class_checked (MonoClass *klass, MonoError *error)
 
        mono_error_init (error);
 
-       if (klass->generic_class)
-               klass = klass->generic_class->container_class;
+       if (mono_class_is_ginst (klass))
+               klass = mono_class_get_generic_class (klass)->container_class;
 
        if (image_is_dynamic (klass->image))
                return lookup_custom_attr (klass->image, klass);
@@ -1220,20 +1229,20 @@ mono_custom_attrs_from_class_checked (MonoClass *klass, MonoError *error)
                idx <<= MONO_CUSTOM_ATTR_BITS;
                idx |= MONO_CUSTOM_ATTR_TYPEDEF;
        }
-       return mono_custom_attrs_from_index_checked (klass->image, idx, error);
+       return mono_custom_attrs_from_index_checked (klass->image, idx, FALSE, error);
 }
 
 MonoCustomAttrInfo*
 mono_custom_attrs_from_assembly (MonoAssembly *assembly)
 {
        MonoError error;
-       MonoCustomAttrInfo *result = mono_custom_attrs_from_assembly_checked (assembly, &error);
+       MonoCustomAttrInfo *result = mono_custom_attrs_from_assembly_checked (assembly, FALSE, &error);
        mono_error_cleanup (&error);
        return result;
 }
 
 MonoCustomAttrInfo*
-mono_custom_attrs_from_assembly_checked (MonoAssembly *assembly, MonoError *error)
+mono_custom_attrs_from_assembly_checked (MonoAssembly *assembly, gboolean ignore_missing, MonoError *error)
 {
        guint32 idx;
        
@@ -1244,7 +1253,7 @@ mono_custom_attrs_from_assembly_checked (MonoAssembly *assembly, MonoError *erro
        idx = 1; /* there is only one assembly */
        idx <<= MONO_CUSTOM_ATTR_BITS;
        idx |= MONO_CUSTOM_ATTR_ASSEMBLY;
-       return mono_custom_attrs_from_index_checked (assembly->image, idx, error);
+       return mono_custom_attrs_from_index_checked (assembly->image, idx, ignore_missing, error);
 }
 
 static MonoCustomAttrInfo*
@@ -1257,7 +1266,7 @@ mono_custom_attrs_from_module (MonoImage *image, MonoError *error)
        idx = 1; /* there is only one module */
        idx <<= MONO_CUSTOM_ATTR_BITS;
        idx |= MONO_CUSTOM_ATTR_MODULE;
-       return mono_custom_attrs_from_index_checked (image, idx, error);
+       return mono_custom_attrs_from_index_checked (image, idx, FALSE, error);
 }
 
 MonoCustomAttrInfo*
@@ -1281,7 +1290,7 @@ mono_custom_attrs_from_property_checked (MonoClass *klass, MonoProperty *propert
        idx = find_property_index (klass, property);
        idx <<= MONO_CUSTOM_ATTR_BITS;
        idx |= MONO_CUSTOM_ATTR_PROPERTY;
-       return mono_custom_attrs_from_index_checked (klass->image, idx, error);
+       return mono_custom_attrs_from_index_checked (klass->image, idx, FALSE, error);
 }
 
 MonoCustomAttrInfo*
@@ -1305,7 +1314,7 @@ mono_custom_attrs_from_event_checked (MonoClass *klass, MonoEvent *event, MonoEr
        idx = find_event_index (klass, event);
        idx <<= MONO_CUSTOM_ATTR_BITS;
        idx |= MONO_CUSTOM_ATTR_EVENT;
-       return mono_custom_attrs_from_index_checked (klass->image, idx, error);
+       return mono_custom_attrs_from_index_checked (klass->image, idx, FALSE, error);
 }
 
 MonoCustomAttrInfo*
@@ -1330,7 +1339,7 @@ mono_custom_attrs_from_field_checked (MonoClass *klass, MonoClassField *field, M
        idx = find_field_index (klass, field);
        idx <<= MONO_CUSTOM_ATTR_BITS;
        idx |= MONO_CUSTOM_ATTR_FIELDDEF;
-       return mono_custom_attrs_from_index_checked (klass->image, idx, error);
+       return mono_custom_attrs_from_index_checked (klass->image, idx, FALSE, error);
 }
 
 /**
@@ -1426,7 +1435,7 @@ mono_custom_attrs_from_param_checked (MonoMethod *method, guint32 param, MonoErr
        idx = i;
        idx <<= MONO_CUSTOM_ATTR_BITS;
        idx |= MONO_CUSTOM_ATTR_PARAMDEF;
-       return mono_custom_attrs_from_index_checked (image, idx, error);
+       return mono_custom_attrs_from_index_checked (image, idx, FALSE, error);
 }
 
 gboolean
@@ -1434,8 +1443,11 @@ mono_custom_attrs_has_attr (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass)
 {
        int i;
        for (i = 0; i < ainfo->num_attrs; ++i) {
-               MonoClass *klass = ainfo->attrs [i].ctor->klass;
-               if (mono_class_has_parent (klass, attr_klass) || (MONO_CLASS_IS_INTERFACE (attr_klass) && mono_class_is_assignable_from (attr_klass, klass)))
+               MonoCustomAttrEntry *centry = &ainfo->attrs[i];
+               if (centry->ctor == NULL)
+                       continue;
+               MonoClass *klass = centry->ctor->klass;
+               if (klass == attr_klass || mono_class_has_parent (klass, attr_klass) || (MONO_CLASS_IS_INTERFACE (attr_klass) && mono_class_is_assignable_from (attr_klass, klass)))
                        return TRUE;
        }
        return FALSE;
@@ -1453,26 +1465,25 @@ mono_custom_attrs_get_attr (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass)
 MonoObject*
 mono_custom_attrs_get_attr_checked (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass, MonoError *error)
 {
-       int i, attr_index;
-       MonoArray *attrs;
+       int i;
+       MonoCustomAttrEntry *centry = NULL;
+
+       g_assert (attr_klass != NULL);
 
        mono_error_init (error);
 
-       attr_index = -1;
        for (i = 0; i < ainfo->num_attrs; ++i) {
-               MonoClass *klass = ainfo->attrs [i].ctor->klass;
-               if (mono_class_has_parent (klass, attr_klass)) {
-                       attr_index = i;
+               centry = &ainfo->attrs[i];
+               if (centry->ctor == NULL)
+                       continue;
+               MonoClass *klass = centry->ctor->klass;
+               if (attr_klass == klass || mono_class_is_assignable_from (attr_klass, klass))
                        break;
-               }
        }
-       if (attr_index == -1)
+       if (centry == NULL)
                return NULL;
 
-       attrs = mono_custom_attrs_construct_by_type (ainfo, NULL, error);
-       if (!mono_error_ok (error))
-               return NULL;
-       return mono_array_get (attrs, MonoObject*, attr_index);
+       return create_custom_attr (ainfo->image, centry->ctor, centry->data, centry->data_size, error);
 }
 
 /*
@@ -1523,7 +1534,7 @@ mono_reflection_get_custom_attrs_info_checked (MonoObject *obj, MonoError *error
                return_val_if_nok (error, NULL);
        } else if (strcmp ("Assembly", klass->name) == 0 || strcmp ("MonoAssembly", klass->name) == 0) {
                MonoReflectionAssembly *rassembly = (MonoReflectionAssembly*)obj;
-               cinfo = mono_custom_attrs_from_assembly_checked (rassembly->assembly, error);
+               cinfo = mono_custom_attrs_from_assembly_checked (rassembly->assembly, FALSE, error);
                return_val_if_nok (error, NULL);
        } else if (strcmp ("Module", klass->name) == 0 || strcmp ("MonoModule", klass->name) == 0) {
                MonoReflectionModule *module = (MonoReflectionModule*)obj;
@@ -1545,10 +1556,6 @@ mono_reflection_get_custom_attrs_info_checked (MonoObject *obj, MonoError *error
                MonoReflectionMethod *rmethod = (MonoReflectionMethod*)obj;
                cinfo = mono_custom_attrs_from_method_checked (rmethod->method, error);
                return_val_if_nok (error, NULL);
-       } else if ((strcmp ("MonoGenericMethod", klass->name) == 0) || (strcmp ("MonoGenericCMethod", klass->name) == 0)) {
-               MonoReflectionMethod *rmethod = (MonoReflectionMethod*)obj;
-               cinfo = mono_custom_attrs_from_method_checked (rmethod->method, error);
-               return_val_if_nok (error, NULL);
        } else if (strcmp ("ParameterInfo", klass->name) == 0 || strcmp ("MonoParameterInfo", klass->name) == 0) {
                MonoReflectionParameter *param = (MonoReflectionParameter*)obj;
                MonoClass *member_class = mono_object_class (param->MemberImpl);
@@ -1568,22 +1575,11 @@ mono_reflection_get_custom_attrs_info_checked (MonoObject *obj, MonoError *error
                } 
 #ifndef DISABLE_REFLECTION_EMIT
                else if (mono_is_sre_method_on_tb_inst (member_class)) {/*XXX This is a workaround for Compiler Context*/
-                       MonoMethod *method = mono_reflection_method_on_tb_inst_get_handle ((MonoReflectionMethodOnTypeBuilderInst*)param->MemberImpl, error);
-                       return_val_if_nok (error, NULL);
-                       cinfo = mono_custom_attrs_from_param_checked (method, param->PositionImpl + 1, error);
-                       return_val_if_nok (error, NULL);
+                       // FIXME: Is this still needed ?
+                       g_assert_not_reached ();
                } else if (mono_is_sre_ctor_on_tb_inst (member_class)) { /*XX This is a workaround for Compiler Context*/
-                       MonoReflectionCtorOnTypeBuilderInst *c = (MonoReflectionCtorOnTypeBuilderInst*)param->MemberImpl;
-                       MonoMethod *method = NULL;
-                       if (mono_is_sre_ctor_builder (mono_object_class (c->cb)))
-                               method = ((MonoReflectionCtorBuilder *)c->cb)->mhandle;
-                       else if (mono_is_sr_mono_cmethod (mono_object_class (c->cb)))
-                               method = ((MonoReflectionMethod *)c->cb)->method;
-                       else
-                               g_error ("mono_reflection_get_custom_attrs_info:: can't handle a CTBI with base_method of type %s", mono_type_get_full_name (member_class));
-
-                       cinfo = mono_custom_attrs_from_param_checked (method, param->PositionImpl + 1, error);
-                       return_val_if_nok (error, NULL);
+                       // FIXME: Is this still needed ?
+                       g_assert_not_reached ();
                } 
 #endif
                else {
@@ -1718,3 +1714,174 @@ mono_reflection_get_custom_attrs_data_checked (MonoObject *obj, MonoError *error
 
        return result;
 }
+
+static gboolean
+custom_attr_class_name_from_methoddef (MonoImage *image, guint32 method_token, const gchar **nspace, const gchar **class_name)
+{
+       /* mono_get_method_from_token () */
+       g_assert (mono_metadata_token_table (method_token) == MONO_TABLE_METHOD);
+       guint32 type_token = mono_metadata_typedef_from_method (image, method_token);
+       if (!type_token) {
+               /* Bad method token (could not find corresponding typedef) */
+               return FALSE;
+       }
+       type_token |= MONO_TOKEN_TYPE_DEF;
+       {
+               /* mono_class_create_from_typedef () */
+               MonoTableInfo *tt = &image->tables [MONO_TABLE_TYPEDEF];
+               guint32 cols [MONO_TYPEDEF_SIZE];
+               guint tidx = mono_metadata_token_index (type_token);
+
+               if (mono_metadata_token_table (type_token) != MONO_TABLE_TYPEDEF || tidx > tt->rows) {
+                       /* "Invalid typedef token %x", type_token */
+                       return FALSE;
+               }
+
+               mono_metadata_decode_row (tt, tidx - 1, cols, MONO_TYPEDEF_SIZE);
+
+               if (class_name)
+                       *class_name = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAME]);
+               if (nspace)
+                       *nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]);
+               return TRUE;
+       }
+}
+
+
+/**
+ * custom_attr_class_name_from_method_token:
+ * @image: The MonoImage
+ * @method_token: a token for a custom attr constructor in @image
+ * @assembly_token: out argment set to the assembly ref token of the custom attr
+ * @nspace: out argument set to namespace (a string in the string heap of @image) of the custom attr
+ * @class_name: out argument set to the class name of the custom attr.
+ *
+ * Given an @image and a @method_token (which is assumed to be a
+ * constructor), fills in the out arguments with the assembly ref (if
+ * a methodref) and the namespace and class name of the custom
+ * attribute.
+ *
+ * Returns: TRUE on success, FALSE otherwise.
+ *
+ * LOCKING: does not take locks
+ */
+static gboolean
+custom_attr_class_name_from_method_token (MonoImage *image, guint32 method_token, guint32 *assembly_token, const gchar **nspace, const gchar **class_name)
+{
+       /* This only works with method tokens constructed from a
+        * custom attr token, which can only be methoddef or
+        * memberref */
+       g_assert (mono_metadata_token_table (method_token) == MONO_TABLE_METHOD
+                 || mono_metadata_token_table  (method_token) == MONO_TABLE_MEMBERREF);
+
+       if (mono_metadata_token_table (method_token) == MONO_TABLE_MEMBERREF) {
+               /* method_from_memberref () */
+               guint32 cols[6];
+               guint32 nindex, class_index;
+
+               int idx = mono_metadata_token_index (method_token);
+
+               mono_metadata_decode_row (&image->tables [MONO_TABLE_MEMBERREF], idx-1, cols, 3);
+               nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS;
+               class_index = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK;
+               if (class_index == MONO_MEMBERREF_PARENT_TYPEREF) {
+                       guint32 type_token = MONO_TOKEN_TYPE_REF | nindex;
+                       /* mono_class_from_typeref_checked () */
+                       {
+                               guint32 cols [MONO_TYPEREF_SIZE];
+                               MonoTableInfo  *t = &image->tables [MONO_TABLE_TYPEREF];
+
+                               mono_metadata_decode_row (t, (type_token&0xffffff)-1, cols, MONO_TYPEREF_SIZE);
+
+                               if (class_name)
+                                       *class_name = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAME]);
+                               if (nspace)
+                                       *nspace = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAMESPACE]);
+                               if (assembly_token)
+                                       *assembly_token = cols [MONO_TYPEREF_SCOPE];
+                               return TRUE;
+                       }
+               } else if (class_index == MONO_MEMBERREF_PARENT_METHODDEF) {
+                       guint32 methoddef_token = MONO_TOKEN_METHOD_DEF | nindex;
+                       if (assembly_token)
+                               *assembly_token = 0;
+                       return custom_attr_class_name_from_methoddef (image, methoddef_token, nspace, class_name);
+               } else {
+                       /* Attributes can't be generic, so it won't be
+                        * a typespec, and they're always
+                        * constructors, so it won't be a moduleref */
+                       g_assert_not_reached ();
+               }
+       } else {
+               /* must be MONO_TABLE_METHOD */
+               if (assembly_token)
+                       *assembly_token = 0;
+               return custom_attr_class_name_from_methoddef (image, method_token, nspace, class_name);
+       }
+}
+
+/**
+ * mono_assembly_metadata_foreach_custom_attr:
+ * @assembly: the assembly to iterate over
+ * @func: the function to call for each custom attribute
+ * @user_data: passed to @func
+ *
+ * Calls @func for each custom attribute type on the given assembly until @func returns TRUE.
+ * Everything is done using low-level metadata APIs, so it is safe to use during assembly loading.
+ *
+ */
+void
+mono_assembly_metadata_foreach_custom_attr (MonoAssembly *assembly, MonoAssemblyMetadataCustomAttrIterFunc func, gpointer user_data)
+{
+       MonoImage *image;
+       guint32 mtoken, i;
+       guint32 cols [MONO_CUSTOM_ATTR_SIZE];
+       MonoTableInfo *ca;
+       guint32 idx;
+
+       /*
+        * This might be called during assembly loading, so do everything using the low-level
+        * metadata APIs.
+        */
+
+       image = assembly->image;
+       g_assert (!image_is_dynamic (image));
+       idx = 1; /* there is only one assembly */
+       idx <<= MONO_CUSTOM_ATTR_BITS;
+       idx |= MONO_CUSTOM_ATTR_ASSEMBLY;
+
+       /* Inlined from mono_custom_attrs_from_index_checked () */
+       ca = &image->tables [MONO_TABLE_CUSTOMATTRIBUTE];
+       i = mono_metadata_custom_attrs_from_index (image, idx);
+       if (!i)
+               return;
+       i --;
+       gboolean stop_iterating = FALSE;
+       while (!stop_iterating && i < ca->rows) {
+               if (mono_metadata_decode_row_col (ca, i, MONO_CUSTOM_ATTR_PARENT) != idx)
+                       break;
+               mono_metadata_decode_row (ca, i, cols, MONO_CUSTOM_ATTR_SIZE);
+               i ++;
+               mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> MONO_CUSTOM_ATTR_TYPE_BITS;
+               switch (cols [MONO_CUSTOM_ATTR_TYPE] & MONO_CUSTOM_ATTR_TYPE_MASK) {
+               case MONO_CUSTOM_ATTR_TYPE_METHODDEF:
+                       mtoken |= MONO_TOKEN_METHOD_DEF;
+                       break;
+               case MONO_CUSTOM_ATTR_TYPE_MEMBERREF:
+                       mtoken |= MONO_TOKEN_MEMBER_REF;
+                       break;
+               default:
+                       g_warning ("Unknown table for custom attr type %08x", cols [MONO_CUSTOM_ATTR_TYPE]);
+                       continue;
+               }
+
+               const char *nspace = NULL;
+               const char *name = NULL;
+               guint32 assembly_token = 0;
+
+               if (!custom_attr_class_name_from_method_token (image, mtoken, &assembly_token, &nspace, &name))
+                       continue;
+
+               stop_iterating = func (image, assembly_token, nspace, name, mtoken, user_data);
+       }
+}
index f418b2078cee4af6f2da49eb191d887c99d458bb..b7e48f95d44aebf774a53df0f23ca8fc3521e7e7 100644 (file)
@@ -649,11 +649,6 @@ mono_debug_symfile_get_seq_points (MonoDebugMethodInfo *minfo, char **source_fil
                        if (source_files)
                                (*source_files) [i] = (*source_file_list)->len - 1;
                }
-               if ((*source_file_list)->len == 0 && stm.file) {
-                       MonoDebugSourceInfo *info = get_source_info (symfile, stm.file);
-
-                       g_ptr_array_add (*source_file_list, info);
-               }
        }                               
 
        if (n_seq_points) {
index 1f555ed4e324daf757f982df42c12e13733d4ac2..5448aa4ca8f50d65095781497ed21baf794face5 100644 (file)
@@ -339,7 +339,6 @@ struct _MonoDomain {
        /* Needed by Thread:GetDomainID() */
        gint32             domain_id;
        gint32             shadow_serial;
-       unsigned char      inet_family_hint; // used in socket-io.c as a cache
        GSList             *domain_assemblies;
        MonoAssembly       *entry_assembly;
        char               *friendly_name;
@@ -698,7 +697,7 @@ void
 mono_context_init_checked (MonoDomain *domain, MonoError *error);
 
 gboolean
-mono_assembly_get_reference_assembly_attribute (MonoAssembly *assembly, MonoError *error);
+mono_assembly_has_reference_assembly_attribute (MonoAssembly *assembly, MonoError *error);
 
 
 #endif /* __MONO_METADATA_DOMAIN_INTERNALS_H__ */
index bb40725ac1f401e085deccb0dc901a0b083a6ecd..020b0dd00c4406bc0d482714b2af17e65836b0d6 100644 (file)
@@ -43,6 +43,7 @@
 #include <mono/metadata/w32mutex.h>
 #include <mono/metadata/w32semaphore.h>
 #include <mono/metadata/w32event.h>
+#include <mono/metadata/w32process.h>
 #include <metadata/threads.h>
 #include <metadata/profiler-private.h>
 #include <mono/metadata/coree.h>
@@ -66,7 +67,6 @@ MONO_FAST_TLS_DECLARE(tls_appdomain);
        MonoThreadInfo *info; \
        MONO_FAST_TLS_SET (tls_appdomain,x); \
        mono_native_tls_set_value (appdomain_thread_id, x); \
-       mono_gc_set_current_thread_appdomain (x); \
        info = mono_thread_info_current (); \
        if (info) \
                mono_thread_info_tls_set (info, TLS_KEY_DOMAIN, (x));   \
@@ -78,7 +78,6 @@ MONO_FAST_TLS_DECLARE(tls_appdomain);
 #define SET_APPDOMAIN(x) do {                                          \
                MonoThreadInfo *info;                                                           \
                mono_native_tls_set_value (appdomain_thread_id, x);     \
-               mono_gc_set_current_thread_appdomain (x);               \
                info = mono_thread_info_current ();                             \
                if (info)                                                                                                \
                        mono_thread_info_tls_set (info, TLS_KEY_DOMAIN, (x));   \
@@ -512,7 +511,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
        static MonoDomain *domain = NULL;
        MonoAssembly *ass = NULL;
        MonoImageOpenStatus status = MONO_IMAGE_OK;
-       const MonoRuntimeInfo* runtimes [G_N_ELEMENTS (supported_runtimes) + 1];
+       const MonoRuntimeInfo* runtimes [G_N_ELEMENTS (supported_runtimes) + 1] = { NULL };
        int n, dummy;
 
 #ifdef DEBUG_DOMAIN_UNLOAD
@@ -522,7 +521,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
        if (domain)
                g_assert_not_reached ();
 
-#ifdef HOST_WIN32
+#if defined(HOST_WIN32) && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
        /* Avoid system error message boxes. */
        SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
 #endif
@@ -536,6 +535,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
        mono_w32mutex_init ();
        mono_w32semaphore_init ();
        mono_w32event_init ();
+       mono_w32process_init ();
 
 #ifndef DISABLE_PERFCOUNTERS
        mono_perfcounters_init ();
@@ -900,6 +900,8 @@ mono_cleanup (void)
        mono_native_tls_free (appdomain_thread_id);
        mono_coop_mutex_destroy (&appdomains_mutex);
 
+       mono_w32process_cleanup ();
+
 #ifndef HOST_WIN32
        wapi_cleanup ();
 #endif
@@ -1175,6 +1177,12 @@ mono_domain_free (MonoDomain *domain, gboolean force)
        g_slist_free (domain->domain_assemblies);
        domain->domain_assemblies = NULL;
 
+       /* 
+        * Send this after the assemblies have been unloaded and the domain is still in a 
+        * usable state.
+        */
+       mono_profiler_appdomain_event (domain, MONO_PROFILE_END_UNLOAD);
+
        if (free_domain_hook)
                free_domain_hook (domain);
 
index 17f0f8e82fba2642e8296010cd2c33d41c5d4284..9906f43b31838ec448675aeab80c281ee262d8c1 100644 (file)
@@ -347,7 +347,6 @@ mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, c
        image->handleref_managed = mono_g_hash_table_new_type ((GHashFunc)mono_object_hash, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module reference-to-token table");
        image->tokens = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module tokens table");
        image->generic_def_objects = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module generic definitions table");
-       image->methodspec = mono_g_hash_table_new_type ((GHashFunc)mono_object_hash, NULL, MONO_HASH_KEY_GC, MONO_ROOT_SOURCE_REFLECTION, "dynamic module method specifications table");
        image->typespec = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
        image->typeref = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
        image->blob_cache = g_hash_table_new ((GHashFunc)mono_blob_entry_hash, (GCompareFunc)mono_blob_entry_equal);
@@ -469,7 +468,6 @@ mono_dynamic_image_release_gc_roots (MonoDynamicImage *image)
        release_hashtable (&image->tokens);
        release_hashtable (&image->remapped_tokens);
        release_hashtable (&image->generic_def_objects);
-       release_hashtable (&image->methodspec);
 }
 
 // Free dynamic image pass one: Free resources but not image itself
@@ -480,8 +478,6 @@ mono_dynamic_image_free (MonoDynamicImage *image)
        GList *list;
        int i;
 
-       if (di->methodspec)
-               mono_g_hash_table_destroy (di->methodspec);
        if (di->typespec)
                g_hash_table_destroy (di->typespec);
        if (di->typeref)
index 02b738556c597c72fbc7ed9fe76a5acead5d97eb..b4be09844ac59ec3c482c2bb27d7620acacd7cc4 100644 (file)
@@ -976,8 +976,12 @@ mono_exception_get_native_backtrace (MonoException *exc)
        domain = mono_domain_get ();
        len = mono_array_length (arr);
        text = g_string_new_len (NULL, len * 20);
-       messages = backtrace_symbols (mono_array_addr (arr, gpointer, 0), len);
-
+       uint32_t gchandle = mono_gchandle_new (&arr->obj, TRUE); /* pinned */
+       void* addr = mono_array_addr (arr, gpointer, 0);
+       MONO_ENTER_GC_SAFE;
+       messages = backtrace_symbols (addr, len);
+       MONO_EXIT_GC_SAFE;
+       mono_gchandle_free (gchandle);
 
        for (i = 0; i < len; ++i) {
                gpointer ip = mono_array_get (arr, gpointer, i);
diff --git a/mono/metadata/file-io-internals.h b/mono/metadata/file-io-internals.h
new file mode 100644 (file)
index 0000000..ad45529
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_FILE_IO_INTERNALS_H__
+#define __MONO_FILE_IO_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+#include "mono/metadata/object.h"
+#include "mono/metadata/object-internals.h"
+
+gboolean
+mono_file_io_move_file (gunichar2 *path, gunichar2 *dest, gint32 *error);
+
+gboolean
+mono_file_io_copy_file (gunichar2 *path, gunichar2 *dest, gboolean overwrite, gint32 *error);
+
+gint64
+mono_file_io_get_file_size (HANDLE handle, gint32 *error);
+
+gboolean
+mono_file_io_lock_file (HANDLE handle, gint64 position, gint64 length, gint32 *error);
+
+gboolean
+mono_file_io_replace_file (gunichar2 *destinationFileName, gunichar2 *sourceFileName,
+                          gunichar2 *destinationBackupFileName, guint32 flags, gint32 *error);
+
+gboolean
+mono_file_io_unlock_file (HANDLE handle, gint64 position, gint64 length, gint32 *error);
+
+HANDLE
+mono_file_io_get_console_output (void);
+
+HANDLE
+mono_file_io_get_console_error (void);
+
+HANDLE
+mono_file_io_get_console_input (void);
+
+#endif /* __MONO_FILE_IO_INTERNALS_H__ */
diff --git a/mono/metadata/file-io-windows-internals.h b/mono/metadata/file-io-windows-internals.h
new file mode 100644 (file)
index 0000000..df372e8
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef _MONO_METADATA_FILEIO_WINDOWS_H_
+#define _MONO_METADATA_FILEIO_WINDOWS_H_
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include "mono/metadata/file-io.h"
+#include "mono/metadata/file-io-internals.h"
+#endif /* HOST_WIN32 */
+#endif /* _MONO_METADATA_FILEIO_WINDOWS_H_ */
diff --git a/mono/metadata/file-io-windows-uwp.c b/mono/metadata/file-io-windows-uwp.c
new file mode 100644 (file)
index 0000000..3af6c05
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * file-io-windows-uwp.c: UWP file-io support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include "mono/metadata/file-io-windows-internals.h"
+
+gboolean
+mono_file_io_move_file (gunichar2 *path, gunichar2 *dest, gint32 *error)
+{
+       gboolean result = FALSE;
+       MONO_ENTER_GC_SAFE;
+
+       result = MoveFileEx (path, dest, MOVEFILE_COPY_ALLOWED);
+       if (result == FALSE) {
+               *error=GetLastError ();
+       }
+
+       MONO_EXIT_GC_SAFE;
+       return result;
+}
+
+gboolean
+mono_file_io_replace_file (gunichar2 *destinationFileName, gunichar2 *sourceFileName,
+                          gunichar2 *destinationBackupFileName, guint32 flags, gint32 *error)
+{
+       gboolean result = FALSE;
+       MONO_ENTER_GC_SAFE;
+
+       result = ReplaceFile (destinationFileName, sourceFileName, destinationBackupFileName, flags, NULL, NULL);
+       if (result == FALSE) {
+               *error=GetLastError ();
+       }
+
+       MONO_EXIT_GC_SAFE;
+       return result;
+}
+
+gboolean
+mono_file_io_copy_file (gunichar2 *path, gunichar2 *dest, gboolean overwrite, gint32 *error)
+{
+       gboolean                                                result = FALSE;
+       COPYFILE2_EXTENDED_PARAMETERS   copy_param = {0};
+
+       copy_param.dwSize = sizeof (COPYFILE2_EXTENDED_PARAMETERS);
+       copy_param.dwCopyFlags = (!overwrite) ? COPY_FILE_FAIL_IF_EXISTS : 0;
+
+       MONO_ENTER_GC_SAFE;
+
+       result = SUCCEEDED (CopyFile2 (path, dest, &copy_param));
+       if (result == FALSE) {
+               *error=GetLastError ();
+       }
+
+       MONO_EXIT_GC_SAFE;
+       return result;
+}
+
+gint64
+mono_file_io_get_file_size (HANDLE handle, gint32 *error)
+{
+       LARGE_INTEGER length;
+
+       MONO_ENTER_GC_SAFE;
+
+       if (!GetFileSizeEx (handle, &length)) {
+               *error=GetLastError ();
+               length.QuadPart = INVALID_FILE_SIZE;
+       }
+
+       MONO_EXIT_GC_SAFE;
+       return length.QuadPart;
+}
+
+gboolean
+mono_file_io_lock_file (HANDLE handle, gint64 position, gint64 length, gint32 *error)
+{
+       gboolean result = FALSE;
+       MONO_ENTER_GC_SAFE;
+
+       result = LockFile (handle, position & 0xFFFFFFFF, position >> 32,
+                          length & 0xFFFFFFFF, length >> 32);
+
+       if (result == FALSE) {
+               *error = GetLastError ();
+       }
+
+       MONO_EXIT_GC_SAFE;
+       return result;
+}
+
+gboolean
+mono_file_io_unlock_file (HANDLE handle, gint64 position, gint64 length, gint32 *error)
+{
+       gboolean result = FALSE;
+       MONO_ENTER_GC_SAFE;
+
+       result = UnlockFile (handle, position & 0xFFFFFFFF, position >> 32,
+                            length & 0xFFFFFFFF, length >> 32);
+
+       if (result == FALSE) {
+               *error = GetLastError ();
+       }
+
+       MONO_EXIT_GC_SAFE;
+       return result;
+}
+
+HANDLE
+mono_file_io_get_console_output (void)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetStdHandle (STD_OUTPUT_HANDLE)");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetStdHandle (STD_OUTPUT_HANDLE)");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return INVALID_HANDLE_VALUE;
+}
+
+HANDLE
+mono_file_io_get_console_input (void)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetStdHandle (STD_INPUT_HANDLE)");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetStdHandle (STD_INPUT_HANDLE)");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return INVALID_HANDLE_VALUE;
+}
+
+HANDLE
+mono_file_io_get_console_error (void)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetStdHandle (STD_ERROR_HANDLE)");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetStdHandle (STD_ERROR_HANDLE)");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return INVALID_HANDLE_VALUE;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (file_io_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/metadata/file-io-windows.c b/mono/metadata/file-io-windows.c
new file mode 100644 (file)
index 0000000..e7dd111
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * file-io-windows.c: Windows File IO internal calls.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#include <config.h>
+#include <glib.h>
+
+#if defined(HOST_WIN32)
+#include <winsock2.h>
+#include <windows.h>
+#include "mono/metadata/file-io-windows-internals.h"
+
+gunichar2
+ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar ()
+{
+       return (gunichar2) ':'; /* colon */
+}
+
+gunichar2
+ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar ()
+{
+       return (gunichar2) '\\';        /* backslash */
+}
+
+gunichar2
+ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar ()
+{
+       return (gunichar2) '/'; /* forward slash */
+}
+
+gunichar2
+ves_icall_System_IO_MonoIO_get_PathSeparator ()
+{
+       return (gunichar2) ';'; /* semicolon */
+}
+
+void ves_icall_System_IO_MonoIO_DumpHandles (void)
+{
+       return;
+}
+#endif /* HOST_WIN32 */
index 1e0422e35fbc0f069b63b3136850af188a785384..0b001db668921cde759f8d3dbc434bc30aedf43f 100644 (file)
 #include <mono/metadata/object.h>
 #include <mono/io-layer/io-layer.h>
 #include <mono/metadata/file-io.h>
+#include <mono/metadata/file-io-internals.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/marshal.h>
 #include <mono/utils/strenc.h>
 #include <utils/mono-io-portability.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 
 #undef DEBUG
 
@@ -606,33 +607,55 @@ ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString *path,
        return(ret);
 }
 
-MonoBoolean
-ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest,
-                                    gint32 *error)
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gboolean
+mono_file_io_move_file (gunichar2 *path, gunichar2 *dest, gint32 *error)
 {
-       gboolean ret;
+       gboolean result = FALSE;
        MONO_ENTER_GC_SAFE;
-       
+
+       result = MoveFile (path, dest);
+       if (result == FALSE) {
+               *error=GetLastError ();
+       }
+
+       MONO_EXIT_GC_SAFE;
+       return result;
+}
+#endif /* HAVE_CLASSIC_WINAPI_SUPPORT */
+
+MonoBoolean
+ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest, gint32 *error)
+{
        *error=ERROR_SUCCESS;
+       return mono_file_io_move_file (mono_string_chars (path), mono_string_chars (dest), error);
+}
 
-       ret=MoveFile (mono_string_chars (path), mono_string_chars (dest));
-       if(ret==FALSE) {
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gboolean
+mono_file_io_replace_file (gunichar2 *destinationFileName, gunichar2 *sourceFileName,
+                          gunichar2 *destinationBackupFileName, guint32 flags, gint32 *error)
+{
+       gboolean result = FALSE;
+       MONO_ENTER_GC_SAFE;
+
+       result = ReplaceFile (destinationFileName, sourceFileName, destinationBackupFileName, flags, NULL, NULL);
+       if (result == FALSE) {
                *error=GetLastError ();
        }
 
        MONO_EXIT_GC_SAFE;
-       return(ret);
+       return result;
 }
+#endif /* HAVE_CLASSIC_WINAPI_SUPPORT */
 
 MonoBoolean
 ves_icall_System_IO_MonoIO_ReplaceFile (MonoString *sourceFileName, MonoString *destinationFileName,
                                        MonoString *destinationBackupFileName, MonoBoolean ignoreMetadataErrors,
                                        gint32 *error)
 {
-       gboolean ret;
        gunichar2 *utf16_sourceFileName = NULL, *utf16_destinationFileName = NULL, *utf16_destinationBackupFileName = NULL;
        guint32 replaceFlags = REPLACEFILE_WRITE_THROUGH;
-       MONO_ENTER_GC_SAFE;
 
        if (sourceFileName)
                utf16_sourceFileName = mono_string_chars (sourceFileName);
@@ -646,31 +669,33 @@ ves_icall_System_IO_MonoIO_ReplaceFile (MonoString *sourceFileName, MonoString *
                replaceFlags |= REPLACEFILE_IGNORE_MERGE_ERRORS;
 
        /* FIXME: source and destination file names must not be NULL, but apparently they might be! */
-       ret = ReplaceFile (utf16_destinationFileName, utf16_sourceFileName, utf16_destinationBackupFileName,
-                        replaceFlags, NULL, NULL);
-       if (ret == FALSE)
-               *error = GetLastError ();
+       return mono_file_io_replace_file (utf16_destinationFileName, utf16_sourceFileName,
+                                         utf16_destinationBackupFileName, replaceFlags, error);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gboolean
+mono_file_io_copy_file (gunichar2 *path, gunichar2 *dest, gboolean overwrite, gint32 *error)
+{
+       gboolean result = FALSE;
+       MONO_ENTER_GC_SAFE;
+
+       result = CopyFile (path, dest, !overwrite);
+       if (result == FALSE) {
+               *error=GetLastError ();
+       }
 
        MONO_EXIT_GC_SAFE;
-       return ret;
+       return result;
 }
+#endif /* HAVE_CLASSIC_WINAPI_SUPPORT */
 
 MonoBoolean
 ves_icall_System_IO_MonoIO_CopyFile (MonoString *path, MonoString *dest,
                                     MonoBoolean overwrite, gint32 *error)
 {
-       gboolean ret;
-       MONO_ENTER_GC_SAFE;
-       
        *error=ERROR_SUCCESS;
-       
-       ret=CopyFile (mono_string_chars (path), mono_string_chars (dest), !overwrite);
-       if(ret==FALSE) {
-               *error=GetLastError ();
-       }
-       
-       MONO_EXIT_GC_SAFE;
-       return(ret);
+       return mono_file_io_copy_file (mono_string_chars (path), mono_string_chars (dest), overwrite, error);
 }
 
 MonoBoolean
@@ -948,23 +973,31 @@ ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error)
        return(ret);
 }
 
-gint64 
-ves_icall_System_IO_MonoIO_GetLength (HANDLE handle, gint32 *error)
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gint64
+mono_file_io_get_file_size (HANDLE handle, gint32 *error)
 {
        gint64 length;
        guint32 length_hi;
+
        MONO_ENTER_GC_SAFE;
 
-       *error=ERROR_SUCCESS;
-       
        length = GetFileSize (handle, &length_hi);
        if(length==INVALID_FILE_SIZE) {
                *error=GetLastError ();
        }
-       
+
        MONO_EXIT_GC_SAFE;
        return length | ((gint64)length_hi << 32);
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+gint64
+ves_icall_System_IO_MonoIO_GetLength (HANDLE handle, gint32 *error)
+{
+       *error=ERROR_SUCCESS;
+       return mono_file_io_get_file_size (handle, error);
+}
 
 /* FIXME make gc suspendable */
 MonoBoolean
@@ -1052,22 +1085,46 @@ ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
        return(ret);
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+HANDLE
+mono_file_io_get_console_output (void)
+{
+       return GetStdHandle (STD_OUTPUT_HANDLE);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
 HANDLE 
 ves_icall_System_IO_MonoIO_get_ConsoleOutput ()
 {
-       return GetStdHandle (STD_OUTPUT_HANDLE);
+       return mono_file_io_get_console_output ();
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+HANDLE
+mono_file_io_get_console_input (void)
+{
+       return GetStdHandle (STD_INPUT_HANDLE);
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 HANDLE 
 ves_icall_System_IO_MonoIO_get_ConsoleInput ()
 {
-       return GetStdHandle (STD_INPUT_HANDLE);
+       return mono_file_io_get_console_input ();
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+HANDLE
+mono_file_io_get_console_error (void)
+{
+       return GetStdHandle (STD_ERROR_HANDLE);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
 HANDLE 
 ves_icall_System_IO_MonoIO_get_ConsoleError ()
 {
-       return GetStdHandle (STD_ERROR_HANDLE);
+       return mono_file_io_get_console_error ();
 }
 
 MonoBoolean
@@ -1113,48 +1170,34 @@ ves_icall_System_IO_MonoIO_DuplicateHandle (HANDLE source_process_handle, HANDLE
        return(TRUE);
 }
 
+#ifndef HOST_WIN32
 gunichar2 
 ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar ()
 {
-#if defined (TARGET_WIN32)
-       return (gunichar2) ':'; /* colon */
-#else
        return (gunichar2) '/'; /* forward slash */
-#endif
 }
 
 gunichar2 
 ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar ()
 {
-#if defined (TARGET_WIN32)
-       return (gunichar2) '\\';        /* backslash */
-#else
        return (gunichar2) '/'; /* forward slash */
-#endif
 }
 
 gunichar2 
 ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar ()
 {
-#if defined (TARGET_WIN32)
-       return (gunichar2) '/'; /* forward slash */
-#else
        if (IS_PORTABILITY_SET)
                return (gunichar2) '\\';        /* backslash */
        else
                return (gunichar2) '/'; /* forward slash */
-#endif
 }
 
 gunichar2 
 ves_icall_System_IO_MonoIO_get_PathSeparator ()
 {
-#if defined (TARGET_WIN32)
-       return (gunichar2) ';'; /* semicolon */
-#else
        return (gunichar2) ':'; /* colon */
-#endif
 }
+#endif /* !HOST_WIN32 */
 
 static const gunichar2
 invalid_path_chars [] = {
@@ -1197,38 +1240,56 @@ ves_icall_System_IO_MonoIO_get_InvalidPathChars ()
        return chars;
 }
 
-void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
-                                     gint64 length, gint32 *error)
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gboolean
+mono_file_io_lock_file (HANDLE handle, gint64 position, gint64 length, gint32 *error)
 {
-       gboolean ret;
+       gboolean result = FALSE;
        MONO_ENTER_GC_SAFE;
-       
-       *error=ERROR_SUCCESS;
-       
-       ret=LockFile (handle, position & 0xFFFFFFFF, position >> 32,
-                     length & 0xFFFFFFFF, length >> 32);
-       if (ret == FALSE) {
+
+       result = LockFile (handle, position & 0xFFFFFFFF, position >> 32,
+                          length & 0xFFFFFFFF, length >> 32);
+
+       if (result == FALSE) {
                *error = GetLastError ();
        }
 
        MONO_EXIT_GC_SAFE;
+       return result;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
-void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
-                                       gint64 length, gint32 *error)
+void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
+                                     gint64 length, gint32 *error)
 {
-       gboolean ret;
-       MONO_ENTER_GC_SAFE;
-       
        *error=ERROR_SUCCESS;
+       mono_file_io_lock_file (handle, position, length, error);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gboolean
+mono_file_io_unlock_file (HANDLE handle, gint64 position, gint64 length, gint32 *error)
+{
+       gboolean result = FALSE;
+       MONO_ENTER_GC_SAFE;
        
-       ret=UnlockFile (handle, position & 0xFFFFFFFF, position >> 32,
-                       length & 0xFFFFFFFF, length >> 32);
-       if (ret == FALSE) {
+       result = UnlockFile (handle, position & 0xFFFFFFFF, position >> 32,
+                            length & 0xFFFFFFFF, length >> 32);
+
+       if (result == FALSE) {
                *error = GetLastError ();
        }
 
        MONO_EXIT_GC_SAFE;
+       return result;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
+                                       gint64 length, gint32 *error)
+{
+       *error=ERROR_SUCCESS;
+       mono_file_io_unlock_file (handle, position, length, error);
 }
 
 //Support for io-layer free mmap'd files.
@@ -1274,11 +1335,12 @@ mono_filesize_from_fd (int fd)
 
 #endif
 
+#ifndef HOST_WIN32
 void mono_w32handle_dump (void);
 
 void ves_icall_System_IO_MonoIO_DumpHandles (void)
 {
-#ifndef HOST_WIN32
+
        mono_w32handle_dump ();
-#endif
 }
+#endif /* !HOST_WIN32 */
index 84e3b4aa68d75000fbec036787887c36f1fe8930..4b9ce74499e04ec81a5b1ad1e422615d7c44636b 100644 (file)
@@ -63,7 +63,9 @@ enum {
        COULD_NOT_OPEN,
        CAPACITY_MUST_BE_POSITIVE,
        INVALID_FILE_MODE,
-       COULD_NOT_MAP_MEMORY
+       COULD_NOT_MAP_MEMORY,
+       ACCESS_DENIED,
+       CAPACITY_LARGER_THAN_LOGICAL_ADDRESS_SPACE
 };
 
 enum {
@@ -300,10 +302,16 @@ static void*
 open_memory_map (const char *c_mapName, int mode, gint64 *capacity, int access, int options, int *ioerror)
 {
        MmapHandle *handle;
-       if (*capacity <= 1) {
+       if (*capacity <= 0) {
                *ioerror = CAPACITY_MUST_BE_POSITIVE;
                return NULL;
        }
+#if SIZEOF_VOID_P == 4
+       if (*capacity > UINT32_MAX) {
+               *ioerror = CAPACITY_LARGER_THAN_LOGICAL_ADDRESS_SPACE;
+               return NULL;
+       }
+#endif
 
        if (!(mode == FILE_MODE_CREATE_NEW || mode == FILE_MODE_OPEN_OR_CREATE || mode == FILE_MODE_OPEN)) {
                *ioerror = INVALID_FILE_MODE;
@@ -499,8 +507,11 @@ mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mma
        struct stat buf = { 0 };
        fstat (fh->fd, &buf); //FIXME error handling
 
+       *mmap_handle = NULL;
+       *base_address = NULL;
+
        if (offset > buf.st_size || ((eff_size + offset) > buf.st_size && !is_special_zero_size_file (&buf)))
-               goto error;
+               return ACCESS_DENIED;
        /**
          * We use the file size if one of the following conditions is true:
          *  -input size is zero
@@ -522,9 +533,6 @@ mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mma
                return 0;
        }
 
-error:
-       *mmap_handle = NULL;
-       *base_address = NULL;
        return COULD_NOT_MAP_MEMORY;
 }
 
index dba37472c34741355a3f5e1e954f4c54a86801ad..3cc9124c0854ccf6626e244329df27bd8c5e90ae 100644 (file)
 /*
- * file-mmap-posix.c: File mmap internal calls
+ * file-mmap-windows.c: MemoryMappedFile internal calls for Windows
  *
- * Author:
- *     Rodrigo Kumpera
- *
- * Copyright 2014 Xamarin Inc (http://www.xamarin.com)
+ * Copyright 2016 Microsoft
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
-#include <config.h>
-
-#ifdef HOST_WIN32
+/*
+ * The code in this file has been inspired by the CoreFX MemoryMappedFile Windows implementation contained in the files
+ *
+ * https://github.com/dotnet/corefx/blob/master/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Windows.cs
+ * https://github.com/dotnet/corefx/blob/master/src/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs
+ */
 
+#include <config.h>
 #include <glib.h>
-#include <string.h>
-#include <errno.h>
+#include <mono/utils/mono-compiler.h>
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) && defined(HOST_WIN32)
 
+#include <glib.h>
 
-#include <mono/metadata/object.h>
 #include <mono/metadata/file-mmap.h>
 
-void *
-mono_mmap_open_file (MonoString *path, int mode, MonoString *mapName, gint64 *capacity, int access, int options, int *error)
+// These control the retry behaviour when lock violation errors occur during Flush:
+#define MAX_FLUSH_WAITS 15  // must be <=30
+#define MAX_FLUSH_RETIRES_PER_WAIT 20
+
+typedef struct {
+       void *address;
+       size_t length;
+} MmapInstance;
+
+enum {
+       BAD_CAPACITY_FOR_FILE_BACKED = 1,
+       CAPACITY_SMALLER_THAN_FILE_SIZE,
+       FILE_NOT_FOUND,
+       FILE_ALREADY_EXISTS,
+       PATH_TOO_LONG,
+       COULD_NOT_OPEN,
+       CAPACITY_MUST_BE_POSITIVE,
+       INVALID_FILE_MODE,
+       COULD_NOT_MAP_MEMORY,
+       ACCESS_DENIED,
+       CAPACITY_LARGER_THAN_LOGICAL_ADDRESS_SPACE
+};
+
+enum {
+       FILE_MODE_CREATE_NEW = 1,
+       FILE_MODE_CREATE = 2,
+       FILE_MODE_OPEN = 3,
+       FILE_MODE_OPEN_OR_CREATE = 4,
+       FILE_MODE_TRUNCATE = 5,
+       FILE_MODE_APPEND = 6,
+};
+
+enum {
+       MMAP_FILE_ACCESS_READ_WRITE = 0,
+       MMAP_FILE_ACCESS_READ = 1,
+       MMAP_FILE_ACCESS_WRITE = 2,
+       MMAP_FILE_ACCESS_COPY_ON_WRITE = 3,
+       MMAP_FILE_ACCESS_READ_EXECUTE = 4,
+       MMAP_FILE_ACCESS_READ_WRITE_EXECUTE = 5,
+};
+
+static DWORD get_page_access (int access)
 {
-       g_error ("No windows backend");
-       return NULL;
+       switch (access) {
+       case MMAP_FILE_ACCESS_READ:
+               return PAGE_READONLY;
+       case MMAP_FILE_ACCESS_READ_WRITE:
+               return PAGE_READWRITE;
+       case MMAP_FILE_ACCESS_COPY_ON_WRITE:
+               return PAGE_WRITECOPY;
+       case MMAP_FILE_ACCESS_READ_EXECUTE:
+               return PAGE_EXECUTE_READ;
+       case MMAP_FILE_ACCESS_READ_WRITE_EXECUTE:
+               return PAGE_EXECUTE_READWRITE;
+       default:
+               g_error ("unknown MemoryMappedFileAccess %d", access);
+       }
 }
 
-void *
-mono_mmap_open_handle (void *handle, MonoString *mapName, gint64 *capacity, int access, int options, int *error)
+static DWORD get_file_access (int access)
 {
-       g_error ("No windows backend");
-       return NULL;
+       switch (access) {
+       case MMAP_FILE_ACCESS_READ:
+       case MMAP_FILE_ACCESS_READ_EXECUTE:
+               return GENERIC_READ;
+       case MMAP_FILE_ACCESS_READ_WRITE:
+       case MMAP_FILE_ACCESS_COPY_ON_WRITE:
+       case MMAP_FILE_ACCESS_READ_WRITE_EXECUTE:
+               return GENERIC_READ | GENERIC_WRITE;
+       case MMAP_FILE_ACCESS_WRITE:
+               return GENERIC_WRITE;
+       default:
+               g_error ("unknown MemoryMappedFileAccess %d", access);
+       }
 }
 
-void
-mono_mmap_close (void *mmap_handle)
+static int get_file_map_access (int access)
 {
-       g_error ("No windows backend");
+       switch (access) {
+       case MMAP_FILE_ACCESS_READ:
+               return FILE_MAP_READ;
+       case MMAP_FILE_ACCESS_WRITE:
+               return FILE_MAP_WRITE;
+       case MMAP_FILE_ACCESS_READ_WRITE:
+               return FILE_MAP_READ | FILE_MAP_WRITE;
+       case MMAP_FILE_ACCESS_COPY_ON_WRITE:
+               return FILE_MAP_COPY;
+       case MMAP_FILE_ACCESS_READ_EXECUTE:
+               return FILE_MAP_EXECUTE | FILE_MAP_READ;
+       case MMAP_FILE_ACCESS_READ_WRITE_EXECUTE:
+               return FILE_MAP_EXECUTE | FILE_MAP_READ | FILE_MAP_WRITE;
+       default:
+               g_error ("unknown MemoryMappedFileAccess %d", access);
+       }
 }
 
-void
-mono_mmap_configure_inheritability (void *mmap_handle, gboolean inheritability)
+static int convert_win32_error (int error, int def)
 {
-       g_error ("No windows backend");
+       switch (error) {
+       case ERROR_FILE_NOT_FOUND:
+               return FILE_NOT_FOUND;
+       case ERROR_FILE_EXISTS:
+       case ERROR_ALREADY_EXISTS:
+               return FILE_ALREADY_EXISTS;
+       case ERROR_ACCESS_DENIED:
+               return ACCESS_DENIED;
+       }
+       return def;
 }
 
-void
-mono_mmap_flush (void *mmap_handle)
+static void *open_handle (void *handle, MonoString *mapName, int mode, gint64 *capacity, int access, int options, int *error)
 {
-       g_error ("No windows backend");
+       g_assert (handle != NULL);
+
+       wchar_t *w_mapName = NULL;
+       HANDLE result = NULL;
+
+       if (handle == INVALID_HANDLE_VALUE) {
+               if (*capacity <= 0) {
+                       *error = CAPACITY_MUST_BE_POSITIVE;
+                       return NULL;
+               }
+#if SIZEOF_VOID_P == 4
+               if (*capacity > UINT32_MAX) {
+                       *error = CAPACITY_LARGER_THAN_LOGICAL_ADDRESS_SPACE;
+                       return NULL;
+               }
+#endif
+               if (!(mode == FILE_MODE_CREATE_NEW || mode == FILE_MODE_OPEN_OR_CREATE || mode == FILE_MODE_OPEN)) {
+                       *error = INVALID_FILE_MODE;
+                       return NULL;
+               }
+       } else {
+               FILE_STANDARD_INFO info;
+               if (!GetFileInformationByHandleEx ((HANDLE) handle, FileStandardInfo, &info, sizeof (FILE_STANDARD_INFO))) {
+                       *error = convert_win32_error (GetLastError (), COULD_NOT_OPEN);
+                       return NULL;
+               }
+               if (*capacity == 0) {
+                       if (info.EndOfFile.QuadPart == 0) {
+                               *error = CAPACITY_SMALLER_THAN_FILE_SIZE;
+                               return NULL;
+                       }
+               } else if (*capacity < info.EndOfFile.QuadPart) {
+                       *error = CAPACITY_SMALLER_THAN_FILE_SIZE;
+                       return NULL;
+               }
+       }
+
+       w_mapName = mapName ? mono_string_to_utf16 (mapName) : NULL;
+
+       if (mode == FILE_MODE_CREATE_NEW || handle != INVALID_HANDLE_VALUE) {
+               result = CreateFileMappingW ((HANDLE)handle, NULL, get_page_access (access) | options, (DWORD)(((guint64)*capacity) >> 32), (DWORD)*capacity, w_mapName);
+               if (result && GetLastError () == ERROR_ALREADY_EXISTS) {
+                       CloseHandle (result);
+                       result = NULL;
+                       *error = FILE_ALREADY_EXISTS;
+               } else if (!result && GetLastError () != NO_ERROR) {
+                       *error = convert_win32_error (GetLastError (), COULD_NOT_OPEN);
+               }
+       } else if (mode == FILE_MODE_OPEN || mode == FILE_MODE_OPEN_OR_CREATE && access == MMAP_FILE_ACCESS_WRITE) {
+               result = OpenFileMappingW (get_file_map_access (access), FALSE, w_mapName);
+               if (!result) {
+                       if (mode == FILE_MODE_OPEN_OR_CREATE && GetLastError () == ERROR_FILE_NOT_FOUND) {
+                               *error = INVALID_FILE_MODE;
+                       } else {
+                               *error = convert_win32_error (GetLastError (), COULD_NOT_OPEN);
+                       }
+               }
+       } else if (mode == FILE_MODE_OPEN_OR_CREATE) {
+
+               // This replicates how CoreFX does MemoryMappedFile.CreateOrOpen ().
+
+               /// Try to open the file if it exists -- this requires a bit more work. Loop until we can
+               /// either create or open a memory mapped file up to a timeout. CreateFileMapping may fail
+               /// if the file exists and we have non-null security attributes, in which case we need to
+               /// use OpenFileMapping.  But, there exists a race condition because the memory mapped file
+               /// may have closed between the two calls -- hence the loop. 
+               /// 
+               /// The retry/timeout logic increases the wait time each pass through the loop and times 
+               /// out in approximately 1.4 minutes. If after retrying, a MMF handle still hasn't been opened, 
+               /// throw an InvalidOperationException.
+
+               guint32 waitRetries = 14;   //((2^13)-1)*10ms == approximately 1.4mins
+               guint32 waitSleep = 0;
+
+               while (waitRetries > 0) {
+                       result = CreateFileMappingW ((HANDLE)handle, NULL, get_page_access (access) | options, (DWORD)(((guint64)*capacity) >> 32), (DWORD)*capacity, w_mapName);
+                       if (result)
+                               break;
+                       if (GetLastError() != ERROR_ACCESS_DENIED) {
+                               *error = convert_win32_error (GetLastError (), COULD_NOT_OPEN);
+                               break;
+                       }
+                       result = OpenFileMappingW (get_file_map_access (access), FALSE, w_mapName);
+                       if (result)
+                               break;
+                       if (GetLastError () != ERROR_FILE_NOT_FOUND) {
+                               *error = convert_win32_error (GetLastError (), COULD_NOT_OPEN);
+                               break;
+                       }
+                       // increase wait time
+                       --waitRetries;
+                       if (waitSleep == 0) {
+                               waitSleep = 10;
+                       } else {
+                               mono_thread_info_sleep (waitSleep, NULL);
+                               waitSleep *= 2;
+                       }
+               }
+
+               if (!result) {
+                       *error = COULD_NOT_OPEN;
+               }
+       }
+
+       if (w_mapName)
+               g_free (w_mapName);
+       return result;
 }
 
+void *mono_mmap_open_file (MonoString *path, int mode, MonoString *mapName, gint64 *capacity, int access, int options, int *error)
+{
+       g_assert (path != NULL || mapName != NULL);
+
+       wchar_t *w_path = NULL;
+       HANDLE hFile = INVALID_HANDLE_VALUE;
+       HANDLE result = NULL;
+       gboolean delete_on_error = FALSE;
+
+       if (path) {
+               w_path = mono_string_to_utf16 (path);
+               WIN32_FILE_ATTRIBUTE_DATA file_attrs;
+               gboolean existed = GetFileAttributesExW (w_path, GetFileExInfoStandard, &file_attrs);
+               if (!existed && mode == FILE_MODE_CREATE_NEW && *capacity == 0) {
+                       *error = CAPACITY_SMALLER_THAN_FILE_SIZE;
+                       goto done;
+               }
+               hFile = CreateFileW (w_path, get_file_access (access), FILE_SHARE_READ, NULL, mode, FILE_ATTRIBUTE_NORMAL, NULL);
+               if (hFile == INVALID_HANDLE_VALUE) {
+                       *error = convert_win32_error (GetLastError (), COULD_NOT_OPEN);
+                       goto done;
+               }
+               delete_on_error = !existed;
+       }
+
+       result = open_handle (hFile, mapName, mode, capacity, access, options, error);
+
+done:
+       if (!result && delete_on_error)
+               DeleteFileW (w_path);
+       if (w_path)
+               g_free (w_path);
 
+       return result;
+}
 
-int
-mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mmap_handle, void **base_address)
+void *mono_mmap_open_handle (void *handle, MonoString *mapName, gint64 *capacity, int access, int options, int *error)
 {
-       g_error ("No windows backend");
+       g_assert (handle != NULL);
+
+       return open_handle (handle, mapName, FILE_MODE_OPEN, capacity, access, options, error);
+}
+
+void mono_mmap_close (void *mmap_handle)
+{
+       g_assert (mmap_handle);
+       CloseHandle ((HANDLE) mmap_handle);
+}
+
+void mono_mmap_configure_inheritability (void *mmap_handle, gboolean inheritability)
+{
+       g_assert (mmap_handle);
+       if (!SetHandleInformation ((HANDLE) mmap_handle, HANDLE_FLAG_INHERIT, inheritability ? HANDLE_FLAG_INHERIT : 0)) {
+               g_error ("mono_mmap_configure_inheritability: SetHandleInformation failed with error %d!", GetLastError ());
+       }
+}
+
+void mono_mmap_flush (void *mmap_handle)
+{
+       g_assert (mmap_handle);
+       MmapInstance *h = (MmapInstance *)mmap_handle;
+
+       if (FlushViewOfFile (h->address, h->length))
+               return;
+
+       // This replicates how CoreFX does MemoryMappedView.Flush ().
+
+       // It is a known issue within the NTFS transaction log system that
+       // causes FlushViewOfFile to intermittently fail with ERROR_LOCK_VIOLATION
+       // As a workaround, we catch this particular error and retry the flush operation 
+       // a few milliseconds later. If it does not work, we give it a few more tries with
+       // increasing intervals. Eventually, however, we need to give up. In ad-hoc tests
+       // this strategy successfully flushed the view after no more than 3 retries.
+
+       if (GetLastError () != ERROR_LOCK_VIOLATION)
+               // TODO: Propagate error to caller
+               return;
+
+       for (int w = 0; w < MAX_FLUSH_WAITS; w++) {
+               int pause = (1 << w);  // MaxFlushRetries should never be over 30
+               mono_thread_info_sleep (pause, NULL);
+
+               for (int r = 0; r < MAX_FLUSH_RETIRES_PER_WAIT; r++) {
+                       if (FlushViewOfFile (h->address, h->length))
+                               return;
+
+                       if (GetLastError () != ERROR_LOCK_VIOLATION)
+                               // TODO: Propagate error to caller
+                               return;
+
+                       mono_thread_info_yield ();
+               }
+       }
+
+       // We got to here, so there was no success:
+       // TODO: Propagate error to caller
+}
+
+int mono_mmap_map (void *handle, gint64 offset, gint64 *size, int access, void **mmap_handle, void **base_address)
+{
+       static DWORD allocationGranularity = 0;
+       if (allocationGranularity == 0) {
+               SYSTEM_INFO info;
+               GetSystemInfo (&info);
+               allocationGranularity = info.dwAllocationGranularity;
+       }
+
+       gint64 extraMemNeeded = offset % allocationGranularity;
+       guint64 newOffset = offset - extraMemNeeded;
+       gint64 nativeSize = (*size != 0) ? *size + extraMemNeeded : 0;
+
+#if SIZEOF_VOID_P == 4
+       if (nativeSize > UINT32_MAX)
+               return CAPACITY_LARGER_THAN_LOGICAL_ADDRESS_SPACE;
+#endif
+       
+       void *address = MapViewOfFile ((HANDLE) handle, get_file_map_access (access), (DWORD) (newOffset >> 32), (DWORD) newOffset, (SIZE_T) nativeSize);
+       if (!address)
+               return convert_win32_error (GetLastError (), COULD_NOT_MAP_MEMORY);
+
+       // Query the view for its size and allocation type
+       MEMORY_BASIC_INFORMATION viewInfo;
+       VirtualQuery (address, &viewInfo, sizeof (MEMORY_BASIC_INFORMATION));
+       guint64 viewSize = (guint64) viewInfo.RegionSize;
+
+       // Allocate the pages if we were using the MemoryMappedFileOptions.DelayAllocatePages option
+       // OR check if the allocated view size is smaller than the expected native size
+       // If multiple overlapping views are created over the file mapping object, the pages in a given region
+       // could have different attributes(MEM_RESERVE OR MEM_COMMIT) as MapViewOfFile preserves coherence between 
+       // views created on a mapping object backed by same file.
+       // In which case, the viewSize will be smaller than nativeSize required and viewState could be MEM_COMMIT 
+       // but more pages may need to be committed in the region.
+       // This is because, VirtualQuery function(that internally invokes VirtualQueryEx function) returns the attributes 
+       // and size of the region of pages with matching attributes starting from base address.
+       // VirtualQueryEx: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366907(v=vs.85).aspx
+       if (((viewInfo.State & MEM_RESERVE) != 0) || viewSize < (guint64) nativeSize) {
+               void *tempAddress = VirtualAlloc (address, nativeSize != 0 ? nativeSize : viewSize, MEM_COMMIT, get_page_access (access));
+               if (!tempAddress) {
+                       return convert_win32_error (GetLastError (), COULD_NOT_MAP_MEMORY);
+               }
+               // again query the view for its new size
+               VirtualQuery (address, &viewInfo, sizeof (MEMORY_BASIC_INFORMATION));
+               viewSize = (guint64) viewInfo.RegionSize;
+       }
+
+       if (*size == 0)
+               *size = viewSize - extraMemNeeded;
+
+       MmapInstance *h = g_malloc0 (sizeof (MmapInstance));
+       h->address = address;
+       h->length = *size + extraMemNeeded;
+       *mmap_handle = h;
+       *base_address = (char*) address + (offset - newOffset);
+
        return 0;
 }
 
-gboolean
-mono_mmap_unmap (void *mmap_handle)
+gboolean mono_mmap_unmap (void *mmap_handle)
 {
-       g_error ("No windows backend");
-       return TRUE;
+       g_assert (mmap_handle);
+
+       MmapInstance *h = (MmapInstance *) mmap_handle;
+
+       gboolean result = UnmapViewOfFile (h->address);
+
+       g_free (h);
+       return result;
 }
 
+#else
+
+MONO_EMPTY_SOURCE_FILE (file_mmap_windows);
+
 #endif
index cd9408df98bbd073b054eeff706deb64b7a9765f..2ef55c6e6733baa729f9a37c2bbb544d82c7d03d 100644 (file)
@@ -103,8 +103,6 @@ extern void mono_gc_set_stack_end (void *stack_end);
 gboolean mono_object_is_alive (MonoObject* obj);
 gboolean mono_gc_is_finalizer_thread (MonoThread *thread);
 gpointer mono_gc_out_of_memory (size_t size);
-void     mono_gc_enable_events (void);
-void     mono_gc_enable_alloc_events (void);
 
 void mono_gchandle_set_target (guint32 gchandle, MonoObject *obj);
 
@@ -299,8 +297,6 @@ gboolean mono_gc_card_table_nursery_check (void);
 
 void* mono_gc_get_nursery (int *shift_bits, size_t *size);
 
-void mono_gc_set_current_thread_appdomain (MonoDomain *domain);
-
 void mono_gc_set_skip_thread (gboolean skip);
 
 #ifndef HOST_WIN32
@@ -364,6 +360,8 @@ guint mono_gc_get_vtable_bits (MonoClass *klass);
 
 void mono_gc_register_altstack (gpointer stack, gint32 stack_size, gpointer altstack, gint32 altstack_size);
 
+gboolean mono_gc_is_critical_method (MonoMethod *method);
+
 /* If set, print debugging messages around finalizers. */
 extern gboolean log_finalizers;
 
index 46eaf5e224af7ad3bd1ac05a365d4415ad0d910b..e66b4da35a2b97c6ae48945d7f18dc5325ee0fc3 100644 (file)
@@ -91,13 +91,13 @@ static void mono_reference_queue_cleanup (void);
 static void reference_queue_clear_for_domain (MonoDomain *domain);
 
 
-static guint32
-guarded_wait (HANDLE handle, guint32 timeout, gboolean alertable)
+static MonoThreadInfoWaitRet
+guarded_wait (MonoThreadHandle *thread_handle, guint32 timeout, gboolean alertable)
 {
-       guint32 result;
+       MonoThreadInfoWaitRet result;
 
        MONO_ENTER_GC_SAFE;
-       result = WaitForSingleObjectEx (handle, timeout, alertable);
+       result = mono_thread_info_wait_one_handle (thread_handle, timeout, alertable);
        MONO_EXIT_GC_SAFE;
 
        return result;
@@ -560,8 +560,6 @@ mono_domain_finalize (MonoDomain *domain, guint32 timeout)
                mono_gc_finalize_threadpool_threads ();
        }
 
-       mono_profiler_appdomain_event (domain, MONO_PROFILE_END_UNLOAD);
-
 done:
        if (InterlockedDecrement (&req->ref) == 0) {
                mono_coop_sem_destroy (&req->done);
@@ -644,7 +642,9 @@ ves_icall_System_GC_WaitForPendingFinalizers (void)
        ResetEvent (pending_done_event);
        mono_gc_finalize_notify ();
        /* g_print ("Waiting for pending finalizers....\n"); */
-       guarded_wait (pending_done_event, INFINITE, TRUE);
+       MONO_ENTER_GC_SAFE;
+       WaitForSingleObjectEx (pending_done_event, INFINITE, TRUE);
+       MONO_EXIT_GC_SAFE;
        /* g_print ("Done pending....\n"); */
 #else
        gboolean alerted = FALSE;
@@ -732,7 +732,7 @@ ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle)
                } else {
                        /* the C# code will check and throw the exception */
                        /* FIXME: missing !klass->blittable test, see bug #61134 */
-                       if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
+                       if (mono_class_is_auto_layout (klass))
                                return (gpointer)-1;
                        return (char*)obj + sizeof (MonoObject);
                }
@@ -1016,6 +1016,7 @@ mono_gc_cleanup (void)
        if (!gc_disabled) {
                finished = TRUE;
                if (mono_thread_internal_current () != gc_thread) {
+                       int ret;
                        gint64 start_ticks = mono_msec_ticks ();
                        gint64 end_ticks = start_ticks + 2000;
 
@@ -1037,8 +1038,6 @@ mono_gc_cleanup (void)
                        }
 
                        if (!finalizer_thread_exited) {
-                               int ret;
-
                                /* Set a flag which the finalizer thread can check */
                                suspend_finalizers = TRUE;
                                mono_gc_suspend_finalizers ();
@@ -1049,23 +1048,22 @@ mono_gc_cleanup (void)
                                /* Wait for it to stop */
                                ret = guarded_wait (gc_thread->handle, 100, TRUE);
 
-                               if (ret == WAIT_TIMEOUT) {
+                               if (ret == MONO_THREAD_INFO_WAIT_RET_TIMEOUT) {
                                        /*
                                         * The finalizer thread refused to exit. Make it stop.
                                         */
                                        mono_thread_internal_stop (gc_thread);
                                        ret = guarded_wait (gc_thread->handle, 100, TRUE);
-                                       g_assert (ret != WAIT_TIMEOUT);
+                                       g_assert (ret != MONO_THREAD_INFO_WAIT_RET_TIMEOUT);
                                        /* The thread can't set this flag */
                                        finalizer_thread_exited = TRUE;
                                }
                        }
 
-                       int ret;
 
                        /* Wait for the thread to actually exit */
                        ret = guarded_wait (gc_thread->handle, INFINITE, TRUE);
-                       g_assert (ret == WAIT_OBJECT_0);
+                       g_assert (ret == MONO_THREAD_INFO_WAIT_RET_SUCCESS_0);
 
                        mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));
                        g_assert (finalizer_thread_exited);
index 44327aed131a7f85595486d2465e19293180d58f..e201b38c687582f3c20bcb50b3d420b58bbddd67 100644 (file)
@@ -163,8 +163,10 @@ mono_handle_stack_scan (HandleStack *stack, GcScanFunc func, gpointer gc_data)
 
        while (cur) {
                int i;
-               for (i = 0; i < cur->size; ++i)
-                       func ((gpointer*)&cur->objects [i], gc_data);
+               for (i = 0; i < cur->size; ++i) {
+                       if (cur->objects [i] != NULL)
+                               func ((gpointer*)&cur->objects [i], gc_data);
+               }
                if (cur == last)
                        break;
                cur = cur->next;
@@ -185,7 +187,7 @@ mono_stack_mark_record_size (MonoThreadInfo *info, HandleStackMark *stackmark, c
        }
 
        if (size > THIS_IS_AN_OK_NUMBER_OF_HANDLES)
-               printf ("%s USED %d handles\n", func_name, size);
+               g_warning ("%s USED %d handles\n", func_name, size);
 }
 
 /*
index 507c67244a750418461cd8a74f4660d0e10c4cdc..f264c4851ac7836012af8b232aae3faf33ddb63c 100644 (file)
@@ -84,6 +84,9 @@ ICALL(COMPROX_1, "AddProxy", ves_icall_Mono_Interop_ComInteropProxy_AddProxy)
 ICALL(COMPROX_2, "FindProxy", ves_icall_Mono_Interop_ComInteropProxy_FindProxy)
 #endif
 
+ICALL_TYPE(TLS_PROVIDER_FACTORY, "Mono.Net.Security.MonoTlsProviderFactory", TLS_PROVIDER_FACTORY_1)
+ICALL(TLS_PROVIDER_FACTORY_1, "IsBtlsSupported", ves_icall_Mono_TlsProviderFactory_IsBtlsSupported)
+
 ICALL_TYPE(RUNTIME, "Mono.Runtime", RUNTIME_1)
 ICALL(RUNTIME_1, "GetDisplayName", ves_icall_Mono_Runtime_GetDisplayName)
 ICALL(RUNTIME_12, "GetNativeStackTrace", ves_icall_Mono_Runtime_GetNativeStackTrace)
@@ -171,13 +174,13 @@ ICALL_TYPE (COMPO_W, "System.ComponentModel.Win32Exception", COMPO_W_1)
 ICALL (COMPO_W_1, "W32ErrorMessage", ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage)
 
 ICALL_TYPE(DEFAULTC, "System.Configuration.DefaultConfig", DEFAULTC_1)
-HANDLES(ICALL(DEFAULTC_1, "get_bundled_machine_config", get_bundled_machine_config))
+HANDLES(ICALL(DEFAULTC_1, "get_bundled_machine_config", ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config))
 ICALL(DEFAULTC_2, "get_machine_config_path", ves_icall_System_Configuration_DefaultConfig_get_machine_config_path)
 
 /* Note that the below icall shares the same function as DefaultConfig uses */
 ICALL_TYPE(INTCFGHOST, "System.Configuration.InternalConfigurationHost", INTCFGHOST_1)
 ICALL(INTCFGHOST_1, "get_bundled_app_config", get_bundled_app_config)
-ICALL(INTCFGHOST_2, "get_bundled_machine_config", get_bundled_machine_config)
+HANDLES(ICALL(INTCFGHOST_2, "get_bundled_machine_config", ves_icall_System_Configuration_InternalConfigurationHost_get_bundled_machine_config))
 
 ICALL_TYPE(CONSOLE, "System.ConsoleDriver", CONSOLE_1)
 ICALL(CONSOLE_1, "InternalKeyAvailable", ves_icall_System_ConsoleDriver_InternalKeyAvailable )
@@ -280,6 +283,7 @@ ICALL(ENV_13, "get_Platform", ves_icall_System_Environment_get_Platform)
 ICALL(ENV_14, "get_ProcessorCount", mono_cpu_count)
 ICALL(ENV_15, "get_TickCount", ves_icall_System_Environment_get_TickCount)
 ICALL(ENV_16, "get_UserName", ves_icall_System_Environment_get_UserName)
+HANDLES(ICALL(ENV_16b, "get_bundled_machine_config", ves_icall_System_Environment_get_bundled_machine_config))
 ICALL(ENV_16m, "internalBroadcastSettingChange", ves_icall_System_Environment_BroadcastSettingChange)
 HANDLES(ICALL(ENV_17, "internalGetEnvironmentVariable_native", ves_icall_System_Environment_GetEnvironmentVariable_native))
 HANDLES(ICALL(ENV_18, "internalGetGacPath", ves_icall_System_Environment_GetGacPath))
@@ -439,8 +443,8 @@ ICALL(MCATTR_3, "IsDefinedInternal", custom_attrs_defined_internal)
 
 #ifndef DISABLE_SOCKETS
 ICALL_TYPE(NDNS, "System.Net.Dns", NDNS_1)
-ICALL(NDNS_1, "GetHostByAddr_internal(string,string&,string[]&,string[]&)", ves_icall_System_Net_Dns_GetHostByAddr_internal)
-ICALL(NDNS_2, "GetHostByName_internal(string,string&,string[]&,string[]&)", ves_icall_System_Net_Dns_GetHostByName_internal)
+ICALL(NDNS_1, "GetHostByAddr_internal(string,string&,string[]&,string[]&,int)", ves_icall_System_Net_Dns_GetHostByAddr_internal)
+ICALL(NDNS_2, "GetHostByName_internal(string,string&,string[]&,string[]&,int)", ves_icall_System_Net_Dns_GetHostByName_internal)
 ICALL(NDNS_3, "GetHostName_internal(string&)", ves_icall_System_Net_Dns_GetHostName_internal)
 
 #if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
@@ -454,7 +458,7 @@ ICALL(SOCK_2, "Available_internal(intptr,int&)", ves_icall_System_Net_Sockets_So
 ICALL(SOCK_3, "Bind_internal(intptr,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_Bind_internal)
 ICALL(SOCK_4, "Blocking_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Blocking_internal)
 ICALL(SOCK_5, "Close_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_Close_internal)
-ICALL(SOCK_6, "Connect_internal(intptr,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_Connect_internal)
+ICALL(SOCK_6, "Connect_internal(intptr,System.Net.SocketAddress,int&,bool)", ves_icall_System_Net_Sockets_Socket_Connect_internal)
 ICALL (SOCK_6a, "Disconnect_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Disconnect_internal)
 ICALL(SOCK_7, "GetSocketOption_arr_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,byte[]&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal)
 ICALL(SOCK_8, "GetSocketOption_obj_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal)
@@ -462,15 +466,15 @@ ICALL(SOCK_21, "IOControl_internal(intptr,int,byte[],byte[],int&)", ves_icall_Sy
 ICALL(SOCK_9, "Listen_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_Listen_internal)
 ICALL(SOCK_10, "LocalEndPoint_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal)
 ICALL(SOCK_11, "Poll_internal", ves_icall_System_Net_Sockets_Socket_Poll_internal)
-ICALL(SOCK_13, "ReceiveFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal)
-ICALL(SOCK_11a, "Receive_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_array_internal)
-ICALL(SOCK_12, "Receive_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_internal)
+ICALL(SOCK_13, "ReceiveFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&,bool)", ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal)
+ICALL(SOCK_11a, "Receive_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&,bool)", ves_icall_System_Net_Sockets_Socket_Receive_array_internal)
+ICALL(SOCK_12, "Receive_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&,bool)", ves_icall_System_Net_Sockets_Socket_Receive_internal)
 ICALL(SOCK_14, "RemoteEndPoint_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal)
 ICALL(SOCK_15, "Select_internal(System.Net.Sockets.Socket[]&,int,int&)", ves_icall_System_Net_Sockets_Socket_Select_internal)
-ICALL(SOCK_15a, "SendFile_internal(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions)", ves_icall_System_Net_Sockets_Socket_SendFile_internal)
-ICALL(SOCK_16, "SendTo_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_SendTo_internal)
-ICALL(SOCK_16a, "Send_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_array_internal)
-ICALL(SOCK_17, "Send_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_internal)
+ICALL(SOCK_15a, "SendFile_internal(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions,int&,bool)", ves_icall_System_Net_Sockets_Socket_SendFile_internal)
+ICALL(SOCK_16, "SendTo_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress,int&,bool)", ves_icall_System_Net_Sockets_Socket_SendTo_internal)
+ICALL(SOCK_16a, "Send_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&,bool)", ves_icall_System_Net_Sockets_Socket_Send_array_internal)
+ICALL(SOCK_17, "Send_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&,bool)", ves_icall_System_Net_Sockets_Socket_Send_internal)
 ICALL(SOCK_18, "SetSocketOption_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object,byte[],int,int&)", ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal)
 ICALL(SOCK_19, "Shutdown_internal(intptr,System.Net.Sockets.SocketShutdown,int&)", ves_icall_System_Net_Sockets_Socket_Shutdown_internal)
 ICALL(SOCK_20, "Socket_internal(System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.Net.Sockets.ProtocolType,int&)", ves_icall_System_Net_Sockets_Socket_Socket_internal)
@@ -544,12 +548,6 @@ ICALL(DYNM_1, "create_dynamic_method", ves_icall_DynamicMethod_create_dynamic_me
 ICALL_TYPE(ENUMB, "System.Reflection.Emit.EnumBuilder", ENUMB_1)
 ICALL(ENUMB_1, "setup_enum_type", ves_icall_EnumBuilder_setup_enum_type)
 
-ICALL_TYPE(GPARB, "System.Reflection.Emit.GenericTypeParameterBuilder", GPARB_1)
-ICALL(GPARB_1, "initialize", ves_icall_GenericTypeParameterBuilder_initialize_generic_parameter)
-
-ICALL_TYPE(METHODB, "System.Reflection.Emit.MethodBuilder", METHODB_1)
-ICALL(METHODB_1, "MakeGenericMethod", ves_icall_MethodBuilder_MakeGenericMethod)
-
 ICALL_TYPE(MODULEB, "System.Reflection.Emit.ModuleBuilder", MODULEB_10)
 ICALL(MODULEB_10, "GetRegisteredToken", ves_icall_ModuleBuilder_GetRegisteredToken)
 ICALL(MODULEB_8, "RegisterToken", ves_icall_ModuleBuilder_RegisterToken)
@@ -565,17 +563,8 @@ ICALL_TYPE(SIGH, "System.Reflection.Emit.SignatureHelper", SIGH_1)
 ICALL(SIGH_1, "get_signature_field", ves_icall_SignatureHelper_get_signature_field)
 ICALL(SIGH_2, "get_signature_local", ves_icall_SignatureHelper_get_signature_local)
 
-#ifndef DISABLE_REFLECTION_EMIT
-ICALL_TYPE(SYMBOLTYPE, "System.Reflection.Emit.SymbolType", SYMBOLTYPE_1)
-ICALL(SYMBOLTYPE_1, "create_unmanaged_type", ves_icall_SymbolType_create_unmanaged_type)
-#endif
-
 ICALL_TYPE(TYPEB, "System.Reflection.Emit.TypeBuilder", TYPEB_1)
-ICALL(TYPEB_1, "create_generic_class", ves_icall_TypeBuilder_create_generic_class)
-ICALL(TYPEB_3, "create_runtime_class", ves_icall_TypeBuilder_create_runtime_class)
-ICALL(TYPEB_4, "get_IsGenericParameter", ves_icall_TypeBuilder_get_IsGenericParameter)
-ICALL(TYPEB_5, "get_event_info", ves_icall_TypeBuilder_get_event_info)
-ICALL(TYPEB_7, "setup_internal_class", ves_icall_TypeBuilder_setup_internal_class)
+ICALL(TYPEB_1, "create_runtime_class", ves_icall_TypeBuilder_create_runtime_class)
 
 ICALL_TYPE(EVENTI, "System.Reflection.EventInfo", EVENTI_1)
 ICALL(EVENTI_1, "internal_from_handle_type", ves_icall_System_Reflection_EventInfo_internal_from_handle_type)
@@ -626,10 +615,6 @@ ICALL(MFIELD_6, "ResolveType", ves_icall_MonoField_ResolveType)
 ICALL(MFIELD_4, "SetValueInternal", ves_icall_MonoField_SetValueInternal)
 ICALL(MFIELD_7, "get_core_clr_security_level", ves_icall_MonoField_get_core_clr_security_level)
 
-ICALL_TYPE(MGENCL, "System.Reflection.MonoGenericClass", MGENCL_5)
-ICALL(MGENCL_5, "initialize", mono_reflection_generic_class_initialize)
-ICALL(MGENCL_6, "register_with_runtime", mono_reflection_register_with_runtime)
-
 ICALL_TYPE(MMETH, "System.Reflection.MonoMethod", MMETH_2)
 ICALL(MMETH_2, "GetGenericArguments", ves_icall_MonoMethod_GetGenericArguments)
 ICALL(MMETH_3, "GetGenericMethodDefinition_impl", ves_icall_MonoMethod_GetGenericMethodDefinition)
@@ -687,6 +672,7 @@ ICALL(MARSHAL_1, "AddRefInternal", ves_icall_System_Runtime_InteropServices_Mars
 ICALL_TYPE(MARSHAL, "System.Runtime.InteropServices.Marshal", MARSHAL_2)
 #endif
 ICALL(MARSHAL_2, "AllocCoTaskMem", ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem)
+ICALL(MARSHAL_51,"AllocCoTaskMemSize(uintptr)", ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMemSize)
 ICALL(MARSHAL_3, "AllocHGlobal", ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal)
 ICALL(MARSHAL_50, "BufferToBSTR", ves_icall_System_Runtime_InteropServices_Marshal_BufferToBSTR)
 ICALL(MARSHAL_4, "DestroyStructure", ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure)
@@ -700,12 +686,15 @@ ICALL(MARSHAL_8, "GetComSlotForMethodInfoInternal", ves_icall_System_Runtime_Int
 ICALL(MARSHAL_9, "GetDelegateForFunctionPointerInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal)
 ICALL(MARSHAL_10, "GetFunctionPointerForDelegateInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal)
 #ifndef DISABLE_COM
+ICALL(MARSHAL_52, "GetHRForException_WinRT", ves_icall_System_Runtime_InteropServices_Marshal_GetHRForException_WinRT)
 ICALL(MARSHAL_45, "GetIDispatchForObjectInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetIDispatchForObjectInternal)
 ICALL(MARSHAL_46, "GetIUnknownForObjectInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal)
 #endif
 ICALL(MARSHAL_11, "GetLastWin32Error", ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error)
 #ifndef DISABLE_COM
+ICALL(MARSHAL_53, "GetNativeActivationFactory", ves_icall_System_Runtime_InteropServices_Marshal_GetNativeActivationFactory)
 ICALL(MARSHAL_47, "GetObjectForCCW", ves_icall_System_Runtime_InteropServices_Marshal_GetObjectForCCW)
+ICALL(MARSHAL_54, "GetRawIUnknownForComObjectNoAddRef", ves_icall_System_Runtime_InteropServices_Marshal_GetRawIUnknownForComObjectNoAddRef)
 ICALL(MARSHAL_48, "IsComObject", ves_icall_System_Runtime_InteropServices_Marshal_IsComObject)
 #endif
 ICALL(MARSHAL_12, "OffsetOf", ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf)
@@ -713,9 +702,7 @@ ICALL(MARSHAL_13, "Prelink", ves_icall_System_Runtime_InteropServices_Marshal_Pr
 ICALL(MARSHAL_14, "PrelinkAll", ves_icall_System_Runtime_InteropServices_Marshal_PrelinkAll)
 ICALL(MARSHAL_15, "PtrToStringAnsi(intptr)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi)
 ICALL(MARSHAL_16, "PtrToStringAnsi(intptr,int)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len)
-#ifndef DISABLE_COM
 ICALL(MARSHAL_17, "PtrToStringBSTR", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringBSTR)
-#endif
 ICALL(MARSHAL_18, "PtrToStringUni(intptr)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni)
 ICALL(MARSHAL_19, "PtrToStringUni(intptr,int)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni_len)
 ICALL(MARSHAL_20, "PtrToStructure(intptr,System.Type)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type)
@@ -739,6 +726,16 @@ ICALL(MARSHAL_35, "UnsafeAddrOfPinnedArrayElement", ves_icall_System_Runtime_Int
 ICALL(MARSHAL_41, "copy_from_unmanaged", ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged)
 ICALL(MARSHAL_42, "copy_to_unmanaged", ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged)
 
+#ifndef DISABLE_COM
+ICALL_TYPE(WINDOWSRUNTIME_UNM, "System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods", WINDOWSRUNTIME_UNM_0)
+ICALL(WINDOWSRUNTIME_UNM_0, "GetRestrictedErrorInfo", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_GetRestrictedErrorInfo)
+ICALL(WINDOWSRUNTIME_UNM_1, "RoOriginateLanguageException", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_RoOriginateLanguageException)
+ICALL(WINDOWSRUNTIME_UNM_2, "RoReportUnhandledError", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_RoReportUnhandledError)
+ICALL(WINDOWSRUNTIME_UNM_3, "WindowsCreateString", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsCreateString)
+ICALL(WINDOWSRUNTIME_UNM_4, "WindowsDeleteString", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsDeleteString)
+ICALL(WINDOWSRUNTIME_UNM_5, "WindowsGetStringRawBuffer", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsGetStringRawBuffer)
+#endif
+
 ICALL_TYPE(ACTS, "System.Runtime.Remoting.Activation.ActivationServices", ACTS_1)
 ICALL(ACTS_1, "AllocateUninitializedClassInstance", ves_icall_System_Runtime_Activation_ActivationServices_AllocateUninitializedClassInstance)
 ICALL(ACTS_2, "EnableProxyActivation", ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation)
diff --git a/mono/metadata/icall-internals.h b/mono/metadata/icall-internals.h
new file mode 100644 (file)
index 0000000..45a922c
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_ICALL_INTERNALS_H__
+#define __MONO_METADATA_ICALL_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+#include <mono/metadata/object-internals.h>
+
+// On Windows platform implementation of bellow methods are hosted in separate source file
+// icall-windows.c or icall-windows-*.c. On other platforms the implementation is still keept
+// in icall.c still declared as static and in some places even inlined.
+#ifdef HOST_WIN32
+void
+mono_icall_make_platform_path (gchar *path);
+
+const gchar *
+mono_icall_get_file_path_prefix (const gchar *path);
+
+gpointer
+mono_icall_module_get_hinstance (MonoReflectionModule *module);
+
+MonoString *
+mono_icall_get_machine_name (void);
+
+int
+mono_icall_get_platform (void);
+
+MonoString *
+mono_icall_get_new_line (void);
+
+MonoBoolean
+mono_icall_is_64bit_os (void);
+
+MonoArray *
+mono_icall_get_environment_variable_names (void);
+
+void
+mono_icall_set_environment_variable (MonoString *name, MonoString *value);
+
+MonoString *
+mono_icall_get_windows_folder_path (int folder);
+
+void
+mono_icall_broadcast_setting_change (void);
+
+void
+mono_icall_write_windows_debug_string (MonoString *message);
+
+gint32
+mono_icall_wait_for_input_idle (gpointer handle, gint32 milliseconds);
+#endif  /* HOST_WIN32 */
+
+// On platforms not using classic WIN API support the  implementation of bellow methods are hosted in separate source file
+// icall-windows-*.c. On platforms using classic WIN API the implementation is still keept in icall.c and still declared
+// static and in some places even inlined.
+#if !G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+MonoArray *
+mono_icall_get_logical_drives (void);
+
+guint32
+mono_icall_drive_info_get_drive_type (MonoString *root_path_name);
+#endif  /* !G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+#endif /* __MONO_METADATA_ICALL_INTERNALS_H__ */
diff --git a/mono/metadata/icall-windows-internals.h b/mono/metadata/icall-windows-internals.h
new file mode 100644 (file)
index 0000000..0093767
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_ICALL_WINDOWS_INTERNALS_H__
+#define __MONO_METADATA_ICALL_WINDOWS_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include "mono/metadata/icall-internals.h"
+#include "mono/metadata/object.h"
+#include "mono/metadata/object-internals.h"
+#include "mono/metadata/class.h"
+#include "mono/metadata/class-internals.h"
+#endif /* HOST_WIN32 */
+#endif /* __MONO_METADATA_ICALL_WINDOWS_INTERNALS_H__ */
diff --git a/mono/metadata/icall-windows-uwp.c b/mono/metadata/icall-windows-uwp.c
new file mode 100644 (file)
index 0000000..f43e22f
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * icall-windows-uwp.c: UWP icall support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include "mono/metadata/icall-windows-internals.h"
+
+MonoString *
+mono_icall_get_machine_name (void)
+{
+       g_unsupported_api ("GetComputerName");
+       return mono_string_new (mono_domain_get (), "mono");
+}
+
+MonoString *
+mono_icall_get_windows_folder_path (int folder)
+{
+       g_unsupported_api ("SHGetFolderPath");
+       return mono_string_new (mono_domain_get (), "");
+}
+
+MonoArray *
+mono_icall_get_logical_drives (void)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetLogicalDriveStrings");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetLogicalDriveStrings");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return NULL;
+}
+
+void
+mono_icall_broadcast_setting_change (void)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("SendMessageTimeout");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "SendMessageTimeout");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return;
+}
+
+guint32
+mono_icall_drive_info_get_drive_type (MonoString *root_path_name)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetDriveType");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetDriveType");
+       mono_error_set_pending_exception (&mono_error);
+
+       return DRIVE_UNKNOWN;
+}
+
+gint32
+mono_icall_wait_for_input_idle (gpointer handle, gint32 milliseconds)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("WaitForInputIdle");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "WaitForInputIdle");
+       mono_error_set_pending_exception (&mono_error);
+
+       return WAIT_TIMEOUT;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (icall_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/metadata/icall-windows.c b/mono/metadata/icall-windows.c
new file mode 100644 (file)
index 0000000..9ebcf30
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * icall-windows.c: Windows icall support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#include <config.h>
+#include <glib.h>
+
+#if defined(HOST_WIN32)
+#include <winsock2.h>
+#include <windows.h>
+#include "mono/metadata/icall-windows-internals.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+#include <shlobj.h>
+#endif
+
+void
+mono_icall_make_platform_path (gchar *path)
+{
+       for (size_t i = strlen (path); i > 0; i--)
+               if (path [i-1] == '\\')
+                       path [i-1] = '/';
+}
+
+const gchar *
+mono_icall_get_file_path_prefix (const gchar *path)
+{
+       if (*path == '/' && *(path + 1) == '/') {
+               return "file:";
+       } else {
+               return "file:///";
+       }
+}
+
+gpointer
+mono_icall_module_get_hinstance (MonoReflectionModule *module)
+{
+       if (module->image && module->image->is_module_handle)
+               return module->image->raw_data;
+
+       return (gpointer) (-1);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+MonoString *
+mono_icall_get_machine_name (void)
+{
+       gunichar2 *buf;
+       guint32 len;
+       MonoString *result;
+
+       len = MAX_COMPUTERNAME_LENGTH + 1;
+       buf = g_new (gunichar2, len);
+
+       result = NULL;
+       if (GetComputerName (buf, (PDWORD) &len)) {
+               MonoError error;
+               result = mono_string_new_utf16_checked (mono_domain_get (), buf, len, &error);
+               mono_error_set_pending_exception (&error);
+       }
+
+       g_free (buf);
+       return result;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+int
+mono_icall_get_platform (void)
+{
+       /* Win32NT */
+       return 2;
+}
+
+MonoString *
+mono_icall_get_new_line (void)
+{
+       return mono_string_new (mono_domain_get (), "\r\n");
+}
+
+MonoBoolean
+mono_icall_is_64bit_os (void)
+{
+#if SIZEOF_VOID_P == 8
+       return TRUE;
+#else
+       gboolean isWow64Process = FALSE;
+       if (IsWow64Process (GetCurrentProcess (), &isWow64Process)) {
+               return (MonoBoolean)isWow64Process;
+       }
+       return FALSE;
+#endif
+}
+
+MonoArray *
+mono_icall_get_environment_variable_names (void)
+{
+       MonoError error;
+       MonoArray *names;
+       MonoDomain *domain;
+       MonoString *str;
+       WCHAR* env_strings;
+       WCHAR* env_string;
+       WCHAR* equal_str;
+       int n = 0;
+
+       env_strings = GetEnvironmentStrings();
+
+       if (env_strings) {
+               env_string = env_strings;
+               while (*env_string != '\0') {
+               /* weird case that MS seems to skip */
+                       if (*env_string != '=')
+                               n++;
+                       while (*env_string != '\0')
+                               env_string++;
+                       env_string++;
+               }
+       }
+
+       domain = mono_domain_get ();
+       names = mono_array_new_checked (domain, mono_defaults.string_class, n, &error);
+       if (mono_error_set_pending_exception (&error))
+               return NULL;
+
+       if (env_strings) {
+               n = 0;
+               env_string = env_strings;
+               while (*env_string != '\0') {
+                       /* weird case that MS seems to skip */
+                       if (*env_string != '=') {
+                               equal_str = wcschr(env_string, '=');
+                               g_assert(equal_str);
+                               str = mono_string_new_utf16_checked (domain, env_string, (gint32)(equal_str - env_string), &error);
+                               if (mono_error_set_pending_exception (&error))
+                                       return NULL;
+
+                               mono_array_setref (names, n, str);
+                               n++;
+                       }
+                       while (*env_string != '\0')
+                               env_string++;
+                       env_string++;
+               }
+
+               FreeEnvironmentStrings (env_strings);
+       }
+
+       return names;
+}
+
+void
+mono_icall_set_environment_variable (MonoString *name, MonoString *value)
+{
+       gunichar2 *utf16_name, *utf16_value;
+
+       utf16_name = mono_string_to_utf16 (name);
+       if ((value == NULL) || (mono_string_length (value) == 0) || (mono_string_chars (value)[0] == 0)) {
+               SetEnvironmentVariable (utf16_name, NULL);
+               g_free (utf16_name);
+               return;
+       }
+
+       utf16_value = mono_string_to_utf16 (value);
+
+       SetEnvironmentVariable (utf16_name, utf16_value);
+
+       g_free (utf16_name);
+       g_free (utf16_value);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+MonoString *
+mono_icall_get_windows_folder_path (int folder)
+{
+       #ifndef CSIDL_FLAG_CREATE
+               #define CSIDL_FLAG_CREATE       0x8000
+       #endif
+
+       WCHAR path [MAX_PATH];
+       /* Create directory if no existing */
+       if (SUCCEEDED (SHGetFolderPathW (NULL, folder | CSIDL_FLAG_CREATE, NULL, 0, path))) {
+               int len = 0;
+               while (path [len])
+                       ++ len;
+               MonoError error;
+               MonoString *res = mono_string_new_utf16_checked (mono_domain_get (), path, len, &error);
+               mono_error_set_pending_exception (&error);
+               return res;
+       }
+       return mono_string_new (mono_domain_get (), "");
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+void
+mono_icall_broadcast_setting_change (void)
+{
+       SendMessageTimeout (HWND_BROADCAST, WM_SETTINGCHANGE, (WPARAM)NULL, (LPARAM)L"Environment", SMTO_ABORTIFHUNG, 2000, 0);
+}
+
+gint32
+mono_icall_wait_for_input_idle (gpointer handle, gint32 milliseconds)
+{
+       return WaitForInputIdle (handle, milliseconds);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+void
+mono_icall_write_windows_debug_string (MonoString *message)
+{
+       OutputDebugString (mono_string_chars (message));
+}
+
+#endif /* HOST_WIN32 */
index 4e5d773cb73447db0fb8e0f8cc4e80689d21b15b..29ee725a4db5e926d61af3cec194340f836c58a7 100644 (file)
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if defined (HOST_WIN32)
-#include <stdlib.h>
-#endif
 #if defined (HAVE_WCHAR_H)
 #include <wchar.h>
 #endif
-
+#include "mono/metadata/icall-internals.h"
 #include "mono/utils/mono-membar.h"
 #include <mono/metadata/object.h>
 #include <mono/metadata/threads.h>
@@ -66,7 +63,7 @@
 #include <mono/metadata/sysmath.h>
 #include <mono/metadata/string-icalls.h>
 #include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/process.h>
+#include <mono/metadata/w32process.h>
 #include <mono/metadata/environment.h>
 #include <mono/metadata/profiler-private.h>
 #include <mono/metadata/locales.h>
 #include <mono/utils/mono-os-mutex.h>
 #include <mono/utils/mono-threads.h>
 
-#if defined (HOST_WIN32)
-#include <windows.h>
-#include <shlobj.h>
-#endif
 #include "decimal-ms.h"
 #include "number-ms.h"
 
@@ -142,6 +135,20 @@ mono_class_init_checked (MonoClass *klass, MonoError *error)
                mono_error_set_for_class_failure (error, klass);
 }
 
+#ifndef HOST_WIN32
+static inline void
+mono_icall_make_platform_path (gchar *path)
+{
+       return;
+}
+
+static inline const gchar *
+mono_icall_get_file_path_prefix (const gchar *path)
+{
+       return "file://";
+}
+#endif /* HOST_WIN32 */
+
 ICALL_EXPORT MonoObject *
 ves_icall_System_Array_GetValueImpl (MonoArray *arr, guint32 pos)
 {
@@ -937,7 +944,7 @@ ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor (Mo
        klass = mono_class_from_mono_type (handle);
        MONO_CHECK_ARG (handle, klass,);
 
-       if (klass->generic_container)
+       if (mono_class_is_gtd (klass))
                return;
 
        vtable = mono_class_vtable_full (mono_domain_get (), klass, &error);
@@ -977,15 +984,24 @@ ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor (M
 ICALL_EXPORT MonoBoolean
 ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStack (void)
 {
+#if defined(TARGET_WIN32) || defined(HOST_WIN32)
+       // It does not work on win32
+#else
        guint8 *stack_addr;
        guint8 *current;
        size_t stack_size;
-       /* later make this configurable and per-arch */
-       int min_size = 4096 * 4 * sizeof (void*);
+       int min_size;
+       MonoInternalThread *thread;
+
        mono_thread_info_get_stack_bounds (&stack_addr, &stack_size);
        /* if we have no info we are optimistic and assume there is enough room */
        if (!stack_addr)
                return TRUE;
+
+       thread = mono_thread_internal_current ();
+       // .net seems to check that at least 50% of stack is available
+       min_size = thread->stack_size / 2;
+
        current = (guint8 *)&stack_addr;
        if (current > stack_addr) {
                if ((current - stack_addr) < min_size)
@@ -994,6 +1010,7 @@ ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStac
                if (current - (stack_addr - stack_size) < min_size)
                        return FALSE;
        }
+#endif
        return TRUE;
 }
 
@@ -1285,7 +1302,7 @@ get_caller_no_system_or_reflection (MonoMethod *m, gint32 no, gint32 ilo, gboole
 }
 
 static MonoReflectionType *
-type_from_parsed_name (MonoTypeNameParse *info, MonoBoolean ignoreCase, MonoError *error)
+type_from_parsed_name (MonoTypeNameParse *info, MonoBoolean ignoreCase, MonoAssembly **caller_assembly, MonoError *error)
 {
        MonoMethod *m, *dest;
 
@@ -1336,6 +1353,7 @@ type_from_parsed_name (MonoTypeNameParse *info, MonoBoolean ignoreCase, MonoErro
        } else {
                g_warning (G_STRLOC);
        }
+       *caller_assembly = assembly;
 
        if (info->assembly.name)
                assembly = mono_assembly_load (&info->assembly, assembly ? assembly->basedir : NULL, NULL);
@@ -1380,6 +1398,7 @@ ves_icall_System_Type_internal_from_name (MonoString *name,
        MonoTypeNameParse info;
        MonoReflectionType *type = NULL;
        gboolean parsedOk;
+       MonoAssembly *caller_assembly;
 
        char *str = mono_string_to_utf8_checked (name, &error);
        if (!is_ok (&error))
@@ -1395,18 +1414,27 @@ ves_icall_System_Type_internal_from_name (MonoString *name,
                goto leave;
        }
 
-       type = type_from_parsed_name (&info, ignoreCase, &error);
+       type = type_from_parsed_name (&info, ignoreCase, &caller_assembly, &error);
 
-       mono_reflection_free_type_info (&info);
-
-       if (!is_ok (&error))
+       if (!is_ok (&error)) {
+               mono_reflection_free_type_info (&info);
                goto leave;
+       }
 
-       if (type == NULL){
+       if (type == NULL) {
                if (throwOnError) {
-                       mono_error_set_type_load_name (&error, g_strdup (str), NULL, "");
-                       goto leave;
+                       char *tname = info.name_space ? g_strdup_printf ("%s.%s", info.name_space, info.name) : g_strdup (info.name);
+                       char *aname;
+                       if (info.assembly.name)
+                               aname = mono_stringify_assembly_name (&info.assembly);
+                       else if (caller_assembly)
+                               aname = mono_stringify_assembly_name (mono_assembly_get_name (caller_assembly));
+                       else
+                               aname = g_strdup ("");
+                       mono_error_set_type_load_name (&error, tname, aname, "");
                }
+               mono_reflection_free_type_info (&info);
+               goto leave;
        }
        
 leave:
@@ -1642,7 +1670,7 @@ ICALL_EXPORT guint32
 ves_icall_RuntimeTypeHandle_GetAttributes (MonoReflectionType *type)
 {
        MonoClass *klass = mono_class_from_mono_type (type->type);
-       return klass->flags;
+       return mono_class_get_flags (klass);
 }
 
 ICALL_EXPORT MonoReflectionMarshalAsAttribute*
@@ -1654,8 +1682,9 @@ ves_icall_System_Reflection_FieldInfo_get_marshal_info (MonoReflectionField *fie
        MonoType *ftype;
        int i;
 
-       if (klass->generic_container ||
-           (klass->generic_class && klass->generic_class->context.class_inst->is_open))
+       MonoGenericClass *gklass = mono_class_try_get_generic_class (klass);
+       if (mono_class_is_gtd (klass) ||
+           (gklass && gklass->context.class_inst->is_open))
                return NULL;
 
        ftype = mono_field_get_type (field->field);
@@ -1865,9 +1894,7 @@ ICALL_EXPORT gint32
 ves_icall_MonoField_GetFieldOffset (MonoReflectionField *field)
 {
        MonoClass *parent = field->field->parent;
-       if (!parent->size_inited)
-               mono_class_init (parent);
-       mono_class_setup_fields_locking (parent);
+       mono_class_setup_fields (parent);
 
        return field->field->offset - sizeof (MonoObject);
 }
@@ -2071,12 +2098,13 @@ ves_icall_MonoField_GetRawConstantValue (MonoReflectionField *rfield)
        if (image_is_dynamic (field->parent->image)) {
                MonoClass *klass = field->parent;
                int fidx = field - klass->fields;
+               MonoClassExt *ext = mono_class_get_ext (klass);
+
+               g_assert (ext);
+               g_assert (ext->field_def_values);
+               def_type = ext->field_def_values [fidx].def_type;
+               def_value = ext->field_def_values [fidx].data;
 
-               g_assert (fidx >= 0 && fidx < klass->field.count);
-               g_assert (klass->ext);
-               g_assert (klass->ext->field_def_values);
-               def_type = klass->ext->field_def_values [fidx].def_type;
-               def_value = klass->ext->field_def_values [fidx].data;
                if (def_type == MONO_TYPE_END) {
                        mono_set_pending_exception (mono_get_exception_invalid_operation (NULL));
                        return NULL;
@@ -2343,7 +2371,7 @@ fill_iface_array (gpointer key, gpointer value, gpointer user_data)
        if (!mono_error_ok (data->error))
                return;
 
-       if (data->context && ic->generic_class && ic->generic_class->context.class_inst->is_open) {
+       if (data->context && mono_class_is_ginst (ic) && mono_class_get_generic_class (ic)->context.class_inst->is_open) {
                inflated = ret = mono_class_inflate_generic_type_checked (ret, data->context, data->error);
                if (!mono_error_ok (data->error))
                        return;
@@ -2378,9 +2406,9 @@ ves_icall_RuntimeType_GetInterfaces (MonoReflectionType* type)
 
        GHashTable *iface_hash = g_hash_table_new (get_interfaces_hash, NULL);
 
-       if (klass->generic_class && klass->generic_class->context.class_inst->is_open) {
+       if (mono_class_is_ginst (klass) && mono_class_get_generic_class (klass)->context.class_inst->is_open) {
                data.context = mono_class_get_context (klass);
-               klass = klass->generic_class->container_class;
+               klass = mono_class_get_generic_class (klass)->container_class;
        }
 
        for (parent = klass; parent; parent = parent->parent) {
@@ -2703,8 +2731,8 @@ ves_icall_RuntimeType_GetGenericArguments (MonoReflectionType *type, MonoBoolean
 
        klass = mono_class_from_mono_type (type->type);
 
-       if (klass->generic_container) {
-               MonoGenericContainer *container = klass->generic_container;
+       if (mono_class_is_gtd (klass)) {
+               MonoGenericContainer *container = mono_class_get_generic_container (klass);
                res = create_type_array (domain, runtimeTypeArray, container->type_argc, &error);
                if (mono_error_set_pending_exception (&error))
                        return NULL;
@@ -2717,8 +2745,8 @@ ves_icall_RuntimeType_GetGenericArguments (MonoReflectionType *type, MonoBoolean
 
                        mono_array_setref (res, i, rt);
                }
-       } else if (klass->generic_class) {
-               MonoGenericInst *inst = klass->generic_class->context.class_inst;
+       } else if (mono_class_is_ginst (klass)) {
+               MonoGenericInst *inst = mono_class_get_generic_class (klass)->context.class_inst;
                res = create_type_array (domain, runtimeTypeArray, inst->type_argc, &error);
                if (mono_error_set_pending_exception (&error))
                        return NULL;
@@ -2747,7 +2775,7 @@ ves_icall_RuntimeTypeHandle_IsGenericTypeDefinition (MonoReflectionType *type)
                return FALSE;
 
        klass = mono_class_from_mono_type (type->type);
-       return klass->generic_container != NULL;
+       return mono_class_is_gtd (klass);
 }
 
 ICALL_EXPORT MonoReflectionType*
@@ -2762,11 +2790,11 @@ ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl (MonoReflectionType *t
 
        klass = mono_class_from_mono_type (type->type);
 
-       if (klass->generic_container) {
+       if (mono_class_is_gtd (klass)) {
                return type; /* check this one */
        }
-       if (klass->generic_class) {
-               MonoClass *generic_class = klass->generic_class->container_class;
+       if (mono_class_is_ginst (klass)) {
+               MonoClass *generic_class = mono_class_get_generic_class (klass)->container_class;
                gpointer tb;
 
                tb = mono_class_get_ref_info (generic_class);
@@ -2815,7 +2843,7 @@ ves_icall_RuntimeType_MakeGenericType (MonoReflectionType *type, MonoArray *type
        klass = mono_class_from_mono_type (geninst);
 
        /*we might inflate to the GTD*/
-       if (klass->generic_class && !mono_verifier_class_is_valid_generic_instantiation (klass)) {
+       if (mono_class_is_ginst (klass) && !mono_verifier_class_is_valid_generic_instantiation (klass)) {
                mono_set_pending_exception (mono_get_exception_argument ("typeArguments", "Invalid generic arguments"));
                return NULL;
        }
@@ -2838,7 +2866,7 @@ ves_icall_RuntimeTypeHandle_HasInstantiation (MonoReflectionType *type)
                return FALSE;
 
        klass = mono_class_from_mono_type (type->type);
-       return klass->generic_class != NULL || klass->generic_container != NULL;
+       return mono_class_is_ginst (klass) || mono_class_is_gtd (klass);
 }
 
 ICALL_EXPORT gint32
@@ -3159,7 +3187,7 @@ ves_icall_InternalInvoke (MonoReflectionMethod *method, MonoObject *this_arg, Mo
                return NULL;
        }
 
-       if ((m->klass->flags & TYPE_ATTRIBUTE_ABSTRACT) && !strcmp (m->name, ".ctor") && !this_arg) {
+       if (mono_class_is_abstract (m->klass) && !strcmp (m->name, ".ctor") && !this_arg) {
                mono_gc_wbarrier_generic_store (exc, (MonoObject*) mono_exception_from_name_msg (mono_defaults.corlib, "System.Reflection", "TargetException", "Cannot invoke constructor of an abstract class."));
                return NULL;
        }
@@ -4272,15 +4300,15 @@ ves_icall_RuntimeType_GetNestedTypes_native (MonoReflectionType *type, char *str
         * nested types that aren't generic.  In any case, the container of that
         * nested type would be the generic type definition.
         */
-       if (klass->generic_class)
-               klass = klass->generic_class->container_class;
+       if (mono_class_is_ginst (klass))
+               klass = mono_class_get_generic_class (klass)->container_class;
 
        res_array = g_ptr_array_new ();
        
        iter = NULL;
        while ((nested = mono_class_get_nested_types (klass, &iter))) {
                match = 0;
-               if ((nested->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK) == TYPE_ATTRIBUTE_NESTED_PUBLIC) {
+               if ((mono_class_get_flags (nested) & TYPE_ATTRIBUTE_VISIBILITY_MASK) == TYPE_ATTRIBUTE_NESTED_PUBLIC) {
                        if (bflags & BFLAGS_Public)
                                match++;
                } else {
@@ -4417,8 +4445,8 @@ ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssembly *as
                /* need to report exceptions ? */
                if (throwOnError && mono_class_has_failure (klass)) {
                        /* report SecurityException (or others) that occured when loading the assembly */
-                       MonoException *exc = mono_class_get_exception_for_failure (klass);
-                       mono_set_pending_exception (exc);
+                       mono_error_set_for_class_failure (&error, klass);
+                       mono_error_set_pending_exception (&error);
                        return NULL;
                }
        }
@@ -4479,25 +4507,13 @@ ves_icall_System_Reflection_Assembly_get_code_base (MonoReflectionAssembly *asse
 
        replace_shadow_path (domain, dirname, &absolute);
        g_free (dirname);
-#if HOST_WIN32
-       {
-               gint i;
-               for (i = strlen (absolute) - 1; i >= 0; i--)
-                       if (absolute [i] == '\\')
-                               absolute [i] = '/';
-       }
-#endif
+
+       mono_icall_make_platform_path (absolute);
+
        if (escaped) {
                uri = g_filename_to_uri (absolute, NULL, NULL);
        } else {
-               const char *prepend = "file://";
-#if HOST_WIN32
-               if (*absolute == '/' && *(absolute + 1) == '/') {
-                       prepend = "file:";
-               } else {
-                       prepend = "file:///";
-               }
-#endif
+               const gchar *prepend = mono_icall_get_file_path_prefix (absolute);
                uri = g_strconcat (prepend, absolute, NULL);
        }
 
@@ -5080,10 +5096,10 @@ mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass)
                MonoGenericContext ctx;
                ctx.method_inst = inflated->context.method_inst;
                ctx.class_inst = inflated->context.class_inst;
-               if (klass->generic_class)
-                       ctx.class_inst = klass->generic_class->context.class_inst;
-               else if (klass->generic_container)
-                       ctx.class_inst = klass->generic_container->context.class_inst;
+               if (mono_class_is_ginst (klass))
+                       ctx.class_inst = mono_class_get_generic_class (klass)->context.class_inst;
+               else if (mono_class_is_gtd (klass))
+                       ctx.class_inst = mono_class_get_generic_container (klass)->context.class_inst;
                result = mono_class_inflate_generic_method_full_checked (inflated->declaring, klass, &ctx, &error);
                g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
                return result;
@@ -5092,7 +5108,8 @@ mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass)
        mono_class_setup_methods (method->klass);
        if (mono_class_has_failure (method->klass))
                return NULL;
-       for (i = 0; i < method->klass->method.count; ++i) {
+       int mcount = mono_class_get_method_count (method->klass);
+       for (i = 0; i < mcount; ++i) {
                if (method->klass->methods [i] == method) {
                        offset = i;
                        break;
@@ -5101,7 +5118,7 @@ mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass)
        mono_class_setup_methods (klass);
        if (mono_class_has_failure (klass))
                return NULL;
-       g_assert (offset >= 0 && offset < klass->method.count);
+       g_assert (offset >= 0 && offset < mono_class_get_method_count (klass));
        return klass->methods [offset];
 }
 
@@ -5286,25 +5303,14 @@ fill_reflection_assembly_name (MonoDomain *domain, MonoReflectionAssemblyName *a
 
        codebase = NULL;
        if (absolute != NULL && *absolute != '\0') {
-               const gchar *prepend = "file://";
                gchar *result;
 
                codebase = g_strdup (absolute);
 
-#if HOST_WIN32
-               {
-                       gint i;
-                       for (i = strlen (codebase) - 1; i >= 0; i--)
-                               if (codebase [i] == '\\')
-                                       codebase [i] = '/';
+               mono_icall_make_platform_path (codebase);
+
+               const gchar *prepend = mono_icall_get_file_path_prefix (codebase);
 
-                       if (*codebase == '/' && *(codebase + 1) == '/') {
-                               prepend = "file:";
-                       } else {
-                               prepend = "file:///";
-                       }
-               }
-#endif
                result = g_strconcat (prepend, codebase, NULL);
                g_free (codebase);
                codebase = result;
@@ -5717,15 +5723,18 @@ ves_icall_System_Reflection_Module_GetGuidInternal (MonoReflectionModuleHandle r
        return mono_string_new_handle (domain, image->guid, error);
 }
 
+#ifndef HOST_WIN32
+static inline gpointer
+mono_icall_module_get_hinstance (MonoReflectionModule *module)
+{
+       return (gpointer) (-1);
+}
+#endif /* HOST_WIN32 */
+
 ICALL_EXPORT gpointer
 ves_icall_System_Reflection_Module_GetHINSTANCE (MonoReflectionModule *module)
 {
-#ifdef HOST_WIN32
-       if (module->image && module->image->is_module_handle)
-               return module->image->raw_data;
-#endif
-
-       return (gpointer) (-1);
+       return mono_icall_module_get_hinstance (module);
 }
 
 ICALL_EXPORT void
@@ -6128,7 +6137,6 @@ static void
 check_for_invalid_type (MonoClass *klass, MonoError *error)
 {
        char *name;
-       MonoString *str;
 
        mono_error_init (error);
 
@@ -6136,10 +6144,7 @@ check_for_invalid_type (MonoClass *klass, MonoError *error)
                return;
 
        name = mono_type_get_full_name (klass);
-       str =  mono_string_new (mono_domain_get (), name);
-       g_free (name);
-       mono_error_set_exception_instance (error, mono_get_exception_type_load (str, NULL));
-
+       mono_error_set_type_load_name (error, name, g_strdup (""), "");
 }
 ICALL_EXPORT MonoReflectionType *
 ves_icall_RuntimeType_make_array_type (MonoReflectionType *type, int rank)
@@ -6150,7 +6155,8 @@ ves_icall_RuntimeType_make_array_type (MonoReflectionType *type, int rank)
 
        klass = mono_class_from_mono_type (type->type);
        check_for_invalid_type (klass, &error);
-       mono_error_set_pending_exception (&error);
+       if (mono_error_set_pending_exception (&error))
+               return NULL;
 
        if (rank == 0) //single dimentional array
                aklass = mono_array_class_get (klass, 1);
@@ -6455,28 +6461,11 @@ ves_icall_System_Environment_get_UserName (void)
        return mono_string_new (mono_domain_get (), g_get_user_name ());
 }
 
-
-ICALL_EXPORT MonoString *
-ves_icall_System_Environment_get_MachineName (void)
+#ifndef HOST_WIN32
+static MonoString *
+mono_icall_get_machine_name (void)
 {
-#if defined (HOST_WIN32)
-       gunichar2 *buf;
-       guint32 len;
-       MonoString *result;
-
-       len = MAX_COMPUTERNAME_LENGTH + 1;
-       buf = g_new (gunichar2, len);
-
-       result = NULL;
-       if (GetComputerName (buf, (PDWORD) &len)) {
-               MonoError error;
-               result = mono_string_new_utf16_checked (mono_domain_get (), buf, len, &error);
-               mono_error_set_pending_exception (&error);
-       }
-
-       g_free (buf);
-       return result;
-#elif !defined(DISABLE_SOCKETS)
+#if !defined(DISABLE_SOCKETS)
        MonoString *result;
        char *buf;
        int n;
@@ -6499,14 +6488,19 @@ ves_icall_System_Environment_get_MachineName (void)
        return mono_string_new (mono_domain_get (), "mono");
 #endif
 }
+#endif /* !HOST_WIN32 */
 
-ICALL_EXPORT int
-ves_icall_System_Environment_get_Platform (void)
+ICALL_EXPORT MonoString *
+ves_icall_System_Environment_get_MachineName (void)
 {
-#if defined (TARGET_WIN32)
-       /* Win32NT */
-       return 2;
-#elif defined(__MACH__)
+       return mono_icall_get_machine_name ();
+}
+
+#ifndef HOST_WIN32
+static inline int
+mono_icall_get_platform (void)
+{
+#if defined(__MACH__)
        /* OSX */
        //
        // Notice that the value is hidden from user code, and only exposed
@@ -6521,29 +6515,36 @@ ves_icall_System_Environment_get_Platform (void)
        return 4;
 #endif
 }
+#endif /* !HOST_WIN32 */
+
+ICALL_EXPORT int
+ves_icall_System_Environment_get_Platform (void)
+{
+       return mono_icall_get_platform ();
+}
+
+#ifndef HOST_WIN32
+static inline MonoString *
+mono_icall_get_new_line (void)
+{
+       return mono_string_new (mono_domain_get (), "\n");
+}
+#endif /* !HOST_WIN32 */
 
 ICALL_EXPORT MonoString *
 ves_icall_System_Environment_get_NewLine (void)
 {
-#if defined (HOST_WIN32)
-       return mono_string_new (mono_domain_get (), "\r\n");
-#else
-       return mono_string_new (mono_domain_get (), "\n");
-#endif
+       return mono_icall_get_new_line ();
 }
 
-ICALL_EXPORT MonoBoolean
-ves_icall_System_Environment_GetIs64BitOperatingSystem (void)
+#ifndef HOST_WIN32
+static inline MonoBoolean
+mono_icall_is_64bit_os (void)
 {
 #if SIZEOF_VOID_P == 8
        return TRUE;
 #else
-#ifdef HOST_WIN32
-       gboolean isWow64Process = FALSE;
-       if (IsWow64Process (GetCurrentProcess (), &isWow64Process)) {
-               return (MonoBoolean)isWow64Process;
-       }
-#elif defined(HAVE_SYS_UTSNAME_H)
+#if defined(HAVE_SYS_UTSNAME_H)
        struct utsname name;
 
        if (uname (&name) >= 0) {
@@ -6553,6 +6554,13 @@ ves_icall_System_Environment_GetIs64BitOperatingSystem (void)
        return FALSE;
 #endif
 }
+#endif /* !HOST_WIN32 */
+
+ICALL_EXPORT MonoBoolean
+ves_icall_System_Environment_GetIs64BitOperatingSystem (void)
+{
+       return mono_icall_is_64bit_os ();
+}
 
 ICALL_EXPORT MonoStringHandle
 ves_icall_System_Environment_GetEnvironmentVariable_native (const gchar *utf8_name, MonoError *error)
@@ -6603,65 +6611,10 @@ ves_icall_System_Environment_GetCoomandLineArgs (void)
        return result;
 }
 
-ICALL_EXPORT MonoArray *
-ves_icall_System_Environment_GetEnvironmentVariableNames (void)
+#ifndef HOST_WIN32
+static MonoArray *
+mono_icall_get_environment_variable_names (void)
 {
-#ifdef HOST_WIN32
-       MonoError error;
-       MonoArray *names;
-       MonoDomain *domain;
-       MonoString *str;
-       WCHAR* env_strings;
-       WCHAR* env_string;
-       WCHAR* equal_str;
-       int n = 0;
-
-       env_strings = GetEnvironmentStrings();
-
-       if (env_strings) {
-               env_string = env_strings;
-               while (*env_string != '\0') {
-               /* weird case that MS seems to skip */
-                       if (*env_string != '=')
-                               n++;
-                       while (*env_string != '\0')
-                               env_string++;
-                       env_string++;
-               }
-       }
-
-       domain = mono_domain_get ();
-       names = mono_array_new_checked (domain, mono_defaults.string_class, n, &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
-
-       if (env_strings) {
-               n = 0;
-               env_string = env_strings;
-               while (*env_string != '\0') {
-                       /* weird case that MS seems to skip */
-                       if (*env_string != '=') {
-                               equal_str = wcschr(env_string, '=');
-                               g_assert(equal_str);
-                               MonoError error;
-                               str = mono_string_new_utf16_checked (domain, env_string, equal_str-env_string, &error);
-                               if (mono_error_set_pending_exception (&error))
-                                       return NULL;
-
-                               mono_array_setref (names, n, str);
-                               n++;
-                       }
-                       while (*env_string != '\0')
-                               env_string++;
-                       env_string++;
-               }
-
-               FreeEnvironmentStrings (env_strings);
-       }
-
-       return names;
-
-#else
        MonoError error;
        MonoArray *names;
        MonoDomain *domain;
@@ -6692,34 +6645,22 @@ ves_icall_System_Environment_GetEnvironmentVariableNames (void)
        }
 
        return names;
-#endif
 }
+#endif /* !HOST_WIN32 */
 
-ICALL_EXPORT void
-ves_icall_System_Environment_InternalSetEnvironmentVariable (MonoString *name, MonoString *value)
+ICALL_EXPORT MonoArray *
+ves_icall_System_Environment_GetEnvironmentVariableNames (void)
+{
+       return mono_icall_get_environment_variable_names ();
+}
+
+#ifndef HOST_WIN32
+static void
+mono_icall_set_environment_variable (MonoString *name, MonoString *value)
 {
-#ifdef HOST_WIN32
-       gunichar2 *utf16_name, *utf16_value;
-#else
        gchar *utf8_name, *utf8_value;
        MonoError error;
-#endif
 
-#ifdef HOST_WIN32
-       utf16_name = mono_string_to_utf16 (name);
-       if ((value == NULL) || (mono_string_length (value) == 0) || (mono_string_chars (value)[0] == 0)) {
-               SetEnvironmentVariable (utf16_name, NULL);
-               g_free (utf16_name);
-               return;
-       }
-
-       utf16_value = mono_string_to_utf16 (value);
-
-       SetEnvironmentVariable (utf16_name, utf16_value);
-
-       g_free (utf16_name);
-       g_free (utf16_value);
-#else
        utf8_name = mono_string_to_utf8_checked (name, &error); /* FIXME: this should be ascii */
        if (mono_error_set_pending_exception (&error))
                return;
@@ -6740,7 +6681,13 @@ ves_icall_System_Environment_InternalSetEnvironmentVariable (MonoString *name, M
 
        g_free (utf8_name);
        g_free (utf8_value);
-#endif
+}
+#endif /* !HOST_WIN32 */
+
+ICALL_EXPORT void
+ves_icall_System_Environment_InternalSetEnvironmentVariable (MonoString *name, MonoString *value)
+{
+       mono_icall_set_environment_variable (name, value);
 }
 
 ICALL_EXPORT void
@@ -6772,36 +6719,27 @@ ves_icall_System_Environment_GetGacPath (MonoError *error)
        return mono_string_new_handle (mono_domain_get (), mono_assembly_getrootdir (), error);
 }
 
-ICALL_EXPORT MonoString*
-ves_icall_System_Environment_GetWindowsFolderPath (int folder)
+#ifndef HOST_WIN32
+static inline MonoString *
+mono_icall_get_windows_folder_path (int folder)
 {
-#if defined (HOST_WIN32)
-       #ifndef CSIDL_FLAG_CREATE
-               #define CSIDL_FLAG_CREATE       0x8000
-       #endif
-
-       WCHAR path [MAX_PATH];
-       /* Create directory if no existing */
-       if (SUCCEEDED (SHGetFolderPathW (NULL, folder | CSIDL_FLAG_CREATE, NULL, 0, path))) {
-               int len = 0;
-               while (path [len])
-                       ++ len;
-               MonoError error;
-               MonoString *res = mono_string_new_utf16_checked (mono_domain_get (), path, len, &error);
-               mono_error_set_pending_exception (&error);
-               return res;
-       }
-#else
        g_warning ("ves_icall_System_Environment_GetWindowsFolderPath should only be called on Windows!");
-#endif
        return mono_string_new (mono_domain_get (), "");
 }
+#endif /* !HOST_WIN32 */
 
-ICALL_EXPORT MonoArray *
-ves_icall_System_Environment_GetLogicalDrives (void)
+ICALL_EXPORT MonoString*
+ves_icall_System_Environment_GetWindowsFolderPath (int folder)
+{
+       return mono_icall_get_windows_folder_path (folder);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static MonoArray *
+mono_icall_get_logical_drives (void)
 {
        MonoError error;
-        gunichar2 buf [256], *ptr, *dname;
+       gunichar2 buf [256], *ptr, *dname;
        gunichar2 *u16;
        guint initial_size = 127, size = 128;
        gint ndrives;
@@ -6856,6 +6794,13 @@ leave:
 
        return result;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+ICALL_EXPORT MonoArray *
+ves_icall_System_Environment_GetLogicalDrives (void)
+{
+       return mono_icall_get_logical_drives ();
+}
 
 ICALL_EXPORT MonoString *
 ves_icall_System_IO_DriveInfo_GetDriveFormat (MonoString *path)
@@ -6917,7 +6862,7 @@ ves_icall_System_Text_EncodingHelper_InternalCodePage (gint32 *int_code_page)
        *int_code_page = -1;
 
        g_get_charset (&cset);
-       c = codepage = strdup (cset);
+       c = codepage = g_strdup (cset);
        for (c = codepage; *c; c++){
                if (isascii (*c) && isalpha (*c))
                        *c = tolower (*c);
@@ -6964,12 +6909,18 @@ ves_icall_System_Environment_get_HasShutdownStarted (void)
        return FALSE;
 }
 
+#ifndef HOST_WIN32
+static inline void
+mono_icall_broadcast_setting_change (void)
+{
+       return;
+}
+#endif /* !HOST_WIN32 */
+
 ICALL_EXPORT void
 ves_icall_System_Environment_BroadcastSettingChange (void)
 {
-#ifdef HOST_WIN32
-       SendMessageTimeout (HWND_BROADCAST, WM_SETTINGCHANGE, (WPARAM)NULL, (LPARAM)L"Environment", SMTO_ABORTIFHUNG, 2000, 0);
-#endif
+       mono_icall_broadcast_setting_change ();
 }
 
 ICALL_EXPORT
@@ -7036,7 +6987,7 @@ ves_icall_Remoting_RemotingServices_GetVirtualMethod (
        mono_class_setup_vtable (klass);
        vtable = klass->vtable;
 
-       if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (method->klass)) {
                gboolean variance_used = FALSE;
                /*MS fails with variant interfaces but it's the right thing to do anyway.*/
                int offs = mono_class_interface_offset_with_variance (klass, method->klass, &variance_used);
@@ -7099,7 +7050,7 @@ ves_icall_System_Runtime_Activation_ActivationServices_AllocateUninitializedClas
        if (mono_error_set_pending_exception (&error))
                return NULL;
 
-       if (MONO_CLASS_IS_INTERFACE (klass) || (klass->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
+       if (MONO_CLASS_IS_INTERFACE (klass) || mono_class_is_abstract (klass)) {
                mono_set_pending_exception (mono_get_exception_argument ("type", "Type cannot be instantiated"));
                return NULL;
        }
@@ -7158,12 +7109,21 @@ ves_icall_System_IO_DriveInfo_GetDiskFreeSpace (MonoString *path_name, guint64 *
        return result;
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static inline guint32
+mono_icall_drive_info_get_drive_type (MonoString *root_path_name)
+{
+       return GetDriveType (mono_string_chars (root_path_name));
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
 ICALL_EXPORT guint32
 ves_icall_System_IO_DriveInfo_GetDriveType (MonoString *root_path_name)
 {
-       return GetDriveType (mono_string_chars (root_path_name));
+       return mono_icall_drive_info_get_drive_type (root_path_name);
 }
-#endif
+
+#endif /* PLATFORM_NO_DRIVEINFO */
 
 ICALL_EXPORT gpointer
 ves_icall_RuntimeMethodHandle_GetFunctionPointer (MonoMethod *method)
@@ -7182,15 +7142,8 @@ ves_icall_System_Configuration_DefaultConfig_get_machine_config_path (void)
 
        path = g_build_path (G_DIR_SEPARATOR_S, mono_get_config_dir (), "mono", mono_get_runtime_info ()->framework_version, "machine.config", NULL);
 
-#if defined (HOST_WIN32)
-       /* Avoid mixing '/' and '\\' */
-       {
-               gint i;
-               for (i = strlen (path) - 1; i >= 0; i--)
-                       if (path [i] == '/')
-                               path [i] = '\\';
-       }
-#endif
+       mono_icall_make_platform_path (path);
+
        mcpath = mono_string_new (mono_domain_get (), path);
        g_free (path);
 
@@ -7244,7 +7197,6 @@ get_bundled_app_config (void)
        return mono_string_new (mono_domain_get (), app_config);
 }
 
-/* this is an icall */
 static MonoStringHandle
 get_bundled_machine_config (MonoError *error)
 {
@@ -7258,6 +7210,26 @@ get_bundled_machine_config (MonoError *error)
        return mono_string_new_handle (mono_domain_get (), machine_config, error);
 }
 
+ICALL_EXPORT MonoStringHandle
+ves_icall_System_Environment_get_bundled_machine_config (MonoError *error)
+{
+       return get_bundled_machine_config (error);
+}
+
+
+ICALL_EXPORT MonoStringHandle
+ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config (MonoError *error)
+{
+       return get_bundled_machine_config (error);
+}
+
+ICALL_EXPORT MonoStringHandle
+ves_icall_System_Configuration_InternalConfigurationHost_get_bundled_machine_config (MonoError *error)
+{
+       return get_bundled_machine_config (error);
+}
+
+
 ICALL_EXPORT MonoString *
 ves_icall_System_Web_Util_ICalls_get_machine_install_dir (void)
 {
@@ -7266,15 +7238,8 @@ ves_icall_System_Web_Util_ICalls_get_machine_install_dir (void)
 
        path = g_path_get_dirname (mono_get_config_dir ());
 
-#if defined (HOST_WIN32)
-       /* Avoid mixing '/' and '\\' */
-       {
-               gint i;
-               for (i = strlen (path) - 1; i >= 0; i--)
-                       if (path [i] == '/')
-                               path [i] = '\\';
-       }
-#endif
+       mono_icall_make_platform_path (path);
+
        ipath = mono_string_new (mono_domain_get (), path);
        g_free (path);
 
@@ -7329,14 +7294,18 @@ ves_icall_System_Diagnostics_Debugger_Log (int level, MonoString *category, Mono
                mono_get_runtime_callbacks ()->debug_log (level, category, message);
 }
 
+#ifndef HOST_WIN32
+static inline void
+mono_icall_write_windows_debug_string (MonoString *message)
+{
+       g_warning ("WriteWindowsDebugString called and HOST_WIN32 not defined!\n");
+}
+#endif /* !HOST_WIN32 */
+
 ICALL_EXPORT void
 ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString (MonoString *message)
 {
-#if defined (HOST_WIN32)
-       OutputDebugString (mono_string_chars (message));
-#else
-       g_warning ("WriteWindowsDebugString called and HOST_WIN32 not defined!\n");
-#endif
+       mono_icall_write_windows_debug_string (message);
 }
 
 /* Only used for value types */
@@ -7388,9 +7357,9 @@ ves_icall_MonoMethod_get_base_method (MonoReflectionMethod *m, gboolean definiti
                return m;
 
        klass = method->klass;
-       if (klass->generic_class) {
+       if (mono_class_is_ginst (klass)) {
                generic_inst = mono_class_get_context (klass);
-               klass = klass->generic_class->container_class;
+               klass = mono_class_get_generic_class (klass)->container_class;
        }
 
 retry:
@@ -7427,9 +7396,9 @@ retry:
                                        return NULL;
                                }
                        }
-                       if (parent->generic_class) {
+                       if (mono_class_is_ginst (parent)) {
                                parent_inst = mono_class_get_context (parent);
-                               parent = parent->generic_class->container_class;
+                               parent = mono_class_get_generic_class (parent)->container_class;
                        }
 
                        mono_class_setup_vtable (parent);
@@ -7451,9 +7420,9 @@ retry:
 
                        generic_inst = NULL;
                }
-               if (klass->generic_class) {
+               if (mono_class_is_ginst (klass)) {
                        generic_inst = mono_class_get_context (klass);
-                       klass = klass->generic_class->container_class;
+                       klass = mono_class_get_generic_class (klass)->container_class;
                }
 
        }
@@ -8002,81 +7971,103 @@ ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage (guint32 code)
        return message;
 }
 
-ICALL_EXPORT gpointer
-ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess (void)
+#ifndef HOST_WIN32
+static inline gint32
+mono_icall_wait_for_input_idle (gpointer handle, gint32 milliseconds)
 {
-       return GetCurrentProcess ();
+       return WAIT_TIMEOUT;
 }
+#endif /* !HOST_WIN32 */
 
-ICALL_EXPORT MonoBoolean
-ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gint32 *exitcode)
+ICALL_EXPORT gint32
+ves_icall_Microsoft_Win32_NativeMethods_WaitForInputIdle (gpointer handle, gint32 milliseconds)
+{
+       return mono_icall_wait_for_input_idle (handle, milliseconds);
+}
+
+ICALL_EXPORT gint32
+ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcessId (void)
 {
-       return GetExitCodeProcess (handle, (guint32*) exitcode);
+       return mono_process_current_pid ();
 }
 
 ICALL_EXPORT MonoBoolean
-ves_icall_Microsoft_Win32_NativeMethods_CloseProcess (gpointer handle)
+ves_icall_Mono_TlsProviderFactory_IsBtlsSupported (void)
 {
-#if defined(TARGET_WIN32) || defined(HOST_WIN32)
-       return CloseHandle (handle);
+#if HAVE_BTLS
+       return TRUE;
 #else
-       return CloseProcess (handle);
+       return FALSE;
 #endif
 }
 
-ICALL_EXPORT MonoBoolean
-ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint32 exitcode)
+#ifndef DISABLE_COM
+
+ICALL_EXPORT int
+ves_icall_System_Runtime_InteropServices_Marshal_GetHRForException_WinRT(MonoException* ex)
 {
-       return TerminateProcess (handle, exitcode);
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.Marshal.GetHRForException_WinRT internal call is not implemented."));
+       return 0;
 }
 
-ICALL_EXPORT gint32
-ves_icall_Microsoft_Win32_NativeMethods_WaitForInputIdle (gpointer handle, gint32 milliseconds)
+ICALL_EXPORT MonoObject*
+ves_icall_System_Runtime_InteropServices_Marshal_GetNativeActivationFactory(MonoObject* type)
 {
-#ifdef HOST_WIN32
-       return WaitForInputIdle (handle, milliseconds);
-#else
-       /*TODO: Not implemented*/
-       return WAIT_TIMEOUT;
-#endif
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.Marshal.GetNativeActivationFactory internal call is not implemented."));
+       return NULL;
 }
 
-ICALL_EXPORT MonoBoolean
-ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize (gpointer handle, gsize *min, gsize *max)
+ICALL_EXPORT void*
+ves_icall_System_Runtime_InteropServices_Marshal_GetRawIUnknownForComObjectNoAddRef(MonoObject* obj)
 {
-       return GetProcessWorkingSetSize (handle, min, max);
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.Marshal.GetRawIUnknownForComObjectNoAddRef internal call is not implemented."));
+       return NULL;
 }
 
-ICALL_EXPORT MonoBoolean
-ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handle, gsize min, gsize max)
+ICALL_EXPORT MonoObject*
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_GetRestrictedErrorInfo()
 {
-       return SetProcessWorkingSetSize (handle, min, max);
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.GetRestrictedErrorInfo internal call is not implemented."));
+       return NULL;
 }
 
 ICALL_EXPORT MonoBoolean
-ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64 *creationtime, gint64 *exittime, gint64 *kerneltime, gint64 *usertime)
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_RoOriginateLanguageException(int error, MonoString* message, void* languageException)
 {
-       return GetProcessTimes (handle, (LPFILETIME) creationtime, (LPFILETIME) exittime, (LPFILETIME) kerneltime, (LPFILETIME) usertime);
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.RoOriginateLanguageException internal call is not implemented."));
+       return FALSE;
 }
 
-ICALL_EXPORT gint32
-ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcessId (void)
+ICALL_EXPORT void
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_RoReportUnhandledError(MonoObject* error)
 {
-       return mono_process_current_pid ();
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.RoReportUnhandledError internal call is not implemented."));
 }
 
-ICALL_EXPORT gint32
-ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass (gpointer handle)
+ICALL_EXPORT int
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsCreateString(MonoString* sourceString, int length, void** hstring)
 {
-       return GetPriorityClass (handle);
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.WindowsCreateString internal call is not implemented."));
+       return 0;
 }
 
-ICALL_EXPORT MonoBoolean
-ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass (gpointer handle, gint32 priorityClass)
+ICALL_EXPORT int
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsDeleteString(void* hstring)
 {
-       return SetPriorityClass (handle, priorityClass);
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.WindowsDeleteString internal call is not implemented."));
+       return 0;
+}
+
+ICALL_EXPORT mono_unichar2*
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsGetStringRawBuffer(void* hstring, unsigned* length)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.WindowsGetStringRawBuffer internal call is not implemented."));
+       return NULL;
 }
 
+#endif
+
+
 #ifndef DISABLE_ICALL_TABLES
 
 #define ICALL_TYPE(id,name,first)
index 7f3260c0babc5887fef8335e55367356f1e08d6d..4fc6f218e1708a0ccc7c676f069f8743ef2f277b 100644 (file)
@@ -761,7 +761,7 @@ class_key_extract (gpointer value)
 static gpointer*
 class_next_value (gpointer value)
 {
-       MonoClass *klass = (MonoClass *)value;
+       MonoClassDef *klass = (MonoClassDef *)value;
 
        return (gpointer*)&klass->next_class_cache;
 }
index e2a91f0975fb4ee6dea5c401e23e545c8038dad3..9e09748c344ba714c8e4002ed87f1531f690eb2d 100644 (file)
@@ -194,7 +194,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
        fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
 
        if (!mono_verifier_verify_memberref_field_signature (image, cols [MONO_MEMBERREF_SIGNATURE], NULL)) {
-               mono_error_set_bad_image (error, image, "Bad field '%s' signature 0x%08x", class_index, token);
+               mono_error_set_bad_image (error, image, "Bad field '%u' signature 0x%08x", class_index, token);
                return NULL;
        }
 
@@ -209,7 +209,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
                klass = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_SPEC | nindex, context, error);
                break;
        default:
-               mono_error_set_bad_image (error, image, "Bad field field '%s' signature 0x%08x", class_index, token);
+               mono_error_set_bad_image (error, image, "Bad field field '%u' signature 0x%08x", class_index, token);
        }
 
        if (!klass)
@@ -319,7 +319,7 @@ mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retk
                }
        }
 
-       if (field && field->parent && !field->parent->generic_class && !field->parent->generic_container) {
+       if (field && field->parent && !mono_class_is_ginst (field->parent) && !mono_class_is_gtd (field->parent)) {
                mono_image_lock (image);
                mono_conc_hashtable_insert (image->field_cache, GUINT_TO_POINTER (token), field);
                mono_image_unlock (image);
@@ -362,15 +362,17 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con
        /* Search directly in the metadata to avoid calling setup_methods () */
        mono_error_init (error);
 
-       /* FIXME: !from_class->generic_class condition causes test failures. */
-       if (klass->type_token && !image_is_dynamic (klass->image) && !klass->methods && !klass->rank && klass == from_class && !from_class->generic_class) {
-               for (i = 0; i < klass->method.count; ++i) {
+       /* FIXME: !mono_class_is_ginst (from_class) condition causes test failures. */
+       if (klass->type_token && !image_is_dynamic (klass->image) && !klass->methods && !klass->rank && klass == from_class && !mono_class_is_ginst (from_class)) {
+               int first_idx = mono_class_get_first_method_idx (klass);
+               int mcount = mono_class_get_method_count (klass);
+               for (i = 0; i < mcount; ++i) {
                        guint32 cols [MONO_METHOD_SIZE];
                        MonoMethod *method;
                        const char *m_name;
                        MonoMethodSignature *other_sig;
 
-                       mono_metadata_decode_table_row (klass->image, MONO_TABLE_METHOD, klass->method.first + i, cols, MONO_METHOD_SIZE);
+                       mono_metadata_decode_table_row (klass->image, MONO_TABLE_METHOD, first_idx + i, cols, MONO_METHOD_SIZE);
 
                        m_name = mono_metadata_string_heap (klass->image, cols [MONO_METHOD_NAME]);
 
@@ -379,7 +381,7 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con
                                  (name && !strcmp (m_name, name))))
                                continue;
 
-                       method = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | (klass->method.first + i + 1), klass, NULL, error);
+                       method = mono_get_method_checked (klass->image, MONO_TOKEN_METHOD_DEF | (first_idx + i + 1), klass, NULL, error);
                        if (!mono_error_ok (error)) //bail out if we hit a loader error
                                return NULL;
                        if (method) {
@@ -403,7 +405,8 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con
 
                return NULL;
        }
-       for (i = 0; i < klass->method.count; ++i) {
+       int mcount = mono_class_get_method_count (klass);
+       for (i = 0; i < mcount; ++i) {
                MonoMethod *m = klass->methods [i];
                MonoMethodSignature *msig;
 
@@ -431,7 +434,7 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con
                }
        }
 
-       if (i < klass->method.count)
+       if (i < mcount)
                return mono_class_get_method_by_index (from_class, i);
        return NULL;
 }
@@ -668,7 +671,7 @@ mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32
                return mono_method_signature_checked (method, error);
        }
 
-       if (method->klass->generic_class)
+       if (mono_class_is_ginst (method->klass))
                return mono_method_signature_checked (method, error);
 
        if (image_is_dynamic (image)) {
@@ -751,7 +754,8 @@ mono_method_search_in_array_class (MonoClass *klass, const char *name, MonoMetho
 
        mono_class_setup_methods (klass);
        g_assert (!mono_class_has_failure (klass)); /*FIXME this should not fail, right?*/
-       for (i = 0; i < klass->method.count; ++i) {
+       int mcount = mono_class_get_method_count (klass);
+       for (i = 0; i < mcount; ++i) {
                MonoMethod *method = klass->methods [i];
                if (strcmp (method->name, name) == 0 && sig->param_count == method->signature->param_count)
                        return method;
@@ -854,7 +858,7 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp
                type = &klass->byval_arg;
 
                if (type->type != MONO_TYPE_ARRAY && type->type != MONO_TYPE_SZARRAY) {
-                       MonoClass *in_class = klass->generic_class ? klass->generic_class->container_class : klass;
+                       MonoClass *in_class = mono_class_is_ginst (klass) ? mono_class_get_generic_class (klass)->container_class : klass;
                        method = find_method (in_class, NULL, mname, sig, klass, error);
                        break;
                }
@@ -941,12 +945,12 @@ method_from_methodspec (MonoImage *image, MonoGenericContext *context, guint32 i
 
        klass = method->klass;
 
-       if (klass->generic_class) {
+       if (mono_class_is_ginst (klass)) {
                g_assert (method->is_inflated);
                method = ((MonoMethodInflated *) method)->declaring;
        }
 
-       new_context.class_inst = klass->generic_class ? klass->generic_class->context.class_inst : NULL;
+       new_context.class_inst = mono_class_is_ginst (klass) ? mono_class_get_generic_class (klass)->context.class_inst : NULL;
        new_context.method_inst = inst;
 
        method = mono_class_inflate_generic_method_full_checked (method, klass, &new_context, error);
@@ -1659,7 +1663,7 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
                sig = mono_metadata_blob_heap (image, cols [4]);
        /* size = */ mono_metadata_decode_blob_size (sig, &sig);
 
-       container = klass->generic_container;
+       container = mono_class_try_get_generic_container (klass);
 
        /* 
         * load_generic_params does a binary search so only call it if the method 
@@ -2374,10 +2378,10 @@ mono_method_signature_checked (MonoMethod *m, MonoError *error)
 
        sig = mono_metadata_blob_heap (img, sig_offset = mono_metadata_decode_row_col (&img->tables [MONO_TABLE_METHOD], idx - 1, MONO_METHOD_SIGNATURE));
 
-       g_assert (!m->klass->generic_class);
+       g_assert (!mono_class_is_ginst (m->klass));
        container = mono_method_get_generic_container (m);
        if (!container)
-               container = m->klass->generic_container;
+               container = mono_class_try_get_generic_container (m->klass);
 
        /* Generic signatures depend on the container so they cannot be cached */
        /* icall/pinvoke signatures cannot be cached cause we modify them below */
@@ -2579,7 +2583,7 @@ mono_method_get_header_checked (MonoMethod *method, MonoError *error)
         */
        container = mono_method_get_generic_container (method);
        if (!container)
-               container = method->klass->generic_container;
+               container = mono_class_try_get_generic_container (method->klass);
        return mono_metadata_parse_mh_full (img, container, (const char *)loc, error);
 }
 
@@ -2620,12 +2624,14 @@ mono_method_get_index (MonoMethod *method)
        mono_class_setup_methods (klass);
        if (mono_class_has_failure (klass))
                return 0;
-       for (i = 0; i < klass->method.count; ++i) {
+       int first_idx = mono_class_get_first_method_idx (klass);
+       int mcount = mono_class_get_method_count (klass);
+       for (i = 0; i < mcount; ++i) {
                if (method == klass->methods [i]) {
                        if (klass->image->uncompressed_metadata)
-                               return mono_metadata_translate_token_index (klass->image, MONO_TABLE_METHOD, klass->method.first + i + 1);
+                               return mono_metadata_translate_token_index (klass->image, MONO_TABLE_METHOD, first_idx + i + 1);
                        else
-                               return klass->method.first + i + 1;
+                               return first_idx + i + 1;
                }
        }
        return 0;
index 6382c774ae3fd431d61f741df0456253a4847d44..328cb5ac7583312904112bbfb933f779f8a9c402 100644 (file)
@@ -4,7 +4,6 @@
 #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
 
@@ -64,9 +63,6 @@ mono_lookup_internal_call (MonoMethod *method);
 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);
 
index 66f7d6b560d084cac2f07ffc20249e62b699c8f9..8ca4a27ab8211ed592ba4f0cbbe4d7f78d4ad91f 100644 (file)
@@ -21,6 +21,7 @@
 #endif
 
 #include <mono/io-layer/io-layer.h>
+#include <mono/utils/mono-compiler.h>
 
 #include "lock-tracer.h"
 
@@ -141,8 +142,6 @@ mono_locks_lock_released (RuntimeLocks kind, gpointer lock)
        add_record (RECORD_LOCK_RELEASED, kind, lock);
 }
 #else
-       #ifdef _MSC_VER
-               // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-               void __mono_win32_lock_tracer_quiet_lnk4221(void) {}
-       #endif
+
+MONO_EMPTY_SOURCE_FILE (lock_tracer);
 #endif /* LOCK_TRACER */
diff --git a/mono/metadata/marshal-internals.h b/mono/metadata/marshal-internals.h
new file mode 100644 (file)
index 0000000..1b4ff57
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_MARSHAL_INTERNALS_H__
+#define __MONO_METADATA_MARSHAL_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+#include <mono/metadata/object-internals.h>
+
+// On Windows platform implementation of bellow methods are hosted in separate source file
+// masrshal-windows.c or marshal-windows-*.c. On other platforms the implementation is still keept
+// in marshal.c still declared as static and in some places even inlined.
+#ifdef HOST_WIN32
+void*
+mono_marshal_alloc_co_task_mem (size_t size);
+
+void
+mono_marshal_free_co_task_mem (void *ptr);
+
+gpointer
+mono_marshal_realloc_co_task_mem (gpointer ptr, size_t size);
+
+void*
+mono_marshal_alloc_hglobal (size_t size);
+
+gpointer
+mono_marshal_realloc_hglobal (gpointer ptr, size_t size);
+
+void
+mono_marshal_free_hglobal (void *ptr);
+
+gpointer
+mono_string_to_utf8str (MonoString *s);
+#endif  /* HOST_WIN32 */
+
+#endif /* __MONO_METADATA_MARSHAL_INTERNALS_H__ */
diff --git a/mono/metadata/marshal-windows-internals.h b/mono/metadata/marshal-windows-internals.h
new file mode 100644 (file)
index 0000000..d6b3f45
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_MARSHAL_WINDOWS_INTERNALS_H__
+#define __MONO_METADATA_MARSHAL_WINDOWS_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include "mono/metadata/marshal.h"
+#include "mono/metadata/marshal-internals.h"
+#include "mono/metadata/exception.h"
+#endif /* HOST_WIN32 */
+
+#endif /* __MONO_METADATA_MARSHAL_WINDOWS_INTERNALS_H__ */
diff --git a/mono/metadata/marshal-windows-uwp.c b/mono/metadata/marshal-windows-uwp.c
new file mode 100644 (file)
index 0000000..7ac1a33
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * marshal-windows-uwp.c: UWP marshal support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include "mono/metadata/marshal-windows-internals.h"
+
+void *
+mono_marshal_alloc_hglobal (size_t size)
+{
+       return HeapAlloc (GetProcessHeap (), 0, size);
+}
+
+gpointer
+mono_marshal_realloc_hglobal (gpointer ptr, size_t size)
+{
+       return HeapReAlloc (GetProcessHeap (), 0, ptr, size);
+}
+
+void
+mono_marshal_free_hglobal (gpointer ptr)
+{
+       HeapFree (GetProcessHeap (), 0, ptr);
+       return;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (marshal_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/metadata/marshal-windows.c b/mono/metadata/marshal-windows.c
new file mode 100644 (file)
index 0000000..69ee01d
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * marshal-windows.c: Windows marshal support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#include <config.h>
+#include <glib.h>
+
+#if defined(HOST_WIN32)
+#include <winsock2.h>
+#include <windows.h>
+#include <objbase.h>
+#include "mono/metadata/marshal-windows-internals.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+void*
+mono_marshal_alloc_hglobal (size_t size)
+{
+       return GlobalAlloc (GMEM_FIXED, size);
+}
+
+gpointer
+mono_marshal_realloc_hglobal (gpointer ptr, size_t size)
+{
+       return GlobalReAlloc (ptr, size, GMEM_MOVEABLE);
+}
+
+void
+mono_marshal_free_hglobal (gpointer ptr)
+{
+       GlobalFree (ptr);
+       return;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+void*
+mono_marshal_alloc_co_task_mem (size_t size)
+{
+       return CoTaskMemAlloc (size);
+}
+
+void
+mono_marshal_free_co_task_mem (void *ptr)
+{
+       CoTaskMemFree (ptr);
+       return;
+}
+
+gpointer
+mono_marshal_realloc_co_task_mem (gpointer ptr, size_t size)
+{
+       return CoTaskMemRealloc (ptr, size);
+}
+
+gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi (MonoString *string)
+{
+       MonoError error;
+       char* tres, *ret;
+       size_t len;
+       tres = mono_string_to_utf8_checked (string, &error);
+       if (mono_error_set_pending_exception (&error))
+               return NULL;
+       if (!tres)
+               return tres;
+
+       /*
+        * mono_string_to_utf8_checked() returns a memory area at least as large as the size of the
+        * MonoString, even if it contains NULL characters. The copy we allocate here has to be equally
+        * large.
+        */
+       len = MAX (strlen (tres) + 1, string->length);
+       ret = ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal ((gpointer)len);
+       memcpy (ret, tres, len);
+       g_free (tres);
+       return ret;
+}
+
+gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (MonoString *string)
+{
+       if (string == NULL)
+               return NULL;
+       else {
+               size_t len = ((mono_string_length (string) + 1) * 2);
+               gunichar2 *res = ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal ((gpointer)len);
+
+               memcpy (res, mono_string_chars (string), mono_string_length (string) * 2);
+               res [mono_string_length (string)] = 0;
+               return res;
+       }
+}
+
+gpointer
+mono_string_to_utf8str (MonoString *s)
+{
+       char *as, *tmp;
+       glong len;
+       GError *error = NULL;
+
+       if (s == NULL)
+               return NULL;
+
+       if (!s->length) {
+               as = CoTaskMemAlloc (1);
+               as [0] = '\0';
+               return as;
+       }
+
+       tmp = g_utf16_to_utf8 (mono_string_chars (s), s->length, NULL, &len, &error);
+       if (error) {
+               MonoException *exc = mono_get_exception_argument ("string", error->message);
+               g_error_free (error);
+               mono_set_pending_exception (exc);
+               return NULL;
+       } else {
+               as = CoTaskMemAlloc (len + 1);
+               memcpy (as, tmp, len + 1);
+               g_free (tmp);
+               return as;
+       }
+}
+
+#endif /* HOST_WIN32 */
index d12e345ca26f4f399373e70077e13595d9a9160d..148f5bc251743e9d26bf104a8fc70b9c9c41d7cb 100644 (file)
@@ -20,6 +20,7 @@
 #include "loader.h"
 #include "cil-coff.h"
 #include "metadata/marshal.h"
+#include "metadata/marshal-internals.h"
 #include "metadata/method-builder.h"
 #include "metadata/tabledefs.h"
 #include "metadata/exception.h"
@@ -81,6 +82,8 @@ static MonoNativeTlsKey load_type_info_tls_id;
 
 static gboolean use_aot_wrappers;
 
+static int class_marshal_info_count;
+
 static void ftnptr_eh_callback_default (guint32 gchandle);
 
 static MonoFtnPtrEHCallback ftnptr_eh_callback = ftnptr_eh_callback_default;
@@ -106,8 +109,10 @@ mono_marshal_string_to_utf16 (MonoString *s);
 static void *
 mono_marshal_string_to_utf16_copy (MonoString *s);
 
+#ifndef HOST_WIN32
 static gpointer
-mono_string_to_lpstr (MonoString *string_obj);
+mono_string_to_utf8str (MonoString *string_obj);
+#endif
 
 static MonoStringBuilder *
 mono_string_utf8_to_builder2 (char *text);
@@ -303,7 +308,7 @@ mono_marshal_init (void)
                register_icall (mono_string_new_wrapper, "mono_string_new_wrapper", "obj ptr", FALSE);
                register_icall (mono_string_new_len_wrapper, "mono_string_new_len_wrapper", "obj ptr int", FALSE);
                register_icall (ves_icall_mono_string_to_utf8, "ves_icall_mono_string_to_utf8", "ptr obj", FALSE);
-               register_icall (mono_string_to_lpstr, "mono_string_to_lpstr", "ptr obj", FALSE);
+               register_icall (mono_string_to_utf8str, "mono_string_to_utf8str", "ptr obj", FALSE);
                register_icall (mono_string_to_ansibstr, "mono_string_to_ansibstr", "ptr object", FALSE);
                register_icall (mono_string_builder_to_utf8, "mono_string_builder_to_utf8", "ptr object", FALSE);
                register_icall (mono_string_builder_to_utf16, "mono_string_builder_to_utf16", "ptr object", FALSE);
@@ -351,6 +356,10 @@ mono_marshal_init (void)
 
                mono_cominterop_init ();
                mono_remoting_init ();
+
+               mono_counters_register ("MonoClass::class_marshal_info_count count",
+                                                               MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_marshal_info_count);
+
        }
 }
 
@@ -919,13 +928,13 @@ mono_string_utf8_to_builder (MonoStringBuilder *sb, char *text)
        if (!sb || !text)
                return;
 
-       int len = strlen (text);
-       if (len > mono_string_builder_capacity (sb))
-               len = mono_string_builder_capacity (sb);
-
        GError *error = NULL;
        glong copied;
-       gunichar2* ut = g_utf8_to_utf16 (text, len, NULL, &copied, &error);
+       gunichar2* ut = g_utf8_to_utf16 (text, strlen (text), NULL, &copied, &error);
+       int capacity = mono_string_builder_capacity (sb);
+
+       if (copied > capacity)
+               copied = capacity;
 
        if (!error) {
                MONO_OBJECT_SETREF (sb, chunkPrevious, NULL);
@@ -949,7 +958,6 @@ mono_string_utf8_to_builder2 (char *text)
        return sb;
 }
 
-
 void
 mono_string_utf16_to_builder (MonoStringBuilder *sb, gunichar2 *text)
 {
@@ -982,7 +990,7 @@ mono_string_builder_to_utf8 (MonoStringBuilder *sb)
 {
        MonoError error;
        GError *gerror = NULL;
-
+       glong byte_count;
        if (!sb)
                return NULL;
 
@@ -990,7 +998,7 @@ mono_string_builder_to_utf8 (MonoStringBuilder *sb)
 
        guint str_len = mono_string_builder_string_length (sb);
 
-       gchar *tmp = g_utf16_to_utf8 (str_utf16, str_len, NULL, NULL, &gerror);
+       gchar *tmp = g_utf16_to_utf8 (str_utf16, str_len, NULL, &byte_count, &gerror);
 
        if (gerror) {
                g_error_free (gerror);
@@ -999,7 +1007,7 @@ mono_string_builder_to_utf8 (MonoStringBuilder *sb)
                return NULL;
        } else {
                guint len = mono_string_builder_capacity (sb) + 1;
-               gchar *res = (gchar *)mono_marshal_alloc (len * sizeof (gchar), &error);
+               gchar *res = (gchar *)mono_marshal_alloc (MAX (byte_count+1, len * sizeof (gchar)), &error);
                if (!mono_error_ok (&error)) {
                        mono_marshal_free (str_utf16);
                        g_free (tmp);
@@ -1007,9 +1015,8 @@ mono_string_builder_to_utf8 (MonoStringBuilder *sb)
                        return NULL;
                }
 
-               g_assert (str_len < len);
-               memcpy (res, tmp, str_len * sizeof (gchar));
-               res[str_len] = '\0';
+               memcpy (res, tmp, byte_count);
+               res[byte_count] = '\0';
 
                mono_marshal_free (str_utf16);
                g_free (tmp);
@@ -1075,43 +1082,17 @@ mono_string_builder_to_utf16 (MonoStringBuilder *sb)
        return str;
 }
 
+#ifndef HOST_WIN32
 /* This is a JIT icall, it sets the pending exception and returns NULL on error. */
 static gpointer
-mono_string_to_lpstr (MonoString *s)
+mono_string_to_utf8str (MonoString *s)
 {
-#ifdef TARGET_WIN32
-       char *as, *tmp;
-       glong len;
-       GError *error = NULL;
-
-       if (s == NULL)
-               return NULL;
-
-       if (!s->length) {
-               as = CoTaskMemAlloc (1);
-               as [0] = '\0';
-               return as;
-       }
-
-       tmp = g_utf16_to_utf8 (mono_string_chars (s), s->length, NULL, &len, &error);
-       if (error) {
-               MonoException *exc = mono_get_exception_argument ("string", error->message);
-               g_error_free (error);
-               mono_set_pending_exception (exc);
-               return NULL;
-       } else {
-               as = CoTaskMemAlloc (len + 1);
-               memcpy (as, tmp, len + 1);
-               g_free (tmp);
-               return as;
-       }
-#else
        MonoError error;
        char *result = mono_string_to_utf8_checked (s, &error);
        mono_error_set_pending_exception (&error);
        return result;
+}
 #endif
-}      
 
 gpointer
 mono_string_to_ansibstr (MonoString *string_obj)
@@ -1499,7 +1480,10 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv
 #endif
                mono_mb_emit_byte (mb, CEE_STIND_REF);  
                break;
+
+               // In Mono historically LPSTR was treated as a UTF8STR
        case MONO_MARSHAL_CONV_STR_LPSTR:
+       case MONO_MARSHAL_CONV_STR_UTF8STR:
                mono_mb_emit_ldloc (mb, 1);
                mono_mb_emit_ldloc (mb, 0);
                mono_mb_emit_byte (mb, CEE_LDIND_I);
@@ -1627,6 +1611,7 @@ conv_to_icall (MonoMarshalConv conv, int *ind_store_type)
        case MONO_MARSHAL_CONV_LPTSTR_STR:
                *ind_store_type = CEE_STIND_REF;
                return mono_string_new_wrapper;
+       case MONO_MARSHAL_CONV_UTF8STR_STR:
        case MONO_MARSHAL_CONV_LPSTR_STR:
                *ind_store_type = CEE_STIND_REF;
                return mono_string_new_wrapper;
@@ -1634,10 +1619,12 @@ conv_to_icall (MonoMarshalConv conv, int *ind_store_type)
 #ifdef TARGET_WIN32
                return mono_marshal_string_to_utf16;
 #else
-               return mono_string_to_lpstr;
+               return mono_string_to_utf8str;
 #endif
+               // In Mono historically LPSTR was treated as a UTF8STR
+       case MONO_MARSHAL_CONV_STR_UTF8STR:
        case MONO_MARSHAL_CONV_STR_LPSTR:
-               return mono_string_to_lpstr;
+               return mono_string_to_utf8str;
        case MONO_MARSHAL_CONV_STR_BSTR:
                return mono_string_to_bstr;
        case MONO_MARSHAL_CONV_BSTR_STR:
@@ -1646,6 +1633,7 @@ conv_to_icall (MonoMarshalConv conv, int *ind_store_type)
        case MONO_MARSHAL_CONV_STR_TBSTR:
        case MONO_MARSHAL_CONV_STR_ANSIBSTR:
                return mono_string_to_ansibstr;
+       case MONO_MARSHAL_CONV_SB_UTF8STR:
        case MONO_MARSHAL_CONV_SB_LPSTR:
                return mono_string_builder_to_utf8;
        case MONO_MARSHAL_CONV_SB_LPTSTR:
@@ -1667,6 +1655,7 @@ conv_to_icall (MonoMarshalConv conv, int *ind_store_type)
        case MONO_MARSHAL_CONV_FTN_DEL:
                *ind_store_type = CEE_STIND_REF;
                return mono_ftnptr_to_delegate;
+       case MONO_MARSHAL_CONV_UTF8STR_SB:
        case MONO_MARSHAL_CONV_LPSTR_SB:
                *ind_store_type = CEE_STIND_REF;
                return mono_string_utf8_to_builder;
@@ -1713,6 +1702,8 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv
                mono_mb_emit_byte (mb, CEE_NEG);
                mono_mb_emit_byte (mb, CEE_STIND_I2);
                break;
+       // In Mono historically LPSTR was treated as a UTF8STR
+       case MONO_MARSHAL_CONV_STR_UTF8STR:
        case MONO_MARSHAL_CONV_STR_LPWSTR:
        case MONO_MARSHAL_CONV_STR_LPSTR:
        case MONO_MARSHAL_CONV_STR_LPTSTR:
@@ -1937,10 +1928,12 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv
        }
 }
 
-static int offset_of_first_nonstatic_field(MonoClass *klass)
+static int
+offset_of_first_nonstatic_field (MonoClass *klass)
 {
        int i;
-       for (i = 0; i < klass->field.count; i++) {
+       int fcount = mono_class_get_field_count (klass);
+       for (i = 0; i < fcount; i++) {
                if (!(klass->fields[i].type->attrs & FIELD_ATTRIBUTE_STATIC) && !mono_field_is_deleted (&klass->fields[i]))
                        return klass->fields[i].offset - sizeof (MonoObject);
        }
@@ -1983,7 +1976,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje
        }
 
        if (klass != mono_class_try_get_safehandle_class ()) {
-               if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
+               if (mono_class_is_auto_layout (klass)) {
                        char *msg = g_strdup_printf ("Type %s which is passed to unmanaged code must have a StructLayout attribute.",
                                                                                 mono_type_full_name (&klass->byval_arg));
                        mono_mb_emit_exception_marshal_directive (mb, msg);
@@ -2018,7 +2011,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje
                         * the layout to the managed structure as well.
                         */
                        
-                       if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) && (usize == 0)) {
+                       if (mono_class_is_explicit_layout (klass) && (usize == 0)) {
                                if (MONO_TYPE_IS_REFERENCE (info->fields [i].field->type) ||
                                    ((!last_field && MONO_TYPE_IS_REFERENCE (info->fields [i + 1].field->type))))
                                        g_error ("Type %s which has an [ExplicitLayout] attribute cannot have a "
@@ -2441,6 +2434,8 @@ mono_marshal_get_string_to_ptr_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec
                return MONO_MARSHAL_CONV_STR_LPTSTR;
        case MONO_NATIVE_BSTR:
                return MONO_MARSHAL_CONV_STR_BSTR;
+       case MONO_NATIVE_UTF8STR:
+               return MONO_MARSHAL_CONV_STR_UTF8STR;
        default:
                return MONO_MARSHAL_CONV_INVALID;
        }
@@ -2454,13 +2449,12 @@ mono_marshal_get_stringbuilder_to_ptr_conv (MonoMethodPInvoke *piinfo, MonoMarsh
        switch (encoding) {
        case MONO_NATIVE_LPWSTR:
                return MONO_MARSHAL_CONV_SB_LPWSTR;
-               break;
        case MONO_NATIVE_LPSTR:
                return MONO_MARSHAL_CONV_SB_LPSTR;
-               break;
+       case MONO_NATIVE_UTF8STR:
+               return MONO_MARSHAL_CONV_SB_UTF8STR;
        case MONO_NATIVE_LPTSTR:
                return MONO_MARSHAL_CONV_SB_LPTSTR;
-               break;
        default:
                return MONO_MARSHAL_CONV_INVALID;
        }
@@ -2477,6 +2471,8 @@ mono_marshal_get_ptr_to_string_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec
        case MONO_NATIVE_LPWSTR:
                *need_free = FALSE;
                return MONO_MARSHAL_CONV_LPWSTR_STR;
+       case MONO_NATIVE_UTF8STR:
+               return MONO_MARSHAL_CONV_UTF8STR_STR;
        case MONO_NATIVE_LPSTR:
        case MONO_NATIVE_VBBYREFSTR:
                return MONO_MARSHAL_CONV_LPSTR_STR;
@@ -2504,6 +2500,8 @@ mono_marshal_get_ptr_to_stringbuilder_conv (MonoMethodPInvoke *piinfo, MonoMarsh
                 */
                *need_free = FALSE;
                return MONO_MARSHAL_CONV_LPWSTR_SB;
+       case MONO_NATIVE_UTF8STR:
+               return MONO_MARSHAL_CONV_UTF8STR_SB;
        case MONO_NATIVE_LPSTR:
                return MONO_MARSHAL_CONV_LPSTR_SB;
                break;
@@ -2891,6 +2889,7 @@ cache_generic_delegate_wrapper (GHashTable *cache, MonoMethod *orig_method, Mono
 {
        MonoError error;
        MonoMethod *inst, *res;
+       WrapperInfo *ginfo, *info;
 
        /*
         * We use the same cache for the generic definition and the instances.
@@ -2898,6 +2897,16 @@ cache_generic_delegate_wrapper (GHashTable *cache, MonoMethod *orig_method, Mono
        inst = mono_class_inflate_generic_method_checked (def, ctx, &error);
        g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
 
+       ginfo = mono_marshal_get_wrapper_info (def);
+       if (ginfo) {
+               info = (WrapperInfo *)mono_image_alloc0 (def->klass->image, sizeof (WrapperInfo));
+               info->subtype = ginfo->subtype;
+               if (info->subtype == WRAPPER_SUBTYPE_NONE) {
+                       info->d.delegate_invoke.method = mono_class_inflate_generic_method_checked (ginfo->d.delegate_invoke.method, ctx, &error);
+                       mono_error_assert_ok (&error);
+               }
+       }
+
        mono_memory_barrier ();
        mono_marshal_lock ();
        res = (MonoMethod *)g_hash_table_lookup (cache, orig_method->klass);
@@ -3267,7 +3276,7 @@ mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt
        MonoMethod *res;
        GHashTable *cache;
        gpointer cache_key = NULL;
-       SignaturePointerPair key;
+       SignaturePointerPair key = { NULL, NULL };
        SignaturePointerPair *new_key;
        int local_i, local_len, local_delegates, local_d, local_target, local_res;
        int pos0, pos1, pos2;
@@ -3325,7 +3334,7 @@ mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt
 
                container = mono_method_get_generic_container (method);
                if (!container)
-                       container = method->klass->generic_container;
+                       container = mono_class_try_get_generic_container (method->klass); //FIXME is this a case of a try?
                g_assert (container);
 
                invoke_sig = sig = mono_signature_no_pinvoke (method);
@@ -3568,7 +3577,7 @@ mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt
 #endif /* DISABLE_JIT */
 
        info = mono_wrapper_info_create (mb, subtype);
-       info->d.delegate_invoke.method = orig_method;
+       info->d.delegate_invoke.method = method;
 
        if (ctx) {
                MonoMethod *def;
@@ -4941,8 +4950,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                        break;
                }
 
-               if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                       klass->blittable || klass->enumtype)
+               if (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype)
                        break;
 
                conv_arg = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
@@ -4988,8 +4996,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                        /* Have to change the signature since the vtype is passed byref */
                        m->csig->params [argnum - m->csig->hasthis] = &mono_defaults.int_class->byval_arg;
 
-                       if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                               klass->blittable || klass->enumtype)
+                       if (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype)
                                mono_mb_emit_ldarg_addr (mb, argnum);
                        else
                                mono_mb_emit_ldloc (mb, conv_arg);
@@ -5004,8 +5011,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                        break;
                }
 
-               if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                       klass->blittable || klass->enumtype) {
+               if (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype) {
                        mono_mb_emit_ldarg (mb, argnum);
                        break;
                }                       
@@ -5037,8 +5043,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                        break;
                }
 
-               if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                       klass->blittable || klass->enumtype)
+               if (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype)
                        break;
 
                if (t->byref) {
@@ -5066,8 +5071,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                break;
 
        case MARSHAL_ACTION_CONV_RESULT:
-               if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                       klass->blittable) {
+               if (mono_class_is_explicit_layout (klass) || klass->blittable) {
                        mono_mb_emit_stloc (mb, 3);
                        break;
                }
@@ -5086,8 +5090,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                break;
 
        case MARSHAL_ACTION_MANAGED_CONV_IN:
-               if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                       klass->blittable || klass->enumtype) {
+               if (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype) {
                        conv_arg = 0;
                        break;
                }
@@ -5119,11 +5122,8 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                break;
 
        case MARSHAL_ACTION_MANAGED_CONV_OUT:
-               if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                       klass->blittable || klass->enumtype) {
+               if (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype)
                        break;
-               }
-
                if (t->byref && (t->attrs & PARAM_ATTRIBUTE_IN) && !(t->attrs & PARAM_ATTRIBUTE_OUT))
                        break;
 
@@ -5146,8 +5146,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                break;
 
        case MARSHAL_ACTION_MANAGED_CONV_RESULT:
-               if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                       klass->blittable || klass->enumtype) {
+               if (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype) {
                        mono_mb_emit_stloc (mb, 3);
                        m->retobj_var = 0;
                        break;
@@ -5479,7 +5478,7 @@ emit_marshal_safehandle (EmitMarshalContext *m, int argnum, MonoType *t,
                MonoMethod *ctor = NULL;
                int intptr_handle_slot;
                
-               if (t->data.klass->flags & TYPE_ATTRIBUTE_ABSTRACT){
+               if (mono_class_is_abstract (t->data.klass)) {
                        mono_mb_emit_byte (mb, CEE_POP);
                        mono_mb_emit_exception_marshal_directive (mb, g_strdup ("Returned SafeHandles should not be abstract"));
                        break;
@@ -5752,6 +5751,9 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                                case MONO_NATIVE_LPSTR:
                                        mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
                                        break;
+                               case MONO_NATIVE_UTF8STR:
+                                       mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
+                                       break;
                                default:
                                        g_assert_not_reached ();
                                }
@@ -5862,6 +5864,8 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                        mono_mb_emit_ldloc (mb, 0);
                        mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_FTN_DEL, NULL));
                        mono_mb_emit_stloc (mb, 3);
+               } else if (klass == mono_defaults.stringbuilder_class){
+                       // FIXME: implement
                } else {
                        /* set src */
                        mono_mb_emit_stloc (mb, 0);
@@ -5921,7 +5925,7 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                        encoding = mono_marshal_get_string_encoding (m->piinfo, spec);
 
                        // FIXME:
-                       g_assert (encoding == MONO_NATIVE_LPSTR);
+                       g_assert (encoding == MONO_NATIVE_LPSTR || encoding == MONO_NATIVE_UTF8STR);
 
                        g_assert (!t->byref);
                        g_assert (encoding != -1);
@@ -5933,7 +5937,7 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                }
 
                /* The class can not have an automatic layout */
-               if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
+               if (mono_class_is_auto_layout (klass)) {
                        mono_mb_emit_auto_layout_exception (mb, klass);
                        break;
                }
@@ -6053,7 +6057,7 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                }
 
                /* The class can not have an automatic layout */
-               if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
+               if (mono_class_is_auto_layout (klass)) {
                        mono_mb_emit_auto_layout_exception (mb, klass);
                        break;
                }
@@ -6687,7 +6691,8 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
                        mono_mb_emit_icon (mb, esize);
                        mono_mb_emit_byte (mb, CEE_MUL);
                        mono_mb_emit_byte (mb, CEE_PREFIX1);
-                       mono_mb_emit_byte (mb, CEE_CPBLK);                      
+                       mono_mb_emit_byte (mb, CEE_CPBLK);
+                       mono_mb_patch_branch (mb, label1);
                        break;
                }
 
@@ -7513,7 +7518,7 @@ mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoM
        if (MONO_TYPE_ISSTRUCT (sig->ret)) {
                MonoClass *klass = mono_class_from_mono_type (sig->ret);
                mono_class_init (klass);
-               if (!(((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) || klass->blittable)) {
+               if (!(mono_class_is_explicit_layout (klass) || klass->blittable)) {
                        /* This is used by emit_marshal_vtype (), but it needs to go right before the call */
                        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
                        mono_mb_emit_byte (mb, CEE_MONO_VTADDR);
@@ -8252,7 +8257,7 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
        if (MONO_TYPE_ISSTRUCT (sig->ret)) {
                MonoClass *klass = mono_class_from_mono_type (sig->ret);
                mono_class_init (klass);
-               if (!(((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) || klass->blittable)) {
+               if (!(mono_class_is_explicit_layout (klass) || klass->blittable)) {
                        /* This is used by emit_marshal_vtype (), but it needs to go right before the call */
                        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
                        mono_mb_emit_byte (mb, CEE_MONO_VTADDR);
@@ -9123,8 +9128,9 @@ mono_marshal_get_struct_to_ptr (MonoClass *klass)
 
        mono_marshal_load_type_info (klass);
 
-       if (klass->marshal_info->str_to_ptr)
-               return klass->marshal_info->str_to_ptr;
+       MonoMarshalType *marshal_info = mono_class_get_marshal_info (klass);
+       if (marshal_info->str_to_ptr)
+               return marshal_info->str_to_ptr;
 
        if (!stoptr) 
                stoptr = mono_class_get_method_from_name (mono_defaults.marshal_class, "StructureToPtr", 3);
@@ -9170,10 +9176,10 @@ mono_marshal_get_struct_to_ptr (MonoClass *klass)
        mono_mb_free (mb);
 
        mono_marshal_lock ();
-       if (!klass->marshal_info->str_to_ptr)
-               klass->marshal_info->str_to_ptr = res;
+       if (!marshal_info->str_to_ptr)
+               marshal_info->str_to_ptr = res;
        else
-               res = klass->marshal_info->str_to_ptr;
+               res = marshal_info->str_to_ptr;
        mono_marshal_unlock ();
        return res;
 }
@@ -9196,8 +9202,9 @@ mono_marshal_get_ptr_to_struct (MonoClass *klass)
 
        mono_marshal_load_type_info (klass);
 
-       if (klass->marshal_info->ptr_to_str)
-               return klass->marshal_info->ptr_to_str;
+       MonoMarshalType *marshal_info = mono_class_get_marshal_info (klass);
+       if (marshal_info->ptr_to_str)
+               return marshal_info->ptr_to_str;
 
        if (!ptostr) {
                MonoMethodSignature *sig;
@@ -9248,10 +9255,10 @@ mono_marshal_get_ptr_to_struct (MonoClass *klass)
        mono_mb_free (mb);
 
        mono_marshal_lock ();
-       if (!klass->marshal_info->ptr_to_str)
-               klass->marshal_info->ptr_to_str = res;
+       if (!marshal_info->ptr_to_str)
+               marshal_info->ptr_to_str = res;
        else
-               res = klass->marshal_info->ptr_to_str;
+               res = marshal_info->ptr_to_str;
        mono_marshal_unlock ();
        return res;
 }
@@ -9277,7 +9284,7 @@ mono_marshal_get_synchronized_inner_wrapper (MonoMethod *method)
                method = ((MonoMethodInflated*)method)->declaring;
                container = mono_method_get_generic_container (method);
                if (!container)
-                       container = method->klass->generic_container;
+                       container = mono_class_try_get_generic_container (method->klass); //FIXME is this a case of a try?
                g_assert (container);
        }
 
@@ -9331,7 +9338,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
                method = ((MonoMethodInflated*)method)->declaring;
                container = mono_method_get_generic_container (method);
                if (!container)
-                       container = method->klass->generic_container;
+                       container = mono_class_try_get_generic_container (method->klass); //FIXME is this a case of a try?
                g_assert (container);
        }
 
@@ -9365,7 +9372,8 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
 #endif
 
        if (method->klass->valuetype && !(method->flags & MONO_METHOD_ATTR_STATIC)) {
-               mono_class_set_failure (method->klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               /* FIXME Is this really the best way to signal an error here?  Isn't this called much later after class setup? -AK */
+               mono_class_set_type_load_failure (method->klass, "");
 #ifndef DISABLE_JIT
                /* This will throw the type load exception when the wrapper is compiled */
                mono_mb_emit_byte (mb, CEE_LDNULL);
@@ -9557,7 +9565,7 @@ is_monomorphic_array (MonoClass *klass)
                return FALSE;
 
        element_class = klass->element_class;
-       return (element_class->flags & TYPE_ATTRIBUTE_SEALED) || element_class->valuetype;
+       return mono_class_is_sealed (element_class) || element_class->valuetype;
 }
 
 static int
@@ -9577,7 +9585,7 @@ get_virtual_stelemref_kind (MonoClass *element_class)
        /*Arrays are sealed but are covariant on their element type, We can't use any of the fast paths.*/
        if (mono_class_is_marshalbyref (element_class) || element_class->rank || mono_class_has_variant_generic_params (element_class))
                return STELEMREF_COMPLEX;
-       if (element_class->flags & TYPE_ATTRIBUTE_SEALED)
+       if (mono_class_is_sealed (element_class))
                return STELEMREF_SEALED_CLASS;
        return STELEMREF_CLASS;
 }
@@ -9936,14 +9944,14 @@ get_virtual_stelemref_wrapper (int kind)
                /* uiid = klass->interface_id; */
                mono_mb_emit_ldloc (mb, aklass);
                mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoClass, interface_id));
-               mono_mb_emit_byte (mb, CEE_LDIND_U2);
+               mono_mb_emit_byte (mb, CEE_LDIND_U4);
                mono_mb_emit_stloc (mb, uiid);
 
                /*if (uiid > vt->max_interface_id)*/
                mono_mb_emit_ldloc (mb, uiid);
                mono_mb_emit_ldloc (mb, vtable);
                mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoVTable, max_interface_id));
-               mono_mb_emit_byte (mb, CEE_LDIND_U2);
+               mono_mb_emit_byte (mb, CEE_LDIND_U4);
                b2 = mono_mb_emit_branch (mb, CEE_BGT_UN);
 
                /* if (!(vt->interface_bitmap [(uiid) >> 3] & (1 << ((uiid)&7)))) */
@@ -10519,6 +10527,18 @@ mono_marshal_get_array_accessor_wrapper (MonoMethod *method)
        return res;     
 }
 
+#ifndef HOST_WIN32
+static inline void*
+mono_marshal_alloc_co_task_mem (size_t size)
+{
+       if ((gulong)size == 0)
+               /* This returns a valid pointer for size 0 on MS.NET */
+               size = 4;
+
+       return g_try_malloc ((gulong)size);
+}
+#endif
+
 void*
 mono_marshal_alloc (gulong size, MonoError *error)
 {
@@ -10526,13 +10546,10 @@ mono_marshal_alloc (gulong size, MonoError *error)
 
        mono_error_init (error);
 
-#ifdef HOST_WIN32
-       res = CoTaskMemAlloc (size);
-#else
-       res = g_try_malloc ((gulong)size);
+       res = mono_marshal_alloc_co_task_mem (size);
        if (!res)
-               mono_error_set_out_of_memory (error, "Could not allocate %i bytes", size);
-#endif
+               mono_error_set_out_of_memory (error, "Could not allocate %lu bytes", size);
+
        return res;
 }
 
@@ -10550,14 +10567,19 @@ ves_icall_marshal_alloc (gulong size)
        return ret;
 }
 
-void
-mono_marshal_free (gpointer ptr)
+#ifndef HOST_WIN32
+static inline void
+mono_marshal_free_co_task_mem (void *ptr)
 {
-#ifdef HOST_WIN32
-       CoTaskMemFree (ptr);
-#else
        g_free (ptr);
+       return;
+}
 #endif
+
+void
+mono_marshal_free (gpointer ptr)
+{
+       mono_marshal_free_co_task_mem (ptr);
 }
 
 void
@@ -10780,7 +10802,7 @@ ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionType *rty
                return 0;
        }
 
-       layout = (klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK);
+       layout = (mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK);
 
        if (type->type == MONO_TYPE_PTR || type->type == MONO_TYPE_FNPTR) {
                return sizeof (gpointer);
@@ -10956,35 +10978,14 @@ ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionType *t
        return info->fields [match_index].offset;
 }
 
+#ifndef HOST_WIN32
 gpointer
 ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi (MonoString *string)
 {
        MonoError error;
-#ifdef HOST_WIN32
-       char* tres, *ret;
-       size_t len;
-       tres = mono_string_to_utf8_checked (string, &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
-       if (!tres)
-               return tres;
-
-       /*
-        * mono_string_to_utf8_checked() returns a memory area at least as large as the size of the
-        * MonoString, even if it contains NULL characters. The copy we allocate here has to be equally
-        * large.
-        */
-       len = MAX (strlen (tres) + 1, string->length);
-       ret = ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (len);
-       memcpy (ret, tres, len);
-       g_free (tres);
-       return ret;
-
-#else
        char *ret = mono_string_to_utf8_checked (string, &error);
        mono_error_set_pending_exception (&error);
        return ret;
-#endif
 }
 
 gpointer
@@ -10993,17 +10994,14 @@ ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (MonoString
        if (string == NULL)
                return NULL;
        else {
-#ifdef TARGET_WIN32
-               gunichar2 *res = ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal 
-                       ((mono_string_length (string) + 1) * 2);
-#else
                gunichar2 *res = (gunichar2 *)g_malloc ((mono_string_length (string) + 1) * 2);
-#endif
+
                memcpy (res, mono_string_chars (string), mono_string_length (string) * 2);
                res [mono_string_length (string)] = 0;
                return res;
        }
 }
+#endif /* !HOST_WIN32 */
 
 static void
 mono_struct_delete_old (MonoClass *klass, char *ptr)
@@ -11046,6 +11044,7 @@ mono_struct_delete_old (MonoClass *klass, char *ptr)
                case MONO_MARSHAL_CONV_STR_BSTR:
                case MONO_MARSHAL_CONV_STR_ANSIBSTR:
                case MONO_MARSHAL_CONV_STR_TBSTR:
+               case MONO_MARSHAL_CONV_STR_UTF8STR:
                        mono_marshal_free (*(gpointer *)cpos);
                        break;
 
@@ -11072,6 +11071,14 @@ ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (gpointer src,
        mono_struct_delete_old (klass, (char *)src);
 }
 
+#ifndef HOST_WIN32
+static inline void *
+mono_marshal_alloc_hglobal (size_t size)
+{
+       return g_try_malloc (size);
+}
+#endif
+
 void*
 ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (gpointer size)
 {
@@ -11082,11 +11089,8 @@ ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (gpointer size)
                /* This returns a valid pointer for size 0 on MS.NET */
                s = 4;
 
-#ifdef HOST_WIN32
-       res = GlobalAlloc (GMEM_FIXED, s);
-#else
-       res = g_try_malloc (s);
-#endif
+       res = mono_marshal_alloc_hglobal (s);
+
        if (!res) {
                mono_set_pending_exception (mono_domain_get ()->out_of_memory_ex);
                return NULL;
@@ -11095,6 +11099,14 @@ ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (gpointer size)
        return res;
 }
 
+#ifndef HOST_WIN32
+static inline gpointer
+mono_marshal_realloc_hglobal (gpointer ptr, size_t size)
+{
+       return g_try_realloc (ptr, size);
+}
+#endif
+
 gpointer
 ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal (gpointer ptr, gpointer size)
 {
@@ -11106,11 +11118,8 @@ ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal (gpointer ptr, g
                return NULL;
        }
 
-#ifdef HOST_WIN32
-       res = GlobalReAlloc (ptr, s, GMEM_MOVEABLE);
-#else
-       res = g_try_realloc (ptr, s);
-#endif
+       res = mono_marshal_realloc_hglobal (ptr, s);
+
        if (!res) {
                mono_set_pending_exception (mono_domain_get ()->out_of_memory_ex);
                return NULL;
@@ -11119,30 +11128,38 @@ ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal (gpointer ptr, g
        return res;
 }
 
-void
-ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal (void *ptr)
+#ifndef HOST_WIN32
+static inline void
+mono_marshal_free_hglobal (gpointer ptr)
 {
-#ifdef HOST_WIN32
-       GlobalFree (ptr);
-#else
        g_free (ptr);
+       return;
+}
 #endif
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal (void *ptr)
+{
+       mono_marshal_free_hglobal (ptr);
 }
 
 void*
 ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int size)
 {
-       void *res;
+       void *res = mono_marshal_alloc_co_task_mem (size);
 
-#ifdef HOST_WIN32
-       res = CoTaskMemAlloc (size);
-#else
-       if ((gulong)size == 0)
-               /* This returns a valid pointer for size 0 on MS.NET */
-               size = 4;
+       if (!res) {
+               mono_set_pending_exception (mono_domain_get ()->out_of_memory_ex);
+               return NULL;
+       }
+       return res;
+}
+
+void*
+ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMemSize (gulong size)
+{
+       void *res = mono_marshal_alloc_co_task_mem (size);
 
-       res = g_try_malloc ((gulong)size);
-#endif
        if (!res) {
                mono_set_pending_exception (mono_domain_get ()->out_of_memory_ex);
                return NULL;
@@ -11153,23 +11170,23 @@ ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int size)
 void
 ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem (void *ptr)
 {
-#ifdef HOST_WIN32
-       CoTaskMemFree (ptr);
-#else
-       g_free (ptr);
-#endif
+       mono_marshal_free_co_task_mem (ptr);
+       return;
 }
 
+#ifndef HOST_WIN32
+static inline gpointer
+mono_marshal_realloc_co_task_mem (gpointer ptr, size_t size)
+{
+       return g_try_realloc (ptr, (gulong)size);
+}
+#endif
+
 gpointer
 ves_icall_System_Runtime_InteropServices_Marshal_ReAllocCoTaskMem (gpointer ptr, int size)
 {
-       void *res;
+       void *res = mono_marshal_realloc_co_task_mem (ptr, size);
 
-#ifdef HOST_WIN32
-       res = CoTaskMemRealloc (ptr, size);
-#else
-       res = g_try_realloc (ptr, (gulong)size);
-#endif
        if (!res) {
                mono_set_pending_exception (mono_domain_get ()->out_of_memory_ex);
                return NULL;
@@ -11218,7 +11235,7 @@ mono_marshal_is_loading_type_info (MonoClass *klass)
 /**
  * mono_marshal_load_type_info:
  *
- *  Initialize klass->marshal_info using information from metadata. This function can
+ *  Initialize klass::marshal_info using information from metadata. This function can
  * recursively call itself, and the caller is responsible to avoid that by calling 
  * mono_marshal_is_loading_type_info () beforehand.
  *
@@ -11237,14 +11254,16 @@ mono_marshal_load_type_info (MonoClass* klass)
 
        g_assert (klass != NULL);
 
-       if (klass->marshal_info)
-               return klass->marshal_info;
+       info = mono_class_get_marshal_info (klass);
+       if (info)
+               return info;
 
        if (!klass->inited)
                mono_class_init (klass);
 
-       if (klass->marshal_info)
-               return klass->marshal_info;
+       info = mono_class_get_marshal_info (klass);
+       if (info)
+               return info;
 
        /*
         * This function can recursively call itself, so we keep the list of classes which are
@@ -11264,7 +11283,7 @@ mono_marshal_load_type_info (MonoClass* klass)
                count++;
        }
 
-       layout = klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
+       layout = mono_class_get_flags (klass) & TYPE_ATTRIBUTE_LAYOUT_MASK;
 
        /* The mempool is protected by the loader lock */
        info = (MonoMarshalType *)mono_image_alloc0 (klass->image, MONO_SIZEOF_MARSHAL_TYPE + sizeof (MonoMarshalField) * count);
@@ -11328,6 +11347,9 @@ mono_marshal_load_type_info (MonoClass* klass)
                j++;
        }
 
+       if (klass->byval_arg.type == MONO_TYPE_PTR)
+               info->native_size = sizeof (gpointer);
+
        if (layout != TYPE_ATTRIBUTE_AUTO_LAYOUT) {
                info->native_size = MAX (native_size, info->native_size);
                /*
@@ -11363,14 +11385,17 @@ mono_marshal_load_type_info (MonoClass* klass)
        mono_native_tls_set_value (load_type_info_tls_id, loads_list);
 
        mono_marshal_lock ();
-       if (!klass->marshal_info) {
+       MonoMarshalType *info2 = mono_class_get_marshal_info (klass);
+       if (!info2) {
                /*We do double-checking locking on marshal_info */
                mono_memory_barrier ();
-               klass->marshal_info = info;
+               mono_class_set_marshal_info (klass, info);
+               ++class_marshal_info_count;
+               info2 = info;
        }
        mono_marshal_unlock ();
 
-       return klass->marshal_info;
+       return info2;
 }
 
 /**
@@ -11382,8 +11407,9 @@ mono_marshal_load_type_info (MonoClass* klass)
  */
 gint32
 mono_class_native_size (MonoClass *klass, guint32 *align)
-{      
-       if (!klass->marshal_info) {
+{
+       MonoMarshalType *info = mono_class_get_marshal_info (klass);
+       if (!info) {
                if (mono_marshal_is_loading_type_info (klass)) {
                        if (align)
                                *align = 0;
@@ -11391,12 +11417,13 @@ mono_class_native_size (MonoClass *klass, guint32 *align)
                } else {
                        mono_marshal_load_type_info (klass);
                }
+               info = mono_class_get_marshal_info (klass);
        }
 
        if (align)
-               *align = klass->marshal_info->min_align;
+               *align = info->min_align;
 
-       return klass->marshal_info->native_size;
+       return info->native_size;
 }
 
 /*
@@ -11526,6 +11553,7 @@ mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align,
        case MONO_NATIVE_BSTR:
        case MONO_NATIVE_ANSIBSTR:
        case MONO_NATIVE_TBSTR:
+       case MONO_NATIVE_UTF8STR:
        case MONO_NATIVE_LPARRAY:
        case MONO_NATIVE_SAFEARRAY:
        case MONO_NATIVE_IUNKNOWN:
@@ -11609,10 +11637,10 @@ mono_marshal_asany (MonoObject *o, MonoMarshalNative string_encoding, int param_
                switch (string_encoding) {
                case MONO_NATIVE_LPWSTR:
                        return mono_marshal_string_to_utf16_copy ((MonoString*)o);
-                       break;
                case MONO_NATIVE_LPSTR:
-                       return mono_string_to_lpstr ((MonoString*)o);
-                       break;
+               case MONO_NATIVE_UTF8STR:
+                       // Same code path, because in Mono, we treated strings as Utf8
+                       return mono_string_to_utf8str ((MonoString*)o);
                default:
                        g_warning ("marshaling conversion %d not implemented", string_encoding);
                        g_assert_not_reached ();
@@ -11627,11 +11655,10 @@ mono_marshal_asany (MonoObject *o, MonoMarshalNative string_encoding, int param_
 
                klass = t->data.klass;
 
-               if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
+               if (mono_class_is_auto_layout (klass))
                        break;
 
-               if (klass->valuetype && (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                       klass->blittable || klass->enumtype))
+               if (klass->valuetype && (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype))
                        return mono_object_unbox (o);
 
                res = mono_marshal_alloc (mono_class_native_size (klass, NULL), &error);
@@ -11680,6 +11707,7 @@ mono_marshal_free_asany (MonoObject *o, gpointer ptr, MonoMarshalNative string_e
                switch (string_encoding) {
                case MONO_NATIVE_LPWSTR:
                case MONO_NATIVE_LPSTR:
+               case MONO_NATIVE_UTF8STR:
                        mono_marshal_free (ptr);
                        break;
                default:
@@ -11691,8 +11719,7 @@ mono_marshal_free_asany (MonoObject *o, gpointer ptr, MonoMarshalNative string_e
        case MONO_TYPE_VALUETYPE: {
                klass = t->data.klass;
 
-               if (klass->valuetype && (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
-                                                                klass->blittable || klass->enumtype))
+               if (klass->valuetype && (mono_class_is_explicit_layout (klass) || klass->blittable || klass->enumtype))
                        break;
 
                if (param_attrs & PARAM_ATTRIBUTE_OUT) {
index 166db1478ce52312ca113fd954646df022247a7e..e22653f2d5bd2f1538e4c02e1f451bca53a067b2 100644 (file)
@@ -490,6 +490,9 @@ ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (gpointer src,
 void*
 ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int size);
 
+void*
+ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMemSize (gulong size);
+
 void
 ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem (void *ptr);
 
index ee07963fad720b71df7d3afde7b197fa3a198e4c..4896a237fe49060fcad67b280e3ac7c9820dc638 100644 (file)
@@ -61,7 +61,7 @@ char*
 mono_mempool_strdup_vprintf (MonoMemPool *pool, const char *format, va_list args);
 
 char*
-mono_mempool_strdup_printf (MonoMemPool *pool, const char *format, ...);
+mono_mempool_strdup_printf (MonoMemPool *pool, const char *format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);;
 
 long
 mono_mempool_get_bytes_allocated (void);
index 2706ec6662b974ff39c98f87a82625cbea23c1f5..7a871f034bfd58b28de0092507c84d2cc6c41b37 100644 (file)
@@ -198,25 +198,27 @@ static mono_mutex_t mempool_tracing_lock;
 static void
 mono_backtrace (int size)
 {
-        void *array[BACKTRACE_DEPTH];
-        char **names;
-        int i, symbols;
-        static gboolean inited;
-
-        if (!inited) {
-            mono_os_mutex_init_recursive (&mempool_tracing_lock);
-            inited = TRUE;
-        }
-
-        mono_os_mutex_lock (&mempool_tracing_lock);
-        g_print ("Allocating %d bytes\n", size);
-        symbols = backtrace (array, BACKTRACE_DEPTH);
-        names = backtrace_symbols (array, symbols);
-        for (i = 1; i < symbols; ++i) {
-                g_print ("\t%s\n", names [i]);
-        }
-        g_free (names);
-        mono_os_mutex_unlock (&mempool_tracing_lock);
+       void *array[BACKTRACE_DEPTH];
+       char **names;
+       int i, symbols;
+       static gboolean inited;
+
+       if (!inited) {
+               mono_os_mutex_init_recursive (&mempool_tracing_lock);
+               inited = TRUE;
+       }
+
+       mono_os_mutex_lock (&mempool_tracing_lock);
+       g_print ("Allocating %d bytes\n", size);
+       MONO_ENTER_GC_SAFE;
+       symbols = backtrace (array, BACKTRACE_DEPTH);
+       names = backtrace_symbols (array, symbols);
+       MONO_EXIT_GC_SAFE;
+       for (i = 1; i < symbols; ++i) {
+               g_print ("\t%s\n", names [i]);
+       }
+       g_free (names);
+       mono_os_mutex_unlock (&mempool_tracing_lock);
 }
 
 #endif
index 8852d29458c056eb80ac39ae39e9f5798e30774c..1c82b442e2798dbc7ce8fdcf4855fc7c9bdc8ed3 100644 (file)
@@ -499,7 +499,6 @@ struct _MonoDynamicImage {
        GHashTable *method_aux_hash;
        GHashTable *vararg_aux_hash;
        MonoGHashTable *generic_def_objects;
-       MonoGHashTable *methodspec;
        /*
         * Maps final token values to the object they describe.
         */
@@ -643,7 +642,7 @@ char*
 mono_image_strdup_vprintf (MonoImage *image, const char *format, va_list args);
 
 char*
-mono_image_strdup_printf (MonoImage *image, const char *format, ...);
+mono_image_strdup_printf (MonoImage *image, const char *format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);;
 
 GList*
 g_list_prepend_image (MonoImage *image, GList *list, gpointer data);
@@ -918,5 +917,8 @@ mono_image_set_description (MonoImageSet *);
 MonoImageSet *
 mono_find_image_set_owner (void *ptr);
 
+void
+mono_loader_register_module (const char *name, MonoDl *module);
+
 #endif /* __MONO_METADATA_INTERNALS_H__ */
 
index c3beaa4553795cf7d9285b3b0f68c5d3c88abf7e..9b4ca91bc753965ceaba0e55cf9b8f096af0ee08 100644 (file)
@@ -2397,7 +2397,7 @@ verify_typeref_table (VerifyContext *ctx)
 }
 
 /*bits 9,11,14,15,19,21,24-31 */
-#define INVALID_TYPEDEF_FLAG_BITS ((1 << 6) | (1 << 9) | (1 << 14) | (1 << 15) | (1 << 19) | (1 << 21) | 0xFF000000)
+#define INVALID_TYPEDEF_FLAG_BITS ((1 << 6) | (1 << 9) | (1 << 15) | (1 << 19) | (1 << 21) | 0xFF000000)
 static void
 verify_typedef_table (VerifyContext *ctx)
 {
index f9e2bc514889b5f1fb78f1898467f7bbc2408ce1..e8a19188a757201581b562a6ce7309af31b420d5 100644 (file)
@@ -2937,7 +2937,7 @@ mono_metadata_get_generic_inst (int type_argc, MonoType **type_argv)
 static gboolean
 mono_metadata_is_type_builder_generic_type_definition (MonoClass *container_class, MonoGenericInst *inst, gboolean is_dynamic)
 {
-       MonoGenericContainer *container = container_class->generic_container
+       MonoGenericContainer *container = mono_class_get_generic_container (container_class)
 
        if (!is_dynamic || container_class->wastypebuilder || container->type_argc != inst->type_argc)
                return FALSE;
@@ -2959,6 +2959,8 @@ mono_metadata_lookup_generic_class (MonoClass *container_class, MonoGenericInst
        MonoImageSet *set;
        CollectData data;
 
+       g_assert (mono_class_get_generic_container (container_class)->type_argc == inst->type_argc);
+
        memset (&helper, 0, sizeof(helper)); // act like g_new0
        helper.container_class = container_class;
        helper.context.class_inst = inst;
@@ -2994,7 +2996,7 @@ mono_metadata_lookup_generic_class (MonoClass *container_class, MonoGenericInst
        gclass->context.class_inst = inst;
        gclass->context.method_inst = NULL;
        gclass->owner = set;
-       if (inst == container_class->generic_container->context.class_inst && !is_tb_open)
+       if (inst == mono_class_get_generic_container (container_class)->context.class_inst && !is_tb_open)
                gclass->cached_class = container_class;
 
        g_hash_table_insert (set->gclass_cache, gclass, gclass);
@@ -3089,7 +3091,7 @@ do_mono_metadata_parse_generic_class (MonoType *type, MonoImage *m, MonoGenericC
                return FALSE;
 
        gklass = mono_class_from_mono_type (gtype);
-       if (!gklass->generic_container) {
+       if (!mono_class_is_gtd (gklass)) {
                mono_error_set_bad_image (error, m, "Generic instance with non-generic definition");
                return FALSE;
        }
@@ -4804,7 +4806,7 @@ static gboolean
 _mono_metadata_generic_class_container_equal (const MonoGenericClass *g1, MonoClass *c2, gboolean signature_only)
 {
        MonoGenericInst *i1 = g1->context.class_inst;
-       MonoGenericInst *i2 = c2->generic_container->context.class_inst;
+       MonoGenericInst *i2 = mono_class_get_generic_container (c2)->context.class_inst;
 
        if (!mono_metadata_class_equal (g1->container_class, c2, signature_only))
                return FALSE;
@@ -4959,12 +4961,12 @@ mono_metadata_class_equal (MonoClass *c1, MonoClass *c2, gboolean signature_only
 {
        if (c1 == c2)
                return TRUE;
-       if (c1->generic_class && c2->generic_class)
-               return _mono_metadata_generic_class_equal (c1->generic_class, c2->generic_class, signature_only);
-       if (c1->generic_class && c2->generic_container)
-               return _mono_metadata_generic_class_container_equal (c1->generic_class, c2, signature_only);
-       if (c1->generic_container && c2->generic_class)
-               return _mono_metadata_generic_class_container_equal (c2->generic_class, c1, signature_only);
+       if (mono_class_is_ginst (c1) && mono_class_is_ginst (c2))
+               return _mono_metadata_generic_class_equal (mono_class_get_generic_class (c1), mono_class_get_generic_class (c2), signature_only);
+       if (mono_class_is_ginst (c1) && mono_class_is_gtd (c2))
+               return _mono_metadata_generic_class_container_equal (mono_class_get_generic_class (c1), c2, signature_only);
+       if (mono_class_is_gtd (c1) && mono_class_is_ginst (c2))
+               return _mono_metadata_generic_class_container_equal (mono_class_get_generic_class (c2), c1, signature_only);
        if ((c1->byval_arg.type == MONO_TYPE_VAR) && (c2->byval_arg.type == MONO_TYPE_VAR))
                return mono_metadata_generic_param_equal_internal (
                        c1->byval_arg.data.generic_param, c2->byval_arg.data.generic_param, signature_only);
@@ -5812,6 +5814,9 @@ handle_enum:
                        case MONO_NATIVE_TBSTR:
                                *conv = MONO_MARSHAL_CONV_STR_TBSTR;
                                return MONO_NATIVE_TBSTR;
+                       case MONO_NATIVE_UTF8STR:
+                               *conv = MONO_MARSHAL_CONV_STR_LPTSTR;
+                               return MONO_NATIVE_UTF8STR;
                        case MONO_NATIVE_BYVALTSTR:
                                if (unicode)
                                        *conv = MONO_MARSHAL_CONV_STR_BYVALWSTR;
@@ -6607,10 +6612,10 @@ mono_metadata_get_corresponding_field_from_generic_type_definition (MonoClassFie
        MonoClass *gtd;
        int offset;
 
-       if (!field->parent->generic_class)
+       if (!mono_class_is_ginst (field->parent))
                return field;
 
-       gtd = field->parent->generic_class->container_class;
+       gtd = mono_class_get_generic_class (field->parent)->container_class;
        offset = field - field->parent->fields;
        return gtd->fields + offset;
 }
@@ -6625,12 +6630,12 @@ mono_metadata_get_corresponding_event_from_generic_type_definition (MonoEvent *e
        MonoClass *gtd;
        int offset;
 
-       if (!event->parent->generic_class)
+       if (!mono_class_is_ginst (event->parent))
                return event;
 
-       gtd = event->parent->generic_class->container_class;
-       offset = event - event->parent->ext->events;
-       return gtd->ext->events + offset;
+       gtd = mono_class_get_generic_class (event->parent)->container_class;
+       offset = event - mono_class_get_ext (event->parent)->events;
+       return mono_class_get_ext (gtd)->events + offset;
 }
 
 /*
@@ -6643,12 +6648,12 @@ mono_metadata_get_corresponding_property_from_generic_type_definition (MonoPrope
        MonoClass *gtd;
        int offset;
 
-       if (!property->parent->generic_class)
+       if (!mono_class_is_ginst (property->parent))
                return property;
 
-       gtd = property->parent->generic_class->container_class;
-       offset = property - property->parent->ext->properties;
-       return gtd->ext->properties + offset;
+       gtd = mono_class_get_generic_class (property->parent)->container_class;
+       offset = property - mono_class_get_ext (property->parent)->properties;
+       return mono_class_get_ext (gtd)->properties + offset;
 }
 
 MonoWrapperCaches*
index 046491943d5e7d5493b9a225d2a28f7e275162c5..d8e48318b4da77868fe8e06b40810e31849b6402 100644 (file)
@@ -15,9 +15,9 @@ MONO_BEGIN_DECLS
 #define MONO_TYPE_IS_POINTER(t) mono_type_is_pointer (t)
 #define MONO_TYPE_IS_REFERENCE(t) mono_type_is_reference (t)
 
-#define MONO_CLASS_IS_INTERFACE(c) ((c->flags & TYPE_ATTRIBUTE_INTERFACE) || (c->byval_arg.type == MONO_TYPE_VAR) || (c->byval_arg.type == MONO_TYPE_MVAR))
+#define MONO_CLASS_IS_INTERFACE(c) ((mono_class_get_flags (c) & TYPE_ATTRIBUTE_INTERFACE) || (c->byval_arg.type == MONO_TYPE_VAR) || (c->byval_arg.type == MONO_TYPE_MVAR))
 
-#define MONO_CLASS_IS_IMPORT(c) ((c->flags & TYPE_ATTRIBUTE_IMPORT))
+#define MONO_CLASS_IS_IMPORT(c) ((mono_class_get_flags (c) & TYPE_ATTRIBUTE_IMPORT))
 
 typedef struct _MonoClass MonoClass;
 typedef struct _MonoDomain MonoDomain;
@@ -76,6 +76,9 @@ typedef enum {
        MONO_NATIVE_LPSTRUCT = 0x2b,
        MONO_NATIVE_CUSTOM = 0x2c,
        MONO_NATIVE_ERROR = 0x2d,
+       // TODO: MONO_NATIVE_IINSPECTABLE = 0x2e
+       // TODO: MONO_NATIVE_HSTRING = 0x2f
+       MONO_NATIVE_UTF8STR = 0x30,
        MONO_NATIVE_MAX = 0x50 /* no info */
 } MonoMarshalNative;
 
@@ -162,7 +165,11 @@ typedef enum {
        MONO_MARSHAL_FREE_ARRAY,
        MONO_MARSHAL_CONV_BSTR_STR,
        MONO_MARSHAL_CONV_SAFEHANDLE,
-       MONO_MARSHAL_CONV_HANDLEREF
+       MONO_MARSHAL_CONV_HANDLEREF,
+       MONO_MARSHAL_CONV_STR_UTF8STR,
+       MONO_MARSHAL_CONV_SB_UTF8STR,
+       MONO_MARSHAL_CONV_UTF8STR_STR,
+       MONO_MARSHAL_CONV_UTF8STR_SB,
 } MonoMarshalConv;
 
 #define MONO_MARSHAL_CONV_INVALID ((MonoMarshalConv)-1)
index ece67d1286cd4fef23ca0b3389e7af6b58171f82..2e61a1b3373548162adf8a0291ebc00c3411fe4a 100644 (file)
@@ -41,3 +41,13 @@ mono_config_get_bin_dir (void)
 #endif
 }
 
+const char*
+mono_config_get_reloc_lib_dir (void)
+{
+#ifdef MONO_RELOC_LIBDIR
+       return MONO_RELOC_LIBDIR;
+#else
+       return NULL;
+#endif
+}
+
index 9488511bde4b719d7f0ba0a1f779915250eb5812..25e765122539c04384aad6f75ade2ee5efb39637 100644 (file)
@@ -13,4 +13,7 @@ mono_config_get_cfg_dir (void);
 const char*
 mono_config_get_bin_dir (void);
 
+const char*
+mono_config_get_reloc_lib_dir (void);
+
 #endif
index 2bedf12cd8fa713149e7ee88a43ad09cd2912988..fe82c2e037bef78c7074f11e22a817abd3093f40 100644 (file)
@@ -314,13 +314,14 @@ dllmap_start (gpointer user_data,
                        else if (strcmp (attribute_names [i], "target") == 0){
                                char *p = strstr (attribute_values [i], "$mono_libdir");
                                if (p != NULL){
-                                       const char *libdir = mono_assembly_getrootdir ();
+                                       char *libdir = mono_native_getrootdir ();
                                        size_t libdir_len = strlen (libdir);
                                        char *result;
                                        
                                        result = (char *)g_malloc (libdir_len-strlen("$mono_libdir")+strlen(attribute_values[i])+1);
                                        strncpy (result, attribute_values[i], p-attribute_values[i]);
                                        strcpy (result+(p-attribute_values[i]), libdir);
+                                       g_free (libdir);
                                        strcat (result, p+strlen("$mono_libdir"));
                                        info->target = result;
                                } else 
index a4c48f1413dda3adef0ed9064d111854343a075e..0a697360e22e3404541a4f645725d78a2d518217 100644 (file)
@@ -9,6 +9,7 @@
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 #include <config.h>
+#include <mono/utils/mono-compiler.h>
 #include "mono-endian.h"
 
 #if NO_UNALIGNED_ACCESS
@@ -86,4 +87,8 @@ mono_read64 (const unsigned char *x)
        return r.i;
 }
 
+#else /* NO_UNALIGNED_ACCESS */
+
+MONO_EMPTY_SOURCE_FILE (mono_endian);
+
 #endif
diff --git a/mono/metadata/mono-security-windows-internals.h b/mono/metadata/mono-security-windows-internals.h
new file mode 100644 (file)
index 0000000..a7cc247
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_MONO_SECURITY_WINDOWS_INTERNALS_H__
+#define __MONO_METADATA_MONO_SECURITY_WINDOWS_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include "mono/metadata/security.h"
+#include "mono/metadata/object.h"
+#include "mono/metadata/object-internals.h"
+#include "mono/metadata/metadata.h"
+#include "mono/metadata/metadata-internals.h"
+
+gint32
+mono_security_win_get_token_name (gpointer token, gunichar2 ** uniname);
+
+gboolean
+mono_security_win_is_machine_protected (gunichar2 *path);
+
+gboolean
+mono_security_win_is_user_protected (gunichar2 *path);
+
+gboolean
+mono_security_win_protect_machine (gunichar2 *path);
+
+gboolean
+mono_security_win_protect_user (gunichar2 *path);
+#endif /* HOST_WIN32 */
+
+#endif /* __MONO_METADATA_MONO_SECURITY_WINDOWS_INTERNALS_H__ */
diff --git a/mono/metadata/mono-security-windows-uwp.c b/mono/metadata/mono-security-windows-uwp.c
new file mode 100644 (file)
index 0000000..01549b8
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * mono-security-windows-uwp.c: UWP security support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include "mono/metadata/mono-security-windows-internals.h"
+
+gpointer
+ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (void)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("OpenThreadToken, OpenProcessToken");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "OpenThreadToken, OpenProcessToken");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return NULL;
+}
+
+MonoArray*
+ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetTokenInformation");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetTokenInformation");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return NULL;
+}
+
+gpointer
+ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken (gpointer token)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("DuplicateToken");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "DuplicateToken");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return NULL;
+}
+
+gboolean
+ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken (gpointer token)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("ImpersonateLoggedOnUser");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "ImpersonateLoggedOnUser");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+gboolean
+ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf (void)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("RevertToSelf");
+
+       mono_error_set_not_supported(&mono_error, G_UNSUPPORTED_API, "RevertToSelf");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+gint32
+mono_security_win_get_token_name (gpointer token, gunichar2 ** uniname)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetTokenInformation");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetTokenInformation");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return 0;
+}
+
+gboolean
+mono_security_win_is_machine_protected (gunichar2 *path)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetNamedSecurityInfo, LocalFree");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetNamedSecurityInfo, LocalFree");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+gboolean
+mono_security_win_is_user_protected (gunichar2 *path)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetNamedSecurityInfo, LocalFree");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetNamedSecurityInfo, LocalFree");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+gboolean
+mono_security_win_protect_machine (gunichar2 *path)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("BuildTrusteeWithSid, SetEntriesInAcl, SetNamedSecurityInfo, LocalFree, FreeSid");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "BuildTrusteeWithSid, SetEntriesInAcl, SetNamedSecurityInfo, LocalFree, FreeSid");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+gboolean
+mono_security_win_protect_user (gunichar2 *path)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("BuildTrusteeWithSid, SetEntriesInAcl, SetNamedSecurityInfo, LocalFree");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "BuildTrusteeWithSid, SetEntriesInAcl, SetNamedSecurityInfo, LocalFree");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (mono_security_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/metadata/mono-security-windows.c b/mono/metadata/mono-security-windows.c
new file mode 100644 (file)
index 0000000..f6d088d
--- /dev/null
@@ -0,0 +1,495 @@
+/*
+ * mono-security-windows.c: Windows security support.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#include <config.h>
+#include <glib.h>
+
+#if defined(HOST_WIN32)
+#include <winsock2.h>
+#include <windows.h>
+#include "mono/metadata/mono-security-windows-internals.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+#include <aclapi.h>
+#include <accctrl.h>
+#endif
+
+#ifndef PROTECTED_DACL_SECURITY_INFORMATION
+#define PROTECTED_DACL_SECURITY_INFORMATION    0x80000000L
+#endif
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static gunichar2*
+GetSidName (gunichar2 *server, PSID sid, gint32 *size)
+{
+       gunichar2 *uniname = NULL;
+       DWORD cchName = 0;
+       DWORD cchDomain = 0;
+       SID_NAME_USE peUse; /* out */
+
+       LookupAccountSid (server, sid, NULL, &cchName, NULL,
+               &cchDomain, &peUse);
+
+       if ((cchName > 0) && (cchDomain > 0)) {
+               gunichar2 *user = g_malloc0 ((cchName + 1) * 2);
+               gunichar2 *domain = g_malloc0 ((cchDomain + 1) * 2);
+
+               LookupAccountSid (server, sid, user, &cchName, domain,
+                       &cchDomain, &peUse);
+
+               if (cchName > 0) {
+                       if (cchDomain > 0) {
+                               /* domain/machine name included (+ sepearator) */
+                               *size = cchName + cchDomain + 1;
+                               uniname = g_malloc0 ((*size + 1) * 2);
+                               memcpy (uniname, domain, cchDomain * 2);
+                               *(uniname + cchDomain) = '\\';
+                               memcpy (uniname + cchDomain + 1, user, cchName * 2);
+                               g_free (user);
+                       }
+                       else {
+                               /* no domain / machine */
+                               *size = cchName;
+                               uniname = user;
+                       }
+               }
+               else {
+                       /* nothing -> return NULL */
+                       g_free (user);
+               }
+
+               g_free (domain);
+       }
+
+       return uniname;
+}
+
+gpointer
+ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (void)
+{
+       gpointer token = NULL;
+
+       /* Note: This isn't a copy of the Token - we must not close it!!!
+        * http://www.develop.com/kbrown/book/html/whatis_windowsprincipal.html
+        */
+
+       /* thread may be impersonating somebody */
+       if (OpenThreadToken (GetCurrentThread (), MAXIMUM_ALLOWED, 1, &token) == 0) {
+               /* if not take the process identity */
+               OpenProcessToken (GetCurrentProcess (), MAXIMUM_ALLOWED, &token);
+       }
+
+       return token;
+}
+
+gint32
+mono_security_win_get_token_name (gpointer token, gunichar2 ** uniname)
+{
+       gint32 size = 0;
+
+       GetTokenInformation (token, TokenUser, NULL, size, (PDWORD)&size);
+       if (size > 0) {
+               TOKEN_USER *tu = g_malloc0 (size);
+               if (GetTokenInformation (token, TokenUser, tu, size, (PDWORD)&size)) {
+                       *uniname = GetSidName (NULL, tu->User.Sid, &size);
+               }
+               g_free (tu);
+       }
+
+       return size;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+MonoString*
+ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token)
+{
+       MonoError error;
+       MonoString *result = NULL;
+       gunichar2 *uniname = NULL;
+       gint32 size = 0;
+
+       mono_error_init (&error);
+
+       size = mono_security_win_get_token_name (token, &uniname);
+
+       if (size > 0) {
+               result = mono_string_new_utf16_checked (mono_domain_get (), uniname, size, &error);
+       }
+       else
+               result = mono_string_new (mono_domain_get (), "");
+
+       if (uniname)
+               g_free (uniname);
+
+       mono_error_set_pending_exception (&error);
+       return result;
+}
+
+gpointer
+ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoString *username)
+{
+       gpointer token = NULL;
+
+       /* TODO: MS has something like this working in Windows 2003 (client and
+        * server) but works only for domain accounts (so it's quite limiting).
+        * http://www.develop.com/kbrown/book/html/howto_logonuser.html
+        */
+       g_warning ("Unsupported on Win32 (anyway requires W2K3 minimum)");
+       return token;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+MonoArray*
+ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
+{
+       MonoError error;
+       MonoArray *array = NULL;
+       MonoDomain *domain = mono_domain_get ();
+
+       gint32 size = 0;
+
+       GetTokenInformation (token, TokenGroups, NULL, size, (PDWORD)&size);
+       if (size > 0) {
+               TOKEN_GROUPS *tg = g_malloc0 (size);
+               if (GetTokenInformation (token, TokenGroups, tg, size, (PDWORD)&size)) {
+                       int i=0;
+                       int num = tg->GroupCount;
+
+                       array = mono_array_new_checked (domain, mono_get_string_class (), num, &error);
+                       if (mono_error_set_pending_exception (&error)) {
+                               g_free (tg);
+                               return NULL;
+                       }
+
+                       for (i=0; i < num; i++) {
+                               gint32 size = 0;
+                               gunichar2 *uniname = GetSidName (NULL, tg->Groups [i].Sid, &size);
+
+                               if (uniname) {
+                                       MonoString *str = mono_string_new_utf16_checked (domain, uniname, size, &error);
+                                       if (!is_ok (&error)) {
+                                               g_free (uniname);
+                                               g_free (tg);
+                                               mono_error_set_pending_exception (&error);
+                                               return NULL;
+                                       }
+                                       mono_array_setref (array, i, str);
+                                       g_free (uniname);
+                               }
+                       }
+               }
+               g_free (tg);
+       }
+
+       if (!array) {
+               /* return empty array of string, i.e. string [0] */
+               array = mono_array_new_checked (domain, mono_get_string_class (), 0, &error);
+               mono_error_set_pending_exception (&error);
+       }
+       return array;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+gboolean
+ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken (gpointer token)
+{
+       gboolean result = TRUE;
+       result = (CloseHandle (token) != 0);
+       return result;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gpointer
+ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken (gpointer token)
+{
+       gpointer dupe = NULL;
+
+       if (DuplicateToken (token, SecurityImpersonation, &dupe) == 0) {
+               dupe = NULL;
+       }
+       return dupe;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+gboolean
+ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer user, gpointer group)
+{
+       gboolean result = FALSE;
+
+       /* The convertion from an ID to a string is done in managed code for Windows */
+       g_warning ("IsMemberOfGroupId should never be called on Win32");
+       return result;
+}
+
+gboolean
+ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpointer user, MonoString *group)
+{
+       gboolean result = FALSE;
+
+       /* Windows version use a cache built using WindowsIdentity._GetRoles */
+       g_warning ("IsMemberOfGroupName should never be called on Win32");
+       return result;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static PSID
+GetAdministratorsSid (void)
+{
+       SID_IDENTIFIER_AUTHORITY admins = { SECURITY_NT_AUTHORITY };
+       PSID pSid = NULL;
+       if (!AllocateAndInitializeSid (&admins, 2, SECURITY_BUILTIN_DOMAIN_RID,
+               DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSid))
+               return NULL;
+       /* Note: this SID must be freed with FreeSid () */
+       return pSid;
+}
+
+static PSID
+GetEveryoneSid (void)
+{
+       SID_IDENTIFIER_AUTHORITY everyone = { SECURITY_WORLD_SID_AUTHORITY };
+       PSID pSid = NULL;
+       if (!AllocateAndInitializeSid (&everyone, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pSid))
+               return NULL;
+       /* Note: this SID must be freed with FreeSid () */
+       return pSid;
+}
+
+static PSID
+GetCurrentUserSid (void)
+{
+       PSID sid = NULL;
+       guint32 size = 0;
+       gpointer token = ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken ();
+
+       GetTokenInformation (token, TokenUser, NULL, size, (PDWORD)&size);
+       if (size > 0) {
+               TOKEN_USER *tu = g_malloc0 (size);
+               if (GetTokenInformation (token, TokenUser, tu, size, (PDWORD)&size)) {
+                       DWORD length = GetLengthSid (tu->User.Sid);
+                       sid = (PSID) g_malloc0 (length);
+                       if (!CopySid (length, sid, tu->User.Sid)) {
+                               g_free (sid);
+                               sid = NULL;
+                       }
+               }
+               g_free (tu);
+       }
+       /* Note: this SID must be freed with g_free () */
+       return sid;
+}
+
+static ACCESS_MASK
+GetRightsFromSid (PSID sid, PACL acl)
+{
+       ACCESS_MASK rights = 0;
+       TRUSTEE trustee;
+
+       BuildTrusteeWithSidW (&trustee, sid);
+       if (GetEffectiveRightsFromAcl (acl, &trustee, &rights) != ERROR_SUCCESS)
+               return 0;
+
+       return rights;
+}
+
+gboolean
+mono_security_win_is_machine_protected (gunichar2 *path)
+{
+       gboolean success = FALSE;
+       PACL pDACL = NULL;
+       PSECURITY_DESCRIPTOR pSD = NULL;
+       PSID pEveryoneSid = NULL;
+
+       DWORD dwRes = GetNamedSecurityInfoW (path, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, &pSD);
+       if (dwRes != ERROR_SUCCESS)
+               return FALSE;
+
+       /* We check that Everyone is still limited to READ-ONLY -
+       but not if new entries have been added by an Administrator */
+
+       pEveryoneSid = GetEveryoneSid ();
+       if (pEveryoneSid) {
+               ACCESS_MASK rights = GetRightsFromSid (pEveryoneSid, pDACL);
+               /* http://msdn.microsoft.com/library/en-us/security/security/generic_access_rights.asp?frame=true */
+               success = (rights == (READ_CONTROL | SYNCHRONIZE | FILE_READ_DATA | FILE_READ_EA | FILE_READ_ATTRIBUTES));
+               FreeSid (pEveryoneSid);
+       }
+       /* Note: we don't need to check our own access -
+       we'll know soon enough when reading the file */
+
+       if (pSD)
+               LocalFree (pSD);
+
+       return success;
+}
+
+gboolean
+mono_security_win_is_user_protected (gunichar2 *path)
+{
+       gboolean success = FALSE;
+       PACL pDACL = NULL;
+       PSID pEveryoneSid = NULL;
+       PSECURITY_DESCRIPTOR pSecurityDescriptor = NULL;
+
+       DWORD dwRes = GetNamedSecurityInfoW (path, SE_FILE_OBJECT,
+               DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, &pSecurityDescriptor);
+       if (dwRes != ERROR_SUCCESS)
+               return FALSE;
+
+       /* We check that our original entries in the ACL are in place -
+       but not if new entries have been added by the user */
+
+       /* Everyone should be denied */
+       pEveryoneSid = GetEveryoneSid ();
+       if (pEveryoneSid) {
+               ACCESS_MASK rights = GetRightsFromSid (pEveryoneSid, pDACL);
+               success = (rights == 0);
+               FreeSid (pEveryoneSid);
+       }
+       /* Note: we don't need to check our own access -
+       we'll know soon enough when reading the file */
+
+       if (pSecurityDescriptor)
+               LocalFree (pSecurityDescriptor);
+
+       return success;
+}
+
+gboolean
+mono_security_win_protect_machine (gunichar2 *path)
+{
+       PSID pEveryoneSid = GetEveryoneSid ();
+       PSID pAdminsSid = GetAdministratorsSid ();
+       DWORD retval = -1;
+
+       if (pEveryoneSid && pAdminsSid) {
+               PACL pDACL = NULL;
+               EXPLICIT_ACCESS ea [2];
+               ZeroMemory (&ea, 2 * sizeof (EXPLICIT_ACCESS));
+
+               /* grant all access to the BUILTIN\Administrators group */
+               BuildTrusteeWithSidW (&ea [0].Trustee, pAdminsSid);
+               ea [0].grfAccessPermissions = GENERIC_ALL;
+               ea [0].grfAccessMode = SET_ACCESS;
+               ea [0].grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
+               ea [0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
+               ea [0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
+
+               /* read-only access everyone */
+               BuildTrusteeWithSidW (&ea [1].Trustee, pEveryoneSid);
+               ea [1].grfAccessPermissions = GENERIC_READ;
+               ea [1].grfAccessMode = SET_ACCESS;
+               ea [1].grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
+               ea [1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
+               ea [1].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
+
+               retval = SetEntriesInAcl (2, ea, NULL, &pDACL);
+               if (retval == ERROR_SUCCESS) {
+                       /* with PROTECTED_DACL_SECURITY_INFORMATION we */
+                       /* remove any existing ACL (like inherited ones) */
+                       retval = SetNamedSecurityInfo (path, SE_FILE_OBJECT,
+                               DACL_SECURITY_INFORMATION | PROTECTED_DACL_SECURITY_INFORMATION,
+                               NULL, NULL, pDACL, NULL);
+               }
+               if (pDACL)
+                       LocalFree (pDACL);
+       }
+
+       if (pEveryoneSid)
+               FreeSid (pEveryoneSid);
+       if (pAdminsSid)
+               FreeSid (pAdminsSid);
+       return (retval == ERROR_SUCCESS);
+}
+
+gboolean
+mono_security_win_protect_user (gunichar2 *path)
+{
+       DWORD retval = -1;
+
+       PSID pCurrentSid = GetCurrentUserSid ();
+       if (pCurrentSid) {
+               PACL pDACL = NULL;
+               EXPLICIT_ACCESS ea;
+               ZeroMemory (&ea, sizeof (EXPLICIT_ACCESS));
+
+               /* grant exclusive access to the current user */
+               BuildTrusteeWithSidW (&ea.Trustee, pCurrentSid);
+               ea.grfAccessPermissions = GENERIC_ALL;
+               ea.grfAccessMode = SET_ACCESS;
+               ea.grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
+               ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
+               ea.Trustee.TrusteeType = TRUSTEE_IS_USER;
+
+               retval = SetEntriesInAcl (1, &ea, NULL, &pDACL);
+               if (retval == ERROR_SUCCESS) {
+                       /* with PROTECTED_DACL_SECURITY_INFORMATION we
+                          remove any existing ACL (like inherited ones) */
+                       retval = SetNamedSecurityInfo (path, SE_FILE_OBJECT,
+                               DACL_SECURITY_INFORMATION | PROTECTED_DACL_SECURITY_INFORMATION,
+                               NULL, NULL, pDACL, NULL);
+               }
+
+               if (pDACL)
+                       LocalFree (pDACL);
+               g_free (pCurrentSid); /* g_malloc0 */
+       }
+
+       return (retval == ERROR_SUCCESS);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (MonoString *root)
+{
+       gint32 flags;
+
+       /* ACL are nice... unless you have FAT or other uncivilized filesystem */
+       if (!GetVolumeInformation (mono_string_chars (root), NULL, 0, NULL, NULL, (LPDWORD)&flags, NULL, 0))
+               return FALSE;
+       return ((flags & FS_PERSISTENT_ACLS) == FS_PERSISTENT_ACLS);
+}
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (MonoString *path)
+{
+       gboolean ret = FALSE;
+
+       /* no one, but the owner, should have write access to the directory */
+       ret = mono_security_win_is_machine_protected (mono_string_chars (path));
+       return (MonoBoolean)ret;
+}
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (MonoString *path)
+{
+       gboolean ret = FALSE;
+
+       /* no one, but the user, should have access to the directory */
+       ret = mono_security_win_is_user_protected (mono_string_chars (path));
+       return (MonoBoolean)ret;
+}
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (MonoString *path)
+{
+       gboolean ret = FALSE;
+
+       /* read/write to owner, read to everyone else */
+       ret = mono_security_win_protect_machine (mono_string_chars (path));
+       return (MonoBoolean)ret;
+}
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (MonoString *path)
+{
+       gboolean ret = FALSE;
+
+       /* read/write to user, no access to everyone else */
+       ret = mono_security_win_protect_user (mono_string_chars (path));
+       return (MonoBoolean)ret;
+}
+#endif /* HOST_WIN32 */
index 865b9ca1e04236ec1a7c7840436fca8c6e02de8a..09b8cd44abe6deaba2428602aa257022dbf21a88 100644 (file)
 #include <mono/io-layer/io-layer.h>
 #include <mono/utils/strenc.h>
 
-#ifdef HOST_WIN32
-
-#include <aclapi.h>
-#include <accctrl.h>
-
-#ifndef PROTECTED_DACL_SECURITY_INFORMATION
-#define PROTECTED_DACL_SECURITY_INFORMATION    0x80000000L
-#endif
-
-#else
-
+#ifndef HOST_WIN32
 #include <config.h>
 #ifdef HAVE_GRP_H
 #include <grp.h>
 #endif
 
 #endif /* defined(__GNUC__) */
-
-#endif /* not HOST_WIN32 */
-
+#endif /* !HOST_WIN32 */
 
 /* internal functions - reuse driven */
 
-#ifdef HOST_WIN32
-
 /* ask a server to translate a SID into a textual representation */
-static gunichar2*
-GetSidName (gunichar2 *server, PSID sid, gint32 *size) 
-{
-       gunichar2 *uniname = NULL;
-       DWORD cchName = 0;
-       DWORD cchDomain = 0;
-       SID_NAME_USE peUse; /* out */
-
-       LookupAccountSid (server, sid, NULL, &cchName, NULL, 
-               &cchDomain, &peUse); 
-       
-       if ((cchName > 0) && (cchDomain > 0)) {
-               gunichar2 *user = g_malloc0 ((cchName + 1) * 2);
-               gunichar2 *domain = g_malloc0 ((cchDomain + 1) * 2);
-
-               LookupAccountSid (server, sid, user, &cchName, domain,
-                       &cchDomain, &peUse);
-
-               if (cchName > 0) {
-                       if (cchDomain > 0) {
-                               /* domain/machine name included (+ sepearator) */
-                               *size = cchName + cchDomain + 1;
-                               uniname = g_malloc0 ((*size + 1) * 2);
-                               memcpy (uniname, domain, cchDomain * 2);
-                               *(uniname + cchDomain) = '\\';
-                               memcpy (uniname + cchDomain + 1, user, cchName * 2);
-                               g_free (user);
-                       }
-                       else {
-                               /* no domain / machine */
-                               *size = cchName;
-                               uniname = user;
-                       }
-               }
-               else {
-                       /* nothing -> return NULL */
-                       g_free (user);
-               }
-
-               g_free (domain);
-       }
-
-       return uniname;
-}
-
-
-#else /* not HOST_WIN32 */
-
+#ifndef HOST_WIN32
 #define MONO_SYSCONF_DEFAULT_SIZE      ((size_t) 1024)
 
 /*
@@ -133,7 +72,6 @@ static size_t mono_sysconf (int name)
        return (size == -1) ? MONO_SYSCONF_DEFAULT_SIZE : size;
 }
 
-
 static gchar*
 GetTokenName (uid_t uid)
 {
@@ -174,7 +112,6 @@ GetTokenName (uid_t uid)
        return uname;
 }
 
-
 static gboolean
 IsMemberInList (uid_t user, struct group *g) 
 {
@@ -201,7 +138,6 @@ IsMemberInList (uid_t user, struct group *g)
        return result;
 }
 
-
 static gboolean
 IsDefaultGroup (uid_t user, gid_t group)
 {
@@ -241,7 +177,6 @@ IsDefaultGroup (uid_t user, gid_t group)
        return result;
 }
 
-
 static gboolean
 IsMemberOf (gid_t user, struct group *g) 
 {
@@ -255,37 +190,34 @@ IsMemberOf (gid_t user, struct group *g)
        /* is the user in the group list */
        return IsMemberInList (user, g);
 }
-
-#endif
-
+#endif /* !HOST_WIN32 */
 
 /* ICALLS */
 
-
 /* System.Security.Principal.WindowsIdentity */
 
-
+#ifndef HOST_WIN32
 gpointer
 ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (void)
 {
-       gpointer token = NULL;
+       return GINT_TO_POINTER (geteuid ());
+}
+
+static gint32
+internal_get_token_name (gpointer token, gunichar2 ** uniname)
+{
+       gint32 size = 0;
 
-#ifdef HOST_WIN32
-       /* Note: This isn't a copy of the Token - we must not close it!!!
-        * http://www.develop.com/kbrown/book/html/whatis_windowsprincipal.html
-        */
+       gchar *uname = GetTokenName ((uid_t) GPOINTER_TO_INT (token));
 
-       /* thread may be impersonating somebody */
-       if (OpenThreadToken (GetCurrentThread (), MAXIMUM_ALLOWED, 1, &token) == 0) {
-               /* if not take the process identity */
-               OpenProcessToken (GetCurrentProcess (), MAXIMUM_ALLOWED, &token);
+       if (uname) {
+               size = strlen (uname);
+               *uniname = g_utf8_to_utf16 (uname, size, NULL, NULL, NULL);
+               g_free (uname);
        }
-#else
-       token = GINT_TO_POINTER (geteuid ());
-#endif
-       return token;
-}
 
+       return size;
+}
 
 MonoString*
 ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token)
@@ -296,24 +228,8 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token
        gint32 size = 0;
 
        mono_error_init (&error);
-#ifdef HOST_WIN32
-       GetTokenInformation (token, TokenUser, NULL, size, (PDWORD)&size);
-       if (size > 0) {
-               TOKEN_USER *tu = g_malloc0 (size);
-               if (GetTokenInformation (token, TokenUser, tu, size, (PDWORD)&size)) {
-                       uniname = GetSidName (NULL, tu->User.Sid, &size);
-               }
-               g_free (tu);
-       }
-#else 
-       gchar *uname = GetTokenName ((uid_t) GPOINTER_TO_INT (token));
 
-       if (uname) {
-               size = strlen (uname);
-               uniname = g_utf8_to_utf16 (uname, size, NULL, NULL, NULL);
-               g_free (uname);
-       }
-#endif /* HOST_WIN32 */
+       size = internal_get_token_name (token, &uniname);
 
        if (size > 0) {
                result = mono_string_new_utf16_checked (mono_domain_get (), uniname, size, &error);
@@ -327,22 +243,12 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token
        mono_error_set_pending_exception (&error);
        return result;
 }
+#endif  /* !HOST_WIN32 */
 
-
+#ifndef HOST_WIN32
 gpointer
 ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoString *username)
 {
-#ifdef HOST_WIN32
-       gpointer token = NULL;
-
-       /* TODO: MS has something like this working in Windows 2003 (client and
-        * server) but works only for domain accounts (so it's quite limiting).
-        * http://www.develop.com/kbrown/book/html/howto_logonuser.html
-        */
-       g_warning ("Unsupported on Win32 (anyway requires W2K3 minimum)");
-
-#else /* HOST_WIN32*/
-
 #ifdef HAVE_GETPWNAM_R
        struct passwd pwd;
        size_t fbufsize;
@@ -380,59 +286,26 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoString *us
        g_free (fbuf);
 #endif
        g_free (utf8_name);
-#endif
+
        return token;
 }
-
+#endif /* HOST_WIN32 */
 
 /* http://www.dotnet247.com/247reference/msgs/39/195403.aspx
 // internal static string[] WindowsIdentity._GetRoles (IntPtr token)
 */
+
+#ifndef HOST_WIN32
 MonoArray*
-ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token) 
+ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
 {
        MonoError error;
        MonoArray *array = NULL;
-       MonoDomain *domain = mono_domain_get (); 
-#ifdef HOST_WIN32
-       gint32 size = 0;
-
-       GetTokenInformation (token, TokenGroups, NULL, size, (PDWORD)&size);
-       if (size > 0) {
-               TOKEN_GROUPS *tg = g_malloc0 (size);
-               if (GetTokenInformation (token, TokenGroups, tg, size, (PDWORD)&size)) {
-                       int i=0;
-                       int num = tg->GroupCount;
-
-                       array = mono_array_new_checked (domain, mono_get_string_class (), num, &error);
-                       if (mono_error_set_pending_exception (&error)) {
-                               g_free (tg);
-                               return NULL;
-                       }
+       MonoDomain *domain = mono_domain_get ();
 
-                       for (i=0; i < num; i++) {
-                               gint32 size = 0;
-                               gunichar2 *uniname = GetSidName (NULL, tg->Groups [i].Sid, &size);
-
-                               if (uniname) {
-                                       MonoString *str = mono_string_new_utf16_checked (domain, uniname, size, &error);
-                                       if (!is_ok (&error)) {
-                                               g_free (uniname);
-                                               g_free (tg);
-                                               mono_error_set_pending_exception (&error);
-                                               return NULL;
-                                       }
-                                       mono_array_setref (array, i, str);
-                                       g_free (uniname);
-                               }
-                       }
-               }
-               g_free (tg);
-       }
-#else
        /* POSIX-compliant systems should use IsMemberOfGroupId or IsMemberOfGroupName */
        g_warning ("WindowsIdentity._GetRoles should never be called on POSIX");
-#endif
+
        if (!array) {
                /* return empty array of string, i.e. string [0] */
                array = mono_array_new_checked (domain, mono_get_string_class (), 0, &error);
@@ -440,39 +313,27 @@ ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
        }
        return array;
 }
-
+#endif /* !HOST_WIN32 */
 
 /* System.Security.Principal.WindowsImpersonationContext */
 
-
+#ifndef HOST_WIN32
 gboolean
 ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken (gpointer token)
 {
-       gboolean result = TRUE;
-
-#ifdef HOST_WIN32
-       result = (CloseHandle (token) != 0);
-#endif
-       return result;
+       return TRUE;
 }
+#endif /* !HOST_WIN32 */
 
-
+#ifndef HOST_WIN32
 gpointer
 ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken (gpointer token)
 {
-       gpointer dupe = NULL;
-
-#ifdef HOST_WIN32
-       if (DuplicateToken (token, SecurityImpersonation, &dupe) == 0) {
-               dupe = NULL;
-       }
-#else
-       dupe = token;
-#endif
-       return dupe;
+       return token;
 }
+#endif /* !HOST_WIN32 */
 
-
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 gboolean
 ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken (gpointer token)
 {
@@ -480,28 +341,22 @@ ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken
        return (ImpersonateLoggedOnUser (token) != 0);
 }
 
-
 gboolean
 ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf (void)
 {
        /* Posix version implemented in /mono/mono/io-layer/security.c */
        return (RevertToSelf () != 0);
 }
-
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 /* System.Security.Principal.WindowsPrincipal */
 
+#ifndef HOST_WIN32
 gboolean
 ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer user, gpointer group)
 {
        gboolean result = FALSE;
 
-#ifdef HOST_WIN32
-       /* The convertion from an ID to a string is done in managed code for Windows */
-       g_warning ("IsMemberOfGroupId should never be called on Win32");
-
-#else /* HOST_WIN32 */
-
 #ifdef HAVE_GETGRGID_R
        struct group grp;
        size_t fbufsize;
@@ -533,22 +388,13 @@ ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer
        g_free (fbuf);
 #endif
 
-#endif /* HOST_WIN32 */
-
        return result;
 }
 
-
 gboolean
 ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpointer user, MonoString *group)
 {
        gboolean result = FALSE;
-
-#ifdef HOST_WIN32
-       /* Windows version use a cache built using WindowsIdentity._GetRoles */
-       g_warning ("IsMemberOfGroupName should never be called on Win32");
-
-#else /* HOST_WIN32 */
        gchar *utf8_groupname;
 
        utf8_groupname = mono_unicode_to_external (mono_string_chars (group));
@@ -581,232 +427,15 @@ ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpoint
 #endif
                g_free (utf8_groupname);
        }
-#endif /* HOST_WIN32 */
 
        return result;
 }
-
+#endif /* !HOST_WIN32 */
 
 /* Mono.Security.Cryptography IO related internal calls */
 
-#ifdef HOST_WIN32
-
-static PSID
-GetAdministratorsSid (void) 
-{
-       SID_IDENTIFIER_AUTHORITY admins = SECURITY_NT_AUTHORITY;
-       PSID pSid = NULL;
-       if (!AllocateAndInitializeSid (&admins, 2, SECURITY_BUILTIN_DOMAIN_RID, 
-               DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSid)) 
-               return NULL;
-       /* Note: this SID must be freed with FreeSid () */
-       return pSid;
-}
-
-
-static PSID
-GetEveryoneSid (void)
-{
-       SID_IDENTIFIER_AUTHORITY everyone = SECURITY_WORLD_SID_AUTHORITY;
-       PSID pSid = NULL;
-       if (!AllocateAndInitializeSid (&everyone, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pSid))
-               return NULL;
-       /* Note: this SID must be freed with FreeSid () */
-       return pSid;
-}
-
-
-static PSID
-GetCurrentUserSid (void) 
-{
-       PSID sid = NULL;
-       guint32 size = 0;
-       gpointer token = ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken ();
-
-       GetTokenInformation (token, TokenUser, NULL, size, (PDWORD)&size);
-       if (size > 0) {
-               TOKEN_USER *tu = g_malloc0 (size);
-               if (GetTokenInformation (token, TokenUser, tu, size, (PDWORD)&size)) {
-                       DWORD length = GetLengthSid (tu->User.Sid);
-                       sid = (PSID) g_malloc0 (length);
-                       if (!CopySid (length, sid, tu->User.Sid)) {
-                               g_free (sid);
-                               sid = NULL;
-                       }
-               }
-               g_free (tu);
-       }
-       /* Note: this SID must be freed with g_free () */
-       return sid;
-}
-
-
-static ACCESS_MASK
-GetRightsFromSid (PSID sid, PACL acl) 
-{
-       ACCESS_MASK rights = 0;
-       TRUSTEE trustee;
-
-       BuildTrusteeWithSidW (&trustee, sid);
-       if (GetEffectiveRightsFromAcl (acl, &trustee, &rights) != ERROR_SUCCESS)
-               return 0;
-
-       return rights;
-}
-
-
-static gboolean 
-IsMachineProtected (gunichar2 *path)
-{
-       gboolean success = FALSE;
-       PACL pDACL = NULL;
-       PSECURITY_DESCRIPTOR pSD = NULL;
-       PSID pEveryoneSid = NULL;
-
-       DWORD dwRes = GetNamedSecurityInfoW (path, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, &pSD);
-       if (dwRes != ERROR_SUCCESS)
-               return FALSE;
-
-       /* We check that Everyone is still limited to READ-ONLY -
-       but not if new entries have been added by an Administrator */
-
-       pEveryoneSid = GetEveryoneSid ();
-       if (pEveryoneSid) {
-               ACCESS_MASK rights = GetRightsFromSid (pEveryoneSid, pDACL);
-               /* http://msdn.microsoft.com/library/en-us/security/security/generic_access_rights.asp?frame=true */
-               success = (rights == (READ_CONTROL | SYNCHRONIZE | FILE_READ_DATA | FILE_READ_EA | FILE_READ_ATTRIBUTES));
-               FreeSid (pEveryoneSid);
-       }
-       /* Note: we don't need to check our own access - 
-       we'll know soon enough when reading the file */
-
-       if (pSD)
-               LocalFree (pSD);
-
-       return success;
-}
-
-
-static gboolean 
-IsUserProtected (gunichar2 *path)
-{
-       gboolean success = FALSE;
-       PACL pDACL = NULL;
-       PSID pEveryoneSid = NULL;
-       PSECURITY_DESCRIPTOR pSecurityDescriptor = NULL;
-
-       DWORD dwRes = GetNamedSecurityInfoW (path, SE_FILE_OBJECT, 
-               DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, &pSecurityDescriptor);
-       if (dwRes != ERROR_SUCCESS)
-               return FALSE;
-
-       /* We check that our original entries in the ACL are in place -
-       but not if new entries have been added by the user */
-
-       /* Everyone should be denied */
-       pEveryoneSid = GetEveryoneSid ();
-       if (pEveryoneSid) {
-               ACCESS_MASK rights = GetRightsFromSid (pEveryoneSid, pDACL);
-               success = (rights == 0);
-               FreeSid (pEveryoneSid);
-       }
-       /* Note: we don't need to check our own access - 
-       we'll know soon enough when reading the file */
-
-       if (pSecurityDescriptor)
-               LocalFree (pSecurityDescriptor);
-
-       return success;
-}
-
-
-static gboolean 
-ProtectMachine (gunichar2 *path)
-{
-       PSID pEveryoneSid = GetEveryoneSid ();
-       PSID pAdminsSid = GetAdministratorsSid ();
-       DWORD retval = -1;
-
-       if (pEveryoneSid && pAdminsSid) {
-               PACL pDACL = NULL;
-               EXPLICIT_ACCESS ea [2];
-               ZeroMemory (&ea, 2 * sizeof (EXPLICIT_ACCESS));
-
-               /* grant all access to the BUILTIN\Administrators group */
-               BuildTrusteeWithSidW (&ea [0].Trustee, pAdminsSid);
-               ea [0].grfAccessPermissions = GENERIC_ALL;
-               ea [0].grfAccessMode = SET_ACCESS;
-               ea [0].grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
-               ea [0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
-               ea [0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
-
-               /* read-only access everyone */
-               BuildTrusteeWithSidW (&ea [1].Trustee, pEveryoneSid);
-               ea [1].grfAccessPermissions = GENERIC_READ;
-               ea [1].grfAccessMode = SET_ACCESS;
-               ea [1].grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
-               ea [1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
-               ea [1].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
-
-               retval = SetEntriesInAcl (2, ea, NULL, &pDACL);
-               if (retval == ERROR_SUCCESS) {
-                       /* with PROTECTED_DACL_SECURITY_INFORMATION we */
-                       /* remove any existing ACL (like inherited ones) */
-                       retval = SetNamedSecurityInfo (path, SE_FILE_OBJECT, 
-                               DACL_SECURITY_INFORMATION | PROTECTED_DACL_SECURITY_INFORMATION,
-                               NULL, NULL, pDACL, NULL);
-               }
-               if (pDACL)
-                       LocalFree (pDACL);
-       }
-
-       if (pEveryoneSid)
-               FreeSid (pEveryoneSid);
-       if (pAdminsSid)
-               FreeSid (pAdminsSid);
-       return (retval == ERROR_SUCCESS);
-}
-
-
-static gboolean 
-ProtectUser (gunichar2 *path)
-{
-       DWORD retval = -1;
-
-       PSID pCurrentSid = GetCurrentUserSid ();
-       if (pCurrentSid) {
-               PACL pDACL = NULL;
-               EXPLICIT_ACCESS ea;
-               ZeroMemory (&ea, sizeof (EXPLICIT_ACCESS));
-
-               /* grant exclusive access to the current user */
-               BuildTrusteeWithSidW (&ea.Trustee, pCurrentSid);
-               ea.grfAccessPermissions = GENERIC_ALL;
-               ea.grfAccessMode = SET_ACCESS;
-               ea.grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
-               ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
-               ea.Trustee.TrusteeType = TRUSTEE_IS_USER;
-
-               retval = SetEntriesInAcl (1, &ea, NULL, &pDACL);
-               if (retval == ERROR_SUCCESS) {
-                       /* with PROTECTED_DACL_SECURITY_INFORMATION we
-                          remove any existing ACL (like inherited ones) */
-                       retval = SetNamedSecurityInfo (path, SE_FILE_OBJECT, 
-                               DACL_SECURITY_INFORMATION | PROTECTED_DACL_SECURITY_INFORMATION,
-                               NULL, NULL, pDACL, NULL);
-               }
-
-               if (pDACL)
-                       LocalFree (pDACL);
-               g_free (pCurrentSid); /* g_malloc0 */
-       }
-
-       return (retval == ERROR_SUCCESS);
-}
-
-#else
-
-static gboolean 
+#ifndef HOST_WIN32
+static gboolean
 IsProtected (MonoString *path, gint32 protection) 
 {
        gboolean result = FALSE;
@@ -822,7 +451,7 @@ IsProtected (MonoString *path, gint32 protection)
 }
 
 
-static gboolean 
+static gboolean
 Protect (MonoString *path, gint32 file_mode, gint32 add_dir_mode)
 {
        gboolean result = FALSE;
@@ -840,85 +469,53 @@ Protect (MonoString *path, gint32 file_mode, gint32 add_dir_mode)
        return result;
 }
 
-#endif /* not HOST_WIN32 */
-
-
 MonoBoolean
 ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (MonoString *root)
 {
-#if HOST_WIN32
-       gint32 flags;
-
-       /* ACL are nice... unless you have FAT or other uncivilized filesystem */
-       if (!GetVolumeInformation (mono_string_chars (root), NULL, 0, NULL, NULL, (LPDWORD)&flags, NULL, 0))
-               return FALSE;
-       return ((flags & FS_PERSISTENT_ACLS) == FS_PERSISTENT_ACLS);
-#else
        /* we assume some kind of security is applicable outside Windows */
        return TRUE;
-#endif
 }
 
-
 MonoBoolean
 ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (MonoString *path)
 {
        gboolean ret = FALSE;
 
        /* no one, but the owner, should have write access to the directory */
-#ifdef HOST_WIN32
-       ret = IsMachineProtected (mono_string_chars (path));
-#else
        ret = IsProtected (path, (S_IWGRP | S_IWOTH));
-#endif
-       return ret;
+       return (MonoBoolean)ret;
 }
 
-
 MonoBoolean
 ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (MonoString *path)
 {
        gboolean ret = FALSE;
 
        /* no one, but the user, should have access to the directory */
-#ifdef HOST_WIN32
-       ret = IsUserProtected (mono_string_chars (path));
-#else
        ret = IsProtected (path, (S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH));
-#endif
-       return ret;
+       return (MonoBoolean)ret;
 }
 
-
 MonoBoolean
 ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (MonoString *path)
 {
        gboolean ret = FALSE;
 
        /* read/write to owner, read to everyone else */
-#ifdef HOST_WIN32
-       ret = ProtectMachine (mono_string_chars (path));
-#else
        ret = Protect (path, (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH), (S_IXUSR | S_IXGRP | S_IXOTH));
-#endif
-       return ret;
+       return (MonoBoolean)ret;
 }
 
-
 MonoBoolean
 ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (MonoString *path)
 {
        gboolean ret = FALSE;
        
        /* read/write to user, no access to everyone else */
-#ifdef HOST_WIN32
-       ret = ProtectUser (mono_string_chars (path));
-#else
        ret = Protect (path, (S_IRUSR | S_IWUSR), S_IXUSR);
-#endif
-       return ret;
+       return (MonoBoolean)ret;
 }
-
+#endif /* !HOST_WIN32 */
 
 /*
  * Returns TRUE if there is "something" where the Authenticode signature is 
@@ -930,7 +527,7 @@ MonoBoolean
 ves_icall_System_Security_Policy_Evidence_IsAuthenticodePresent (MonoReflectionAssembly *refass)
 {
        if (refass && refass->assembly && refass->assembly->image) {
-               return mono_image_has_authenticode_entry (refass->assembly->image);
+               return (MonoBoolean)mono_image_has_authenticode_entry (refass->assembly->image);
        }
        return FALSE;
 }
index 0f47c00fa62f299a3e11d4016c37da9c420d1222..9ea87bd844c51a3efaf775a8b159251b1271fc2f 100644 (file)
@@ -111,16 +111,6 @@ mono_object_is_alive (MonoObject* o)
        return TRUE;
 }
 
-void
-mono_gc_enable_events (void)
-{
-}
-
-void
-mono_gc_enable_alloc_events (void)
-{
-}
-
 int
 mono_gc_register_root (char *start, size_t size, void *descr, MonoGCRootSource source, const char *msg)
 {
@@ -454,11 +444,6 @@ mono_gc_get_nursery (int *shift_bits, size_t *size)
        return NULL;
 }
 
-void
-mono_gc_set_current_thread_appdomain (MonoDomain *domain)
-{
-}
-
 gboolean
 mono_gc_precise_stack_mark_enabled (void)
 {
@@ -471,6 +456,16 @@ mono_gc_get_logfile (void)
        return NULL;
 }
 
+void
+mono_gc_params_set (const char* options)
+{
+}
+
+void
+mono_gc_debug_set (const char* options)
+{
+}
+
 void
 mono_gc_conservatively_scan_area (void *start, void *end)
 {
@@ -556,8 +551,6 @@ mono_gc_is_null (void)
        return TRUE;
 }
 #else
-       #ifdef _MSC_VER
-               // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-               void __mono_win32_null_gc_quiet_lnk4221(void) {}
-       #endif
+
+MONO_EMPTY_SOURCE_FILE (null_gc);
 #endif /* HAVE_NULL_GC */
index d643b57206a9edc4194b127fd6496da2e74ec508..46269e2a377c60580f970ce2fd6974742e728755 100644 (file)
@@ -349,7 +349,8 @@ typedef enum {
 struct _MonoInternalThread {
        MonoObject  obj;
        volatile int lock_thread_id; /* to be used as the pre-shifted thread id in thin locks. Used for appdomain_ref push/pop */
-       HANDLE      handle;
+       MonoThreadHandle *handle;
+       HANDLE native_handle;
        MonoArray  *cached_culture_info;
        gunichar2  *name;
        guint32     name_len;
@@ -382,6 +383,8 @@ struct _MonoInternalThread {
        gsize abort_protected_block_count;
        gint32 priority;
        GPtrArray *owned_mutexes;
+       MonoOSEvent *suspended;
+       gint32 self_suspended; // TRUE | FALSE
        /* 
         * These fields are used to avoid having to increment corlib versions
         * when a new field is added to this structure.
@@ -1180,12 +1183,16 @@ typedef struct {
        guint32 attrs;
 } MonoReflectionGenericParam;
 
+typedef struct {
+       MonoReflectionType type;
+       MonoReflectionTypeBuilder *tb;
+} MonoReflectionEnumBuilder;
+
 typedef struct _MonoReflectionGenericClass MonoReflectionGenericClass;
 struct _MonoReflectionGenericClass {
        MonoReflectionType type;
        MonoReflectionType *generic_type; /*Can be either a MonoType or a TypeBuilder*/
        MonoArray *type_arguments;
-       guint32 initialized;
 };
 
 typedef struct {
@@ -1282,26 +1289,6 @@ typedef struct {
        MonoArray *modopts;
 } MonoReflectionSigHelper;
 
-typedef struct {
-       MonoObject object;
-       MonoReflectionGenericClass *inst;
-       MonoObject *fb; /*can be either a MonoField or a FieldBuilder*/
-} MonoReflectionFieldOnTypeBuilderInst;
-
-typedef struct {
-       MonoObject object;
-       MonoReflectionGenericClass *inst;
-       MonoObject *cb; /*can be either a MonoCMethod or ConstructorBuilder*/
-} MonoReflectionCtorOnTypeBuilderInst;
-
-typedef struct {
-       MonoObject object;
-       MonoReflectionType *inst;
-       MonoObject *mb; /*can be either a MonoMethod or MethodBuilder*/
-       MonoArray *method_args;
-       MonoReflectionMethodBuilder *generic_method_definition;
-} MonoReflectionMethodOnTypeBuilderInst;
-
 typedef struct {
        MonoObject object;
        MonoBoolean visible;
@@ -1357,12 +1344,6 @@ void          mono_dynamic_image_release_gc_roots (MonoDynamicImage *image);
 
 void        mono_reflection_setup_internal_class  (MonoReflectionTypeBuilder *tb);
 
-MonoReflectionType*
-ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb);
-
-void
-ves_icall_TypeBuilder_setup_internal_class (MonoReflectionTypeBuilder *tb);
-
 void        mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides, int *num_overrides, MonoError *error);
 
 void mono_reflection_destroy_dynamic_method (MonoReflectionDynamicMethod *mb);
@@ -1785,17 +1766,14 @@ ves_icall_AssemblyBuilder_basic_init (MonoReflectionAssemblyBuilder *assemblyb);
 MonoReflectionModule*
 ves_icall_AssemblyBuilder_InternalAddModule (MonoReflectionAssemblyBuilder *ab, MonoString *fileName);
 
-void
-ves_icall_TypeBuilder_create_generic_class (MonoReflectionTypeBuilder *tb);
-
 MonoArray*
 ves_icall_CustomAttributeBuilder_GetBlob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues);
 
 void
 ves_icall_DynamicMethod_create_dynamic_method (MonoReflectionDynamicMethod *mb);
 
-MonoBoolean
-ves_icall_TypeBuilder_get_IsGenericParameter (MonoReflectionTypeBuilder *tb);
+MonoReflectionType*
+ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb);
 
 void
 ves_icall_EnumBuilder_setup_enum_type (MonoReflectionType *enumtype,
@@ -1810,10 +1788,4 @@ ves_icall_ModuleBuilder_getUSIndex (MonoReflectionModuleBuilder *module, MonoStr
 void
 ves_icall_ModuleBuilder_set_wrappers_type (MonoReflectionModuleBuilder *moduleb, MonoReflectionType *type);
 
-void
-ves_icall_GenericTypeParameterBuilder_initialize_generic_parameter (MonoReflectionGenericParam *gparam);
-
-MonoReflectionMethod*
-ves_icall_MethodBuilder_MakeGenericMethod (MonoReflectionMethod *rmethod, MonoArray *types);
-
 #endif /* __MONO_OBJECT_INTERNALS_H__ */
index e4965a512a758da60f6db8a0512e36588a3b3bce..5c78288ec8b20f808fa2db0e74d9612e7ac817b3 100644 (file)
@@ -238,6 +238,8 @@ DECL_OFFSET(GSharedVtCallInfo, gsharedvt_in)
 #endif
 
 #if defined(TARGET_ARM64)
+DECL_OFFSET (MonoContext, has_fregs)
+
 DECL_OFFSET(GSharedVtCallInfo, stack_usage)
 DECL_OFFSET(GSharedVtCallInfo, gsharedvt_in)
 DECL_OFFSET(GSharedVtCallInfo, ret_marshal)
index 9db69581fbcc77704b0230f94bf300466255d509..07982207428e2ed46b9e00eb57eed2bd98b78296 100644 (file)
@@ -1403,17 +1403,18 @@ build_imt_slots (MonoClass *klass, MonoVTable *vt, MonoDomain *domain, gpointer*
 
                mono_class_setup_methods (iface);
                vt_slot = interface_offset;
-               for (method_slot_in_interface = 0; method_slot_in_interface < iface->method.count; method_slot_in_interface++) {
+               int mcount = mono_class_get_method_count (iface);
+               for (method_slot_in_interface = 0; method_slot_in_interface < mcount; method_slot_in_interface++) {
                        MonoMethod *method;
 
-                       if (slot_num >= 0 && iface->is_inflated) {
+                       if (slot_num >= 0 && mono_class_is_ginst (iface)) {
                                /*
                                 * The imt slot of the method is the same as for its declaring method,
                                 * see the comment in mono_method_get_imt_slot (), so we can
                                 * avoid inflating methods which will be discarded by 
                                 * add_imt_builder_entry anyway.
                                 */
-                               method = mono_class_get_method_by_index (iface->generic_class->container_class, method_slot_in_interface);
+                               method = mono_class_get_method_by_index (mono_class_get_generic_class (iface)->container_class, method_slot_in_interface);
                                if (mono_method_get_imt_slot (method) != slot_num) {
                                        vt_slot ++;
                                        continue;
@@ -1438,14 +1439,15 @@ build_imt_slots (MonoClass *klass, MonoVTable *vt, MonoDomain *domain, gpointer*
                for (list_item = extra_interfaces; list_item != NULL; list_item=list_item->next) {
                        MonoClass* iface = (MonoClass *)list_item->data;
                        int method_slot_in_interface;
-                       for (method_slot_in_interface = 0; method_slot_in_interface < iface->method.count; method_slot_in_interface++) {
+                       int mcount = mono_class_get_method_count (iface);
+                       for (method_slot_in_interface = 0; method_slot_in_interface < mcount; method_slot_in_interface++) {
                                MonoMethod *method = mono_class_get_method_by_index (iface, method_slot_in_interface);
 
                                if (method->is_generic)
                                        has_generic_virtual = TRUE;
                                add_imt_builder_entry (imt_builder, method, &imt_collisions_bitmap, interface_offset + method_slot_in_interface, slot_num);
                        }
-                       interface_offset += iface->method.count;
+                       interface_offset += mcount;
                }
        }
        for (i = 0; i < MONO_IMT_SIZE; ++i) {
@@ -1890,7 +1892,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, MonoErro
                if (mono_class_has_failure (element_class)) {
                        /*Can happen if element_class only got bad after mono_class_setup_vtable*/
                        if (!mono_class_has_failure (klass))
-                               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                               mono_class_set_type_load_failure (klass, "");
                        mono_domain_unlock (domain);
                        mono_loader_unlock ();
                        mono_error_set_for_class_failure (error, klass);
@@ -1905,7 +1907,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *klass, MonoErro
        if (!klass->vtable_size)
                mono_class_setup_vtable (klass);
 
-       if (klass->generic_class && !klass->vtable)
+       if (mono_class_is_ginst (klass) && !klass->vtable)
                mono_class_check_vtable_constraints (klass, NULL);
 
        /* Initialize klass->has_finalize */
@@ -2202,7 +2204,8 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
        MONO_REQ_GC_UNSAFE_MODE;
 
        MonoVTable *vt, *pvt;
-       int i, j, vtsize, max_interface_id, extra_interface_vtsize = 0;
+       int i, j, vtsize, extra_interface_vtsize = 0;
+       guint32 max_interface_id;
        MonoClass *k;
        GSList *extra_interfaces = NULL;
        MonoClass *klass = remote_class->proxy_class;
@@ -2290,7 +2293,7 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mono
                        pvt->vtable [i] = NULL;
        }
 
-       if (klass->flags & TYPE_ATTRIBUTE_ABSTRACT) {
+       if (mono_class_is_abstract (klass)) {
                /* create trampolines for abstract methods */
                for (k = klass; k; k = k->parent) {
                        MonoMethod* m;
@@ -2448,7 +2451,7 @@ create_remote_class_key (MonoRemoteClass *remote_class, MonoClass *extra_class)
        int i, j;
        
        if (remote_class == NULL) {
-               if (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+               if (mono_class_is_interface (extra_class)) {
                        key = (void **)g_malloc (sizeof(gpointer) * 3);
                        key [0] = GINT_TO_POINTER (2);
                        key [1] = mono_defaults.marshalbyrefobject_class;
@@ -2459,7 +2462,7 @@ create_remote_class_key (MonoRemoteClass *remote_class, MonoClass *extra_class)
                        key [1] = extra_class;
                }
        } else {
-               if (extra_class != NULL && (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE)) {
+               if (extra_class != NULL && mono_class_is_interface (extra_class)) {
                        key = (void **)g_malloc (sizeof(gpointer) * (remote_class->interface_count + 3));
                        key [0] = GINT_TO_POINTER (remote_class->interface_count + 2);
                        key [1] = remote_class->proxy_class;
@@ -2548,7 +2551,7 @@ mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_
        g_free (key);
        key = mp_key;
 
-       if (proxy_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (proxy_class)) {
                rc = (MonoRemoteClass *)mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*));
                rc->interface_count = 1;
                rc->interfaces [0] = proxy_class;
@@ -2595,7 +2598,7 @@ clone_remote_class (MonoDomain *domain, MonoRemoteClass* remote_class, MonoClass
        g_free (key);
        key = mp_key;
 
-       if (extra_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (extra_class)) {
                int i,j;
                rc = (MonoRemoteClass *)mono_domain_alloc (domain, MONO_SIZEOF_REMOTE_CLASS + sizeof(MonoClass*) * (remote_class->interface_count + 1));
                rc->proxy_class = remote_class->proxy_class;
@@ -2696,7 +2699,7 @@ mono_upgrade_remote_class (MonoDomain *domain, MonoObject *proxy_object, MonoCla
        tproxy = (MonoTransparentProxy*) proxy_object;
        remote_class = tproxy->remote_class;
        
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (klass)) {
                int i;
                redo_vtable = TRUE;
                for (i = 0; i < remote_class->interface_count && redo_vtable; i++)
@@ -2767,7 +2770,7 @@ mono_object_get_virtual_method (MonoObject *obj, MonoMethod *method)
 
        /* check method->slot is a valid index: perform isinstance? */
        if (method->slot != -1) {
-               if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+               if (mono_class_is_interface (method->klass)) {
                        if (!is_proxy) {
                                gboolean variance_used = FALSE;
                                int iface_offset = mono_class_interface_offset_with_variance (klass, method->klass, &variance_used);
@@ -3745,7 +3748,7 @@ mono_nullable_init (guint8 *buf, MonoObject *value, MonoClass *klass)
 
        MonoClass *param_class = klass->cast_class;
 
-       mono_class_setup_fields_locking (klass);
+       mono_class_setup_fields (klass);
        g_assert (klass->fields_inited);
                                
        g_assert (mono_class_from_mono_type (klass->fields [0].type) == param_class);
@@ -3779,7 +3782,7 @@ mono_nullable_box (guint8 *buf, MonoClass *klass, MonoError *error)
        mono_error_init (error);
        MonoClass *param_class = klass->cast_class;
 
-       mono_class_setup_fields_locking (klass);
+       mono_class_setup_fields (klass);
        g_assert (klass->fields_inited);
 
        g_assert (mono_class_from_mono_type (klass->fields [0].type) == param_class);
@@ -5457,7 +5460,7 @@ mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean for_box, gboolean *p
 
        *pass_size_in_words = FALSE;
 
-       if (mono_class_has_finalizer (vtable->klass) || mono_class_is_marshalbyref (vtable->klass) || (mono_profiler_get_events () & MONO_PROFILE_ALLOCATIONS))
+       if (mono_class_has_finalizer (vtable->klass) || mono_class_is_marshalbyref (vtable->klass))
                return ves_icall_object_new_specific;
 
        if (vtable->gc_descr != MONO_GC_DESCRIPTOR_NULL) {
@@ -5822,7 +5825,7 @@ mono_array_new_full_checked (MonoDomain *domain, MonoClass *array_class, uintptr
                o = (MonoObject *)mono_gc_alloc_vector (vtable, byte_len, len);
 
        if (G_UNLIKELY (!o)) {
-               mono_error_set_out_of_memory (error, "Could not allocate %i bytes", byte_len);
+               mono_error_set_out_of_memory (error, "Could not allocate %zd bytes", (gsize) byte_len);
                return NULL;
        }
 
@@ -5936,7 +5939,7 @@ mono_array_new_specific_checked (MonoVTable *vtable, uintptr_t n, MonoError *err
        o = (MonoObject *)mono_gc_alloc_vector (vtable, byte_len, n);
 
        if (G_UNLIKELY (!o)) {
-               mono_error_set_out_of_memory (error, "Could not allocate %i bytes", byte_len);
+               mono_error_set_out_of_memory (error, "Could not allocate %zd bytes", (gsize) byte_len);
                return NULL;
        }
 
@@ -6094,7 +6097,7 @@ mono_string_new_size_checked (MonoDomain *domain, gint32 len, MonoError *error)
        s = (MonoString *)mono_gc_alloc_string (vtable, size, len);
 
        if (G_UNLIKELY (!s)) {
-               mono_error_set_out_of_memory (error, "Could not allocate %i bytes", size);
+               mono_error_set_out_of_memory (error, "Could not allocate %zd bytes", size);
                return NULL;
        }
 
@@ -6487,7 +6490,7 @@ mono_object_isinst_checked (MonoObject *obj, MonoClass *klass, MonoError *error)
        if (!klass->inited)
                mono_class_init (klass);
 
-       if (mono_class_is_marshalbyref (klass) || (klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
+       if (mono_class_is_marshalbyref (klass) || mono_class_is_interface (klass)) {
                result = mono_object_isinst_mbyref_checked (obj, klass, error);
                return result;
        }
@@ -6523,7 +6526,7 @@ mono_object_isinst_mbyref_checked (MonoObject *obj, MonoClass *klass, MonoError
 
        vt = obj->vtable;
        
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (klass)) {
                if (MONO_VTABLE_IMPLEMENTS_INTERFACE (vt, klass->interface_id)) {
                        return obj;
                }
@@ -7843,7 +7846,7 @@ mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr, Mon
                ji = mono_jit_info_table_find (mono_get_root_domain (), (char *)mono_get_addr_from_ftnptr (addr));
        if (ji) {
                method = mono_jit_info_get_method (ji);
-               g_assert (!method->klass->generic_container);
+               g_assert (!mono_class_is_gtd (method->klass));
        }
 
        return mono_delegate_ctor_with_method (this_obj, target, addr, method, error);
diff --git a/mono/metadata/process.c b/mono/metadata/process.c
deleted file mode 100644 (file)
index 96814db..0000000
+++ /dev/null
@@ -1,934 +0,0 @@
-/*
- * process.c: System.Diagnostics.Process support
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * Copyright 2002 Ximian, Inc.
- * Copyright 2002-2006 Novell, Inc.
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <string.h>
-
-#include <mono/metadata/object-internals.h>
-#include <mono/metadata/process.h>
-#include <mono/metadata/assembly.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/cil-coff.h>
-#include <mono/metadata/exception.h>
-#include <mono/metadata/threadpool-ms-io.h>
-#include <mono/utils/strenc.h>
-#include <mono/utils/mono-proclib.h>
-#include <mono/io-layer/io-layer.h>
-/* FIXME: fix this code to not depend so much on the internals */
-#include <mono/metadata/class-internals.h>
-#include <mono/utils/w32handle.h>
-
-#define LOGDEBUG(...)  
-/* define LOGDEBUG(...) g_message(__VA_ARGS__)  */
-
-#ifdef _WIN32
-#include <shellapi.h>
-#endif
-
-HANDLE
-ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
-{
-       HANDLE handle;
-       
-       /* GetCurrentProcess returns a pseudo-handle, so use
-        * OpenProcess instead
-        */
-       handle = OpenProcess (PROCESS_ALL_ACCESS, TRUE, pid);
-       if (handle == NULL)
-               /* FIXME: Throw an exception */
-               return NULL;
-       return handle;
-}
-
-static MonoImage *system_assembly;
-
-static void
-stash_system_assembly (MonoObject *obj)
-{
-       if (!system_assembly)
-               system_assembly = obj->vtable->klass->image;
-}
-
-//Hand coded version that loads from system
-static MonoClass*
-mono_class_get_file_version_info_class (void)
-{
-       static MonoClass *tmp_class;
-       MonoClass *klass = tmp_class;
-       if (!klass) {
-               klass = mono_class_load_from_name (system_assembly, "System.Diagnostics", "FileVersionInfo");
-               mono_memory_barrier ();
-               tmp_class = klass;
-       }
-       return klass;
-}
-
-static MonoClass*
-mono_class_get_process_module_class (void)
-{
-       static MonoClass *tmp_class;
-       MonoClass *klass = tmp_class;
-       if (!klass) {
-               klass = mono_class_load_from_name (system_assembly, "System.Diagnostics", "ProcessModule");
-               mono_memory_barrier ();
-               tmp_class = klass;
-       }
-       return klass;
-}
-
-static guint32
-unicode_chars (const gunichar2 *str)
-{
-       guint32 len;
-
-       for (len = 0; str [len] != '\0'; ++len)
-               ;
-       return len;
-}
-
-static void
-process_set_field_object (MonoObject *obj, const gchar *fieldname,
-                                                 MonoObject *data)
-{
-       MonoClassField *field;
-
-       LOGDEBUG (g_message ("%s: Setting field %s to object at %p", __func__, fieldname, data));
-
-       field = mono_class_get_field_from_name (mono_object_class (obj),
-                                                                                       fieldname);
-       mono_gc_wbarrier_generic_store (((char *)obj) + field->offset, data);
-}
-
-static void
-process_set_field_string (MonoObject *obj, const gchar *fieldname,
-                                                 const gunichar2 *val, guint32 len, MonoError *error)
-{
-       MonoClassField *field;
-       MonoString *string;
-
-       mono_error_init (error);
-
-       LOGDEBUG (g_message ("%s: Setting field %s to [%s]", __func__, fieldname, g_utf16_to_utf8 (val, len, NULL, NULL, NULL)));
-
-       string = mono_string_new_utf16_checked (mono_object_domain (obj), val, len, error);
-       
-       field = mono_class_get_field_from_name (mono_object_class (obj),
-                                                                                       fieldname);
-       mono_gc_wbarrier_generic_store (((char *)obj) + field->offset, (MonoObject*)string);
-}
-
-static void
-process_set_field_string_char (MonoObject *obj, const gchar *fieldname,
-                                                          const gchar *val)
-{
-       MonoClassField *field;
-       MonoString *string;
-
-       LOGDEBUG (g_message ("%s: Setting field %s to [%s]", __func__, fieldname, val));
-
-       string = mono_string_new (mono_object_domain (obj), val);
-       
-       field = mono_class_get_field_from_name (mono_object_class (obj), fieldname);
-       mono_gc_wbarrier_generic_store (((char *)obj) + field->offset, (MonoObject*)string);
-}
-
-static void
-process_set_field_int (MonoObject *obj, const gchar *fieldname,
-                                          guint32 val)
-{
-       MonoClassField *field;
-
-       LOGDEBUG (g_message ("%s: Setting field %s to %d", __func__,fieldname, val));
-       
-       field = mono_class_get_field_from_name (mono_object_class (obj),
-                                             fieldname);
-       *(guint32 *)(((char *)obj) + field->offset)=val;
-}
-
-static void
-process_set_field_intptr (MonoObject *obj, const gchar *fieldname,
-                                                 gpointer val)
-{
-       MonoClassField *field;
-
-       LOGDEBUG (g_message ("%s: Setting field %s to %p", __func__, fieldname, val));
-       
-       field = mono_class_get_field_from_name (mono_object_class (obj),
-                                                                                       fieldname);
-       *(gpointer *)(((char *)obj) + field->offset) = val;
-}
-
-static void
-process_set_field_bool (MonoObject *obj, const gchar *fieldname,
-                                               gboolean val)
-{
-       MonoClassField *field;
-
-       LOGDEBUG (g_message ("%s: Setting field %s to %s", __func__, fieldname, val ? "TRUE":"FALSE"));
-       
-       field = mono_class_get_field_from_name (mono_object_class (obj),
-                                                                                       fieldname);
-       *(guint8 *)(((char *)obj) + field->offset) = val;
-}
-
-#define SFI_COMMENTS           "\\StringFileInfo\\%02X%02X%02X%02X\\Comments"
-#define SFI_COMPANYNAME                "\\StringFileInfo\\%02X%02X%02X%02X\\CompanyName"
-#define SFI_FILEDESCRIPTION    "\\StringFileInfo\\%02X%02X%02X%02X\\FileDescription"
-#define SFI_FILEVERSION                "\\StringFileInfo\\%02X%02X%02X%02X\\FileVersion"
-#define SFI_INTERNALNAME       "\\StringFileInfo\\%02X%02X%02X%02X\\InternalName"
-#define SFI_LEGALCOPYRIGHT     "\\StringFileInfo\\%02X%02X%02X%02X\\LegalCopyright"
-#define SFI_LEGALTRADEMARKS    "\\StringFileInfo\\%02X%02X%02X%02X\\LegalTrademarks"
-#define SFI_ORIGINALFILENAME   "\\StringFileInfo\\%02X%02X%02X%02X\\OriginalFilename"
-#define SFI_PRIVATEBUILD       "\\StringFileInfo\\%02X%02X%02X%02X\\PrivateBuild"
-#define SFI_PRODUCTNAME                "\\StringFileInfo\\%02X%02X%02X%02X\\ProductName"
-#define SFI_PRODUCTVERSION     "\\StringFileInfo\\%02X%02X%02X%02X\\ProductVersion"
-#define SFI_SPECIALBUILD       "\\StringFileInfo\\%02X%02X%02X%02X\\SpecialBuild"
-#define EMPTY_STRING           (gunichar2*)"\000\000"
-
-static void
-process_module_string_read (MonoObject *filever, gpointer data,
-                                                       const gchar *fieldname,
-                                                       guchar lang_hi, guchar lang_lo,
-                                                       const gchar *key, MonoError *error)
-{
-       gchar *lang_key_utf8;
-       gunichar2 *lang_key, *buffer;
-       UINT chars;
-
-       mono_error_init (error);
-
-       lang_key_utf8 = g_strdup_printf (key, lang_lo, lang_hi, 0x04, 0xb0);
-
-       LOGDEBUG (g_message ("%s: asking for [%s]", __func__, lang_key_utf8));
-
-       lang_key = g_utf8_to_utf16 (lang_key_utf8, -1, NULL, NULL, NULL);
-
-       if (VerQueryValue (data, lang_key, (gpointer *)&buffer, &chars) && chars > 0) {
-               LOGDEBUG (g_message ("%s: found %d chars of [%s]", __func__, chars, g_utf16_to_utf8 (buffer, chars, NULL, NULL, NULL)));
-               /* chars includes trailing null */
-               process_set_field_string (filever, fieldname, buffer, chars - 1, error);
-       } else {
-               process_set_field_string (filever, fieldname, EMPTY_STRING, 0, error);
-       }
-
-       g_free (lang_key);
-       g_free (lang_key_utf8);
-}
-
-typedef struct {
-       const char *name;
-       const char *id;
-} StringTableEntry;
-
-static StringTableEntry stringtable_entries [] = {
-       { "comments", SFI_COMMENTS },
-       { "companyname", SFI_COMPANYNAME },
-       { "filedescription", SFI_FILEDESCRIPTION },
-       { "fileversion", SFI_FILEVERSION },
-       { "internalname", SFI_INTERNALNAME },
-       { "legalcopyright", SFI_LEGALCOPYRIGHT },
-       { "legaltrademarks", SFI_LEGALTRADEMARKS },
-       { "originalfilename", SFI_ORIGINALFILENAME },
-       { "privatebuild", SFI_PRIVATEBUILD },
-       { "productname", SFI_PRODUCTNAME },
-       { "productversion", SFI_PRODUCTVERSION },
-       { "specialbuild", SFI_SPECIALBUILD }
-};
-
-static void
-process_module_stringtable (MonoObject *filever, gpointer data,
-                                                       guchar lang_hi, guchar lang_lo, MonoError *error)
-{
-       int i;
-
-       for (i = 0; i < G_N_ELEMENTS (stringtable_entries); ++i) {
-               process_module_string_read (filever, data, stringtable_entries [i].name, lang_hi, lang_lo,
-                                                                       stringtable_entries [i].id, error);
-               return_if_nok (error);
-       }
-}
-
-static void
-process_get_fileversion (MonoObject *filever, gunichar2 *filename, MonoError *error)
-{
-       DWORD verinfohandle;
-       VS_FIXEDFILEINFO *ffi;
-       gpointer data;
-       DWORD datalen;
-       guchar *trans_data;
-       gunichar2 *query;
-       UINT ffi_size, trans_size;
-       BOOL ok;
-       gunichar2 lang_buf[128];
-       guint32 lang, lang_count;
-
-       mono_error_init (error);
-
-       datalen = GetFileVersionInfoSize (filename, &verinfohandle);
-       if (datalen) {
-               data = g_malloc0 (datalen);
-               ok = GetFileVersionInfo (filename, verinfohandle, datalen,
-                                        data);
-               if (ok) {
-                       query = g_utf8_to_utf16 ("\\", -1, NULL, NULL, NULL);
-                       if (query == NULL) {
-                               g_free (data);
-                               return;
-                       }
-                       
-                       if (VerQueryValue (data, query, (gpointer *)&ffi,
-                           &ffi_size)) {
-                               LOGDEBUG (g_message ("%s: recording assembly: FileName [%s] FileVersionInfo [%d.%d.%d.%d]", __func__, g_utf16_to_utf8 (filename, -1, NULL, NULL, NULL), HIWORD (ffi->dwFileVersionMS), LOWORD (ffi->dwFileVersionMS), HIWORD (ffi->dwFileVersionLS), LOWORD (ffi->dwFileVersionLS)));
-       
-                               process_set_field_int (filever, "filemajorpart", HIWORD (ffi->dwFileVersionMS));
-                               process_set_field_int (filever, "fileminorpart", LOWORD (ffi->dwFileVersionMS));
-                               process_set_field_int (filever, "filebuildpart", HIWORD (ffi->dwFileVersionLS));
-                               process_set_field_int (filever, "fileprivatepart", LOWORD (ffi->dwFileVersionLS));
-
-                               process_set_field_int (filever, "productmajorpart", HIWORD (ffi->dwProductVersionMS));
-                               process_set_field_int (filever, "productminorpart", LOWORD (ffi->dwProductVersionMS));
-                               process_set_field_int (filever, "productbuildpart", HIWORD (ffi->dwProductVersionLS));
-                               process_set_field_int (filever, "productprivatepart", LOWORD (ffi->dwProductVersionLS));
-
-                               process_set_field_bool (filever, "isdebug", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_DEBUG) != 0);
-                               process_set_field_bool (filever, "isprerelease", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_PRERELEASE) != 0);
-                               process_set_field_bool (filever, "ispatched", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_PATCHED) != 0);
-                               process_set_field_bool (filever, "isprivatebuild", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_PRIVATEBUILD) != 0);
-                               process_set_field_bool (filever, "isspecialbuild", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_SPECIALBUILD) != 0);
-                       }
-                       g_free (query);
-
-                       query = g_utf8_to_utf16 ("\\VarFileInfo\\Translation", -1, NULL, NULL, NULL);
-                       if (query == NULL) {
-                               g_free (data);
-                               return;
-                       }
-                       
-                       if (VerQueryValue (data, query,
-                                          (gpointer *)&trans_data,
-                                          &trans_size)) {
-                               /* use the first language ID we see
-                                */
-                               if (trans_size >= 4) {
-                                       LOGDEBUG (g_message("%s: %s has 0x%0x 0x%0x 0x%0x 0x%0x", __func__, g_utf16_to_utf8 (filename, -1, NULL, NULL, NULL), trans_data[0], trans_data[1], trans_data[2], trans_data[3]));
-                                       lang = (trans_data[0]) |
-                                               (trans_data[1] << 8) |
-                                               (trans_data[2] << 16) |
-                                               (trans_data[3] << 24);
-                                       /* Only give the lower 16 bits
-                                        * to VerLanguageName, as
-                                        * Windows gets confused
-                                        * otherwise
-                                        */
-                                       lang_count = VerLanguageName (lang & 0xFFFF, lang_buf, 128);
-                                       if (lang_count) {
-                                               process_set_field_string (filever, "language", lang_buf, lang_count, error);
-                                               return_if_nok (error);
-                                       }
-                                       process_module_stringtable (filever, data, trans_data[0], trans_data[1], error);
-                                       return_if_nok (error);
-                               }
-                       } else {
-                               int i;
-
-                               for (i = 0; i < G_N_ELEMENTS (stringtable_entries); ++i) {
-                                       /* No strings, so set every field to
-                                        * the empty string
-                                        */
-                                       process_set_field_string (filever,
-                                                                                         stringtable_entries [i].name,
-                                                                                         EMPTY_STRING, 0, error);
-                                       return_if_nok (error);
-                               }
-
-                               /* And language seems to be set to
-                                * en_US according to bug 374600
-                                */
-                               lang_count = VerLanguageName (0x0409, lang_buf, 128);
-                               if (lang_count) {
-                                       process_set_field_string (filever, "language", lang_buf, lang_count, error);
-                                       return_if_nok (error);
-                               }
-                       }
-                       
-                       g_free (query);
-               }
-               g_free (data);
-       }
-}
-
-static void
-process_get_assembly_fileversion (MonoObject *filever, MonoAssembly *assembly)
-{
-       process_set_field_int (filever, "filemajorpart", assembly->aname.major);
-       process_set_field_int (filever, "fileminorpart", assembly->aname.minor);
-       process_set_field_int (filever, "filebuildpart", assembly->aname.build);
-}
-
-static MonoObject*
-get_process_module (MonoAssembly *assembly, MonoClass *proc_class, MonoError *error)
-{
-       MonoObject *item, *filever;
-       MonoDomain *domain = mono_domain_get ();
-       char *filename;
-       const char *modulename = assembly->aname.name;
-
-       mono_error_init (error);
-
-       /* Build a System.Diagnostics.ProcessModule with the data.
-        */
-       item = mono_object_new_checked (domain, proc_class, error);
-       return_val_if_nok (error, NULL);
-       filever = mono_object_new_checked (domain, mono_class_get_file_version_info_class (), error);
-       return_val_if_nok (error, NULL);
-
-       filename = g_strdup_printf ("[In Memory] %s", modulename);
-
-       process_get_assembly_fileversion (filever, assembly);
-       process_set_field_string_char (filever, "filename", filename);
-       process_set_field_object (item, "version_info", filever);
-
-       process_set_field_intptr (item, "baseaddr", assembly->image->raw_data);
-       process_set_field_int (item, "memory_size", assembly->image->raw_data_len);
-       process_set_field_string_char (item, "filename", filename);
-       process_set_field_string_char (item, "modulename", modulename);
-
-       g_free (filename);
-
-       return item;
-}
-
-static MonoObject*
-process_add_module (HANDLE process, HMODULE mod, gunichar2 *filename, gunichar2 *modulename, MonoClass *proc_class, MonoError *error)
-{
-       MonoObject *item, *filever;
-       MonoDomain *domain = mono_domain_get ();
-       MODULEINFO modinfo;
-       BOOL ok;
-
-       mono_error_init (error);
-
-       /* Build a System.Diagnostics.ProcessModule with the data.
-        */
-       item = mono_object_new_checked (domain, proc_class, error);
-       return_val_if_nok (error, NULL);
-       filever = mono_object_new_checked (domain, mono_class_get_file_version_info_class (), error);
-       return_val_if_nok (error, NULL);
-
-       process_get_fileversion (filever, filename, error);
-       return_val_if_nok (error, NULL);
-
-       process_set_field_string (filever, "filename", filename,
-                                                         unicode_chars (filename), error);
-       return_val_if_nok (error, NULL);
-       ok = GetModuleInformation (process, mod, &modinfo, sizeof(MODULEINFO));
-       if (ok) {
-               process_set_field_intptr (item, "baseaddr",
-                                         modinfo.lpBaseOfDll);
-               process_set_field_intptr (item, "entryaddr",
-                                         modinfo.EntryPoint);
-               process_set_field_int (item, "memory_size",
-                                      modinfo.SizeOfImage);
-       }
-       process_set_field_string (item, "filename", filename,
-                                                         unicode_chars (filename), error);
-       return_val_if_nok (error, NULL);
-       process_set_field_string (item, "modulename", modulename,
-                                                         unicode_chars (modulename), error);
-       return_val_if_nok (error, NULL);
-       process_set_field_object (item, "version_info", filever);
-
-       return item;
-}
-
-static GPtrArray*
-get_domain_assemblies (MonoDomain *domain)
-{
-       GSList *tmp;
-       GPtrArray *assemblies;
-
-       /* 
-        * Make a copy of the list of assemblies because we can't hold the assemblies
-        * lock while creating objects etc.
-        */
-       assemblies = g_ptr_array_new ();
-       mono_domain_assemblies_lock (domain);
-       for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) {
-               MonoAssembly *ass = (MonoAssembly *)tmp->data;
-               if (ass->image->fileio_used)
-                       continue;
-               g_ptr_array_add (assemblies, ass);
-       }
-       mono_domain_assemblies_unlock (domain);
-
-       return assemblies;
-}
-
-/* Returns an array of System.Diagnostics.ProcessModule */
-MonoArray *
-ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this_obj, HANDLE process)
-{
-       MonoError error;
-       MonoArray *temp_arr = NULL;
-       MonoArray *arr;
-       HMODULE mods[1024];
-       gunichar2 filename[MAX_PATH];
-       gunichar2 modname[MAX_PATH];
-       DWORD needed;
-       guint32 count = 0, module_count = 0, assembly_count = 0;
-       guint32 i, num_added = 0;
-       GPtrArray *assemblies = NULL;
-
-       stash_system_assembly (this_obj);
-
-       if (GetProcessId (process) == mono_process_current_pid ()) {
-               assemblies = get_domain_assemblies (mono_domain_get ());
-               assembly_count = assemblies->len;
-       }
-
-       if (EnumProcessModules (process, mods, sizeof(mods), &needed)) {
-               module_count += needed / sizeof(HMODULE);
-       }
-
-       count = module_count + assembly_count; 
-       temp_arr = mono_array_new_checked (mono_domain_get (), mono_class_get_process_module_class (), count, &error);
-       if (mono_error_set_pending_exception (&error))
-               return NULL;
-
-       for (i = 0; i < module_count; i++) {
-               if (GetModuleBaseName (process, mods[i], modname, MAX_PATH) &&
-                               GetModuleFileNameEx (process, mods[i], filename, MAX_PATH)) {
-                       MonoObject *module = process_add_module (process, mods[i],
-                                                                                                        filename, modname, mono_class_get_process_module_class (), &error);
-                       if (!mono_error_ok (&error)) {
-                               mono_error_set_pending_exception (&error);
-                               return NULL;
-                       }
-                       mono_array_setref (temp_arr, num_added++, module);
-               }
-       }
-
-       if (assemblies) {
-               for (i = 0; i < assembly_count; i++) {
-                       MonoAssembly *ass = (MonoAssembly *)g_ptr_array_index (assemblies, i);
-                       MonoObject *module = get_process_module (ass, mono_class_get_process_module_class (), &error);
-                       if (!mono_error_ok (&error)) {
-                               mono_error_set_pending_exception (&error);
-                               return NULL;
-                       }
-                       mono_array_setref (temp_arr, num_added++, module);
-               }
-               g_ptr_array_free (assemblies, TRUE);
-       }
-
-       if (count == num_added) {
-               arr = temp_arr;
-       } else {
-               /* shorter version of the array */
-               arr = mono_array_new_checked (mono_domain_get (), mono_class_get_process_module_class (), num_added, &error);
-               if (mono_error_set_pending_exception (&error))
-                       return NULL;
-
-               for (i = 0; i < num_added; i++)
-                       mono_array_setref (arr, i, mono_array_get (temp_arr, MonoObject*, i));
-       }
-
-       return arr;
-}
-
-void
-ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this_obj, MonoString *filename)
-{
-       MonoError error;
-
-       stash_system_assembly (this_obj);
-       
-       process_get_fileversion (this_obj, mono_string_chars (filename), &error);
-       if (!mono_error_ok (&error)) {
-               mono_error_set_pending_exception (&error);
-               return;
-       }
-       process_set_field_string (this_obj, "filename",
-                                                         mono_string_chars (filename),
-                                                         mono_string_length (filename), &error);
-       if (!mono_error_ok (&error)) {
-               mono_error_set_pending_exception (&error);
-               return;
-       }
-}
-
-/* Only used when UseShellExecute is false */
-static gchar *
-quote_path (const gchar *path)
-{
-       gchar *res = g_shell_quote (path);
-#ifdef TARGET_WIN32
-       {
-       gchar *q = res;
-       while (*q) {
-               if (*q == '\'')
-                       *q = '\"';
-               q++;
-       }
-       }
-#endif
-       return res;
-}
-
-/* Only used when UseShellExecute is false */
-static gboolean
-complete_path (const gunichar2 *appname, gchar **completed)
-{
-       gchar *utf8app, *utf8appmemory;
-       gchar *found;
-
-       utf8appmemory = utf8app = g_utf16_to_utf8 (appname, -1, NULL, NULL, NULL);
-#ifdef TARGET_WIN32 // Should this happen on all platforms? 
-       {
-               // remove the quotes around utf8app.
-               size_t len;
-               len = strlen (utf8app);
-               if (len) {
-                       if (utf8app[len-1] == '\"')
-                               utf8app[len-1] = '\0';
-                       if (utf8app[0] == '\"')
-                               utf8app++;
-               }
-       }
-#endif
-
-       if (g_path_is_absolute (utf8app)) {
-               *completed = quote_path (utf8app);
-               g_free (utf8appmemory);
-               return TRUE;
-       }
-
-       if (g_file_test (utf8app, G_FILE_TEST_IS_EXECUTABLE) && !g_file_test (utf8app, G_FILE_TEST_IS_DIR)) {
-               *completed = quote_path (utf8app);
-               g_free (utf8appmemory);
-               return TRUE;
-       }
-       
-       found = g_find_program_in_path (utf8app);
-       if (found == NULL) {
-               *completed = NULL;
-               g_free (utf8appmemory);
-               return FALSE;
-       }
-
-       *completed = quote_path (found);
-       g_free (found);
-       g_free (utf8appmemory);
-       return TRUE;
-}
-
-MonoBoolean
-ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoProcessStartInfo *proc_start_info, MonoProcInfo *process_info)
-{
-       SHELLEXECUTEINFO shellex = {0};
-       gboolean ret;
-
-       shellex.cbSize = sizeof(SHELLEXECUTEINFO);
-       shellex.fMask = (gulong)(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_UNICODE);
-       shellex.nShow = (gulong)proc_start_info->window_style;
-       shellex.nShow = (gulong)((shellex.nShow == 0) ? 1 : (shellex.nShow == 1 ? 0 : shellex.nShow));
-
-       if (proc_start_info->filename != NULL) {
-               shellex.lpFile = mono_string_chars (proc_start_info->filename);
-       }
-
-       if (proc_start_info->arguments != NULL) {
-               shellex.lpParameters = mono_string_chars (proc_start_info->arguments);
-       }
-
-       if (proc_start_info->verb != NULL &&
-           mono_string_length (proc_start_info->verb) != 0) {
-               shellex.lpVerb = mono_string_chars (proc_start_info->verb);
-       }
-
-       if (proc_start_info->working_directory != NULL &&
-           mono_string_length (proc_start_info->working_directory) != 0) {
-               shellex.lpDirectory = mono_string_chars (proc_start_info->working_directory);
-       }
-
-       if (proc_start_info->error_dialog) {    
-               shellex.hwnd = proc_start_info->error_dialog_parent_handle;
-       } else {
-               shellex.fMask = (gulong)(shellex.fMask | SEE_MASK_FLAG_NO_UI);
-       }
-
-       ret = ShellExecuteEx (&shellex);
-       if (ret == FALSE) {
-               process_info->pid = -GetLastError ();
-       } else {
-               process_info->process_handle = shellex.hProcess;
-               process_info->thread_handle = NULL;
-#if !defined(MONO_CROSS_COMPILE)
-               process_info->pid = GetProcessId (shellex.hProcess);
-#else
-               process_info->pid = 0;
-#endif
-               process_info->tid = 0;
-       }
-
-       return ret;
-}
-
-MonoBoolean
-ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoProcessStartInfo *proc_start_info, HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle, MonoProcInfo *process_info)
-{
-       MonoError error G_GNUC_UNUSED;
-       gboolean ret;
-       gunichar2 *dir;
-       STARTUPINFO startinfo={0};
-       PROCESS_INFORMATION procinfo;
-       gunichar2 *shell_path = NULL;
-       gchar *env_vars = NULL;
-       gboolean free_shell_path = TRUE;
-       gchar *spath = NULL;
-       MonoString *cmd = proc_start_info->arguments;
-       guint32 creation_flags, logon_flags;
-       
-       startinfo.cb = sizeof(STARTUPINFO);
-       startinfo.dwFlags = STARTF_USESTDHANDLES;
-       startinfo.hStdInput = stdin_handle;
-       startinfo.hStdOutput = stdout_handle;
-       startinfo.hStdError = stderr_handle;
-
-       creation_flags = CREATE_UNICODE_ENVIRONMENT;
-       if (proc_start_info->create_no_window)
-               creation_flags |= CREATE_NO_WINDOW;
-       
-       shell_path = mono_string_chars (proc_start_info->filename);
-       complete_path (shell_path, &spath);
-       if (spath == NULL) {
-               process_info->pid = -ERROR_FILE_NOT_FOUND;
-               return FALSE;
-       }
-#ifdef TARGET_WIN32
-       /* Seems like our CreateProcess does not work as the windows one.
-        * This hack is needed to deal with paths containing spaces */
-       shell_path = NULL;
-       free_shell_path = FALSE;
-       if (cmd) {
-               gchar *newcmd, *tmp;
-               tmp = mono_string_to_utf8_checked (cmd, &error);
-               if (mono_error_set_pending_exception (&error)) {
-                       g_free (spath);
-                       return NULL;
-               }
-               newcmd = g_strdup_printf ("%s %s", spath, tmp);
-               cmd = mono_string_new_wrapper (newcmd);
-               g_free (tmp);
-               g_free (newcmd);
-       }
-       else {
-               cmd = mono_string_new_wrapper (spath);
-       }
-#else
-       shell_path = g_utf8_to_utf16 (spath, -1, NULL, NULL, NULL);
-#endif
-       g_free (spath);
-
-       if (process_info->env_keys) {
-               gint i, len; 
-               MonoString *ms;
-               MonoString *key, *value;
-               gunichar2 *str, *ptr;
-               gunichar2 *equals16;
-
-               for (len = 0, i = 0; i < mono_array_length (process_info->env_keys); i++) {
-                       ms = mono_array_get (process_info->env_values, MonoString *, i);
-                       if (ms == NULL)
-                               continue;
-
-                       len += mono_string_length (ms) * sizeof (gunichar2);
-                       ms = mono_array_get (process_info->env_keys, MonoString *, i);
-                       len += mono_string_length (ms) * sizeof (gunichar2);
-                       len += 2 * sizeof (gunichar2);
-               }
-
-               equals16 = g_utf8_to_utf16 ("=", 1, NULL, NULL, NULL);
-               ptr = str = g_new0 (gunichar2, len + 1);
-               for (i = 0; i < mono_array_length (process_info->env_keys); i++) {
-                       value = mono_array_get (process_info->env_values, MonoString *, i);
-                       if (value == NULL)
-                               continue;
-
-                       key = mono_array_get (process_info->env_keys, MonoString *, i);
-                       memcpy (ptr, mono_string_chars (key), mono_string_length (key) * sizeof (gunichar2));
-                       ptr += mono_string_length (key);
-
-                       memcpy (ptr, equals16, sizeof (gunichar2));
-                       ptr++;
-
-                       memcpy (ptr, mono_string_chars (value), mono_string_length (value) * sizeof (gunichar2));
-                       ptr += mono_string_length (value);
-                       ptr++;
-               }
-
-               g_free (equals16);
-               env_vars = (gchar *) str;
-       }
-       
-       /* The default dir name is "".  Turn that into NULL to mean
-        * "current directory"
-        */
-       if (proc_start_info->working_directory == NULL || mono_string_length (proc_start_info->working_directory) == 0)
-               dir = NULL;
-       else
-               dir = mono_string_chars (proc_start_info->working_directory);
-
-       if (process_info->username) {
-               logon_flags = process_info->load_user_profile ? LOGON_WITH_PROFILE : 0;
-               ret = CreateProcessWithLogonW (
-                       mono_string_chars (process_info->username),
-                       process_info->domain ? mono_string_chars (process_info->domain) : NULL,
-                       (const gunichar2 *)process_info->password, logon_flags, shell_path,
-                       cmd ? mono_string_chars (cmd) : NULL,
-                       creation_flags, env_vars, dir, &startinfo, &procinfo);
-       } else {
-               ret = CreateProcess (shell_path, cmd ? mono_string_chars (cmd): NULL, NULL, NULL, TRUE, creation_flags, env_vars, dir, &startinfo, &procinfo);
-       }
-
-       g_free (env_vars);
-       if (free_shell_path)
-               g_free (shell_path);
-
-       if (ret) {
-               process_info->process_handle = procinfo.hProcess;
-               /*process_info->thread_handle=procinfo.hThread;*/
-               process_info->thread_handle = NULL;
-               if (procinfo.hThread != NULL && procinfo.hThread != INVALID_HANDLE_VALUE)
-                       CloseHandle (procinfo.hThread);
-               process_info->pid = procinfo.dwProcessId;
-               process_info->tid = procinfo.dwThreadId;
-       } else {
-               process_info->pid = -GetLastError ();
-       }
-       
-       return ret;
-}
-
-MonoString *
-ves_icall_System_Diagnostics_Process_ProcessName_internal (HANDLE process)
-{
-       MonoError error;
-       MonoString *string;
-       gboolean ok;
-       HMODULE mod;
-       gunichar2 name[MAX_PATH];
-       DWORD needed;
-       guint32 len;
-       
-       ok = EnumProcessModules (process, &mod, sizeof(mod), &needed);
-       if (!ok)
-               return NULL;
-       
-       len = GetModuleBaseName (process, mod, name, MAX_PATH);
-       if (len == 0)
-               return NULL;
-       
-       LOGDEBUG (g_message ("%s: process name is [%s]", __func__, g_utf16_to_utf8 (name, -1, NULL, NULL, NULL)));
-       
-       string = mono_string_new_utf16_checked (mono_domain_get (), name, len, &error);
-       if (!mono_error_ok (&error))
-               mono_error_set_pending_exception (&error);
-       
-       return string;
-}
-
-/* Returns an array of pids */
-MonoArray *
-ves_icall_System_Diagnostics_Process_GetProcesses_internal (void)
-{
-#if !defined(HOST_WIN32)
-       MonoError error;
-       MonoArray *procs;
-       gpointer *pidarray;
-       int i, count;
-
-       pidarray = mono_process_list (&count);
-       if (!pidarray) {
-               mono_set_pending_exception (mono_get_exception_not_supported ("This system does not support EnumProcesses"));
-               return NULL;
-       }
-       procs = mono_array_new_checked (mono_domain_get (), mono_get_int32_class (), count, &error);
-       if (mono_error_set_pending_exception (&error)) {
-               g_free (pidarray);
-               return NULL;
-       }
-       if (sizeof (guint32) == sizeof (gpointer)) {
-               memcpy (mono_array_addr (procs, guint32, 0), pidarray, count * sizeof (gint32));
-       } else {
-               for (i = 0; i < count; ++i)
-                       *(mono_array_addr (procs, guint32, i)) = GPOINTER_TO_UINT (pidarray [i]);
-       }
-       g_free (pidarray);
-
-       return procs;
-#else
-       MonoError error;
-       MonoArray *procs;
-       gboolean ret;
-       DWORD needed;
-       int count;
-       guint32 *pids;
-
-       count = 512;
-       do {
-               pids = g_new0 (guint32, count);
-               ret = EnumProcesses (pids, count * sizeof (guint32), &needed);
-               if (ret == FALSE) {
-                       MonoException *exc;
-
-                       g_free (pids);
-                       pids = NULL;
-                       exc = mono_get_exception_not_supported ("This system does not support EnumProcesses");
-                       mono_set_pending_exception (exc);
-                       return NULL;
-               }
-               if (needed < (count * sizeof (guint32)))
-                       break;
-               g_free (pids);
-               pids = NULL;
-               count = (count * 3) / 2;
-       } while (TRUE);
-
-       count = needed / sizeof (guint32);
-       procs = mono_array_new_checked (mono_domain_get (), mono_get_int32_class (), count, &error);
-       if (mono_error_set_pending_exception (&error)) {
-               g_free (pids);
-               return NULL;
-       }
-
-       memcpy (mono_array_addr (procs, guint32, 0), pids, needed);
-       g_free (pids);
-       pids = NULL;
-       
-       return procs;
-#endif
-}
-
-gint64
-ves_icall_System_Diagnostics_Process_GetProcessData (int pid, gint32 data_type, gint32 *error)
-{
-       MonoProcessError perror;
-       guint64 res;
-
-       res = mono_process_get_data_with_error (GINT_TO_POINTER (pid), (MonoProcessData)data_type, &perror);
-       if (error)
-               *error = perror;
-       return res;
-}
diff --git a/mono/metadata/process.h b/mono/metadata/process.h
deleted file mode 100644 (file)
index bad2095..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * process.h: System.Diagnostics.Process support
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _MONO_METADATA_PROCESS_H_
-#define _MONO_METADATA_PROCESS_H_
-
-#include <config.h>
-#include <glib.h>
-
-#include <mono/metadata/object.h>
-#include <mono/io-layer/io-layer.h>
-#include "mono/utils/mono-compiler.h"
-
-typedef struct 
-{
-       HANDLE process_handle;
-       HANDLE thread_handle;
-       guint32 pid; /* Contains GetLastError () on failure */
-       guint32 tid;
-       MonoArray *env_keys;
-       MonoArray *env_values;
-       MonoString *username;
-       MonoString *domain;
-       gpointer password; /* BSTR from SecureString in 2.0 profile */
-       MonoBoolean load_user_profile;
-} MonoProcInfo;
-
-typedef struct
-{
-       MonoObject object;
-       MonoString *filename;
-       MonoString *arguments;
-       MonoString *working_directory;
-       MonoString *verb;
-       guint32 window_style;
-       MonoBoolean error_dialog;
-       gpointer error_dialog_parent_handle;
-       MonoBoolean use_shell_execute;
-       MonoString *username;
-       MonoString *domain;
-       MonoObject *password; /* SecureString in 2.0 profile, dummy in 1.x */
-       MonoString *password_in_clear_text;
-       MonoBoolean load_user_profile;
-       MonoBoolean redirect_standard_input;
-       MonoBoolean redirect_standard_output;
-       MonoBoolean redirect_standard_error;
-       MonoObject *encoding_stdout;
-       MonoObject *encoding_stderr;
-       MonoBoolean create_no_window;
-       MonoObject *weak_parent_process;
-       MonoObject *envVars;
-} MonoProcessStartInfo;
-
-G_BEGIN_DECLS
-
-HANDLE ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid);
-MonoArray *ves_icall_System_Diagnostics_Process_GetProcesses_internal (void);
-MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this_obj, HANDLE process);
-void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this_obj, MonoString *filename);
-MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoProcessStartInfo *proc_start_info, MonoProcInfo *process_handle);
-MonoBoolean ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoProcessStartInfo *proc_start_info, HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle, MonoProcInfo *process_handle);
-MonoString *ves_icall_System_Diagnostics_Process_ProcessName_internal (HANDLE process);
-gint64 ves_icall_System_Diagnostics_Process_GetProcessData (int pid, gint32 data_type, gint32 *error);
-
-G_END_DECLS
-
-#endif /* _MONO_METADATA_PROCESS_H_ */
-
index fb4cdeca08b8632bf1f746c8ea5bda5b26a1517a..0fd162dd98a86884d77a104587973a79cd5549a0 100644 (file)
@@ -273,7 +273,6 @@ mono_profiler_install_transition (MonoProfileMethodResult callback)
 void 
 mono_profiler_install_allocation (MonoProfileAllocFunc callback)
 {
-       mono_gc_enable_alloc_events ();
        if (!prof_list)
                return;
        prof_list->allocation_cb = callback;
@@ -876,7 +875,6 @@ mono_profiler_gc_roots (int num, void **objects, int *root_types, uintptr_t *ext
 void
 mono_profiler_install_gc (MonoProfileGCFunc callback, MonoProfileGCResizeFunc heap_resize_callback)
 {
-       mono_gc_enable_events ();
        if (!prof_list)
                return;
        prof_list->gc_event = callback;
@@ -970,7 +968,7 @@ mono_profiler_install_gc_finalize (MonoProfileGCFinalizeFunc begin, MonoProfileG
 
        prof_list->gc_finalize_begin = begin;
        prof_list->gc_finalize_object_begin = begin_obj;
-       prof_list->gc_finalize_object_begin = end_obj;
+       prof_list->gc_finalize_object_end = end_obj;
        prof_list->gc_finalize_end = end;
 }
 
diff --git a/mono/metadata/property-bag.c b/mono/metadata/property-bag.c
new file mode 100644 (file)
index 0000000..28e8113
--- /dev/null
@@ -0,0 +1,49 @@
+
+/*
+ * property-bag.c: Linearizable property bag.
+ *
+ * Authors:
+ *   Rodrigo Kumpera (kumpera@gmail.com)
+ *
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#include <mono/metadata/property-bag.h>
+#include <mono/utils/atomic.h>
+#include <mono/utils/mono-membar.h>
+
+void*
+mono_property_bag_get (MonoPropertyBag *bag, int tag)
+{
+       MonoPropertyBagItem *item;
+       
+       for (item = bag->head; item && item->tag <= tag; item = item->next) {
+               if (item->tag == tag)
+                       return item;
+       }
+       return NULL;
+}
+
+void*
+mono_property_bag_add (MonoPropertyBag *bag, void *value)
+{
+       MonoPropertyBagItem *cur, **prev, *item = value;
+       int tag = item->tag;
+       mono_memory_barrier (); //publish the values in value
+
+retry:
+       prev = &bag->head;
+       while (1) {
+               cur = *prev;
+               if (!cur || cur->tag > tag) {
+                       item->next = cur;
+                       if (InterlockedCompareExchangePointer ((void*)prev, item, cur) == cur)
+                               return item;
+                       goto retry;
+               } else if (cur->tag == tag) {
+                       return cur;
+               } else {
+                       prev = &cur->next;
+               }
+       }
+       return value;
+}
diff --git a/mono/metadata/property-bag.h b/mono/metadata/property-bag.h
new file mode 100644 (file)
index 0000000..8f3f0ee
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * property-bag.h: Linearizable property bag.
+ *
+ * Authors:
+ *   Rodrigo Kumpera (kumpera@gmail.com)
+ *
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_PROPERTY_BAG_H__
+#define __MONO_METADATA_PROPERTY_BAG_H__
+
+#include <mono/utils/mono-compiler.h>
+
+typedef struct _MonoPropertyBagItem MonoPropertyBagItem;
+
+struct _MonoPropertyBagItem {
+       MonoPropertyBagItem *next;
+       int tag;
+};
+
+typedef struct {
+       MonoPropertyBagItem *head;
+} MonoPropertyBag;
+
+void* mono_property_bag_get (MonoPropertyBag *bag, int tag);
+void* mono_property_bag_add (MonoPropertyBag *bag, void *value);
+
+#endif
index 967867149caa4c79eaea873cd615b16ee230bd95..85e757fbf5dbf85904bd7c00fcb4b71347c72e5d 100644 (file)
@@ -41,13 +41,13 @@ MonoArray*
 mono_reflection_get_custom_attrs_blob_checked (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues, MonoError *error);
 
 MonoCustomAttrInfo*
-mono_custom_attrs_from_index_checked    (MonoImage *image, uint32_t idx, MonoError *error);
+mono_custom_attrs_from_index_checked    (MonoImage *image, uint32_t idx, gboolean ignore_missing, MonoError *error);
 MonoCustomAttrInfo*
 mono_custom_attrs_from_method_checked   (MonoMethod *method, MonoError *error);
 MonoCustomAttrInfo*
 mono_custom_attrs_from_class_checked           (MonoClass *klass, MonoError *error);
 MonoCustomAttrInfo*
-mono_custom_attrs_from_assembly_checked        (MonoAssembly *assembly, MonoError *error);
+mono_custom_attrs_from_assembly_checked        (MonoAssembly *assembly, gboolean ignore_missing, MonoError *error);
 MonoCustomAttrInfo*
 mono_custom_attrs_from_property_checked        (MonoClass *klass, MonoProperty *property, MonoError *error);
 MonoCustomAttrInfo*
index 0a5ea615a03f73a95bfc4822f98dd4307a265158..c0c334a0f23e3b0671c51336e7144180378d7774 100644 (file)
@@ -46,6 +46,7 @@
 #include <mono/utils/mono-string.h>
 #include <mono/utils/mono-error-internals.h>
 #include <mono/utils/checked-build.h>
+#include <mono/utils/mono-counters.h>
 
 static void get_default_param_value_blobs (MonoMethod *method, char **blobs, guint32 *types);
 static MonoType* mono_reflection_get_type_with_rootimage (MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve, MonoError *error);
@@ -53,8 +54,6 @@ static MonoType* mono_reflection_get_type_with_rootimage (MonoImage *rootimage,
 /* Class lazy loading functions */
 static GENERATE_GET_CLASS_WITH_CACHE (mono_assembly, System.Reflection, MonoAssembly)
 static GENERATE_GET_CLASS_WITH_CACHE (mono_module, System.Reflection, MonoModule)
-static GENERATE_GET_CLASS_WITH_CACHE (mono_generic_method, System.Reflection, MonoGenericMethod);
-static GENERATE_GET_CLASS_WITH_CACHE (mono_generic_cmethod, System.Reflection, MonoGenericCMethod);
 static GENERATE_GET_CLASS_WITH_CACHE (mono_method, System.Reflection, MonoMethod);
 static GENERATE_GET_CLASS_WITH_CACHE (mono_cmethod, System.Reflection, MonoCMethod);
 static GENERATE_GET_CLASS_WITH_CACHE (mono_field, System.Reflection, MonoField);
@@ -68,10 +67,17 @@ static GENERATE_GET_CLASS_WITH_CACHE (exception_handling_clause, System.Reflecti
 static GENERATE_GET_CLASS_WITH_CACHE (type_builder, System.Reflection.Emit, TypeBuilder);
 static GENERATE_GET_CLASS_WITH_CACHE (dbnull, System, DBNull);
 
+
+static int class_ref_info_handle_count;
+
 void
 mono_reflection_init (void)
 {
        mono_reflection_emit_init ();
+
+       mono_counters_register ("MonoClass::ref_info_handle count",
+                                                       MONO_COUNTER_METADATA | MONO_COUNTER_INT, &class_ref_info_handle_count);
+
 }
 
 /*
@@ -83,11 +89,12 @@ gpointer
 mono_class_get_ref_info (MonoClass *klass)
 {
        MONO_REQ_GC_UNSAFE_MODE;
+       guint32 ref_info_handle = mono_class_get_ref_info_handle (klass);
 
-       if (klass->ref_info_handle == 0)
+       if (ref_info_handle == 0)
                return NULL;
        else
-               return mono_gchandle_get_target (klass->ref_info_handle);
+               return mono_gchandle_get_target (ref_info_handle);
 }
 
 void
@@ -95,18 +102,23 @@ mono_class_set_ref_info (MonoClass *klass, gpointer obj)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       klass->ref_info_handle = mono_gchandle_new ((MonoObject*)obj, FALSE);
-       g_assert (klass->ref_info_handle != 0);
+       guint32 candidate = mono_gchandle_new ((MonoObject*)obj, FALSE);
+       guint32 handle = mono_class_set_ref_info_handle (klass, candidate);
+       ++class_ref_info_handle_count;
+
+       if (handle != candidate)
+               mono_gchandle_free (candidate);
 }
 
 void
 mono_class_free_ref_info (MonoClass *klass)
 {
        MONO_REQ_GC_NEUTRAL_MODE;
+       guint32 handle = mono_class_get_ref_info_handle (klass);
 
-       if (klass->ref_info_handle) {
-               mono_gchandle_free (klass->ref_info_handle);
-               klass->ref_info_handle = 0;
+       if (handle) {
+               mono_gchandle_free (handle);
+               mono_class_set_ref_info_handle (klass, 0);
        }
 }
 
@@ -325,36 +337,6 @@ mono_module_file_get_object_checked (MonoDomain *domain, MonoImage *image, int t
        return res;
 }
 
-static gboolean
-verify_safe_for_managed_space (MonoType *type)
-{
-       switch (type->type) {
-#ifdef DEBUG_HARDER
-       case MONO_TYPE_ARRAY:
-               return verify_safe_for_managed_space (&type->data.array->eklass->byval_arg);
-       case MONO_TYPE_PTR:
-               return verify_safe_for_managed_space (type->data.type);
-       case MONO_TYPE_SZARRAY:
-               return verify_safe_for_managed_space (&type->data.klass->byval_arg);
-       case MONO_TYPE_GENERICINST: {
-               MonoGenericInst *inst = type->data.generic_class->inst;
-               int i;
-               if (!inst->is_open)
-                       break;
-               for (i = 0; i < inst->type_argc; ++i)
-                       if (!verify_safe_for_managed_space (inst->type_argv [i]))
-                               return FALSE;
-               return TRUE;
-       }
-#endif
-       case MONO_TYPE_VAR:
-       case MONO_TYPE_MVAR:
-               return TRUE;
-       default:
-               return TRUE;
-       }
-}
-
 static MonoType*
 mono_type_normalize (MonoType *type)
 {
@@ -375,7 +357,7 @@ mono_type_normalize (MonoType *type)
                return type;
 
        gtd = gclass->container_class;
-       gcontainer = gtd->generic_container;
+       gcontainer = mono_class_get_generic_container (gtd);
        argv = g_newa (MonoType*, ginst->type_argc);
 
        for (i = 0; i < ginst->type_argc; ++i) {
@@ -483,40 +465,10 @@ mono_type_get_object_checked (MonoDomain *domain, MonoType *type, MonoError *err
        if ((type->type == MONO_TYPE_GENERICINST) && type->data.generic_class->is_dynamic && !type->data.generic_class->container_class->wastypebuilder)
                g_assert (0);
 
-       if (!verify_safe_for_managed_space (type)) {
+       if (mono_class_get_ref_info (klass) && !klass->wastypebuilder && !type->byref) {
                mono_domain_unlock (domain);
                mono_loader_unlock ();
-               mono_error_set_generic_error (error, "System", "InvalidOperationException", "This type cannot be propagated to managed space");
-               return NULL;
-       }
-
-       if (mono_class_get_ref_info (klass) && !klass->wastypebuilder) {
-               gboolean is_type_done = TRUE;
-               /* Generic parameters have reflection_info set but they are not finished together with their enclosing type.
-                * We must ensure that once a type is finished we don't return a GenericTypeParameterBuilder.
-                * We can't simply close the types as this will interfere with other parts of the generics machinery.
-               */
-               if (klass->byval_arg.type == MONO_TYPE_MVAR || klass->byval_arg.type == MONO_TYPE_VAR) {
-                       MonoGenericParam *gparam = klass->byval_arg.data.generic_param;
-
-                       if (gparam->owner && gparam->owner->is_method) {
-                               MonoMethod *method = gparam->owner->owner.method;
-                               if (method && mono_class_get_generic_type_definition (method->klass)->wastypebuilder)
-                                       is_type_done = FALSE;
-                       } else if (gparam->owner && !gparam->owner->is_method) {
-                               MonoClass *klass = gparam->owner->owner.klass;
-                               if (klass && mono_class_get_generic_type_definition (klass)->wastypebuilder)
-                                       is_type_done = FALSE;
-                       }
-               } 
-
-               /* g_assert_not_reached (); */
-               /* should this be considered an error condition? */
-               if (is_type_done && !type->byref) {
-                       mono_domain_unlock (domain);
-                       mono_loader_unlock ();
-                       return (MonoReflectionType *)mono_class_get_ref_info (klass);
-               }
+               return (MonoReflectionType *)mono_class_get_ref_info (klass);
        }
        /* This is stored in vtables/JITted code so it has to be pinned */
        res = (MonoReflectionType *)mono_object_new_pinned (domain, mono_defaults.runtimetype_class, error);
@@ -575,33 +527,6 @@ mono_method_get_object_checked (MonoDomain *domain, MonoMethod *method, MonoClas
 
        mono_error_init (error);
 
-       if (method->is_inflated) {
-               MonoReflectionGenericMethod *gret;
-
-               if (!refclass)
-                       refclass = method->klass;
-               CHECK_OBJECT (MonoReflectionMethod *, method, refclass);
-               if ((*method->name == '.') && (!strcmp (method->name, ".ctor") || !strcmp (method->name, ".cctor"))) {
-                       klass = mono_class_get_mono_generic_cmethod_class ();
-               } else {
-                       klass = mono_class_get_mono_generic_method_class ();
-               }
-               gret = (MonoReflectionGenericMethod*)mono_object_new_checked (domain, klass, error);
-               if (!mono_error_ok (error))
-                       goto leave;
-               gret->method.method = method;
-
-               MONO_OBJECT_SETREF (gret, method.name, mono_string_new (domain, method->name));
-
-               rt = mono_type_get_object_checked (domain, &refclass->byval_arg, error);
-               if (!mono_error_ok (error))
-                   goto leave;
-
-               MONO_OBJECT_SETREF (gret, method.reftype, rt);
-
-               CACHE_OBJECT (MonoReflectionMethod *, method, (MonoReflectionMethod*)gret, refclass);
-       }
-
        if (!refclass)
                refclass = method->klass;
 
@@ -2149,9 +2074,7 @@ mono_reflection_get_token_checked (MonoObject *obj, MonoError *error)
 
                token = mc->type_token;
        } else if (strcmp (klass->name, "MonoCMethod") == 0 ||
-                  strcmp (klass->name, "MonoMethod") == 0 ||
-                  strcmp (klass->name, "MonoGenericMethod") == 0 ||
-                  strcmp (klass->name, "MonoGenericCMethod") == 0) {
+                          strcmp (klass->name, "MonoMethod") == 0) {
                MonoReflectionMethod *m = (MonoReflectionMethod *)obj;
                if (m->method->is_inflated) {
                        MonoMethodInflated *inflated = (MonoMethodInflated *) m->method;
@@ -2214,7 +2137,6 @@ MonoType*
 mono_reflection_bind_generic_parameters (MonoReflectionType *type, int type_argc, MonoType **types, MonoError *error)
 {
        MonoClass *klass;
-       MonoReflectionTypeBuilder *tb = NULL;
        gboolean is_dynamic = FALSE;
        MonoClass *geninst;
 
@@ -2223,25 +2145,13 @@ mono_reflection_bind_generic_parameters (MonoReflectionType *type, int type_argc
        mono_loader_lock ();
 
        if (mono_is_sre_type_builder (mono_object_class (type))) {
-               tb = (MonoReflectionTypeBuilder *) type;
-
                is_dynamic = TRUE;
        } else if (mono_is_sre_generic_instance (mono_object_class (type))) {
                MonoReflectionGenericClass *rgi = (MonoReflectionGenericClass *) type;
                MonoReflectionType *gtd = rgi->generic_type;
 
-               if (mono_is_sre_type_builder (mono_object_class (gtd))) {
-                       tb = (MonoReflectionTypeBuilder *)gtd;
+               if (mono_is_sre_type_builder (mono_object_class (gtd)))
                        is_dynamic = TRUE;
-               }
-       }
-
-       /* FIXME: fix the CreateGenericParameters protocol to avoid the two stage setup of TypeBuilders */
-       if (tb && tb->generic_container) {
-               if (!mono_reflection_create_generic_class (tb, error)) {
-                       mono_loader_unlock ();
-                       return NULL;
-               }
        }
 
        MonoType *t = mono_reflection_type_get_handle (type, error);
@@ -2251,17 +2161,22 @@ mono_reflection_bind_generic_parameters (MonoReflectionType *type, int type_argc
        }
 
        klass = mono_class_from_mono_type (t);
-       if (!klass->generic_container) {
+       if (!mono_class_is_gtd (klass)) {
                mono_loader_unlock ();
                mono_error_set_type_load_class (error, klass, "Cannot bind generic parameters of a non-generic type");
                return NULL;
        }
 
-       if (klass->wastypebuilder) {
-               tb = (MonoReflectionTypeBuilder *) mono_class_get_ref_info (klass);
+       guint gtd_type_argc = mono_class_get_generic_container (klass)->type_argc;
+       if (gtd_type_argc != type_argc) {
+               mono_loader_unlock ();
+               mono_error_set_argument (error, "types", "The generic type definition needs %d type arguments, but was instantiated with %d ", gtd_type_argc, type_argc);
+               return NULL;
+       }
+
 
+       if (klass->wastypebuilder)
                is_dynamic = TRUE;
-       }
 
        mono_loader_unlock ();
 
@@ -2276,7 +2191,7 @@ mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **
        MonoGenericClass *gclass;
        MonoGenericInst *inst;
 
-       g_assert (klass->generic_container);
+       g_assert (mono_class_is_gtd (klass));
 
        inst = mono_metadata_get_generic_inst (type_argc, types);
        gclass = mono_metadata_lookup_generic_class (klass, inst, is_dynamic);
@@ -2297,13 +2212,9 @@ reflection_bind_generic_method_parameters (MonoReflectionMethod *rmethod, MonoAr
 
        mono_error_init (error);
 
-       /*FIXME but this no longer should happen*/
-       if (!strcmp (rmethod->object.vtable->klass->name, "MethodBuilder")) {
-               method = mono_reflection_method_builder_to_mono_method ((MonoReflectionMethodBuilder*)rmethod, error);
-               return_val_if_nok (error, NULL);
-       } else {
-               method = rmethod->method;
-       }
+       g_assert (strcmp (rmethod->object.vtable->klass->name, "MethodBuilder"));
+
+       method = rmethod->method;
 
        klass = method->klass;
 
@@ -2326,7 +2237,7 @@ reflection_bind_generic_method_parameters (MonoReflectionMethod *rmethod, MonoAr
        ginst = mono_metadata_get_generic_inst (count, type_argv);
        g_free (type_argv);
 
-       tmp_context.class_inst = klass->generic_class ? klass->generic_class->context.class_inst : NULL;
+       tmp_context.class_inst = mono_class_is_ginst (klass) ? mono_class_get_generic_class (klass)->context.class_inst : NULL;
        tmp_context.method_inst = ginst;
 
        inflated = mono_class_inflate_generic_method_checked (method, &tmp_context, error);
@@ -2350,17 +2261,7 @@ reflection_bind_generic_method_parameters (MonoReflectionMethod *rmethod, MonoAr
                return NULL;
        }
        
-       MonoReflectionMethod *ret = mono_method_get_object_checked (mono_object_domain (rmethod), inflated, NULL, error);
-       return ret;
-}
-
-MonoReflectionMethod*
-ves_icall_MethodBuilder_MakeGenericMethod (MonoReflectionMethod *rmethod, MonoArray *types)
-{
-       MonoError error;
-       MonoReflectionMethod *result = reflection_bind_generic_method_parameters (rmethod, types, &error);
-       mono_error_set_pending_exception (&error);
-       return result;
+       return mono_method_get_object_checked (mono_object_domain (rmethod), inflated, NULL, error);
 }
 
 MonoReflectionMethod*
@@ -2466,8 +2367,9 @@ mono_declsec_flags_from_method (MonoMethod *method)
 guint32
 mono_declsec_flags_from_class (MonoClass *klass)
 {
-       if (klass->flags & TYPE_ATTRIBUTE_HAS_SECURITY) {
-               if (!klass->ext || !klass->ext->declsec_flags) {
+       if (mono_class_get_flags (klass) & TYPE_ATTRIBUTE_HAS_SECURITY) {
+               MonoClassExt *ext = mono_class_get_ext (klass);
+               if (!ext || !ext->declsec_flags) {
                        guint32 idx;
 
                        idx = mono_metadata_token_index (klass->type_token);
@@ -2475,11 +2377,12 @@ mono_declsec_flags_from_class (MonoClass *klass)
                        idx |= MONO_HAS_DECL_SECURITY_TYPEDEF;
                        mono_loader_lock ();
                        mono_class_alloc_ext (klass);
+                       ext = mono_class_get_ext (klass);
                        mono_loader_unlock ();
                        /* we cache the flags on classes */
-                       klass->ext->declsec_flags = mono_declsec_get_flags (klass->image, idx);
+                       ext->declsec_flags = mono_declsec_get_flags (klass->image, idx);
                }
-               return klass->ext->declsec_flags;
+               return ext->declsec_flags;
        }
        return 0;
 }
index 7484759db58c9288cd269392cbf5a565e0880ac5..80e334ed349d31f8c6c511f0b35cf0dd2b3a53b9 100644 (file)
@@ -102,6 +102,7 @@ MONO_API MonoCustomAttrInfo* mono_custom_attrs_from_field    (MonoClass *klass,
 MONO_RT_EXTERNAL_ONLY
 MONO_API MonoCustomAttrInfo* mono_custom_attrs_from_param    (MonoMethod *method, uint32_t param);
 MONO_API mono_bool           mono_custom_attrs_has_attr      (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass);
+MONO_RT_EXTERNAL_ONLY
 MONO_API MonoObject*         mono_custom_attrs_get_attr      (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass);
 MONO_API void                mono_custom_attrs_free          (MonoCustomAttrInfo *ainfo);
 
index 30595ee5410e1a43cf886966b5e7175899ccf2ff..a29cf91a1cc2fb23cdd1dc9400203e7107d8ac36 100644 (file)
@@ -197,7 +197,10 @@ mono_remoting_marshal_init (void)
                register_icall (mono_marshal_xdomain_copy_out_value, "mono_marshal_xdomain_copy_out_value", "void object object", FALSE);
                register_icall (mono_remoting_wrapper, "mono_remoting_wrapper", "object ptr ptr", FALSE);
                register_icall (mono_upgrade_remote_class_wrapper, "mono_upgrade_remote_class_wrapper", "void object object", FALSE);
+
+#ifndef DISABLE_JIT
                register_icall (mono_compile_method_icall, "mono_compile_method_icall", "ptr ptr", FALSE);
+#endif
 
        }
 
index fbbc45dd6415a6b01ffd1966d0061acc09ba09df..f817f956297457016c5c2a7665d87b96fdd59da1 100644 (file)
@@ -165,8 +165,8 @@ set_type_load_exception_type (const char *format, MonoClass *klass)
        g_free (parent_name);
        g_free (type_name);
        
-       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
-       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, message);
+       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
+       mono_class_set_type_load_failure (klass, "%s", message);
        // note: do not free string given to mono_class_set_failure
 }
 
@@ -188,8 +188,8 @@ set_type_load_exception_methods (const char *format, MonoMethod *override, MonoM
        g_free (base_name);
        g_free (method_name);
 
-       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
-       mono_class_set_failure (override->klass, MONO_EXCEPTION_TYPE_LOAD, message);
+       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
+       mono_class_set_type_load_failure (override->klass, "%s", message);
        // note: do not free string given to mono_class_set_failure
 }
 
@@ -206,7 +206,8 @@ get_default_ctor (MonoClass *klass)
        if (!klass->methods)
                return NULL;
 
-       for (i = 0; i < klass->method.count; ++i) {
+       int mcount = mono_class_get_method_count (klass);
+       for (i = 0; i < mcount; ++i) {
                MonoMethodSignature *sig;
                MonoMethod *method = klass->methods [i];
 
@@ -561,7 +562,7 @@ get_argument_exception (const char *format, MonoMethod *caller, MonoMethod *call
        g_free (callee_name);
        g_free (caller_name);
 
-       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
+       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
        ex = mono_get_exception_argument ("method", message);
        g_free (message);
 
@@ -586,7 +587,7 @@ get_field_access_exception (const char *format, MonoMethod *caller, MonoClassFie
        g_free (field_name);
        g_free (caller_name);
 
-       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
+       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
        ex = mono_get_exception_field_access_msg (message);
        g_free (message);
 
@@ -611,7 +612,7 @@ get_method_access_exception (const char *format, MonoMethod *caller, MonoMethod
        g_free (callee_name);
        g_free (caller_name);
 
-       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
+       mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
        ex = mono_get_exception_method_access_msg (message);
        g_free (message);
 
index b6b594071296138a7fed75f03e6d122a98c82767..4f996c727d73161c972cb8a5af4fcfef55060258 100644 (file)
@@ -450,6 +450,7 @@ mono_seq_point_data_write (SeqPointData *data, char *path)
 
        fwrite (buffer_orig, 1, buffer - buffer_orig, f);
        g_free (buffer_orig);
+       fclose (f);
 
        return TRUE;
 }
index 332ed1df8f69815856f3e4af7d43b2167692664b..cb60f3b58ec2b86b58701a4fb1e194a177135c2e 100644 (file)
@@ -39,9 +39,6 @@ struct _SgenClientThreadInfo {
        gboolean skip, suspend_done;
        volatile int in_critical_region;
 
-       gpointer stopped_ip;    /* only valid if the thread is stopped */
-       MonoDomain *stopped_domain; /* dsto */
-
        /*
        This is set the argument of mono_gc_set_skip_thread.
 
@@ -84,6 +81,7 @@ extern void mono_sgen_init_stw (void);
 
 enum {
        INTERNAL_MEM_EPHEMERON_LINK = INTERNAL_MEM_FIRST_CLIENT,
+       INTERNAL_MEM_MOVED_OBJECT,
        INTERNAL_MEM_MAX
 };
 
@@ -699,11 +697,6 @@ sgen_client_binary_protocol_pin_stats (int objects_pinned_in_nursery, size_t byt
 {
 }
 
-int sgen_thread_handshake (BOOL suspend);
-gboolean sgen_suspend_thread (SgenThreadInfo *info);
-gboolean sgen_resume_thread (SgenThreadInfo *info);
-void sgen_wait_for_suspend_ack (int count);
-
 #ifdef HAVE_KW_THREAD
 extern __thread SgenThreadInfo *sgen_thread_info;
 #define TLAB_ACCESS_INIT
index 4b6a5d355ef9e4aeb19226ec6b2ff0d687195017..26e6a089b5dbb987e5d5cb6af8efc54b7c63eca1 100644 (file)
@@ -16,6 +16,7 @@
 #include "sgen/sgen-client.h"
 #include "sgen/sgen-cardtable.h"
 #include "sgen/sgen-pinning.h"
+#include "sgen/sgen-thread-pool.h"
 #include "metadata/marshal.h"
 #include "metadata/method-builder.h"
 #include "metadata/abi-details.h"
@@ -28,6 +29,7 @@
 #include "utils/mono-logger-internals.h"
 #include "utils/mono-threads-coop.h"
 #include "sgen/sgen-thread-pool.h"
+#include "utils/mono-threads.h"
 
 #ifdef HEAVY_STATISTICS
 static guint64 stat_wbarrier_set_arrayref = 0;
@@ -183,6 +185,18 @@ mono_gc_wbarrier_value_copy_bitmap (gpointer _dest, gpointer _src, int size, uns
        sgen_wbarrier_value_copy_bitmap (_dest, _src, size, bitmap);
 }
 
+int
+mono_gc_get_suspend_signal (void)
+{
+       return mono_threads_suspend_get_suspend_signal ();
+}
+
+int
+mono_gc_get_restart_signal (void)
+{
+       return mono_threads_suspend_get_restart_signal ();
+}
+
 static MonoMethod *write_barrier_conc_method;
 static MonoMethod *write_barrier_noconc_method;
 
@@ -198,6 +212,32 @@ sgen_has_critical_method (void)
        return sgen_has_managed_allocator ();
 }
 
+static gboolean
+ip_in_critical_region (MonoDomain *domain, gpointer ip)
+{
+       MonoJitInfo *ji;
+       MonoMethod *method;
+
+       /*
+        * We pass false for 'try_aot' so this becomes async safe.
+        * It won't find aot methods whose jit info is not yet loaded,
+        * so we preload their jit info in the JIT.
+        */
+       ji = mono_jit_info_table_find_internal (domain, ip, FALSE, FALSE);
+       if (!ji)
+               return FALSE;
+
+       method = mono_jit_info_get_method (ji);
+
+       return mono_runtime_is_critical_method (method) || sgen_is_critical_method (method);
+}
+
+gboolean
+mono_gc_is_critical_method (MonoMethod *method)
+{
+       return sgen_is_critical_method (method);
+}
+
 #ifndef DISABLE_JIT
 
 static void
@@ -731,18 +771,6 @@ mono_gc_ephemeron_array_add (MonoObject *obj)
  * Appdomain handling
  */
 
-void
-mono_gc_set_current_thread_appdomain (MonoDomain *domain)
-{
-       SgenThreadInfo *info = mono_thread_info_current ();
-
-       /* Could be called from sgen_thread_unregister () with a NULL info */
-       if (domain) {
-               g_assert (info);
-               info->client_info.stopped_domain = domain;
-       }
-}
-
 static gboolean
 need_remove_object_for_domain (GCObject *start, MonoDomain *domain)
 {
@@ -917,20 +945,12 @@ mono_gc_clear_domain (MonoDomain * domain)
  * Allocation
  */
 
-static gboolean alloc_events = FALSE;
-
-void
-mono_gc_enable_alloc_events (void)
-{
-       alloc_events = TRUE;
-}
-
 void*
 mono_gc_alloc_obj (MonoVTable *vtable, size_t size)
 {
        MonoObject *obj = sgen_alloc_obj (vtable, size);
 
-       if (G_UNLIKELY (alloc_events)) {
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS)) {
                if (obj)
                        mono_profiler_allocation (obj);
        }
@@ -943,7 +963,7 @@ mono_gc_alloc_pinned_obj (MonoVTable *vtable, size_t size)
 {
        MonoObject *obj = sgen_alloc_obj_pinned (vtable, size);
 
-       if (G_UNLIKELY (alloc_events)) {
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS)) {
                if (obj)
                        mono_profiler_allocation (obj);
        }
@@ -956,7 +976,7 @@ mono_gc_alloc_mature (MonoVTable *vtable, size_t size)
 {
        MonoObject *obj = sgen_alloc_obj_mature (vtable, size);
 
-       if (G_UNLIKELY (alloc_events)) {
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS)) {
                if (obj)
                        mono_profiler_allocation (obj);
        }
@@ -1753,7 +1773,7 @@ mono_gc_alloc_vector (MonoVTable *vtable, size_t size, uintptr_t max_length)
        UNLOCK_GC;
 
  done:
-       if (G_UNLIKELY (alloc_events))
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS))
                mono_profiler_allocation (&arr->obj);
 
        SGEN_ASSERT (6, SGEN_ALIGN_UP (size) == SGEN_ALIGN_UP (sgen_client_par_object_get_size (vtable, (GCObject*)arr)), "Vector has incorrect size.");
@@ -1801,7 +1821,7 @@ mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uint
        UNLOCK_GC;
 
  done:
-       if (G_UNLIKELY (alloc_events))
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS))
                mono_profiler_allocation (&arr->obj);
 
        SGEN_ASSERT (6, SGEN_ALIGN_UP (size) == SGEN_ALIGN_UP (sgen_client_par_object_get_size (vtable, (GCObject*)arr)), "Array has incorrect size.");
@@ -1842,7 +1862,7 @@ mono_gc_alloc_string (MonoVTable *vtable, size_t size, gint32 len)
        UNLOCK_GC;
 
  done:
-       if (G_UNLIKELY (alloc_events))
+       if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_ALLOCATIONS))
                mono_profiler_allocation (&str->object);
 
        return str;
@@ -2061,22 +2081,45 @@ sgen_client_collecting_major_3 (SgenPointerQueue *fin_ready_queue, SgenPointerQu
 static void *moved_objects [MOVED_OBJECTS_NUM];
 static int moved_objects_idx = 0;
 
+static SgenPointerQueue moved_objects_queue = SGEN_POINTER_QUEUE_INIT (INTERNAL_MEM_MOVED_OBJECT);
+
 void
 mono_sgen_register_moved_object (void *obj, void *destination)
 {
-       g_assert (mono_profiler_events & MONO_PROFILE_GC_MOVES);
+       /*
+        * This function can be called from SGen's worker threads. We want to try
+        * and avoid exposing those threads to the profiler API, so queue up move
+        * events and send them later when the main GC thread calls
+        * mono_sgen_gc_event_moves ().
+        *
+        * TODO: Once SGen has multiple worker threads, we need to switch to a
+        * lock-free data structure for the queue as multiple threads will be
+        * adding to it at the same time.
+        */
+       if (sgen_thread_pool_is_thread_pool_thread (mono_native_thread_id_get ())) {
+               sgen_pointer_queue_add (&moved_objects_queue, obj);
+               sgen_pointer_queue_add (&moved_objects_queue, destination);
+       } else {
+               if (moved_objects_idx == MOVED_OBJECTS_NUM) {
+                       mono_profiler_gc_moves (moved_objects, moved_objects_idx);
+                       moved_objects_idx = 0;
+               }
 
-       if (moved_objects_idx == MOVED_OBJECTS_NUM) {
-               mono_profiler_gc_moves (moved_objects, moved_objects_idx);
-               moved_objects_idx = 0;
+               moved_objects [moved_objects_idx++] = obj;
+               moved_objects [moved_objects_idx++] = destination;
        }
-       moved_objects [moved_objects_idx++] = obj;
-       moved_objects [moved_objects_idx++] = destination;
 }
 
 void
 mono_sgen_gc_event_moves (void)
 {
+       while (!sgen_pointer_queue_is_empty (&moved_objects_queue)) {
+               void *dst = sgen_pointer_queue_pop (&moved_objects_queue);
+               void *src = sgen_pointer_queue_pop (&moved_objects_queue);
+
+               mono_sgen_register_moved_object (src, dst);
+       }
+
        if (moved_objects_idx) {
                mono_profiler_gc_moves (moved_objects, moved_objects_idx);
                moved_objects_idx = 0;
@@ -2198,8 +2241,6 @@ sgen_client_thread_register (SgenThreadInfo* info, void *stack_bottom_fallback)
 #endif
 
        info->client_info.skip = 0;
-       info->client_info.stopped_ip = NULL;
-       info->client_info.stopped_domain = NULL;
 
        info->client_info.stack_start = NULL;
 
@@ -2270,12 +2311,6 @@ mono_gc_set_skip_thread (gboolean skip)
        UNLOCK_GC;
 }
 
-static gboolean
-is_critical_method (MonoMethod *method)
-{
-       return mono_runtime_is_critical_method (method) || sgen_is_critical_method (method);
-}
-
 static gboolean
 thread_in_critical_region (SgenThreadInfo *info)
 {
@@ -2512,11 +2547,6 @@ mono_gc_get_generation (MonoObject *obj)
        return 1;
 }
 
-void
-mono_gc_enable_events (void)
-{
-}
-
 const char *
 mono_gc_get_gc_name (void)
 {
@@ -2788,6 +2818,7 @@ sgen_client_description_for_internal_mem_type (int type)
 {
        switch (type) {
        case INTERNAL_MEM_EPHEMERON_LINK: return "ephemeron-link";
+       case INTERNAL_MEM_MOVED_OBJECT: return "moved-object";
        default:
                return NULL;
        }
@@ -2834,8 +2865,8 @@ sgen_client_init (void)
        cb.thread_detach = sgen_thread_detach;
        cb.thread_unregister = sgen_thread_unregister;
        cb.thread_attach = sgen_thread_attach;
-       cb.mono_method_is_critical = (gboolean (*)(void *))is_critical_method;
        cb.mono_thread_in_critical_region = thread_in_critical_region;
+       cb.ip_in_critical_region = ip_in_critical_region;
 
        mono_threads_init (&cb, sizeof (SgenThreadInfo));
 
@@ -2864,13 +2895,6 @@ sgen_client_init (void)
        }
 #endif
 
-       /*
-        * This needs to happen before any internal allocations because
-        * it inits the small id which is required for hazard pointer
-        * operations.
-        */
-       sgen_os_init ();
-
        mono_gc_register_thread (&dummy);
 }
 
@@ -3002,6 +3026,9 @@ void
 mono_gc_base_cleanup (void)
 {
        sgen_thread_pool_shutdown ();
+
+       // We should have consumed any outstanding moves.
+       g_assert (sgen_pointer_queue_is_empty (&moved_objects_queue));
 }
 
 gboolean
index 501ceb76d5b8c5a987d26b28891e01ca701cdb53..8b51ccf588a23f92ff45121dbc1499c5957b5bbc 100644 (file)
@@ -196,7 +196,7 @@ class_kind (MonoClass *klass)
 
                /* FIXME the bridge check can be quite expensive, cache it at the class level. */
                /* An array of a sealed type that is not a bridge will never get to a bridge */
-               if ((elem_class->flags & TYPE_ATTRIBUTE_SEALED) && !elem_class->has_references && !bridge_callbacks.bridge_class_kind (elem_class)) {
+               if ((mono_class_get_flags (elem_class) & TYPE_ATTRIBUTE_SEALED) && !elem_class->has_references && !bridge_callbacks.bridge_class_kind (elem_class)) {
                        SGEN_LOG (6, "class %s is opaque\n", klass->name);
                        return GC_BRIDGE_OPAQUE_CLASS;
                }
@@ -1030,7 +1030,7 @@ processing_after_callback (int generation)
                        for (j = 0; j < api_sccs [i]->num_objs; ++j) {
                                GCVTable vtable = SGEN_LOAD_VTABLE (api_sccs [i]->objs [j]);
                                mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC,
-                                       "OBJECT %s (%p) SCC [%d] %s",
+                                       "OBJECT %s.%s (%p) SCC [%d] %s",
                                                sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable), api_sccs [i]->objs [j],
                                                i,
                                                api_sccs [i]->is_alive  ? "ALIVE" : "DEAD");
diff --git a/mono/metadata/sgen-os-coop.c b/mono/metadata/sgen-os-coop.c
deleted file mode 100644 (file)
index 32bab7e..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * sgen-os-coop.c: SGen Cooperative backend support.
- *
- * Author:
- *     João Matos (joao.matos@xamarin.com)
- * Copyright (C) 2015 Xamarin Inc
- *
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include "config.h"
-
-#ifdef HAVE_SGEN_GC
-
-
-#include <glib.h>
-#include "sgen/sgen-gc.h"
-#include "sgen/sgen-archdep.h"
-#include "sgen/sgen-protocol.h"
-#include "metadata/object-internals.h"
-#include "metadata/gc-internals.h"
-
-
-#if defined(USE_COOP_GC)
-
-gboolean
-sgen_resume_thread (SgenThreadInfo *info)
-{
-       g_error ("FIXME");
-       return FALSE;
-}
-
-gboolean
-sgen_suspend_thread (SgenThreadInfo *info)
-{
-       g_error ("FIXME");
-       return FALSE;
-}
-
-void
-sgen_wait_for_suspend_ack (int count)
-{
-}
-
-/* LOCKING: assumes the GC lock is held */
-int
-sgen_thread_handshake (BOOL suspend)
-{
-       g_error ("FIXME");
-       return 0;
-}
-
-void
-sgen_os_init (void)
-{
-}
-
-int
-mono_gc_get_suspend_signal (void)
-{
-       return -1;
-}
-
-int
-mono_gc_get_restart_signal (void)
-{
-       return -1;
-}
-#else
-       #ifdef _MSC_VER
-               // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-               void __mono_win32_sgen_os_coop_quiet_lnk4221(void) {}
-       #endif
-#endif /* USE_COOP_GC */
-#endif
diff --git a/mono/metadata/sgen-os-mach.c b/mono/metadata/sgen-os-mach.c
deleted file mode 100644 (file)
index 1f87eb1..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * sgen-os-mach.c: Mach-OS support.
- *
- * Author:
- *     Paolo Molaro (lupus@ximian.com)
- *     Mark Probst (mprobst@novell.com)
- *     Geoff Norton (gnorton@novell.com)
- *
- * Copyright 2010 Novell, Inc (http://www.novell.com)
- * Copyright (C) 2012 Xamarin Inc
- *
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include "config.h"
-#ifdef HAVE_SGEN_GC
-
-
-#include <glib.h>
-#include "sgen/sgen-gc.h"
-#include "sgen/sgen-archdep.h"
-#include "sgen/sgen-protocol.h"
-#include "sgen/sgen-thread-pool.h"
-#include "metadata/object-internals.h"
-#include "metadata/gc-internals.h"
-
-#if defined(__MACH__)
-#include "utils/mach-support.h"
-#endif
-
-#if defined(__MACH__) && MONO_MACH_ARCH_SUPPORTED
-
-#if !defined(USE_COOP_GC)
-gboolean
-sgen_resume_thread (SgenThreadInfo *info)
-{
-       kern_return_t ret;
-       do {
-               ret = thread_resume (info->client_info.info.native_handle);
-       } while (ret == KERN_ABORTED);
-       return ret == KERN_SUCCESS;
-}
-
-gboolean
-sgen_suspend_thread (SgenThreadInfo *info)
-{
-       mach_msg_type_number_t num_state;
-       thread_state_t state;
-       kern_return_t ret;
-       ucontext_t ctx;
-       mcontext_t mctx;
-
-       gpointer stack_start;
-
-       state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
-       mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
-
-       do {
-               ret = thread_suspend (info->client_info.info.native_handle);
-       } while (ret == KERN_ABORTED);
-       if (ret != KERN_SUCCESS)
-               return FALSE;
-
-       do {
-               ret = mono_mach_arch_get_thread_state (info->client_info.info.native_handle, state, &num_state);
-       } while (ret == KERN_ABORTED);
-       if (ret != KERN_SUCCESS)
-               return FALSE;
-
-       mono_mach_arch_thread_state_to_mcontext (state, mctx);
-       ctx.uc_mcontext = mctx;
-
-       info->client_info.stopped_domain = mono_thread_info_tls_get (info, TLS_KEY_DOMAIN);
-       info->client_info.stopped_ip = (gpointer) mono_mach_arch_get_ip (state);
-       info->client_info.stack_start = NULL;
-       stack_start = (char*) mono_mach_arch_get_sp (state) - REDZONE_SIZE;
-       /* If stack_start is not within the limits, then don't set it in info and we will be restarted. */
-       if (stack_start >= info->client_info.stack_start_limit && stack_start <= info->client_info.stack_end) {
-               info->client_info.stack_start = stack_start;
-
-               mono_sigctx_to_monoctx (&ctx, &info->client_info.ctx);
-       } else {
-               g_assert (!info->client_info.stack_start);
-       }
-
-       /* Notify the JIT */
-       if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
-               mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, &ctx, NULL);
-
-       SGEN_LOG (2, "thread %p stopped at %p stack_start=%p", (void*)(gsize)info->client_info.info.native_handle, info->client_info.stopped_ip, info->client_info.stack_start);
-       binary_protocol_thread_suspend ((gpointer)mono_thread_info_get_tid (info), info->client_info.stopped_ip);
-
-       return TRUE;
-}
-
-void
-sgen_wait_for_suspend_ack (int count)
-{
-    /* mach thread_resume is synchronous so we dont need to wait for them */
-}
-
-/* LOCKING: assumes the GC lock is held */
-int
-sgen_thread_handshake (BOOL suspend)
-{
-       SgenThreadInfo *cur_thread = mono_thread_info_current ();
-       kern_return_t ret;
-
-       int count = 0;
-
-       cur_thread->client_info.suspend_done = TRUE;
-       FOREACH_THREAD (info) {
-               if (info == cur_thread || sgen_thread_pool_is_thread_pool_thread (mono_thread_info_get_tid (info)))
-                       continue;
-
-               info->client_info.suspend_done = FALSE;
-               if (info->client_info.gc_disabled)
-                       continue;
-
-               if (suspend) {
-                       if (!sgen_suspend_thread (info))
-                               continue;
-               } else {
-                       do {
-                               ret = thread_resume (info->client_info.info.native_handle);
-                       } while (ret == KERN_ABORTED);
-                       if (ret != KERN_SUCCESS)
-                               continue;
-               }
-               count ++;
-       } FOREACH_THREAD_END
-       return count;
-}
-
-void
-sgen_os_init (void)
-{
-}
-
-int
-mono_gc_get_suspend_signal (void)
-{
-       return -1;
-}
-
-int
-mono_gc_get_restart_signal (void)
-{
-       return -1;
-}
-#endif
-#endif
-#endif
diff --git a/mono/metadata/sgen-os-posix.c b/mono/metadata/sgen-os-posix.c
deleted file mode 100644 (file)
index 1016841..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * sgen-os-posix.c: Posix support.
- *
- * Author:
- *     Paolo Molaro (lupus@ximian.com)
- *     Mark Probst (mprobst@novell.com)
- *     Geoff Norton (gnorton@novell.com)
- *
- * Copyright 2010 Novell, Inc (http://www.novell.com)
- * Copyright (C) 2012 Xamarin Inc
- *
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include "config.h"
-
-#if defined(HAVE_SGEN_GC) && !defined(USE_COOP_GC)
-#if !defined(__MACH__) && !MONO_MACH_ARCH_SUPPORTED && defined(HAVE_PTHREAD_KILL)
-
-#include <errno.h>
-#include <glib.h>
-#include "sgen/sgen-gc.h"
-#include "metadata/gc-internals.h"
-#include "sgen/sgen-archdep.h"
-#include "metadata/object-internals.h"
-#include "utils/mono-signal-handler.h"
-
-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-const static int suspend_signal_num = SIGXFSZ;
-#else
-const static int suspend_signal_num = SIGPWR;
-#endif
-const static int restart_signal_num = SIGXCPU;
-
-static SgenSemaphore suspend_ack_semaphore;
-static SgenSemaphore *suspend_ack_semaphore_ptr;
-
-static sigset_t suspend_signal_mask;
-static sigset_t suspend_ack_signal_mask;
-
-static void
-suspend_thread (SgenThreadInfo *info, void *context)
-{
-       int stop_count;
-       MonoContext ctx;
-       gpointer stack_start;
-
-       info->client_info.stopped_domain = mono_domain_get ();
-       info->client_info.stack_start = NULL;
-       info->client_info.signal = 0;
-       stop_count = sgen_global_stop_count;
-       /* duplicate signal */
-       if (0 && info->client_info.stop_count == stop_count)
-               return;
-
-       if (context) {
-               mono_sigctx_to_monoctx (context, &ctx);
-               info->client_info.stopped_ip = MONO_CONTEXT_GET_IP (&ctx);
-               stack_start = (((guint8 *) MONO_CONTEXT_GET_SP (&ctx)) - REDZONE_SIZE);
-       } else {
-               info->client_info.stopped_ip = NULL;
-               stack_start = NULL;
-       }
-
-       /* If stack_start is not within the limits, then don't set it
-          in info and we will be restarted. */
-       if (stack_start >= info->client_info.stack_start_limit && stack_start <= info->client_info.stack_end) {
-               info->client_info.stack_start = stack_start;
-
-               if (context) {
-                       memcpy (&info->client_info.ctx, &ctx, sizeof (MonoContext));
-               } else {
-                       memset (&info->client_info.ctx, 0, sizeof (MonoContext));
-               }
-       } else {
-               g_assert (!info->client_info.stack_start);
-       }
-
-       /* Notify the JIT */
-       if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
-               mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, context, NULL);
-
-       SGEN_LOG (4, "Posting suspend_ack_semaphore for suspend from %p %p", info, (gpointer) (gsize) mono_native_thread_id_get ());
-
-       /*
-       Block the restart signal. 
-       We need to block the restart signal while posting to the suspend_ack semaphore or we race to sigsuspend,
-       which might miss the signal and get stuck.
-       */
-       pthread_sigmask (SIG_BLOCK, &suspend_ack_signal_mask, NULL);
-
-       /* notify the waiting thread */
-       SGEN_SEMAPHORE_POST (suspend_ack_semaphore_ptr);
-       info->client_info.stop_count = stop_count;
-
-       /* wait until we receive the restart signal */
-       do {
-               info->client_info.signal = 0;
-               sigsuspend (&suspend_signal_mask);
-       } while (info->client_info.signal != restart_signal_num);
-
-       /* Unblock the restart signal. */
-       pthread_sigmask (SIG_UNBLOCK, &suspend_ack_signal_mask, NULL);
-
-       SGEN_LOG (4, "Posting suspend_ack_semaphore for resume from %p %p\n", info, (gpointer) (gsize) mono_native_thread_id_get ());
-       /* notify the waiting thread */
-       SGEN_SEMAPHORE_POST (suspend_ack_semaphore_ptr);
-}
-
-/* LOCKING: assumes the GC lock is held (by the stopping thread) */
-MONO_SIG_HANDLER_FUNC (static, suspend_handler)
-{
-       /*
-        * The suspend signal handler potentially uses syscalls that
-        * can set errno, and it calls functions that use the hazard
-        * pointer machinery.  Since we're interrupting other code we
-        * must restore those to the values they had when we
-        * interrupted.
-        */
-       SgenThreadInfo *info;
-       int old_errno = errno;
-       int hp_save_index = mono_hazard_pointer_save_for_signal_handler ();
-       MONO_SIG_HANDLER_GET_CONTEXT;
-
-       info = mono_thread_info_current ();
-       suspend_thread (info, ctx);
-
-       mono_hazard_pointer_restore_for_signal_handler (hp_save_index);
-       errno = old_errno;
-}
-
-MONO_SIG_HANDLER_FUNC (static, restart_handler)
-{
-       SgenThreadInfo *info;
-       int old_errno = errno;
-
-       info = mono_thread_info_current ();
-       info->client_info.signal = restart_signal_num;
-       SGEN_LOG (4, "Restart handler in %p %p", info, (gpointer) (gsize) mono_native_thread_id_get ());
-       errno = old_errno;
-}
-
-gboolean
-sgen_resume_thread (SgenThreadInfo *info)
-{
-       return mono_threads_pthread_kill (info, restart_signal_num) == 0;
-}
-
-gboolean
-sgen_suspend_thread (SgenThreadInfo *info)
-{
-       return mono_threads_pthread_kill (info, suspend_signal_num) == 0;
-}
-
-void
-sgen_wait_for_suspend_ack (int count)
-{
-       int i, result;
-
-       for (i = 0; i < count; ++i) {
-               while ((result = SGEN_SEMAPHORE_WAIT (suspend_ack_semaphore_ptr)) != 0) {
-                       if (errno != EINTR) {
-                               g_error ("SGEN_SEMAPHORE_WAIT FAILED with %d errno %d (%s)", result, errno, strerror (errno));
-                       }
-               }
-       }
-}
-
-int
-sgen_thread_handshake (BOOL suspend)
-{
-       int count, result;
-       int signum = suspend ? suspend_signal_num : restart_signal_num;
-
-       MonoNativeThreadId me = mono_native_thread_id_get ();
-
-       count = 0;
-       mono_thread_info_current ()->client_info.suspend_done = TRUE;
-       FOREACH_THREAD (info) {
-               if (mono_native_thread_id_equals (mono_thread_info_get_tid (info), me)) {
-                       continue;
-               }
-               info->client_info.suspend_done = FALSE;
-               if (info->client_info.gc_disabled)
-                       continue;
-               /*if (signum == suspend_signal_num && info->stop_count == global_stop_count)
-                       continue;*/
-               result = mono_threads_pthread_kill (info, signum);
-               if (result == 0) {
-                       count++;
-               } else {
-                       info->client_info.skip = 1;
-               }
-       } FOREACH_THREAD_END
-
-       sgen_wait_for_suspend_ack (count);
-
-       SGEN_LOG (4, "%s handshake for %d threads\n", suspend ? "suspend" : "resume", count);
-
-       return count;
-}
-
-void
-sgen_os_init (void)
-{
-       struct sigaction sinfo;
-
-       if (mono_thread_info_unified_management_enabled ())
-               return;
-
-       suspend_ack_semaphore_ptr = &suspend_ack_semaphore;
-       SGEN_SEMAPHORE_INIT (&suspend_ack_semaphore, 0);
-
-       sigfillset (&sinfo.sa_mask);
-       sinfo.sa_flags = SA_RESTART | SA_SIGINFO;
-       sinfo.sa_sigaction = suspend_handler;
-       if (sigaction (suspend_signal_num, &sinfo, NULL) != 0) {
-               g_error ("failed sigaction");
-       }
-
-       sinfo.sa_handler = (void (*)(int))restart_handler;
-       if (sigaction (restart_signal_num, &sinfo, NULL) != 0) {
-               g_error ("failed sigaction");
-       }
-
-       sigfillset (&suspend_signal_mask);
-       sigdelset (&suspend_signal_mask, restart_signal_num);
-
-       sigemptyset (&suspend_ack_signal_mask);
-       sigaddset (&suspend_ack_signal_mask, restart_signal_num);
-       
-}
-
-int
-mono_gc_get_suspend_signal (void)
-{
-       return suspend_signal_num;
-}
-
-int
-mono_gc_get_restart_signal (void)
-{
-       return restart_signal_num;
-}
-#endif
-#endif
diff --git a/mono/metadata/sgen-os-win32.c b/mono/metadata/sgen-os-win32.c
deleted file mode 100644 (file)
index d78be35..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-#include "config.h"
-
-#if defined(HAVE_SGEN_GC) && !defined(USE_COOP_GC) && defined(HOST_WIN32)
-
-#include "io-layer/io-layer.h"
-
-#include "sgen/sgen-gc.h"
-#include "metadata/gc-internals.h"
-
-gboolean
-sgen_resume_thread (SgenThreadInfo *info)
-{
-       DWORD id = mono_thread_info_get_tid (info);
-       HANDLE handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
-       DWORD result;
-
-       g_assert (handle);
-
-       result = ResumeThread (handle);
-       g_assert (result != (DWORD)-1);
-
-       CloseHandle (handle);
-
-       return result != (DWORD)-1 && result > 0;
-}
-
-gboolean
-sgen_suspend_thread (SgenThreadInfo *info)
-{
-       DWORD id = mono_thread_info_get_tid (info);
-       HANDLE handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
-       CONTEXT context;
-       DWORD result;
-
-       g_assert (id != GetCurrentThreadId ());
-
-       g_assert (handle);
-
-       result = SuspendThread (handle);
-       if (result == (DWORD)-1) {
-               fprintf (stderr, "could not suspend thread %x (handle %p): %d\n", id, handle, GetLastError ()); fflush (stderr);
-               CloseHandle (handle);
-               return FALSE;
-       }
-
-       context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL;
-
-       if (!GetThreadContext (handle, &context)) {
-               g_assert_not_reached ();
-               ResumeThread (handle);
-               CloseHandle (handle);
-               return FALSE;
-       }
-
-       g_assert (context.ContextFlags & CONTEXT_INTEGER);
-       g_assert (context.ContextFlags & CONTEXT_CONTROL);
-
-       CloseHandle (handle);
-
-#if !defined(MONO_CROSS_COMPILE)
-       memset (&info->client_info.ctx, 0, sizeof (MonoContext));
-#ifdef TARGET_AMD64
-    info->client_info.ctx.gregs[AMD64_RIP] = context.Rip;
-    info->client_info.ctx.gregs[AMD64_RAX] = context.Rax;
-    info->client_info.ctx.gregs[AMD64_RCX] = context.Rcx;
-    info->client_info.ctx.gregs[AMD64_RDX] = context.Rdx;
-    info->client_info.ctx.gregs[AMD64_RBX] = context.Rbx;
-    info->client_info.ctx.gregs[AMD64_RSP] = context.Rsp;
-    info->client_info.ctx.gregs[AMD64_RBP] = context.Rbp;
-    info->client_info.ctx.gregs[AMD64_RSI] = context.Rsi;
-    info->client_info.ctx.gregs[AMD64_RDI] = context.Rdi;
-    info->client_info.ctx.gregs[AMD64_R8] = context.R8;
-    info->client_info.ctx.gregs[AMD64_R9] = context.R9;
-    info->client_info.ctx.gregs[AMD64_R10] = context.R10;
-    info->client_info.ctx.gregs[AMD64_R11] = context.R11;
-    info->client_info.ctx.gregs[AMD64_R12] = context.R12;
-    info->client_info.ctx.gregs[AMD64_R13] = context.R13;
-    info->client_info.ctx.gregs[AMD64_R14] = context.R14;
-    info->client_info.ctx.gregs[AMD64_R15] = context.R15;
-    info->client_info.stopped_ip = info->client_info.ctx.gregs[AMD64_RIP];
-    info->client_info.stack_start = (char*)info->client_info.ctx.gregs[AMD64_RSP] - REDZONE_SIZE;
-#else
-       info->client_info.ctx.edi = context.Edi;
-       info->client_info.ctx.esi = context.Esi;
-       info->client_info.ctx.ebx = context.Ebx;
-       info->client_info.ctx.edx = context.Edx;
-       info->client_info.ctx.ecx = context.Ecx;
-       info->client_info.ctx.eax = context.Eax;
-       info->client_info.ctx.ebp = context.Ebp;
-       info->client_info.ctx.esp = context.Esp;
-       info->client_info.stopped_ip = (gpointer)context.Eip;
-       info->client_info.stack_start = (char*)context.Esp - REDZONE_SIZE;
-#endif
-#endif
-
-       /* Notify the JIT */
-       if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
-               mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, NULL, NULL);
-
-       return TRUE;
-}
-
-void
-sgen_wait_for_suspend_ack (int count)
-{
-       /* Win32 suspend/resume is synchronous, so we don't need to wait for anything */
-}
-
-int
-sgen_thread_handshake (BOOL suspend)
-{
-       SgenThreadInfo *current = mono_thread_info_current ();
-       int count = 0;
-
-       current->client_info.suspend_done = TRUE;
-       FOREACH_THREAD (info) {
-               if (info == current)
-                       continue;
-               info->client_info.suspend_done = FALSE;
-               if (info->client_info.gc_disabled)
-                       continue;
-               if (suspend) {
-                       if (!sgen_suspend_thread (info))
-                               continue;
-               } else {
-                       if (!sgen_resume_thread (info))
-                               continue;
-               }
-               ++count;
-       } FOREACH_THREAD_END
-       return count;
-}
-
-void
-sgen_os_init (void)
-{
-}
-
-int
-mono_gc_get_suspend_signal (void)
-{
-       return -1;
-}
-
-#endif
index 60e5933450fba844a1888577df232f4255102127..22ff814df699bdcad3b99b174a2f25ee433e93ea 100644 (file)
@@ -25,6 +25,7 @@
 #include "metadata/sgen-bridge-internals.h"
 #include "metadata/gc-internals.h"
 #include "utils/mono-threads.h"
+#include "utils/mono-threads-debug.h"
 
 #define TV_DECLARE SGEN_TV_DECLARE
 #define TV_GETTIME SGEN_TV_GETTIME
@@ -76,106 +77,6 @@ update_current_thread_stack (void *start)
                mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, NULL, &info->client_info.ctx);
 }
 
-static gboolean
-is_ip_in_managed_allocator (MonoDomain *domain, gpointer ip)
-{
-       MonoJitInfo *ji;
-
-       if (!mono_thread_internal_current ())
-               /* Happens during thread attach */
-               return FALSE;
-
-       if (!ip || !domain)
-               return FALSE;
-       if (!sgen_has_critical_method ())
-               return FALSE;
-
-       /*
-        * mono_jit_info_table_find is not async safe since it calls into the AOT runtime to load information for
-        * missing methods (#13951). To work around this, we disable the AOT fallback. For this to work, the JIT needs
-        * to register the jit info for all GC critical methods after they are JITted/loaded.
-        */
-       ji = mono_jit_info_table_find_internal (domain, (char *)ip, FALSE, FALSE);
-       if (!ji)
-               return FALSE;
-
-       return sgen_is_critical_method (mono_jit_info_get_method (ji));
-}
-
-static int
-restart_threads_until_none_in_managed_allocator (void)
-{
-       int num_threads_died = 0;
-       int sleep_duration = -1;
-
-       for (;;) {
-               int restart_count = 0, restarted_count = 0;
-               /* restart all threads that stopped in the
-                  allocator */
-               FOREACH_THREAD (info) {
-                       gboolean result;
-                       if (info->client_info.skip || info->client_info.gc_disabled || info->client_info.suspend_done)
-                               continue;
-                       if (mono_thread_info_is_live (info) &&
-                                       (!info->client_info.stack_start || info->client_info.in_critical_region || info->client_info.info.inside_critical_region ||
-                                       is_ip_in_managed_allocator (info->client_info.stopped_domain, info->client_info.stopped_ip))) {
-                               binary_protocol_thread_restart ((gpointer)mono_thread_info_get_tid (info));
-                               SGEN_LOG (3, "thread %p resumed.", (void*) (size_t) info->client_info.info.native_handle);
-                               result = sgen_resume_thread (info);
-                               if (result) {
-                                       ++restart_count;
-                               } else {
-                                       info->client_info.skip = 1;
-                               }
-                       } else {
-                               /* we set the stopped_ip to
-                                  NULL for threads which
-                                  we're not restarting so
-                                  that we can easily identify
-                                  the others */
-                               info->client_info.stopped_ip = NULL;
-                               info->client_info.stopped_domain = NULL;
-                               info->client_info.suspend_done = TRUE;
-                       }
-               } FOREACH_THREAD_END
-               /* if no threads were restarted, we're done */
-               if (restart_count == 0)
-                       break;
-
-               /* wait for the threads to signal their restart */
-               sgen_wait_for_suspend_ack (restart_count);
-
-               if (sleep_duration < 0) {
-                       mono_thread_info_yield ();
-                       sleep_duration = 0;
-               } else {
-                       g_usleep (sleep_duration);
-                       sleep_duration += 10;
-               }
-
-               /* stop them again */
-               FOREACH_THREAD (info) {
-                       gboolean result;
-                       if (info->client_info.skip || info->client_info.stopped_ip == NULL)
-                               continue;
-                       result = sgen_suspend_thread (info);
-
-                       if (result) {
-                               ++restarted_count;
-                       } else {
-                               info->client_info.skip = 1;
-                       }
-               } FOREACH_THREAD_END
-               /* some threads might have died */
-               num_threads_died += restart_count - restarted_count;
-               /* wait for the threads to signal their suspension
-                  again */
-               sgen_wait_for_suspend_ack (restarted_count);
-       }
-
-       return num_threads_died;
-}
-
 static void
 acquire_gc_locks (void)
 {
@@ -220,15 +121,7 @@ sgen_client_stop_world (int generation)
        SGEN_LOG (3, "stopping world n %d from %p %p", sgen_global_stop_count, mono_thread_info_current (), (gpointer) (gsize) mono_native_thread_id_get ());
        TV_GETTIME (stop_world_time);
 
-       if (mono_thread_info_unified_management_enabled ()) {
-               sgen_unified_suspend_stop_world ();
-       } else {
-               int count, dead;
-               count = sgen_thread_handshake (TRUE);
-               dead = restart_threads_until_none_in_managed_allocator ();
-               if (count < dead)
-                       g_error ("More threads have died (%d) that been initialy suspended %d", dead, count);
-       }
+       sgen_unified_suspend_stop_world ();
 
        SGEN_LOG (3, "world stopped");
 
@@ -260,10 +153,7 @@ sgen_client_restart_world (int generation, gint64 *stw_time)
 
        TV_GETTIME (start_handshake);
 
-       if (mono_thread_info_unified_management_enabled ())
-               sgen_unified_suspend_restart_world ();
-       else
-               sgen_thread_handshake (FALSE);
+       sgen_unified_suspend_restart_world ();
 
        TV_GETTIME (end_sw);
        time_restart_world += TV_ELAPSED (start_handshake, end_sw);
@@ -358,30 +248,35 @@ sgen_is_thread_in_current_stw (SgenThreadInfo *info, int *reason)
 static void
 sgen_unified_suspend_stop_world (void)
 {
-       int restart_counter;
        int sleep_duration = -1;
 
        mono_threads_begin_global_suspend ();
-       THREADS_STW_DEBUG ("[GC-STW-BEGIN] *** BEGIN SUSPEND *** \n");
+       THREADS_STW_DEBUG ("[GC-STW-BEGIN][%p] *** BEGIN SUSPEND *** \n", mono_thread_info_get_tid (mono_thread_info_current ()));
 
        FOREACH_THREAD (info) {
-               int reason;
                info->client_info.skip = FALSE;
                info->client_info.suspend_done = FALSE;
-               if (sgen_is_thread_in_current_stw (info, &reason)) {
-                       info->client_info.skip = !mono_thread_info_begin_suspend (info);
-                       THREADS_STW_DEBUG ("[GC-STW-BEGIN-SUSPEND] SUSPEND thread %p skip %d\n", mono_thread_info_get_tid (info), info->client_info.skip);
-               } else {
-                       THREADS_STW_DEBUG ("[GC-STW-BEGIN-SUSPEND] IGNORE thread %p skip %d reason %d\n", mono_thread_info_get_tid (info), info->client_info.skip, reason);
+
+               int reason;
+               if (!sgen_is_thread_in_current_stw (info, &reason)) {
+                       THREADS_STW_DEBUG ("[GC-STW-BEGIN-SUSPEND] IGNORE thread %p skip %s reason %d\n", mono_thread_info_get_tid (info), info->client_info.skip ? "true" : "false", reason);
+                       continue;
                }
+
+               info->client_info.skip = !mono_thread_info_begin_suspend (info);
+
+               THREADS_STW_DEBUG ("[GC-STW-BEGIN-SUSPEND] SUSPEND thread %p skip %s\n", mono_thread_info_get_tid (info), info->client_info.skip ? "true" : "false");
        } FOREACH_THREAD_END
 
        mono_thread_info_current ()->client_info.suspend_done = TRUE;
        mono_threads_wait_pending_operations ();
 
        for (;;) {
-               restart_counter = 0;
+               gint restart_counter = 0;
+
                FOREACH_THREAD (info) {
+                       gint suspend_count;
+
                        int reason = 0;
                        if (info->client_info.suspend_done || !sgen_is_thread_in_current_stw (info, &reason)) {
                                THREADS_STW_DEBUG ("[GC-STW-RESTART] IGNORE RESUME thread %p not been processed done %d current %d reason %d\n", mono_thread_info_get_tid (info), info->client_info.suspend_done, !sgen_is_thread_in_current_stw (info, NULL), reason);
@@ -394,27 +289,28 @@ sgen_unified_suspend_stop_world (void)
                        - We haven't accepted the previous suspend as good.
                        - We haven't gave up on it for this STW (it's either bad or asked not to)
                        */
-                       if (mono_thread_info_in_critical_location (info)) {
-                               gboolean res;
-                               gint suspend_count = mono_thread_info_suspend_count (info);
-                               if (!(suspend_count == 1))
-                                       g_error ("[%p] suspend_count = %d, but should be 1", mono_thread_info_get_tid (info), suspend_count);
-                               res = mono_thread_info_begin_resume (info);
-                               THREADS_STW_DEBUG ("[GC-STW-RESTART] RESTART thread %p skip %d\n", mono_thread_info_get_tid (info), res);
-                               if (res)
-                                       ++restart_counter;
-                               else
-                                       info->client_info.skip = TRUE;
-                       } else {
-                               THREADS_STW_DEBUG ("[GC-STW-RESTART] DONE thread %p deemed fully suspended\n", mono_thread_info_get_tid (info));
-                               g_assert (!info->client_info.in_critical_region);
+                       if (!mono_thread_info_in_critical_location (info)) {
                                info->client_info.suspend_done = TRUE;
+
+                               THREADS_STW_DEBUG ("[GC-STW-RESTART] DONE thread %p deemed fully suspended\n", mono_thread_info_get_tid (info));
+                               continue;
                        }
+
+                       suspend_count = mono_thread_info_suspend_count (info);
+                       if (!(suspend_count == 1))
+                               g_error ("[%p] suspend_count = %d, but should be 1", mono_thread_info_get_tid (info), suspend_count);
+
+                       info->client_info.skip = !mono_thread_info_begin_resume (info);
+                       if (!info->client_info.skip)
+                               restart_counter += 1;
+
+                       THREADS_STW_DEBUG ("[GC-STW-RESTART] RESTART thread %p skip %s\n", mono_thread_info_get_tid (info), info->client_info.skip ? "true" : "false");
                } FOREACH_THREAD_END
 
+               mono_threads_wait_pending_operations ();
+
                if (restart_counter == 0)
                        break;
-               mono_threads_wait_pending_operations ();
 
                if (sleep_duration < 0) {
                        mono_thread_info_yield ();
@@ -431,54 +327,51 @@ sgen_unified_suspend_stop_world (void)
                                continue;
                        }
 
-                       if (mono_thread_info_is_running (info)) {
-                               gboolean res = mono_thread_info_begin_suspend (info);
-                               THREADS_STW_DEBUG ("[GC-STW-RESTART] SUSPEND thread %p skip %d\n", mono_thread_info_get_tid (info), res);
-                               if (!res)
-                                       info->client_info.skip = TRUE;
+                       if (!mono_thread_info_is_running (info)) {
+                               THREADS_STW_DEBUG ("[GC-STW-RESTART] IGNORE SUSPEND thread %p not running\n", mono_thread_info_get_tid (info));
+                               continue;
                        }
+
+                       info->client_info.skip = !mono_thread_info_begin_suspend (info);
+
+                       THREADS_STW_DEBUG ("[GC-STW-RESTART] SUSPEND thread %p skip %s\n", mono_thread_info_get_tid (info), info->client_info.skip ? "true" : "false");
                } FOREACH_THREAD_END
 
                mono_threads_wait_pending_operations ();
        }
 
        FOREACH_THREAD (info) {
+               gpointer stopped_ip;
+
                int reason = 0;
-               if (sgen_is_thread_in_current_stw (info, &reason)) {
-                       MonoThreadUnwindState *state;
-
-                       THREADS_STW_DEBUG ("[GC-STW-SUSPEND-END] thread %p is suspended\n", mono_thread_info_get_tid (info));
-                       g_assert (info->client_info.suspend_done);
-
-                       state = mono_thread_info_get_suspend_state (info);
-
-                       info->client_info.ctx = state->ctx;
-
-                       if (!state->unwind_data [MONO_UNWIND_DATA_DOMAIN] || !state->unwind_data [MONO_UNWIND_DATA_LMF]) {
-                               /* thread is starting or detaching, nothing to scan here */
-                               info->client_info.stopped_domain = NULL;
-                               info->client_info.stopped_ip = NULL;
-                               info->client_info.stack_start = NULL;
-                       } else {
-                               /* Once we remove the old suspend code, we should move sgen to directly access the state in MonoThread */
-                               info->client_info.stopped_domain = (MonoDomain*) mono_thread_info_tls_get (info, TLS_KEY_DOMAIN);
-                               info->client_info.stopped_ip = (gpointer) (MONO_CONTEXT_GET_IP (&info->client_info.ctx));
-                               info->client_info.stack_start = (gpointer) ((char*)MONO_CONTEXT_GET_SP (&info->client_info.ctx) - REDZONE_SIZE);
-
-                               /* altstack signal handler, sgen can't handle them, mono-threads should have handled this. */
-                               if (!info->client_info.stack_start
-                                        || info->client_info.stack_start < info->client_info.stack_start_limit
-                                        || info->client_info.stack_start >= info->client_info.stack_end) {
-                                       g_error ("BAD STACK: stack_start = %p, stack_start_limit = %p, stack_end = %p",
-                                               info->client_info.stack_start, info->client_info.stack_start_limit, info->client_info.stack_end);
-                               }
-                       }
+               if (!sgen_is_thread_in_current_stw (info, &reason)) {
+                       g_assert (!info->client_info.suspend_done || info == mono_thread_info_current ());
 
-                       binary_protocol_thread_suspend ((gpointer) mono_thread_info_get_tid (info), info->client_info.stopped_ip);
-               } else {
                        THREADS_STW_DEBUG ("[GC-STW-SUSPEND-END] thread %p is NOT suspended, reason %d\n", mono_thread_info_get_tid (info), reason);
-                       g_assert (!info->client_info.suspend_done || info == mono_thread_info_current ());
+                       continue;
+               }
+
+               g_assert (info->client_info.suspend_done);
+
+               info->client_info.ctx = mono_thread_info_get_suspend_state (info)->ctx;
+
+               /* Once we remove the old suspend code, we should move sgen to directly access the state in MonoThread */
+               info->client_info.stack_start = (gpointer) ((char*)MONO_CONTEXT_GET_SP (&info->client_info.ctx) - REDZONE_SIZE);
+
+               /* altstack signal handler, sgen can't handle them, mono-threads should have handled this. */
+               if (!info->client_info.stack_start
+                        || info->client_info.stack_start < info->client_info.stack_start_limit
+                        || info->client_info.stack_start >= info->client_info.stack_end) {
+                       g_error ("BAD STACK: stack_start = %p, stack_start_limit = %p, stack_end = %p",
+                               info->client_info.stack_start, info->client_info.stack_start_limit, info->client_info.stack_end);
                }
+
+               stopped_ip = (gpointer) (MONO_CONTEXT_GET_IP (&info->client_info.ctx));
+
+               binary_protocol_thread_suspend ((gpointer) mono_thread_info_get_tid (info), stopped_ip);
+
+               THREADS_STW_DEBUG ("[GC-STW-SUSPEND-END] thread %p is suspended, stopped_ip = %p, stack = %p -> %p\n",
+                       mono_thread_info_get_tid (info), stopped_ip, info->client_info.stack_start, info->client_info.stack_start ? info->client_info.stack_end : NULL);
        } FOREACH_THREAD_END
 }
 
index daa983e64ac61ce1a29d534c4f2785d872e5e3ce..fc9a73de67d011c315611e66f02b762b081236ba 100644 (file)
@@ -62,7 +62,7 @@ class_kind (MonoClass *klass)
 
                /* FIXME the bridge check can be quite expensive, cache it at the class level. */
                /* An array of a sealed type that is not a bridge will never get to a bridge */
-               if ((elem_class->flags & TYPE_ATTRIBUTE_SEALED) && !elem_class->has_references && !bridge_callbacks.bridge_class_kind (elem_class)) {
+               if ((mono_class_get_flags (elem_class) & TYPE_ATTRIBUTE_SEALED) && !elem_class->has_references && !bridge_callbacks.bridge_class_kind (elem_class)) {
                        SGEN_LOG (6, "class %s is opaque\n", klass->name);
                        return GC_BRIDGE_OPAQUE_CLASS;
                }
diff --git a/mono/metadata/socket-io-windows-internals.h b/mono/metadata/socket-io-windows-internals.h
new file mode 100644 (file)
index 0000000..b76f9cb
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+* socket-io-windows-internals.h: Windows specific socket code.
+*
+* Copyright 2016 Microsoft
+* Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#ifndef __MONO_METADATA_SOCKET_IO_WINDOWS_INTERNALS_H__
+#define __MONO_METADATA_SOCKET_IO_WINDOWS_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+#include <mono/io-layer/io-layer.h>
+
+SOCKET alertable_accept (SOCKET s, struct sockaddr *addr, int *addrlen, gboolean blocking);
+int alertable_connect (SOCKET s, const struct sockaddr *name, int namelen, gboolean blocking);
+int alertable_recv (SOCKET s, char *buf, int len, int flags, gboolean blocking);
+int alertable_recvfrom (SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen, gboolean blocking);
+int alertable_WSARecv (SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, gboolean blocking);
+int alertable_send (SOCKET s, char *buf, int len, int flags, gboolean blocking);
+int alertable_sendto (SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen, gboolean blocking);
+int alertable_WSASend (SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, DWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, gboolean blocking);
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
+BOOL alertable_TransmitFile (SOCKET hSocket, HANDLE hFile, DWORD nNumberOfBytesToWrite, DWORD nNumberOfBytesPerSend, LPOVERLAPPED lpOverlapped, LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, DWORD dwReserved, gboolean blocking);
+#endif
+
+#endif // __MONO_METADATA_SOCKET_IO_WINDOWS_INTERNALS_H__
diff --git a/mono/metadata/socket-io-windows.c b/mono/metadata/socket-io-windows.c
new file mode 100644 (file)
index 0000000..125dbeb
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+* socket-io-windows.c: Windows specific socket code.
+*
+* Copyright 2016 Microsoft
+* Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+
+#include "mono/metadata/socket-io-windows-internals.h"
+
+#define LOGDEBUG(...)  
+
+static gboolean set_blocking (SOCKET sock, gboolean block)
+{
+       u_long non_block = block ? 0 : 1;
+       return ioctlsocket (sock, FIONBIO, &non_block) != SOCKET_ERROR;
+}
+
+static DWORD get_socket_timeout (SOCKET sock, int optname)
+{
+       DWORD timeout = 0;
+       int optlen = sizeof (DWORD);
+       if (getsockopt (sock, SOL_SOCKET, optname, (char *)&timeout, &optlen) == SOCKET_ERROR) {
+               WSASetLastError (0);
+               return WSA_INFINITE;
+       }
+       if (timeout == 0)
+               timeout = WSA_INFINITE; // 0 means infinite
+       return timeout;
+}
+
+/*
+* Performs an alertable wait for the specified event (FD_ACCEPT_BIT,
+* FD_CONNECT_BIT, FD_READ_BIT, FD_WRITE_BIT) on the specified socket.
+* Returns TRUE if the event is fired without errors. Calls WSASetLastError()
+* with WSAEINTR and returns FALSE if the thread is alerted. If the event is
+* fired but with an error WSASetLastError() is called to set the error and the
+* function returns FALSE.
+*/
+static gboolean alertable_socket_wait (SOCKET sock, int event_bit)
+{
+       static char *EVENT_NAMES[] = { "FD_READ", "FD_WRITE", NULL /*FD_OOB*/, "FD_ACCEPT", "FD_CONNECT", "FD_CLOSE" };
+       gboolean success = FALSE;
+       int error = -1;
+       DWORD timeout = WSA_INFINITE;
+       if (event_bit == FD_READ_BIT || event_bit == FD_WRITE_BIT) {
+               timeout = get_socket_timeout (sock, event_bit == FD_READ_BIT ? SO_RCVTIMEO : SO_SNDTIMEO);
+       }
+       WSASetLastError (0);
+       WSAEVENT event = WSACreateEvent ();
+       if (event != WSA_INVALID_EVENT) {
+               if (WSAEventSelect (sock, event, (1 << event_bit) | FD_CLOSE) != SOCKET_ERROR) {
+                       LOGDEBUG (g_message ("%06d - Calling WSAWaitForMultipleEvents () on socket %d", GetCurrentThreadId (), sock));
+                       DWORD ret = WSAWaitForMultipleEvents (1, &event, TRUE, timeout, TRUE);
+                       if (ret == WSA_WAIT_IO_COMPLETION) {
+                               LOGDEBUG (g_message ("%06d - WSAWaitForMultipleEvents () returned WSA_WAIT_IO_COMPLETION for socket %d", GetCurrentThreadId (), sock));
+                               error = WSAEINTR;
+                       } else if (ret == WSA_WAIT_TIMEOUT) {
+                               error = WSAETIMEDOUT;
+                       } else {
+                               g_assert (ret == WSA_WAIT_EVENT_0);
+                               WSANETWORKEVENTS ne = { 0 };
+                               if (WSAEnumNetworkEvents (sock, event, &ne) != SOCKET_ERROR) {
+                                       if (ne.lNetworkEvents & (1 << event_bit) && ne.iErrorCode[event_bit]) {
+                                               LOGDEBUG (g_message ("%06d - %s error %d on socket %d", GetCurrentThreadId (), EVENT_NAMES[event_bit], ne.iErrorCode[event_bit], sock));
+                                               error = ne.iErrorCode[event_bit];
+                                       } else if (ne.lNetworkEvents & FD_CLOSE_BIT && ne.iErrorCode[FD_CLOSE_BIT]) {
+                                               LOGDEBUG (g_message ("%06d - FD_CLOSE error %d on socket %d", GetCurrentThreadId (), ne.iErrorCode[FD_CLOSE_BIT], sock));
+                                               error = ne.iErrorCode[FD_CLOSE_BIT];
+                                       } else {
+                                               LOGDEBUG (g_message ("%06d - WSAEnumNetworkEvents () finished successfully on socket %d", GetCurrentThreadId (), sock));
+                                               success = TRUE;
+                                               error = 0;
+                                       }
+                               }
+                       }
+                       WSAEventSelect (sock, NULL, 0);
+               }
+               WSACloseEvent (event);
+       }
+       if (error != -1) {
+               WSASetLastError (error);
+       }
+       return success;
+}
+
+#define ALERTABLE_SOCKET_CALL(event_bit, blocking, repeat, ret, op, sock, ...) \
+       LOGDEBUG (g_message ("%06d - Performing %s " #op " () on socket %d", GetCurrentThreadId (), blocking ? "blocking" : "non-blocking", sock)); \
+       if (blocking) { \
+               if (set_blocking(sock, FALSE)) { \
+                       while (-1 == (int) (ret = op (sock, __VA_ARGS__))) { \
+                               int _error = WSAGetLastError ();\
+                               if (_error != WSAEWOULDBLOCK && _error != WSA_IO_PENDING) \
+                                       break; \
+                               if (!alertable_socket_wait (sock, event_bit) || !repeat) \
+                                       break; \
+                       } \
+                       int _saved_error = WSAGetLastError (); \
+                       set_blocking (sock, TRUE); \
+                       WSASetLastError (_saved_error); \
+               } \
+       } else { \
+               ret = op (sock, __VA_ARGS__); \
+       } \
+       int _saved_error = WSAGetLastError (); \
+       LOGDEBUG (g_message ("%06d - Finished %s " #op " () on socket %d (ret = %d, WSAGetLastError() = %d)", GetCurrentThreadId (), \
+               blocking ? "blocking" : "non-blocking", sock, ret, _saved_error)); \
+       WSASetLastError (_saved_error);
+
+SOCKET alertable_accept (SOCKET s, struct sockaddr *addr, int *addrlen, gboolean blocking)
+{
+       SOCKET newsock = INVALID_SOCKET;
+       ALERTABLE_SOCKET_CALL (FD_ACCEPT_BIT, blocking, TRUE, newsock, accept, s, addr, addrlen);
+       return newsock;
+}
+
+int alertable_connect (SOCKET s, const struct sockaddr *name, int namelen, gboolean blocking)
+{
+       int ret = SOCKET_ERROR;
+       ALERTABLE_SOCKET_CALL (FD_CONNECT_BIT, blocking, FALSE, ret, connect, s, name, namelen);
+       ret = WSAGetLastError () != 0 ? SOCKET_ERROR : 0;
+       return ret;
+}
+
+int alertable_recv (SOCKET s, char *buf, int len, int flags, gboolean blocking)
+{
+       int ret = SOCKET_ERROR;
+       ALERTABLE_SOCKET_CALL (FD_READ_BIT, blocking, TRUE, ret, recv, s, buf, len, flags);
+       return ret;
+}
+
+int alertable_recvfrom (SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen, gboolean blocking)
+{
+       int ret = SOCKET_ERROR;
+       ALERTABLE_SOCKET_CALL (FD_READ_BIT, blocking, TRUE, ret, recvfrom, s, buf, len, flags, from, fromlen);
+       return ret;
+}
+
+int alertable_WSARecv (SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, LPDWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, gboolean blocking)
+{
+       int ret = SOCKET_ERROR;
+       ALERTABLE_SOCKET_CALL (FD_READ_BIT, blocking, TRUE, ret, WSARecv, s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags, lpOverlapped, lpCompletionRoutine);
+       return ret;
+}
+
+int alertable_send (SOCKET s, char *buf, int len, int flags, gboolean blocking)
+{
+       int ret = SOCKET_ERROR;
+       ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, send, s, buf, len, flags);
+       return ret;
+}
+
+int alertable_sendto (SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen, gboolean blocking)
+{
+       int ret = SOCKET_ERROR;
+       ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, sendto, s, buf, len, flags, to, tolen);
+       return ret;
+}
+
+int alertable_WSASend (SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount, LPDWORD lpNumberOfBytesRecvd, DWORD lpFlags, LPWSAOVERLAPPED lpOverlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, gboolean blocking)
+{
+       int ret = SOCKET_ERROR;
+       ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, WSASend, s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags, lpOverlapped, lpCompletionRoutine);
+       return ret;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
+BOOL alertable_TransmitFile (SOCKET hSocket, HANDLE hFile, DWORD nNumberOfBytesToWrite, DWORD nNumberOfBytesPerSend, LPOVERLAPPED lpOverlapped, LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, DWORD dwReserved, gboolean blocking)
+{
+       LOGDEBUG (g_message ("%06d - Performing %s TransmitFile () on socket %d", GetCurrentThreadId (), blocking ? "blocking" : "non-blocking", hSocket));
+
+       int error = 0;
+       if (blocking) {
+               g_assert (lpOverlapped == NULL);
+               OVERLAPPED overlapped = { 0 };
+               overlapped.hEvent = WSACreateEvent ();
+               if (overlapped.hEvent == WSA_INVALID_EVENT)
+                       return FALSE;
+               if (!TransmitFile (hSocket, hFile, nNumberOfBytesToWrite, nNumberOfBytesPerSend, &overlapped, lpTransmitBuffers, dwReserved)) {
+                       error = WSAGetLastError ();
+                       if (error == WSA_IO_PENDING) {
+                               error = 0;
+                               // NOTE: .NET's Socket.SendFile() doesn't honor the Socket's SendTimeout so we shouldn't either
+                               DWORD ret = WaitForSingleObjectEx (overlapped.hEvent, INFINITE, TRUE);
+                               if (ret == WAIT_IO_COMPLETION) {
+                                       LOGDEBUG (g_message ("%06d - WaitForSingleObjectEx () returned WSA_WAIT_IO_COMPLETION for socket %d", GetCurrentThreadId (), hSocket));
+                                       error = WSAEINTR;
+                               } else if (ret == WAIT_TIMEOUT) {
+                                       error = WSAETIMEDOUT;
+                               } else if (ret != WAIT_OBJECT_0) {
+                                       error = GetLastError ();
+                               }
+                       }
+               }
+               WSACloseEvent (overlapped.hEvent);
+       } else {
+               if (!TransmitFile (hSocket, hFile, nNumberOfBytesToWrite, nNumberOfBytesPerSend, lpOverlapped, lpTransmitBuffers, dwReserved)) {
+                       error = WSAGetLastError ();
+               }
+       }
+
+       LOGDEBUG (g_message ("%06d - Finished %s TransmitFile () on socket %d (ret = %d, WSAGetLastError() = %d)", GetCurrentThreadId (), \
+               blocking ? "blocking" : "non-blocking", hSocket, error == 0, error));
+       WSASetLastError (error);
+
+       return error == 0;
+}
+#endif /* #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */
index b4a85f27fa4f6d899ad1f40a3e895e9eaabef393..b5866b73a22bb730dc3109f85cf6c7576e1f7662 100644 (file)
@@ -62,7 +62,7 @@
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/networking.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 
 #include <time.h>
 #ifdef HAVE_SYS_TIME_H
 #include <ifaddrs.h>
 #endif
 
+#if defined(_MSC_VER) && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
+#include <MSWSock.h>
+#endif
+
 #include "mono/io-layer/socket-wrappers.h"
+#ifdef HOST_WIN32
+#include "mono/metadata/socket-io-windows-internals.h"
+#endif
 
 #define LOGDEBUG(...)  
 /* define LOGDEBUG(...) g_message(__VA_ARGS__)  */
@@ -588,61 +595,6 @@ get_socket_assembly (void)
        return domain->socket_assembly;
 }
 
-static gint32
-get_family_hint (MonoError *error)
-{
-       MonoDomain *domain = mono_domain_get ();
-
-       mono_error_init (error);
-
-       if (!domain->inet_family_hint) {
-               MonoImage *socket_assembly;
-               MonoClass *socket_class;
-               MonoClassField *ipv6_field, *ipv4_field;
-               gint32 ipv6_enabled = -1, ipv4_enabled = -1;
-               MonoVTable *vtable;
-
-               socket_assembly = get_socket_assembly ();
-               g_assert (socket_assembly);
-
-               socket_class = mono_class_load_from_name (socket_assembly, "System.Net.Sockets", "Socket");
-
-               ipv4_field = mono_class_get_field_from_name (socket_class, "ipv4_supported");
-               g_assert (ipv4_field);
-
-               ipv6_field = mono_class_get_field_from_name (socket_class, "ipv6_supported");
-               g_assert (ipv6_field);
-
-               vtable = mono_class_vtable (mono_domain_get (), socket_class);
-               g_assert (vtable);
-
-               mono_runtime_class_init_full (vtable, error);
-               return_val_if_nok (error, -1);
-
-               mono_field_static_get_value_checked (vtable, ipv4_field, &ipv4_enabled, error);
-               return_val_if_nok (error, -1);
-               mono_field_static_get_value_checked (vtable, ipv6_field, &ipv6_enabled, error);
-               return_val_if_nok (error, -1);
-
-               mono_domain_lock (domain);
-               if (ipv4_enabled == 1 && ipv6_enabled == 1) {
-                       domain->inet_family_hint = 1;
-               } else if (ipv4_enabled == 1) {
-                       domain->inet_family_hint = 2;
-               } else {
-                       domain->inet_family_hint = 3;
-               }
-               mono_domain_unlock (domain);
-       }
-       switch (domain->inet_family_hint) {
-       case 1: return PF_UNSPEC;
-       case 2: return PF_INET;
-       case 3: return PF_INET6;
-       default:
-               return PF_UNSPEC;
-       }
-}
-
 gpointer
 ves_icall_System_Net_Sockets_Socket_Socket_internal (MonoObject *this_obj, gint32 family, gint32 type, gint32 proto, gint32 *werror)
 {
@@ -765,7 +717,7 @@ ves_icall_System_Net_Sockets_Socket_Accept_internal (SOCKET sock, gint32 *werror
        {
                MonoInternalThread *curthread = mono_thread_internal_current ();
                curthread->interrupt_on_stop = (gpointer)TRUE;
-               newsock = _wapi_accept (sock, NULL, 0);
+               newsock = alertable_accept (sock, NULL, 0, blocking);
                curthread->interrupt_on_stop = (gpointer)FALSE;
        }
 #else
@@ -1303,7 +1255,7 @@ ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET sock, gint mode,
 }
 
 void
-ves_icall_System_Net_Sockets_Socket_Connect_internal (SOCKET sock, MonoObject *sockaddr, gint32 *werror)
+ves_icall_System_Net_Sockets_Socket_Connect_internal (SOCKET sock, MonoObject *sockaddr, gint32 *werror, gboolean blocking)
 {
        MonoError error;
        struct sockaddr *sa;
@@ -1331,7 +1283,11 @@ ves_icall_System_Net_Sockets_Socket_Connect_internal (SOCKET sock, MonoObject *s
 
        MONO_ENTER_GC_SAFE;
 
+#ifdef HOST_WIN32
+       ret = alertable_connect (sock, sa, sa_size, blocking);
+#else
        ret = _wapi_connect (sock, sa, sa_size);
+#endif
 
        MONO_EXIT_GC_SAFE;
 
@@ -1345,6 +1301,7 @@ ves_icall_System_Net_Sockets_Socket_Connect_internal (SOCKET sock, MonoObject *s
        g_free (sa);
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
 /* These #defines from mswsock.h from wine.  Defining them here allows
  * us to build this file on a mingw box that doesn't know the magic
  * numbers, but still run on a newer windows box that does.
@@ -1435,9 +1392,10 @@ ves_icall_System_Net_Sockets_Socket_Disconnect_internal (SOCKET sock, MonoBoolea
        if (interrupted)
                *werror = WSAEINTR;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */
 
 gint32
-ves_icall_System_Net_Sockets_Socket_Receive_internal (SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *werror)
+ves_icall_System_Net_Sockets_Socket_Receive_internal (SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *werror, gboolean blocking)
 {
        int ret;
        guchar *buf;
@@ -1469,7 +1427,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_internal (SOCKET sock, MonoArray *bu
 #ifdef HOST_WIN32
        {
                curthread->interrupt_on_stop = (gpointer)TRUE;
-               ret = _wapi_recv (sock, buf, count, recvflags);
+               ret = alertable_recv (sock, buf, count, recvflags, blocking);
                curthread->interrupt_on_stop = (gpointer)FALSE;
        }
 #else
@@ -1492,7 +1450,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_internal (SOCKET sock, MonoArray *bu
 }
 
 gint32
-ves_icall_System_Net_Sockets_Socket_Receive_array_internal (SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *werror)
+ves_icall_System_Net_Sockets_Socket_Receive_array_internal (SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *werror, gboolean blocking)
 {
        int ret, count;
        gboolean interrupted;
@@ -1519,7 +1477,11 @@ ves_icall_System_Net_Sockets_Socket_Receive_array_internal (SOCKET sock, MonoArr
 
        MONO_ENTER_GC_SAFE;
 
+#ifdef HOST_WIN32
+       ret = alertable_WSARecv (sock, wsabufs, count, &recv, &recvflags, NULL, NULL, blocking);
+#else
        ret = WSARecv (sock, wsabufs, count, &recv, &recvflags, NULL, NULL);
+#endif
 
        MONO_EXIT_GC_SAFE;
 
@@ -1537,7 +1499,7 @@ ves_icall_System_Net_Sockets_Socket_Receive_array_internal (SOCKET sock, MonoArr
 }
 
 gint32
-ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *werror)
+ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *werror, gboolean blocking)
 {
        MonoError error;
        int ret;
@@ -1579,7 +1541,11 @@ ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (SOCKET sock, MonoArray
 
        MONO_ENTER_GC_SAFE;
 
+#ifdef HOST_WIN32
+       ret = alertable_recvfrom (sock, buf, count, recvflags, sa, &sa_size, blocking);
+#else
        ret = _wapi_recvfrom (sock, buf, count, recvflags, sa, &sa_size);
+#endif
 
        MONO_EXIT_GC_SAFE;
 
@@ -1617,7 +1583,7 @@ ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal (SOCKET sock, MonoArray
 }
 
 gint32
-ves_icall_System_Net_Sockets_Socket_Send_internal (SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *werror)
+ves_icall_System_Net_Sockets_Socket_Send_internal (SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *werror, gboolean blocking)
 {
        int ret;
        guchar *buf;
@@ -1651,7 +1617,11 @@ ves_icall_System_Net_Sockets_Socket_Send_internal (SOCKET sock, MonoArray *buffe
 
        MONO_ENTER_GC_SAFE;
 
+#ifdef HOST_WIN32
+       ret = alertable_send (sock, buf, count, sendflags, blocking);
+#else
        ret = _wapi_send (sock, buf, count, sendflags);
+#endif
 
        MONO_EXIT_GC_SAFE;
 
@@ -1669,7 +1639,7 @@ ves_icall_System_Net_Sockets_Socket_Send_internal (SOCKET sock, MonoArray *buffe
 }
 
 gint32
-ves_icall_System_Net_Sockets_Socket_Send_array_internal (SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *werror)
+ves_icall_System_Net_Sockets_Socket_Send_array_internal (SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *werror, gboolean blocking)
 {
        int ret, count;
        DWORD sent;
@@ -1696,7 +1666,11 @@ ves_icall_System_Net_Sockets_Socket_Send_array_internal (SOCKET sock, MonoArray
 
        MONO_ENTER_GC_SAFE;
 
+#ifdef HOST_WIN32
+       ret = alertable_WSASend (sock, wsabufs, count, &sent, sendflags, NULL, NULL, blocking);
+#else
        ret = WSASend (sock, wsabufs, count, &sent, sendflags, NULL, NULL);
+#endif
 
        MONO_EXIT_GC_SAFE;
 
@@ -1714,7 +1688,7 @@ ves_icall_System_Net_Sockets_Socket_Send_array_internal (SOCKET sock, MonoArray
 }
 
 gint32
-ves_icall_System_Net_Sockets_Socket_SendTo_internal (SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr, gint32 *werror)
+ves_icall_System_Net_Sockets_Socket_SendTo_internal (SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr, gint32 *werror, gboolean blocking)
 {
        MonoError error;
        int ret;
@@ -1762,7 +1736,11 @@ ves_icall_System_Net_Sockets_Socket_SendTo_internal (SOCKET sock, MonoArray *buf
 
        MONO_ENTER_GC_SAFE;
 
+#ifdef HOST_WIN32
+       ret = alertable_sendto (sock, buf, count, sendflags, sa, sa_size, blocking);
+#else
        ret = _wapi_sendto (sock, buf, count, sendflags, sa, sa_size);
+#endif
 
        MONO_EXIT_GC_SAFE;
 
@@ -2613,50 +2591,18 @@ leave2:
        return is_ok (error);
 }
 
-static int
-get_addrinfo_family_hint (MonoError *error)
-{
-       int hint;
-
-       mono_error_init (error);
-
-       hint = get_family_hint (error);
-       return_val_if_nok (error, 0);
-
-       switch (hint) {
-       case PF_UNSPEC:
-               return MONO_HINT_UNSPECIFIED;
-       case PF_INET:
-               return MONO_HINT_IPV4;
-#ifdef PF_INET6
-       case PF_INET6:
-               return MONO_HINT_IPV6;
-#endif
-       default:
-               g_error ("invalid hint");
-               return 0;
-       }
-}
-
 MonoBoolean
-ves_icall_System_Net_Dns_GetHostByName_internal (MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
+ves_icall_System_Net_Dns_GetHostByName_internal (MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list, gint32 hint)
 {
        MonoError error;
        gboolean add_local_ips = FALSE, add_info_ok = TRUE;
        gchar this_hostname [256];
        MonoAddressInfo *info = NULL;
-       int hint;
 
        char *hostname = mono_string_to_utf8_checked (host, &error);
        if (mono_error_set_pending_exception (&error))
                return FALSE;
 
-       hint = get_addrinfo_family_hint (&error);
-       if (!mono_error_ok (&error)) {
-               mono_error_set_pending_exception (&error);
-               return FALSE;
-       }
-
        if (*hostname == '\0') {
                add_local_ips = TRUE;
                *h_name = host;
@@ -2691,14 +2637,14 @@ ves_icall_System_Net_Dns_GetHostByName_internal (MonoString *host, MonoString **
 }
 
 MonoBoolean
-ves_icall_System_Net_Dns_GetHostByAddr_internal (MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
+ves_icall_System_Net_Dns_GetHostByAddr_internal (MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list, gint32 hint)
 {
        char *address;
        struct sockaddr_in saddr;
        struct sockaddr_in6 saddr6;
        MonoAddressInfo *info = NULL;
        MonoError error;
-       gint32 family, hint;
+       gint32 family;
        gchar hostname [NI_MAXHOST] = { 0 };
        gboolean ret;
 
@@ -2745,11 +2691,6 @@ ves_icall_System_Net_Dns_GetHostByAddr_internal (MonoString *addr, MonoString **
        if (!ret)
                return FALSE;
 
-       hint = get_addrinfo_family_hint (&error);
-       if (!mono_error_ok (&error)) {
-               mono_error_set_pending_exception (&error);
-               return FALSE;
-       }
        if (mono_get_address_info (hostname, 0, hint | MONO_HINT_CANONICAL_NAME | MONO_HINT_CONFIGURED_ONLY, &info) != 0)
                return FALSE;
 
@@ -2773,11 +2714,11 @@ ves_icall_System_Net_Dns_GetHostName_internal (MonoString **h_name)
        return TRUE;
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
 gboolean
-ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags)
+ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags, gint32 *werror, gboolean blocking)
 {
        HANDLE file;
-       gint32 werror;
        gboolean ret;
        gboolean interrupted;
        TRANSMIT_FILE_BUFFERS buffers;
@@ -2787,10 +2728,10 @@ ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *
 
        /* FIXME: replace file by a proper fd that we can call open and close on, as they are interruptible */
 
-       file = ves_icall_System_IO_MonoIO_Open (filename, FileMode_Open, FileAccess_Read, FileShare_Read, 0, &werror);
+       file = ves_icall_System_IO_MonoIO_Open (filename, FileMode_Open, FileAccess_Read, FileShare_Read, 0, werror);
 
        if (file == INVALID_HANDLE_VALUE) {
-               SetLastError (werror);
+               SetLastError (*werror);
                return FALSE;
        }
 
@@ -2813,14 +2754,21 @@ ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *
 
        MONO_ENTER_GC_SAFE;
 
+#ifdef HOST_WIN32
+       ret = alertable_TransmitFile (sock, file, 0, 0, NULL, &buffers, flags, blocking);
+#else
        ret = TransmitFile (sock, file, 0, 0, NULL, &buffers, flags);
+#endif
 
        MONO_EXIT_GC_SAFE;
 
+       if (!ret)
+               *werror = WSAGetLastError ();
+
        mono_thread_info_uninstall_interrupt (&interrupted);
        if (interrupted) {
                CloseHandle (file);
-               SetLastError (WSAEINTR);
+               *werror = WSAEINTR;
                return FALSE;
        }
 
@@ -2830,8 +2778,12 @@ ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *
 
        MONO_EXIT_GC_SAFE;
 
+       if (*werror)
+               return FALSE;
+
        return ret;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */
 
 gboolean
 ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto)
index e228f0a2e63df038682a3d004622f541cf928284..7a8c9361ad6334ca7843275c0eb43f9ac99ebe18 100644 (file)
@@ -169,25 +169,25 @@ extern void ves_icall_System_Net_Sockets_Socket_Listen_internal(SOCKET sock, gui
 extern MonoObject *ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal(SOCKET sock, gint32 af, gint32 *error);
 extern MonoObject *ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal(SOCKET sock, gint32 af, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_Bind_internal(SOCKET sock, MonoObject *sockaddr, gint32 *error);
-extern void ves_icall_System_Net_Sockets_Socket_Connect_internal(SOCKET sock, MonoObject *sockaddr, gint32 *error);
-extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error);
-extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error);
-extern gint32 ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error);
-extern gint32 ves_icall_System_Net_Sockets_Socket_Send_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error);
-extern gint32 ves_icall_System_Net_Sockets_Socket_Send_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error);
-extern gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr, gint32 *error);
+extern void ves_icall_System_Net_Sockets_Socket_Connect_internal(SOCKET sock, MonoObject *sockaddr, gint32 *error, gboolean blocking);
+extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error, gboolean blocking);
+extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error, gboolean blocking);
+extern gint32 ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error, gboolean blocking);
+extern gint32 ves_icall_System_Net_Sockets_Socket_Send_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error, gboolean blocking);
+extern gint32 ves_icall_System_Net_Sockets_Socket_Send_array_internal(SOCKET sock, MonoArray *buffers, gint32 flags, gint32 *error, gboolean blocking);
+extern gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr, gint32 *error, gboolean blocking);
 extern void ves_icall_System_Net_Sockets_Socket_Select_internal(MonoArray **sockets, gint32 timeout, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_Shutdown_internal(SOCKET sock, gint32 how, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET sock, gint32 level, gint32 name, MonoObject **obj_val, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal(SOCKET sock, gint32 level, gint32 name, MonoArray **byte_val, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, gint32 level, gint32 name, MonoObject *obj_val, MonoArray *byte_val, gint32 int_val, gint32 *error);
 extern int ves_icall_System_Net_Sockets_Socket_IOControl_internal (SOCKET sock, gint32 code, MonoArray *input, MonoArray *output, gint32 *error);
-extern MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list);
-extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list);
+extern MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list, gint32 hint);
+extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list, gint32 hint);
 extern MonoBoolean ves_icall_System_Net_Dns_GetHostName_internal(MonoString **h_name);
 extern MonoBoolean ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET sock, gint mode, gint timeout, gint32 *error);
 extern void ves_icall_System_Net_Sockets_Socket_Disconnect_internal(SOCKET sock, MonoBoolean reuse, gint32 *error);
-extern gboolean ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags);
+extern gboolean ves_icall_System_Net_Sockets_Socket_SendFile_internal (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags, gint32 *error, gboolean blocking);
 void icall_cancel_blocking_socket_operation (MonoThread *thread);
 extern gboolean ves_icall_System_Net_Sockets_Socket_SupportPortReuse (MonoProtocolType proto);
 
index ef91c85b0ace8172ccd7a7aa23727f40a6fe643d..a412c1560960f925edd780db02449fefed963aa4 100644 (file)
@@ -195,8 +195,8 @@ encode_type (MonoDynamicImage *assembly, MonoType *type, SigBuffer *buf)
        case MONO_TYPE_CLASS: {
                MonoClass *k = mono_class_from_mono_type (type);
 
-               if (k->generic_container) {
-                       MonoGenericClass *gclass = mono_metadata_lookup_generic_class (k, k->generic_container->context.class_inst, TRUE);
+               if (mono_class_is_gtd (k)) {
+                       MonoGenericClass *gclass = mono_metadata_lookup_generic_class (k, mono_class_get_generic_container (k)->context.class_inst, TRUE);
                        encode_generic_class (assembly, gclass, buf);
                } else {
                        /*
@@ -571,7 +571,7 @@ handle_enum:
                return idx;
        }
        case MONO_TYPE_GENERICINST:
-               *ret_type = val->vtable->klass->generic_class->container_class->byval_arg.type;
+               *ret_type = mono_class_get_generic_class (val->vtable->klass)->container_class->byval_arg.type;
                goto handle_enum;
        default:
                g_error ("we don't encode constant type 0x%02x yet", *ret_type);
@@ -591,7 +591,6 @@ handle_enum:
        return idx;
 }
 
-
 guint32
 mono_dynimage_encode_field_signature (MonoDynamicImage *assembly, MonoReflectionFieldBuilder *fb, MonoError *error)
 {
@@ -605,9 +604,6 @@ mono_dynimage_encode_field_signature (MonoDynamicImage *assembly, MonoReflection
        MonoType *type;
        MonoClass *klass;
 
-       mono_reflection_init_type_builder_generics (fb->type, error);
-       return_val_if_nok (error, 0);
-
        type = mono_reflection_type_get_handle ((MonoReflectionType*)fb->type, error);
        return_val_if_nok (error, 0);
        klass = mono_class_from_mono_type (type);
@@ -620,12 +616,12 @@ mono_dynimage_encode_field_signature (MonoDynamicImage *assembly, MonoReflection
                goto fail;
        /* encode custom attributes before the type */
 
-       if (klass->generic_container)
+       if (mono_class_is_gtd (klass))
                typespec = create_typespec (assembly, type);
 
        if (typespec) {
                MonoGenericClass *gclass;
-               gclass = mono_metadata_lookup_generic_class (klass, klass->generic_container->context.class_inst, TRUE);
+               gclass = mono_metadata_lookup_generic_class (klass, mono_class_get_generic_container (klass)->context.class_inst, TRUE);
                encode_generic_class (assembly, gclass, &buf);
        } else {
                encode_type (assembly, type, &buf);
@@ -716,7 +712,7 @@ create_typespec (MonoDynamicImage *assembly, MonoType *type)
        case MONO_TYPE_CLASS:
        case MONO_TYPE_VALUETYPE: {
                MonoClass *k = mono_class_from_mono_type (type);
-               if (!k || !k->generic_container) {
+               if (!k || !mono_class_is_gtd (k)) {
                        sigbuffer_free (&buf);
                        return 0;
                }
@@ -760,8 +756,6 @@ mono_dynimage_encode_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *
        if (token)
                return token;
        klass = mono_class_from_mono_type (type);
-       if (!klass)
-               klass = mono_class_from_mono_type (type);
 
        /*
         * If it's in the same module and not a generic type parameter:
@@ -806,32 +800,6 @@ mono_image_typedef_or_ref (MonoDynamicImage *assembly, MonoType *type)
        return mono_dynimage_encode_typedef_or_ref_full (assembly, type, TRUE);
 }
 
-guint32
-mono_dynimage_encode_generic_method_definition_sig (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *mb)
-{
-       SigBuffer buf;
-       int i;
-       guint32 nparams = mono_array_length (mb->generic_params);
-       guint32 idx;
-
-       if (!assembly->save)
-               return 0;
-
-       sigbuffer_init (&buf, 32);
-
-       sigbuffer_add_value (&buf, 0xa);
-       sigbuffer_add_value (&buf, nparams);
-
-       for (i = 0; i < nparams; i++) {
-               sigbuffer_add_value (&buf, MONO_TYPE_MVAR);
-               sigbuffer_add_value (&buf, i);
-       }
-
-       idx = sigbuffer_add_to_blob_cached (assembly, &buf);
-       sigbuffer_free (&buf);
-       return idx;
-}
-
 guint32
 mono_dynimage_encode_generic_method_sig (MonoDynamicImage *assembly, MonoGenericContext *context)
 {
@@ -858,84 +826,6 @@ mono_dynimage_encode_generic_method_sig (MonoDynamicImage *assembly, MonoGeneric
        return idx;
 }
 
-#ifndef DISABLE_REFLECTION_EMIT
-guint32
-mono_dynimage_encode_generic_typespec (MonoDynamicImage *assembly, MonoReflectionTypeBuilder *tb, MonoError *error)
-{
-       MonoDynamicTable *table;
-       MonoClass *klass;
-       MonoType *type;
-       guint32 *values;
-       guint32 token;
-       SigBuffer buf;
-       int count, i;
-
-       /*
-        * We're creating a TypeSpec for the TypeBuilder of a generic type declaration,
-        * ie. what we'd normally use as the generic type in a TypeSpec signature.
-        * Because of this, we must not insert it into the `typeref' hash table.
-        */
-       type = mono_reflection_type_get_handle ((MonoReflectionType*)tb, error);
-       return_val_if_nok (error, 0);
-       token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->typespec, type));
-       if (token)
-               return token;
-
-       sigbuffer_init (&buf, 32);
-
-       g_assert (tb->generic_params);
-       klass = mono_class_from_mono_type (type);
-
-       if (tb->generic_container) {
-               if (!mono_reflection_create_generic_class (tb, error))
-                       goto fail;
-       }
-
-       sigbuffer_add_value (&buf, MONO_TYPE_GENERICINST);
-       g_assert (klass->generic_container);
-       sigbuffer_add_value (&buf, klass->byval_arg.type);
-       sigbuffer_add_value (&buf, mono_dynimage_encode_typedef_or_ref_full (assembly, &klass->byval_arg, FALSE));
-
-       count = mono_array_length (tb->generic_params);
-       sigbuffer_add_value (&buf, count);
-       for (i = 0; i < count; i++) {
-               MonoReflectionGenericParam *gparam;
-
-               gparam = mono_array_get (tb->generic_params, MonoReflectionGenericParam *, i);
-               MonoType *gparam_type = mono_reflection_type_get_handle ((MonoReflectionType*)gparam, error);
-               if (!is_ok (error))
-                       goto fail;
-
-               encode_type (assembly, gparam_type, &buf);
-       }
-
-       table = &assembly->tables [MONO_TABLE_TYPESPEC];
-
-       if (assembly->save) {
-               token = sigbuffer_add_to_blob_cached (assembly, &buf);
-               alloc_table (table, table->rows + 1);
-               values = table->values + table->next_idx * MONO_TYPESPEC_SIZE;
-               values [MONO_TYPESPEC_SIGNATURE] = token;
-       }
-       sigbuffer_free (&buf);
-
-       token = MONO_TYPEDEFORREF_TYPESPEC | (table->next_idx << MONO_TYPEDEFORREF_BITS);
-       g_hash_table_insert (assembly->typespec, type, GUINT_TO_POINTER(token));
-       table->next_idx ++;
-       return token;
-fail:
-       sigbuffer_free (&buf);
-       return 0;
-}
-#else /*DISABLE_REFLECTION_EMIT*/
-guint32
-mono_dynimage_encode_generic_typespec (MonoDynamicImage *assembly, MonoReflectionTypeBuilder *tb, MonoError *error)
-{
-       g_assert_not_reached ();
-       return 0;
-}
-#endif /*DISABLE_REFLECTION_EMIT*/
-
 #ifndef DISABLE_REFLECTION_EMIT
 guint32
 mono_dynimage_encode_reflection_sighelper (MonoDynamicImage *assembly, MonoReflectionSigHelper *helper, MonoError *error)
index 87d823a22e0f48b55626f6627714f3e55410063a..5f902cd7cc086bf64cd4957f526171ee6ac29aab 100644 (file)
@@ -74,15 +74,6 @@ mono_is_sr_mono_cmethod (MonoClass *klass);
 gboolean
 mono_is_sr_mono_property (MonoClass *klass);
 
-gboolean
-mono_reflection_create_generic_class (MonoReflectionTypeBuilder *tb, MonoError *error);
-
-MonoMethod*
-mono_reflection_method_builder_to_mono_method (MonoReflectionMethodBuilder *mb, MonoError *error);
-
-MonoMethod*
-mono_reflection_method_on_tb_inst_get_handle (MonoReflectionMethodOnTypeBuilderInst *m, MonoError *error);
-
 gpointer
 mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **handle_class, MonoGenericContext *context, MonoError *error);
 
@@ -98,9 +89,6 @@ mono_reflection_methodbuilder_from_method_builder (ReflectionMethodBuilder *rmb,
 gboolean
 mono_reflection_methodbuilder_from_ctor_builder (ReflectionMethodBuilder *rmb, MonoReflectionCtorBuilder *mb,
                                                 MonoError *error);
-
-void
-mono_reflection_init_type_builder_generics (MonoObject *type, MonoError *error);
                                                            
 guint32
 mono_reflection_resolution_scope_from_image (MonoDynamicImage *assembly, MonoImage *image);
@@ -129,15 +117,9 @@ guint32
 mono_dynimage_encode_method_builder_signature (MonoDynamicImage *assembly, ReflectionMethodBuilder *mb,
                                               MonoError *error);
 
-guint32
-mono_dynimage_encode_generic_method_definition_sig (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *mb);
-
 guint32
 mono_dynimage_encode_generic_method_sig (MonoDynamicImage *assembly, MonoGenericContext *context);
 
-guint32
-mono_dynimage_encode_generic_typespec (MonoDynamicImage *assembly, MonoReflectionTypeBuilder *tb, MonoError *error);
-
 guint32
 mono_dynimage_encode_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType *type, gboolean try_typespec);
 
index ff2f93a767be1a8ef630b34a058a2fa076a48db5..b52ff6c6df9543e60c7386f0af3b70cc829f9840 100644 (file)
@@ -705,7 +705,6 @@ mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicImage *ass
        values [MONO_FIELD_SIGNATURE] = mono_dynimage_encode_field_signature (assembly, fb, error);
        return_if_nok (error);
 
-
        if (fb->offset != -1) {
                table = &assembly->tables [MONO_TABLE_FIELDLAYOUT];
                table->rows ++;
@@ -1195,7 +1194,7 @@ mono_image_fill_export_table_from_class (MonoDomain *domain, MonoClass *klass,
        guint32 *values;
        guint32 visib, res;
 
-       visib = klass->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK;
+       visib = mono_class_get_flags (klass) & TYPE_ATTRIBUTE_VISIBILITY_MASK;
        if (! ((visib & TYPE_ATTRIBUTE_PUBLIC) || (visib & TYPE_ATTRIBUTE_NESTED_PUBLIC)))
                return 0;
 
@@ -1204,7 +1203,7 @@ mono_image_fill_export_table_from_class (MonoDomain *domain, MonoClass *klass,
        alloc_table (table, table->rows);
        values = table->values + table->next_idx * MONO_EXP_TYPE_SIZE;
 
-       values [MONO_EXP_TYPE_FLAGS] = klass->flags;
+       values [MONO_EXP_TYPE_FLAGS] = mono_class_get_flags (klass);
        values [MONO_EXP_TYPE_TYPEDEF] = klass->type_token;
        if (klass->nested_in)
                values [MONO_EXP_TYPE_IMPLEMENTATION] = (parent_index << MONO_IMPLEMENTATION_BITS) + MONO_IMPLEMENTATION_EXP_TYPE;
@@ -1218,10 +1217,11 @@ mono_image_fill_export_table_from_class (MonoDomain *domain, MonoClass *klass,
        table->next_idx ++;
 
        /* Emit nested types */
-       if (klass->ext && klass->ext->nested_classes) {
+       MonoClassExt *ext = mono_class_get_ext (klass);
+       if (ext && ext->nested_classes) {
                GList *tmp;
 
-               for (tmp = klass->ext->nested_classes; tmp; tmp = tmp->next)
+               for (tmp = ext->nested_classes; tmp; tmp = tmp->next)
                        mono_image_fill_export_table_from_class (domain, (MonoClass *)tmp->data, module_index, table->next_idx - 1, assembly);
        }
 
@@ -1275,7 +1275,7 @@ mono_image_fill_export_table_from_module (MonoDomain *domain, MonoReflectionModu
                MonoClass *klass = mono_class_get_checked (image, mono_metadata_make_token (MONO_TABLE_TYPEDEF, i + 1), &error);
                g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
 
-               if (klass->flags & TYPE_ATTRIBUTE_PUBLIC)
+               if (mono_class_is_public (klass))
                        mono_image_fill_export_table_from_class (domain, klass, module_index, 0, assembly);
        }
 }
@@ -1691,9 +1691,6 @@ fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicImage *asse
 {
        guint32 code_idx = GPOINTER_TO_UINT (value);
        MonoReflectionILTokenInfo *iltoken;
-       MonoReflectionFieldBuilder *field;
-       MonoReflectionCtorBuilder *ctor;
-       MonoReflectionMethodBuilder *method;
        MonoReflectionTypeBuilder *tb;
        MonoReflectionArrayMethod *am;
        guint32 i, idx = 0;
@@ -1705,8 +1702,7 @@ fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicImage *asse
                switch (target [3]) {
                case MONO_TABLE_FIELD:
                        if (!strcmp (iltoken->member->vtable->klass->name, "FieldBuilder")) {
-                               field = (MonoReflectionFieldBuilder *)iltoken->member;
-                               idx = field->table_idx;
+                               g_assert_not_reached ();
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "MonoField")) {
                                MonoClassField *f = ((MonoReflectionField*)iltoken->member)->field;
                                idx = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->field_to_table_idx, f));
@@ -1716,11 +1712,9 @@ fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicImage *asse
                        break;
                case MONO_TABLE_METHOD:
                        if (!strcmp (iltoken->member->vtable->klass->name, "MethodBuilder")) {
-                               method = (MonoReflectionMethodBuilder *)iltoken->member;
-                               idx = method->table_idx;
+                               g_assert_not_reached ();
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "ConstructorBuilder")) {
-                               ctor = (MonoReflectionCtorBuilder *)iltoken->member;
-                               idx = ctor->table_idx;
+                               g_assert_not_reached ();
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "MonoMethod") || 
                                           !strcmp (iltoken->member->vtable->klass->name, "MonoCMethod")) {
                                MonoMethod *m = ((MonoReflectionMethod*)iltoken->member)->method;
@@ -1730,47 +1724,67 @@ fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicImage *asse
                        }
                        break;
                case MONO_TABLE_TYPEDEF:
-                       if (strcmp (iltoken->member->vtable->klass->name, "TypeBuilder"))
+                       if (!strcmp (iltoken->member->vtable->klass->name, "TypeBuilder")) {
+                               g_assert_not_reached ();
+                       } else if (!strcmp (iltoken->member->vtable->klass->name, "RuntimeType")) {
+                               MonoClass *k = mono_class_from_mono_type (((MonoReflectionType*)iltoken->member)->type);
+                               MonoObject *obj = mono_class_get_ref_info (k);
+                               g_assert (obj);
+                               g_assert (!strcmp (obj->vtable->klass->name, "TypeBuilder"));
+                               tb = (MonoReflectionTypeBuilder*)obj;
+                               idx = tb->table_idx;
+                       } else {
                                g_assert_not_reached ();
-                       tb = (MonoReflectionTypeBuilder *)iltoken->member;
-                       idx = tb->table_idx;
+                       }
                        break;
                case MONO_TABLE_MEMBERREF:
                        if (!strcmp (iltoken->member->vtable->klass->name, "MonoArrayMethod")) {
                                am = (MonoReflectionArrayMethod*)iltoken->member;
                                idx = am->table_idx;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "MonoMethod") ||
-                                  !strcmp (iltoken->member->vtable->klass->name, "MonoCMethod") ||
-                                  !strcmp (iltoken->member->vtable->klass->name, "MonoGenericMethod") ||
-                                  !strcmp (iltoken->member->vtable->klass->name, "MonoGenericCMethod")) {
+                                          !strcmp (iltoken->member->vtable->klass->name, "MonoCMethod")) {
                                MonoMethod *m = ((MonoReflectionMethod*)iltoken->member)->method;
-                               g_assert (m->klass->generic_class || m->klass->generic_container);
+                               g_assert (mono_class_is_ginst (m->klass) || mono_class_is_gtd (m->klass));
                                continue;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "FieldBuilder")) {
+                               g_assert_not_reached ();
                                continue;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "MonoField")) {
                                continue;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "MethodBuilder") ||
                                        !strcmp (iltoken->member->vtable->klass->name, "ConstructorBuilder")) {
+                               g_assert_not_reached ();
                                continue;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "FieldOnTypeBuilderInst")) {
+                               g_assert_not_reached ();
                                continue;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "MethodOnTypeBuilderInst")) {
+                               g_assert_not_reached ();
                                continue;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "ConstructorOnTypeBuilderInst")) {
+                               g_assert_not_reached ();
                                continue;
                        } else {
                                g_assert_not_reached ();
                        }
                        break;
                case MONO_TABLE_METHODSPEC:
-                       if (!strcmp (iltoken->member->vtable->klass->name, "MonoGenericMethod")) {
+                       if (!strcmp (iltoken->member->vtable->klass->name, "MonoMethod")) {
                                MonoMethod *m = ((MonoReflectionMethod*)iltoken->member)->method;
                                g_assert (mono_method_signature (m)->generic_param_count);
                                continue;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "MethodBuilder")) {
+                               g_assert_not_reached ();
                                continue;
                        } else if (!strcmp (iltoken->member->vtable->klass->name, "MethodOnTypeBuilderInst")) {
+                               g_assert_not_reached ();
+                               continue;
+                       } else {
+                               g_assert_not_reached ();
+                       }
+                       break;
+               case MONO_TABLE_TYPESPEC:
+                       if (!strcmp (iltoken->member->vtable->klass->name, "RuntimeType")) {
                                continue;
                        } else {
                                g_assert_not_reached ();
index 6e800f3913908264254951d21e1db7c5b7a59402..3d73c7561332b5efbf78b0ed01f3c6b7f1240560 100644 (file)
 #include "mono/utils/checked-build.h"
 #include "mono/utils/mono-digest.h"
 
-void
-mono_sre_generic_param_table_entry_free (GenericParamTableEntry *entry)
-{
-       mono_gc_deregister_root ((char*) &entry->gparam);
-       g_free (entry);
-}
-
 static GENERATE_GET_CLASS_WITH_CACHE (marshal_as_attribute, System.Runtime.InteropServices, MarshalAsAttribute);
+static GENERATE_GET_CLASS_WITH_CACHE (module_builder, System.Reflection.Emit, ModuleBuilder);
 
 #ifndef DISABLE_REFLECTION_EMIT
 static guint32 mono_image_get_methodref_token (MonoDynamicImage *assembly, MonoMethod *method, gboolean create_typespec);
-static guint32 mono_image_get_methodbuilder_token (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *mb, gboolean create_open_instance, MonoError *error);
-static guint32 mono_image_get_ctorbuilder_token (MonoDynamicImage *assembly, MonoReflectionCtorBuilder *cb, MonoError *error);
 static guint32 mono_image_get_sighelper_token (MonoDynamicImage *assembly, MonoReflectionSigHelper *helper, MonoError *error);
 static gboolean ensure_runtime_vtable (MonoClass *klass, MonoError  *error);
-static guint32 mono_image_get_methodref_token_for_methodbuilder (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *method, MonoError *error);
 static void reflection_methodbuilder_from_dynamic_method (ReflectionMethodBuilder *rmb, MonoReflectionDynamicMethod *mb);
+static gboolean reflection_setup_internal_class (MonoReflectionTypeBuilder *tb, MonoError *error);
 
 static gpointer register_assembly (MonoDomain *domain, MonoReflectionAssembly *res, MonoAssembly *assembly);
 #endif
@@ -61,17 +53,17 @@ static MonoReflectionType *mono_reflection_type_get_underlying_system_type (Mono
 static gboolean is_sre_array (MonoClass *klass);
 static gboolean is_sre_byref (MonoClass *klass);
 static gboolean is_sre_pointer (MonoClass *klass);
+static gboolean is_sre_generic_instance (MonoClass *klass);
 static gboolean is_sre_type_builder (MonoClass *klass);
 static gboolean is_sre_method_builder (MonoClass *klass);
 static gboolean is_sre_field_builder (MonoClass *klass);
+static gboolean is_sre_gparam_builder (MonoClass *klass);
+static gboolean is_sre_enum_builder (MonoClass *klass);
 static gboolean is_sr_mono_method (MonoClass *klass);
-static gboolean is_sr_mono_generic_method (MonoClass *klass);
-static gboolean is_sr_mono_generic_cmethod (MonoClass *klass);
 static gboolean is_sr_mono_field (MonoClass *klass);
 
 static guint32 mono_image_get_methodspec_token (MonoDynamicImage *assembly, MonoMethod *method);
 static guint32 mono_image_get_inflated_method_token (MonoDynamicImage *assembly, MonoMethod *m);
-static MonoMethod * inflate_method (MonoReflectionType *type, MonoObject *obj, MonoError *error);
 
 #define mono_type_array_get_and_resolve(array, index, error) mono_reflection_type_get_handle ((MonoReflectionType*)mono_array_get (array, gpointer, index), error)
 
@@ -104,7 +96,7 @@ type_get_qualified_name (MonoType *type, MonoAssembly *ass)
                return mono_type_get_name_full (type, MONO_TYPE_NAME_FORMAT_REFLECTION);
        ta = klass->image->assembly;
        if (assembly_is_dynamic (ta) || (ta == ass)) {
-               if (klass->generic_class || klass->generic_container)
+               if (mono_class_is_ginst (klass) || mono_class_is_gtd (klass))
                        /* For generic type definitions, we want T, while REFLECTION returns T<K> */
                        return mono_type_get_name_full (type, MONO_TYPE_NAME_FORMAT_FULL_NAME);
                else
@@ -363,7 +355,6 @@ mono_save_custom_attrs (MonoImage *image, void *obj, MonoArray *cattrs)
 }
 #endif
 
-
 guint32
 mono_reflection_resolution_scope_from_image (MonoDynamicImage *assembly, MonoImage *image)
 {
@@ -684,52 +675,6 @@ mono_image_get_methodref_token (MonoDynamicImage *assembly, MonoMethod *method,
        return token;
 }
 
-static guint32
-mono_image_get_methodref_token_for_methodbuilder (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *method, MonoError *error)
-{
-       guint32 token, parent, sig;
-       ReflectionMethodBuilder rmb;
-       MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)method->type;
-       
-       mono_error_init (error);
-       token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, method));
-       if (token)
-               return token;
-
-       if (!mono_reflection_methodbuilder_from_method_builder (&rmb, method, error))
-               return 0;
-
-       /*
-        * A methodref signature can't contain an unmanaged calling convention.
-        * Since some flags are encoded as part of call_conv, we need to check against it.
-       */
-       if ((rmb.call_conv & ~0x60) != MONO_CALL_DEFAULT && (rmb.call_conv & ~0x60) != MONO_CALL_VARARG)
-               rmb.call_conv = (rmb.call_conv & 0x60) | MONO_CALL_DEFAULT;
-
-       sig = mono_dynimage_encode_method_builder_signature (assembly, &rmb, error);
-       return_val_if_nok (error, 0);
-
-       if (tb->generic_params) {
-               parent = mono_dynimage_encode_generic_typespec (assembly, tb, error);
-               return_val_if_nok (error, 0);
-       } else {
-               MonoType *t = mono_reflection_type_get_handle ((MonoReflectionType*)rmb.type, error);
-               return_val_if_nok (error, 0);
-
-               parent = mono_image_typedef_or_ref (assembly, t);
-       }
-
-       char *name = mono_string_to_utf8_checked (method->name, error);
-       return_val_if_nok (error, 0);
-
-       token = mono_image_add_memberef_row (assembly, parent, name, sig);
-       g_free (name);
-
-       g_hash_table_insert (assembly->handleref, method, GUINT_TO_POINTER(token));
-
-       return token;
-}
-
 static guint32
 mono_image_get_varargs_method_token (MonoDynamicImage *assembly, guint32 original,
                                     const gchar *name, guint32 sig)
@@ -754,113 +699,12 @@ mono_image_get_varargs_method_token (MonoDynamicImage *assembly, guint32 origina
        return token;
 }
 
-static guint32
-mono_image_get_methodspec_token_for_generic_method_definition (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *mb, MonoError *error)
-{
-       MonoDynamicTable *table;
-       guint32 *values;
-       guint32 token, mtoken = 0;
-
-       mono_error_init (error);
-       token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->methodspec, mb));
-       if (token)
-               return token;
-
-       table = &assembly->tables [MONO_TABLE_METHODSPEC];
-
-       mtoken = mono_image_get_methodref_token_for_methodbuilder (assembly, mb, error);
-       if (!mono_error_ok (error))
-               return 0;
-
-       switch (mono_metadata_token_table (mtoken)) {
-       case MONO_TABLE_MEMBERREF:
-               mtoken = (mono_metadata_token_index (mtoken) << MONO_METHODDEFORREF_BITS) | MONO_METHODDEFORREF_METHODREF;
-               break;
-       case MONO_TABLE_METHOD:
-               mtoken = (mono_metadata_token_index (mtoken) << MONO_METHODDEFORREF_BITS) | MONO_METHODDEFORREF_METHODDEF;
-               break;
-       default:
-               g_assert_not_reached ();
-       }
-
-       if (assembly->save) {
-               alloc_table (table, table->rows + 1);
-               values = table->values + table->next_idx * MONO_METHODSPEC_SIZE;
-               values [MONO_METHODSPEC_METHOD] = mtoken;
-               values [MONO_METHODSPEC_SIGNATURE] = mono_dynimage_encode_generic_method_definition_sig (assembly, mb);
-       }
-
-       token = MONO_TOKEN_METHOD_SPEC | table->next_idx;
-       table->next_idx ++;
-
-       mono_g_hash_table_insert (assembly->methodspec, mb, GUINT_TO_POINTER(token));
-       return token;
-}
-
-static guint32
-mono_image_get_methodbuilder_token (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *mb, gboolean create_methodspec, MonoError *error)
-{
-       guint32 token;
-
-       mono_error_init (error);
-
-       if (mb->generic_params && create_methodspec) 
-               return mono_image_get_methodspec_token_for_generic_method_definition (assembly, mb, error);
-
-       token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, mb));
-       if (token)
-               return token;
-
-       token = mono_image_get_methodref_token_for_methodbuilder (assembly, mb, error);
-       if (!mono_error_ok (error))
-               return 0;
-       mono_g_hash_table_insert (assembly->handleref_managed, mb, GUINT_TO_POINTER(token));
-       return token;
-}
-
-static guint32
-mono_image_get_ctorbuilder_token (MonoDynamicImage *assembly, MonoReflectionCtorBuilder *mb, MonoError *error)
-{
-       guint32 token, parent, sig;
-       ReflectionMethodBuilder rmb;
-       char *name;
-       MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mb->type;
-       
-       mono_error_init (error);
-       
-       token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, mb));
-       if (token)
-               return token;
-
-       if (!mono_reflection_methodbuilder_from_ctor_builder (&rmb, mb, error))
-               return 0;
-
-       if (tb->generic_params) {
-               parent = mono_dynimage_encode_generic_typespec (assembly, tb, error);
-               return_val_if_nok (error, 0);
-       } else {
-               MonoType * type = mono_reflection_type_get_handle ((MonoReflectionType*)tb, error);
-               return_val_if_nok (error, 0);
-               parent = mono_image_typedef_or_ref (assembly, type);
-       }
-       
-       name = mono_string_to_utf8_checked (rmb.name, error);
-       return_val_if_nok (error, 0);
-       sig = mono_dynimage_encode_method_builder_signature (assembly, &rmb, error);
-       return_val_if_nok (error, 0);
-
-       token = mono_image_add_memberef_row (assembly, parent, name, sig);
-
-       g_free (name);
-       mono_g_hash_table_insert (assembly->handleref_managed, mb, GUINT_TO_POINTER(token));
-       return token;
-}
 #endif
 
 static gboolean
 is_field_on_inst (MonoClassField *field)
 {
-       return field->parent->generic_class && field->parent->generic_class->is_dynamic;
+       return mono_class_is_ginst (field->parent) && mono_class_get_generic_class (field->parent)->is_dynamic;
 }
 
 #ifndef DISABLE_REFLECTION_EMIT
@@ -877,9 +721,9 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObject *f, MonoCl
        if (token)
                return token;
 
-       if (field->parent->generic_class && field->parent->generic_class->container_class && field->parent->generic_class->container_class->fields) {
+       if (mono_class_is_ginst (field->parent) && mono_class_get_generic_class (field->parent)->container_class && mono_class_get_generic_class (field->parent)->container_class->fields) {
                int index = field - field->parent->fields;
-               type = mono_field_get_type (&field->parent->generic_class->container_class->fields [index]);
+               type = mono_field_get_type (&mono_class_get_generic_class (field->parent)->container_class->fields [index]);
        } else {
                type = mono_field_get_type (field);
        }
@@ -890,221 +734,6 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoObject *f, MonoCl
        return token;
 }
 
-static guint32
-mono_image_get_field_on_inst_token (MonoDynamicImage *assembly, MonoReflectionFieldOnTypeBuilderInst *f, MonoError *error)
-{
-       guint32 token;
-       MonoClass *klass;
-       MonoGenericClass *gclass;
-       MonoType *type;
-       char *name;
-
-       token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, f));
-       if (token)
-               return token;
-       if (is_sre_field_builder (mono_object_class (f->fb))) {
-               MonoReflectionFieldBuilder *fb = (MonoReflectionFieldBuilder *)f->fb;
-               type = mono_reflection_type_get_handle ((MonoReflectionType*)f->inst, error);
-               return_val_if_nok (error, 0);
-               klass = mono_class_from_mono_type (type);
-               gclass = type->data.generic_class;
-               g_assert (gclass->is_dynamic);
-
-               guint32 sig_token = mono_dynimage_encode_field_signature (assembly, fb, error);
-               return_val_if_nok (error, 0);
-               name = mono_string_to_utf8_checked (fb->name, error);
-               return_val_if_nok (error, 0);
-               token = mono_image_get_memberref_token (assembly, &klass->byval_arg, name, sig_token);
-               g_free (name);          
-       } else if (is_sr_mono_field (mono_object_class (f->fb))) {
-               guint32 sig;
-               MonoClassField *field = ((MonoReflectionField *)f->fb)->field;
-
-               type = mono_reflection_type_get_handle ((MonoReflectionType*)f->inst, error);
-               return_val_if_nok (error, 0);
-               klass = mono_class_from_mono_type (type);
-
-               sig = mono_dynimage_encode_fieldref_signature (assembly, field->parent->image, field->type);
-               token = mono_image_get_memberref_token (assembly, &klass->byval_arg, field->name, sig);
-       } else {
-               char *name = mono_type_get_full_name (mono_object_class (f->fb));
-               g_error ("mono_image_get_field_on_inst_token: don't know how to handle %s", name);
-       }
-
-       mono_g_hash_table_insert (assembly->handleref_managed, f, GUINT_TO_POINTER (token));
-       return token;
-}
-
-static guint32
-mono_image_get_ctor_on_inst_token (MonoDynamicImage *assembly, MonoReflectionCtorOnTypeBuilderInst *c, gboolean create_methodspec, MonoError *error)
-{
-       guint32 sig, token;
-       MonoClass *klass;
-       MonoGenericClass *gclass;
-       MonoType *type;
-
-       mono_error_init (error);
-
-       /* A ctor cannot be a generic method, so we can ignore create_methodspec */
-
-       token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, c));
-       if (token)
-               return token;
-
-       if (mono_is_sre_ctor_builder (mono_object_class (c->cb))) {
-               MonoReflectionCtorBuilder *cb = (MonoReflectionCtorBuilder *)c->cb;
-               ReflectionMethodBuilder rmb;
-               char *name;
-
-               type = mono_reflection_type_get_handle ((MonoReflectionType*)c->inst, error);
-               return_val_if_nok (error, 0);
-               klass = mono_class_from_mono_type (type);
-
-               gclass = type->data.generic_class;
-               g_assert (gclass->is_dynamic);
-
-               if (!mono_reflection_methodbuilder_from_ctor_builder (&rmb, cb, error))
-                       return 0;
-
-               sig = mono_dynimage_encode_method_builder_signature (assembly, &rmb, error);
-               return_val_if_nok (error, 0);
-
-               name = mono_string_to_utf8_checked (rmb.name, error);
-               return_val_if_nok (error, 0);
-
-               token = mono_image_get_memberref_token (assembly, &klass->byval_arg, name, sig);
-               g_free (name);
-       } else if (mono_is_sr_mono_cmethod (mono_object_class (c->cb))) {
-               MonoMethod *mm = ((MonoReflectionMethod *)c->cb)->method;
-
-               type = mono_reflection_type_get_handle ((MonoReflectionType*)c->inst, error);
-               return_val_if_nok (error, 0);
-               klass = mono_class_from_mono_type (type);
-
-               sig = mono_dynimage_encode_method_signature (assembly, mono_method_signature (mm));
-               token = mono_image_get_memberref_token (assembly, &klass->byval_arg, mm->name, sig);
-       } else {
-               char *name = mono_type_get_full_name (mono_object_class (c->cb));
-               g_error ("mono_image_get_method_on_inst_token: don't know how to handle %s", name);
-       }
-
-
-       mono_g_hash_table_insert (assembly->handleref_managed, c, GUINT_TO_POINTER (token));
-       return token;
-}
-
-MonoMethod*
-mono_reflection_method_on_tb_inst_get_handle (MonoReflectionMethodOnTypeBuilderInst *m, MonoError *error)
-{
-       MonoClass *klass;
-       MonoGenericContext tmp_context;
-       MonoType **type_argv;
-       MonoGenericInst *ginst;
-       MonoMethod *method, *inflated;
-       int count, i;
-
-       mono_error_init (error);
-
-       mono_reflection_init_type_builder_generics ((MonoObject*)m->inst, error);
-       return_val_if_nok (error, NULL);
-
-       method = inflate_method (m->inst, (MonoObject*)m->mb, error);
-       return_val_if_nok (error, NULL);
-
-       klass = method->klass;
-
-       if (m->method_args == NULL)
-               return method;
-
-       if (method->is_inflated)
-               method = ((MonoMethodInflated *) method)->declaring;
-
-       count = mono_array_length (m->method_args);
-
-       type_argv = g_new0 (MonoType *, count);
-       for (i = 0; i < count; i++) {
-               MonoReflectionType *garg = (MonoReflectionType *)mono_array_get (m->method_args, gpointer, i);
-               type_argv [i] = mono_reflection_type_get_handle (garg, error);
-               return_val_if_nok (error, NULL);
-       }
-       ginst = mono_metadata_get_generic_inst (count, type_argv);
-       g_free (type_argv);
-
-       tmp_context.class_inst = klass->generic_class ? klass->generic_class->context.class_inst : NULL;
-       tmp_context.method_inst = ginst;
-
-       inflated = mono_class_inflate_generic_method_checked (method, &tmp_context, error);
-       mono_error_assert_ok (error);
-       return inflated;
-}
-
-static guint32
-mono_image_get_method_on_inst_token (MonoDynamicImage *assembly, MonoReflectionMethodOnTypeBuilderInst *m, gboolean create_methodspec, MonoError *error)
-{
-       guint32 sig, token = 0;
-       MonoType *type;
-       MonoClass *klass;
-
-       mono_error_init (error);
-
-       if (m->method_args) {
-               MonoMethod *inflated;
-
-               inflated = mono_reflection_method_on_tb_inst_get_handle (m, error);
-               return_val_if_nok (error, 0);
-
-               if (create_methodspec)
-                       token = mono_image_get_methodspec_token (assembly, inflated);
-               else
-                       token = mono_image_get_inflated_method_token (assembly, inflated);
-               return token;
-       }
-
-       token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, m));
-       if (token)
-               return token;
-
-       if (is_sre_method_builder (mono_object_class (m->mb))) {
-               MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder *)m->mb;
-               MonoGenericClass *gclass;
-               ReflectionMethodBuilder rmb;
-               char *name;
-
-               type = mono_reflection_type_get_handle ((MonoReflectionType*)m->inst, error);
-               return_val_if_nok (error, 0);
-               klass = mono_class_from_mono_type (type);
-               gclass = type->data.generic_class;
-               g_assert (gclass->is_dynamic);
-
-               if (!mono_reflection_methodbuilder_from_method_builder (&rmb, mb, error))
-                       return 0;
-
-               sig = mono_dynimage_encode_method_builder_signature (assembly, &rmb, error);
-               return_val_if_nok (error, 0);
-
-               name = mono_string_to_utf8_checked (rmb.name, error);
-               return_val_if_nok (error, 0);
-
-               token = mono_image_get_memberref_token (assembly, &klass->byval_arg, name, sig);
-               g_free (name);          
-       } else if (is_sr_mono_method (mono_object_class (m->mb))) {
-               MonoMethod *mm = ((MonoReflectionMethod *)m->mb)->method;
-
-               type = mono_reflection_type_get_handle ((MonoReflectionType*)m->inst, error);
-               return_val_if_nok (error, 0);
-               klass = mono_class_from_mono_type (type);
-
-               sig = mono_dynimage_encode_method_signature (assembly, mono_method_signature (mm));
-               token = mono_image_get_memberref_token (assembly, &klass->byval_arg, mm->name, sig);
-       } else {
-               char *name = mono_type_get_full_name (mono_object_class (m->mb));
-               g_error ("mono_image_get_method_on_inst_token: don't know how to handle %s", name);
-       }
-
-       mono_g_hash_table_insert (assembly->handleref_managed, m, GUINT_TO_POINTER (token));
-       return token;
-}
-
 static guint32
 method_encode_methodspec (MonoDynamicImage *assembly, MonoMethod *method)
 {
@@ -1191,138 +820,6 @@ mono_image_get_inflated_method_token (MonoDynamicImage *assembly, MonoMethod *m)
        return token;
 }
 
-/*
- * Return a copy of TYPE, adding the custom modifiers in MODREQ and MODOPT.
- */
-static MonoType*
-add_custom_modifiers (MonoDynamicImage *assembly, MonoType *type, MonoArray *modreq, MonoArray *modopt, MonoError *error)
-{
-       int i, count, len, pos;
-       MonoType *t;
-
-       mono_error_init (error);
-
-       count = 0;
-       if (modreq)
-               count += mono_array_length (modreq);
-       if (modopt)
-               count += mono_array_length (modopt);
-
-       if (count == 0)
-               return mono_metadata_type_dup (NULL, type);
-
-       len = MONO_SIZEOF_TYPE + ((gint32)count) * sizeof (MonoCustomMod);
-       t = (MonoType *)g_malloc (len);
-       memcpy (t, type, MONO_SIZEOF_TYPE);
-
-       t->num_mods = count;
-       pos = 0;
-       if (modreq) {
-               for (i = 0; i < mono_array_length (modreq); ++i) {
-                       MonoType *mod = mono_type_array_get_and_resolve (modreq, i, error);
-                       if (!is_ok (error))
-                               goto fail;
-                       t->modifiers [pos].required = 1;
-                       t->modifiers [pos].token = mono_image_typedef_or_ref (assembly, mod);
-                       pos ++;
-               }
-       }
-       if (modopt) {
-               for (i = 0; i < mono_array_length (modopt); ++i) {
-                       MonoType *mod = mono_type_array_get_and_resolve (modopt, i, error);
-                       if (!is_ok (error))
-                               goto fail;
-                       t->modifiers [pos].required = 0;
-                       t->modifiers [pos].token = mono_image_typedef_or_ref (assembly, mod);
-                       pos ++;
-               }
-       }
-
-       return t;
-fail:
-       g_free (t);
-       return NULL;
-}
-
-void
-mono_reflection_init_type_builder_generics (MonoObject *type, MonoError *error)
-{
-       MonoReflectionTypeBuilder *tb;
-
-       mono_error_init (error);
-
-       if (!is_sre_type_builder(mono_object_class (type)))
-               return;
-       tb = (MonoReflectionTypeBuilder *)type;
-
-       if (tb && tb->generic_container)
-               mono_reflection_create_generic_class (tb, error);
-}
-
-static guint32
-mono_image_get_generic_field_token (MonoDynamicImage *assembly, MonoReflectionFieldBuilder *fb, MonoError *error)
-{
-       MonoDynamicTable *table;
-       MonoType *custom = NULL, *type;
-       guint32 *values;
-       guint32 token, pclass, parent, sig;
-       gchar *name;
-
-       mono_error_init (error);
-
-       token = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->handleref_managed, fb));
-       if (token)
-               return token;
-
-       MonoType *typeb = mono_reflection_type_get_handle (fb->typeb, error);
-       return_val_if_nok (error, 0);
-       /* FIXME: is this call necessary? */
-       mono_class_from_mono_type (typeb);
-
-       /*FIXME this is one more layer of ugliness due how types are created.*/
-       mono_reflection_init_type_builder_generics (fb->type, error);
-       return_val_if_nok (error, 0);
-
-       /* fb->type does not include the custom modifiers */
-       /* FIXME: We should do this in one place when a fieldbuilder is created */
-       type = mono_reflection_type_get_handle ((MonoReflectionType*)fb->type, error);
-       return_val_if_nok (error, 0);
-
-       if (fb->modreq || fb->modopt) {
-               type = custom = add_custom_modifiers (assembly, type, fb->modreq, fb->modopt, error);
-               return_val_if_nok (error, 0);
-       }
-
-       sig = mono_dynimage_encode_fieldref_signature (assembly, NULL, type);
-       g_free (custom);
-
-       parent = mono_dynimage_encode_generic_typespec (assembly, (MonoReflectionTypeBuilder *) fb->typeb, error);
-       return_val_if_nok (error, 0);
-       g_assert ((parent & MONO_TYPEDEFORREF_MASK) == MONO_TYPEDEFORREF_TYPESPEC);
-       
-       pclass = MONO_MEMBERREF_PARENT_TYPESPEC;
-       parent >>= MONO_TYPEDEFORREF_BITS;
-
-       table = &assembly->tables [MONO_TABLE_MEMBERREF];
-
-       name = mono_string_to_utf8_checked (fb->name, error);
-       return_val_if_nok (error, 0);
-
-       if (assembly->save) {
-               alloc_table (table, table->rows + 1);
-               values = table->values + table->next_idx * MONO_MEMBERREF_SIZE;
-               values [MONO_MEMBERREF_CLASS] = pclass | (parent << MONO_MEMBERREF_PARENT_BITS);
-               values [MONO_MEMBERREF_NAME] = string_heap_insert (&assembly->sheap, name);
-               values [MONO_MEMBERREF_SIGNATURE] = sig;
-       }
-
-       token = MONO_TOKEN_MEMBER_REF | table->next_idx;
-       table->next_idx ++;
-       mono_g_hash_table_insert (assembly->handleref_managed, fb, GUINT_TO_POINTER(token));
-       g_free (name);
-       return token;
-}
-
 static guint32 
 mono_image_get_sighelper_token (MonoDynamicImage *assembly, MonoReflectionSigHelper *helper, MonoError *error)
 {
@@ -1573,6 +1070,10 @@ mono_image_create_method_token (MonoDynamicImage *assembly, MonoObject *obj, Mon
                        if (!is_ok (error)) goto fail;
                }
 
+               // FIXME: This doesn't work, we don't use 'sig' for anything
+               // The token fixup doesn't work either
+               g_assert_not_reached ();
+
                sig_token = mono_dynimage_encode_method_builder_signature (assembly, &rmb, error);
                if (!is_ok (error))
                        goto fail;
@@ -1632,81 +1133,14 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObject *obj,
                return 0;
        }
 
-       if (strcmp (klass->name, "MethodBuilder") == 0) {
-               MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder *)obj;
-               MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)mb->type;
-
-               if (tb->module->dynamic_image == assembly && !tb->generic_params && !mb->generic_params)
-                       token = mb->table_idx | MONO_TOKEN_METHOD_DEF;
-               else {
-                       token = mono_image_get_methodbuilder_token (assembly, mb, create_open_instance, error);
-                       if (!mono_error_ok (error))
-                               return 0;
-               }
-               /*g_print ("got token 0x%08x for %s\n", token, mono_string_to_utf8 (mb->name));*/
-       } else if (strcmp (klass->name, "ConstructorBuilder") == 0) {
-               MonoReflectionCtorBuilder *mb = (MonoReflectionCtorBuilder *)obj;
-               MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)mb->type;
-
-               if (tb->module->dynamic_image == assembly && !tb->generic_params)
-                       token = mb->table_idx | MONO_TOKEN_METHOD_DEF;
-               else {
-                       token = mono_image_get_ctorbuilder_token (assembly, mb, error);
-                       if (!mono_error_ok (error))
-                               return 0;
-               }
-               /*g_print ("got token 0x%08x for %s\n", token, mono_string_to_utf8 (mb->name));*/
-       } else if (strcmp (klass->name, "FieldBuilder") == 0) {
-               MonoReflectionFieldBuilder *fb = (MonoReflectionFieldBuilder *)obj;
-               MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)fb->typeb;
-               if (tb->generic_params) {
-                       token = mono_image_get_generic_field_token (assembly, fb, error);
-                       return_val_if_nok (error, 0);
-               } else {
-                       if (tb->module->dynamic_image == assembly) {
-                               token = fb->table_idx | MONO_TOKEN_FIELD_DEF;
-                       } else {
-                               token = mono_image_get_fieldref_token (assembly, (MonoObject*)fb, fb->handle);
-                       }
-               }
-       } else if (strcmp (klass->name, "TypeBuilder") == 0) {
-               MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)obj;
-               if (create_open_instance && tb->generic_params) {
-                       MonoType *type;
-                       mono_reflection_init_type_builder_generics (obj, error);
-                       return_val_if_nok (error, 0);
-                       type = mono_reflection_type_get_handle ((MonoReflectionType *)obj, error);
-                       return_val_if_nok (error, 0);
-                       token = mono_dynimage_encode_typedef_or_ref_full (assembly, type, TRUE);
-                       token = mono_metadata_token_from_dor (token);
-               } else if (tb->module->dynamic_image == assembly) {
-                       token = tb->table_idx | MONO_TOKEN_TYPE_DEF;
-               } else {
-                       MonoType *type;
-                       type = mono_reflection_type_get_handle ((MonoReflectionType *)obj, error);
-                       return_val_if_nok (error, 0);
-                       token = mono_metadata_token_from_dor (mono_image_typedef_or_ref (assembly, type));
-               }
-       } else if (strcmp (klass->name, "RuntimeType") == 0) {
+       if (strcmp (klass->name, "RuntimeType") == 0) {
                MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType *)obj, error);
                return_val_if_nok (error, 0);
                MonoClass *mc = mono_class_from_mono_type (type);
                token = mono_metadata_token_from_dor (
-                       mono_dynimage_encode_typedef_or_ref_full (assembly, type, mc->generic_container == NULL || create_open_instance));
-       } else if (strcmp (klass->name, "GenericTypeParameterBuilder") == 0) {
-               MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType *)obj, error);
-               return_val_if_nok (error, 0);
-               token = mono_metadata_token_from_dor (
-                       mono_image_typedef_or_ref (assembly, type));
-       } else if (strcmp (klass->name, "MonoGenericClass") == 0) {
-               MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType *)obj, error);
-               return_val_if_nok (error, 0);
-               token = mono_metadata_token_from_dor (
-                       mono_image_typedef_or_ref (assembly, type));
+                       mono_dynimage_encode_typedef_or_ref_full (assembly, type, !mono_class_is_gtd (mc) || create_open_instance));
        } else if (strcmp (klass->name, "MonoCMethod") == 0 ||
-                  strcmp (klass->name, "MonoMethod") == 0 ||
-                  strcmp (klass->name, "MonoGenericMethod") == 0 ||
-                  strcmp (klass->name, "MonoGenericCMethod") == 0) {
+                          strcmp (klass->name, "MonoMethod") == 0) {
                MonoReflectionMethod *m = (MonoReflectionMethod *)obj;
                if (m->method->is_inflated) {
                        if (create_open_instance)
@@ -1714,7 +1148,7 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObject *obj,
                        else
                                token = mono_image_get_inflated_method_token (assembly, m->method);
                } else if ((m->method->klass->image == &assembly->image) &&
-                        !m->method->klass->generic_class) {
+                        !mono_class_is_ginst (m->method->klass)) {
                        static guint32 method_table_idx = 0xffffff;
                        if (m->method->klass->wastypebuilder) {
                                /* we use the same token as the one that was assigned
@@ -1758,25 +1192,6 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObject *obj,
                return_val_if_nok (error, 0);
                token = mono_metadata_token_from_dor (
                        mono_image_typedef_or_ref (assembly, type));
-       } else if (strcmp (klass->name, "FieldOnTypeBuilderInst") == 0) {
-               MonoReflectionFieldOnTypeBuilderInst *f = (MonoReflectionFieldOnTypeBuilderInst*)obj;
-               token = mono_image_get_field_on_inst_token (assembly, f, error);
-               return_val_if_nok (error, 0);
-       } else if (strcmp (klass->name, "ConstructorOnTypeBuilderInst") == 0) {
-               MonoReflectionCtorOnTypeBuilderInst *c = (MonoReflectionCtorOnTypeBuilderInst*)obj;
-               token = mono_image_get_ctor_on_inst_token (assembly, c, create_open_instance, error);
-               if (!mono_error_ok (error))
-                       return 0;
-       } else if (strcmp (klass->name, "MethodOnTypeBuilderInst") == 0) {
-               MonoReflectionMethodOnTypeBuilderInst *m = (MonoReflectionMethodOnTypeBuilderInst*)obj;
-               token = mono_image_get_method_on_inst_token (assembly, m, create_open_instance, error);
-               if (!mono_error_ok (error))
-                       return 0;
-       } else if (is_sre_array (klass) || is_sre_byref (klass) || is_sre_pointer (klass)) {
-               MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType *)obj, error);
-               return_val_if_nok (error, 0);
-               token = mono_metadata_token_from_dor (
-                               mono_image_typedef_or_ref (assembly, type));
        } else {
                g_error ("requested token for %s\n", klass->name);
        }
@@ -1996,7 +1411,7 @@ is_sre_pointer (MonoClass *klass)
 static gboolean
 is_sre_generic_instance (MonoClass *klass)
 {
-       check_corlib_type_cached (klass, "System.Reflection", "MonoGenericClass");
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "TypeBuilderInstantiation");
 }
 
 static gboolean
@@ -2023,6 +1438,18 @@ is_sre_field_builder (MonoClass *klass)
        check_corlib_type_cached (klass, "System.Reflection.Emit", "FieldBuilder");
 }
 
+static gboolean
+is_sre_gparam_builder (MonoClass *klass)
+{
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "GenericTypeParameterBuilder");
+}
+
+static gboolean
+is_sre_enum_builder (MonoClass *klass)
+{
+       check_corlib_type_cached (klass, "System.Reflection.Emit", "EnumBuilder");
+}
+
 gboolean
 mono_is_sre_method_on_tb_inst (MonoClass *klass)
 {
@@ -2126,60 +1553,64 @@ mono_reflection_type_get_handle (MonoReflectionType* ref, MonoError *error)
                g_assert (res);
                gclass->type.type = res;
                return res;
-       }
+       } else if (is_sre_gparam_builder (klass)) {
+               MonoReflectionGenericParam *gparam = (MonoReflectionGenericParam *)ref;
+               MonoGenericParamFull *param;
+               MonoImage *image;
+               MonoClass *pklass;
 
-       g_error ("Cannot handle corlib user type %s", mono_type_full_name (&mono_object_class(ref)->byval_arg));
-       return NULL;
-}
+               image = &gparam->tbuilder->module->dynamic_image->image;
 
-void
-ves_icall_SymbolType_create_unmanaged_type (MonoReflectionType *type)
-{
-       MonoError error;
-       mono_reflection_type_get_handle (type, &error);
-       mono_error_set_pending_exception (&error);
-}
+               param = mono_image_new0 (image, MonoGenericParamFull, 1);
 
-static gboolean
-reflection_register_with_runtime (MonoReflectionType *type, MonoError *error)
-{
-       MonoDomain *domain = mono_object_domain ((MonoObject*)type);
-       MonoClass *klass;
+               param->info.name = mono_string_to_utf8_image (image, gparam->name, error);
+               mono_error_assert_ok (error);
+               param->param.num = gparam->index;
 
-       mono_error_init (error);
+               if (gparam->mbuilder) {
+                       if (!gparam->mbuilder->generic_container) {
+                               gparam->mbuilder->generic_container = (MonoGenericContainer *)mono_image_alloc0 (image, sizeof (MonoGenericContainer));
+                               gparam->mbuilder->generic_container->is_method = TRUE;
+                               /*
+                                * Cannot set owner.method, since the MonoMethod is not created yet.
+                                * Set the image field instead, so type_in_image () works.
+                                */
+                               gparam->mbuilder->generic_container->is_anonymous = TRUE;
+                               gparam->mbuilder->generic_container->owner.image = image;
+                       }
+                       param->param.owner = gparam->mbuilder->generic_container;
+               } else if (gparam->tbuilder) {
+                       MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)(gparam->tbuilder), error);
+                       mono_error_assert_ok (error);
+                       MonoClass *owner = mono_class_from_mono_type (type);
+                       g_assert (mono_class_is_gtd (owner));
+                       param->param.owner = mono_class_get_generic_container (owner);
+               }
 
-       MonoType *res = mono_reflection_type_get_handle (type, error);
+               pklass = mono_class_from_generic_parameter_internal ((MonoGenericParam *) param);
 
-       if (!res && is_ok (error)) {
-               mono_error_set_argument (error, NULL, "Invalid generic instantiation, one or more arguments are not proper user types");
-       }
-       return_val_if_nok (error, FALSE);
+               gparam->type.type = &pklass->byval_arg;
 
-       klass = mono_class_from_mono_type (res);
+               mono_class_set_ref_info (pklass, gparam);
+               mono_image_append_class_to_reflection_info_set (pklass);
 
-       mono_loader_lock (); /*same locking as mono_type_get_object_checked */
-       mono_domain_lock (domain);
+               return &pklass->byval_arg;
+       } else if (is_sre_enum_builder (klass)) {
+               MonoReflectionEnumBuilder *ebuilder = (MonoReflectionEnumBuilder *)ref;
 
-       if (!image_is_dynamic (klass->image)) {
-               mono_class_setup_supertypes (klass);
-       } else {
-               if (!domain->type_hash)
-                       domain->type_hash = mono_g_hash_table_new_type ((GHashFunc)mono_metadata_type_hash, 
-                                       (GCompareFunc)mono_metadata_type_equal, MONO_HASH_VALUE_GC, MONO_ROOT_SOURCE_DOMAIN, "domain reflection types table");
-               mono_g_hash_table_insert (domain->type_hash, res, type);
-       }
-       mono_domain_unlock (domain);
-       mono_loader_unlock ();
+               return mono_reflection_type_get_handle ((MonoReflectionType*)ebuilder->tb, error);
+       } else if (is_sre_type_builder (klass)) {
+               MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)ref;
 
-       return TRUE;
-}
+               /* This happens when a finished type references an unfinished one. Have to create the minimal type */
+               reflection_setup_internal_class (tb, error);
+               mono_error_assert_ok (error);
+               g_assert (ref->type);
+               return ref->type;
+       }
 
-void
-mono_reflection_register_with_runtime (MonoReflectionType *type)
-{
-       MonoError error;
-       (void) reflection_register_with_runtime (type, &error);
-       mono_error_set_pending_exception (&error);
+       g_error ("Cannot handle corlib user type %s", mono_type_full_name (&mono_object_class(ref)->byval_arg));
+       return NULL;
 }
 
 /**
@@ -2309,12 +1740,6 @@ get_field_name_and_type (MonoObject *field, char **name, MonoType **type, MonoEr
 
 #else /* DISABLE_REFLECTION_EMIT */
 
-void
-mono_reflection_register_with_runtime (MonoReflectionType *type)
-{
-       /* This is empty */
-}
-
 static gboolean
 is_sre_type_builder (MonoClass *klass)
 {
@@ -2345,12 +1770,6 @@ mono_is_sre_ctor_on_tb_inst (MonoClass *klass)
        return FALSE;
 }
 
-void
-mono_reflection_init_type_builder_generics (MonoObject *type, MonoError *error)
-{
-       mono_error_init (error);
-}
-
 #endif /* !DISABLE_REFLECTION_EMIT */
 
 
@@ -2378,22 +1797,10 @@ mono_is_sr_mono_cmethod (MonoClass *klass)
        check_corlib_type_cached (klass, "System.Reflection", "MonoCMethod");
 }
 
-static gboolean
-is_sr_mono_generic_method (MonoClass *klass)
-{
-       check_corlib_type_cached (klass, "System.Reflection", "MonoGenericMethod");
-}
-
-static gboolean
-is_sr_mono_generic_cmethod (MonoClass *klass)
-{
-       check_corlib_type_cached (klass, "System.Reflection", "MonoGenericCMethod");
-}
-
 gboolean
 mono_class_is_reflection_method_or_constructor (MonoClass *klass)
 {
-       return is_sr_mono_method (klass) || mono_is_sr_mono_cmethod (klass) || is_sr_mono_generic_method (klass) || is_sr_mono_generic_cmethod (klass);
+       return is_sr_mono_method (klass) || mono_is_sr_mono_cmethod (klass);
 }
 
 gboolean
@@ -2891,7 +2298,13 @@ reflection_setup_internal_class (MonoReflectionTypeBuilder *tb, MonoError *error
                return TRUE;
        }
 
-       klass = (MonoClass *)mono_image_alloc0 (&tb->module->dynamic_image->image, sizeof (MonoClass));
+       /*
+        * The size calculation here warrants some explaining. 
+        * reflection_setup_internal_class is called too early, well before we know whether the type will be a GTD or DEF,
+        * meaning we need to alloc enough space to morth a def into a gtd.
+        */
+       klass = (MonoClass *)mono_image_alloc0 (&tb->module->dynamic_image->image, MAX (sizeof (MonoClassDef), sizeof (MonoClassGtd)));
+       klass->class_kind = MONO_CLASS_DEF;
 
        klass->image = &tb->module->dynamic_image->image;
 
@@ -2903,7 +2316,7 @@ reflection_setup_internal_class (MonoReflectionTypeBuilder *tb, MonoError *error
        if (!is_ok (error))
                goto failure;
        klass->type_token = MONO_TOKEN_TYPE_DEF | tb->table_idx;
-       klass->flags = tb->attrs;
+       mono_class_set_flags (klass, tb->attrs);
        
        mono_profiler_class_event (klass, MONO_PROFILE_START_LOAD);
 
@@ -2959,6 +2372,7 @@ reflection_setup_internal_class (MonoReflectionTypeBuilder *tb, MonoError *error
        tb->type.type = &klass->byval_arg;
 
        if (tb->nesting_type) {
+               reflection_setup_internal_class ((MonoReflectionTypeBuilder*)tb->nesting_type, error);
                g_assert (tb->nesting_type->type);
                MonoType *nesting_type = mono_reflection_type_get_handle (tb->nesting_type, error);
                if (!is_ok (error)) goto failure;
@@ -2978,73 +2392,55 @@ failure:
 }
 
 /**
- * ves_icall_TypeBuilder_setup_internal_class:
- * @tb: a TypeBuilder object
- *
- * (icall)
- * Creates a MonoClass that represents the TypeBuilder.
- * This is a trick that lets us simplify a lot of reflection code
- * (and will allow us to support Build and Run assemblies easier).
- *
- */
-void
-ves_icall_TypeBuilder_setup_internal_class (MonoReflectionTypeBuilder *tb)
-{
-       MonoError error;
-       (void) reflection_setup_internal_class (tb, &error);
-       mono_error_set_pending_exception (&error);
-}
-
-/**
- * mono_reflection_create_generic_class:
+ * reflection_create_generic_class:
  * @tb: a TypeBuilder object
  * @error: set on error
  *
  * Creates the generic class after all generic parameters have been added.
  * On success returns TRUE, on failure returns FALSE and sets @error.
- * 
  */
-gboolean
-mono_reflection_create_generic_class (MonoReflectionTypeBuilder *tb, MonoError *error)
+static gboolean
+reflection_create_generic_class (MonoReflectionTypeBuilder *tb, MonoError *error)
 {
-
        MonoClass *klass;
        int count, i;
 
        mono_error_init (error);
 
+       reflection_setup_internal_class (tb, error);
+
        klass = mono_class_from_mono_type (tb->type.type);
 
        count = tb->generic_params ? mono_array_length (tb->generic_params) : 0;
 
-       if (klass->generic_container || (count == 0))
+       if (count == 0)
                return TRUE;
 
-       g_assert (tb->generic_container && (tb->generic_container->owner.klass == klass));
+       MonoGenericContainer *generic_container = (MonoGenericContainer *)mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer));
 
-       klass->generic_container = (MonoGenericContainer *)mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer));
+       generic_container->owner.klass = klass;
+       generic_container->type_argc = count;
+       generic_container->type_params = (MonoGenericParamFull *)mono_image_alloc0 (klass->image, sizeof (MonoGenericParamFull) * count);
 
-       klass->generic_container->owner.klass = klass;
-       klass->generic_container->type_argc = count;
-       klass->generic_container->type_params = (MonoGenericParamFull *)mono_image_alloc0 (klass->image, sizeof (MonoGenericParamFull) * count);
+       klass->class_kind = MONO_CLASS_GTD;
+       mono_class_set_generic_container (klass, generic_container);
 
-       klass->is_generic = 1;
 
        for (i = 0; i < count; i++) {
                MonoReflectionGenericParam *gparam = (MonoReflectionGenericParam *)mono_array_get (tb->generic_params, gpointer, i);
                MonoType *param_type = mono_reflection_type_get_handle ((MonoReflectionType*)gparam, error);
                return_val_if_nok (error, FALSE);
                MonoGenericParamFull *param = (MonoGenericParamFull *) param_type->data.generic_param;
-               klass->generic_container->type_params [i] = *param;
+               generic_container->type_params [i] = *param;
                /*Make sure we are a diferent type instance */
-               klass->generic_container->type_params [i].param.owner = klass->generic_container;
-               klass->generic_container->type_params [i].info.pklass = NULL;
-               klass->generic_container->type_params [i].info.flags = gparam->attrs;
+               generic_container->type_params [i].param.owner = generic_container;
+               generic_container->type_params [i].info.pklass = NULL;
+               generic_container->type_params [i].info.flags = gparam->attrs;
 
-               g_assert (klass->generic_container->type_params [i].param.owner);
+               g_assert (generic_container->type_params [i].param.owner);
        }
 
-       klass->generic_container->context.class_inst = mono_get_shared_generic_inst (klass->generic_container);
+       generic_container->context.class_inst = mono_get_shared_generic_inst (generic_container);
        return TRUE;
 }
 
@@ -3185,7 +2581,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
        image = dynamic ? NULL : klass->image;
 
        if (!dynamic)
-               g_assert (!klass->generic_class);
+               g_assert (!mono_class_is_ginst (klass));
 
        mono_loader_lock ();
 
@@ -3292,14 +2688,14 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
 
        if (rmb->generic_params) {
                int count = mono_array_length (rmb->generic_params);
-               MonoGenericContainer *container = rmb->generic_container;
-
-               g_assert (container);
+               MonoGenericContainer *container;
 
+               container = (MonoGenericContainer *)mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer));
+               container->is_method = TRUE;
+               container->is_anonymous = FALSE;
                container->type_argc = count;
                container->type_params = image_g_new0 (image, MonoGenericParamFull, count);
                container->owner.method = m;
-               container->is_anonymous = FALSE; // Method is now known, container is no longer anonymous
 
                m->is_generic = TRUE;
                mono_method_set_generic_container (m, container);
@@ -3311,6 +2707,12 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
                        mono_error_assert_ok (error);
                        MonoGenericParamFull *param = (MonoGenericParamFull *) gp_type->data.generic_param;
                        container->type_params [i] = *param;
+                       container->type_params [i].param.owner = container;
+
+                       gp->type.type->data.generic_param = (MonoGenericParam*)&container->type_params [i];
+
+                       MonoClass *gklass = mono_class_from_mono_type (gp_type);
+                       gklass->wastypebuilder = TRUE;
                }
 
                /*
@@ -3330,9 +2732,9 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass,
                        }
                }
 
-               if (klass->generic_container) {
-                       container->parent = klass->generic_container;
-                       container->context.class_inst = klass->generic_container->context.class_inst;
+               if (mono_class_is_gtd (klass)) {
+                       container->parent = mono_class_get_generic_container (klass);
+                       container->context.class_inst = mono_class_get_generic_container (klass)->context.class_inst;
                }
                container->context.method_inst = mono_get_shared_generic_inst (container);
        }
@@ -3442,20 +2844,20 @@ ctorbuilder_to_mono_method (MonoClass *klass, MonoReflectionCtorBuilder* mb, Mon
        MonoMethodSignature *sig;
 
        mono_loader_lock ();
+
+       if (!mono_reflection_methodbuilder_from_ctor_builder (&rmb, mb, error))
+               return NULL;
+
        g_assert (klass->image != NULL);
        sig = ctor_builder_to_signature (klass->image, mb, error);
        mono_loader_unlock ();
        return_val_if_nok (error, NULL);
 
-       if (!mono_reflection_methodbuilder_from_ctor_builder (&rmb, mb, error))
-               return NULL;
-
        mb->mhandle = reflection_methodbuilder_to_mono_method (klass, &rmb, sig, error);
        return_val_if_nok (error, NULL);
        mono_save_custom_attrs (klass->image, mb->mhandle, mb->cattrs);
 
-       /* If we are in a generic class, we might be called multiple times from inflate_method */
-       if (!((MonoDynamicImage*)(MonoDynamicImage*)klass->image)->save && !klass->generic_container) {
+       if (!((MonoDynamicImage*)(MonoDynamicImage*)klass->image)->save) {
                /* ilgen is no longer needed */
                mb->ilgen = NULL;
        }
@@ -3472,153 +2874,27 @@ methodbuilder_to_mono_method (MonoClass *klass, MonoReflectionMethodBuilder* mb,
        mono_error_init (error);
 
        mono_loader_lock ();
+
+       if (!mono_reflection_methodbuilder_from_method_builder (&rmb, mb, error))
+               return NULL;
+
        g_assert (klass->image != NULL);
        sig = method_builder_to_signature (klass->image, mb, error);
        mono_loader_unlock ();
        return_val_if_nok (error, NULL);
 
-       if (!mono_reflection_methodbuilder_from_method_builder (&rmb, mb, error))
-               return NULL;
-
        mb->mhandle = reflection_methodbuilder_to_mono_method (klass, &rmb, sig, error);
        return_val_if_nok (error, NULL);
        mono_save_custom_attrs (klass->image, mb->mhandle, mb->cattrs);
 
-       /* If we are in a generic class, we might be called multiple times from inflate_method */
-       if (!((MonoDynamicImage*)(MonoDynamicImage*)klass->image)->save && !klass->generic_container) {
+       if (!((MonoDynamicImage*)(MonoDynamicImage*)klass->image)->save)
                /* ilgen is no longer needed */
                mb->ilgen = NULL;
-       }
-       return mb->mhandle;
-}
-#endif
-
-#ifndef DISABLE_REFLECTION_EMIT
-
-static MonoMethod *
-inflate_mono_method (MonoClass *klass, MonoMethod *method, MonoObject *obj)
-{
-       MonoMethodInflated *imethod;
-       MonoGenericContext *context;
-       int i;
-
-       /*
-        * With generic code sharing the klass might not be inflated.
-        * This can happen because classes inflated with their own
-        * type arguments are "normalized" to the uninflated class.
-        */
-       if (!klass->generic_class)
-               return method;
-
-       context = mono_class_get_context (klass);
-
-       if (klass->method.count && klass->methods) {
-               /* Find the already created inflated method */
-               for (i = 0; i < klass->method.count; ++i) {
-                       g_assert (klass->methods [i]->is_inflated);
-                       if (((MonoMethodInflated*)klass->methods [i])->declaring == method)
-                               break;
-               }
-               g_assert (i < klass->method.count);
-               imethod = (MonoMethodInflated*)klass->methods [i];
-       } else {
-               MonoError error;
-               imethod = (MonoMethodInflated *) mono_class_inflate_generic_method_full_checked (method, klass, context, &error);
-               mono_error_assert_ok (&error);
-       }
-
-       if (method->is_generic && image_is_dynamic (method->klass->image)) {
-               MonoDynamicImage *image = (MonoDynamicImage*)method->klass->image;
-
-               mono_image_lock ((MonoImage*)image);
-               mono_g_hash_table_insert (image->generic_def_objects, imethod, obj);
-               mono_image_unlock ((MonoImage*)image);
-       }
-       return (MonoMethod *) imethod;
-}
-
-static MonoMethod *
-inflate_method (MonoReflectionType *type, MonoObject *obj, MonoError *error)
-{
-       MonoMethod *method;
-       MonoClass *gklass;
-
-       mono_error_init (error);
-
-       MonoClass *type_class = mono_object_class (type);
-
-       if (is_sre_generic_instance (type_class)) {
-               MonoReflectionGenericClass *mgc = (MonoReflectionGenericClass*)type;
-               MonoType *generic_type = mono_reflection_type_get_handle ((MonoReflectionType*)mgc->generic_type, error);
-               return_val_if_nok (error, NULL);
-               gklass = mono_class_from_mono_type (generic_type);
-       } else if (is_sre_type_builder (type_class)) {
-               MonoType *t = mono_reflection_type_get_handle (type, error);
-               return_val_if_nok (error, NULL);
-               gklass = mono_class_from_mono_type (t);
-       } else if (type->type) {
-               gklass = mono_class_from_mono_type (type->type);
-               gklass = mono_class_get_generic_type_definition (gklass);
-       } else {
-               g_error ("Can't handle type %s", mono_type_get_full_name (mono_object_class (type)));
-       }
-
-       if (!strcmp (obj->vtable->klass->name, "MethodBuilder"))
-               if (((MonoReflectionMethodBuilder*)obj)->mhandle)
-                       method = ((MonoReflectionMethodBuilder*)obj)->mhandle;
-               else {
-                       method = methodbuilder_to_mono_method (gklass, (MonoReflectionMethodBuilder *) obj, error);
-                       if (!method)
-                               return NULL;
-               }
-       else if (!strcmp (obj->vtable->klass->name, "ConstructorBuilder")) {
-               method = ctorbuilder_to_mono_method (gklass, (MonoReflectionCtorBuilder *) obj, error);
-               if (!method)
-                       return NULL;
-       } else if (!strcmp (obj->vtable->klass->name, "MonoMethod") || !strcmp (obj->vtable->klass->name, "MonoCMethod"))
-               method = ((MonoReflectionMethod *) obj)->method;
-       else {
-               method = NULL; /* prevent compiler warning */
-               g_error ("can't handle type %s", obj->vtable->klass->name);
-       }
-
-       MonoType *t = mono_reflection_type_get_handle (type, error);
-       return_val_if_nok (error, NULL);
-       return inflate_mono_method (mono_class_from_mono_type (t), method, obj);
-}
-
-static void
-reflection_generic_class_initialize (MonoReflectionGenericClass *type, MonoError *error)
-{
-       MonoGenericClass *gclass;
-       MonoClass *klass, *gklass;
-       MonoType *gtype;
-
-       mono_error_init (error);
-
-       gtype = mono_reflection_type_get_handle ((MonoReflectionType*)type, error);
-       return_if_nok (error);
-       klass = mono_class_from_mono_type (gtype);
-       g_assert (gtype->type == MONO_TYPE_GENERICINST);
-       gclass = gtype->data.generic_class;
-
-       if (!gclass->is_dynamic)
-               return;
-
-       gklass = gclass->container_class;
-       mono_class_init (gklass);
-
-       /* Mark this as needing synchronization with its generic container */
-       gclass->need_sync = TRUE;
-}
-
-void
-mono_reflection_generic_class_initialize (MonoReflectionGenericClass *type, MonoArray *fields)
-{
-       MonoError error;
-       reflection_generic_class_initialize (type, &error);
-       mono_error_set_pending_exception (&error);
+       return mb->mhandle;
 }
+#endif
+
+#ifndef DISABLE_REFLECTION_EMIT
 
 /**
  * fix_partial_generic_class:
@@ -3635,7 +2911,7 @@ mono_reflection_generic_class_initialize (MonoReflectionGenericClass *type, Mono
 static gboolean
 fix_partial_generic_class (MonoClass *klass, MonoError *error)
 {
-       MonoClass *gklass = klass->generic_class->container_class;
+       MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
        int i;
 
        mono_error_init (error);
@@ -3644,7 +2920,7 @@ fix_partial_generic_class (MonoClass *klass, MonoError *error)
                return TRUE;
 
        if (klass->parent != gklass->parent) {
-               MonoType *parent_type = mono_class_inflate_generic_type_checked (&gklass->parent->byval_arg, &klass->generic_class->context, error);
+               MonoType *parent_type = mono_class_inflate_generic_type_checked (&gklass->parent->byval_arg, &mono_class_get_generic_class (klass)->context, error);
                if (mono_error_ok (error)) {
                        MonoClass *parent = mono_class_from_mono_type (parent_type);
                        mono_metadata_free_type (parent_type);
@@ -3660,14 +2936,16 @@ fix_partial_generic_class (MonoClass *klass, MonoError *error)
                }
        }
 
-       if (!klass->generic_class->need_sync)
+       if (!mono_class_get_generic_class (klass)->need_sync)
                return TRUE;
 
-       if (klass->method.count != gklass->method.count) {
-               klass->method.count = gklass->method.count;
-               klass->methods = (MonoMethod **)mono_image_alloc (klass->image, sizeof (MonoMethod*) * (klass->method.count + 1));
+       int mcount = mono_class_get_method_count (klass);
+       int gmcount = mono_class_get_method_count (gklass);
+       if (mcount != gmcount) {
+               mono_class_set_method_count (klass, gmcount);
+               klass->methods = (MonoMethod **)mono_image_alloc (klass->image, sizeof (MonoMethod*) * (gmcount + 1));
 
-               for (i = 0; i < klass->method.count; i++) {
+               for (i = 0; i < gmcount; i++) {
                        klass->methods [i] = mono_class_inflate_generic_method_full_checked (
                                gklass->methods [i], klass, mono_class_get_context (klass), error);
                        mono_error_assert_ok (error);
@@ -3692,11 +2970,13 @@ fix_partial_generic_class (MonoClass *klass, MonoError *error)
                klass->interfaces_inited = 1;
        }
 
-       if (klass->field.count != gklass->field.count) {
-               klass->field.count = gklass->field.count;
-               klass->fields = image_g_new0 (klass->image, MonoClassField, klass->field.count);
+       int fcount = mono_class_get_field_count (klass);
+       int gfcount = mono_class_get_field_count (gklass);
+       if (fcount != gfcount) {
+               mono_class_set_field_count (klass, gfcount);
+               klass->fields = image_g_new0 (klass->image, MonoClassField, gfcount);
 
-               for (i = 0; i < klass->field.count; i++) {
+               for (i = 0; i < gfcount; i++) {
                        klass->fields [i] = gklass->fields [i];
                        klass->fields [i].parent = klass;
                        klass->fields [i].type = mono_class_inflate_generic_type_checked (gklass->fields [i].type, mono_class_get_context (klass), error);
@@ -3721,7 +3001,7 @@ fix_partial_generic_class (MonoClass *klass, MonoError *error)
 static gboolean
 ensure_generic_class_runtime_vtable (MonoClass *klass, MonoError *error)
 {
-       MonoClass *gklass = klass->generic_class->container_class;
+       MonoClass *gklass = mono_class_get_generic_class (klass)->container_class;
 
        mono_error_init (error);
 
@@ -3747,7 +3027,7 @@ ensure_runtime_vtable (MonoClass *klass, MonoError *error)
 
        mono_error_init (error);
 
-       if (!image_is_dynamic (klass->image) || (!tb && !klass->generic_class) || klass->wastypebuilder)
+       if (!image_is_dynamic (klass->image) || (!tb && !mono_class_is_ginst (klass)) || klass->wastypebuilder)
                return TRUE;
        if (klass->parent)
                if (!ensure_runtime_vtable (klass->parent, error))
@@ -3756,7 +3036,7 @@ ensure_runtime_vtable (MonoClass *klass, MonoError *error)
        if (tb) {
                num = tb->ctors? mono_array_length (tb->ctors): 0;
                num += tb->num_methods;
-               klass->method.count = num;
+               mono_class_set_method_count (klass, num);
                klass->methods = (MonoMethod **)mono_image_alloc (klass->image, sizeof (MonoMethod*) * num);
                num = tb->ctors? mono_array_length (tb->ctors): 0;
                for (i = 0; i < num; ++i) {
@@ -3786,16 +3066,17 @@ ensure_runtime_vtable (MonoClass *klass, MonoError *error)
                        }
                        klass->interfaces_inited = 1;
                }
-       } else if (klass->generic_class){
+       } else if (mono_class_is_ginst (klass)){
                if (!ensure_generic_class_runtime_vtable (klass, error)) {
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_type_load_failure (klass, "Could not initialize vtable for generic class due to: %s", mono_error_get_message (error));
                        return FALSE;
                }
        }
 
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (klass) && !mono_class_is_ginst (klass)) {
                int slot_num = 0;
-               for (i = 0; i < klass->method.count; ++i) {
+               int mcount = mono_class_get_method_count (klass);
+               for (i = 0; i < mcount; ++i) {
                        MonoMethod *im = klass->methods [i];
                        if (!(im->flags & METHOD_ATTRIBUTE_STATIC))
                                im->slot = slot_num++;
@@ -3825,7 +3106,7 @@ mono_reflection_method_get_handle (MonoObject *method, MonoError *error)
 {
        mono_error_init (error);
        MonoClass *klass = mono_object_class (method);
-       if (is_sr_mono_method (klass) || is_sr_mono_generic_method (klass)) {
+       if (is_sr_mono_method (klass)) {
                MonoReflectionMethod *sr_method = (MonoReflectionMethod*)method;
                return sr_method->method;
        }
@@ -3834,26 +3115,11 @@ mono_reflection_method_get_handle (MonoObject *method, MonoError *error)
                return mb->mhandle;
        }
        if (mono_is_sre_method_on_tb_inst (klass)) {
-               MonoReflectionMethodOnTypeBuilderInst *m = (MonoReflectionMethodOnTypeBuilderInst*)method;
-               MonoMethod *result;
-               /*FIXME move this to a proper method and unify with resolve_object*/
-               if (m->method_args) {
-                       result = mono_reflection_method_on_tb_inst_get_handle (m, error);
-               } else {
-                       MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)m->inst, error);
-                       return_val_if_nok (error, NULL);
-                       MonoClass *inflated_klass = mono_class_from_mono_type (type);
-                       MonoMethod *mono_method;
+               MonoClass *handle_class;
 
-                       if (is_sre_method_builder (mono_object_class (m->mb)))
-                               mono_method = ((MonoReflectionMethodBuilder *)m->mb)->mhandle;
-                       else if (is_sr_mono_method (mono_object_class (m->mb)))
-                               mono_method = ((MonoReflectionMethod *)m->mb)->method;
-                       else
-                               g_error ("resolve_object:: can't handle a MTBI with base_method of type %s", mono_type_get_full_name (mono_object_class (m->mb)));
+               MonoMethod *result =  mono_reflection_resolve_object (NULL, method, &handle_class, NULL, error);
+               return_val_if_nok (error, NULL);
 
-                       result = inflate_mono_method (inflated_klass, mono_method, (MonoObject*)m->mb);
-               }
                return result;
        }
 
@@ -3917,40 +3183,41 @@ mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides
        *num_overrides = onum;
 }
 
+/* This initializes the same data as mono_class_setup_fields () */
 static void
 typebuilder_setup_fields (MonoClass *klass, MonoError *error)
 {
        MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mono_class_get_ref_info (klass);
        MonoReflectionFieldBuilder *fb;
        MonoClassField *field;
+       MonoClassExt *ext;
        MonoImage *image = klass->image;
        const char *p, *p2;
-       int i;
-       guint32 len, idx, real_size = 0;
+       int i, instance_size, packing_size = 0;
+       guint32 len, idx;
+
+       if (klass->parent) {
+               if (!klass->parent->size_inited)
+                       mono_class_init (klass->parent);
+               instance_size = klass->parent->instance_size;
+       } else {
+               instance_size = sizeof (MonoObject);
+       }
 
-       klass->field.count = tb->num_fields;
-       klass->field.first = 0;
+       int fcount = tb->num_fields;
+       mono_class_set_field_count (klass, fcount);
 
        mono_error_init (error);
 
        if (tb->class_size) {
-               if ((tb->packing_size & 0xffffff00) != 0) {
-                       char *err_msg = mono_image_strdup_printf (klass->image, "Could not load struct '%s' with packing size %d >= 256", klass->name, tb->packing_size);
-                       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, err_msg);
-                       return;
-               }
-               klass->packing_size = tb->packing_size;
-               real_size = klass->instance_size + tb->class_size;
-       }
-
-       if (!klass->field.count) {
-               klass->instance_size = MAX (klass->instance_size, real_size);
-               return;
+               packing_size = tb->packing_size;
+               instance_size += tb->class_size;
        }
        
-       klass->fields = image_g_new0 (image, MonoClassField, klass->field.count);
+       klass->fields = image_g_new0 (image, MonoClassField, fcount);
        mono_class_alloc_ext (klass);
-       klass->ext->field_def_values = image_g_new0 (image, MonoFieldDefaultValue, klass->field.count);
+       ext = mono_class_get_ext (klass);
+       ext->field_def_values = image_g_new0 (image, MonoFieldDefaultValue, fcount);
        /*
        This is, guess what, a hack.
        The issue is that the runtime doesn't know how to setup the fields of a typebuider and crash.
@@ -3960,10 +3227,11 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error)
        */
        klass->size_inited = 1;
 
-       for (i = 0; i < klass->field.count; ++i) {
+       for (i = 0; i < fcount; ++i) {
                MonoArray *rva_data;
                fb = (MonoReflectionFieldBuilder *)mono_array_get (tb->fields, gpointer, i);
                field = &klass->fields [i];
+               field->parent = klass;
                field->name = mono_string_to_utf8_image (image, fb->name, error);
                if (!mono_error_ok (error))
                        return;
@@ -3982,32 +3250,27 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error)
                        size_t size = mono_array_length (rva_data);
                        char *data = (char *)mono_image_alloc (klass->image, size);
                        memcpy (data, base, size);
-                       klass->ext->field_def_values [i].data = data;
+                       ext->field_def_values [i].data = data;
                }
                if (fb->offset != -1)
                        field->offset = fb->offset;
-               field->parent = klass;
                fb->handle = field;
                mono_save_custom_attrs (klass->image, field, fb->cattrs);
 
-               if (klass->enumtype && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
-                       klass->cast_class = klass->element_class = mono_class_from_mono_type (field->type);
-               }
                if (fb->def_value) {
                        MonoDynamicImage *assembly = (MonoDynamicImage*)klass->image;
                        field->type->attrs |= FIELD_ATTRIBUTE_HAS_DEFAULT;
-                       idx = mono_dynimage_encode_constant (assembly, fb->def_value, &klass->ext->field_def_values [i].def_type);
+                       idx = mono_dynimage_encode_constant (assembly, fb->def_value, &ext->field_def_values [i].def_type);
                        /* Copy the data from the blob since it might get realloc-ed */
                        p = assembly->blob.data + idx;
                        len = mono_metadata_decode_blob_size (p, &p2);
                        len += p2 - p;
-                       klass->ext->field_def_values [i].data = (const char *)mono_image_alloc (image, len);
-                       memcpy ((gpointer)klass->ext->field_def_values [i].data, p, len);
+                       ext->field_def_values [i].data = (const char *)mono_image_alloc (image, len);
+                       memcpy ((gpointer)ext->field_def_values [i].data, p, len);
                }
        }
 
-       klass->instance_size = MAX (klass->instance_size, real_size);
-       mono_class_layout_fields (klass, klass->instance_size);
+       mono_class_layout_fields (klass, instance_size, packing_size, TRUE);
 }
 
 static void
@@ -4017,19 +3280,21 @@ typebuilder_setup_properties (MonoClass *klass, MonoError *error)
        MonoReflectionPropertyBuilder *pb;
        MonoImage *image = klass->image;
        MonoProperty *properties;
+       MonoClassExt *ext;
        int i;
 
        mono_error_init (error);
 
-       if (!klass->ext)
-               klass->ext = image_g_new0 (image, MonoClassExt, 1);
+       ext = mono_class_get_ext (klass);
+       if (!ext)
+               mono_class_set_ext (klass, ext = image_g_new0 (image, MonoClassExt, 1));
 
-       klass->ext->property.count = tb->properties ? mono_array_length (tb->properties) : 0;
-       klass->ext->property.first = 0;
+       ext->property.count = tb->properties ? mono_array_length (tb->properties) : 0;
+       ext->property.first = 0;
 
-       properties = image_g_new0 (image, MonoProperty, klass->ext->property.count);
-       klass->ext->properties = properties;
-       for (i = 0; i < klass->ext->property.count; ++i) {
+       properties = image_g_new0 (image, MonoProperty, ext->property.count);
+       ext->properties = properties;
+       for (i = 0; i < ext->property.count; ++i) {
                pb = mono_array_get (tb->properties, MonoReflectionPropertyBuilder*, i);
                properties [i].parent = klass;
                properties [i].attrs = pb->attrs;
@@ -4046,80 +3311,18 @@ typebuilder_setup_properties (MonoClass *klass, MonoError *error)
                        guint32 len, idx;
                        const char *p, *p2;
                        MonoDynamicImage *assembly = (MonoDynamicImage*)klass->image;
-                       if (!klass->ext->prop_def_values)
-                               klass->ext->prop_def_values = image_g_new0 (image, MonoFieldDefaultValue, klass->ext->property.count);
+                       if (!ext->prop_def_values)
+                               ext->prop_def_values = image_g_new0 (image, MonoFieldDefaultValue, ext->property.count);
                        properties [i].attrs |= PROPERTY_ATTRIBUTE_HAS_DEFAULT;
-                       idx = mono_dynimage_encode_constant (assembly, pb->def_value, &klass->ext->prop_def_values [i].def_type);
+                       idx = mono_dynimage_encode_constant (assembly, pb->def_value, &ext->prop_def_values [i].def_type);
                        /* Copy the data from the blob since it might get realloc-ed */
                        p = assembly->blob.data + idx;
                        len = mono_metadata_decode_blob_size (p, &p2);
                        len += p2 - p;
-                       klass->ext->prop_def_values [i].data = (const char *)mono_image_alloc (image, len);
-                       memcpy ((gpointer)klass->ext->prop_def_values [i].data, p, len);
-               }
-       }
-}
-
-static MonoReflectionEvent *
-reflection_event_builder_get_event_info (MonoReflectionTypeBuilder *tb, MonoReflectionEventBuilder *eb, MonoError *error)
-{
-       mono_error_init (error);
-
-       MonoEvent *event = g_new0 (MonoEvent, 1);
-       MonoClass *klass;
-
-       MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)tb, error);
-       if (!is_ok (error)) {
-               g_free (event);
-               return NULL;
-       }
-       klass = mono_class_from_mono_type (type);
-
-       event->parent = klass;
-       event->attrs = eb->attrs;
-       event->name = mono_string_to_utf8_checked (eb->name, error);
-       if (!is_ok (error)) {
-               g_free (event);
-               return NULL;
-       }
-       if (eb->add_method)
-               event->add = eb->add_method->mhandle;
-       if (eb->remove_method)
-               event->remove = eb->remove_method->mhandle;
-       if (eb->raise_method)
-               event->raise = eb->raise_method->mhandle;
-
-#ifndef MONO_SMALL_CONFIG
-       if (eb->other_methods) {
-               int j;
-               event->other = g_new0 (MonoMethod*, mono_array_length (eb->other_methods) + 1);
-               for (j = 0; j < mono_array_length (eb->other_methods); ++j) {
-                       MonoReflectionMethodBuilder *mb = 
-                               mono_array_get (eb->other_methods,
-                                               MonoReflectionMethodBuilder*, j);
-                       event->other [j] = mb->mhandle;
+                       ext->prop_def_values [i].data = (const char *)mono_image_alloc (image, len);
+                       memcpy ((gpointer)ext->prop_def_values [i].data, p, len);
                }
        }
-#endif
-
-       MonoReflectionEvent *ev_obj = mono_event_get_object_checked (mono_object_domain (tb), klass, event, error);
-       if (!is_ok (error)) {
-#ifndef MONO_SMALL_CONFIG
-               g_free (event->other);
-#endif
-               g_free (event);
-               return NULL;
-       }
-       return ev_obj;
-}
-
-MonoReflectionEvent *
-ves_icall_TypeBuilder_get_event_info (MonoReflectionTypeBuilder *tb, MonoReflectionEventBuilder *eb)
-{
-       MonoError error;
-       MonoReflectionEvent *result = reflection_event_builder_get_event_info (tb, eb, &error);
-       mono_error_set_pending_exception (&error);
-       return result;
 }
 
 static void
@@ -4129,19 +3332,21 @@ typebuilder_setup_events (MonoClass *klass, MonoError *error)
        MonoReflectionEventBuilder *eb;
        MonoImage *image = klass->image;
        MonoEvent *events;
+       MonoClassExt *ext;
        int i;
 
        mono_error_init (error);
 
-       if (!klass->ext)
-               klass->ext = image_g_new0 (image, MonoClassExt, 1);
+       ext = mono_class_get_ext (klass);
+       if (!ext)
+               mono_class_set_ext (klass, ext = image_g_new0 (image, MonoClassExt, 1));
 
-       klass->ext->event.count = tb->events ? mono_array_length (tb->events) : 0;
-       klass->ext->event.first = 0;
+       ext->event.count = tb->events ? mono_array_length (tb->events) : 0;
+       ext->event.first = 0;
 
-       events = image_g_new0 (image, MonoEvent, klass->ext->event.count);
-       klass->ext->events = events;
-       for (i = 0; i < klass->ext->event.count; ++i) {
+       events = image_g_new0 (image, MonoEvent, ext->event.count);
+       ext->events = events;
+       for (i = 0; i < ext->event.count; ++i) {
                eb = mono_array_get (tb->events, MonoReflectionEventBuilder*, i);
                events [i].parent = klass;
                events [i].attrs = eb->attrs;
@@ -4193,7 +3398,7 @@ remove_instantiations_of_and_ensure_contents (gpointer key,
                MonoClass *inst_klass = mono_class_from_mono_type (type);
                //Ensure it's safe to use it.
                if (!fix_partial_generic_class (inst_klass, error)) {
-                       mono_class_set_failure (inst_klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+                       mono_class_set_type_load_failure (inst_klass, "Could not initialized generic type instance due to: %s", mono_error_get_message (error));
                        // Marked the class with failure, but since some other instantiation already failed,
                        // just report that one, and swallow the error from this one.
                        if (already_failed)
@@ -4215,6 +3420,9 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
 
        mono_error_init (&error);
 
+       reflection_create_generic_class (tb, &error);
+       mono_error_assert_ok (&error);
+
        domain = mono_object_domain (tb);
        klass = mono_class_from_mono_type (tb->type.type);
 
@@ -4239,7 +3447,7 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
         * Fields to set in klass:
         * the various flags: delegate/unicode/contextbound etc.
         */
-       klass->flags = tb->attrs;
+       mono_class_set_flags (klass, tb->attrs);
        klass->has_cctor = 1;
 
        mono_class_setup_parent (klass, klass->parent);
@@ -4248,22 +3456,6 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
        mono_class_setup_supertypes (klass);
        mono_class_setup_mono_type (klass);
 
-#if 0
-       if (!((MonoDynamicImage*)klass->image)->run) {
-               if (klass->generic_container) {
-                       /* FIXME: The code below can't handle generic classes */
-                       klass->wastypebuilder = TRUE;
-                       mono_loader_unlock ();
-                       mono_domain_unlock (domain);
-
-                       res = mono_type_get_object_checked (mono_object_domain (tb), &klass->byval_arg, &error);
-                       mono_error_set_pending_exception (&error);
-
-                       return res;
-               }
-       }
-#endif
-
        /* enums are done right away */
        if (!klass->enumtype)
                if (!ensure_runtime_vtable (klass, &error))
@@ -4273,31 +3465,20 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
                for (i = 0; i < mono_array_length (tb->subtypes); ++i) {
                        MonoReflectionTypeBuilder *subtb = mono_array_get (tb->subtypes, MonoReflectionTypeBuilder*, i);
                        mono_class_alloc_ext (klass);
+
+                       if (!subtb->type.type) {
+                               reflection_setup_internal_class (subtb, &error);
+                               mono_error_assert_ok (&error);
+                       }
+
                        MonoType *subtype = mono_reflection_type_get_handle ((MonoReflectionType*)subtb, &error);
                        if (!is_ok (&error)) goto failure;
-                       klass->ext->nested_classes = g_list_prepend_image (klass->image, klass->ext->nested_classes, mono_class_from_mono_type (subtype));
+                       mono_class_get_ext (klass)->nested_classes = g_list_prepend_image (klass->image, mono_class_get_ext (klass)->nested_classes, mono_class_from_mono_type (subtype));
                }
        }
 
        klass->nested_classes_inited = TRUE;
 
-       /* fields and object layout */
-       if (klass->parent) {
-               if (!klass->parent->size_inited)
-                       mono_class_init (klass->parent);
-               klass->instance_size = klass->parent->instance_size;
-               klass->sizes.class_size = 0;
-               klass->min_align = klass->parent->min_align;
-               /* if the type has no fields we won't call the field_setup
-                * routine which sets up klass->has_references.
-                */
-               klass->has_references |= klass->parent->has_references;
-       } else {
-               klass->instance_size = sizeof (MonoObject);
-               klass->min_align = 1;
-       }
-
-       /* FIXME: handle packing_size and instance_size */
        typebuilder_setup_fields (klass, &error);
        if (!mono_error_ok (&error))
                goto failure;
@@ -4311,6 +3492,16 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
 
        klass->wastypebuilder = TRUE;
 
+       if (tb->generic_params) {
+               for (i = 0; i < mono_array_length (tb->generic_params); i++) {
+                       MonoReflectionGenericParam *gparam = (MonoReflectionGenericParam *)mono_array_get (tb->generic_params, gpointer, i);
+                       MonoType *param_type = mono_reflection_type_get_handle ((MonoReflectionType*)gparam, &error);
+                       MonoClass *gklass = mono_class_from_mono_type (param_type);
+
+                       gklass->wastypebuilder = TRUE;
+               }
+       }
+
        /* 
         * If we are a generic TypeBuilder, there might be instantiations in the type cache
         * which have type System.Reflection.MonoGenericClass, but after the type is created, 
@@ -4318,7 +3509,7 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
         *
         * Together with this we must ensure the contents of all instances to match the created type.
         */
-       if (domain->type_hash && klass->generic_container) {
+       if (domain->type_hash && mono_class_is_gtd (klass)) {
                struct remove_instantiations_user_data data;
                data.klass = klass;
                data.error = &error;
@@ -4332,7 +3523,7 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
        mono_loader_unlock ();
 
        if (klass->enumtype && !mono_class_is_valid_enum (klass)) {
-               mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+               mono_class_set_type_load_failure (klass, "Not a valid enumeration");
                mono_error_set_type_load_class (&error, klass, "Not a valid enumeration");
                goto failure_unlocked;
        }
@@ -4346,7 +3537,7 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
        return res;
 
 failure:
-       mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
+       mono_class_set_type_load_failure (klass, "TypeBuilder could not create runtime class due to: %s", mono_error_get_message (&error));
        klass->wastypebuilder = TRUE;
        mono_domain_unlock (domain);
        mono_loader_unlock ();
@@ -4355,69 +3546,6 @@ failure_unlocked:
        return NULL;
 }
 
-static gboolean
-reflection_initialize_generic_parameter (MonoReflectionGenericParam *gparam, MonoError *error)
-{
-       MonoGenericParamFull *param;
-       MonoImage *image;
-       MonoClass *pklass;
-
-       mono_error_init (error);
-
-       image = &gparam->tbuilder->module->dynamic_image->image;
-
-       param = mono_image_new0 (image, MonoGenericParamFull, 1);
-
-       param->info.name = mono_string_to_utf8_image (image, gparam->name, error);
-       mono_error_assert_ok (error);
-       param->param.num = gparam->index;
-
-       if (gparam->mbuilder) {
-               if (!gparam->mbuilder->generic_container) {
-                       MonoType *tb = mono_reflection_type_get_handle ((MonoReflectionType*)gparam->mbuilder->type, error);
-                       return_val_if_nok (error, FALSE);
-
-                       MonoClass *klass = mono_class_from_mono_type (tb);
-                       gparam->mbuilder->generic_container = (MonoGenericContainer *)mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer));
-                       gparam->mbuilder->generic_container->is_method = TRUE;
-                       /* 
-                        * Cannot set owner.method, since the MonoMethod is not created yet.
-                        * Set the image field instead, so type_in_image () works.
-                        */
-                       gparam->mbuilder->generic_container->is_anonymous = TRUE;
-                       gparam->mbuilder->generic_container->owner.image = klass->image;
-               }
-               param->param.owner = gparam->mbuilder->generic_container;
-       } else if (gparam->tbuilder) {
-               if (!gparam->tbuilder->generic_container) {
-                       MonoType *tb = mono_reflection_type_get_handle ((MonoReflectionType*)gparam->tbuilder, error);
-                       return_val_if_nok (error, FALSE);
-                       MonoClass *klass = mono_class_from_mono_type (tb);
-                       gparam->tbuilder->generic_container = (MonoGenericContainer *)mono_image_alloc0 (klass->image, sizeof (MonoGenericContainer));
-                       gparam->tbuilder->generic_container->owner.klass = klass;
-               }
-               param->param.owner = gparam->tbuilder->generic_container;
-       }
-
-       pklass = mono_class_from_generic_parameter_internal ((MonoGenericParam *) param);
-
-       gparam->type.type = &pklass->byval_arg;
-
-       mono_class_set_ref_info (pklass, gparam);
-       mono_image_append_class_to_reflection_info_set (pklass);
-
-       return TRUE;
-}
-
-void
-ves_icall_GenericTypeParameterBuilder_initialize_generic_parameter (MonoReflectionGenericParam *gparam)
-{
-       MonoError error;
-       (void) reflection_initialize_generic_parameter (gparam, &error);
-       mono_error_set_pending_exception (&error);
-}
-
-
 typedef struct {
        MonoMethod *handle;
        MonoDomain *domain;
@@ -4632,8 +3760,8 @@ ensure_complete_type (MonoClass *klass, MonoError *error)
                //g_assert (klass->wastypebuilder);
        }
 
-       if (klass->generic_class) {
-               MonoGenericInst *inst = klass->generic_class->context.class_inst;
+       if (mono_class_is_ginst (klass)) {
+               MonoGenericInst *inst = mono_class_get_generic_class (klass)->context.class_inst;
                int i;
 
                for (i = 0; i < inst->type_argc; ++i) {
@@ -4646,16 +3774,17 @@ ensure_complete_type (MonoClass *klass, MonoError *error)
 gpointer
 mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **handle_class, MonoGenericContext *context, MonoError *error)
 {
+       MonoClass *oklass = obj->vtable->klass;
        gpointer result = NULL;
 
        mono_error_init (error);
 
-       if (strcmp (obj->vtable->klass->name, "String") == 0) {
+       if (strcmp (oklass->name, "String") == 0) {
                result = mono_string_intern_checked ((MonoString*)obj, error);
                return_val_if_nok (error, NULL);
                *handle_class = mono_defaults.string_class;
                g_assert (result);
-       } else if (strcmp (obj->vtable->klass->name, "RuntimeType") == 0) {
+       } else if (strcmp (oklass->name, "RuntimeType") == 0) {
                MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)obj, error);
                return_val_if_nok (error, NULL);
                MonoClass *mc = mono_class_from_mono_type (type);
@@ -4675,10 +3804,8 @@ mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **h
                }
                *handle_class = mono_defaults.typehandle_class;
                g_assert (result);
-       } else if (strcmp (obj->vtable->klass->name, "MonoMethod") == 0 ||
-                  strcmp (obj->vtable->klass->name, "MonoCMethod") == 0 ||
-                  strcmp (obj->vtable->klass->name, "MonoGenericCMethod") == 0 ||
-                  strcmp (obj->vtable->klass->name, "MonoGenericMethod") == 0) {
+       } else if (strcmp (oklass->name, "MonoMethod") == 0 ||
+                          strcmp (oklass->name, "MonoCMethod") == 0) {
                result = ((MonoReflectionMethod*)obj)->method;
                if (context) {
                        result = mono_class_inflate_generic_method_checked ((MonoMethod *)result, context, error);
@@ -4686,48 +3813,7 @@ mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **h
                }
                *handle_class = mono_defaults.methodhandle_class;
                g_assert (result);
-       } else if (strcmp (obj->vtable->klass->name, "MethodBuilder") == 0) {
-               MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder*)obj;
-               result = mb->mhandle;
-               if (!result) {
-                       /* Type is not yet created */
-                       MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)mb->type;
-
-                       mono_domain_try_type_resolve_checked (mono_domain_get (), NULL, (MonoObject*)tb, error);
-                       return_val_if_nok (error, NULL);
-
-                       /*
-                        * Hopefully this has been filled in by calling CreateType() on the
-                        * TypeBuilder.
-                        */
-                       /*
-                        * TODO: This won't work if the application finishes another 
-                        * TypeBuilder instance instead of this one.
-                        */
-                       result = mb->mhandle;
-               }
-               if (context) {
-                       result = mono_class_inflate_generic_method_checked ((MonoMethod *)result, context, error);
-                       mono_error_assert_ok (error);
-               }
-               *handle_class = mono_defaults.methodhandle_class;
-       } else if (strcmp (obj->vtable->klass->name, "ConstructorBuilder") == 0) {
-               MonoReflectionCtorBuilder *cb = (MonoReflectionCtorBuilder*)obj;
-
-               result = cb->mhandle;
-               if (!result) {
-                       MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)cb->type;
-
-                       mono_domain_try_type_resolve_checked (mono_domain_get (), NULL, (MonoObject*)tb, error);
-                       return_val_if_nok (error, NULL);
-                       result = cb->mhandle;
-               }
-               if (context) {
-                       result = mono_class_inflate_generic_method_checked ((MonoMethod *)result, context, error);
-                       mono_error_assert_ok (error);
-               }
-               *handle_class = mono_defaults.methodhandle_class;
-       } else if (strcmp (obj->vtable->klass->name, "MonoField") == 0) {
+       } else if (strcmp (oklass->name, "MonoField") == 0) {
                MonoClassField *field = ((MonoReflectionField*)obj)->field;
 
                ensure_complete_type (field->parent, error);
@@ -4752,31 +3838,7 @@ mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **h
                }
                *handle_class = mono_defaults.fieldhandle_class;
                g_assert (result);
-       } else if (strcmp (obj->vtable->klass->name, "FieldBuilder") == 0) {
-               MonoReflectionFieldBuilder *fb = (MonoReflectionFieldBuilder*)obj;
-               result = fb->handle;
-
-               if (!result) {
-                       MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)fb->typeb;
-
-                       mono_domain_try_type_resolve_checked (mono_domain_get (), NULL, (MonoObject*)tb, error);
-                       return_val_if_nok (error, NULL);
-                       result = fb->handle;
-               }
-
-               if (fb->handle && fb->handle->parent->generic_container) {
-                       MonoClass *klass = fb->handle->parent;
-                       MonoType *type = mono_class_inflate_generic_type_checked (&klass->byval_arg, context, error);
-                       return_val_if_nok (error, NULL);
-
-                       MonoClass *inflated = mono_class_from_mono_type (type);
-
-                       result = mono_class_get_field_from_name (inflated, mono_field_get_name (fb->handle));
-                       g_assert (result);
-                       mono_metadata_free_type (type);
-               }
-               *handle_class = mono_defaults.fieldhandle_class;
-       } else if (strcmp (obj->vtable->klass->name, "TypeBuilder") == 0) {
+       } else if (strcmp (oklass->name, "TypeBuilder") == 0) {
                MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)obj;
                MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)tb, error);
                return_val_if_nok (error, NULL);
@@ -4794,7 +3856,7 @@ mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **h
                        g_assert (result);
                }
                *handle_class = mono_defaults.typehandle_class;
-       } else if (strcmp (obj->vtable->klass->name, "SignatureHelper") == 0) {
+       } else if (strcmp (oklass->name, "SignatureHelper") == 0) {
                MonoReflectionSigHelper *helper = (MonoReflectionSigHelper*)obj;
                MonoMethodSignature *sig;
                int nargs, i;
@@ -4830,112 +3892,13 @@ mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **h
 
                result = sig;
                *handle_class = NULL;
-       } else if (strcmp (obj->vtable->klass->name, "DynamicMethod") == 0) {
+       } else if (strcmp (oklass->name, "DynamicMethod") == 0) {
                MonoReflectionDynamicMethod *method = (MonoReflectionDynamicMethod*)obj;
                /* Already created by the managed code */
                g_assert (method->mhandle);
                result = method->mhandle;
                *handle_class = mono_defaults.methodhandle_class;
-       } else if (strcmp (obj->vtable->klass->name, "GenericTypeParameterBuilder") == 0) {
-               MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)obj, error);
-               return_val_if_nok (error, NULL);
-               type = mono_class_inflate_generic_type_checked (type, context, error);
-               return_val_if_nok (error, NULL);
-
-               result = mono_class_from_mono_type (type);
-               *handle_class = mono_defaults.typehandle_class;
-               g_assert (result);
-               mono_metadata_free_type (type);
-       } else if (strcmp (obj->vtable->klass->name, "MonoGenericClass") == 0) {
-               MonoType *type = mono_reflection_type_get_handle ((MonoReflectionType*)obj, error);
-               return_val_if_nok (error, NULL);
-               type = mono_class_inflate_generic_type_checked (type, context, error);
-               return_val_if_nok (error, NULL);
-
-               result = mono_class_from_mono_type (type);
-               *handle_class = mono_defaults.typehandle_class;
-               g_assert (result);
-               mono_metadata_free_type (type);
-       } else if (strcmp (obj->vtable->klass->name, "FieldOnTypeBuilderInst") == 0) {
-               MonoReflectionFieldOnTypeBuilderInst *f = (MonoReflectionFieldOnTypeBuilderInst*)obj;
-               MonoClass *inflated;
-               MonoType *type;
-               MonoClassField *field;
-
-               if (is_sre_field_builder (mono_object_class (f->fb)))
-                       field = ((MonoReflectionFieldBuilder*)f->fb)->handle;
-               else if (is_sr_mono_field (mono_object_class (f->fb)))
-                       field = ((MonoReflectionField*)f->fb)->field;
-               else
-                       g_error ("resolve_object:: can't handle a FTBI with base_method of type %s", mono_type_get_full_name (mono_object_class (f->fb)));
-
-               MonoType *finst = mono_reflection_type_get_handle ((MonoReflectionType*)f->inst, error);
-               return_val_if_nok (error, NULL);
-               type = mono_class_inflate_generic_type_checked (finst, context, error);
-               return_val_if_nok (error, NULL);
-
-               inflated = mono_class_from_mono_type (type);
-
-               result = field = mono_class_get_field_from_name (inflated, mono_field_get_name (field));
-               ensure_complete_type (field->parent, error);
-               if (!is_ok (error)) {
-                       mono_metadata_free_type (type);
-                       return NULL;
-               }
-
-               g_assert (result);
-               mono_metadata_free_type (type);
-               *handle_class = mono_defaults.fieldhandle_class;
-       } else if (strcmp (obj->vtable->klass->name, "ConstructorOnTypeBuilderInst") == 0) {
-               MonoReflectionCtorOnTypeBuilderInst *c = (MonoReflectionCtorOnTypeBuilderInst*)obj;
-               MonoType *cinst = mono_reflection_type_get_handle ((MonoReflectionType*)c->inst, error);
-               return_val_if_nok (error, NULL);
-               MonoType *type = mono_class_inflate_generic_type_checked (cinst, context, error);
-               return_val_if_nok (error, NULL);
-
-               MonoClass *inflated_klass = mono_class_from_mono_type (type);
-               MonoMethod *method;
-
-               if (mono_is_sre_ctor_builder (mono_object_class (c->cb)))
-                       method = ((MonoReflectionCtorBuilder *)c->cb)->mhandle;
-               else if (mono_is_sr_mono_cmethod (mono_object_class (c->cb)))
-                       method = ((MonoReflectionMethod *)c->cb)->method;
-               else
-                       g_error ("resolve_object:: can't handle a CTBI with base_method of type %s", mono_type_get_full_name (mono_object_class (c->cb)));
-
-               result = inflate_mono_method (inflated_klass, method, (MonoObject*)c->cb);
-               *handle_class = mono_defaults.methodhandle_class;
-               mono_metadata_free_type (type);
-       } else if (strcmp (obj->vtable->klass->name, "MethodOnTypeBuilderInst") == 0) {
-               MonoReflectionMethodOnTypeBuilderInst *m = (MonoReflectionMethodOnTypeBuilderInst*)obj;
-               if (m->method_args) {
-                       result = mono_reflection_method_on_tb_inst_get_handle (m, error);
-                       return_val_if_nok (error, NULL);
-                       if (context) {
-                               result = mono_class_inflate_generic_method_checked ((MonoMethod *)result, context, error);
-                               mono_error_assert_ok (error);
-                       }
-               } else {
-                       MonoType *minst = mono_reflection_type_get_handle ((MonoReflectionType*)m->inst, error);
-                       return_val_if_nok (error, NULL);
-                       MonoType *type = mono_class_inflate_generic_type_checked (minst, context, error);
-                       return_val_if_nok (error, NULL);
-
-                       MonoClass *inflated_klass = mono_class_from_mono_type (type);
-                       MonoMethod *method;
-
-                       if (is_sre_method_builder (mono_object_class (m->mb)))
-                               method = ((MonoReflectionMethodBuilder *)m->mb)->mhandle;
-                       else if (is_sr_mono_method (mono_object_class (m->mb)))
-                               method = ((MonoReflectionMethod *)m->mb)->method;
-                       else
-                               g_error ("resolve_object:: can't handle a MTBI with base_method of type %s", mono_type_get_full_name (mono_object_class (m->mb)));
-
-                       result = inflate_mono_method (inflated_klass, method, (MonoObject*)m->mb);
-                       mono_metadata_free_type (type);
-               }
-               *handle_class = mono_defaults.methodhandle_class;
-       } else if (strcmp (obj->vtable->klass->name, "MonoArrayMethod") == 0) {
+       } else if (strcmp (oklass->name, "MonoArrayMethod") == 0) {
                MonoReflectionArrayMethod *m = (MonoReflectionArrayMethod*)obj;
                MonoType *mtype;
                MonoClass *klass;
@@ -4964,23 +3927,30 @@ mono_reflection_resolve_object (MonoImage *image, MonoObject *obj, MonoClass **h
 
                result = method;
                *handle_class = mono_defaults.methodhandle_class;
-       } else if (is_sre_array (mono_object_get_class(obj)) ||
-                               is_sre_byref (mono_object_get_class(obj)) ||
-                               is_sre_pointer (mono_object_get_class(obj))) {
-               MonoReflectionType *ref_type = (MonoReflectionType *)obj;
-               MonoType *type = mono_reflection_type_get_handle (ref_type, error);
-               return_val_if_nok (error, NULL);
-
-               if (context) {
-                       MonoType *inflated = mono_class_inflate_generic_type_checked (type, context, error);
-                       return_val_if_nok (error, NULL);
-
-                       result = mono_class_from_mono_type (inflated);
-                       mono_metadata_free_type (inflated);
-               } else {
-                       result = mono_class_from_mono_type (type);
+       } else if (is_sre_method_builder (oklass) ||
+                          mono_is_sre_ctor_builder (oklass) ||
+                          is_sre_field_builder (oklass) ||
+                          is_sre_gparam_builder (oklass) ||
+                          is_sre_generic_instance (oklass) ||
+                          is_sre_array (oklass) ||
+                          is_sre_byref (oklass) ||
+                          is_sre_pointer (oklass) ||
+                          !strcmp (oklass->name, "FieldOnTypeBuilderInst") ||
+                          !strcmp (oklass->name, "MethodOnTypeBuilderInst") ||
+                          !strcmp (oklass->name, "ConstructorOnTypeBuilderInst")) {
+               static MonoMethod *resolve_method;
+               if (!resolve_method) {
+                       MonoMethod *m = mono_class_get_method_from_name_flags (mono_class_get_module_builder_class (), "RuntimeResolve", 1, 0);
+                       g_assert (m);
+                       mono_memory_barrier ();
+                       resolve_method = m;
                }
-               *handle_class = mono_defaults.typehandle_class;
+               void *args [16];
+               args [0] = obj;
+               obj = mono_runtime_invoke_checked (resolve_method, NULL, args, error);
+               mono_error_assert_ok (error);
+               g_assert (obj);
+               return mono_reflection_resolve_object (image, obj, handle_class, context, error);
        } else {
                g_print ("%s\n", obj->vtable->klass->name);
                g_assert_not_reached ();
@@ -4997,19 +3967,6 @@ mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObj
        return NULL;
 }
 
-void
-ves_icall_TypeBuilder_setup_internal_class (MonoReflectionTypeBuilder *tb)
-{
-       g_assert_not_reached ();
-}
-
-gboolean
-mono_reflection_create_generic_class (MonoReflectionTypeBuilder *tb, MonoError *error)
-{
-       g_assert_not_reached ();
-       return FALSE;
-}
-
 void
 mono_reflection_dynimage_basic_init (MonoReflectionAssemblyBuilder *assemblyb)
 {
@@ -5044,12 +4001,6 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObject *obj,
        return 0;
 }
 
-void
-mono_reflection_generic_class_initialize (MonoReflectionGenericClass *type, MonoArray *fields)
-{
-       g_assert_not_reached ();
-}
-
 void
 mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides, int *num_overrides, MonoError *error)
 {
@@ -5058,13 +4009,6 @@ mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides
        *num_overrides = 0;
 }
 
-MonoReflectionEvent *
-ves_icall_TypeBuilder_get_event_info (MonoReflectionTypeBuilder *tb, MonoReflectionEventBuilder *eb)
-{
-       g_assert_not_reached ();
-       return NULL;
-}
-
 MonoReflectionType*
 ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
 {
@@ -5072,12 +4016,6 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilder *tb)
        return NULL;
 }
 
-void
-ves_icall_GenericTypeParameterBuilder_initialize_generic_parameter (MonoReflectionGenericParam *gparam)
-{
-       g_assert_not_reached ();
-}
-
 void 
 ves_icall_DynamicMethod_create_dynamic_method (MonoReflectionDynamicMethod *mb)
 {
@@ -5094,27 +4032,12 @@ mono_reflection_type_get_handle (MonoReflectionType* ref, MonoError *error)
 
 #endif /* DISABLE_REFLECTION_EMIT */
 
-#ifndef DISABLE_REFLECTION_EMIT
-MonoMethod*
-mono_reflection_method_builder_to_mono_method (MonoReflectionMethodBuilder *mb, MonoError *error)
-{
-       MonoType *tb;
-       MonoClass *klass;
-
-       tb = mono_reflection_type_get_handle ((MonoReflectionType*)mb->type, error);
-       return_val_if_nok (error, NULL);
-       klass = mono_class_from_mono_type (tb);
-
-       return methodbuilder_to_mono_method (klass, mb, error);
-}
-#else /* DISABLE_REFLECTION_EMIT */
-MonoMethod*
-mono_reflection_method_builder_to_mono_method (MonoReflectionMethodBuilder *mb, MonoError *error)
+void
+mono_sre_generic_param_table_entry_free (GenericParamTableEntry *entry)
 {
-       g_assert_not_reached ();
-       return NULL;
+       mono_gc_deregister_root ((char*) &entry->gparam);
+       g_free (entry);
 }
-#endif /* DISABLE_REFLECTION_EMIT */
 
 gint32
 ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilder *mb, MonoObject *obj, gboolean create_open_instance)
@@ -5175,21 +4098,6 @@ ves_icall_ModuleBuilder_GetRegisteredToken (MonoReflectionModuleBuilder *mb, gui
        return obj;
 }
 
-/**
- * ves_icall_TypeBuilder_create_generic_class:
- * @tb: a TypeBuilder object
- *
- * (icall)
- * Creates the generic class after all generic parameters have been added.
- */
-void
-ves_icall_TypeBuilder_create_generic_class (MonoReflectionTypeBuilder *tb)
-{
-       MonoError error;
-       (void) mono_reflection_create_generic_class (tb, &error);
-       mono_error_set_pending_exception (&error);
-}
-
 #ifndef DISABLE_REFLECTION_EMIT
 MonoArray*
 ves_icall_CustomAttributeBuilder_GetBlob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues)
@@ -5207,12 +4115,6 @@ ves_icall_AssemblyBuilder_basic_init (MonoReflectionAssemblyBuilder *assemblyb)
        mono_reflection_dynimage_basic_init (assemblyb);
 }
 
-MonoBoolean
-ves_icall_TypeBuilder_get_IsGenericParameter (MonoReflectionTypeBuilder *tb)
-{
-       return mono_type_is_generic_parameter (tb->type.type);
-}
-
 void
 ves_icall_EnumBuilder_setup_enum_type (MonoReflectionType *enumtype,
                                                                           MonoReflectionType *t)
index 7849d4554f5646220aa302bcc00ae013dfcd837d..afd2bcc9e366b4b188cc4321437877f69327b172 100644 (file)
@@ -424,18 +424,20 @@ domain_remove (ThreadPoolDomain *tpdomain)
 static ThreadPoolDomain *
 domain_get (MonoDomain *domain, gboolean create)
 {
-       ThreadPoolDomain *tpdomain = NULL;
        guint i;
 
        g_assert (domain);
 
        for (i = 0; i < threadpool->domains->len; ++i) {
+               ThreadPoolDomain *tpdomain;
+
                tpdomain = (ThreadPoolDomain *)g_ptr_array_index (threadpool->domains, i);
                if (tpdomain->domain == domain)
                        return tpdomain;
        }
 
        if (create) {
+               ThreadPoolDomain *tpdomain;
                ThreadPoolDomainCleanupSemaphore *cleanup_semaphore;
                cleanup_semaphore = g_new0 (ThreadPoolDomainCleanupSemaphore, 1);
                cleanup_semaphore->ref = 2;
@@ -447,9 +449,11 @@ domain_get (MonoDomain *domain, gboolean create)
                tpdomain = g_new0 (ThreadPoolDomain, 1);
                tpdomain->domain = domain;
                domain_add (tpdomain);
+
+               return tpdomain;
        }
 
-       return tpdomain;
+       return NULL;
 }
 
 static void
@@ -658,7 +662,7 @@ worker_thread (gpointer data)
                tpdomain->outstanding_request --;
                g_assert (tpdomain->outstanding_request >= 0);
 
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker running in domain %p",
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker running in domain %p (outstanding requests %d) ",
                        mono_native_thread_id_get (), tpdomain->domain, tpdomain->outstanding_request);
 
                g_assert (tpdomain->domain);
@@ -778,7 +782,7 @@ worker_try_create (void)
        if ((thread = mono_thread_create_internal (mono_get_root_domain (), worker_thread, NULL, TRUE, 0, &error)) != NULL) {
                threadpool->worker_creation_current_count += 1;
 
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, created %p, now = %d count = %d", mono_native_thread_id_get (), thread->tid, now, threadpool->worker_creation_current_count);
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, created %p, now = %d count = %d", mono_native_thread_id_get (), GUINT_TO_POINTER(thread->tid), now, threadpool->worker_creation_current_count);
                mono_coop_mutex_unlock (&threadpool->worker_creation_lock);
                return TRUE;
        }
index a7fd76f1f1c435ef6cc7888fdf1153f2a9ff6df8..84f2c15e98fc5e19d14ad4990b018da5766fb9e6 100644 (file)
@@ -70,7 +70,7 @@ void mono_threads_install_cleanup (MonoThreadCleanupFunc func);
 
 void ves_icall_System_Threading_Thread_ConstructInternalThread (MonoThread *this_obj);
 HANDLE ves_icall_System_Threading_Thread_Thread_internal(MonoThread *this_obj, MonoObject *start);
-void ves_icall_System_Threading_InternalThread_Thread_free_internal(MonoInternalThread *this_obj, HANDLE thread);
+void ves_icall_System_Threading_InternalThread_Thread_free_internal(MonoInternalThread *this_obj);
 void ves_icall_System_Threading_Thread_Sleep_internal(gint32 ms);
 gboolean ves_icall_System_Threading_Thread_Join_internal(MonoThread *this_obj, int ms);
 gint32 ves_icall_System_Threading_Thread_GetDomainID (void);
index 61c69e0ba92819f02eb87b6e18e6021cecbc63fd..34bdb07b755d4f37ff65504b924a94a40a1ea453 100644 (file)
@@ -44,7 +44,9 @@
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/mono-threads-coop.h>
 #include <mono/utils/mono-error-internals.h>
-#include <mono/utils/w32handle.h>
+#include <mono/utils/os-event.h>
+#include <mono/utils/mono-threads-debug.h>
+#include <mono/metadata/w32handle.h>
 #include <mono/metadata/w32event.h>
 #include <mono/metadata/w32mutex.h>
 
 #include <signal.h>
 #endif
 
+#if defined(HOST_WIN32)
+#include <objbase.h>
+#endif
+
 #if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
 #define USE_TKILL_ON_ANDROID 1
 #endif
@@ -134,12 +140,12 @@ static StaticDataInfo context_static_info;
 /* The hash of existing threads (key is thread ID, value is
  * MonoInternalThread*) that need joining before exit
  */
-static MonoGHashTable *threads=NULL;
+static MonoGHashTable *threads;
 
 /* List of app context GC handles.
  * Added to from ves_icall_System_Runtime_Remoting_Contexts_Context_RegisterContext ().
  */
-static GHashTable *contexts = NULL;
+static GHashTable *contexts;
 
 /* Cleanup queue for contexts. */
 static MonoReferenceQueue *context_queue;
@@ -149,7 +155,7 @@ static MonoReferenceQueue *context_queue;
  * When mono_thread_attach_internal is called for a thread, it will be removed from this hash table.
  * Protected by mono_threads_lock ().
  */
-static MonoGHashTable *threads_starting_up = NULL;
+static MonoGHashTable *threads_starting_up;
 
 /* The TLS key that holds the MonoObject assigned to each thread */
 static MonoNativeTlsKey current_object_key;
@@ -159,6 +165,15 @@ static MonoNativeTlsKey current_object_key;
 static GHashTable *joinable_threads;
 static int joinable_thread_count;
 
+#define thread_wait_lock() mono_os_mutex_lock (&thread_wait_mutex)
+#define thread_wait_unlock() mono_os_mutex_unlock (&thread_wait_mutex)
+static mono_mutex_t thread_wait_mutex;
+/* Used to wait for a thread to be joined or to change state */
+/* Used to wait for njoined_threads to increase or for background_change to become true */
+static mono_cond_t thread_wait_cond;
+static int njoined_threads;
+static gboolean background_changed;
+
 #ifdef MONO_HAVE_FAST_TLS
 /* we need to use both the Tls* functions and __thread because
  * the gc needs to see all the threads 
@@ -208,8 +223,10 @@ static mono_mutex_t interlocked_mutex;
 /* global count of thread interruptions requested */
 static gint32 thread_interruption_requested = 0;
 
+#ifdef HOST_WIN32
 /* Event signaled when a thread changes its background mode */
-static HANDLE background_change_event;
+static MonoOSEvent background_change_event;
+#endif
 
 static gboolean shutting_down = FALSE;
 
@@ -447,6 +464,10 @@ static void thread_cleanup (MonoInternalThread *thread)
                thread->thread_pinning_ref = NULL;
        }
 
+       g_assert (thread->suspended);
+       mono_os_event_destroy (thread->suspended);
+       g_free (thread->suspended);
+       thread->suspended = NULL;
 }
 
 /*
@@ -535,22 +556,18 @@ set_current_thread_for_domain (MonoDomain *domain, MonoInternalThread *thread, M
 }
 
 static MonoThread*
-create_thread_object (MonoDomain *domain)
+create_thread_object (MonoDomain *domain, MonoInternalThread *internal)
 {
+       MonoThread *thread;
+       MonoVTable *vtable;
        MonoError error;
-       MonoVTable *vt = mono_class_vtable (domain, mono_defaults.thread_class);
-       MonoThread *t = (MonoThread*)mono_object_new_mature (vt, &error);
-       /* only possible failure mode is OOM, from which we don't expect to recover. */
-       mono_error_assert_ok (&error);
-       return t;
-}
 
-static MonoThread*
-new_thread_with_internal (MonoDomain *domain, MonoInternalThread *internal)
-{
-       MonoThread *thread;
+       vtable = mono_class_vtable (domain, mono_defaults.thread_class);
+       g_assert (vtable);
 
-       thread = create_thread_object (domain);
+       thread = (MonoThread*)mono_object_new_mature (vtable, &error);
+       /* only possible failure mode is OOM, from which we don't expect to recover. */
+       mono_error_assert_ok (&error);
 
        MONO_OBJECT_SETREF (thread, internal_thread, internal);
 
@@ -558,7 +575,7 @@ new_thread_with_internal (MonoDomain *domain, MonoInternalThread *internal)
 }
 
 static MonoInternalThread*
-create_internal_thread (void)
+create_internal_thread_object (void)
 {
        MonoError error;
        MonoInternalThread *thread;
@@ -581,6 +598,9 @@ create_internal_thread (void)
 
        thread->priority = MONO_THREAD_PRIORITY_NORMAL;
 
+       thread->suspended = g_new0 (MonoOSEvent, 1);
+       mono_os_event_init (thread->suspended, TRUE);
+
        return thread;
 }
 
@@ -588,7 +608,6 @@ static void
 mono_thread_internal_set_priority (MonoInternalThread *internal, MonoThreadPriority priority)
 {
        g_assert (internal);
-       g_assert (internal->handle);
 
        g_assert (priority >= MONO_THREAD_PRIORITY_LOWEST);
        g_assert (priority <= MONO_THREAD_PRIORITY_HIGHEST);
@@ -597,7 +616,9 @@ mono_thread_internal_set_priority (MonoInternalThread *internal, MonoThreadPrior
 #ifdef HOST_WIN32
        BOOL res;
 
-       res = SetThreadPriority (internal->handle, priority - 2);
+       g_assert (internal->native_handle);
+
+       res = SetThreadPriority (internal->native_handle, priority - 2);
        if (!res)
                g_error ("%s: SetThreadPriority failed, error %d", __func__, GetLastError ());
 #else /* HOST_WIN32 */
@@ -672,7 +693,10 @@ mono_thread_attach_internal (MonoThread *thread, gboolean force_attach, gboolean
        info = mono_thread_info_current ();
 
        internal = thread->internal_thread;
-       internal->handle = mono_thread_info_duplicate_handle (info);
+       internal->handle = mono_threads_open_thread_handle (info->handle);
+#ifdef HOST_WIN32
+       internal->native_handle = OpenThread (THREAD_ALL_ACCESS, FALSE, GetCurrentThreadId ());
+#endif
        internal->tid = MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ());
        internal->thread_info = info;
        internal->small_id = info->small_id;
@@ -723,7 +747,7 @@ mono_thread_attach_internal (MonoThread *thread, gboolean force_attach, gboolean
 
        g_assert (!internal->root_domain_thread);
        if (domain != root_domain)
-               MONO_OBJECT_SETREF (internal, root_domain_thread, new_thread_with_internal (root_domain, internal));
+               MONO_OBJECT_SETREF (internal, root_domain_thread, create_thread_object (root_domain, internal));
        else
                MONO_OBJECT_SETREF (internal, root_domain_thread, thread);
 
@@ -886,9 +910,6 @@ static gsize WINAPI start_wrapper(void *data)
 {
        volatile gsize dummy;
 
-       /* Avoid scanning the frames above this frame during a GC */
-       mono_gc_set_stack_end ((void*)&dummy);
-
        return start_wrapper_internal ((StartInfo*) data, (gsize*) &dummy);
 }
 
@@ -903,9 +924,10 @@ create_thread (MonoThread *thread, MonoInternalThread *internal, MonoObject *sta
        gboolean threadpool_thread, guint32 stack_size, MonoError *error)
 {
        StartInfo *start_info = NULL;
-       HANDLE thread_handle;
+       MonoThreadHandle *thread_handle;
        MonoNativeThreadId tid;
        gboolean ret;
+       gsize stack_set_size;
 
        if (start_delegate)
                g_assert (!start_func && !start_func_arg);
@@ -947,9 +969,11 @@ create_thread (MonoThread *thread, MonoInternalThread *internal, MonoObject *sta
        mono_coop_sem_init (&start_info->registered, 0);
 
        if (stack_size == 0)
-               stack_size = default_stacksize_for_thread (internal);
+               stack_set_size = default_stacksize_for_thread (internal);
+       else
+               stack_set_size = 0;
 
-       thread_handle = mono_threads_create_thread (start_wrapper, start_info, stack_size, &tid);
+       thread_handle = mono_threads_create_thread (start_wrapper, start_info, &stack_set_size, &tid);
 
        if (thread_handle == NULL) {
                /* The thread couldn't be created, so set an exception */
@@ -963,6 +987,8 @@ create_thread (MonoThread *thread, MonoInternalThread *internal, MonoObject *sta
                goto done;
        }
 
+       internal->stack_size = (int) stack_set_size;
+
        THREAD_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT") Launching thread %p (%"G_GSIZE_FORMAT")", __func__, mono_native_thread_id_get (), internal, (gsize)internal->tid));
 
        /*
@@ -1020,11 +1046,9 @@ mono_thread_create_internal (MonoDomain *domain, gpointer func, gpointer arg, gb
 
        mono_error_init (error);
 
-       thread = create_thread_object (domain);
+       internal = create_internal_thread_object ();
 
-       internal = create_internal_thread ();
-
-       MONO_OBJECT_SETREF (thread, internal_thread, internal);
+       thread = create_thread_object (domain, internal);
 
        LOCK_THREAD (internal);
 
@@ -1079,9 +1103,9 @@ mono_thread_attach_full (MonoDomain *domain, gboolean force_attach)
 
        tid=mono_native_thread_id_get ();
 
-       internal = create_internal_thread ();
+       internal = create_internal_thread_object ();
 
-       thread = new_thread_with_internal (domain, internal);
+       thread = create_thread_object (domain, internal);
 
        if (!mono_thread_attach_internal (thread, force_attach, TRUE, &stack_ptr)) {
                /* Mono is shutting down, so just wait for the end */
@@ -1188,7 +1212,7 @@ mono_thread_exit (void)
        if (mono_thread_get_main () && (thread == mono_thread_get_main ()->internal_thread))
                exit (mono_environment_exitcode_get ());
 
-       mono_thread_info_exit ();
+       mono_thread_info_exit (0);
 }
 
 void
@@ -1196,7 +1220,7 @@ ves_icall_System_Threading_Thread_ConstructInternalThread (MonoThread *this_obj)
 {
        MonoInternalThread *internal;
 
-       internal = create_internal_thread ();
+       internal = create_internal_thread_object ();
 
        internal->state = ThreadState_Unstarted;
 
@@ -1249,17 +1273,23 @@ ves_icall_System_Threading_Thread_Thread_internal (MonoThread *this_obj,
  * This is called from the finalizer of the internal thread object.
  */
 void
-ves_icall_System_Threading_InternalThread_Thread_free_internal (MonoInternalThread *this_obj, HANDLE thread)
+ves_icall_System_Threading_InternalThread_Thread_free_internal (MonoInternalThread *this_obj)
 {
-       THREAD_DEBUG (g_message ("%s: Closing thread %p, handle %p", __func__, this, thread));
+       THREAD_DEBUG (g_message ("%s: Closing thread %p, handle %p", __func__, this, this_obj->handle));
 
        /*
         * Since threads keep a reference to their thread object while running, by the time this function is called,
         * the thread has already exited/detached, i.e. thread_cleanup () has ran. The exception is during shutdown,
         * when thread_cleanup () can be called after this.
         */
-       if (thread)
-               mono_threads_close_thread_handle (thread);
+       if (this_obj->handle) {
+               mono_threads_close_thread_handle (this_obj->handle);
+               this_obj->handle = NULL;
+       }
+
+#if HOST_WIN32
+       CloseHandle (this_obj->native_handle);
+#endif
 
        if (this_obj->synch_cs) {
                MonoCoopMutex *synch_cs = this_obj->synch_cs;
@@ -1506,7 +1536,7 @@ ves_icall_System_Threading_Thread_SetPriority (MonoThread *this_obj, int priorit
 
        LOCK_THREAD (internal);
        internal->priority = priority;
-       if (internal->handle != NULL)
+       if (internal->thread_info != NULL)
                mono_thread_internal_set_priority (internal, priority);
        UNLOCK_THREAD (internal);
 }
@@ -1560,7 +1590,7 @@ mono_thread_current (void)
 
        if (!*current_thread_ptr) {
                g_assert (domain != mono_get_root_domain ());
-               *current_thread_ptr = new_thread_with_internal (domain, internal);
+               *current_thread_ptr = create_thread_object (domain, internal);
        }
        return *current_thread_ptr;
 }
@@ -1577,7 +1607,7 @@ mono_thread_current_for_thread (MonoInternalThread *internal)
 
        if (!*current_thread_ptr) {
                g_assert (domain != mono_get_root_domain ());
-               *current_thread_ptr = new_thread_with_internal (domain, internal);
+               *current_thread_ptr = create_thread_object (domain, internal);
        }
        return *current_thread_ptr;
 }
@@ -1594,7 +1624,7 @@ gboolean
 ves_icall_System_Threading_Thread_Join_internal(MonoThread *this_obj, int ms)
 {
        MonoInternalThread *thread = this_obj->internal_thread;
-       HANDLE handle = thread->handle;
+       MonoThreadHandle *handle = thread->handle;
        MonoInternalThread *cur_thread = mono_thread_internal_current ();
        gboolean ret;
 
@@ -1620,12 +1650,12 @@ ves_icall_System_Threading_Thread_Join_internal(MonoThread *this_obj, int ms)
        mono_thread_set_state (cur_thread, ThreadState_WaitSleepJoin);
 
        MONO_ENTER_GC_SAFE;
-       ret=WaitForSingleObjectEx (handle, ms, TRUE);
+       ret=mono_thread_info_wait_one_handle (handle, ms, TRUE);
        MONO_EXIT_GC_SAFE;
 
        mono_thread_clr_state (cur_thread, ThreadState_WaitSleepJoin);
        
-       if(ret==WAIT_OBJECT_0) {
+       if(ret==MONO_THREAD_INFO_WAIT_RET_SUCCESS_0) {
                THREAD_DEBUG (g_message ("%s: join successful", __func__));
 
                return(TRUE);
@@ -2053,6 +2083,18 @@ ves_icall_System_Threading_Thread_MemoryBarrier (void)
        mono_memory_barrier ();
 }
 
+static void
+signal_background_change (void)
+{
+       thread_wait_lock ();
+       background_changed = TRUE;
+       mono_os_cond_signal (&thread_wait_cond);
+       thread_wait_unlock ();
+#ifdef HOST_WIN32
+       mono_os_event_set (&background_change_event);
+#endif
+}
+
 void
 ves_icall_System_Threading_Thread_ClrState (MonoInternalThread* this_obj, guint32 state)
 {
@@ -2063,7 +2105,7 @@ ves_icall_System_Threading_Thread_ClrState (MonoInternalThread* this_obj, guint3
                 * be notified, since it has to rebuild the list of threads to
                 * wait for.
                 */
-               mono_w32event_set (background_change_event);
+               signal_background_change ();
        }
 }
 
@@ -2077,7 +2119,7 @@ ves_icall_System_Threading_Thread_SetState (MonoInternalThread* this_obj, guint3
                 * be notified, since it has to rebuild the list of threads to
                 * wait for.
                 */
-               mono_w32event_set (background_change_event);
+               signal_background_change ();
        }
 }
 
@@ -2315,6 +2357,7 @@ mono_thread_suspend (MonoInternalThread *thread)
        }
        
        thread->state |= ThreadState_SuspendRequested;
+       mono_os_event_reset (thread->suspended);
 
        if (thread == mono_thread_internal_current ()) {
                /* calls UNLOCK_THREAD (thread) */
@@ -2341,7 +2384,9 @@ static gboolean
 mono_thread_resume (MonoInternalThread *thread)
 {
        if ((thread->state & ThreadState_SuspendRequested) != 0) {
+               // MOSTLY_ASYNC_SAFE_PRINTF ("RESUME (1) thread %p\n", thread_get_tid (thread));
                thread->state &= ~ThreadState_SuspendRequested;
+               mono_os_event_set (thread->suspended);
                return TRUE;
        }
 
@@ -2350,16 +2395,23 @@ mono_thread_resume (MonoInternalThread *thread)
                (thread->state & ThreadState_Aborted) != 0 || 
                (thread->state & ThreadState_Stopped) != 0)
        {
+               // MOSTLY_ASYNC_SAFE_PRINTF ("RESUME (2) thread %p\n", thread_get_tid (thread));
                return FALSE;
        }
 
-       UNLOCK_THREAD (thread);
+       // MOSTLY_ASYNC_SAFE_PRINTF ("RESUME (3) thread %p\n", thread_get_tid (thread));
 
-       /* Awake the thread */
-       if (!mono_thread_info_resume (thread_get_tid (thread)))
-               return FALSE;
+       mono_os_event_set (thread->suspended);
 
-       LOCK_THREAD (thread);
+       if (!thread->self_suspended) {
+               UNLOCK_THREAD (thread);
+
+               /* Awake the thread */
+               if (!mono_thread_info_resume (thread_get_tid (thread)))
+                       return FALSE;
+
+               LOCK_THREAD (thread);
+       }
 
        thread->state &= ~ThreadState_Suspended;
 
@@ -2827,9 +2879,13 @@ void mono_thread_init (MonoThreadStartCB start_cb,
 
        mono_os_mutex_init_recursive(&interlocked_mutex);
        mono_os_mutex_init_recursive(&joinable_threads_mutex);
+
+       mono_os_mutex_init_recursive(&thread_wait_mutex);
+       mono_os_cond_init(&thread_wait_cond);
        
-       background_change_event = mono_w32event_create (TRUE, FALSE);
-       g_assert(background_change_event != NULL);
+#ifdef HOST_WIN32
+       mono_os_event_init (&background_change_event, FALSE);
+#endif
        
        mono_init_static_data_info (&thread_static_info);
        mono_init_static_data_info (&context_static_info);
@@ -2838,25 +2894,18 @@ void mono_thread_init (MonoThreadStartCB start_cb,
 
        mono_thread_start_cb = start_cb;
        mono_thread_attach_cb = attach_cb;
-
-       /* Get a pseudo handle to the current process.  This is just a
-        * kludge so that wapi can build a process handle if needed.
-        * As a pseudo handle is returned, we don't need to clean
-        * anything up.
-        */
-       GetCurrentProcess ();
 }
 
 void mono_thread_cleanup (void)
 {
-#if !defined(RUN_IN_SUBTHREAD)
+#if !defined(RUN_IN_SUBTHREAD) && !defined(HOST_WIN32)
        /* The main thread must abandon any held mutexes (particularly
         * important for named mutexes as they are shared across
         * processes, see bug 74680.)  This will happen when the
         * thread exits, but if it's not running in a subthread it
         * won't exit in time.
         */
-       mono_thread_info_set_exited (mono_thread_info_current ());
+       mono_w32mutex_abandon ();
 #endif
 
 #if 0
@@ -2868,7 +2917,9 @@ void mono_thread_cleanup (void)
        mono_os_mutex_destroy (&interlocked_mutex);
        mono_os_mutex_destroy (&delayed_free_table_mutex);
        mono_os_mutex_destroy (&small_id_mutex);
-       CloseHandle (background_change_event);
+#ifdef HOST_WIN32
+       mono_os_event_destroy (&background_change_event);
+#endif
 #endif
 
        mono_native_tls_free (current_object_key);
@@ -2898,77 +2949,78 @@ static void print_tids (gpointer key, gpointer value, gpointer user)
        g_message ("Waiting for: %p", key);
 }
 
-struct wait_data 
-{
-       HANDLE handles[MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS];
+typedef struct {
+       int njoined;
+       MonoThreadHandle *handles[MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS];
        MonoInternalThread *threads[MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS];
        guint32 num;
-};
+} WaitData;
 
+/*
+ * wait_for_tids:
+ *
+ * Wait until either:
+ * - wait->num threads are joined
+ * - @check_state_change is TRUE and a thread changes background state
+ * - timeout elapses
+ */
 static void
-wait_for_tids (struct wait_data *wait, guint32 timeout)
+wait_for_tids (WaitData *wait, guint32 timeout, gboolean check_state_change)
 {
-       guint32 i, ret;
-       
-       THREAD_DEBUG (g_message("%s: %d threads to wait for in this batch", __func__, wait->num));
-
-       MONO_ENTER_GC_SAFE;
-       ret=WaitForMultipleObjectsEx(wait->num, wait->handles, TRUE, timeout, TRUE);
-       MONO_EXIT_GC_SAFE;
-
-       if(ret==WAIT_FAILED) {
-               /* See the comment in build_wait_tids() */
-               THREAD_DEBUG (g_message ("%s: Wait failed", __func__));
-               return;
-       }
-       
-       for(i=0; i<wait->num; i++)
-               mono_threads_close_thread_handle (wait->handles [i]);
-
-       if (ret == WAIT_TIMEOUT)
-               return;
-
-       for(i=0; i<wait->num; i++) {
-               MonoInternalThread *internal;
-
-               internal = wait->threads [i];
-
-               mono_threads_lock ();
-               if (mono_g_hash_table_lookup (threads, (gpointer) internal->tid) == internal)
-                       g_error ("%s: failed to call mono_thread_detach_internal on thread %p, InternalThread: %p", __func__, internal->tid, internal);
-               mono_threads_unlock ();
+#ifndef HOST_WIN32
+       /*
+        * Its is complicated to wait for a given set of threads, so we wait for a given
+        * number of threads instead, the caller needs to call us until the set of threads
+        * it is waiting for are terminated.
+        */
+       gboolean finished = FALSE;
+       gint64 start = mono_msec_ticks ();
+       while (!finished) {
+               thread_wait_lock ();
+               if (njoined_threads >= wait->njoined + wait->num || (check_state_change && background_changed)) {
+                       finished = TRUE;
+               } else {
+                       int res = mono_os_cond_timedwait (&thread_wait_cond, &thread_wait_mutex, timeout);
+                       if (res)
+                               finished = TRUE;
+                       if (timeout != INFINITE) {
+                               gint64 now = mono_msec_ticks ();
+                               if (now - start >= timeout) {
+                                       finished = TRUE;
+                               } else {
+                                       timeout -= now - start;
+                                       start = now;
+                               }
+                       }
+               }
+               thread_wait_unlock ();
        }
-}
+#else
+       guint32 i;
+       MonoThreadInfoWaitRet ret;
 
-static void wait_for_tids_or_state_change (struct wait_data *wait, guint32 timeout)
-{
-       guint32 i, ret, count;
-       
        THREAD_DEBUG (g_message("%s: %d threads to wait for in this batch", __func__, wait->num));
 
-       /* Add the thread state change event, so it wakes up if a thread changes
-        * to background mode.
-        */
-       count = wait->num;
-       if (count < MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
-               wait->handles [count] = background_change_event;
-               count++;
-       }
+       /* Add the thread state change event, so it wakes
+        * up if a thread changes to background mode. */
 
        MONO_ENTER_GC_SAFE;
-       ret=WaitForMultipleObjectsEx (count, wait->handles, FALSE, timeout, TRUE);
+       if (check_state_change)
+               ret = mono_thread_info_wait_multiple_handle (wait->handles, wait->num, &background_change_event, FALSE, timeout, TRUE);
+       else
+               ret = mono_thread_info_wait_multiple_handle (wait->handles, wait->num, NULL, TRUE, timeout, TRUE);
        MONO_EXIT_GC_SAFE;
 
-       if(ret==WAIT_FAILED) {
+       if (ret == MONO_THREAD_INFO_WAIT_RET_FAILED) {
                /* See the comment in build_wait_tids() */
                THREAD_DEBUG (g_message ("%s: Wait failed", __func__));
                return;
        }
        
-       for(i=0; i<wait->num; i++)
+       for( i = 0; i < wait->num; i++)
                mono_threads_close_thread_handle (wait->handles [i]);
 
-       if (ret == WAIT_TIMEOUT)
+       if (ret == MONO_THREAD_INFO_WAIT_RET_TIMEOUT)
                return;
        
        if (ret < wait->num) {
@@ -2981,75 +3033,88 @@ static void wait_for_tids_or_state_change (struct wait_data *wait, guint32 timeo
                        g_error ("%s: failed to call mono_thread_detach_internal on thread %p, InternalThread: %p", __func__, internal->tid, internal);
                mono_threads_unlock ();
        }
+#endif
 }
 
-static void build_wait_tids (gpointer key, gpointer value, gpointer user)
+static void
+init_wait_data (WaitData *wait)
 {
-       struct wait_data *wait=(struct wait_data *)user;
+       /* This is used calculate the number of joined threads in wait_for_tids () */
+       thread_wait_lock ();
+       wait->njoined = njoined_threads;
+       thread_wait_unlock ();
+       wait->num = 0;
+       /* We must zero all InternalThread pointers to avoid making the GC unhappy. */
+       memset (wait->threads, 0, MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS * SIZEOF_VOID_P);
+}
 
-       if(wait->num<MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
-               HANDLE handle;
-               MonoInternalThread *thread=(MonoInternalThread *)value;
+static void
+add_wait_thread (WaitData *wait, MonoInternalThread *thread)
+{
+#ifdef HOST_WIN32
+       /* These are not used by the wait_for_tids () code on unix */
+       wait->handles [wait->num] = mono_threads_open_thread_handle (thread->handle);
+#endif
+       wait->threads [wait->num] = thread;
+       wait->num++;
+}
 
-               /* Ignore background threads, we abort them later */
-               /* Do not lock here since it is not needed and the caller holds threads_lock */
-               if (thread->state & ThreadState_Background) {
-                       THREAD_DEBUG (g_message ("%s: ignoring background thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return; /* just leave, ignore */
-               }
+static void
+build_wait_tids (gpointer key, gpointer value, gpointer user)
+{
+       WaitData *wait = (WaitData *)user;
+       MonoInternalThread *thread = (MonoInternalThread *)value;
+
+       if (wait->num >= MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS - 1) {
+               /* Just ignore the rest, we can't do anything with
+                * them yet
+                */
+               return;
+       }
+
+       /* Ignore background threads, we abort them later */
+       /* Do not lock here since it is not needed and the caller holds threads_lock */
+       if (thread->state & ThreadState_Background) {
+               THREAD_DEBUG (g_message ("%s: ignoring background thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
+               return; /* just leave, ignore */
+       }
                
-               if (mono_gc_is_finalizer_internal_thread (thread)) {
-                       THREAD_DEBUG (g_message ("%s: ignoring finalizer thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return;
-               }
+       if (mono_gc_is_finalizer_internal_thread (thread)) {
+               THREAD_DEBUG (g_message ("%s: ignoring finalizer thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
+               return;
+       }
 
-               if (thread == mono_thread_internal_current ()) {
-                       THREAD_DEBUG (g_message ("%s: ignoring current thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return;
-               }
+       if (thread == mono_thread_internal_current ()) {
+               THREAD_DEBUG (g_message ("%s: ignoring current thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
+               return;
+       }
 
-               if (mono_thread_get_main () && (thread == mono_thread_get_main ()->internal_thread)) {
-                       THREAD_DEBUG (g_message ("%s: ignoring main thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return;
-               }
+       if (mono_thread_get_main () && (thread == mono_thread_get_main ()->internal_thread)) {
+               THREAD_DEBUG (g_message ("%s: ignoring main thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
+               return;
+       }
 
-               if (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) {
-                       THREAD_DEBUG (g_message ("%s: ignoring thread %" G_GSIZE_FORMAT "with DONT_MANAGE flag set.", __func__, (gsize)thread->tid));
-                       return;
-               }
+       if (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) {
+               THREAD_DEBUG (g_message ("%s: ignoring thread %" G_GSIZE_FORMAT "with DONT_MANAGE flag set.", __func__, (gsize)thread->tid));
+               return;
+       }
 
-               handle = mono_threads_open_thread_handle (thread->handle, thread_get_tid (thread));
-               if (handle == NULL) {
-                       THREAD_DEBUG (g_message ("%s: ignoring unopenable thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-                       return;
-               }
-               
-               THREAD_DEBUG (g_message ("%s: Invoking mono_thread_manage callback on thread %p", __func__, thread));
-               if ((thread->manage_callback == NULL) || (thread->manage_callback (thread->root_domain_thread) == TRUE)) {
-                       wait->handles[wait->num]=handle;
-                       wait->threads[wait->num]=thread;
-                       wait->num++;
+       THREAD_DEBUG (g_message ("%s: Invoking mono_thread_manage callback on thread %p", __func__, thread));
+       if ((thread->manage_callback == NULL) || (thread->manage_callback (thread->root_domain_thread) == TRUE)) {
+               add_wait_thread (wait, thread);
 
-                       THREAD_DEBUG (g_message ("%s: adding thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-               } else {
-                       THREAD_DEBUG (g_message ("%s: ignoring (because of callback) thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
-               }
-               
-               
+               THREAD_DEBUG (g_message ("%s: adding thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
        } else {
-               /* Just ignore the rest, we can't do anything with
-                * them yet
-                */
+               THREAD_DEBUG (g_message ("%s: ignoring (because of callback) thread %"G_GSIZE_FORMAT, __func__, (gsize)thread->tid));
        }
 }
 
 static gboolean
 remove_and_abort_threads (gpointer key, gpointer value, gpointer user)
 {
-       struct wait_data *wait=(struct wait_data *)user;
+       WaitData *wait = (WaitData *)user;
        MonoNativeThreadId self = mono_native_thread_id_get ();
        MonoInternalThread *thread = (MonoInternalThread *)value;
-       HANDLE handle;
 
        if (wait->num >= MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS)
                return FALSE;
@@ -3057,15 +3122,8 @@ remove_and_abort_threads (gpointer key, gpointer value, gpointer user)
        /* The finalizer thread is not a background thread */
        if (!mono_native_thread_id_equals (thread_get_tid (thread), self)
             && (thread->state & ThreadState_Background) != 0
-            && (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) == 0
-       ) {
-               handle = mono_threads_open_thread_handle (thread->handle, thread_get_tid (thread));
-               if (handle == NULL)
-                       return FALSE;
-
-               wait->handles[wait->num] = handle;
-               wait->threads[wait->num] = thread;
-               wait->num++;
+               && (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE) == 0) {
+               add_wait_thread (wait, thread);
 
                THREAD_DEBUG (g_print ("%s: Aborting id: %"G_GSIZE_FORMAT"\n", __func__, (gsize)thread->tid));
                mono_thread_internal_abort (thread);
@@ -3111,7 +3169,7 @@ mono_threads_set_shutting_down (void)
                mono_thread_detach_internal (current_thread);
 
                /* Wake up other threads potentially waiting for us */
-               mono_thread_info_exit ();
+               mono_thread_info_exit (0);
        } else {
                shutting_down = TRUE;
 
@@ -3119,18 +3177,19 @@ mono_threads_set_shutting_down (void)
                 * interrupt the main thread if it is waiting for all
                 * the other threads.
                 */
-               mono_w32event_set (background_change_event);
+               signal_background_change ();
                
                mono_threads_unlock ();
        }
 }
 
-void mono_thread_manage (void)
+void
+mono_thread_manage (void)
 {
-       struct wait_data wait_data;
-       struct wait_data *wait = &wait_data;
+       WaitData wait_data;
+       WaitData *wait = &wait_data;
 
-       memset (wait, 0, sizeof (struct wait_data));
+       memset (wait, 0, sizeof (WaitData));
        /* join each thread that's still running */
        THREAD_DEBUG (g_message ("%s: Joining each running thread...", __func__));
        
@@ -3152,18 +3211,18 @@ void mono_thread_manage (void)
                THREAD_DEBUG (g_message ("%s: There are %d threads to join", __func__, mono_g_hash_table_size (threads));
                        mono_g_hash_table_foreach (threads, print_tids, NULL));
        
-               mono_w32event_reset (background_change_event);
-               wait->num=0;
-               /*We must zero all InternalThread pointers to avoid making the GC unhappy.*/
-               memset (wait->threads, 0, MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS * SIZEOF_VOID_P);
+#ifdef HOST_WIN32
+               mono_os_event_reset (&background_change_event);
+#endif
+               background_changed = FALSE;
+               init_wait_data (wait);
                mono_g_hash_table_foreach (threads, build_wait_tids, wait);
                mono_threads_unlock ();
-               if(wait->num>0) {
+               if (wait->num > 0)
                        /* Something to wait for */
-                       wait_for_tids_or_state_change (wait, INFINITE);
-               }
+                       wait_for_tids (wait, INFINITE, TRUE);
                THREAD_DEBUG (g_message ("%s: I have %d threads after waiting.", __func__, wait->num));
-       } while(wait->num>0);
+       } while (wait->num > 0);
 
        /* Mono is shutting down, so just wait for the end */
        if (!mono_runtime_try_shutdown ()) {
@@ -3179,17 +3238,15 @@ void mono_thread_manage (void)
        do {
                mono_threads_lock ();
 
-               wait->num = 0;
-               /*We must zero all InternalThread pointers to avoid making the GC unhappy.*/
-               memset (wait->threads, 0, MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS * SIZEOF_VOID_P);
+               init_wait_data (wait);
                mono_g_hash_table_foreach_remove (threads, remove_and_abort_threads, wait);
 
                mono_threads_unlock ();
 
                THREAD_DEBUG (g_message ("%s: wait->num is now %d", __func__, wait->num));
-               if(wait->num>0) {
+               if (wait->num > 0) {
                        /* Something to wait for */
-                       wait_for_tids (wait, INFINITE);
+                       wait_for_tids (wait, INFINITE, FALSE);
                }
        } while (wait->num > 0);
        
@@ -3205,8 +3262,7 @@ static void
 collect_threads_for_suspend (gpointer key, gpointer value, gpointer user_data)
 {
        MonoInternalThread *thread = (MonoInternalThread*)value;
-       struct wait_data *wait = (struct wait_data*)user_data;
-       HANDLE handle;
+       WaitData *wait = (WaitData*)user_data;
 
        /* 
         * We try to exclude threads early, to avoid running into the MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS
@@ -3217,13 +3273,9 @@ collect_threads_for_suspend (gpointer key, gpointer value, gpointer user_data)
                (thread->state & ThreadState_Stopped) != 0)
                return;
 
-       if (wait->num<MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
-               handle = mono_threads_open_thread_handle (thread->handle, thread_get_tid (thread));
-               if (handle == NULL)
-                       return;
-
-               wait->handles [wait->num] = handle;
-               wait->threads [wait->num] = thread;
+       if (wait->num < MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
+               wait->handles[wait->num] = mono_threads_open_thread_handle (thread->handle);
+               wait->threads[wait->num] = thread;
                wait->num++;
        }
 }
@@ -3234,16 +3286,17 @@ collect_threads_for_suspend (gpointer key, gpointer value, gpointer user_data)
  *  Suspend all managed threads except the finalizer thread and this thread. It is
  * not possible to resume them later.
  */
-void mono_thread_suspend_all_other_threads (void)
+void
+mono_thread_suspend_all_other_threads (void)
 {
-       struct wait_data wait_data;
-       struct wait_data *wait = &wait_data;
+       WaitData wait_data;
+       WaitData *wait = &wait_data;
        int i;
        MonoNativeThreadId self = mono_native_thread_id_get ();
        guint32 eventidx = 0;
        gboolean starting, finished;
 
-       memset (wait, 0, sizeof (struct wait_data));
+       memset (wait, 0, sizeof (WaitData));
        /*
         * The other threads could be in an arbitrary state at this point, i.e.
         * they could be starting up, shutting down etc. This means that there could be
@@ -3269,9 +3322,7 @@ void mono_thread_suspend_all_other_threads (void)
                 * Make a copy of the hashtable since we can't do anything with
                 * threads while threads_mutex is held.
                 */
-               wait->num = 0;
-               /*We must zero all InternalThread pointers to avoid making the GC unhappy.*/
-               memset (wait->threads, 0, MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS * SIZEOF_VOID_P);
+               init_wait_data (wait);
                mono_threads_lock ();
                mono_g_hash_table_foreach (threads, collect_threads_for_suspend, wait);
                mono_threads_unlock ();
@@ -3285,8 +3336,8 @@ void mono_thread_suspend_all_other_threads (void)
                             || mono_gc_is_finalizer_internal_thread (thread)
                             || (thread->flags & MONO_THREAD_FLAG_DONT_MANAGE)
                        ) {
-                               //mono_threads_close_thread_handle (wait->handles [i]);
-                               wait->threads [i] = NULL; /* ignore this thread in next loop */
+                               mono_threads_close_thread_handle (wait->handles [i]);
+                               wait->threads [i] = NULL;
                                continue;
                        }
 
@@ -3297,7 +3348,7 @@ void mono_thread_suspend_all_other_threads (void)
                                (thread->state & ThreadState_Stopped) != 0) {
                                UNLOCK_THREAD (thread);
                                mono_threads_close_thread_handle (wait->handles [i]);
-                               wait->threads [i] = NULL; /* ignore this thread in next loop */
+                               wait->threads [i] = NULL;
                                continue;
                        }
 
@@ -3308,9 +3359,13 @@ void mono_thread_suspend_all_other_threads (void)
                                thread->state &= ~ThreadState_AbortRequested;
                        
                        thread->state |= ThreadState_SuspendRequested;
+                       mono_os_event_reset (thread->suspended);
 
                        /* Signal the thread to suspend + calls UNLOCK_THREAD (thread) */
                        async_suspend_internal (thread, TRUE);
+
+                       mono_threads_close_thread_handle (wait->handles [i]);
+                       wait->threads [i] = NULL;
                }
                if (eventidx <= 0) {
                        /* 
@@ -3731,7 +3786,7 @@ mono_thread_has_appdomain_ref (MonoThread *thread, MonoDomain *domain)
 }
 
 typedef struct abort_appdomain_data {
-       struct wait_data wait;
+       WaitData wait;
        MonoDomain *domain;
 } abort_appdomain_data;
 
@@ -3745,13 +3800,8 @@ collect_appdomain_thread (gpointer key, gpointer value, gpointer user_data)
        if (mono_thread_internal_has_appdomain_ref (thread, domain)) {
                /* printf ("ABORTING THREAD %p BECAUSE IT REFERENCES DOMAIN %s.\n", thread->tid, domain->friendly_name); */
 
-               if(data->wait.num<MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
-                       HANDLE handle = mono_threads_open_thread_handle (thread->handle, thread_get_tid (thread));
-                       if (handle == NULL)
-                               return;
-                       data->wait.handles [data->wait.num] = handle;
-                       data->wait.threads [data->wait.num] = thread;
-                       data->wait.num++;
+               if (data->wait.num < MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
+                       add_wait_thread (&data->wait, thread);
                } else {
                        /* Just ignore the rest, we can't do anything with
                         * them yet
@@ -3784,7 +3834,7 @@ mono_threads_abort_appdomain_threads (MonoDomain *domain, int timeout)
                mono_threads_lock ();
 
                user_data.domain = domain;
-               user_data.wait.num = 0;
+               init_wait_data (&user_data.wait);
                /* This shouldn't take any locks */
                mono_g_hash_table_foreach (threads, collect_appdomain_thread, &user_data);
                mono_threads_unlock ();
@@ -3798,7 +3848,7 @@ mono_threads_abort_appdomain_threads (MonoDomain *domain, int timeout)
                         * We should wait for the threads either to abort, or to leave the
                         * domain. We can't do the latter, so we wait with a timeout.
                         */
-                       wait_for_tids (&user_data.wait, 100);
+                       wait_for_tids (&user_data.wait, 100, FALSE);
                }
 
                /* Update remaining time */
@@ -4408,7 +4458,7 @@ mono_thread_request_interruption (gboolean running_managed)
                   or similar */
                /* Our implementation of this function ignores the func argument */
 #ifdef HOST_WIN32
-               QueueUserAPC ((PAPCFUNC)dummy_apc, thread->handle, (ULONG_PTR)NULL);
+               QueueUserAPC ((PAPCFUNC)dummy_apc, thread->native_handle, (ULONG_PTR)NULL);
 #else
                mono_thread_info_self_interrupt ();
 #endif
@@ -4635,11 +4685,24 @@ mono_runtime_has_tls_get (void)
 static void
 self_interrupt_thread (void *_unused)
 {
-       MonoThreadInfo *info = mono_thread_info_current ();
-       MonoException *exc = mono_thread_execute_interruption ();
-       if (exc) /*We must use _with_context since we didn't trampoline into the runtime*/
-               mono_raise_exception_with_context (exc, &info->thread_saved_state [ASYNC_SUSPEND_STATE_INDEX].ctx); /* FIXME using thread_saved_state [ASYNC_SUSPEND_STATE_INDEX] can race with another suspend coming in. */
-       g_assert_not_reached (); /*this MUST not happen since we can't resume from an async call*/
+       MonoException *exc;
+       MonoThreadInfo *info;
+
+       exc = mono_thread_execute_interruption ();
+       if (!exc) {
+               if (mono_threads_is_coop_enabled ()) {
+                       /* We can return from an async call in coop, as
+                        * it's simply called when exiting the safepoint */
+                       return;
+               }
+
+               g_error ("%s: we can't resume from an async call", __func__);
+       }
+
+       info = mono_thread_info_current ();
+
+       /* We must use _with_context since we didn't trampoline into the runtime */
+       mono_raise_exception_with_context (exc, &info->thread_saved_state [ASYNC_SUSPEND_STATE_INDEX].ctx); /* FIXME using thread_saved_state [ASYNC_SUSPEND_STATE_INDEX] can race with another suspend coming in. */
 }
 
 static gboolean
@@ -4790,9 +4853,14 @@ async_suspend_critical (MonoThreadInfo *info, gpointer ud)
        running_managed = mono_jit_info_match (ji, MONO_CONTEXT_GET_IP (&mono_thread_info_get_suspend_state (info)->ctx));
 
        if (running_managed && !protected_wrapper) {
-               thread->state &= ~ThreadState_SuspendRequested;
-               thread->state |= ThreadState_Suspended;
-               return KeepSuspended;
+               if (mono_threads_is_coop_enabled ()) {
+                       mono_thread_info_setup_async_call (info, self_interrupt_thread, NULL);
+                       return MonoResumeThread;
+               } else {
+                       thread->state &= ~ThreadState_SuspendRequested;
+                       thread->state |= ThreadState_Suspended;
+                       return KeepSuspended;
+               }
        } else {
                if (InterlockedCompareExchange (&thread->interruption_requested, 1, 0) == 0)
                        InterlockedIncrement (&thread_interruption_requested);
@@ -4811,6 +4879,10 @@ async_suspend_internal (MonoInternalThread *thread, gboolean interrupt)
 
        g_assert (thread != mono_thread_internal_current ());
 
+       // MOSTLY_ASYNC_SAFE_PRINTF ("ASYNC SUSPEND thread %p\n", thread_get_tid (thread));
+
+       thread->self_suspended = FALSE;
+
        data.thread = thread;
        data.interrupt = interrupt;
        data.interrupt_token = NULL;
@@ -4827,16 +4899,26 @@ static void
 self_suspend_internal (void)
 {
        MonoInternalThread *thread;
+       MonoOSEvent *event;
+       MonoOSEventWaitRet res;
 
        thread = mono_thread_internal_current ();
 
-       mono_thread_info_begin_self_suspend ();
+       // MOSTLY_ASYNC_SAFE_PRINTF ("SELF SUSPEND thread %p\n", thread_get_tid (thread));
+
+       thread->self_suspended = TRUE;
+
        thread->state &= ~ThreadState_SuspendRequested;
        thread->state |= ThreadState_Suspended;
 
        UNLOCK_THREAD (thread);
 
-       mono_thread_info_end_self_suspend ();
+       event = thread->suspended;
+
+       MONO_ENTER_GC_SAFE;
+       res = mono_os_event_wait_one (event, MONO_INFINITE_WAIT);
+       g_assert (res == MONO_OS_EVENT_WAIT_RET_SUCCESS_0 || res == MONO_OS_EVENT_WAIT_RET_ALERTED);
+       MONO_EXIT_GC_SAFE;
 }
 
 /*
@@ -4917,8 +4999,12 @@ mono_threads_join_threads (void)
                        if (thread != pthread_self ()) {
                                MONO_ENTER_GC_SAFE;
                                /* This shouldn't block */
-                               pthread_join (thread, NULL);
+                               mono_native_thread_join (thread);
                                MONO_EXIT_GC_SAFE;
+                               thread_wait_lock ();
+                               njoined_threads ++;
+                               mono_os_cond_signal (&thread_wait_cond);
+                               thread_wait_unlock ();
                        }
                } else {
                        break;
@@ -4953,7 +5039,7 @@ mono_thread_join (gpointer tid)
                return;
        thread = (pthread_t)tid;
        MONO_ENTER_GC_SAFE;
-       pthread_join (thread, NULL);
+       mono_native_thread_join (thread);
        MONO_EXIT_GC_SAFE;
 #endif
 }
@@ -5121,6 +5207,7 @@ mono_thread_try_resume_interruption (void)
        return mono_thread_resume_interruption ();
 }
 
+#if 0
 /* Returns TRUE if the current thread is ready to be interrupted. */
 gboolean
 mono_threads_is_ready_to_be_interrupted (void)
@@ -5142,6 +5229,7 @@ mono_threads_is_ready_to_be_interrupted (void)
        UNLOCK_THREAD (thread);
        return TRUE;
 }
+#endif
 
 void
 mono_thread_internal_describe (MonoInternalThread *internal, GString *text)
index 7be7267baa5d7bdb303b6809640bb58b9f88c18b..106bae0725557f553a4fbb760eea7b3d04a9ee74 100644 (file)
@@ -471,7 +471,8 @@ mono_class_has_default_constructor (MonoClass *klass)
        if (mono_class_has_failure (klass))
                return FALSE;
 
-       for (i = 0; i < klass->method.count; ++i) {
+       int mcount = mono_class_get_method_count (klass);
+       for (i = 0; i < mcount; ++i) {
                method = klass->methods [i];
                if (mono_method_is_constructor (method) &&
                        mono_method_signature (method) &&
@@ -529,7 +530,7 @@ mono_type_is_valid_type_in_context_full (MonoType *type, MonoGenericContext *con
                if (klass->byval_arg.type != type->type)
                        return mono_type_is_valid_type_in_context_full (&klass->byval_arg, context, check_gtd);
 
-               if (check_gtd && klass->generic_container)
+               if (check_gtd && mono_class_is_gtd (klass))
                        return FALSE;
                break;
        }
@@ -597,11 +598,11 @@ is_valid_generic_instantiation (MonoGenericContainer *gc, MonoGenericContext *co
                 * The type A <K> has a parent B<K>, that is inflated into the GTD B<>.
                 * Since A<K> is open, thus not instantiatable, this is valid.
                 */
-               if (paramClass->generic_container && param_type->type != MONO_TYPE_GENERICINST && !ginst->is_open)
+               if (mono_class_is_gtd (paramClass) && param_type->type != MONO_TYPE_GENERICINST && !ginst->is_open)
                        return FALSE;
 
                /*it's not safe to call mono_class_init from here*/
-               if (paramClass->generic_class && !paramClass->inited) {
+               if (mono_class_is_ginst (paramClass) && !paramClass->inited) {
                        if (!mono_class_is_valid_generic_instantiation (NULL, paramClass))
                                return FALSE;
                }
@@ -754,9 +755,9 @@ verifier_get_generic_param_from_type (VerifyContext *ctx, MonoType *type)
 
        if (type->type == MONO_TYPE_VAR) {
                MonoClass *gtd = method->klass;
-               if (gtd->generic_class)
-                       gtd = gtd->generic_class->container_class;
-               gc = gtd->generic_container;
+               if (mono_class_is_ginst (gtd))
+                       gtd = mono_class_get_generic_class (gtd)->container_class;
+               gc = mono_class_try_get_generic_container (gtd);
        } else { //MVAR
                MonoMethod *gmd = method;
                if (method->is_inflated)
@@ -831,9 +832,9 @@ mono_method_repect_method_constraints (VerifyContext *ctx, MonoMethod *method)
 static gboolean
 mono_class_repect_method_constraints (VerifyContext *ctx, MonoClass *klass)
 {
-       MonoGenericClass *gklass = klass->generic_class;
+       MonoGenericClass *gklass = mono_class_get_generic_class (klass);
        MonoGenericInst *ginst = gklass->context.class_inst;
-       MonoGenericContainer *gc = gklass->container_class->generic_container;
+       MonoGenericContainer *gc = mono_class_get_generic_container (gklass->container_class);
        return !gc || generic_arguments_respect_constraints (ctx, gc, &gklass->context, ginst);
 }
 
@@ -854,9 +855,9 @@ mono_method_is_valid_generic_instantiation (VerifyContext *ctx, MonoMethod *meth
 static gboolean
 mono_class_is_valid_generic_instantiation (VerifyContext *ctx, MonoClass *klass)
 {
-       MonoGenericClass *gklass = klass->generic_class;
+       MonoGenericClass *gklass = mono_class_get_generic_class (klass);
        MonoGenericInst *ginst = gklass->context.class_inst;
-       MonoGenericContainer *gc = gklass->container_class->generic_container;
+       MonoGenericContainer *gc = mono_class_get_generic_container (gklass->container_class);
        if (ctx && !is_valid_generic_instantiation_in_context (ctx, ginst, TRUE))
                return FALSE;
        return is_valid_generic_instantiation (gc, &gklass->context, ginst);
@@ -887,19 +888,19 @@ mono_type_is_valid_in_context (VerifyContext *ctx, MonoType *type)
        klass = mono_class_from_mono_type (type);
        mono_class_init (klass);
        if (mono_class_has_failure (klass)) {
-               if (klass->generic_class && !mono_class_is_valid_generic_instantiation (NULL, klass))
+               if (mono_class_is_ginst (klass) && !mono_class_is_valid_generic_instantiation (NULL, klass))
                        ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Invalid generic instantiation of type %s.%s at 0x%04x", klass->name_space, klass->name, ctx->ip_offset), MONO_EXCEPTION_TYPE_LOAD);
                else
                        ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Could not load type %s.%s at 0x%04x", klass->name_space, klass->name, ctx->ip_offset), MONO_EXCEPTION_TYPE_LOAD);
                return FALSE;
        }
 
-       if (klass->generic_class && mono_class_has_failure (klass->generic_class->container_class)) {
+       if (mono_class_is_ginst (klass) && mono_class_has_failure (mono_class_get_generic_class (klass)->container_class)) {
                ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Could not load type %s.%s at 0x%04x", klass->name_space, klass->name, ctx->ip_offset), MONO_EXCEPTION_TYPE_LOAD);
                return FALSE;
        }
 
-       if (!klass->generic_class)
+       if (!mono_class_is_ginst (klass))
                return TRUE;
 
        if (!mono_class_is_valid_generic_instantiation (ctx, klass)) {
@@ -1678,7 +1679,7 @@ get_boxable_mono_type (VerifyContext* ctx, int token, const char *opcode)
        if (!(klass = mono_class_from_mono_type (type)))
                ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Could not retrieve type token for %s at 0x%04x", opcode, ctx->ip_offset));
 
-       if (klass->generic_container && type->type != MONO_TYPE_GENERICINST)
+       if (mono_class_is_gtd (klass) && type->type != MONO_TYPE_GENERICINST)
                CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use the generic type definition in a boxable type position for %s at 0x%04x", opcode, ctx->ip_offset));      
 
        check_unverifiable_type (ctx, type);
@@ -2188,14 +2189,14 @@ verifier_class_is_assignable_from (MonoClass *target, MonoClass *candidate)
        if (mono_class_is_assignable_from (target, candidate))
                return TRUE;
 
-       if (!MONO_CLASS_IS_INTERFACE (target) || !target->generic_class || candidate->rank != 1)
+       if (!MONO_CLASS_IS_INTERFACE (target) || !mono_class_is_ginst (target) || candidate->rank != 1)
                return FALSE;
 
-       iface_gtd = target->generic_class->container_class;
+       iface_gtd = mono_class_get_generic_class (target)->container_class;
        if (iface_gtd != mono_defaults.generic_ilist_class && iface_gtd != get_icollection_class () && iface_gtd != get_ienumerable_class ())
                return FALSE;
 
-       target = mono_class_from_mono_type (target->generic_class->context.class_inst->type_argv [0]);
+       target = mono_class_from_mono_type (mono_class_get_generic_class (target)->context.class_inst->type_argv [0]);
        candidate = candidate->element_class;
 
        return TRUE;
@@ -2674,7 +2675,7 @@ verify_ldftn_delegate (VerifyContext *ctx, MonoClass *delegate, ILStackDesc *val
         * the object is a this arg (comes from a ldarg.0), and there is no starg.0.
         * This rules doesn't apply if the object on stack is a boxed valuetype.
         */
-       if ((method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !(method->flags & METHOD_ATTRIBUTE_FINAL) && !(method->klass->flags & TYPE_ATTRIBUTE_SEALED) && !stack_slot_is_boxed_value (value)) {
+       if ((method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !(method->flags & METHOD_ATTRIBUTE_FINAL) && !mono_class_is_sealed (method->klass) && !stack_slot_is_boxed_value (value)) {
                /*A stdarg 0 must not happen, we fail here only in fail fast mode to avoid double error reports*/
                if (IS_FAIL_FAST_MODE (ctx) && ctx->has_this_store)
                        CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Invalid ldftn with virtual function in method with stdarg 0 at  0x%04x", ctx->ip_offset));
@@ -3166,7 +3167,7 @@ do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual_)
                if (method->flags & METHOD_ATTRIBUTE_ABSTRACT) 
                        CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use call with an abstract method at 0x%04x", ctx->ip_offset));
                
-               if ((method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !(method->flags & METHOD_ATTRIBUTE_FINAL) && !(method->klass->flags & TYPE_ATTRIBUTE_SEALED)) {
+               if ((method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !(method->flags & METHOD_ATTRIBUTE_FINAL) && !mono_class_is_sealed (method->klass)) {
                        virt_check_this = TRUE;
                        ctx->code [ctx->ip_offset].flags |= IL_CODE_CALL_NONFINAL_VIRTUAL;
                }
@@ -3811,7 +3812,7 @@ do_newobj (VerifyContext *ctx, int token)
                return;
        }
 
-       if (method->klass->flags & (TYPE_ATTRIBUTE_ABSTRACT | TYPE_ATTRIBUTE_INTERFACE))
+       if (mono_class_get_flags (method->klass) & (TYPE_ATTRIBUTE_ABSTRACT | TYPE_ATTRIBUTE_INTERFACE))
                CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Trying to instantiate an abstract or interface type at 0x%04x", ctx->ip_offset));
 
        if (!IS_SKIP_VISIBILITY (ctx) && !mono_method_can_access_method_full (ctx->method, method, NULL)) {
@@ -4643,7 +4644,7 @@ merge_stacks (VerifyContext *ctx, ILCodeDesc *from, ILCodeDesc *to, gboolean sta
                        }
 
                        /* if old class is an interface that new class implements */
-                       if (old_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+                       if (mono_class_is_interface (old_class)) {
                                if (verifier_class_is_assignable_from (old_class, new_class)) {
                                        match_class = old_class;
                                        goto match_found;       
@@ -4656,7 +4657,7 @@ merge_stacks (VerifyContext *ctx, ILCodeDesc *from, ILCodeDesc *to, gboolean sta
                                }
                        }
 
-                       if (new_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+                       if (mono_class_is_interface (new_class)) {
                                if (verifier_class_is_assignable_from (new_class, old_class)) {
                                        match_class = new_class;
                                        goto match_found;       
@@ -4848,7 +4849,7 @@ mono_method_verify (MonoMethod *method, int level)
                finish_collect_stats ();
                return ctx.list;
        }
-       if (!method->is_generic && !method->klass->is_generic && ctx.signature->has_type_parameters) {
+       if (!method->is_generic && !mono_class_is_gtd (method->klass) && ctx.signature->has_type_parameters) {
                ADD_VERIFY_ERROR (&ctx, g_strdup_printf ("Method and signature don't match in terms of genericity"));
                finish_collect_stats ();
                return ctx.list;
@@ -4895,11 +4896,11 @@ mono_method_verify (MonoMethod *method, int level)
        if (ctx.signature->is_inflated)
                ctx.generic_context = generic_context = mono_method_get_context (method);
 
-       if (!generic_context && (method->klass->generic_container || method->is_generic)) {
+       if (!generic_context && (mono_class_is_gtd (method->klass) || method->is_generic)) {
                if (method->is_generic)
                        ctx.generic_context = generic_context = &(mono_method_get_generic_container (method)->context);
                else
-                       ctx.generic_context = generic_context = &method->klass->generic_container->context;
+                       ctx.generic_context = generic_context = &mono_class_get_generic_container (method->klass)->context;
        }
 
        for (i = 0; i < ctx.num_locals; ++i) {
@@ -6102,7 +6103,7 @@ verify_class_for_overlapping_reference_fields (MonoClass *klass)
        MonoClassField *field;
        gboolean is_fulltrust = mono_verifier_is_class_full_trust (klass);
        /*We can't skip types with !has_references since this is calculated after we have run.*/
-       if (!((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT))
+       if (!mono_class_is_explicit_layout (klass))
                return TRUE;
 
 
@@ -6117,7 +6118,8 @@ verify_class_for_overlapping_reference_fields (MonoClass *klass)
                if (mono_field_is_deleted (field) || (field->type->attrs & FIELD_ATTRIBUTE_STATIC))
                        continue;
 
-               for (j = i; j < klass->field.count; ++j) {
+               int fcount = mono_class_get_field_count (klass);
+               for (j = i; j < fcount; ++j) {
                        MonoClassField *other = &klass->fields [j];
                        int otherEnd = get_field_end (other);
                        if (mono_field_is_deleted (other) || (is_valuetype && !MONO_TYPE_IS_REFERENCE (other->type)) || (other->type->attrs & FIELD_ATTRIBUTE_STATIC))
@@ -6156,8 +6158,8 @@ verify_class_fields (MonoClass *klass)
        MonoClassField *field;
        MonoGenericContext *context = mono_class_get_context (klass);
        GHashTable *unique_fields = g_hash_table_new_full (&field_hash, &field_equals, NULL, NULL);
-       if (klass->generic_container)
-               context = &klass->generic_container->context;
+       if (mono_class_is_gtd (klass))
+               context = &mono_class_get_generic_container (klass)->context;
 
        while ((field = mono_class_get_fields (klass, &iter)) != NULL) {
                if (!mono_type_is_valid_type_in_context (field->type, context)) {
@@ -6180,7 +6182,7 @@ verify_interfaces (MonoClass *klass)
        int i;
        for (i = 0; i < klass->interface_count; ++i) {
                MonoClass *iface = klass->interfaces [i];
-               if (!(iface->flags & TYPE_ATTRIBUTE_INTERFACE))
+               if (!mono_class_get_flags (iface))
                        return FALSE;
        }
        return TRUE;
@@ -6259,7 +6261,7 @@ static gboolean
 verify_generic_parameters (MonoClass *klass)
 {
        int i;
-       MonoGenericContainer *gc = klass->generic_container;
+       MonoGenericContainer *gc = mono_class_get_generic_container (klass);
        MonoBitSet *used_args = mono_bitset_new (gc->type_argc, 0);
 
        for (i = 0; i < gc->type_argc; ++i) {
@@ -6284,7 +6286,7 @@ verify_generic_parameters (MonoClass *klass)
 
                        if (mono_type_is_generic_argument (constraint_type) && !recursive_mark_constraint_args (used_args, gc, constraint_type))
                                goto fail;
-                       if (ctr->generic_class && !mono_class_is_valid_generic_instantiation (NULL, ctr))
+                       if (mono_class_is_ginst (ctr) && !mono_class_is_valid_generic_instantiation (NULL, ctr))
                                goto fail;
                }
        }
@@ -6317,25 +6319,25 @@ mono_verifier_verify_class (MonoClass *klass)
        if (klass->parent) {
                if (MONO_CLASS_IS_INTERFACE (klass->parent))
                        return FALSE;
-               if (!klass->generic_class && klass->parent->generic_container)
+               if (!mono_class_is_ginst (klass) && mono_class_is_gtd (klass->parent))
                        return FALSE;
-               if (klass->parent->generic_class && !klass->generic_class) {
+               if (mono_class_is_ginst (klass->parent) && !mono_class_is_ginst (klass)) {
                        MonoGenericContext *context = mono_class_get_context (klass);
-                       if (klass->generic_container)
-                               context = &klass->generic_container->context;
+                       if (mono_class_is_gtd (klass))
+                               context = &mono_class_get_generic_container (klass)->context;
                        if (!mono_type_is_valid_type_in_context (&klass->parent->byval_arg, context))
                                return FALSE;
                }
        }
-       if (klass->generic_container && (klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT)
+       if (mono_class_is_gtd (klass) && (mono_class_is_explicit_layout (klass)))
                return FALSE;
-       if (klass->generic_container && !verify_generic_parameters (klass))
+       if (mono_class_is_gtd (klass) && !verify_generic_parameters (klass))
                return FALSE;
        if (!verify_class_for_overlapping_reference_fields (klass))
                return FALSE;
-       if (klass->generic_class && !mono_class_is_valid_generic_instantiation (NULL, klass))
+       if (mono_class_is_ginst (klass) && !mono_class_is_valid_generic_instantiation (NULL, klass))
                return FALSE;
-       if (klass->generic_class == NULL && !verify_class_fields (klass))
+       if (!mono_class_is_ginst (klass) && !verify_class_fields (klass))
                return FALSE;
        if (klass->valuetype && !verify_valuetype_layout (klass))
                return FALSE;
index 75f52c6628f35dcb0f44d9340eb1c971996b373a..bc4b2d293dd4771fa01947fb4e37cca1ecb67e56 100644 (file)
@@ -4,6 +4,7 @@
 #include <mono/metadata/metadata.h>
 #include <mono/metadata/image.h>
 #include <mono/metadata/loader.h>
+#include <mono/metadata/class-internals.h>
 #include <glib.h> /* GSList dep */
 
 MONO_BEGIN_DECLS
@@ -48,7 +49,7 @@ typedef struct {
 
 typedef struct {
        MonoVerifyInfo info;
-       int8_t exception_type; /*should be one of MONO_EXCEPTION_* */
+       MonoExceptionType exception_type : 8; /*should be one of MONO_EXCEPTION_* */
 } MonoVerifyInfoExtended;
 
 
index 5644ce7d27b1eb708aa47933e1acca5b0be7b44d..6c95aaf56c9e97a4f48828e29a602be528d04970 100644 (file)
@@ -12,7 +12,7 @@
 #include "w32handle-namespace.h"
 #include "mono/io-layer/io-layer.h"
 #include "mono/utils/mono-logger-internals.h"
-#include "mono/utils/w32handle.h"
+#include "mono/metadata/w32handle.h"
 
 typedef struct {
        gboolean manual;
@@ -34,12 +34,12 @@ static gboolean event_handle_own (gpointer handle, MonoW32HandleType type, guint
        ok = mono_w32handle_lookup (handle, type, (gpointer *)&event_handle);
        if (!ok) {
                g_warning ("%s: error looking up %s handle %p",
-                       __func__, mono_w32handle_ops_typename (type), handle);
+                       __func__, mono_w32handle_get_typename (type), handle);
                return FALSE;
        }
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: owning %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
        if (!event_handle->manual) {
                g_assert (event_handle->set_count > 0);
@@ -171,7 +171,6 @@ mono_w32event_reset (gpointer handle)
 static gpointer event_handle_create (MonoW32HandleEvent *event_handle, MonoW32HandleType type, gboolean manual, gboolean initial)
 {
        gpointer handle;
-       int thr_ret;
 
        event_handle->manual = manual;
        event_handle->set_count = (initial && !manual) ? 1 : 0;
@@ -179,22 +178,20 @@ static gpointer event_handle_create (MonoW32HandleEvent *event_handle, MonoW32Ha
        handle = mono_w32handle_new (type, event_handle);
        if (handle == INVALID_HANDLE_VALUE) {
                g_warning ("%s: error creating %s handle",
-                       __func__, mono_w32handle_ops_typename (type));
+                       __func__, mono_w32handle_get_typename (type));
                SetLastError (ERROR_GEN_FAILURE);
                return NULL;
        }
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
 
        if (initial)
                mono_w32handle_set_signal_state (handle, TRUE, FALSE);
 
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: created %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
        return handle;
 }
@@ -203,7 +200,7 @@ static gpointer event_create (gboolean manual, gboolean initial)
 {
        MonoW32HandleEvent event_handle;
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle",
-               __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_EVENT));
+               __func__, mono_w32handle_get_typename (MONO_W32HANDLE_EVENT));
        return event_handle_create (&event_handle, MONO_W32HANDLE_EVENT, manual, initial);
 }
 
@@ -213,7 +210,7 @@ static gpointer namedevent_create (gboolean manual, gboolean initial, const guni
        gchar *utf8_name;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle",
-               __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDEVENT));
+               __func__, mono_w32handle_get_typename (MONO_W32HANDLE_NAMEDEVENT));
 
        /* w32 seems to guarantee that opening named objects can't race each other */
        mono_w32handle_namespace_lock ();
@@ -269,7 +266,6 @@ ves_icall_System_Threading_Events_SetEvent_internal (gpointer handle)
 {
        MonoW32HandleType type;
        MonoW32HandleEvent *event_handle;
-       int thr_ret;
 
        if (handle == NULL) {
                SetLastError (ERROR_INVALID_HANDLE);
@@ -287,15 +283,14 @@ ves_icall_System_Threading_Events_SetEvent_internal (gpointer handle)
 
        if (!mono_w32handle_lookup (handle, type, (gpointer *)&event_handle)) {
                g_warning ("%s: error looking up %s handle %p",
-                       __func__, mono_w32handle_ops_typename (type), handle);
+                       __func__, mono_w32handle_get_typename (type), handle);
                return FALSE;
        }
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: setting %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
 
        if (!event_handle->manual) {
                event_handle->set_count = 1;
@@ -304,8 +299,7 @@ ves_icall_System_Threading_Events_SetEvent_internal (gpointer handle)
                mono_w32handle_set_signal_state (handle, TRUE, TRUE);
        }
 
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
 
        return TRUE;
 }
@@ -315,7 +309,6 @@ ves_icall_System_Threading_Events_ResetEvent_internal (gpointer handle)
 {
        MonoW32HandleType type;
        MonoW32HandleEvent *event_handle;
-       int thr_ret;
 
        SetLastError (ERROR_SUCCESS);
 
@@ -335,30 +328,28 @@ ves_icall_System_Threading_Events_ResetEvent_internal (gpointer handle)
 
        if (!mono_w32handle_lookup (handle, type, (gpointer *)&event_handle)) {
                g_warning ("%s: error looking up %s handle %p",
-                       __func__, mono_w32handle_ops_typename (type), handle);
+                       __func__, mono_w32handle_get_typename (type), handle);
                return FALSE;
        }
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: resetting %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
 
        if (!mono_w32handle_issignalled (handle)) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: no need to reset %s handle %p",
-                       __func__, mono_w32handle_ops_typename (type), handle);
+                       __func__, mono_w32handle_get_typename (type), handle);
        } else {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: obtained write lock on %s handle %p",
-                       __func__, mono_w32handle_ops_typename (type), handle);
+                       __func__, mono_w32handle_get_typename (type), handle);
 
                mono_w32handle_set_signal_state (handle, FALSE, FALSE);
        }
 
        event_handle->set_count = 0;
 
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
 
        return TRUE;
 }
index 1ca4e1dd8c57162da5177bc0eaacafe6fad0166c..2eb2145533b6d804c6e285cc7848803e38e1e8cf 100644 (file)
@@ -84,7 +84,7 @@ mono_w32handle_namespace_search_handle_callback (gpointer handle, gpointer data,
                if (type != search_data->type) {
                        /* Its the wrong type, so fail now */
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p matches name but is wrong type: %s",
-                               __func__, handle, mono_w32handle_ops_typename (type));
+                               __func__, handle, mono_w32handle_get_typename (type));
                        search_data->ret = INVALID_HANDLE_VALUE;
                } else {
                        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: handle %p matches name and type",
@@ -111,7 +111,7 @@ mono_w32handle_namespace_search_handle (MonoW32HandleType type, gchar *name)
                g_error ("%s: type %s does not have a namespace", __func__, type);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Lookup for handle named [%s] type %s",
-               __func__, name, mono_w32handle_ops_typename (type));
+               __func__, name, mono_w32handle_get_typename (type));
 
        search_data.ret = NULL;
        search_data.type = type;
index 5a2547774d49e6f80be7a883e4fa4f7a1cfa3956..75797a80d65e0fba735a99fad2b2b916d85bf9a6 100644 (file)
@@ -5,7 +5,7 @@
 #include <config.h>
 #include <glib.h>
 
-#include "mono/utils/w32handle.h"
+#include "mono/metadata/w32handle.h"
 
 #define MONO_W32HANDLE_NAMESPACE_MAX_PATH 260
 
diff --git a/mono/metadata/w32handle.c b/mono/metadata/w32handle.c
new file mode 100644 (file)
index 0000000..ef3b248
--- /dev/null
@@ -0,0 +1,1452 @@
+/*
+ * w32handle.c:  Generic and internal operations on handles
+ *
+ * Author:
+ *     Dick Porter (dick@ximian.com)
+ *     Ludovic Henry (luhenry@microsoft.com)
+ *
+ * (C) 2002-2011 Novell, Inc.
+ * Copyright 2011 Xamarin Inc
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include "w32handle.h"
+
+#include "utils/atomic.h"
+#include "utils/mono-logger-internals.h"
+#include "utils/mono-os-mutex.h"
+#include "utils/mono-proclib.h"
+#include "utils/mono-threads.h"
+#include "utils/mono-time.h"
+
+#undef DEBUG_REFS
+
+#define SLOT_MAX               (1024 * 16)
+
+/* must be a power of 2 */
+#define HANDLE_PER_SLOT        (256)
+
+#define INFINITE 0xFFFFFFFF
+
+typedef struct {
+       MonoW32HandleType type;
+       guint ref;
+       gboolean signalled;
+       mono_mutex_t signal_mutex;
+       mono_cond_t signal_cond;
+       gpointer specific;
+} MonoW32HandleBase;
+
+static MonoW32HandleCapability handle_caps [MONO_W32HANDLE_COUNT];
+static MonoW32HandleOps *handle_ops [MONO_W32HANDLE_COUNT];
+
+/*
+ * We can hold SLOT_MAX * HANDLE_PER_SLOT handles.
+ * If 4M handles are not enough... Oh, well... we will crash.
+ */
+#define SLOT_INDEX(x)  (x / HANDLE_PER_SLOT)
+#define SLOT_OFFSET(x) (x % HANDLE_PER_SLOT)
+
+static MonoW32HandleBase *private_handles [SLOT_MAX];
+static guint32 private_handles_count = 0;
+static guint32 private_handles_slots_count = 0;
+
+guint32 mono_w32handle_fd_reserve;
+
+/*
+ * This is an internal handle which is used for handling waiting for multiple handles.
+ * Threads which wait for multiple handles wait on this one handle, and when a handle
+ * is signalled, this handle is signalled too.
+ */
+static mono_mutex_t global_signal_mutex;
+static mono_cond_t global_signal_cond;
+
+static mono_mutex_t scan_mutex;
+
+static gboolean shutting_down = FALSE;
+
+static gboolean
+type_is_fd (MonoW32HandleType type)
+{
+       switch (type) {
+       case MONO_W32HANDLE_FILE:
+       case MONO_W32HANDLE_CONSOLE:
+       case MONO_W32HANDLE_SOCKET:
+       case MONO_W32HANDLE_PIPE:
+               return TRUE;
+       default:
+               return FALSE;
+       }
+}
+
+static gboolean
+mono_w32handle_lookup_data (gpointer handle, MonoW32HandleBase **handle_data)
+{
+       gsize index, offset;
+
+       g_assert (handle_data);
+
+       index = SLOT_INDEX ((gsize) handle);
+       if (index >= SLOT_MAX)
+               return FALSE;
+       if (!private_handles [index])
+               return FALSE;
+
+       offset = SLOT_OFFSET ((gsize) handle);
+       if (private_handles [index][offset].type == MONO_W32HANDLE_UNUSED)
+               return FALSE;
+
+       *handle_data = &private_handles [index][offset];
+       return TRUE;
+}
+
+MonoW32HandleType
+mono_w32handle_get_type (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data))
+               return MONO_W32HANDLE_UNUSED;   /* An impossible type */
+
+       return handle_data->type;
+}
+
+static const gchar*
+mono_w32handle_ops_typename (MonoW32HandleType type);
+
+const gchar*
+mono_w32handle_get_typename (MonoW32HandleType type)
+{
+       return mono_w32handle_ops_typename (type);
+}
+
+void
+mono_w32handle_set_signal_state (gpointer handle, gboolean state, gboolean broadcast)
+{
+       MonoW32HandleBase *handle_data;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return;
+       }
+
+#ifdef DEBUG
+       g_message ("%s: setting state of %p to %s (broadcast %s)", __func__,
+                  handle, state?"TRUE":"FALSE", broadcast?"TRUE":"FALSE");
+#endif
+
+       if (state == TRUE) {
+               /* Tell everyone blocking on a single handle */
+
+               /* The condition the global signal cond is waiting on is the signalling of
+                * _any_ handle. So lock it before setting the signalled state.
+                */
+               mono_os_mutex_lock (&global_signal_mutex);
+
+               /* This function _must_ be called with
+                * handle->signal_mutex locked
+                */
+               handle_data->signalled=state;
+
+               if (broadcast == TRUE) {
+                       mono_os_cond_broadcast (&handle_data->signal_cond);
+               } else {
+                       mono_os_cond_signal (&handle_data->signal_cond);
+               }
+
+               /* Tell everyone blocking on multiple handles that something
+                * was signalled
+                */
+               mono_os_cond_broadcast (&global_signal_cond);
+
+               mono_os_mutex_unlock (&global_signal_mutex);
+       } else {
+               handle_data->signalled=state;
+       }
+}
+
+gboolean
+mono_w32handle_issignalled (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return(FALSE);
+       }
+
+       return handle_data->signalled;
+}
+
+static void
+mono_w32handle_lock_signal_mutex (void)
+{
+#ifdef DEBUG
+       g_message ("%s: lock global signal mutex", __func__);
+#endif
+
+       mono_os_mutex_lock (&global_signal_mutex);
+}
+
+static void
+mono_w32handle_unlock_signal_mutex (void)
+{
+#ifdef DEBUG
+       g_message ("%s: unlock global signal mutex", __func__);
+#endif
+
+       mono_os_mutex_unlock (&global_signal_mutex);
+}
+
+void
+mono_w32handle_lock_handle (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data))
+               g_error ("%s: failed to lookup handle %p", __func__, handle);
+
+       mono_w32handle_ref (handle);
+
+       mono_os_mutex_lock (&handle_data->signal_mutex);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: lock handle %p", __func__, handle);
+}
+
+gboolean
+mono_w32handle_trylock_handle (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+       gboolean locked;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: trylock handle %p", __func__, handle);
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data))
+               g_error ("%s: failed to lookup handle %p", __func__, handle);
+
+       mono_w32handle_ref (handle);
+
+       locked = mono_os_mutex_trylock (&handle_data->signal_mutex) == 0;
+       if (!locked)
+               mono_w32handle_unref (handle);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: trylock handle %p, locked: %s", __func__, handle, locked ? "true" : "false");
+
+       return locked;
+}
+
+void
+mono_w32handle_unlock_handle (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data))
+               g_error ("%s: failed to lookup handle %p", __func__, handle);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: unlock handle %p", __func__, handle);
+
+       mono_os_mutex_unlock (&handle_data->signal_mutex);
+
+       mono_w32handle_unref (handle);
+}
+
+/*
+ * wapi_init:
+ *
+ *   Initialize the io-layer.
+ */
+void
+mono_w32handle_init (void)
+{
+       static gboolean initialized = FALSE;
+
+       if (initialized)
+               return;
+
+       g_assert ((sizeof (handle_ops) / sizeof (handle_ops[0]))
+                 == MONO_W32HANDLE_COUNT);
+
+       /* This is needed by the code in mono_w32handle_new_internal */
+       mono_w32handle_fd_reserve = (eg_getdtablesize () + (HANDLE_PER_SLOT - 1)) & ~(HANDLE_PER_SLOT - 1);
+
+       do {
+               /*
+                * The entries in private_handles reserved for fds are allocated lazily to
+                * save memory.
+                */
+
+               private_handles_count += HANDLE_PER_SLOT;
+               private_handles_slots_count ++;
+       } while(mono_w32handle_fd_reserve > private_handles_count);
+
+       mono_os_mutex_init (&scan_mutex);
+
+       mono_os_cond_init (&global_signal_cond);
+       mono_os_mutex_init (&global_signal_mutex);
+
+       initialized = TRUE;
+}
+
+void
+mono_w32handle_cleanup (void)
+{
+       int i, j, k;
+
+       g_assert (!shutting_down);
+       shutting_down = TRUE;
+
+       /* Every shared handle we were using ought really to be closed
+        * by now, but to make sure just blow them all away.  The
+        * exiting finalizer thread in particular races us to the
+        * program exit and doesn't always win, so it can be left
+        * cluttering up the shared file.  Anything else left over is
+        * really a bug.
+        */
+       for(i = SLOT_INDEX (0); private_handles[i] != NULL; i++) {
+               for(j = SLOT_OFFSET (0); j < HANDLE_PER_SLOT; j++) {
+                       MonoW32HandleBase *handle_data = &private_handles[i][j];
+                       gpointer handle = GINT_TO_POINTER (i*HANDLE_PER_SLOT+j);
+
+                       for(k = handle_data->ref; k > 0; k--) {
+                               mono_w32handle_unref (handle);
+                       }
+               }
+       }
+
+       for (i = 0; i < SLOT_MAX; ++i)
+               g_free (private_handles [i]);
+}
+
+static gsize
+mono_w32handle_ops_typesize (MonoW32HandleType type);
+
+static void mono_w32handle_init_handle (MonoW32HandleBase *handle,
+                              MonoW32HandleType type, gpointer handle_specific)
+{
+       g_assert (handle->ref == 0);
+
+       handle->type = type;
+       handle->signalled = FALSE;
+       handle->ref = 1;
+
+       mono_os_cond_init (&handle->signal_cond);
+       mono_os_mutex_init (&handle->signal_mutex);
+
+       if (handle_specific)
+               handle->specific = g_memdup (handle_specific, mono_w32handle_ops_typesize (type));
+}
+
+/*
+ * mono_w32handle_new_internal:
+ * @type: Init handle to this type
+ *
+ * Search for a free handle and initialize it. Return the handle on
+ * success and 0 on failure.  This is only called from
+ * mono_w32handle_new, and scan_mutex must be held.
+ */
+static guint32 mono_w32handle_new_internal (MonoW32HandleType type,
+                                         gpointer handle_specific)
+{
+       guint32 i, k, count;
+       static guint32 last = 0;
+       gboolean retry = FALSE;
+       
+       /* A linear scan should be fast enough.  Start from the last
+        * allocation, assuming that handles are allocated more often
+        * than they're freed. Leave the space reserved for file
+        * descriptors
+        */
+
+       if (last < mono_w32handle_fd_reserve) {
+               last = mono_w32handle_fd_reserve;
+       } else {
+               retry = TRUE;
+       }
+
+again:
+       count = last;
+       for(i = SLOT_INDEX (count); i < private_handles_slots_count; i++) {
+               if (private_handles [i]) {
+                       for (k = SLOT_OFFSET (count); k < HANDLE_PER_SLOT; k++) {
+                               MonoW32HandleBase *handle = &private_handles [i][k];
+
+                               if(handle->type == MONO_W32HANDLE_UNUSED) {
+                                       last = count + 1;
+
+                                       mono_w32handle_init_handle (handle, type, handle_specific);
+                                       return (count);
+                               }
+                               count++;
+                       }
+               }
+       }
+
+       if(retry && last > mono_w32handle_fd_reserve) {
+               /* Try again from the beginning */
+               last = mono_w32handle_fd_reserve;
+               goto again;
+       }
+
+       /* Will need to expand the array.  The caller will sort it out */
+
+       return(0);
+}
+
+gpointer
+mono_w32handle_new (MonoW32HandleType type, gpointer handle_specific)
+{
+       guint32 handle_idx = 0;
+       gpointer handle;
+
+       g_assert (!shutting_down);
+
+       g_assert(!type_is_fd(type));
+
+       mono_os_mutex_lock (&scan_mutex);
+
+       while ((handle_idx = mono_w32handle_new_internal (type, handle_specific)) == 0) {
+               /* Try and expand the array, and have another go */
+               int idx = SLOT_INDEX (private_handles_count);
+               if (idx >= SLOT_MAX) {
+                       break;
+               }
+
+               private_handles [idx] = g_new0 (MonoW32HandleBase, HANDLE_PER_SLOT);
+
+               private_handles_count += HANDLE_PER_SLOT;
+               private_handles_slots_count ++;
+       }
+
+       mono_os_mutex_unlock (&scan_mutex);
+
+       if (handle_idx == 0) {
+               /* We ran out of slots */
+               handle = INVALID_HANDLE_VALUE;
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle", __func__, mono_w32handle_ops_typename (type));
+               goto done;
+       }
+
+       /* Make sure we left the space for fd mappings */
+       g_assert (handle_idx >= mono_w32handle_fd_reserve);
+
+       handle = GUINT_TO_POINTER (handle_idx);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: create %s handle %p", __func__, mono_w32handle_ops_typename (type), handle);
+
+done:
+       return(handle);
+}
+
+gpointer mono_w32handle_new_fd (MonoW32HandleType type, int fd,
+                             gpointer handle_specific)
+{
+       MonoW32HandleBase *handle_data;
+       int fd_index, fd_offset;
+
+       g_assert (!shutting_down);
+
+       g_assert(type_is_fd(type));
+
+       if (fd >= mono_w32handle_fd_reserve) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle, fd is too big", __func__, mono_w32handle_ops_typename (type));
+
+               return(GUINT_TO_POINTER (INVALID_HANDLE_VALUE));
+       }
+
+       fd_index = SLOT_INDEX (fd);
+       fd_offset = SLOT_OFFSET (fd);
+
+       /* Initialize the array entries on demand */
+       if (!private_handles [fd_index]) {
+               mono_os_mutex_lock (&scan_mutex);
+
+               if (!private_handles [fd_index])
+                       private_handles [fd_index] = g_new0 (MonoW32HandleBase, HANDLE_PER_SLOT);
+
+               mono_os_mutex_unlock (&scan_mutex);
+       }
+
+       handle_data = &private_handles [fd_index][fd_offset];
+
+       if (handle_data->type != MONO_W32HANDLE_UNUSED) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle, fd is already in use", __func__, mono_w32handle_ops_typename (type));
+               /* FIXME: clean up this handle?  We can't do anything
+                * with the fd, cos thats the new one
+                */
+               return(GUINT_TO_POINTER (INVALID_HANDLE_VALUE));
+       }
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: create %s handle %p", __func__, mono_w32handle_ops_typename (type), GUINT_TO_POINTER(fd));
+
+       mono_w32handle_init_handle (handle_data, type, handle_specific);
+
+       return(GUINT_TO_POINTER(fd));
+}
+
+gboolean
+mono_w32handle_lookup (gpointer handle, MonoW32HandleType type,
+                             gpointer *handle_specific)
+{
+       MonoW32HandleBase *handle_data;
+
+       g_assert (handle_specific);
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return(FALSE);
+       }
+
+       if (handle_data->type != type) {
+               return(FALSE);
+       }
+
+       *handle_specific = handle_data->specific;
+
+       return(TRUE);
+}
+
+static gboolean
+mono_w32handle_ref_core (gpointer handle, MonoW32HandleBase *handle_data);
+
+static gboolean
+mono_w32handle_unref_core (gpointer handle, MonoW32HandleBase *handle_data, guint minimum);
+
+void
+mono_w32handle_foreach (gboolean (*on_each)(gpointer handle, gpointer data, gpointer user_data), gpointer user_data)
+{
+       guint32 i, k;
+
+       mono_os_mutex_lock (&scan_mutex);
+
+       for (i = SLOT_INDEX (0); i < private_handles_slots_count; i++) {
+               if (!private_handles [i])
+                       continue;
+               for (k = SLOT_OFFSET (0); k < HANDLE_PER_SLOT; k++) {
+                       MonoW32HandleBase *handle_data = NULL;
+                       gpointer handle;
+                       gboolean destroy, finished;
+
+                       handle_data = &private_handles [i][k];
+                       if (handle_data->type == MONO_W32HANDLE_UNUSED)
+                               continue;
+
+                       handle = GUINT_TO_POINTER (i * HANDLE_PER_SLOT + k);
+
+                       if (!mono_w32handle_ref_core (handle, handle_data)) {
+                               /* we are racing with mono_w32handle_unref:
+                                *  the handle ref has been decremented, but it
+                                *  hasn't yet been destroyed. */
+                               continue;
+                       }
+
+                       finished = on_each (handle, handle_data->specific, user_data);
+
+                       /* we do not want to have to destroy the handle here,
+                        * as it would means the ref/unref are unbalanced */
+                       destroy = mono_w32handle_unref_core (handle, handle_data, 2);
+                       g_assert (!destroy);
+
+                       if (finished)
+                               goto done;
+               }
+       }
+
+done:
+       mono_os_mutex_unlock (&scan_mutex);
+}
+
+static gboolean
+mono_w32handle_ref_core (gpointer handle, MonoW32HandleBase *handle_data)
+{
+       guint old, new;
+
+       do {
+               old = handle_data->ref;
+               if (old == 0)
+                       return FALSE;
+
+               new = old + 1;
+       } while (InterlockedCompareExchange ((gint32*) &handle_data->ref, new, old) != old);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: ref %s handle %p, ref: %d -> %d",
+               __func__, mono_w32handle_ops_typename (handle_data->type), handle, old, new);
+
+       return TRUE;
+}
+
+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))
+                       g_error ("%s: handle %p has ref %d, it should be >= %d", __func__, handle, 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 (type), handle, old, new, new == 0 ? "true" : "false");
+
+       return new == 0;
+}
+
+void mono_w32handle_ref (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to ref handle %p, unknown handle", __func__, handle);
+               return;
+       }
+
+       if (!mono_w32handle_ref_core (handle, handle_data))
+               g_error ("%s: failed to ref handle %p", __func__, handle);
+}
+
+static void (*_wapi_handle_ops_get_close_func (MonoW32HandleType type))(gpointer, gpointer);
+
+/* The handle must not be locked on entry to this function */
+void
+mono_w32handle_unref (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+       gboolean destroy;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to unref handle %p, unknown handle",
+                       __func__, handle);
+               return;
+       }
+
+       destroy = mono_w32handle_unref_core (handle, handle_data, 1);
+
+       if (destroy) {
+               /* Need to copy the handle info, reset the slot in the
+                * array, and _only then_ call the close function to
+                * avoid race conditions (eg file descriptors being
+                * closed, and another file being opened getting the
+                * same fd racing the memset())
+                */
+               MonoW32HandleType type;
+               gpointer handle_specific;
+               void (*close_func)(gpointer, gpointer);
+
+               type = handle_data->type;
+               handle_specific = handle_data->specific;
+
+               mono_os_mutex_lock (&scan_mutex);
+
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: destroy %s handle %p", __func__, mono_w32handle_ops_typename (type), handle);
+
+               mono_os_mutex_destroy (&handle_data->signal_mutex);
+               mono_os_cond_destroy (&handle_data->signal_cond);
+
+               memset (handle_data, 0, sizeof (MonoW32HandleBase));
+
+               mono_os_mutex_unlock (&scan_mutex);
+
+               close_func = _wapi_handle_ops_get_close_func (type);
+               if (close_func != NULL) {
+                       close_func (handle, handle_specific);
+               }
+
+               g_free (handle_specific);
+       }
+}
+
+static void
+mono_w32handle_ops_close (gpointer handle, gpointer data);
+
+void
+mono_w32handle_force_close (gpointer handle, gpointer data)
+{
+       mono_w32handle_ops_close (handle, data);
+}
+
+void
+mono_w32handle_register_ops (MonoW32HandleType type, MonoW32HandleOps *ops)
+{
+       handle_ops [type] = ops;
+}
+
+void mono_w32handle_register_capabilities (MonoW32HandleType type,
+                                        MonoW32HandleCapability caps)
+{
+       handle_caps[type] = caps;
+}
+
+gboolean mono_w32handle_test_capabilities (gpointer handle,
+                                        MonoW32HandleCapability caps)
+{
+       MonoW32HandleBase *handle_data;
+       MonoW32HandleType type;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return(FALSE);
+       }
+
+       type = handle_data->type;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: testing 0x%x against 0x%x (%d)", __func__,
+                  handle_caps[type], caps, handle_caps[type] & caps);
+
+       return((handle_caps[type] & caps) != 0);
+}
+
+static void (*_wapi_handle_ops_get_close_func (MonoW32HandleType type))(gpointer, gpointer)
+{
+       if (handle_ops[type] != NULL &&
+           handle_ops[type]->close != NULL) {
+               return (handle_ops[type]->close);
+       }
+
+       return (NULL);
+}
+
+static void
+mono_w32handle_ops_close (gpointer handle, gpointer data)
+{
+       MonoW32HandleBase *handle_data;
+       MonoW32HandleType type;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return;
+       }
+
+       type = handle_data->type;
+
+       if (handle_ops[type] != NULL &&
+           handle_ops[type]->close != NULL) {
+               handle_ops[type]->close (handle, data);
+       }
+}
+
+static void
+mono_w32handle_ops_details (MonoW32HandleType type, gpointer data)
+{
+       if (handle_ops[type] != NULL &&
+           handle_ops[type]->details != NULL) {
+               handle_ops[type]->details (data);
+       }
+}
+
+static const gchar*
+mono_w32handle_ops_typename (MonoW32HandleType type)
+{
+       g_assert (handle_ops [type]);
+       g_assert (handle_ops [type]->typename);
+       return handle_ops [type]->typename ();
+}
+
+static gsize
+mono_w32handle_ops_typesize (MonoW32HandleType type)
+{
+       g_assert (handle_ops [type]);
+       g_assert (handle_ops [type]->typesize);
+       return handle_ops [type]->typesize ();
+}
+
+static void
+mono_w32handle_ops_signal (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+       MonoW32HandleType type;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return;
+       }
+
+       type = handle_data->type;
+
+       if (handle_ops[type] != NULL && handle_ops[type]->signal != NULL) {
+               handle_ops[type]->signal (handle);
+       }
+}
+
+static gboolean
+mono_w32handle_ops_own (gpointer handle, guint32 *statuscode)
+{
+       MonoW32HandleBase *handle_data;
+       MonoW32HandleType type;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return(FALSE);
+       }
+
+       type = handle_data->type;
+
+       if (handle_ops[type] != NULL && handle_ops[type]->own_handle != NULL) {
+               return(handle_ops[type]->own_handle (handle, statuscode));
+       } else {
+               return(FALSE);
+       }
+}
+
+static gboolean
+mono_w32handle_ops_isowned (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+       MonoW32HandleType type;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return(FALSE);
+       }
+
+       type = handle_data->type;
+
+       if (handle_ops[type] != NULL && handle_ops[type]->is_owned != NULL) {
+               return(handle_ops[type]->is_owned (handle));
+       } else {
+               return(FALSE);
+       }
+}
+
+static MonoW32HandleWaitRet
+mono_w32handle_ops_specialwait (gpointer handle, guint32 timeout, gboolean *alerted)
+{
+       MonoW32HandleBase *handle_data;
+       MonoW32HandleType type;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return(WAIT_FAILED);
+       }
+
+       type = handle_data->type;
+
+       if (handle_ops[type] != NULL &&
+           handle_ops[type]->special_wait != NULL) {
+               return(handle_ops[type]->special_wait (handle, timeout, alerted));
+       } else {
+               return(WAIT_FAILED);
+       }
+}
+
+static void
+mono_w32handle_ops_prewait (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+       MonoW32HandleType type;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
+               return;
+       }
+
+       type = handle_data->type;
+
+       if (handle_ops[type] != NULL &&
+           handle_ops[type]->prewait != NULL) {
+               handle_ops[type]->prewait (handle);
+       }
+}
+
+static void
+spin (guint32 ms)
+{
+#ifdef HOST_WIN32
+       SleepEx (ms, TRUE);
+#else
+       struct timespec sleepytime;
+
+       g_assert (ms < 1000);
+
+       sleepytime.tv_sec = 0;
+       sleepytime.tv_nsec = ms * 1000000;
+       nanosleep (&sleepytime, NULL);
+#endif /* HOST_WIN32 */
+}
+
+static void
+mono_w32handle_lock_handles (gpointer *handles, gsize numhandles)
+{
+       guint32 i, iter=0;
+
+       /* Lock all the handles, with backoff */
+again:
+       for(i=0; i<numhandles; i++) {
+               gpointer handle = handles[i];
+
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: attempting to lock %p", __func__, handle);
+
+               if (!mono_w32handle_trylock_handle (handle)) {
+                       /* Bummer */
+
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: attempt failed for %p: %s", __func__,
+                                  handle);
+
+                       while (i--) {
+                               handle = handles[i];
+
+                               mono_w32handle_unlock_handle (handle);
+                       }
+
+                       /* If iter ever reaches 100 the nanosleep will
+                        * return EINVAL immediately, but we have a
+                        * design flaw if that happens.
+                        */
+                       iter++;
+                       if(iter==100) {
+                               g_warning ("%s: iteration overflow!",
+                                          __func__);
+                               iter=1;
+                       }
+
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: Backing off for %d ms", __func__,
+                                  iter*10);
+                       spin (10 * iter);
+
+                       goto again;
+               }
+       }
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: Locked all handles", __func__);
+}
+
+static void
+mono_w32handle_unlock_handles (gpointer *handles, gsize numhandles)
+{
+       guint32 i;
+
+       for(i=0; i<numhandles; i++) {
+               gpointer handle = handles[i];
+
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: unlocking handle %p", __func__, handle);
+
+               mono_w32handle_unlock_handle (handle);
+       }
+}
+
+static int
+mono_w32handle_timedwait_signal_naked (mono_cond_t *cond, mono_mutex_t *mutex, guint32 timeout, gboolean poll, gboolean *alerted)
+{
+       int res;
+
+       if (!poll) {
+               res = mono_os_cond_timedwait (cond, mutex, timeout);
+       } else {
+               /* This is needed when waiting for process handles */
+               if (!alerted) {
+                       /*
+                        * pthread_cond_(timed)wait() can return 0 even if the condition was not
+                        * signalled.  This happens at least on Darwin.  We surface this, i.e., we
+                        * get spurious wake-ups.
+                        *
+                        * http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_cond_wait.html
+                        */
+                       res = mono_os_cond_timedwait (cond, mutex, timeout);
+               } else {
+                       if (timeout < 100) {
+                               /* Real timeout is less than 100ms time */
+                               res = mono_os_cond_timedwait (cond, mutex, timeout);
+                       } else {
+                               res = mono_os_cond_timedwait (cond, mutex, 100);
+
+                               /* Mask the fake timeout, this will cause
+                                * another poll if the cond was not really signaled
+                                */
+                               if (res == -1)
+                                       res = 0;
+                       }
+               }
+       }
+
+       return res;
+}
+
+static void
+signal_global (gpointer unused)
+{
+       /* If we reach here, then interrupt token is set to the flag value, which
+        * means that the target thread is either
+        * - before the first CAS in timedwait, which means it won't enter the wait.
+        * - it is after the first CAS, so it is already waiting, or it will enter
+        *    the wait, and it will be interrupted by the broadcast. */
+       mono_os_mutex_lock (&global_signal_mutex);
+       mono_os_cond_broadcast (&global_signal_cond);
+       mono_os_mutex_unlock (&global_signal_mutex);
+}
+
+static int
+mono_w32handle_timedwait_signal (guint32 timeout, gboolean poll, gboolean *alerted)
+{
+       int res;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: waiting for global", __func__);
+
+       if (alerted)
+               *alerted = FALSE;
+
+       if (alerted) {
+               mono_thread_info_install_interrupt (signal_global, NULL, alerted);
+               if (*alerted)
+                       return 0;
+       }
+
+       res = mono_w32handle_timedwait_signal_naked (&global_signal_cond, &global_signal_mutex, timeout, poll, alerted);
+
+       if (alerted)
+               mono_thread_info_uninstall_interrupt (alerted);
+
+       return res;
+}
+
+static void
+signal_handle_and_unref (gpointer handle)
+{
+       MonoW32HandleBase *handle_data;
+       mono_cond_t *cond;
+       mono_mutex_t *mutex;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data))
+               g_error ("cannot signal unknown handle %p", handle);
+
+       /* If we reach here, then interrupt token is set to the flag value, which
+        * means that the target thread is either
+        * - before the first CAS in timedwait, which means it won't enter the wait.
+        * - it is after the first CAS, so it is already waiting, or it will enter
+        *    the wait, and it will be interrupted by the broadcast. */
+       cond = &handle_data->signal_cond;
+       mutex = &handle_data->signal_mutex;
+
+       mono_os_mutex_lock (mutex);
+       mono_os_cond_broadcast (cond);
+       mono_os_mutex_unlock (mutex);
+
+       mono_w32handle_unref (handle);
+}
+
+static int
+mono_w32handle_timedwait_signal_handle (gpointer handle, guint32 timeout, gboolean poll, gboolean *alerted)
+{
+       MonoW32HandleBase *handle_data;
+       int res;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data))
+               g_error ("cannot wait on unknown handle %p", handle);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: waiting for %p (type %s)", __func__, handle,
+                  mono_w32handle_ops_typename (mono_w32handle_get_type (handle)));
+
+       if (alerted)
+               *alerted = FALSE;
+
+       if (alerted) {
+               mono_thread_info_install_interrupt (signal_handle_and_unref, handle, alerted);
+               if (*alerted)
+                       return 0;
+               mono_w32handle_ref (handle);
+       }
+
+       res = mono_w32handle_timedwait_signal_naked (&handle_data->signal_cond, &handle_data->signal_mutex, timeout, poll, alerted);
+
+       if (alerted) {
+               mono_thread_info_uninstall_interrupt (alerted);
+               if (!*alerted) {
+                       /* if it is alerted, then the handle is unref in the interrupt callback */
+                       mono_w32handle_unref (handle);
+               }
+       }
+
+       return res;
+}
+
+static gboolean
+dump_callback (gpointer handle, gpointer handle_specific, gpointer user_data)
+{
+       MonoW32HandleBase *handle_data;
+
+       if (!mono_w32handle_lookup_data (handle, &handle_data))
+               g_error ("cannot dump unknown handle %p", handle);
+
+       g_print ("%p [%7s] signalled: %5s ref: %3d ",
+               handle, mono_w32handle_ops_typename (handle_data->type), handle_data->signalled ? "true" : "false", handle_data->ref);
+       mono_w32handle_ops_details (handle_data->type, handle_data->specific);
+       g_print ("\n");
+
+       return FALSE;
+}
+
+void mono_w32handle_dump (void)
+{
+       mono_w32handle_foreach (dump_callback, NULL);
+}
+
+static gboolean
+own_if_signalled (gpointer handle, guint32 *statuscode)
+{
+       if (!mono_w32handle_issignalled (handle))
+               return FALSE;
+
+       *statuscode = WAIT_OBJECT_0;
+       mono_w32handle_ops_own (handle, statuscode);
+       return TRUE;
+}
+
+static gboolean
+own_if_owned( gpointer handle, guint32 *statuscode)
+{
+       if (!mono_w32handle_ops_isowned (handle))
+               return FALSE;
+
+       *statuscode = WAIT_OBJECT_0;
+       mono_w32handle_ops_own (handle, statuscode);
+       return TRUE;
+}
+
+MonoW32HandleWaitRet
+mono_w32handle_wait_one (gpointer handle, guint32 timeout, gboolean alertable)
+{
+       MonoW32HandleWaitRet ret;
+       gboolean alerted;
+       gint64 start;
+       guint32 statuscode = 0;
+
+       alerted = FALSE;
+
+       if (mono_w32handle_test_capabilities (handle, MONO_W32HANDLE_CAP_SPECIAL_WAIT)) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p has special wait",
+                       __func__, handle);
+
+               return mono_w32handle_ops_specialwait (handle, timeout, alertable ? &alerted : NULL);
+       }
+
+       if (!mono_w32handle_test_capabilities (handle, MONO_W32HANDLE_CAP_WAIT)) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p can't be waited for",
+                       __func__, handle);
+
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
+       }
+
+       mono_w32handle_lock_handle (handle);
+
+       if (mono_w32handle_test_capabilities (handle, MONO_W32HANDLE_CAP_OWN)) {
+               if (own_if_owned (handle, &statuscode)) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p already owned",
+                               __func__, handle);
+
+                       ret = statuscode == WAIT_ABANDONED_0 ? MONO_W32HANDLE_WAIT_RET_ABANDONED_0 : MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
+                       goto done;
+               }
+       }
+
+       if (timeout != INFINITE)
+               start = mono_msec_ticks ();
+
+       for (;;) {
+               gint waited;
+
+               if (own_if_signalled (handle, &statuscode)) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p signalled",
+                               __func__, handle);
+
+                       ret = statuscode == WAIT_ABANDONED_0 ? MONO_W32HANDLE_WAIT_RET_ABANDONED_0 : MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
+                       goto done;
+               }
+
+               mono_w32handle_ops_prewait (handle);
+
+               if (timeout == INFINITE) {
+                       waited = mono_w32handle_timedwait_signal_handle (handle, INFINITE, FALSE, alertable ? &alerted : NULL);
+               } else {
+                       gint64 elapsed;
+
+                       elapsed = mono_msec_ticks () - start;
+                       if (elapsed > timeout) {
+                               ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+                               goto done;
+                       }
+
+                       waited = mono_w32handle_timedwait_signal_handle (handle, timeout - elapsed, FALSE, alertable ? &alerted : NULL);
+               }
+
+               if (alerted) {
+                       ret = MONO_W32HANDLE_WAIT_RET_ALERTED;
+                       goto done;
+               }
+
+               if (waited != 0) {
+                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+                       goto done;
+               }
+       }
+
+done:
+       mono_w32handle_unlock_handle (handle);
+
+       return ret;
+}
+
+MonoW32HandleWaitRet
+mono_w32handle_wait_multiple (gpointer *handles, gsize nhandles, gboolean waitall, guint32 timeout, gboolean alertable)
+{
+       MonoW32HandleWaitRet ret;
+       gboolean alerted, poll;
+       gint i;
+       gint64 start;
+       gpointer handles_sorted [MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS];
+       guint32 statuscodes [MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS] = {0};
+
+       if (nhandles == 0)
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
+
+       if (nhandles == 1)
+               return mono_w32handle_wait_one (handles [0], timeout, alertable);
+
+       alerted = FALSE;
+
+       if (nhandles > MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: too many handles: %zd",
+                       __func__, nhandles);
+
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
+       }
+
+       for (i = 0; i < nhandles; ++i) {
+               if (!mono_w32handle_test_capabilities (handles[i], MONO_W32HANDLE_CAP_WAIT)
+                        && !mono_w32handle_test_capabilities (handles[i], MONO_W32HANDLE_CAP_SPECIAL_WAIT))
+               {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p can't be waited for",
+                                  __func__, handles [i]);
+
+                       return MONO_W32HANDLE_WAIT_RET_FAILED;
+               }
+
+               handles_sorted [i] = handles [i];
+       }
+
+       qsort (handles_sorted, nhandles, sizeof (gpointer), g_direct_equal);
+       for (i = 1; i < nhandles; ++i) {
+               if (handles_sorted [i - 1] == handles_sorted [i]) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p is duplicated",
+                               __func__, handles_sorted [i]);
+
+                       return MONO_W32HANDLE_WAIT_RET_FAILED;
+               }
+       }
+
+       poll = FALSE;
+       for (i = 0; i < nhandles; ++i) {
+               if (mono_w32handle_get_type (handles [i]) == MONO_W32HANDLE_PROCESS) {
+                       /* Can't wait for a process handle + another handle without polling */
+                       poll = TRUE;
+               }
+       }
+
+       if (timeout != INFINITE)
+               start = mono_msec_ticks ();
+
+       for (i = 0; i < nhandles; ++i) {
+               /* Add a reference, as we need to ensure the handle wont
+                * disappear from under us while we're waiting in the loop
+                * (not lock, as we don't want exclusive access here) */
+               mono_w32handle_ref (handles [i]);
+       }
+
+       for (;;) {
+               gsize count, lowest;
+               gboolean signalled;
+               gint waited;
+
+               count = 0;
+               lowest = nhandles;
+
+               mono_w32handle_lock_handles (handles, nhandles);
+
+               for (i = 0; i < nhandles; i++) {
+                       if ((mono_w32handle_test_capabilities (handles [i], MONO_W32HANDLE_CAP_OWN) && mono_w32handle_ops_isowned (handles [i]))
+                                || mono_w32handle_issignalled (handles [i]))
+                       {
+                               count ++;
+
+                               if (i < lowest)
+                                       lowest = i;
+                       }
+               }
+
+               signalled = (waitall && count == nhandles) || (!waitall && count > 0);
+
+               if (signalled) {
+                       for (i = 0; i < nhandles; i++)
+                               own_if_signalled (handles [i], &statuscodes [i]);
+               }
+
+               mono_w32handle_unlock_handles (handles, nhandles);
+
+               if (signalled) {
+                       ret = MONO_W32HANDLE_WAIT_RET_SUCCESS_0 + lowest;
+                       for (i = lowest; i < nhandles; i++) {
+                               if (statuscodes [i] == WAIT_ABANDONED_0) {
+                                       ret = MONO_W32HANDLE_WAIT_RET_ABANDONED_0 + lowest;
+                                       break;
+                               }
+                       }
+                       goto done;
+               }
+
+               for (i = 0; i < nhandles; i++) {
+                       mono_w32handle_ops_prewait (handles[i]);
+
+                       if (mono_w32handle_test_capabilities (handles [i], MONO_W32HANDLE_CAP_SPECIAL_WAIT)
+                                && !mono_w32handle_issignalled (handles [i]))
+                       {
+                               mono_w32handle_ops_specialwait (handles [i], 0, alertable ? &alerted : NULL);
+                       }
+               }
+
+               mono_w32handle_lock_signal_mutex ();
+
+               if (waitall) {
+                       signalled = TRUE;
+                       for (i = 0; i < nhandles; ++i) {
+                               if (!mono_w32handle_issignalled (handles [i])) {
+                                       signalled = FALSE;
+                                       break;
+                               }
+                       }
+               } else {
+                       signalled = FALSE;
+                       for (i = 0; i < nhandles; ++i) {
+                               if (mono_w32handle_issignalled (handles [i])) {
+                                       signalled = TRUE;
+                                       break;
+                               }
+                       }
+               }
+
+               waited = 0;
+
+               if (!signalled) {
+                       if (timeout == INFINITE) {
+                               waited = mono_w32handle_timedwait_signal (INFINITE, poll, alertable ? &alerted : NULL);
+                       } else {
+                               gint64 elapsed;
+
+                               elapsed = mono_msec_ticks () - start;
+                               if (elapsed > timeout) {
+                                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+
+                                       mono_w32handle_unlock_signal_mutex ();
+
+                                       goto done;
+                               }
+
+                               waited = mono_w32handle_timedwait_signal (timeout - elapsed, poll, alertable ? &alerted : NULL);
+                       }
+               }
+
+               mono_w32handle_unlock_signal_mutex ();
+
+               if (alerted) {
+                       ret = MONO_W32HANDLE_WAIT_RET_ALERTED;
+                       goto done;
+               }
+
+               if (waited != 0) {
+                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+                       goto done;
+               }
+       }
+
+done:
+       for (i = 0; i < nhandles; i++) {
+               /* Unref everything we reffed above */
+               mono_w32handle_unref (handles [i]);
+       }
+
+       return ret;
+}
+
+MonoW32HandleWaitRet
+mono_w32handle_signal_and_wait (gpointer signal_handle, gpointer wait_handle, guint32 timeout, gboolean alertable)
+{
+       MonoW32HandleWaitRet ret;
+       gint64 start;
+       gboolean alerted;
+       guint32 statuscode = 0;
+       gpointer handles [2];
+
+       alerted = FALSE;
+
+       if (!mono_w32handle_test_capabilities (signal_handle, MONO_W32HANDLE_CAP_SIGNAL))
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
+       if (!mono_w32handle_test_capabilities (wait_handle, MONO_W32HANDLE_CAP_WAIT))
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
+
+       if (mono_w32handle_test_capabilities (wait_handle, MONO_W32HANDLE_CAP_SPECIAL_WAIT)) {
+               g_warning ("%s: handle %p has special wait, implement me!!", __func__, wait_handle);
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
+       }
+
+       handles [0] = wait_handle;
+       handles [1] = signal_handle;
+
+       mono_w32handle_lock_handles (handles, 2);
+
+       mono_w32handle_ops_signal (signal_handle);
+
+       mono_w32handle_unlock_handle (signal_handle);
+
+       if (mono_w32handle_test_capabilities (wait_handle, MONO_W32HANDLE_CAP_OWN)) {
+               if (own_if_owned (wait_handle, &statuscode)) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p already owned",
+                               __func__, wait_handle);
+
+                       ret = statuscode == WAIT_ABANDONED_0 ? MONO_W32HANDLE_WAIT_RET_ABANDONED_0 : MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
+                       goto done;
+               }
+       }
+
+       if (timeout != INFINITE)
+               start = mono_msec_ticks ();
+
+       for (;;) {
+               gint waited;
+
+               if (own_if_signalled (wait_handle, &statuscode)) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p signalled",
+                               __func__, wait_handle);
+
+                       ret = statuscode == WAIT_ABANDONED_0 ? MONO_W32HANDLE_WAIT_RET_ABANDONED_0 : MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
+                       goto done;
+               }
+
+               mono_w32handle_ops_prewait (wait_handle);
+
+               if (timeout == INFINITE) {
+                       waited = mono_w32handle_timedwait_signal_handle (wait_handle, INFINITE, FALSE, alertable ? &alerted : NULL);
+               } else {
+                       gint64 elapsed;
+
+                       elapsed = mono_msec_ticks () - start;
+                       if (elapsed > timeout) {
+                               ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+                               goto done;
+                       }
+
+                       waited = mono_w32handle_timedwait_signal_handle (wait_handle, timeout - elapsed, FALSE, alertable ? &alerted : NULL);
+               }
+
+               if (alerted) {
+                       ret = MONO_W32HANDLE_WAIT_RET_ALERTED;
+                       goto done;
+               }
+
+               if (waited != 0) {
+                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+                       goto done;
+               }
+       }
+
+done:
+       mono_w32handle_unlock_handle (wait_handle);
+
+       return ret;
+}
diff --git a/mono/metadata/w32handle.h b/mono/metadata/w32handle.h
new file mode 100644 (file)
index 0000000..ce7d76e
--- /dev/null
@@ -0,0 +1,162 @@
+
+#ifndef _MONO_METADATA_W32HANDLE_H_
+#define _MONO_METADATA_W32HANDLE_H_
+
+#include <config.h>
+#include <glib.h>
+
+#ifndef INVALID_HANDLE_VALUE
+#define INVALID_HANDLE_VALUE (gpointer)-1
+#endif
+
+#define MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS 64
+
+typedef enum {
+       MONO_W32HANDLE_UNUSED = 0,
+       MONO_W32HANDLE_FILE,
+       MONO_W32HANDLE_CONSOLE,
+       MONO_W32HANDLE_THREAD,
+       MONO_W32HANDLE_SEM,
+       MONO_W32HANDLE_MUTEX,
+       MONO_W32HANDLE_EVENT,
+       MONO_W32HANDLE_SOCKET,
+       MONO_W32HANDLE_FIND,
+       MONO_W32HANDLE_PROCESS,
+       MONO_W32HANDLE_PIPE,
+       MONO_W32HANDLE_NAMEDMUTEX,
+       MONO_W32HANDLE_NAMEDSEM,
+       MONO_W32HANDLE_NAMEDEVENT,
+       MONO_W32HANDLE_COUNT
+} MonoW32HandleType;
+
+typedef enum {
+       MONO_W32HANDLE_WAIT_RET_SUCCESS_0   =  0,
+       MONO_W32HANDLE_WAIT_RET_ABANDONED_0 =  MONO_W32HANDLE_WAIT_RET_SUCCESS_0 + MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS,
+       MONO_W32HANDLE_WAIT_RET_ALERTED     = -1,
+       MONO_W32HANDLE_WAIT_RET_TIMEOUT     = -2,
+       MONO_W32HANDLE_WAIT_RET_FAILED      = -3,
+} MonoW32HandleWaitRet;
+
+typedef struct 
+{
+       void (*close)(gpointer handle, gpointer data);
+
+       /* SignalObjectAndWait */
+       void (*signal)(gpointer signal);
+
+       /* Called by WaitForSingleObject and WaitForMultipleObjects,
+        * with the handle locked (shared handles aren't locked.)
+        * Returns TRUE if ownership was established, false otherwise.
+        * If TRUE, *statuscode contains a status code such as
+        * WAIT_OBJECT_0 or WAIT_ABANDONED_0.
+        */
+       gboolean (*own_handle)(gpointer handle, guint32 *statuscode);
+
+       /* Called by WaitForSingleObject and WaitForMultipleObjects, if the
+        * handle in question is "ownable" (ie mutexes), to see if the current
+        * thread already owns this handle
+        */
+       gboolean (*is_owned)(gpointer handle);
+
+       /* Called by WaitForSingleObject and WaitForMultipleObjects,
+        * if the handle in question needs a special wait function
+        * instead of using the normal handle signal mechanism.
+        * Returns the WaitForSingleObject return code.
+        */
+       MonoW32HandleWaitRet (*special_wait)(gpointer handle, guint32 timeout, gboolean *alerted);
+
+       /* Called by WaitForSingleObject and WaitForMultipleObjects,
+        * if the handle in question needs some preprocessing before the
+        * signal wait.
+        */
+       void (*prewait)(gpointer handle);
+
+       /* Called when dumping the handles */
+       void (*details)(gpointer data);
+
+       /* Called to get the name of the handle type */
+       const gchar* (*typename) (void);
+
+       /* Called to get the size of the handle type */
+       gsize (*typesize) (void);
+} MonoW32HandleOps;
+
+typedef enum {
+       MONO_W32HANDLE_CAP_WAIT         = 0x01,
+       MONO_W32HANDLE_CAP_SIGNAL       = 0x02,
+       MONO_W32HANDLE_CAP_OWN          = 0x04,
+       MONO_W32HANDLE_CAP_SPECIAL_WAIT = 0x08,
+} MonoW32HandleCapability;
+
+extern guint32 mono_w32handle_fd_reserve;
+
+void
+mono_w32handle_init (void);
+
+void
+mono_w32handle_cleanup (void);
+
+void
+mono_w32handle_register_ops (MonoW32HandleType type, MonoW32HandleOps *ops);
+
+gpointer
+mono_w32handle_new (MonoW32HandleType type, gpointer handle_specific);
+
+gpointer
+mono_w32handle_new_fd (MonoW32HandleType type, int fd, gpointer handle_specific);
+
+MonoW32HandleType
+mono_w32handle_get_type (gpointer handle);
+
+const gchar*
+mono_w32handle_get_typename (MonoW32HandleType type);
+
+gboolean
+mono_w32handle_lookup (gpointer handle, MonoW32HandleType type, gpointer *handle_specific);
+
+void
+mono_w32handle_foreach (gboolean (*on_each)(gpointer handle, gpointer data, gpointer user_data), gpointer user_data);
+
+void
+mono_w32handle_dump (void);
+
+void
+mono_w32handle_ref (gpointer handle);
+
+void
+mono_w32handle_unref (gpointer handle);
+
+void
+mono_w32handle_register_capabilities (MonoW32HandleType type, MonoW32HandleCapability caps);
+
+gboolean
+mono_w32handle_test_capabilities (gpointer handle, MonoW32HandleCapability caps);
+
+void
+mono_w32handle_force_close (gpointer handle, gpointer data);
+
+void
+mono_w32handle_set_signal_state (gpointer handle, gboolean state, gboolean broadcast);
+
+gboolean
+mono_w32handle_issignalled (gpointer handle);
+
+void
+mono_w32handle_lock_handle (gpointer handle);
+
+gboolean
+mono_w32handle_trylock_handle (gpointer handle);
+
+void
+mono_w32handle_unlock_handle (gpointer handle);
+
+MonoW32HandleWaitRet
+mono_w32handle_wait_one (gpointer handle, guint32 timeout, gboolean alertable);
+
+MonoW32HandleWaitRet
+mono_w32handle_wait_multiple (gpointer *handles, gsize nhandles, gboolean waitall, guint32 timeout, gboolean alertable);
+
+MonoW32HandleWaitRet
+mono_w32handle_signal_and_wait (gpointer signal_handle, gpointer wait_handle, guint32 timeout, gboolean alertable);
+
+#endif /* _MONO_METADATA_W32HANDLE_H_ */
index a995eeb3640c44159e9c9534f70f7373a7e577f0..d27fd5b8a586dbb182643b647e97dcafadd97d95 100644 (file)
@@ -16,7 +16,7 @@
 #include "mono/metadata/object-internals.h"
 #include "mono/utils/mono-logger-internals.h"
 #include "mono/utils/mono-threads.h"
-#include "mono/utils/w32handle.h"
+#include "mono/metadata/w32handle.h"
 
 typedef struct {
        MonoNativeThreadId tid;
@@ -66,12 +66,12 @@ mutex_handle_own (gpointer handle, MonoW32HandleType type, guint32 *statuscode)
        *statuscode = WAIT_OBJECT_0;
 
        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);
+               g_warning ("%s: error looking up %s handle %p", __func__, mono_w32handle_get_typename (type), handle);
                return FALSE;
        }
 
        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");
+               __func__, mono_w32handle_get_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));
@@ -99,20 +99,20 @@ mutex_handle_is_owned (gpointer handle, MonoW32HandleType type)
        MonoW32HandleMutex *mutex_handle;
 
        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);
+               g_warning ("%s: error looking up %s handle %p", __func__, mono_w32handle_get_typename (type), handle);
                return FALSE;
        }
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: testing ownership %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
        if (mutex_handle->recursion > 0 && pthread_equal (mutex_handle->tid, pthread_self ())) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: %s handle %p owned by %p",
-                       __func__, mono_w32handle_ops_typename (type), handle, (gpointer) pthread_self ());
+                       __func__, mono_w32handle_get_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, tid: %p recursion: %d",
-                       __func__, mono_w32handle_ops_typename (type), handle, (gpointer) pthread_self (), (gpointer) mutex_handle->tid, mutex_handle->recursion);
+                       __func__, mono_w32handle_get_typename (type), handle, (gpointer) pthread_self (), (gpointer) mutex_handle->tid, mutex_handle->recursion);
                return FALSE;
        }
 }
@@ -161,12 +161,12 @@ static void mutex_handle_prewait (gpointer handle, MonoW32HandleType type)
 
        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);
+                       __func__, mono_w32handle_get_typename (type), handle);
                return;
        }
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: pre-waiting %s handle %p, owned? %s",
-               __func__, mono_w32handle_ops_typename (type), handle, mutex_handle->recursion != 0 ? "true" : "false");
+               __func__, mono_w32handle_get_typename (type), handle, mutex_handle->recursion != 0 ? "true" : "false");
 }
 
 /* The shared state is not locked when prewait methods are called */
@@ -264,7 +264,6 @@ mono_w32mutex_init (void)
 static gpointer mutex_handle_create (MonoW32HandleMutex *mutex_handle, MonoW32HandleType type, gboolean owned)
 {
        gpointer handle;
-       int thr_ret;
        guint32 statuscode;
 
        mutex_handle->tid = 0;
@@ -274,24 +273,22 @@ static gpointer mutex_handle_create (MonoW32HandleMutex *mutex_handle, MonoW32Ha
        handle = mono_w32handle_new (type, mutex_handle);
        if (handle == INVALID_HANDLE_VALUE) {
                g_warning ("%s: error creating %s handle",
-                       __func__, mono_w32handle_ops_typename (type));
+                       __func__, mono_w32handle_get_typename (type));
                SetLastError (ERROR_GEN_FAILURE);
                return NULL;
        }
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
 
        if (owned)
                mutex_handle_own (handle, type, &statuscode);
        else
                mono_w32handle_set_signal_state (handle, TRUE, FALSE);
 
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: created %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
        return handle;
 }
@@ -300,7 +297,7 @@ static gpointer mutex_create (gboolean owned)
 {
        MonoW32HandleMutex mutex_handle;
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle",
-               __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_MUTEX));
+               __func__, mono_w32handle_get_typename (MONO_W32HANDLE_MUTEX));
        return mutex_handle_create (&mutex_handle, MONO_W32HANDLE_MUTEX, owned);
 }
 
@@ -310,7 +307,7 @@ static gpointer namedmutex_create (gboolean owned, const gunichar2 *name)
        gchar *utf8_name;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle",
-               __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDMUTEX));
+               __func__, mono_w32handle_get_typename (MONO_W32HANDLE_NAMEDMUTEX));
 
        /* w32 seems to guarantee that opening named objects can't race each other */
        mono_w32handle_namespace_lock ();
@@ -374,7 +371,6 @@ ves_icall_System_Threading_Mutex_ReleaseMutex_internal (gpointer handle)
        MonoW32HandleType type;
        MonoW32HandleMutex *mutex_handle;
        pthread_t tid;
-       int thr_ret;
        gboolean ret;
 
        if (handle == NULL) {
@@ -393,15 +389,14 @@ ves_icall_System_Threading_Mutex_ReleaseMutex_internal (gpointer handle)
 
        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);
+                       __func__, mono_w32handle_get_typename (type), handle);
                return FALSE;
        }
 
        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);
+               __func__, mono_w32handle_get_typename (type), handle, (gpointer) mutex_handle->tid, mutex_handle->recursion);
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
 
        tid = pthread_self ();
 
@@ -412,7 +407,7 @@ ves_icall_System_Threading_Mutex_ReleaseMutex_internal (gpointer handle)
                ret = FALSE;
 
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: we don't own %s handle %p (owned by %ld, me %ld)",
-                       __func__, mono_w32handle_ops_typename (type), handle, mutex_handle->tid, tid);
+                           __func__, mono_w32handle_get_typename (type), handle, (long)mutex_handle->tid, (long)tid);
        } else {
                ret = TRUE;
 
@@ -423,15 +418,14 @@ ves_icall_System_Threading_Mutex_ReleaseMutex_internal (gpointer handle)
                        thread_disown_mutex (mono_thread_internal_current (), 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);
+                               __func__, mono_w32handle_get_typename (type), handle, (gpointer) mutex_handle->tid, mutex_handle->recursion);
 
                        mutex_handle->tid = 0;
                        mono_w32handle_set_signal_state (handle, TRUE, FALSE);
                }
        }
 
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
 
        return ret;
 }
@@ -492,7 +486,6 @@ mono_w32mutex_abandon (void)
                MonoW32HandleMutex *mutex_handle;
                MonoNativeThreadId tid;
                gpointer handle;
-               int thr_ret;
 
                handle = g_ptr_array_index (internal->owned_mutexes, 0);
 
@@ -506,11 +499,11 @@ mono_w32mutex_abandon (void)
 
                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);
+                               __func__, mono_w32handle_get_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);
+                       __func__, mono_w32handle_get_typename (type), handle);
 
                tid = MONO_UINT_TO_NATIVE_THREAD_ID (internal->tid);
 
@@ -518,8 +511,7 @@ mono_w32mutex_abandon (void)
                        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);
+               mono_w32handle_lock_handle (handle);
 
                mutex_handle->recursion = 0;
                mutex_handle->tid = 0;
@@ -530,10 +522,9 @@ mono_w32mutex_abandon (void)
                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);
+                       __func__, mono_w32handle_get_typename (type), handle);
 
-               thr_ret = mono_w32handle_unlock_handle (handle);
-               g_assert (thr_ret == 0);
+               mono_w32handle_unlock_handle (handle);
        }
 
        g_ptr_array_free (internal->owned_mutexes, TRUE);
diff --git a/mono/metadata/w32process-internals.h b/mono/metadata/w32process-internals.h
new file mode 100644 (file)
index 0000000..ad59f4c
--- /dev/null
@@ -0,0 +1,29 @@
+
+#ifndef _MONO_METADATA_W32PROCESS_INTERNALS_H_
+#define _MONO_METADATA_W32PROCESS_INTERNALS_H_
+
+#include <config.h>
+#include <glib.h>
+
+#include "io-layer/io-layer.h"
+
+#if !defined(HOST_WIN32)
+
+guint32
+mono_w32process_get_pid (gpointer handle);
+
+gboolean
+mono_w32process_try_get_modules (gpointer process, gpointer *modules, guint32 size, guint32 *needed);
+
+guint32
+mono_w32process_module_get_name (gpointer process, gpointer module, gunichar2 *basename, guint32 size);
+
+guint32
+mono_w32process_module_get_filename (gpointer process, gpointer module, gunichar2 *basename, guint32 size);
+
+gboolean
+mono_w32process_module_get_information (gpointer process, gpointer module, MODULEINFO *modinfo, guint32 size);
+
+#endif /* !defined(HOST_WIN32) */
+
+#endif /* _MONO_METADATA_W32PROCESS_INTERNALS_H_ */
diff --git a/mono/metadata/w32process-unix-bsd.c b/mono/metadata/w32process-unix-bsd.c
new file mode 100644 (file)
index 0000000..79655b9
--- /dev/null
@@ -0,0 +1,151 @@
+
+#include "w32process.h"
+#include "w32process-unix-internals.h"
+
+#ifdef USE_BSD_BACKEND
+
+#include <errno.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+#if !defined(__OpenBSD__)
+#include <sys/utsname.h>
+#endif
+#if defined(__FreeBSD__)
+#include <sys/user.h> /* struct kinfo_proc */
+#endif
+
+#include <link.h>
+
+#include "utils/mono-logger-internals.h"
+
+gchar*
+mono_w32process_get_name (pid_t pid)
+{
+       gint mib [6];
+       gsize size;
+       struct kinfo_proc *pi;
+       gchar *ret;
+
+#if defined(__FreeBSD__)
+       mib [0] = CTL_KERN;
+       mib [1] = KERN_PROC;
+       mib [2] = KERN_PROC_PID;
+       mib [3] = pid;
+       if (sysctl(mib, 4, NULL, &size, NULL, 0) < 0) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: sysctl() failed: %d", __func__, errno);
+               return NULL;
+       }
+
+       if ((pi = g_malloc (size)) == NULL)
+               return NULL;
+
+       if (sysctl (mib, 4, pi, &size, NULL, 0) < 0) {
+               if (errno == ENOMEM) {
+                       g_free (pi);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Didn't allocate enough memory for kproc info", __func__);
+               }
+               return NULL;
+       }
+
+       ret = strlen (pi->ki_comm) > 0 ? g_strdup (pi->ki_comm) : NULL;
+
+       g_free (pi);
+#elif defined(__OpenBSD__)
+       mib [0] = CTL_KERN;
+       mib [1] = KERN_PROC;
+       mib [2] = KERN_PROC_PID;
+       mib [3] = pid;
+       mib [4] = sizeof(struct kinfo_proc);
+       mib [5] = 0;
+
+retry:
+       if (sysctl(mib, 6, NULL, &size, NULL, 0) < 0) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: sysctl() failed: %d", __func__, errno);
+               return NULL;
+       }
+
+       if ((pi = g_malloc (size)) == NULL)
+               return NULL;
+
+       mib[5] = (int)(size / sizeof(struct kinfo_proc));
+
+       if ((sysctl (mib, 6, pi, &size, NULL, 0) < 0) ||
+               (size != sizeof (struct kinfo_proc))) {
+               if (errno == ENOMEM) {
+                       g_free (pi);
+                       goto retry;
+               }
+               return NULL;
+       }
+
+       ret = strlen (pi->p_comm) > 0 ? g_strdup (pi->p_comm) : NULL;
+
+       g_free (pi);
+#endif
+
+       return ret;
+}
+
+gchar*
+mono_w32process_get_path (pid_t pid)
+{
+       return mono_w32process_get_name (pid);
+}
+
+static gint
+mono_w32process_get_modules_callback (struct dl_phdr_info *info, gsize size, gpointer ptr)
+{
+       if (size < offsetof (struct dl_phdr_info, dlpi_phnum) + sizeof (info->dlpi_phnum))
+               return (-1);
+
+       struct dl_phdr_info *cpy = g_calloc (1, sizeof(struct dl_phdr_info));
+       if (!cpy)
+               return (-1);
+
+       memcpy(cpy, info, sizeof(*info));
+
+       g_ptr_array_add ((GPtrArray *)ptr, cpy);
+
+       return (0);
+}
+
+GSList*
+mono_w32process_get_modules (pid_t pid)
+{
+       GSList *ret = NULL;
+       MonoW32ProcessModule *mod;
+       GPtrArray *dlarray = g_ptr_array_new();
+       gint i;
+
+       if (dl_iterate_phdr (mono_w32process_get_modules_callback, dlarray) < 0)
+               return NULL;
+
+       for (i = 0; i < dlarray->len; i++) {
+               struct dl_phdr_info *info = g_ptr_array_index (dlarray, i);
+
+               mod = g_new0 (MonoW32ProcessModule, 1);
+               mod->address_start = (gpointer)(info->dlpi_addr + info->dlpi_phdr[0].p_vaddr);
+               mod->address_end = (gpointer)(info->dlpi_addr + info->dlpi_phdr[info->dlpi_phnum - 1].p_vaddr);
+               mod->perms = g_strdup ("r--p");
+               mod->address_offset = 0;
+               mod->inode = i;
+               mod->filename = g_strdup (info->dlpi_name);
+
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: inode=%d, filename=%s, address_start=%p, address_end=%p",
+                       __func__, mod->inode, mod->filename, mod->address_start, mod->address_end);
+
+               g_free (info);
+
+               if (g_slist_find_custom (ret, mod, mono_w32process_module_equals) == NULL) {
+                       ret = g_slist_prepend (ret, mod);
+               } else {
+                       mono_w32process_module_free (mod);
+               }
+       }
+
+       g_ptr_array_free (dlarray, TRUE);
+
+       return g_slist_reverse (ret);
+}
+
+#endif
diff --git a/mono/metadata/w32process-unix-default.c b/mono/metadata/w32process-unix-default.c
new file mode 100644 (file)
index 0000000..0b48370
--- /dev/null
@@ -0,0 +1,256 @@
+
+#include "w32process.h"
+#include "w32process-unix-internals.h"
+
+#ifdef USE_DEFAULT_BACKEND
+
+#include <unistd.h>
+
+#ifdef PLATFORM_SOLARIS
+/* procfs.h cannot be included if this define is set, but it seems to work fine if it is undefined */
+#if _FILE_OFFSET_BITS == 64
+#undef _FILE_OFFSET_BITS
+#include <procfs.h>
+#define _FILE_OFFSET_BITS 64
+#else
+#include <procfs.h>
+#endif
+#endif
+
+#include "utils/mono-logger-internals.h"
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 242
+#endif
+
+gchar*
+mono_w32process_get_name (pid_t pid)
+{
+       FILE *fp;
+       gchar *filename;
+       gchar buf[256];
+       gchar *ret = NULL;
+
+#if defined(PLATFORM_SOLARIS)
+       filename = g_strdup_printf ("/proc/%d/psinfo", pid);
+       if ((fp = fopen (filename, "r")) != NULL) {
+               struct psinfo info;
+               int nread;
+
+               nread = fread (&info, sizeof (info), 1, fp);
+               if (nread == 1) {
+                       ret = g_strdup (info.pr_fname);
+               }
+
+               fclose (fp);
+       }
+       g_free (filename);
+#else
+       memset (buf, '\0', sizeof(buf));
+       filename = g_strdup_printf ("/proc/%d/exe", pid);
+       if (readlink (filename, buf, 255) > 0) {
+               ret = g_strdup (buf);
+       }
+       g_free (filename);
+
+       if (ret != NULL) {
+               return(ret);
+       }
+
+       filename = g_strdup_printf ("/proc/%d/cmdline", pid);
+       if ((fp = fopen (filename, "r")) != NULL) {
+               if (fgets (buf, 256, fp) != NULL) {
+                       ret = g_strdup (buf);
+               }
+
+               fclose (fp);
+       }
+       g_free (filename);
+
+       if (ret != NULL) {
+               return(ret);
+       }
+
+       filename = g_strdup_printf ("/proc/%d/stat", pid);
+       if ((fp = fopen (filename, "r")) != NULL) {
+               if (fgets (buf, 256, fp) != NULL) {
+                       char *start, *end;
+
+                       start = strchr (buf, '(');
+                       if (start != NULL) {
+                               end = strchr (start + 1, ')');
+
+                               if (end != NULL) {
+                                       ret = g_strndup (start + 1,
+                                                        end - start - 1);
+                               }
+                       }
+               }
+
+               fclose (fp);
+       }
+       g_free (filename);
+#endif
+
+       return ret;
+}
+
+gchar*
+mono_w32process_get_path (pid_t pid)
+{
+       return mono_w32process_get_name (pid);
+}
+
+static FILE *
+open_process_map (int pid, const char *mode)
+{
+       gint i;
+       const gchar *proc_path[] = {
+               "/proc/%d/maps", /* GNU/Linux */
+               "/proc/%d/map",  /* FreeBSD */
+               NULL
+       };
+
+       for (i = 0; proc_path [i]; i++) {
+               gchar *filename;
+               FILE *fp;
+
+               filename = g_strdup_printf (proc_path[i], pid);
+               fp = fopen (filename, mode);
+               g_free (filename);
+
+               if (fp)
+                       return fp;
+       }
+
+       return NULL;
+}
+
+
+GSList*
+mono_w32process_get_modules (pid_t pid)
+{
+       GSList *ret = NULL;
+       FILE *fp;
+       MonoW32ProcessModule *mod;
+       gchar buf[MAXPATHLEN + 1], *p, *endp;
+       gchar *start_start, *end_start, *prot_start, *offset_start;
+       gchar *maj_dev_start, *min_dev_start, *inode_start, prot_buf[5];
+       gpointer address_start, address_end, address_offset;
+       guint32 maj_dev, min_dev;
+       guint64 inode;
+       guint64 device;
+
+       fp = open_process_map (pid, "r");
+       if (!fp)
+               return NULL;
+
+       while (fgets (buf, sizeof(buf), fp)) {
+               p = buf;
+               while (g_ascii_isspace (*p)) ++p;
+               start_start = p;
+               if (!g_ascii_isxdigit (*start_start)) {
+                       continue;
+               }
+               address_start = (gpointer)strtoul (start_start, &endp, 16);
+               p = endp;
+               if (*p != '-') {
+                       continue;
+               }
+
+               ++p;
+               end_start = p;
+               if (!g_ascii_isxdigit (*end_start)) {
+                       continue;
+               }
+               address_end = (gpointer)strtoul (end_start, &endp, 16);
+               p = endp;
+               if (!g_ascii_isspace (*p)) {
+                       continue;
+               }
+
+               while (g_ascii_isspace (*p)) ++p;
+               prot_start = p;
+               if (*prot_start != 'r' && *prot_start != '-') {
+                       continue;
+               }
+               memcpy (prot_buf, prot_start, 4);
+               prot_buf[4] = '\0';
+               while (!g_ascii_isspace (*p)) ++p;
+
+               while (g_ascii_isspace (*p)) ++p;
+               offset_start = p;
+               if (!g_ascii_isxdigit (*offset_start)) {
+                       continue;
+               }
+               address_offset = (gpointer)strtoul (offset_start, &endp, 16);
+               p = endp;
+               if (!g_ascii_isspace (*p)) {
+                       continue;
+               }
+
+               while(g_ascii_isspace (*p)) ++p;
+               maj_dev_start = p;
+               if (!g_ascii_isxdigit (*maj_dev_start)) {
+                       continue;
+               }
+               maj_dev = strtoul (maj_dev_start, &endp, 16);
+               p = endp;
+               if (*p != ':') {
+                       continue;
+               }
+
+               ++p;
+               min_dev_start = p;
+               if (!g_ascii_isxdigit (*min_dev_start)) {
+                       continue;
+               }
+               min_dev = strtoul (min_dev_start, &endp, 16);
+               p = endp;
+               if (!g_ascii_isspace (*p)) {
+                       continue;
+               }
+
+               while (g_ascii_isspace (*p)) ++p;
+               inode_start = p;
+               if (!g_ascii_isxdigit (*inode_start)) {
+                       continue;
+               }
+               inode = (guint64)strtol (inode_start, &endp, 10);
+               p = endp;
+               if (!g_ascii_isspace (*p)) {
+                       continue;
+               }
+
+               device = makedev ((int)maj_dev, (int)min_dev);
+               if ((device == 0) && (inode == 0)) {
+                       continue;
+               }
+
+               while(g_ascii_isspace (*p)) ++p;
+               /* p now points to the filename */
+
+               mod = g_new0 (MonoW32ProcessModule, 1);
+               mod->address_start = address_start;
+               mod->address_end = address_end;
+               mod->perms = g_strdup (prot_buf);
+               mod->address_offset = address_offset;
+               mod->device = device;
+               mod->inode = inode;
+               mod->filename = g_strdup (g_strstrip (p));
+
+               if (g_slist_find_custom (ret, mod, mono_w32process_module_equals) == NULL) {
+                       ret = g_slist_prepend (ret, mod);
+               } else {
+                       mono_w32process_module_free (mod);
+               }
+       }
+
+       ret = g_slist_reverse (ret);
+
+       fclose (fp);
+
+       return(ret);
+}
+
+#endif
diff --git a/mono/metadata/w32process-unix-haiku.c b/mono/metadata/w32process-unix-haiku.c
new file mode 100644 (file)
index 0000000..4311993
--- /dev/null
@@ -0,0 +1,56 @@
+
+#include "w32process.h"
+#include "w32process-unix-internals.h"
+
+#ifdef USE_HAIKU_BACKEND
+
+#include <KernelKit.h>
+
+gchar*
+mono_w32process_get_name (pid_t pid)
+{
+       image_info imageInfo;
+       int32 cookie = 0;
+
+       if (get_next_image_info ((team_id) pid, &cookie, &imageInfo) != B_OK)
+               return NULL;
+
+       return g_strdup (imageInfo.name);
+}
+
+gchar*
+mono_w32process_get_path (pid_t pid)
+{
+       return mono_w32process_get_name (pid);
+}
+
+GSList*
+mono_w32process_get_modules (pid_t pid)
+{
+       GSList *ret = NULL;
+       MonoW32ProcessModule *mod;
+       gint32 cookie = 0;
+       image_info imageInfo;
+
+       while (get_next_image_info (B_CURRENT_TEAM, &cookie, &imageInfo) == B_OK) {
+               mod = g_new0 (MonoW32ProcessModule, 1);
+               mod->device = imageInfo.device;
+               mod->inode = imageInfo.node;
+               mod->filename = g_strdup (imageInfo.name);
+               mod->address_start = MIN (imageInfo.text, imageInfo.data);
+               mod->address_end = MAX ((uint8_t*)imageInfo.text + imageInfo.text_size,
+                       (uint8_t*)imageInfo.data + imageInfo.data_size);
+               mod->perms = g_strdup ("r--p");
+               mod->address_offset = 0;
+
+               if (g_slist_find_custom (ret, mod, mono_w32process_module_equals) == NULL) {
+                       ret = g_slist_prepend (ret, mod);
+               } else {
+                       mono_w32process_module_free (mod);
+               }
+       }
+
+       return g_slist_reverse (ret);
+}
+
+#endif
diff --git a/mono/metadata/w32process-unix-internals.h b/mono/metadata/w32process-unix-internals.h
new file mode 100644 (file)
index 0000000..71226c3
--- /dev/null
@@ -0,0 +1,57 @@
+
+#ifndef _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_
+#define _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_
+
+#include <config.h>
+#include <glib.h>
+
+/*
+ * FOR EXCLUSIVE USE BY w32process-unix.c
+ */
+
+#if defined(PLATFORM_MACOSX)
+#define USE_OSX_BACKEND
+#elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(HAVE_LINK_H)
+#define USE_BSD_BACKEND
+#elif defined(__HAIKU__)
+#define USE_HAIKU_BACKEND
+#else
+#define USE_DEFAULT_BACKEND
+#endif
+
+typedef struct {
+       gpointer address_start;
+       gpointer address_end;
+       gchar *perms;
+       gpointer address_offset;
+       guint64 device;
+       guint64 inode;
+       gchar *filename;
+} MonoW32ProcessModule;
+
+gchar*
+mono_w32process_get_name (pid_t pid);
+
+GSList*
+mono_w32process_get_modules (pid_t pid);
+
+static void
+mono_w32process_module_free (MonoW32ProcessModule *module)
+{
+       g_free (module->perms);
+       g_free (module->filename);
+       g_free (module);
+}
+
+/*
+ * Used to look through the GSList* returned by mono_w32process_get_modules
+ */
+static gint
+mono_w32process_module_equals (gconstpointer a, gconstpointer b)
+{
+       MonoW32ProcessModule *want = (MonoW32ProcessModule *)a;
+       MonoW32ProcessModule *compare = (MonoW32ProcessModule *)b;
+       return (want->device == compare->device && want->inode == compare->inode) ? 0 : 1;
+}
+
+#endif /* _MONO_METADATA_W32PROCESS_UNIX_INTERNALS_H_ */
diff --git a/mono/metadata/w32process-unix-osx.c b/mono/metadata/w32process-unix-osx.c
new file mode 100644 (file)
index 0000000..eb3d5b7
--- /dev/null
@@ -0,0 +1,160 @@
+
+#include "w32process.h"
+#include "w32process-unix-internals.h"
+
+#ifdef USE_OSX_BACKEND
+
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+#include <sys/utsname.h>
+#include <mach-o/dyld.h>
+#include <mach-o/getsect.h>
+
+/* sys/resource.h (for rusage) is required when using osx 10.3 (but not 10.4) */
+#ifdef __APPLE__
+#include <TargetConditionals.h>
+#include <sys/resource.h>
+#ifdef HAVE_LIBPROC_H
+/* proc_name */
+#include <libproc.h>
+#endif
+#endif
+
+#include "utils/mono-logger-internals.h"
+
+gchar*
+mono_w32process_get_name (pid_t pid)
+{
+       gchar *ret = NULL;
+
+#if defined (__mono_ppc__) || !defined (TARGET_OSX)
+       size_t size;
+       struct kinfo_proc *pi;
+       gint mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };
+
+       if (sysctl(mib, 4, NULL, &size, NULL, 0) < 0)
+               return(ret);
+
+       if ((pi = g_malloc (size)) == NULL)
+               return(ret);
+
+       if (sysctl (mib, 4, pi, &size, NULL, 0) < 0) {
+               if (errno == ENOMEM) {
+                       g_free (pi);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Didn't allocate enough memory for kproc info", __func__);
+               }
+               return(ret);
+       }
+
+       if (strlen (pi->kp_proc.p_comm) > 0)
+               ret = g_strdup (pi->kp_proc.p_comm);
+
+       g_free (pi);
+#else
+       gchar buf[256];
+
+       /* No proc name on OSX < 10.5 nor ppc nor iOS */
+       memset (buf, '\0', sizeof(buf));
+       proc_name (pid, buf, sizeof(buf));
+
+       // Fixes proc_name triming values to 15 characters #32539
+       if (strlen (buf) >= MAXCOMLEN - 1) {
+               gchar path_buf [PROC_PIDPATHINFO_MAXSIZE];
+               gchar *name_buf;
+               gint path_len;
+
+               memset (path_buf, '\0', sizeof(path_buf));
+               path_len = proc_pidpath (pid, path_buf, sizeof(path_buf));
+
+               if (path_len > 0 && path_len < sizeof(path_buf)) {
+                       name_buf = path_buf + path_len;
+                       for(;name_buf > path_buf; name_buf--) {
+                               if (name_buf [0] == '/') {
+                                       name_buf++;
+                                       break;
+                               }
+                       }
+
+                       if (memcmp (buf, name_buf, MAXCOMLEN - 1) == 0)
+                               ret = g_strdup (name_buf);
+               }
+       }
+
+       if (ret == NULL && strlen (buf) > 0)
+               ret = g_strdup (buf);
+#endif
+
+       return ret;
+}
+
+gchar*
+mono_w32process_get_path (pid_t pid)
+{
+#if defined(__mono_ppc__) || !defined(TARGET_OSX)
+       return mono_w32process_get_name (pid);
+#else
+       gchar buf [PROC_PIDPATHINFO_MAXSIZE];
+       gint res;
+
+       res = proc_pidpath (pid, buf, sizeof (buf));
+       if (res <= 0)
+               return NULL;
+       if (buf [0] == '\0')
+               return NULL;
+       return g_strdup (buf);
+#endif
+}
+
+GSList*
+mono_w32process_get_modules (pid_t pid)
+{
+       GSList *ret = NULL;
+       MonoW32ProcessModule *mod;
+       guint32 count = _dyld_image_count ();
+       int i = 0;
+
+       for (i = 0; i < count; i++) {
+#if SIZEOF_VOID_P == 8
+               const struct mach_header_64 *hdr;
+               const struct section_64 *sec;
+#else
+               const struct mach_header *hdr;
+               const struct section *sec;
+#endif
+               const char *name;
+
+               name = _dyld_get_image_name (i);
+#if SIZEOF_VOID_P == 8
+               hdr = (const struct mach_header_64*)_dyld_get_image_header (i);
+               sec = getsectbynamefromheader_64 (hdr, SEG_DATA, SECT_DATA);
+#else
+               hdr = _dyld_get_image_header (i);
+               sec = getsectbynamefromheader (hdr, SEG_DATA, SECT_DATA);
+#endif
+
+               /* Some dynlibs do not have data sections on osx (#533893) */
+               if (sec == 0)
+                       continue;
+
+               mod = g_new0 (MonoW32ProcessModule, 1);
+               mod->address_start = GINT_TO_POINTER (sec->addr);
+               mod->address_end = GINT_TO_POINTER (sec->addr+sec->size);
+               mod->perms = g_strdup ("r--p");
+               mod->address_offset = 0;
+               mod->device = makedev (0, 0);
+               mod->inode = i;
+               mod->filename = g_strdup (name);
+
+               if (g_slist_find_custom (ret, mod, mono_w32process_module_equals) == NULL) {
+                       ret = g_slist_prepend (ret, mod);
+               } else {
+                       mono_w32process_module_free (mod);
+               }
+       }
+
+       return g_slist_reverse (ret);
+}
+
+#endif
diff --git a/mono/metadata/w32process-unix.c b/mono/metadata/w32process-unix.c
new file mode 100644 (file)
index 0000000..82663ca
--- /dev/null
@@ -0,0 +1,2332 @@
+/*
+ * process.c: System.Diagnostics.Process support
+ *
+ * Author:
+ *     Dick Porter (dick@ximian.com)
+ *
+ * Copyright 2002 Ximian, Inc.
+ * Copyright 2002-2006 Novell, Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <sched.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#include <sys/time.h>
+#include <fcntl.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <ctype.h>
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+#ifdef HAVE_SYS_MKDEV_H
+#include <sys/mkdev.h>
+#endif
+
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif
+
+#include <mono/metadata/w32process.h>
+#include <mono/metadata/w32process-internals.h>
+#include <mono/metadata/w32process-unix-internals.h>
+#include <mono/metadata/class.h>
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/object-internals.h>
+#include <mono/metadata/metadata.h>
+#include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/exception.h>
+#include <mono/io-layer/io-layer.h>
+#include <mono/metadata/w32handle.h>
+#include <mono/utils/mono-membar.h>
+#include <mono/utils/mono-logger-internals.h>
+#include <mono/utils/strenc.h>
+#include <mono/utils/mono-proclib.h>
+#include <mono/utils/mono-path.h>
+#include <mono/utils/mono-lazy-init.h>
+#include <mono/utils/mono-signal-handler.h>
+#include <mono/utils/mono-time.h>
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 242
+#endif
+
+#define STILL_ACTIVE ((int) 0x00000103)
+
+#define LOGDEBUG(...)
+/* define LOGDEBUG(...) g_message(__VA_ARGS__)  */
+
+/* The process' environment strings */
+#if defined(__APPLE__)
+#if defined (TARGET_OSX)
+/* Apple defines this in crt_externs.h but doesn't provide that header for 
+ * arm-apple-darwin9.  We'll manually define the symbol on Apple as it does
+ * in fact exist on all implementations (so far) 
+ */
+gchar ***_NSGetEnviron(void);
+#define environ (*_NSGetEnviron())
+#else
+static char *mono_environ[1] = { NULL };
+#define environ mono_environ
+#endif /* defined (TARGET_OSX) */
+#else
+extern char **environ;
+#endif
+
+typedef enum {
+       STARTF_USESHOWWINDOW=0x001,
+       STARTF_USESIZE=0x002,
+       STARTF_USEPOSITION=0x004,
+       STARTF_USECOUNTCHARS=0x008,
+       STARTF_USEFILLATTRIBUTE=0x010,
+       STARTF_RUNFULLSCREEN=0x020,
+       STARTF_FORCEONFEEDBACK=0x040,
+       STARTF_FORCEOFFFEEDBACK=0x080,
+       STARTF_USESTDHANDLES=0x100
+} StartupFlags;
+
+typedef struct {
+       gpointer input;
+       gpointer output;
+       gpointer error;
+} StartupHandles;
+
+typedef struct {
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+       guint32 highDateTime;
+       guint32 lowDateTime;
+#else
+       guint32 lowDateTime;
+       guint32 highDateTime;
+#endif
+} ProcessTime;
+
+/*
+ * MonoProcess describes processes we create.
+ * It contains a semaphore that can be waited on in order to wait
+ * for process termination. It's accessed in our SIGCHLD handler,
+ * when status is updated (and pid cleared, to not clash with
+ * subsequent processes that may get executed).
+ */
+typedef struct _MonoProcess MonoProcess;
+struct _MonoProcess {
+       pid_t pid; /* the pid of the process. This value is only valid until the process has exited. */
+       MonoSemType exit_sem; /* this semaphore will be released when the process exits */
+       int status; /* the exit status */
+       gint32 handle_count; /* the number of handles to this mono_process instance */
+       /* we keep a ref to the creating _WapiHandle_process handle until
+        * the process has exited, so that the information there isn't lost.
+        */
+       gpointer handle;
+       gboolean freeable;
+       MonoProcess *next;
+};
+
+/* MonoW32HandleProcess is a structure containing all the required information for process handling. */
+typedef struct {
+       pid_t id;
+       gboolean child;
+       guint32 exitstatus;
+       gpointer main_thread;
+       WapiFileTime create_time;
+       WapiFileTime exit_time;
+       char *proc_name;
+       size_t min_working_set;
+       size_t max_working_set;
+       gboolean exited;
+       MonoProcess *mono_process;
+} MonoW32HandleProcess;
+
+#if HAVE_SIGACTION
+static mono_lazy_init_t process_sig_chld_once = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
+#endif
+
+static gchar *cli_launcher;
+
+/* The signal-safe logic to use processes goes like this:
+ * - The list must be safe to traverse for the signal handler at all times.
+ *   It's safe to: prepend an entry (which is a single store to 'processes'),
+ *   unlink an entry (assuming the unlinked entry isn't freed and doesn't
+ *   change its 'next' pointer so that it can still be traversed).
+ * When cleaning up we first unlink an entry, then we verify that
+ * the read lock isn't locked. Then we can free the entry, since
+ * we know that nobody is using the old version of the list (including
+ * the unlinked entry).
+ * We also need to lock when adding and cleaning up so that those two
+ * operations don't mess with eachother. (This lock is not used in the
+ * signal handler) */
+static MonoProcess *processes;
+static mono_mutex_t processes_mutex;
+
+static gpointer current_process;
+
+static const gunichar2 utf16_space_bytes [2] = { 0x20, 0 };
+static const gunichar2 *utf16_space = utf16_space_bytes;
+static const gunichar2 utf16_quote_bytes [2] = { 0x22, 0 };
+static const gunichar2 *utf16_quote = utf16_quote_bytes;
+
+/* Check if a pid is valid - i.e. if a process exists with this pid. */
+static gboolean
+process_is_alive (pid_t pid)
+{
+#if defined(HOST_WATCHOS)
+       return TRUE; // TODO: Rewrite using sysctl
+#elif defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
+       if (pid == 0)
+               return FALSE;
+       if (kill (pid, 0) == 0)
+               return TRUE;
+       if (errno == EPERM)
+               return TRUE;
+       return FALSE;
+#elif defined(__HAIKU__)
+       team_info teamInfo;
+       if (get_team_info ((team_id)pid, &teamInfo) == B_OK)
+               return TRUE;
+       return FALSE;
+#else
+       gchar *dir = g_strdup_printf ("/proc/%d", pid);
+       gboolean result = access (dir, F_OK) == 0;
+       g_free (dir);
+       return result;
+#endif
+}
+
+static void
+process_details (gpointer data)
+{
+       MonoW32HandleProcess *process_handle = (MonoW32HandleProcess *) data;
+       g_print ("id: %d, exited: %s, exitstatus: %d",
+               process_handle->id, process_handle->exited ? "true" : "false", process_handle->exitstatus);
+}
+
+static const gchar*
+process_typename (void)
+{
+       return "Process";
+}
+
+static gsize
+process_typesize (void)
+{
+       return sizeof (MonoW32HandleProcess);
+}
+
+static MonoW32HandleWaitRet
+process_wait (gpointer handle, guint32 timeout, gboolean *alerted)
+{
+       MonoW32HandleProcess *process_handle;
+       pid_t pid G_GNUC_UNUSED, ret;
+       int status;
+       gint64 start, now;
+       MonoProcess *mp;
+       gboolean res;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u)", __func__, handle, timeout);
+
+       if (alerted)
+               *alerted = FALSE;
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               g_warning ("%s: error looking up process handle %p", __func__, handle);
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
+       }
+
+       if (process_handle->exited) {
+               /* We've already done this one */
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Process already exited", __func__, handle, timeout);
+               return MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
+       }
+
+       pid = process_handle->id;
+
+       if (pid == mono_process_current_pid ()) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on current process", __func__, handle, timeout);
+               return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+       }
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): PID: %d", __func__, handle, timeout, pid);
+
+       /* We don't need to lock processes here, the entry
+        * has a handle_count > 0 which means it will not be freed. */
+       mp = process_handle->mono_process;
+       if (!mp) {
+               pid_t res;
+
+               /* This path is used when calling Process.HasExited, so
+                * it is only used to poll the state of the process, not
+                * to actually wait on it to exit */
+               g_assert (timeout == 0);
+
+               /* We alway create a MonoProcess for a child process */
+               g_assert (!process_handle->child);
+
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on non-child process", __func__, handle, timeout);
+
+               res = waitpid (pid, &status, WNOHANG);
+               if (res != -1)
+                       g_error ("%s: a process handle without a mono_process is not a child process", __func__);
+
+               if (errno == ECHILD) {
+                       if (!process_is_alive (pid)) {
+                               /* assume the process had exited */
+                               process_handle->exited = TRUE;
+                               process_handle->exitstatus = -1;
+                               mono_w32handle_set_signal_state (handle, TRUE, TRUE);
+                       }
+
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process waited successfully (2)", __func__, handle, timeout);
+                       return MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
+               }
+
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): non-child process wait failed, error : %s (%d))", __func__, handle, timeout, g_strerror (errno), errno);
+               return MONO_W32HANDLE_WAIT_RET_FAILED;
+       }
+
+       start = mono_msec_ticks ();
+       now = start;
+
+       while (1) {
+               if (timeout != INFINITE) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on semaphore for %li ms...",
+                               __func__, handle, timeout, (long)(timeout - (now - start)));
+                       ret = mono_os_sem_timedwait (&mp->exit_sem, (timeout - (now - start)), alerted ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE);
+               } else {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on semaphore forever...",
+                               __func__, handle, timeout);
+                       ret = mono_os_sem_wait (&mp->exit_sem, alerted ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE);
+               }
+
+               if (ret == MONO_SEM_TIMEDWAIT_RET_SUCCESS) {
+                       /* Success, process has exited */
+                       mono_os_sem_post (&mp->exit_sem);
+                       break;
+               }
+
+               if (ret == MONO_SEM_TIMEDWAIT_RET_TIMEDOUT) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): wait timeout (timeout = 0)", __func__, handle, timeout);
+                       return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+               }
+
+               now = mono_msec_ticks ();
+               if (now - start >= timeout) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): wait timeout", __func__, handle, timeout);
+                       return MONO_W32HANDLE_WAIT_RET_TIMEOUT;
+               }
+
+               if (alerted && ret == MONO_SEM_TIMEDWAIT_RET_ALERTED) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): wait alerted", __func__, handle, timeout);
+                       *alerted = TRUE;
+                       return MONO_W32HANDLE_WAIT_RET_ALERTED;
+               }
+       }
+
+       /* Process must have exited */
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Waited successfully", __func__, handle, timeout);
+
+       status = mp->status;
+       if (WIFSIGNALED (status))
+               process_handle->exitstatus = 128 + WTERMSIG (status);
+       else
+               process_handle->exitstatus = WEXITSTATUS (status);
+       _wapi_time_t_to_filetime (time (NULL), &process_handle->exit_time);
+
+       process_handle->exited = TRUE;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): Setting pid %d signalled, exit status %d",
+                  __func__, handle, timeout, process_handle->id, process_handle->exitstatus);
+
+       mono_w32handle_set_signal_state (handle, TRUE, TRUE);
+
+       return MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
+}
+
+static void
+processes_cleanup (void)
+{
+       static gint32 cleaning_up;
+       MonoProcess *mp;
+       MonoProcess *prev = NULL;
+       GSList *finished = NULL;
+       GSList *l;
+       gpointer unref_handle;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s", __func__);
+
+       /* Ensure we're not in here in multiple threads at once, nor recursive. */
+       if (InterlockedCompareExchange (&cleaning_up, 1, 0) != 0)
+               return;
+
+       for (mp = processes; mp; mp = mp->next) {
+               if (mp->pid == 0 && mp->handle) {
+                       /* This process has exited and we need to remove the artifical ref
+                        * on the handle */
+                       mono_os_mutex_lock (&processes_mutex);
+                       unref_handle = mp->handle;
+                       mp->handle = NULL;
+                       mono_os_mutex_unlock (&processes_mutex);
+                       if (unref_handle)
+                               mono_w32handle_unref (unref_handle);
+               }
+       }
+
+       /*
+        * Remove processes which exited from the processes list.
+        * We need to synchronize with the sigchld handler here, which runs
+        * asynchronously. The handler requires that the processes list
+        * remain valid.
+        */
+       mono_os_mutex_lock (&processes_mutex);
+
+       mp = processes;
+       while (mp) {
+               if (mp->handle_count == 0 && mp->freeable) {
+                       /*
+                        * Unlink the entry.
+                        * This code can run parallel with the sigchld handler, but the
+                        * modifications it makes are safe.
+                        */
+                       if (mp == processes)
+                               processes = mp->next;
+                       else
+                               prev->next = mp->next;
+                       finished = g_slist_prepend (finished, mp);
+
+                       mp = mp->next;
+               } else {
+                       prev = mp;
+                       mp = mp->next;
+               }
+       }
+
+       mono_memory_barrier ();
+
+       for (l = finished; l; l = l->next) {
+               /*
+                * All the entries in the finished list are unlinked from processes, and
+                * they have the 'finished' flag set, which means the sigchld handler is done
+                * accessing them.
+                */
+               mp = (MonoProcess *)l->data;
+               mono_os_sem_destroy (&mp->exit_sem);
+               g_free (mp);
+       }
+       g_slist_free (finished);
+
+       mono_os_mutex_unlock (&processes_mutex);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s done", __func__);
+
+       InterlockedExchange (&cleaning_up, 0);
+}
+
+static void
+process_close (gpointer handle, gpointer data)
+{
+       MonoW32HandleProcess *process_handle;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s", __func__);
+
+       process_handle = (MonoW32HandleProcess *) data;
+       g_free (process_handle->proc_name);
+       process_handle->proc_name = NULL;
+       if (process_handle->mono_process)
+               InterlockedDecrement (&process_handle->mono_process->handle_count);
+       processes_cleanup ();
+}
+
+static MonoW32HandleOps process_ops = {
+       process_close,          /* close_shared */
+       NULL,                           /* signal */
+       NULL,                           /* own */
+       NULL,                           /* is_owned */
+       process_wait,                   /* special_wait */
+       NULL,                           /* prewait */
+       process_details,        /* details */
+       process_typename,       /* typename */
+       process_typesize,       /* typesize */
+};
+
+static void
+process_set_defaults (MonoW32HandleProcess *process_handle)
+{
+       /* These seem to be the defaults on w2k */
+       process_handle->min_working_set = 204800;
+       process_handle->max_working_set = 1413120;
+
+       _wapi_time_t_to_filetime (time (NULL), &process_handle->create_time);
+}
+
+static void
+process_set_name (MonoW32HandleProcess *process_handle)
+{
+       char *progname, *utf8_progname, *slash;
+
+       progname = g_get_prgname ();
+       utf8_progname = mono_utf8_from_external (progname);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: using [%s] as prog name", __func__, progname);
+
+       if (utf8_progname) {
+               slash = strrchr (utf8_progname, '/');
+               if (slash)
+                       process_handle->proc_name = g_strdup (slash+1);
+               else
+                       process_handle->proc_name = g_strdup (utf8_progname);
+               g_free (utf8_progname);
+       }
+}
+
+void
+mono_w32process_init (void)
+{
+       MonoW32HandleProcess process_handle;
+
+       mono_w32handle_register_ops (MONO_W32HANDLE_PROCESS, &process_ops);
+
+       mono_w32handle_register_capabilities (MONO_W32HANDLE_PROCESS,
+               (MonoW32HandleCapability)(MONO_W32HANDLE_CAP_WAIT | MONO_W32HANDLE_CAP_SPECIAL_WAIT));
+
+       memset (&process_handle, 0, sizeof (process_handle));
+       process_handle.id = wapi_getpid ();
+       process_set_defaults (&process_handle);
+       process_set_name (&process_handle);
+
+       current_process = mono_w32handle_new (MONO_W32HANDLE_PROCESS, &process_handle);
+       g_assert (current_process);
+
+       mono_os_mutex_init (&processes_mutex);
+}
+
+void
+mono_w32process_cleanup (void)
+{
+       g_free (cli_launcher);
+}
+
+static int
+len16 (const gunichar2 *str)
+{
+       int len = 0;
+
+       while (*str++ != 0)
+               len++;
+
+       return len;
+}
+
+static gunichar2 *
+utf16_concat (const gunichar2 *first, ...)
+{
+       va_list args;
+       int total = 0, i;
+       const gunichar2 *s;
+       const gunichar2 *p;
+       gunichar2 *ret;
+
+       va_start (args, first);
+       total += len16 (first);
+       for (s = va_arg (args, gunichar2 *); s != NULL; s = va_arg(args, gunichar2 *))
+               total += len16 (s);
+       va_end (args);
+
+       ret = g_new (gunichar2, total + 1);
+       if (ret == NULL)
+               return NULL;
+
+       ret [total] = 0;
+       i = 0;
+       for (s = first; *s != 0; s++)
+               ret [i++] = *s;
+       va_start (args, first);
+       for (s = va_arg (args, gunichar2 *); s != NULL; s = va_arg (args, gunichar2 *)){
+               for (p = s; *p != 0; p++)
+                       ret [i++] = *p;
+       }
+       va_end (args);
+
+       return ret;
+}
+
+guint32
+mono_w32process_get_pid (gpointer handle)
+{
+       MonoW32HandleProcess *process_handle;
+       gboolean res;
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               SetLastError (ERROR_INVALID_HANDLE);
+               return 0;
+       }
+
+       return process_handle->id;
+}
+
+typedef struct {
+       guint32 pid;
+       gpointer handle;
+} GetProcessForeachData;
+
+static gboolean
+get_process_foreach_callback (gpointer handle, gpointer handle_specific, gpointer user_data)
+{
+       GetProcessForeachData *foreach_data;
+       MonoW32HandleProcess *process_handle;
+       pid_t pid;
+
+       foreach_data = (GetProcessForeachData*) user_data;
+
+       if (mono_w32handle_get_type (handle) != MONO_W32HANDLE_PROCESS)
+               return FALSE;
+
+       process_handle = (MonoW32HandleProcess*) handle_specific;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: looking at process %d", __func__, process_handle->id);
+
+       pid = process_handle->id;
+       if (pid == 0)
+               return FALSE;
+
+       /* It's possible to have more than one process handle with the
+        * same pid, but only the one running process can be
+        * unsignalled. */
+       if (foreach_data->pid != pid)
+               return FALSE;
+       if (mono_w32handle_issignalled (handle))
+               return FALSE;
+
+       mono_w32handle_ref (handle);
+       foreach_data->handle = handle;
+       return TRUE;
+}
+
+HANDLE
+ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
+{
+       GetProcessForeachData foreach_data;
+       gpointer handle;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: looking for process %d", __func__, pid);
+
+       memset (&foreach_data, 0, sizeof (foreach_data));
+       foreach_data.pid = pid;
+       mono_w32handle_foreach (get_process_foreach_callback, &foreach_data);
+       handle = foreach_data.handle;
+       if (handle) {
+               /* get_process_foreach_callback already added a ref */
+               return handle;
+       }
+
+       if (process_is_alive (pid)) {
+               /* non-child process */
+               MonoW32HandleProcess process_handle;
+
+               memset (&process_handle, 0, sizeof (process_handle));
+               process_handle.id = pid;
+               process_handle.proc_name = mono_w32process_get_name (pid);
+
+               handle = mono_w32handle_new (MONO_W32HANDLE_PROCESS, &process_handle);
+               if (handle == INVALID_HANDLE_VALUE) {
+                       g_warning ("%s: error creating process handle", __func__);
+
+                       SetLastError (ERROR_OUTOFMEMORY);
+                       return NULL;
+               }
+
+               return handle;
+       }
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find pid %d", __func__, pid);
+
+       SetLastError (ERROR_PROC_NOT_FOUND);
+       return NULL;
+}
+
+static gboolean
+match_procname_to_modulename (char *procname, char *modulename)
+{
+       char* lastsep = NULL;
+       char* lastsep2 = NULL;
+       char* pname = NULL;
+       char* mname = NULL;
+       gboolean result = FALSE;
+
+       if (procname == NULL || modulename == NULL)
+               return (FALSE);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: procname=\"%s\", modulename=\"%s\"", __func__, procname, modulename);
+       pname = mono_path_resolve_symlinks (procname);
+       mname = mono_path_resolve_symlinks (modulename);
+
+       if (!strcmp (pname, mname))
+               result = TRUE;
+
+       if (!result) {
+               lastsep = strrchr (mname, '/');
+               if (lastsep)
+                       if (!strcmp (lastsep+1, pname))
+                               result = TRUE;
+               if (!result) {
+                       lastsep2 = strrchr (pname, '/');
+                       if (lastsep2){
+                               if (lastsep) {
+                                       if (!strcmp (lastsep+1, lastsep2+1))
+                                               result = TRUE;
+                               } else {
+                                       if (!strcmp (mname, lastsep2+1))
+                                               result = TRUE;
+                               }
+                       }
+               }
+       }
+
+       g_free (pname);
+       g_free (mname);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: result is %d", __func__, result);
+       return result;
+}
+
+gboolean
+mono_w32process_try_get_modules (gpointer process, gpointer *modules, guint32 size, guint32 *needed)
+{
+       MonoW32HandleProcess *process_handle;
+       GSList *mods = NULL;
+       MonoW32ProcessModule *module;
+       guint32 count, avail = size / sizeof(gpointer);
+       int i;
+       pid_t pid;
+       char *proc_name = NULL;
+       gboolean res;
+
+       /* Store modules in an array of pointers (main module as
+        * modules[0]), using the load address for each module as a
+        * token.  (Use 'NULL' as an alternative for the main module
+        * so that the simple implementation can just return one item
+        * for now.)  Get the info from /proc/<pid>/maps on linux,
+        * /proc/<pid>/map on FreeBSD, other systems will have to
+        * implement /dev/kmem reading or whatever other horrid
+        * technique is needed.
+        */
+       if (size < sizeof(gpointer))
+               return FALSE;
+
+       res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
+               return FALSE;
+       }
+
+       pid = process_handle->id;
+       proc_name = g_strdup (process_handle->proc_name);
+
+       if (!proc_name) {
+               modules[0] = NULL;
+               *needed = sizeof(gpointer);
+               return TRUE;
+       }
+
+       mods = mono_w32process_get_modules (pid);
+       if (!mods) {
+               modules[0] = NULL;
+               *needed = sizeof(gpointer);
+               g_free (proc_name);
+               return TRUE;
+       }
+
+       count = g_slist_length (mods);
+
+       /* count + 1 to leave slot 0 for the main module */
+       *needed = sizeof(gpointer) * (count + 1);
+
+       /*
+        * Use the NULL shortcut, as the first line in
+        * /proc/<pid>/maps isn't the executable, and we need
+        * that first in the returned list. Check the module name
+        * to see if it ends with the proc name and substitute
+        * the first entry with it.  FIXME if this turns out to
+        * be a problem.
+        */
+       modules[0] = NULL;
+       for (i = 0; i < (avail - 1) && i < count; i++) {
+               module = (MonoW32ProcessModule *)g_slist_nth_data (mods, i);
+               if (modules[0] != NULL)
+                       modules[i] = module->address_start;
+               else if (match_procname_to_modulename (proc_name, module->filename))
+                       modules[0] = module->address_start;
+               else
+                       modules[i + 1] = module->address_start;
+       }
+
+       for (i = 0; i < count; i++) {
+               mono_w32process_module_free ((MonoW32ProcessModule *)g_slist_nth_data (mods, i));
+       }
+       g_slist_free (mods);
+       g_free (proc_name);
+
+       return TRUE;
+}
+
+guint32
+mono_w32process_module_get_filename (gpointer process, gpointer module, gunichar2 *basename, guint32 size)
+{
+       gint pid, len;
+       gsize bytes;
+       gchar *path;
+       gunichar2 *proc_path;
+
+       size *= sizeof (gunichar2); /* adjust for unicode characters */
+
+       if (basename == NULL || size == 0)
+               return 0;
+
+       pid = mono_w32process_get_pid (process);
+
+       path = mono_w32process_get_path (pid);
+       if (path == NULL)
+               return 0;
+
+       proc_path = mono_unicode_from_external (path, &bytes);
+       g_free (path);
+
+       if (proc_path == NULL)
+               return 0;
+
+       len = (bytes / 2);
+
+       /* Add the terminator */
+       bytes += 2;
+
+       if (size < bytes) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d smaller than needed (%ld); truncating", __func__, size, bytes);
+               memcpy (basename, proc_path, size);
+       } else {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d larger than needed (%ld)", __func__, size, bytes);
+               memcpy (basename, proc_path, bytes);
+       }
+
+       g_free (proc_path);
+
+       return len;
+}
+
+guint32
+mono_w32process_module_get_name (gpointer process, gpointer module, gunichar2 *basename, guint32 size)
+{
+       MonoW32HandleProcess *process_handle;
+       pid_t pid;
+       gunichar2 *procname;
+       char *procname_ext = NULL;
+       glong len;
+       gsize bytes;
+       GSList *mods = NULL;
+       MonoW32ProcessModule *found_module;
+       guint32 count;
+       int i;
+       char *proc_name = NULL;
+       gboolean res;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Getting module base name, process handle %p module %p",
+                  __func__, process, module);
+
+       size = size * sizeof (gunichar2); /* adjust for unicode characters */
+
+       if (basename == NULL || size == 0)
+               return 0;
+
+       res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
+               return 0;
+       }
+
+       pid = process_handle->id;
+       proc_name = g_strdup (process_handle->proc_name);
+
+       mods = mono_w32process_get_modules (pid);
+       if (!mods) {
+               g_free (proc_name);
+               return 0;
+       }
+
+       count = g_slist_length (mods);
+
+       /* If module != NULL compare the address.
+        * If module == NULL we are looking for the main module.
+        * The best we can do for now check it the module name end with the process name.
+        */
+       for (i = 0; i < count; i++) {
+               found_module = (MonoW32ProcessModule *)g_slist_nth_data (mods, i);
+               if (procname_ext == NULL &&
+                       ((module == NULL && match_procname_to_modulename (proc_name, found_module->filename)) ||
+                        (module != NULL && found_module->address_start == module))) {
+                       procname_ext = g_path_get_basename (found_module->filename);
+               }
+
+               mono_w32process_module_free (found_module);
+       }
+
+       if (procname_ext == NULL) {
+               /* If it's *still* null, we might have hit the
+                * case where reading /proc/$pid/maps gives an
+                * empty file for this user.
+                */
+               procname_ext = mono_w32process_get_name (pid);
+       }
+
+       g_slist_free (mods);
+       g_free (proc_name);
+
+       if (procname_ext) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Process name is [%s]", __func__,
+                          procname_ext);
+
+               procname = mono_unicode_from_external (procname_ext, &bytes);
+               if (procname == NULL) {
+                       /* bugger */
+                       g_free (procname_ext);
+                       return 0;
+               }
+
+               len = (bytes / 2);
+
+               /* Add the terminator */
+               bytes += 2;
+
+               if (size < bytes) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d smaller than needed (%ld); truncating", __func__, size, bytes);
+
+                       memcpy (basename, procname, size);
+               } else {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Size %d larger than needed (%ld)",
+                                  __func__, size, bytes);
+
+                       memcpy (basename, procname, bytes);
+               }
+
+               g_free (procname);
+               g_free (procname_ext);
+
+               return len;
+       }
+
+       return 0;
+}
+
+gboolean
+mono_w32process_module_get_information (gpointer process, gpointer module, WapiModuleInfo *modinfo, guint32 size)
+{
+       MonoW32HandleProcess *process_handle;
+       pid_t pid;
+       GSList *mods = NULL;
+       MonoW32ProcessModule *found_module;
+       guint32 count;
+       int i;
+       gboolean ret = FALSE;
+       char *proc_name = NULL;
+       gboolean res;
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Getting module info, process handle %p module %p",
+                  __func__, process, module);
+
+       if (modinfo == NULL || size < sizeof (WapiModuleInfo))
+               return FALSE;
+
+       res = mono_w32handle_lookup (process, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, process);
+               return FALSE;
+       }
+
+       pid = process_handle->id;
+       proc_name = g_strdup (process_handle->proc_name);
+
+       mods = mono_w32process_get_modules (pid);
+       if (!mods) {
+               g_free (proc_name);
+               return FALSE;
+       }
+
+       count = g_slist_length (mods);
+
+       /* If module != NULL compare the address.
+        * If module == NULL we are looking for the main module.
+        * The best we can do for now check it the module name end with the process name.
+        */
+       for (i = 0; i < count; i++) {
+                       found_module = (MonoW32ProcessModule *)g_slist_nth_data (mods, i);
+                       if (ret == FALSE &&
+                               ((module == NULL && match_procname_to_modulename (proc_name, found_module->filename)) ||
+                                (module != NULL && found_module->address_start == module))) {
+                               modinfo->lpBaseOfDll = found_module->address_start;
+                               modinfo->SizeOfImage = (gsize)(found_module->address_end) - (gsize)(found_module->address_start);
+                               modinfo->EntryPoint = found_module->address_offset;
+                               ret = TRUE;
+                       }
+
+                       mono_w32process_module_free (found_module);
+       }
+
+       g_slist_free (mods);
+       g_free (proc_name);
+
+       return ret;
+}
+
+static void
+switch_dir_separators (char *path)
+{
+       size_t i, pathLength = strlen(path);
+       
+       /* Turn all the slashes round the right way, except for \' */
+       /* There are probably other characters that need to be excluded as well. */
+       for (i = 0; i < pathLength; i++) {
+               if (path[i] == '\\' && i < pathLength - 1 && path[i+1] != '\'' )
+                       path[i] = '/';
+       }
+}
+
+#if HAVE_SIGACTION
+
+MONO_SIGNAL_HANDLER_FUNC (static, mono_sigchld_signal_handler, (int _dummy, siginfo_t *info, void *context))
+{
+       int status;
+       int pid;
+       MonoProcess *p;
+
+       do {
+               do {
+                       pid = waitpid (-1, &status, WNOHANG);
+               } while (pid == -1 && errno == EINTR);
+
+               if (pid <= 0)
+                       break;
+
+               /*
+                * This can run concurrently with the code in the rest of this module.
+                */
+               for (p = processes; p; p = p->next) {
+                       if (p->pid != pid)
+                               continue;
+
+                       p->pid = 0; /* this pid doesn't exist anymore, clear it */
+                       p->status = status;
+                       mono_os_sem_post (&p->exit_sem);
+                       mono_memory_barrier ();
+                       /* Mark this as freeable, the pointer becomes invalid afterwards */
+                       p->freeable = TRUE;
+                       break;
+               }
+       } while (1);
+}
+
+static void
+process_add_sigchld_handler (void)
+{
+       struct sigaction sa;
+
+       sa.sa_sigaction = mono_sigchld_signal_handler;
+       sigemptyset (&sa.sa_mask);
+       sa.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
+       g_assert (sigaction (SIGCHLD, &sa, NULL) != -1);
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "Added SIGCHLD handler");
+}
+
+#endif
+
+static gboolean
+is_readable_or_executable (const char *prog)
+{
+       struct stat buf;
+       int a = access (prog, R_OK);
+       int b = access (prog, X_OK);
+       if (a != 0 && b != 0)
+               return FALSE;
+       if (stat (prog, &buf))
+               return FALSE;
+       if (S_ISREG (buf.st_mode))
+               return TRUE;
+       return FALSE;
+}
+
+static gboolean
+is_executable (const char *prog)
+{
+       struct stat buf;
+       if (access (prog, X_OK) != 0)
+               return FALSE;
+       if (stat (prog, &buf))
+               return FALSE;
+       if (S_ISREG (buf.st_mode))
+               return TRUE;
+       return FALSE;
+}
+
+static gboolean
+is_managed_binary (const char *filename)
+{
+       int original_errno = errno;
+#if defined(HAVE_LARGE_FILE_SUPPORT) && defined(O_LARGEFILE)
+       int file = open (filename, O_RDONLY | O_LARGEFILE);
+#else
+       int file = open (filename, O_RDONLY);
+#endif
+       off_t new_offset;
+       unsigned char buffer[8];
+       off_t file_size, optional_header_offset;
+       off_t pe_header_offset, clr_header_offset;
+       gboolean managed = FALSE;
+       int num_read;
+       guint32 first_word, second_word, magic_number;
+       
+       /* If we are unable to open the file, then we definitely
+        * can't say that it is managed. The child mono process
+        * probably wouldn't be able to open it anyway.
+        */
+       if (file < 0) {
+               errno = original_errno;
+               return FALSE;
+       }
+
+       /* Retrieve the length of the file for future sanity checks. */
+       file_size = lseek (file, 0, SEEK_END);
+       lseek (file, 0, SEEK_SET);
+
+       /* We know we need to read a header field at offset 60. */
+       if (file_size < 64)
+               goto leave;
+
+       num_read = read (file, buffer, 2);
+
+       if ((num_read != 2) || (buffer[0] != 'M') || (buffer[1] != 'Z'))
+               goto leave;
+
+       new_offset = lseek (file, 60, SEEK_SET);
+
+       if (new_offset != 60)
+               goto leave;
+       
+       num_read = read (file, buffer, 4);
+
+       if (num_read != 4)
+               goto leave;
+       pe_header_offset =  buffer[0]
+               | (buffer[1] <<  8)
+               | (buffer[2] << 16)
+               | (buffer[3] << 24);
+       
+       if (pe_header_offset + 24 > file_size)
+               goto leave;
+
+       new_offset = lseek (file, pe_header_offset, SEEK_SET);
+
+       if (new_offset != pe_header_offset)
+               goto leave;
+
+       num_read = read (file, buffer, 4);
+
+       if ((num_read != 4) || (buffer[0] != 'P') || (buffer[1] != 'E') || (buffer[2] != 0) || (buffer[3] != 0))
+               goto leave;
+
+       /*
+        * Verify that the header we want in the optional header data
+        * is present in this binary.
+        */
+       new_offset = lseek (file, pe_header_offset + 20, SEEK_SET);
+
+       if (new_offset != pe_header_offset + 20)
+               goto leave;
+
+       num_read = read (file, buffer, 2);
+
+       if ((num_read != 2) || ((buffer[0] | (buffer[1] << 8)) < 216))
+               goto leave;
+
+       optional_header_offset = pe_header_offset + 24;
+
+       /* Read the PE magic number */
+       new_offset = lseek (file, optional_header_offset, SEEK_SET);
+       
+       if (new_offset != optional_header_offset)
+               goto leave;
+
+       num_read = read (file, buffer, 2);
+
+       if (num_read != 2)
+               goto leave;
+
+       magic_number = (buffer[0] | (buffer[1] << 8));
+       
+       if (magic_number == 0x10B)  // PE32
+               clr_header_offset = 208;
+       else if (magic_number == 0x20B)  // PE32+
+               clr_header_offset = 224;
+       else
+               goto leave;
+
+       /* Read the CLR header address and size fields. These will be
+        * zero if the binary is not managed.
+        */
+       new_offset = lseek (file, optional_header_offset + clr_header_offset, SEEK_SET);
+
+       if (new_offset != optional_header_offset + clr_header_offset)
+               goto leave;
+
+       num_read = read (file, buffer, 8);
+       
+       /* We are not concerned with endianness, only with
+        * whether it is zero or not.
+        */
+       first_word = *(guint32 *)&buffer[0];
+       second_word = *(guint32 *)&buffer[4];
+       
+       if ((num_read != 8) || (first_word == 0) || (second_word == 0))
+               goto leave;
+       
+       managed = TRUE;
+
+leave:
+       close (file);
+       errno = original_errno;
+       return managed;
+}
+
+static gboolean
+process_create (const gunichar2 *appname, const gunichar2 *cmdline, gpointer new_environ,
+       const gunichar2 *cwd, StartupHandles *startup_handles, MonoW32ProcessInfo *process_info)
+{
+#if defined (HAVE_FORK) && defined (HAVE_EXECVE)
+       char *cmd = NULL, *prog = NULL, *full_prog = NULL, *args = NULL, *args_after_prog = NULL;
+       char *dir = NULL, **env_strings = NULL, **argv = NULL;
+       guint32 i, env_count = 0;
+       gboolean ret = FALSE;
+       gpointer handle = NULL;
+       GError *gerr = NULL;
+       int in_fd, out_fd, err_fd;
+       pid_t pid = 0;
+       int startup_pipe [2] = {-1, -1};
+       int dummy;
+       MonoProcess *mono_process;
+
+#if HAVE_SIGACTION
+       mono_lazy_initialize (&process_sig_chld_once, process_add_sigchld_handler);
+#endif
+
+       /* appname and cmdline specify the executable and its args:
+        *
+        * If appname is not NULL, it is the name of the executable.
+        * Otherwise the executable is the first token in cmdline.
+        *
+        * Executable searching:
+        *
+        * If appname is not NULL, it can specify the full path and
+        * file name, or else a partial name and the current directory
+        * will be used.  There is no additional searching.
+        *
+        * If appname is NULL, the first whitespace-delimited token in
+        * cmdline is used.  If the name does not contain a full
+        * directory path, the search sequence is:
+        *
+        * 1) The directory containing the current process
+        * 2) The current working directory
+        * 3) The windows system directory  (Ignored)
+        * 4) The windows directory (Ignored)
+        * 5) $PATH
+        *
+        * Just to make things more interesting, tokens can contain
+        * white space if they are surrounded by quotation marks.  I'm
+        * beginning to understand just why windows apps are generally
+        * so crap, with an API like this :-(
+        */
+       if (appname != NULL) {
+               cmd = mono_unicode_to_external (appname);
+               if (cmd == NULL) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unicode conversion returned NULL",
+                                  __func__);
+
+                       SetLastError (ERROR_PATH_NOT_FOUND);
+                       goto free_strings;
+               }
+
+               switch_dir_separators(cmd);
+       }
+
+       if (cmdline != NULL) {
+               args = mono_unicode_to_external (cmdline);
+               if (args == NULL) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unicode conversion returned NULL", __func__);
+
+                       SetLastError (ERROR_PATH_NOT_FOUND);
+                       goto free_strings;
+               }
+       }
+
+       if (cwd != NULL) {
+               dir = mono_unicode_to_external (cwd);
+               if (dir == NULL) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unicode conversion returned NULL", __func__);
+
+                       SetLastError (ERROR_PATH_NOT_FOUND);
+                       goto free_strings;
+               }
+
+               /* Turn all the slashes round the right way */
+               switch_dir_separators(dir);
+       }
+
+
+       /* We can't put off locating the executable any longer :-( */
+       if (cmd != NULL) {
+               char *unquoted;
+               if (g_ascii_isalpha (cmd[0]) && (cmd[1] == ':')) {
+                       /* Strip off the drive letter.  I can't
+                        * believe that CP/M holdover is still
+                        * visible...
+                        */
+                       g_memmove (cmd, cmd+2, strlen (cmd)-2);
+                       cmd[strlen (cmd)-2] = '\0';
+               }
+
+               unquoted = g_shell_unquote (cmd, NULL);
+               if (unquoted[0] == '/') {
+                       /* Assume full path given */
+                       prog = g_strdup (unquoted);
+
+                       /* Executable existing ? */
+                       if (!is_readable_or_executable (prog)) {
+                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find executable %s",
+                                          __func__, prog);
+                               g_free (unquoted);
+                               SetLastError (ERROR_FILE_NOT_FOUND);
+                               goto free_strings;
+                       }
+               } else {
+                       /* Search for file named by cmd in the current
+                        * directory
+                        */
+                       char *curdir = g_get_current_dir ();
+
+                       prog = g_strdup_printf ("%s/%s", curdir, unquoted);
+                       g_free (curdir);
+
+                       /* And make sure it's readable */
+                       if (!is_readable_or_executable (prog)) {
+                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find executable %s",
+                                          __func__, prog);
+                               g_free (unquoted);
+                               SetLastError (ERROR_FILE_NOT_FOUND);
+                               goto free_strings;
+                       }
+               }
+               g_free (unquoted);
+
+               args_after_prog = args;
+       } else {
+               char *token = NULL;
+               char quote;
+
+               /* Dig out the first token from args, taking quotation
+                * marks into account
+                */
+
+               /* First, strip off all leading whitespace */
+               args = g_strchug (args);
+
+               /* args_after_prog points to the contents of args
+                * after token has been set (otherwise argv[0] is
+                * duplicated)
+                */
+               args_after_prog = args;
+
+               /* Assume the opening quote will always be the first
+                * character
+                */
+               if (args[0] == '\"' || args [0] == '\'') {
+                       quote = args [0];
+                       for (i = 1; args[i] != '\0' && args[i] != quote; i++);
+                       if (args [i + 1] == '\0' || g_ascii_isspace (args[i+1])) {
+                               /* We found the first token */
+                               token = g_strndup (args+1, i-1);
+                               args_after_prog = g_strchug (args + i + 1);
+                       } else {
+                               /* Quotation mark appeared in the
+                                * middle of the token.  Just give the
+                                * whole first token, quotes and all,
+                                * to exec.
+                                */
+                       }
+               }
+
+               if (token == NULL) {
+                       /* No quote mark, or malformed */
+                       for (i = 0; args[i] != '\0'; i++) {
+                               if (g_ascii_isspace (args[i])) {
+                                       token = g_strndup (args, i);
+                                       args_after_prog = args + i + 1;
+                                       break;
+                               }
+                       }
+               }
+
+               if (token == NULL && args[0] != '\0') {
+                       /* Must be just one token in the string */
+                       token = g_strdup (args);
+                       args_after_prog = NULL;
+               }
+
+               if (token == NULL) {
+                       /* Give up */
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find what to exec", __func__);
+
+                       SetLastError (ERROR_PATH_NOT_FOUND);
+                       goto free_strings;
+               }
+
+               /* Turn all the slashes round the right way. Only for
+                * the prg. name
+                */
+               switch_dir_separators(token);
+
+               if (g_ascii_isalpha (token[0]) && (token[1] == ':')) {
+                       /* Strip off the drive letter.  I can't
+                        * believe that CP/M holdover is still
+                        * visible...
+                        */
+                       g_memmove (token, token+2, strlen (token)-2);
+                       token[strlen (token)-2] = '\0';
+               }
+
+               if (token[0] == '/') {
+                       /* Assume full path given */
+                       prog = g_strdup (token);
+
+                       /* Executable existing ? */
+                       if (!is_readable_or_executable (prog)) {
+                               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find executable %s",
+                                          __func__, token);
+                               g_free (token);
+                               SetLastError (ERROR_FILE_NOT_FOUND);
+                               goto free_strings;
+                       }
+               } else {
+                       char *curdir = g_get_current_dir ();
+
+                       /* FIXME: Need to record the directory
+                        * containing the current process, and check
+                        * that for the new executable as the first
+                        * place to look
+                        */
+
+                       prog = g_strdup_printf ("%s/%s", curdir, token);
+                       g_free (curdir);
+
+                       /* I assume X_OK is the criterion to use,
+                        * rather than F_OK
+                        *
+                        * X_OK is too strict *if* the target is a CLR binary
+                        */
+                       if (!is_readable_or_executable (prog)) {
+                               g_free (prog);
+                               prog = g_find_program_in_path (token);
+                               if (prog == NULL) {
+                                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Couldn't find executable %s", __func__, token);
+
+                                       g_free (token);
+                                       SetLastError (ERROR_FILE_NOT_FOUND);
+                                       goto free_strings;
+                               }
+                       }
+               }
+
+               g_free (token);
+       }
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Exec prog [%s] args [%s]",
+               __func__, prog, args_after_prog);
+
+       /* Check for CLR binaries; if found, we will try to invoke
+        * them using the same mono binary that started us.
+        */
+       if (is_managed_binary (prog)) {
+               gunichar2 *newapp, *newcmd;
+               gsize bytes_ignored;
+
+               newapp = mono_unicode_from_external (cli_launcher ? cli_launcher : "mono", &bytes_ignored);
+               if (newapp) {
+                       if (appname)
+                               newcmd = utf16_concat (utf16_quote, newapp, utf16_quote, utf16_space, appname, utf16_space, cmdline, NULL);
+                       else
+                               newcmd = utf16_concat (utf16_quote, newapp, utf16_quote, utf16_space, cmdline, NULL);
+
+                       g_free (newapp);
+
+                       if (newcmd) {
+                               ret = process_create (NULL, newcmd, new_environ, cwd, startup_handles, process_info);
+
+                               g_free (newcmd);
+
+                               goto free_strings;
+                       }
+               }
+       } else {
+               if (!is_executable (prog)) {
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Executable permisson not set on %s", __func__, prog);
+                       SetLastError (ERROR_ACCESS_DENIED);
+                       goto free_strings;
+               }
+       }
+
+       if (args_after_prog != NULL && *args_after_prog) {
+               char *qprog;
+
+               qprog = g_shell_quote (prog);
+               full_prog = g_strconcat (qprog, " ", args_after_prog, NULL);
+               g_free (qprog);
+       } else {
+               full_prog = g_shell_quote (prog);
+       }
+
+       ret = g_shell_parse_argv (full_prog, NULL, &argv, &gerr);
+       if (ret == FALSE) {
+               g_message ("process_create: %s\n", gerr->message);
+               g_error_free (gerr);
+               gerr = NULL;
+               goto free_strings;
+       }
+
+       if (startup_handles) {
+               in_fd = GPOINTER_TO_UINT (startup_handles->input);
+               out_fd = GPOINTER_TO_UINT (startup_handles->output);
+               err_fd = GPOINTER_TO_UINT (startup_handles->error);
+       } else {
+               in_fd = GPOINTER_TO_UINT (GetStdHandle (STD_INPUT_HANDLE));
+               out_fd = GPOINTER_TO_UINT (GetStdHandle (STD_OUTPUT_HANDLE));
+               err_fd = GPOINTER_TO_UINT (GetStdHandle (STD_ERROR_HANDLE));
+       }
+
+       /* new_environ is a block of NULL-terminated strings, which
+        * is itself NULL-terminated. Of course, passing an array of
+        * string pointers would have made things too easy :-(
+        *
+        * If new_environ is not NULL it specifies the entire set of
+        * environment variables in the new process.  Otherwise the
+        * new process inherits the same environment.
+        */
+       if (new_environ) {
+               gunichar2 *new_environp;
+
+               /* Count the number of strings */
+               for (new_environp = (gunichar2 *)new_environ; *new_environp; new_environp++) {
+                       env_count++;
+                       while (*new_environp)
+                               new_environp++;
+               }
+
+               /* +2: one for the process handle value, and the last
+                * one is NULL
+                */
+               env_strings = g_new0 (char *, env_count + 2);
+
+               /* Copy each environ string into 'strings' turning it
+                * into utf8 (or the requested encoding) at the same
+                * time
+                */
+               env_count = 0;
+               for (new_environp = (gunichar2 *)new_environ; *new_environp; new_environp++) {
+                       env_strings[env_count] = mono_unicode_to_external (new_environp);
+                       env_count++;
+                       while (*new_environp) {
+                               new_environp++;
+                       }
+               }
+       } else {
+               for (i = 0; environ[i] != NULL; i++)
+                       env_count++;
+
+               /* +2: one for the process handle value, and the last
+                * one is NULL
+                */
+               env_strings = g_new0 (char *, env_count + 2);
+
+               /* Copy each environ string into 'strings' turning it
+                * into utf8 (or the requested encoding) at the same
+                * time
+                */
+               env_count = 0;
+               for (i = 0; environ[i] != NULL; i++) {
+                       env_strings[env_count] = g_strdup (environ[i]);
+                       env_count++;
+               }
+       }
+
+       /* Create a pipe to make sure the child doesn't exit before
+        * we can add the process to the linked list of processes */
+       if (pipe (startup_pipe) == -1) {
+               /* Could not create the pipe to synchroniz process startup. We'll just not synchronize.
+                * This is just for a very hard to hit race condition in the first place */
+               startup_pipe [0] = startup_pipe [1] = -1;
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: new process startup not synchronized. We may not notice if the newly created process exits immediately.", __func__);
+       }
+
+#if HAVE_SIGACTION
+       /* FIXME: block SIGCHLD */
+#endif
+
+       switch (pid = fork ()) {
+       case -1: /* Error */ {
+               SetLastError (ERROR_OUTOFMEMORY);
+               ret = FALSE;
+               break;
+       }
+       case 0: /* Child */ {
+               if (startup_pipe [0] != -1) {
+                       /* Wait until the parent has updated it's internal data */
+                       ssize_t _i G_GNUC_UNUSED = read (startup_pipe [0], &dummy, 1);
+                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: child: parent has completed its setup", __func__);
+                       close (startup_pipe [0]);
+                       close (startup_pipe [1]);
+               }
+
+               /* should we detach from the process group? */
+
+               /* Connect stdin, stdout and stderr */
+               dup2 (in_fd, 0);
+               dup2 (out_fd, 1);
+               dup2 (err_fd, 2);
+
+               /* Close all file descriptors */
+               for (i = mono_w32handle_fd_reserve - 1; i > 2; i--)
+                       close (i);
+
+#ifdef DEBUG_ENABLED
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: exec()ing [%s] in dir [%s]", __func__, cmd,
+                          dir == NULL?".":dir);
+               for (i = 0; argv[i] != NULL; i++)
+                       g_message ("arg %d: [%s]", i, argv[i]);
+
+               for (i = 0; env_strings[i] != NULL; i++)
+                       g_message ("env %d: [%s]", i, env_strings[i]);
+#endif
+
+               /* set cwd */
+               if (dir != NULL && chdir (dir) == -1) {
+                       /* set error */
+                       _exit (-1);
+               }
+
+               /* exec */
+               execve (argv[0], argv, env_strings);
+
+               /* set error */
+               _exit (-1);
+
+               break;
+       }
+       default: /* Parent */ {
+               MonoW32HandleProcess process_handle;
+
+               memset (&process_handle, 0, sizeof (process_handle));
+               process_handle.id = pid;
+               process_handle.child = TRUE;
+               process_handle.proc_name = g_strdup (prog);
+               process_set_defaults (&process_handle);
+
+               /* Add our mono_process into the linked list of processes */
+               mono_process = (MonoProcess *) g_malloc0 (sizeof (MonoProcess));
+               mono_process->pid = pid;
+               mono_process->handle_count = 1;
+               mono_os_sem_init (&mono_process->exit_sem, 0);
+
+               process_handle.mono_process = mono_process;
+
+               handle = mono_w32handle_new (MONO_W32HANDLE_PROCESS, &process_handle);
+               if (handle == INVALID_HANDLE_VALUE) {
+                       g_warning ("%s: error creating process handle", __func__);
+
+                       mono_os_sem_destroy (&mono_process->exit_sem);
+                       g_free (mono_process);
+
+                       SetLastError (ERROR_OUTOFMEMORY);
+                       ret = FALSE;
+                       break;
+               }
+
+               /* Keep the process handle artificially alive until the process
+                * exits so that the information in the handle isn't lost. */
+               mono_w32handle_ref (handle);
+               mono_process->handle = handle;
+
+               mono_os_mutex_lock (&processes_mutex);
+               mono_process->next = processes;
+               processes = mono_process;
+               mono_os_mutex_unlock (&processes_mutex);
+
+               if (process_info != NULL) {
+                       process_info->process_handle = handle;
+                       process_info->pid = pid;
+
+                       /* FIXME: we might need to handle the thread info some day */
+                       process_info->thread_handle = INVALID_HANDLE_VALUE;
+                       process_info->tid = 0;
+               }
+
+               break;
+       }
+       }
+
+#if HAVE_SIGACTION
+       /* FIXME: unblock SIGCHLD */
+#endif
+
+       if (startup_pipe [1] != -1) {
+               /* Write 1 byte, doesn't matter what */
+               ssize_t _i G_GNUC_UNUSED = write (startup_pipe [1], startup_pipe, 1);
+               close (startup_pipe [0]);
+               close (startup_pipe [1]);
+       }
+
+free_strings:
+       if (cmd)
+               g_free (cmd);
+       if (full_prog)
+               g_free (full_prog);
+       if (prog)
+               g_free (prog);
+       if (args)
+               g_free (args);
+       if (dir)
+               g_free (dir);
+       if (env_strings)
+               g_strfreev (env_strings);
+       if (argv)
+               g_strfreev (argv);
+
+       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning handle %p for pid %d", __func__, handle, pid);
+
+       /* Check if something needs to be cleaned up. */
+       processes_cleanup ();
+
+       return ret;
+#else
+       SetLastError (ERROR_NOT_SUPPORTED);
+       return FALSE;
+#endif // defined (HAVE_FORK) && defined (HAVE_EXECVE)
+}
+
+MonoBoolean
+ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoW32ProcessStartInfo *proc_start_info, MonoW32ProcessInfo *process_info)
+{
+       const gunichar2 *lpFile;
+       const gunichar2 *lpParameters;
+       const gunichar2 *lpDirectory;
+       gunichar2 *args;
+       gboolean ret;
+
+       if (!proc_start_info->filename) {
+               /* w2k returns TRUE for this, for some reason. */
+               ret = TRUE;
+               goto done;
+       }
+
+       lpFile = proc_start_info->filename ? mono_string_chars (proc_start_info->filename) : NULL;
+       lpParameters = proc_start_info->arguments ? mono_string_chars (proc_start_info->arguments) : NULL;
+       lpDirectory = proc_start_info->working_directory && mono_string_length (proc_start_info->working_directory) != 0 ?
+               mono_string_chars (proc_start_info->working_directory) : NULL;
+
+       /* Put both executable and parameters into the second argument
+        * to process_create (), so it searches $PATH.  The conversion
+        * into and back out of utf8 is because there is no
+        * g_strdup_printf () equivalent for gunichar2 :-(
+        */
+       args = utf16_concat (utf16_quote, lpFile, utf16_quote, lpParameters == NULL ? NULL : utf16_space, lpParameters, NULL);
+       if (args == NULL) {
+               SetLastError (ERROR_INVALID_DATA);
+               ret = FALSE;
+               goto done;
+       }
+       ret = process_create (NULL, args, NULL, lpDirectory, NULL, process_info);
+       g_free (args);
+
+       if (!ret && GetLastError () == ERROR_OUTOFMEMORY)
+               goto done;
+
+       if (!ret) {
+               static char *handler;
+               static gunichar2 *handler_utf16;
+
+               if (handler_utf16 == (gunichar2 *)-1) {
+                       ret = FALSE;
+                       goto done;
+               }
+
+#ifdef PLATFORM_MACOSX
+               handler = g_strdup ("/usr/bin/open");
+#else
+               /*
+                * On Linux, try: xdg-open, the FreeDesktop standard way of doing it,
+                * if that fails, try to use gnome-open, then kfmclient
+                */
+               handler = g_find_program_in_path ("xdg-open");
+               if (handler == NULL){
+                       handler = g_find_program_in_path ("gnome-open");
+                       if (handler == NULL){
+                               handler = g_find_program_in_path ("kfmclient");
+                               if (handler == NULL){
+                                       handler_utf16 = (gunichar2 *) -1;
+                                       ret = FALSE;
+                                       goto done;
+                               } else {
+                                       /* kfmclient needs exec argument */
+                                       char *old = handler;
+                                       handler = g_strconcat (old, " exec",
+                                                              NULL);
+                                       g_free (old);
+                               }
+                       }
+               }
+#endif
+               handler_utf16 = g_utf8_to_utf16 (handler, -1, NULL, NULL, NULL);
+               g_free (handler);
+
+               /* Put quotes around the filename, in case it's a url
+                * that contains #'s (process_create() calls
+                * g_shell_parse_argv(), which deliberately throws
+                * away anything after an unquoted #).  Fixes bug
+                * 371567.
+                */
+               args = utf16_concat (handler_utf16, utf16_space, utf16_quote, lpFile, utf16_quote,
+                       lpParameters == NULL ? NULL : utf16_space, lpParameters, NULL);
+               if (args == NULL) {
+                       SetLastError (ERROR_INVALID_DATA);
+                       ret = FALSE;
+                       goto done;
+               }
+               ret = process_create (NULL, args, NULL, lpDirectory, NULL, process_info);
+               g_free (args);
+               if (!ret) {
+                       if (GetLastError () != ERROR_OUTOFMEMORY)
+                               SetLastError (ERROR_INVALID_DATA);
+                       ret = FALSE;
+                       goto done;
+               }
+               /* Shell exec should not return a process handle when it spawned a GUI thing, like a browser. */
+               CloseHandle (process_info->process_handle);
+               process_info->process_handle = NULL;
+       }
+
+done:
+       if (ret == FALSE) {
+               process_info->pid = -GetLastError ();
+       } else {
+               process_info->thread_handle = NULL;
+#if !defined(MONO_CROSS_COMPILE)
+               process_info->pid = mono_w32process_get_pid (process_info->process_handle);
+#else
+               process_info->pid = 0;
+#endif
+               process_info->tid = 0;
+       }
+
+       return ret;
+}
+
+/* Only used when UseShellExecute is false */
+static gboolean
+process_get_complete_path (const gunichar2 *appname, gchar **completed)
+{
+       gchar *utf8app;
+       gchar *found;
+
+       utf8app = g_utf16_to_utf8 (appname, -1, NULL, NULL, NULL);
+
+       if (g_path_is_absolute (utf8app)) {
+               *completed = g_shell_quote (utf8app);
+               g_free (utf8app);
+               return TRUE;
+       }
+
+       if (g_file_test (utf8app, G_FILE_TEST_IS_EXECUTABLE) && !g_file_test (utf8app, G_FILE_TEST_IS_DIR)) {
+               *completed = g_shell_quote (utf8app);
+               g_free (utf8app);
+               return TRUE;
+       }
+       
+       found = g_find_program_in_path (utf8app);
+       if (found == NULL) {
+               *completed = NULL;
+               g_free (utf8app);
+               return FALSE;
+       }
+
+       *completed = g_shell_quote (found);
+       g_free (found);
+       g_free (utf8app);
+       return TRUE;
+}
+
+static gboolean
+process_get_shell_arguments (MonoW32ProcessStartInfo *proc_start_info, gunichar2 **shell_path, MonoString **cmd)
+{
+       gchar *spath = NULL;
+
+       *shell_path = NULL;
+       *cmd = proc_start_info->arguments;
+
+       process_get_complete_path (mono_string_chars (proc_start_info->filename), &spath);
+       if (spath != NULL) {
+               *shell_path = g_utf8_to_utf16 (spath, -1, NULL, NULL, NULL);
+               g_free (spath);
+       }
+
+       return (*shell_path != NULL) ? TRUE : FALSE;
+}
+
+MonoBoolean
+ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoW32ProcessStartInfo *proc_start_info,
+       HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle, MonoW32ProcessInfo *process_info)
+{
+       gboolean ret;
+       gunichar2 *dir;
+       StartupHandles startup_handles;
+       gunichar2 *shell_path = NULL;
+       gchar *env_vars = NULL;
+       MonoString *cmd = NULL;
+
+       memset (&startup_handles, 0, sizeof (startup_handles));
+       startup_handles.input = stdin_handle;
+       startup_handles.output = stdout_handle;
+       startup_handles.error = stderr_handle;
+
+       if (process_get_shell_arguments (proc_start_info, &shell_path, &cmd) == FALSE) {
+               process_info->pid = -ERROR_FILE_NOT_FOUND;
+               return FALSE;
+       }
+
+       if (process_info->env_keys) {
+               gint i, len; 
+               MonoString *ms;
+               MonoString *key, *value;
+               gunichar2 *str, *ptr;
+               gunichar2 *equals16;
+
+               for (len = 0, i = 0; i < mono_array_length (process_info->env_keys); i++) {
+                       ms = mono_array_get (process_info->env_values, MonoString *, i);
+                       if (ms == NULL)
+                               continue;
+
+                       len += mono_string_length (ms) * sizeof (gunichar2);
+                       ms = mono_array_get (process_info->env_keys, MonoString *, i);
+                       len += mono_string_length (ms) * sizeof (gunichar2);
+                       len += 2 * sizeof (gunichar2);
+               }
+
+               equals16 = g_utf8_to_utf16 ("=", 1, NULL, NULL, NULL);
+               ptr = str = g_new0 (gunichar2, len + 1);
+               for (i = 0; i < mono_array_length (process_info->env_keys); i++) {
+                       value = mono_array_get (process_info->env_values, MonoString *, i);
+                       if (value == NULL)
+                               continue;
+
+                       key = mono_array_get (process_info->env_keys, MonoString *, i);
+                       memcpy (ptr, mono_string_chars (key), mono_string_length (key) * sizeof (gunichar2));
+                       ptr += mono_string_length (key);
+
+                       memcpy (ptr, equals16, sizeof (gunichar2));
+                       ptr++;
+
+                       memcpy (ptr, mono_string_chars (value), mono_string_length (value) * sizeof (gunichar2));
+                       ptr += mono_string_length (value);
+                       ptr++;
+               }
+
+               g_free (equals16);
+               env_vars = (gchar *) str;
+       }
+       
+       /* The default dir name is "".  Turn that into NULL to mean "current directory" */
+       dir = proc_start_info->working_directory && mono_string_length (proc_start_info->working_directory) > 0 ?
+                       mono_string_chars (proc_start_info->working_directory) : NULL;
+
+       ret = process_create (shell_path, cmd ? mono_string_chars (cmd): NULL, env_vars, dir, &startup_handles, process_info);
+
+       g_free (env_vars);
+       if (shell_path != NULL)
+               g_free (shell_path);
+
+       if (!ret)
+               process_info->pid = -GetLastError ();
+
+       return ret;
+}
+
+/* Returns an array of pids */
+MonoArray *
+ves_icall_System_Diagnostics_Process_GetProcesses_internal (void)
+{
+       MonoError error;
+       MonoArray *procs;
+       gpointer *pidarray;
+       int i, count;
+
+       pidarray = mono_process_list (&count);
+       if (!pidarray) {
+               mono_set_pending_exception (mono_get_exception_not_supported ("This system does not support EnumProcesses"));
+               return NULL;
+       }
+       procs = mono_array_new_checked (mono_domain_get (), mono_get_int32_class (), count, &error);
+       if (mono_error_set_pending_exception (&error)) {
+               g_free (pidarray);
+               return NULL;
+       }
+       if (sizeof (guint32) == sizeof (gpointer)) {
+               memcpy (mono_array_addr (procs, guint32, 0), pidarray, count * sizeof (gint32));
+       } else {
+               for (i = 0; i < count; ++i)
+                       *(mono_array_addr (procs, guint32, i)) = GPOINTER_TO_UINT (pidarray [i]);
+       }
+       g_free (pidarray);
+
+       return procs;
+}
+
+void
+mono_w32process_set_cli_launcher (gchar *path)
+{
+       g_free (cli_launcher);
+       cli_launcher = g_strdup (path);
+}
+
+gpointer
+ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess (void)
+{
+       mono_w32handle_ref (current_process);
+       return current_process;
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gint32 *exitcode)
+{
+       MonoW32HandleProcess *process_handle;
+       gboolean res;
+
+       if (!exitcode)
+               return FALSE;
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
+               return FALSE;
+       }
+
+       if (process_handle->id == wapi_getpid ()) {
+               *exitcode = STILL_ACTIVE;
+               return TRUE;
+       }
+
+       /* A process handle is only signalled if the process has exited
+        * and has been waited for. Make sure any process exit has been
+        * noticed before checking if the process is signalled.
+        * Fixes bug 325463. */
+       mono_w32handle_wait_one (handle, 0, TRUE);
+
+       *exitcode = mono_w32handle_issignalled (handle) ? process_handle->exitstatus : STILL_ACTIVE;
+       return TRUE;
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_CloseProcess (gpointer handle)
+{
+       return CloseHandle (handle);
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint32 exitcode)
+{
+#ifdef HAVE_KILL
+       MonoW32HandleProcess *process_handle;
+       int ret;
+       pid_t pid;
+       gboolean res;
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
+               SetLastError (ERROR_INVALID_HANDLE);
+               return FALSE;
+       }
+
+       pid = process_handle->id;
+
+       ret = kill (pid, exitcode == -1 ? SIGKILL : SIGTERM);
+       if (ret == 0)
+               return TRUE;
+
+       switch (errno) {
+       case EINVAL: SetLastError (ERROR_INVALID_PARAMETER); break;
+       case EPERM:  SetLastError (ERROR_ACCESS_DENIED);     break;
+       case ESRCH:  SetLastError (ERROR_PROC_NOT_FOUND);    break;
+       default:     SetLastError (ERROR_GEN_FAILURE);       break;
+       }
+
+       return FALSE;
+#else
+       g_error ("kill() is not supported by this platform");
+#endif
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize (gpointer handle, gsize *min, gsize *max)
+{
+       MonoW32HandleProcess *process_handle;
+       gboolean res;
+
+       if (!min || !max)
+               return FALSE;
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
+               return FALSE;
+       }
+
+       if (!process_handle->child)
+               return FALSE;
+
+       *min = process_handle->min_working_set;
+       *max = process_handle->max_working_set;
+       return TRUE;
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handle, gsize min, gsize max)
+{
+       MonoW32HandleProcess *process_handle;
+       gboolean res;
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
+               return FALSE;
+       }
+
+       if (!process_handle->child)
+               return FALSE;
+
+       process_handle->min_working_set = min;
+       process_handle->max_working_set = max;
+       return TRUE;
+}
+
+gint32
+ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass (gpointer handle)
+{
+#ifdef HAVE_GETPRIORITY
+       MonoW32HandleProcess *process_handle;
+       gint ret;
+       pid_t pid;
+       gboolean res;
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               SetLastError (ERROR_INVALID_HANDLE);
+               return 0;
+       }
+
+       pid = process_handle->id;
+
+       errno = 0;
+       ret = getpriority (PRIO_PROCESS, pid);
+       if (ret == -1 && errno != 0) {
+               switch (errno) {
+               case EPERM:
+               case EACCES:
+                       SetLastError (ERROR_ACCESS_DENIED);
+                       break;
+               case ESRCH:
+                       SetLastError (ERROR_PROC_NOT_FOUND);
+                       break;
+               default:
+                       SetLastError (ERROR_GEN_FAILURE);
+               }
+               return 0;
+       }
+
+       if (ret == 0)
+               return MONO_W32PROCESS_PRIORITY_CLASS_NORMAL;
+       else if (ret < -15)
+               return MONO_W32PROCESS_PRIORITY_CLASS_REALTIME;
+       else if (ret < -10)
+               return MONO_W32PROCESS_PRIORITY_CLASS_HIGH;
+       else if (ret < 0)
+               return MONO_W32PROCESS_PRIORITY_CLASS_ABOVE_NORMAL;
+       else if (ret > 10)
+               return MONO_W32PROCESS_PRIORITY_CLASS_IDLE;
+       else if (ret > 0)
+               return MONO_W32PROCESS_PRIORITY_CLASS_BELOW_NORMAL;
+
+       return MONO_W32PROCESS_PRIORITY_CLASS_NORMAL;
+#else
+       SetLastError (ERROR_NOT_SUPPORTED);
+       return 0;
+#endif
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass (gpointer handle, gint32 priorityClass)
+{
+#ifdef HAVE_SETPRIORITY
+       MonoW32HandleProcess *process_handle;
+       int ret;
+       int prio;
+       pid_t pid;
+       gboolean res;
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               SetLastError (ERROR_INVALID_HANDLE);
+               return FALSE;
+       }
+
+       pid = process_handle->id;
+
+       switch (priorityClass) {
+       case MONO_W32PROCESS_PRIORITY_CLASS_IDLE:
+               prio = 19;
+               break;
+       case MONO_W32PROCESS_PRIORITY_CLASS_BELOW_NORMAL:
+               prio = 10;
+               break;
+       case MONO_W32PROCESS_PRIORITY_CLASS_NORMAL:
+               prio = 0;
+               break;
+       case MONO_W32PROCESS_PRIORITY_CLASS_ABOVE_NORMAL:
+               prio = -5;
+               break;
+       case MONO_W32PROCESS_PRIORITY_CLASS_HIGH:
+               prio = -11;
+               break;
+       case MONO_W32PROCESS_PRIORITY_CLASS_REALTIME:
+               prio = -20;
+               break;
+       default:
+               SetLastError (ERROR_INVALID_PARAMETER);
+               return FALSE;
+       }
+
+       ret = setpriority (PRIO_PROCESS, pid, prio);
+       if (ret == -1) {
+               switch (errno) {
+               case EPERM:
+               case EACCES:
+                       SetLastError (ERROR_ACCESS_DENIED);
+                       break;
+               case ESRCH:
+                       SetLastError (ERROR_PROC_NOT_FOUND);
+                       break;
+               default:
+                       SetLastError (ERROR_GEN_FAILURE);
+               }
+       }
+
+       return ret == 0;
+#else
+       SetLastError (ERROR_NOT_SUPPORTED);
+       return FALSE;
+#endif
+}
+
+static void
+ticks_to_processtime (guint64 ticks, ProcessTime *processtime)
+{
+       processtime->lowDateTime = ticks & 0xFFFFFFFF;
+       processtime->highDateTime = ticks >> 32;
+}
+
+static void
+wapifiletime_to_processtime (WapiFileTime wapi_filetime, ProcessTime *processtime)
+{
+       processtime->lowDateTime = wapi_filetime.dwLowDateTime;
+       processtime->highDateTime = wapi_filetime.dwHighDateTime;
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64 *creation_time, gint64 *exit_time, gint64 *kernel_time, gint64 *user_time)
+{
+       MonoW32HandleProcess *process_handle;
+       ProcessTime *creation_processtime, *exit_processtime, *kernel_processtime, *user_processtime;
+       gboolean res;
+
+       if (!creation_time || !exit_time || !kernel_time || !user_time) {
+               /* Not sure if w32 allows NULLs here or not */
+               return FALSE;
+       }
+
+       creation_processtime = (ProcessTime*) creation_time;
+       exit_processtime = (ProcessTime*) exit_time;
+       kernel_processtime = (ProcessTime*) kernel_time;
+       user_processtime = (ProcessTime*) user_time;
+
+       memset (creation_processtime, 0, sizeof (ProcessTime));
+       memset (exit_processtime, 0, sizeof (ProcessTime));
+       memset (kernel_processtime, 0, sizeof (ProcessTime));
+       memset (user_processtime, 0, sizeof (ProcessTime));
+
+       res = mono_w32handle_lookup (handle, MONO_W32HANDLE_PROCESS, (gpointer*) &process_handle);
+       if (!res) {
+               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't find process %p", __func__, handle);
+               return FALSE;
+       }
+
+       if (!process_handle->child) {
+               gint64 start_ticks, user_ticks, kernel_ticks;
+
+               mono_process_get_times (GINT_TO_POINTER (process_handle->id),
+                       &start_ticks, &user_ticks, &kernel_ticks);
+
+               ticks_to_processtime (start_ticks, creation_processtime);
+               ticks_to_processtime (user_ticks, kernel_processtime);
+               ticks_to_processtime (kernel_ticks, user_processtime);
+               return TRUE;
+       }
+
+       wapifiletime_to_processtime (process_handle->create_time, creation_processtime);
+
+       /* A process handle is only signalled if the process has
+        * exited, otherwise exit_processtime isn't set */
+       if (mono_w32handle_issignalled (handle))
+               wapifiletime_to_processtime (process_handle->exit_time, exit_processtime);
+
+#ifdef HAVE_GETRUSAGE
+       if (process_handle->id == getpid ()) {
+               struct rusage time_data;
+               if (getrusage (RUSAGE_SELF, &time_data) == 0) {
+                       ticks_to_processtime ((guint64)time_data.ru_utime.tv_sec * 10000000 + (guint64)time_data.ru_utime.tv_usec * 10, user_processtime);
+                       ticks_to_processtime ((guint64)time_data.ru_stime.tv_sec * 10000000 + (guint64)time_data.ru_stime.tv_usec * 10, kernel_processtime);
+               }
+       }
+#endif
+
+       return TRUE;
+}
diff --git a/mono/metadata/w32process-win32-internals.h b/mono/metadata/w32process-win32-internals.h
new file mode 100644 (file)
index 0000000..a5eb90a
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_PROCESS_INTERNALS_H__
+#define __MONO_METADATA_PROCESS_INTERNALS_H__
+
+#include <config.h>
+#include <glib.h>
+
+// On platforms not using classic WIN API support the  implementation of bellow methods are hosted in separate source file
+// process-windows-*.c. On platforms using classic WIN API the implementation is still keept in process.c and still declared
+// static and in some places even inlined.
+#if !G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+void
+mono_w32process_get_fileversion (MonoObject *filever, gunichar2 *filename, MonoError *error);
+
+void
+mono_process_init_startup_info (HANDLE stdin_handle, HANDLE stdout_handle,
+                               HANDLE stderr_handle,STARTUPINFO *startinfo);
+
+gboolean
+mono_process_create_process (MonoW32ProcessInfo *mono_process_info, gunichar2 *shell_path, MonoString *cmd,
+                            guint32 creation_flags, gchar *env_vars, gunichar2 *dir, STARTUPINFO *start_info,
+                            PROCESS_INFORMATION *process_info);
+
+MonoBoolean
+mono_icall_get_process_working_set_size (gpointer handle, gsize *min, gsize *max);
+
+MonoBoolean
+mono_icall_set_process_working_set_size (gpointer handle, gsize min, gsize max);
+
+gint32
+mono_icall_get_priority_class (gpointer handle);
+
+MonoBoolean
+mono_icall_set_priority_class (gpointer handle, gint32 priorityClass);
+
+gboolean
+mono_process_win_enum_processes (DWORD *pids, DWORD count, DWORD *needed);
+#endif  /* !G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+#endif /* __MONO_METADATA_PROCESS_INTERNALS_H__ */
diff --git a/mono/metadata/w32process-win32-uwp.c b/mono/metadata/w32process-win32-uwp.c
new file mode 100644 (file)
index 0000000..cbd46b7
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * process-windows-uwp.c: UWP process support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include <mono/metadata/object-internals.h>
+#include "mono/metadata/w32process.h"
+#include "mono/metadata/w32process-internals.h"
+#include "mono/metadata/w32process-win32-internals.h"
+
+gboolean
+mono_process_win_enum_processes (DWORD *pids, DWORD count, DWORD *needed)
+{
+       g_unsupported_api ("EnumProcesses");
+       *needed = 0;
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+HANDLE
+ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("OpenProcess");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "OpenProcess");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return NULL;
+}
+
+void
+mono_w32process_get_fileversion (MonoObject *filever, gunichar2 *filename, MonoError *error)
+{
+       g_unsupported_api ("GetFileVersionInfoSize, GetFileVersionInfo, VerQueryValue, VerLanguageName");
+
+       mono_error_init (error);
+       mono_error_set_not_supported (error, G_UNSUPPORTED_API, "GetFileVersionInfoSize, GetFileVersionInfo, VerQueryValue, VerLanguageName");
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+}
+
+MonoObject*
+process_add_module (HANDLE process, HMODULE mod, gunichar2 *filename, gunichar2 *modulename, MonoClass *proc_class, MonoError *error)
+{
+       g_unsupported_api ("GetModuleInformation");
+
+       mono_error_init (error);
+       mono_error_set_not_supported (error, G_UNSUPPORTED_API, "GetModuleInformation");
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return NULL;
+}
+
+MonoArray *
+ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this_obj, HANDLE process)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("EnumProcessModules, GetModuleBaseName, GetModuleFileNameEx");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "EnumProcessModules, GetModuleBaseName, GetModuleFileNameEx");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return NULL;
+}
+
+MonoBoolean
+ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoW32ProcessStartInfo *proc_start_info, MonoW32ProcessInfo *process_info)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("ShellExecuteEx");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "ShellExecuteEx");
+       mono_error_set_pending_exception (&mono_error);
+
+       process_info->pid = (guint32)(-ERROR_NOT_SUPPORTED);
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+MonoString *
+ves_icall_System_Diagnostics_Process_ProcessName_internal (HANDLE process)
+{
+       MonoError error;
+       MonoString *string;
+       gunichar2 name[MAX_PATH];
+       guint32 len;
+
+       len = GetModuleFileName (NULL, name, G_N_ELEMENTS (name));
+       if (len == 0)
+               return NULL;
+
+       string = mono_string_new_utf16_checked (mono_domain_get (), name, len, &error);
+       if (!mono_error_ok (&error))
+               mono_error_set_pending_exception (&error);
+
+       return string;
+}
+
+void
+mono_process_init_startup_info (HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle, STARTUPINFO *startinfo)
+{
+       startinfo->cb = sizeof(STARTUPINFO);
+       startinfo->dwFlags = 0;
+       startinfo->hStdInput = INVALID_HANDLE_VALUE;
+       startinfo->hStdOutput = INVALID_HANDLE_VALUE;
+       startinfo->hStdError = INVALID_HANDLE_VALUE;
+       return;
+}
+
+gboolean
+mono_process_create_process (MonoW32ProcessInfo *mono_process_info, gunichar2 *shell_path, MonoString *cmd, guint32 creation_flags,
+                            gchar *env_vars, gunichar2 *dir, STARTUPINFO *start_info, PROCESS_INFORMATION *process_info)
+{
+       MonoError       mono_error;
+       gchar           *api_name = "";
+
+       if (mono_process_info->username) {
+               api_name = "CreateProcessWithLogonW";
+       } else {
+               api_name = "CreateProcess";
+       }
+
+       memset (&process_info, 0, sizeof (PROCESS_INFORMATION));
+       g_unsupported_api (api_name);
+
+       mono_error_init (&mono_error);
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, api_name);
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+MonoBoolean
+mono_icall_get_process_working_set_size (gpointer handle, gsize *min, gsize *max)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetProcessWorkingSetSize");
+
+       mono_error_set_not_supported(&mono_error, G_UNSUPPORTED_API, "GetProcessWorkingSetSize");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+MonoBoolean
+mono_icall_set_process_working_set_size (gpointer handle, gsize min, gsize max)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("SetProcessWorkingSetSize");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "SetProcessWorkingSetSize");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+gint32
+mono_icall_get_priority_class (gpointer handle)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("GetPriorityClass");
+
+       mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "GetPriorityClass");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+MonoBoolean
+mono_icall_set_priority_class (gpointer handle, gint32 priorityClass)
+{
+       MonoError mono_error;
+       mono_error_init (&mono_error);
+
+       g_unsupported_api ("SetPriorityClass");
+
+       mono_error_set_not_supported(&mono_error, G_UNSUPPORTED_API, "SetPriorityClass");
+       mono_error_set_pending_exception (&mono_error);
+
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return FALSE;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (process_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/metadata/w32process-win32.c b/mono/metadata/w32process-win32.c
new file mode 100644 (file)
index 0000000..15cfd4d
--- /dev/null
@@ -0,0 +1,500 @@
+/*
+ * process.c: System.Diagnostics.Process support
+ *
+ * Author:
+ *     Dick Porter (dick@ximian.com)
+ *
+ * Copyright 2002 Ximian, Inc.
+ * Copyright 2002-2006 Novell, Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include <config.h>
+
+#include <glib.h>
+#include <string.h>
+
+#include <winsock2.h>
+#include <windows.h>
+
+#include <mono/metadata/object-internals.h>
+#include <mono/metadata/w32process.h>
+#include <mono/metadata/w32process-win32-internals.h>
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/image.h>
+#include <mono/metadata/cil-coff.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/threadpool-ms-io.h>
+#include <mono/utils/strenc.h>
+#include <mono/utils/mono-proclib.h>
+#include <mono/io-layer/io-layer.h>
+/* FIXME: fix this code to not depend so much on the internals */
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/w32handle.h>
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+#include <shellapi.h>
+#endif
+
+void
+mono_w32process_init (void)
+{
+}
+
+void
+mono_w32process_cleanup (void)
+{
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+HANDLE
+ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
+{
+       HANDLE handle;
+       
+       /* GetCurrentProcess returns a pseudo-handle, so use
+        * OpenProcess instead
+        */
+       handle = OpenProcess (PROCESS_ALL_ACCESS, TRUE, pid);
+       if (handle == NULL)
+               /* FIXME: Throw an exception */
+               return NULL;
+       return handle;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */
+
+static gchar*
+mono_process_unquote_application_name (gchar *appname)
+{
+       size_t len = strlen (appname);
+       if (len) {
+               if (appname[len-1] == '\"')
+                       appname[len-1] = '\0';
+               if (appname[0] == '\"')
+                       appname++;
+       }
+
+       return appname;
+}
+
+static gchar*
+mono_process_quote_path (const gchar *path)
+{
+       gchar *res = g_shell_quote (path);
+       gchar *q = res;
+       while (*q) {
+               if (*q == '\'')
+                       *q = '\"';
+               q++;
+       }
+       return res;
+}
+
+/* Only used when UseShellExecute is false */
+static gboolean
+mono_process_complete_path (const gunichar2 *appname, gchar **completed)
+{
+       gchar *utf8app, *utf8appmemory;
+       gchar *found;
+
+       utf8appmemory = g_utf16_to_utf8 (appname, -1, NULL, NULL, NULL);
+       utf8app = mono_process_unquote_application_name (utf8appmemory);
+
+       if (g_path_is_absolute (utf8app)) {
+               *completed = mono_process_quote_path (utf8app);
+               g_free (utf8appmemory);
+               return TRUE;
+       }
+
+       if (g_file_test (utf8app, G_FILE_TEST_IS_EXECUTABLE) && !g_file_test (utf8app, G_FILE_TEST_IS_DIR)) {
+               *completed = mono_process_quote_path (utf8app);
+               g_free (utf8appmemory);
+               return TRUE;
+       }
+       
+       found = g_find_program_in_path (utf8app);
+       if (found == NULL) {
+               *completed = NULL;
+               g_free (utf8appmemory);
+               return FALSE;
+       }
+
+       *completed = mono_process_quote_path (found);
+       g_free (found);
+       g_free (utf8appmemory);
+       return TRUE;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+MonoBoolean
+ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoW32ProcessStartInfo *proc_start_info, MonoW32ProcessInfo *process_info)
+{
+       SHELLEXECUTEINFO shellex = {0};
+       gboolean ret;
+
+       shellex.cbSize = sizeof(SHELLEXECUTEINFO);
+       shellex.fMask = (gulong)(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_UNICODE);
+       shellex.nShow = (gulong)proc_start_info->window_style;
+       shellex.nShow = (gulong)((shellex.nShow == 0) ? 1 : (shellex.nShow == 1 ? 0 : shellex.nShow));
+
+       if (proc_start_info->filename != NULL) {
+               shellex.lpFile = mono_string_chars (proc_start_info->filename);
+       }
+
+       if (proc_start_info->arguments != NULL) {
+               shellex.lpParameters = mono_string_chars (proc_start_info->arguments);
+       }
+
+       if (proc_start_info->verb != NULL &&
+           mono_string_length (proc_start_info->verb) != 0) {
+               shellex.lpVerb = mono_string_chars (proc_start_info->verb);
+       }
+
+       if (proc_start_info->working_directory != NULL &&
+           mono_string_length (proc_start_info->working_directory) != 0) {
+               shellex.lpDirectory = mono_string_chars (proc_start_info->working_directory);
+       }
+
+       if (proc_start_info->error_dialog) {    
+               shellex.hwnd = proc_start_info->error_dialog_parent_handle;
+       } else {
+               shellex.fMask = (gulong)(shellex.fMask | SEE_MASK_FLAG_NO_UI);
+       }
+
+       ret = ShellExecuteEx (&shellex);
+       if (ret == FALSE) {
+               process_info->pid = -GetLastError ();
+       } else {
+               process_info->process_handle = shellex.hProcess;
+               process_info->thread_handle = NULL;
+#if !defined(MONO_CROSS_COMPILE)
+               process_info->pid = GetProcessId (shellex.hProcess);
+#else
+               process_info->pid = 0;
+#endif
+               process_info->tid = 0;
+       }
+
+       return ret;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static inline void
+mono_process_init_startup_info (HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle, STARTUPINFO *startinfo)
+{
+       startinfo->cb = sizeof(STARTUPINFO);
+       startinfo->dwFlags = STARTF_USESTDHANDLES;
+       startinfo->hStdInput = stdin_handle;
+       startinfo->hStdOutput = stdout_handle;
+       startinfo->hStdError = stderr_handle;
+       return;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static gboolean
+mono_process_create_process (MonoW32ProcessInfo *mono_process_info, gunichar2 *shell_path,
+                            MonoString *cmd, guint32 creation_flags, gchar *env_vars,
+                            gunichar2 *dir, STARTUPINFO *start_info, PROCESS_INFORMATION *process_info)
+{
+       gboolean result = FALSE;
+
+       if (mono_process_info->username) {
+               guint32 logon_flags = mono_process_info->load_user_profile ? LOGON_WITH_PROFILE : 0;
+
+               result = CreateProcessWithLogonW (mono_string_chars (mono_process_info->username),
+                                                 mono_process_info->domain ? mono_string_chars (mono_process_info->domain) : NULL,
+                                                 (const gunichar2 *)mono_process_info->password,
+                                                 logon_flags,
+                                                 shell_path,
+                                                 cmd ? mono_string_chars (cmd) : NULL,
+                                                 creation_flags,
+                                                 env_vars, dir, start_info, process_info);
+
+       } else {
+
+               result = CreateProcess (shell_path,
+                                       cmd ? mono_string_chars (cmd): NULL,
+                                       NULL,
+                                       NULL,
+                                       TRUE,
+                                       creation_flags,
+                                       env_vars,
+                                       dir,
+                                       start_info,
+                                       process_info);
+
+       }
+
+       return result;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+static gboolean
+mono_process_get_shell_arguments (MonoW32ProcessStartInfo *proc_start_info, gunichar2 **shell_path, MonoString **cmd)
+{
+       gchar           *spath = NULL;
+       gchar           *new_cmd, *cmd_utf8;
+       MonoError       mono_error;
+
+       *shell_path = NULL;
+       *cmd = proc_start_info->arguments;
+
+       mono_process_complete_path (mono_string_chars (proc_start_info->filename), &spath);
+       if (spath != NULL) {
+               /* Seems like our CreateProcess does not work as the windows one.
+                * This hack is needed to deal with paths containing spaces */
+               if (*cmd) {
+                       cmd_utf8 = mono_string_to_utf8_checked (*cmd, &mono_error);
+                       if (!mono_error_set_pending_exception (&mono_error)) {
+                               new_cmd = g_strdup_printf ("%s %s", spath, cmd_utf8);
+                               *cmd = mono_string_new_wrapper (new_cmd);
+                               g_free (cmd_utf8);
+                               g_free (new_cmd);
+                       } else {
+                               *cmd = NULL;
+                       }
+               }
+               else {
+                       *cmd = mono_string_new_wrapper (spath);
+               }
+
+               g_free (spath);
+       }
+
+       return (*cmd != NULL) ? TRUE : FALSE;
+}
+
+MonoBoolean
+ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoW32ProcessStartInfo *proc_start_info, HANDLE stdin_handle,
+                                                            HANDLE stdout_handle, HANDLE stderr_handle, MonoW32ProcessInfo *process_info)
+{
+       gboolean ret;
+       gunichar2 *dir;
+       STARTUPINFO startinfo={0};
+       PROCESS_INFORMATION procinfo;
+       gunichar2 *shell_path = NULL;
+       gchar *env_vars = NULL;
+       MonoString *cmd = NULL;
+       guint32 creation_flags;
+
+       mono_process_init_startup_info (stdin_handle, stdout_handle, stderr_handle, &startinfo);
+
+       creation_flags = CREATE_UNICODE_ENVIRONMENT;
+       if (proc_start_info->create_no_window)
+               creation_flags |= CREATE_NO_WINDOW;
+       
+       if (mono_process_get_shell_arguments (proc_start_info, &shell_path, &cmd) == FALSE) {
+               process_info->pid = -ERROR_FILE_NOT_FOUND;
+               return FALSE;
+       }
+
+       if (process_info->env_keys) {
+               gint i, len; 
+               MonoString *ms;
+               MonoString *key, *value;
+               gunichar2 *str, *ptr;
+               gunichar2 *equals16;
+
+               for (len = 0, i = 0; i < mono_array_length (process_info->env_keys); i++) {
+                       ms = mono_array_get (process_info->env_values, MonoString *, i);
+                       if (ms == NULL)
+                               continue;
+
+                       len += mono_string_length (ms) * sizeof (gunichar2);
+                       ms = mono_array_get (process_info->env_keys, MonoString *, i);
+                       len += mono_string_length (ms) * sizeof (gunichar2);
+                       len += 2 * sizeof (gunichar2);
+               }
+
+               equals16 = g_utf8_to_utf16 ("=", 1, NULL, NULL, NULL);
+               ptr = str = g_new0 (gunichar2, len + 1);
+               for (i = 0; i < mono_array_length (process_info->env_keys); i++) {
+                       value = mono_array_get (process_info->env_values, MonoString *, i);
+                       if (value == NULL)
+                               continue;
+
+                       key = mono_array_get (process_info->env_keys, MonoString *, i);
+                       memcpy (ptr, mono_string_chars (key), mono_string_length (key) * sizeof (gunichar2));
+                       ptr += mono_string_length (key);
+
+                       memcpy (ptr, equals16, sizeof (gunichar2));
+                       ptr++;
+
+                       memcpy (ptr, mono_string_chars (value), mono_string_length (value) * sizeof (gunichar2));
+                       ptr += mono_string_length (value);
+                       ptr++;
+               }
+
+               g_free (equals16);
+               env_vars = (gchar *) str;
+       }
+       
+       /* The default dir name is "".  Turn that into NULL to mean
+        * "current directory"
+        */
+       if (proc_start_info->working_directory == NULL || mono_string_length (proc_start_info->working_directory) == 0)
+               dir = NULL;
+       else
+               dir = mono_string_chars (proc_start_info->working_directory);
+
+       ret = mono_process_create_process (process_info, shell_path, cmd, creation_flags, env_vars, dir, &startinfo, &procinfo);
+
+       g_free (env_vars);
+       if (shell_path != NULL)
+               g_free (shell_path);
+
+       if (ret) {
+               process_info->process_handle = procinfo.hProcess;
+               /*process_info->thread_handle=procinfo.hThread;*/
+               process_info->thread_handle = NULL;
+               if (procinfo.hThread != NULL && procinfo.hThread != INVALID_HANDLE_VALUE)
+                       CloseHandle (procinfo.hThread);
+               process_info->pid = procinfo.dwProcessId;
+               process_info->tid = procinfo.dwThreadId;
+       } else {
+               process_info->pid = -GetLastError ();
+       }
+       
+       return ret;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static inline gboolean
+mono_process_win_enum_processes (DWORD *pids, DWORD count, DWORD *needed)
+{
+       return EnumProcesses (pids, count, needed);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+MonoArray *
+ves_icall_System_Diagnostics_Process_GetProcesses_internal (void)
+{
+       MonoError error;
+       MonoArray *procs;
+       gboolean ret;
+       DWORD needed;
+       int count;
+       DWORD *pids;
+
+       count = 512;
+       do {
+               pids = g_new0 (DWORD, count);
+               ret = mono_process_win_enum_processes (pids, count * sizeof (guint32), &needed);
+               if (ret == FALSE) {
+                       MonoException *exc;
+
+                       g_free (pids);
+                       pids = NULL;
+                       exc = mono_get_exception_not_supported ("This system does not support EnumProcesses");
+                       mono_set_pending_exception (exc);
+                       return NULL;
+               }
+               if (needed < (count * sizeof (guint32)))
+                       break;
+               g_free (pids);
+               pids = NULL;
+               count = (count * 3) / 2;
+       } while (TRUE);
+
+       count = needed / sizeof (guint32);
+       procs = mono_array_new_checked (mono_domain_get (), mono_get_int32_class (), count, &error);
+       if (mono_error_set_pending_exception (&error)) {
+               g_free (pids);
+               return NULL;
+       }
+
+       memcpy (mono_array_addr (procs, guint32, 0), pids, needed);
+       g_free (pids);
+       pids = NULL;
+
+       return procs;
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_CloseProcess (gpointer handle)
+{
+       return CloseHandle (handle);
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint32 exitcode)
+{
+       return TerminateProcess (handle, exitcode);
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gint32 *exitcode)
+{
+       return GetExitCodeProcess (handle, exitcode);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static inline MonoBoolean
+mono_icall_get_process_working_set_size (gpointer handle, gsize *min, gsize *max)
+{
+       return GetProcessWorkingSetSize (handle, min, max);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize (gpointer handle, gsize *min, gsize *max)
+{
+       return mono_icall_get_process_working_set_size (handle, min, max);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static inline MonoBoolean
+mono_icall_set_process_working_set_size (gpointer handle, gsize min, gsize max)
+{
+       return SetProcessWorkingSetSize (handle, min, max);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handle, gsize min, gsize max)
+{
+       return mono_icall_set_process_working_set_size (handle, min, max);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static inline gint32
+mono_icall_get_priority_class (gpointer handle)
+{
+       return GetPriorityClass (handle);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+gint32
+ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass (gpointer handle)
+{
+       return mono_icall_get_priority_class (handle);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static inline MonoBoolean
+mono_icall_set_priority_class (gpointer handle, gint32 priorityClass)
+{
+       return SetPriorityClass (handle, (guint32) priorityClass);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass (gpointer handle, gint32 priorityClass)
+{
+       return mono_icall_set_priority_class (handle, priorityClass);
+}
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64 *creationtime, gint64 *exittime, gint64 *kerneltime, gint64 *usertime)
+{
+       return GetProcessTimes (handle, (LPFILETIME) creationtime, (LPFILETIME) exittime, (LPFILETIME) kerneltime, (LPFILETIME) usertime);
+}
+
+gpointer
+ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess (void)
+{
+       return GetCurrentProcess ();
+}
diff --git a/mono/metadata/w32process.c b/mono/metadata/w32process.c
new file mode 100644 (file)
index 0000000..614168e
--- /dev/null
@@ -0,0 +1,624 @@
+
+#include <glib.h>
+
+#include "w32process.h"
+#include "w32process-internals.h"
+#include "w32process-win32-internals.h"
+#include "object.h"
+#include "object-internals.h"
+#include "class.h"
+#include "class-internals.h"
+#include "image.h"
+#include "utils/mono-proclib.h"
+
+#define LOGDEBUG(...)
+/* define LOGDEBUG(...) g_message(__VA_ARGS__)  */
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) && defined(HOST_WIN32)
+
+static guint32
+mono_w32process_get_pid (gpointer handle)
+{
+       return GetProcessId (handle);
+}
+
+static gboolean
+mono_w32process_try_get_modules (gpointer process, gpointer *modules, guint32 size, guint32 *needed)
+{
+       return EnumProcessModules (process, (HMODULE *) modules, size, (LPDWORD) needed);
+}
+
+static guint32
+mono_w32process_module_get_name (gpointer process, gpointer module, gunichar2 *basename, guint32 size)
+{
+       return GetModuleBaseName (process, module, basename, size);
+}
+
+static guint32
+mono_w32process_module_get_filename (gpointer process, gpointer module, gunichar2 *basename, guint32 size)
+{
+       return GetModuleFileNameEx (process, module, basename, size);
+}
+
+static gboolean
+mono_w32process_module_get_information (gpointer process, gpointer module, MODULEINFO *modinfo, guint32 size)
+{
+       return GetModuleInformation (process, module, modinfo, size);
+}
+
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) && defined(HOST_WIN32) */
+
+static MonoImage *system_image;
+
+static void
+stash_system_image (MonoImage *image)
+{
+       system_image = image;
+}
+
+static MonoClass*
+get_file_version_info_class (void)
+{
+       static MonoClass *file_version_info_class;
+
+       if (file_version_info_class)
+               return file_version_info_class;
+
+       g_assert (system_image);
+
+       return file_version_info_class = mono_class_load_from_name (
+               system_image, "System.Diagnostics", "FileVersionInfo");
+}
+
+static MonoClass*
+get_process_module_class (void)
+{
+       static MonoClass *process_module_class;
+
+       if (process_module_class)
+               return process_module_class;
+
+       g_assert (system_image);
+
+       return process_module_class = mono_class_load_from_name (
+               system_image, "System.Diagnostics", "ProcessModule");
+}
+
+static guint32
+unicode_chars (const gunichar2 *str)
+{
+       guint32 len;
+       for (len = 0; str [len] != '\0'; ++len) {}
+       return len;
+}
+
+static void
+process_set_field_object (MonoObject *obj, const gchar *fieldname, MonoObject *data)
+{
+       MonoClass *klass;
+       MonoClassField *field;
+
+       LOGDEBUG (g_message ("%s: Setting field %s to object at %p", __func__, fieldname, data));
+
+       klass = mono_object_class (obj);
+       g_assert (klass);
+
+       field = mono_class_get_field_from_name (klass, fieldname);
+       g_assert (field);
+
+       mono_gc_wbarrier_generic_store (((char *)obj) + field->offset, data);
+}
+
+static void
+process_set_field_string (MonoObject *obj, const gchar *fieldname, const gunichar2 *val, guint32 len, MonoError *error)
+{
+       MonoDomain *domain;
+       MonoClass *klass;
+       MonoClassField *field;
+       MonoString *string;
+
+       mono_error_init (error);
+
+       LOGDEBUG (g_message ("%s: Setting field %s to [%s]", __func__, fieldname, g_utf16_to_utf8 (val, len, NULL, NULL, NULL)));
+
+       domain = mono_object_domain (obj);
+       g_assert (domain);
+
+       klass = mono_object_class (obj);
+       g_assert (klass);
+
+       field = mono_class_get_field_from_name (klass, fieldname);
+       g_assert (field);
+
+       string = mono_string_new_utf16_checked (domain, val, len, error);
+       return_if_nok (error);
+
+       mono_gc_wbarrier_generic_store (((char *)obj) + field->offset, (MonoObject*)string);
+}
+
+static void
+process_set_field_string_char (MonoObject *obj, const gchar *fieldname, const gchar *val)
+{
+       MonoDomain *domain;
+       MonoClass *klass;
+       MonoClassField *field;
+       MonoString *string;
+
+       LOGDEBUG (g_message ("%s: Setting field %s to [%s]", __func__, fieldname, val));
+
+       domain = mono_object_domain (obj);
+       g_assert (domain);
+
+       klass = mono_object_class (obj);
+       g_assert (klass);
+
+       field = mono_class_get_field_from_name (klass, fieldname);
+       g_assert (field);
+
+       string = mono_string_new (domain, val);
+
+       mono_gc_wbarrier_generic_store (((char *)obj) + field->offset, (MonoObject*)string);
+}
+
+static void
+process_set_field_int (MonoObject *obj, const gchar *fieldname, guint32 val)
+{
+       MonoClass *klass;
+       MonoClassField *field;
+
+       LOGDEBUG (g_message ("%s: Setting field %s to %d", __func__,fieldname, val));
+
+       klass = mono_object_class (obj);
+       g_assert (klass);
+
+       field = mono_class_get_field_from_name (klass, fieldname);
+       g_assert (field);
+
+       *(guint32 *)(((char *)obj) + field->offset)=val;
+}
+
+static void
+process_set_field_intptr (MonoObject *obj, const gchar *fieldname, gpointer val)
+{
+       MonoClass *klass;
+       MonoClassField *field;
+
+       LOGDEBUG (g_message ("%s: Setting field %s to %p", __func__, fieldname, val));
+
+       klass = mono_object_class (obj);
+       g_assert (klass);
+
+       field = mono_class_get_field_from_name (klass, fieldname);
+       g_assert (field);
+
+       *(gpointer *)(((char *)obj) + field->offset) = val;
+}
+
+static void
+process_set_field_bool (MonoObject *obj, const gchar *fieldname, gboolean val)
+{
+       MonoClass *klass;
+       MonoClassField *field;
+
+       LOGDEBUG (g_message ("%s: Setting field %s to %s", __func__, fieldname, val ? "TRUE":"FALSE"));
+
+       klass = mono_object_class (obj);
+       g_assert (klass);
+
+       field = mono_class_get_field_from_name (klass, fieldname);
+       g_assert (field);
+
+       *(guint8 *)(((char *)obj) + field->offset) = val;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+
+#define SFI_COMMENTS           "\\StringFileInfo\\%02X%02X%02X%02X\\Comments"
+#define SFI_COMPANYNAME                "\\StringFileInfo\\%02X%02X%02X%02X\\CompanyName"
+#define SFI_FILEDESCRIPTION    "\\StringFileInfo\\%02X%02X%02X%02X\\FileDescription"
+#define SFI_FILEVERSION                "\\StringFileInfo\\%02X%02X%02X%02X\\FileVersion"
+#define SFI_INTERNALNAME       "\\StringFileInfo\\%02X%02X%02X%02X\\InternalName"
+#define SFI_LEGALCOPYRIGHT     "\\StringFileInfo\\%02X%02X%02X%02X\\LegalCopyright"
+#define SFI_LEGALTRADEMARKS    "\\StringFileInfo\\%02X%02X%02X%02X\\LegalTrademarks"
+#define SFI_ORIGINALFILENAME   "\\StringFileInfo\\%02X%02X%02X%02X\\OriginalFilename"
+#define SFI_PRIVATEBUILD       "\\StringFileInfo\\%02X%02X%02X%02X\\PrivateBuild"
+#define SFI_PRODUCTNAME                "\\StringFileInfo\\%02X%02X%02X%02X\\ProductName"
+#define SFI_PRODUCTVERSION     "\\StringFileInfo\\%02X%02X%02X%02X\\ProductVersion"
+#define SFI_SPECIALBUILD       "\\StringFileInfo\\%02X%02X%02X%02X\\SpecialBuild"
+#define EMPTY_STRING           (gunichar2*)"\000\000"
+
+typedef struct {
+       const char *name;
+       const char *id;
+} StringTableEntry;
+
+static StringTableEntry stringtable_entries [] = {
+       { "comments", SFI_COMMENTS },
+       { "companyname", SFI_COMPANYNAME },
+       { "filedescription", SFI_FILEDESCRIPTION },
+       { "fileversion", SFI_FILEVERSION },
+       { "internalname", SFI_INTERNALNAME },
+       { "legalcopyright", SFI_LEGALCOPYRIGHT },
+       { "legaltrademarks", SFI_LEGALTRADEMARKS },
+       { "originalfilename", SFI_ORIGINALFILENAME },
+       { "privatebuild", SFI_PRIVATEBUILD },
+       { "productname", SFI_PRODUCTNAME },
+       { "productversion", SFI_PRODUCTVERSION },
+       { "specialbuild", SFI_SPECIALBUILD }
+};
+
+static void
+process_module_string_read (MonoObject *filever, gpointer data, const gchar *fieldname,
+               guchar lang_hi, guchar lang_lo, const gchar *key, MonoError *error)
+{
+       gchar *lang_key_utf8;
+       gunichar2 *lang_key, *buffer;
+       UINT chars;
+
+       mono_error_init (error);
+
+       lang_key_utf8 = g_strdup_printf (key, lang_lo, lang_hi, 0x04, 0xb0);
+
+       LOGDEBUG (g_message ("%s: asking for [%s]", __func__, lang_key_utf8));
+
+       lang_key = g_utf8_to_utf16 (lang_key_utf8, -1, NULL, NULL, NULL);
+
+       if (VerQueryValue (data, lang_key, (gpointer *)&buffer, &chars) && chars > 0) {
+               LOGDEBUG (g_message ("%s: found %d chars of [%s]", __func__, chars, g_utf16_to_utf8 (buffer, chars, NULL, NULL, NULL)));
+               /* chars includes trailing null */
+               process_set_field_string (filever, fieldname, buffer, chars - 1, error);
+       } else {
+               process_set_field_string (filever, fieldname, EMPTY_STRING, 0, error);
+       }
+
+       g_free (lang_key);
+       g_free (lang_key_utf8);
+}
+
+static void
+process_module_stringtable (MonoObject *filever, gpointer data, guchar lang_hi, guchar lang_lo, MonoError *error)
+{
+       for (int i = 0; i < G_N_ELEMENTS (stringtable_entries); ++i) {
+               process_module_string_read (filever, data, stringtable_entries [i].name,
+                       lang_hi, lang_lo, stringtable_entries [i].id, error);
+               return_if_nok (error);
+       }
+}
+
+static void
+mono_w32process_get_fileversion (MonoObject *filever, gunichar2 *filename, MonoError *error)
+{
+       DWORD verinfohandle;
+       VS_FIXEDFILEINFO *ffi;
+       gpointer data;
+       DWORD datalen;
+       guchar *trans_data;
+       gunichar2 *query;
+       UINT ffi_size, trans_size;
+       BOOL ok;
+       gunichar2 lang_buf[128];
+       guint32 lang, lang_count;
+
+       mono_error_init (error);
+
+       datalen = GetFileVersionInfoSize (filename, &verinfohandle);
+       if (datalen) {
+               data = g_malloc0 (datalen);
+               ok = GetFileVersionInfo (filename, verinfohandle, datalen, data);
+               if (ok) {
+                       query = g_utf8_to_utf16 ("\\", -1, NULL, NULL, NULL);
+                       if (query == NULL) {
+                               g_free (data);
+                               return;
+                       }
+
+                       if (VerQueryValue (data, query, (gpointer *)&ffi, &ffi_size)) {
+                               LOGDEBUG (g_message ("%s: recording assembly: FileName [%s] FileVersionInfo [%d.%d.%d.%d]", __func__, g_utf16_to_utf8 (filename, -1, NULL, NULL, NULL), HIWORD (ffi->dwFileVersionMS), LOWORD (ffi->dwFileVersionMS), HIWORD (ffi->dwFileVersionLS), LOWORD (ffi->dwFileVersionLS)));
+
+                               process_set_field_int (filever, "filemajorpart", HIWORD (ffi->dwFileVersionMS));
+                               process_set_field_int (filever, "fileminorpart", LOWORD (ffi->dwFileVersionMS));
+                               process_set_field_int (filever, "filebuildpart", HIWORD (ffi->dwFileVersionLS));
+                               process_set_field_int (filever, "fileprivatepart", LOWORD (ffi->dwFileVersionLS));
+
+                               process_set_field_int (filever, "productmajorpart", HIWORD (ffi->dwProductVersionMS));
+                               process_set_field_int (filever, "productminorpart", LOWORD (ffi->dwProductVersionMS));
+                               process_set_field_int (filever, "productbuildpart", HIWORD (ffi->dwProductVersionLS));
+                               process_set_field_int (filever, "productprivatepart", LOWORD (ffi->dwProductVersionLS));
+
+                               process_set_field_bool (filever, "isdebug", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_DEBUG) != 0);
+                               process_set_field_bool (filever, "isprerelease", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_PRERELEASE) != 0);
+                               process_set_field_bool (filever, "ispatched", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_PATCHED) != 0);
+                               process_set_field_bool (filever, "isprivatebuild", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_PRIVATEBUILD) != 0);
+                               process_set_field_bool (filever, "isspecialbuild", ((ffi->dwFileFlags & ffi->dwFileFlagsMask) & VS_FF_SPECIALBUILD) != 0);
+                       }
+                       g_free (query);
+
+                       query = g_utf8_to_utf16 ("\\VarFileInfo\\Translation", -1, NULL, NULL, NULL);
+                       if (query == NULL) {
+                               g_free (data);
+                               return;
+                       }
+
+                       if (VerQueryValue (data, query, (gpointer *)&trans_data, &trans_size)) {
+                               /* use the first language ID we see */
+                               if (trans_size >= 4) {
+                                       LOGDEBUG (g_message("%s: %s has 0x%0x 0x%0x 0x%0x 0x%0x", __func__, g_utf16_to_utf8 (filename, -1, NULL, NULL, NULL), trans_data[0], trans_data[1], trans_data[2], trans_data[3]));
+                                       lang = (trans_data[0]) | (trans_data[1] << 8) | (trans_data[2] << 16) | (trans_data[3] << 24);
+                                       /* Only give the lower 16 bits to VerLanguageName, as Windows gets confused otherwise  */
+                                       lang_count = VerLanguageName (lang & 0xFFFF, lang_buf, 128);
+                                       if (lang_count) {
+                                               process_set_field_string (filever, "language", lang_buf, lang_count, error);
+                                               return_if_nok (error);
+                                       }
+                                       process_module_stringtable (filever, data, trans_data[0], trans_data[1], error);
+                                       return_if_nok (error);
+                               }
+                       } else {
+                               int i;
+
+                               for (i = 0; i < G_N_ELEMENTS (stringtable_entries); ++i) {
+                                       /* No strings, so set every field to the empty string */
+                                       process_set_field_string (filever, stringtable_entries [i].name, EMPTY_STRING, 0, error);
+                                       return_if_nok (error);
+                               }
+
+                               /* And language seems to be set to en_US according to bug 374600 */
+                               lang_count = VerLanguageName (0x0409, lang_buf, 128);
+                               if (lang_count) {
+                                       process_set_field_string (filever, "language", lang_buf, lang_count, error);
+                                       return_if_nok (error);
+                               }
+                       }
+
+                       g_free (query);
+               }
+               g_free (data);
+       }
+}
+
+#endif /* #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+void
+ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this_obj, MonoString *filename)
+{
+       MonoError error;
+
+       stash_system_image (mono_object_class (this_obj)->image);
+
+       mono_w32process_get_fileversion (this_obj, mono_string_chars (filename), &error);
+       if (!mono_error_ok (&error)) {
+               mono_error_set_pending_exception (&error);
+               return;
+       }
+
+       process_set_field_string (this_obj, "filename", mono_string_chars (filename), mono_string_length (filename), &error);
+       if (!mono_error_ok (&error)) {
+               mono_error_set_pending_exception (&error);
+       }
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+
+static GPtrArray*
+get_domain_assemblies (MonoDomain *domain)
+{
+       GSList *tmp;
+       GPtrArray *assemblies;
+
+       /*
+        * Make a copy of the list of assemblies because we can't hold the assemblies
+        * lock while creating objects etc.
+        */
+       assemblies = g_ptr_array_new ();
+       mono_domain_assemblies_lock (domain);
+       for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) {
+               MonoAssembly *ass = (MonoAssembly *)tmp->data;
+               if (ass->image->fileio_used)
+                       continue;
+               g_ptr_array_add (assemblies, ass);
+       }
+       mono_domain_assemblies_unlock (domain);
+
+       return assemblies;
+}
+
+static MonoObject*
+process_add_module (HANDLE process, HMODULE mod, gunichar2 *filename, gunichar2 *modulename, MonoClass *proc_class, MonoError *error)
+{
+       MonoObject *item, *filever;
+       MonoDomain *domain = mono_domain_get ();
+       MODULEINFO modinfo;
+       BOOL ok;
+
+       mono_error_init (error);
+
+       /* Build a System.Diagnostics.ProcessModule with the data. */
+       item = mono_object_new_checked (domain, proc_class, error);
+       return_val_if_nok (error, NULL);
+
+       filever = mono_object_new_checked (domain, get_file_version_info_class (), error);
+       return_val_if_nok (error, NULL);
+
+       mono_w32process_get_fileversion (filever, filename, error);
+       return_val_if_nok (error, NULL);
+
+       process_set_field_string (filever, "filename", filename, unicode_chars (filename), error);
+       return_val_if_nok (error, NULL);
+
+       ok = mono_w32process_module_get_information (process, mod, &modinfo, sizeof(MODULEINFO));
+       if (ok) {
+               process_set_field_intptr (item, "baseaddr", modinfo.lpBaseOfDll);
+               process_set_field_intptr (item, "entryaddr", modinfo.EntryPoint);
+               process_set_field_int (item, "memory_size", modinfo.SizeOfImage);
+       }
+
+       process_set_field_string (item, "filename", filename, unicode_chars (filename), error);
+       return_val_if_nok (error, NULL);
+
+       process_set_field_string (item, "modulename", modulename, unicode_chars (modulename), error);
+       return_val_if_nok (error, NULL);
+
+       process_set_field_object (item, "version_info", filever);
+
+       return item;
+}
+
+static void
+process_get_assembly_fileversion (MonoObject *filever, MonoAssembly *assembly)
+{
+       process_set_field_int (filever, "filemajorpart", assembly->aname.major);
+       process_set_field_int (filever, "fileminorpart", assembly->aname.minor);
+       process_set_field_int (filever, "filebuildpart", assembly->aname.build);
+}
+
+static MonoObject*
+process_get_module (MonoAssembly *assembly, MonoClass *proc_class, MonoError *error)
+{
+       MonoObject *item, *filever;
+       MonoDomain *domain;
+       gchar *filename;
+       const gchar *modulename;
+
+       mono_error_init (error);
+
+       domain = mono_domain_get ();
+
+       modulename = assembly->aname.name;
+
+       /* Build a System.Diagnostics.ProcessModule with the data. */
+       item = mono_object_new_checked (domain, proc_class, error);
+       return_val_if_nok (error, NULL);
+
+       filever = mono_object_new_checked (domain, get_file_version_info_class (), error);
+       return_val_if_nok (error, NULL);
+
+       filename = g_strdup_printf ("[In Memory] %s", modulename);
+
+       process_get_assembly_fileversion (filever, assembly);
+       process_set_field_string_char (filever, "filename", filename);
+       process_set_field_object (item, "version_info", filever);
+
+       process_set_field_intptr (item, "baseaddr", assembly->image->raw_data);
+       process_set_field_int (item, "memory_size", assembly->image->raw_data_len);
+       process_set_field_string_char (item, "filename", filename);
+       process_set_field_string_char (item, "modulename", modulename);
+
+       g_free (filename);
+
+       return item;
+}
+
+/* Returns an array of System.Diagnostics.ProcessModule */
+MonoArray *
+ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this_obj, HANDLE process)
+{
+       MonoError error;
+       MonoArray *temp_arr = NULL;
+       MonoArray *arr;
+       HMODULE mods[1024];
+       gunichar2 filename[MAX_PATH];
+       gunichar2 modname[MAX_PATH];
+       DWORD needed;
+       guint32 count = 0, module_count = 0, assembly_count = 0;
+       guint32 i, num_added = 0;
+       GPtrArray *assemblies = NULL;
+
+       stash_system_image (mono_object_class (this_obj)->image);
+
+       if (mono_w32process_get_pid (process) == mono_process_current_pid ()) {
+               assemblies = get_domain_assemblies (mono_domain_get ());
+               assembly_count = assemblies->len;
+       }
+
+       if (mono_w32process_try_get_modules (process, mods, sizeof(mods), &needed))
+               module_count += needed / sizeof(HMODULE);
+
+       count = module_count + assembly_count;
+       temp_arr = mono_array_new_checked (mono_domain_get (), get_process_module_class (), count, &error);
+       if (mono_error_set_pending_exception (&error))
+               return NULL;
+
+       for (i = 0; i < module_count; i++) {
+               if (mono_w32process_module_get_name (process, mods[i], modname, MAX_PATH)
+                        && mono_w32process_module_get_filename (process, mods[i], filename, MAX_PATH))
+               {
+                       MonoObject *module = process_add_module (process, mods[i], filename, modname, get_process_module_class (), &error);
+                       if (!mono_error_ok (&error)) {
+                               mono_error_set_pending_exception (&error);
+                               return NULL;
+                       }
+                       mono_array_setref (temp_arr, num_added++, module);
+               }
+       }
+
+       if (assemblies) {
+               for (i = 0; i < assembly_count; i++) {
+                       MonoAssembly *ass = (MonoAssembly *)g_ptr_array_index (assemblies, i);
+                       MonoObject *module = process_get_module (ass, get_process_module_class (), &error);
+                       if (!mono_error_ok (&error)) {
+                               mono_error_set_pending_exception (&error);
+                               return NULL;
+                       }
+                       mono_array_setref (temp_arr, num_added++, module);
+               }
+               g_ptr_array_free (assemblies, TRUE);
+       }
+
+       if (count == num_added) {
+               arr = temp_arr;
+       } else {
+               /* shorter version of the array */
+               arr = mono_array_new_checked (mono_domain_get (), get_process_module_class (), num_added, &error);
+               if (mono_error_set_pending_exception (&error))
+                       return NULL;
+
+               for (i = 0; i < num_added; i++)
+                       mono_array_setref (arr, i, mono_array_get (temp_arr, MonoObject*, i));
+       }
+
+       return arr;
+}
+
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+
+MonoString *
+ves_icall_System_Diagnostics_Process_ProcessName_internal (HANDLE process)
+{
+       MonoError error;
+       MonoString *string;
+       gunichar2 name[MAX_PATH];
+       guint32 len;
+       gboolean ok;
+       HMODULE mod;
+       DWORD needed;
+
+       ok = mono_w32process_try_get_modules (process, &mod, sizeof(mod), &needed);
+       if (!ok)
+               return NULL;
+
+       len = mono_w32process_module_get_name (process, mod, name, MAX_PATH);
+       if (len == 0)
+               return NULL;
+
+       string = mono_string_new_utf16_checked (mono_domain_get (), name, len, &error);
+       if (!mono_error_ok (&error))
+               mono_error_set_pending_exception (&error);
+
+       return string;
+}
+
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+gint64
+ves_icall_System_Diagnostics_Process_GetProcessData (int pid, gint32 data_type, gint32 *error)
+{
+       MonoProcessError perror;
+       guint64 res;
+
+       res = mono_process_get_data_with_error (GINT_TO_POINTER (pid), (MonoProcessData)data_type, &perror);
+       if (error)
+               *error = perror;
+       return res;
+}
diff --git a/mono/metadata/w32process.h b/mono/metadata/w32process.h
new file mode 100644 (file)
index 0000000..7df9caf
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * w32process.h: System.Diagnostics.Process support
+ *
+ * Author:
+ *     Dick Porter (dick@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#ifndef _MONO_METADATA_W32PROCESS_H_
+#define _MONO_METADATA_W32PROCESS_H_
+
+#include <config.h>
+#include <glib.h>
+
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#include <mono/metadata/object.h>
+
+G_BEGIN_DECLS
+
+typedef enum {
+       MONO_W32PROCESS_PRIORITY_CLASS_NORMAL       = 0x0020,
+       MONO_W32PROCESS_PRIORITY_CLASS_IDLE         = 0x0040,
+       MONO_W32PROCESS_PRIORITY_CLASS_HIGH         = 0x0080,
+       MONO_W32PROCESS_PRIORITY_CLASS_REALTIME     = 0x0100,
+       MONO_W32PROCESS_PRIORITY_CLASS_BELOW_NORMAL = 0x4000,
+       MONO_W32PROCESS_PRIORITY_CLASS_ABOVE_NORMAL = 0x8000,
+} MonoW32ProcessPriorityClass;
+
+typedef struct 
+{
+       gpointer process_handle;
+       gpointer thread_handle;
+       guint32 pid; /* Contains GetLastError () on failure */
+       guint32 tid;
+       MonoArray *env_keys;
+       MonoArray *env_values;
+       MonoString *username;
+       MonoString *domain;
+       gpointer password; /* BSTR from SecureString in 2.0 profile */
+       MonoBoolean load_user_profile;
+} MonoW32ProcessInfo;
+
+typedef struct
+{
+       MonoObject object;
+       MonoString *filename;
+       MonoString *arguments;
+       MonoString *working_directory;
+       MonoString *verb;
+       guint32 window_style;
+       MonoBoolean error_dialog;
+       gpointer error_dialog_parent_handle;
+       MonoBoolean use_shell_execute;
+       MonoString *username;
+       MonoString *domain;
+       MonoObject *password; /* SecureString in 2.0 profile, dummy in 1.x */
+       MonoString *password_in_clear_text;
+       MonoBoolean load_user_profile;
+       MonoBoolean redirect_standard_input;
+       MonoBoolean redirect_standard_output;
+       MonoBoolean redirect_standard_error;
+       MonoObject *encoding_stdout;
+       MonoObject *encoding_stderr;
+       MonoBoolean create_no_window;
+       MonoObject *weak_parent_process;
+       MonoObject *envVars;
+} MonoW32ProcessStartInfo;
+
+void
+mono_w32process_init (void);
+
+void
+mono_w32process_cleanup (void);
+
+#ifndef HOST_WIN32
+
+void
+mono_w32process_set_cli_launcher (gchar *path);
+
+gchar*
+mono_w32process_get_path (pid_t pid);
+
+#endif
+
+gpointer
+ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid);
+
+MonoArray*
+ves_icall_System_Diagnostics_Process_GetProcesses_internal (void);
+
+MonoArray*
+ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this_obj, gpointer process);
+
+void
+ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this_obj, MonoString *filename);
+
+MonoBoolean
+ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoW32ProcessStartInfo *proc_start_info, MonoW32ProcessInfo *process_handle);
+
+MonoBoolean
+ves_icall_System_Diagnostics_Process_CreateProcess_internal (MonoW32ProcessStartInfo *proc_start_info, gpointer stdin_handle,
+       gpointer stdout_handle, gpointer stderr_handle, MonoW32ProcessInfo *process_handle);
+
+MonoString*
+ves_icall_System_Diagnostics_Process_ProcessName_internal (gpointer process);
+
+gint64
+ves_icall_System_Diagnostics_Process_GetProcessData (int pid, gint32 data_type, gint32 *error);
+
+gpointer
+ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess (void);
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gint32 *exitcode);
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_CloseProcess (gpointer handle);
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint32 exitcode);
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize (gpointer handle, gsize *min, gsize *max);
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handle, gsize min, gsize max);
+
+gint32
+ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass (gpointer handle);
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass (gpointer handle, gint32 priorityClass);
+
+MonoBoolean
+ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64 *creationtime, gint64 *exittime, gint64 *kerneltime, gint64 *usertime);
+
+G_END_DECLS
+
+#endif /* _MONO_METADATA_W32PROCESS_H_ */
+
index 1f99d8fdff35769bebde8d60c0a742256be27a7d..f0a93d1f985384045bcff34f5d44debd2d2d3270 100644 (file)
@@ -12,7 +12,7 @@
 #include "w32handle-namespace.h"
 #include "mono/io-layer/io-layer.h"
 #include "mono/utils/mono-logger-internals.h"
-#include "mono/utils/w32handle.h"
+#include "mono/metadata/w32handle.h"
 
 typedef struct {
        guint32 val;
@@ -32,12 +32,12 @@ static gboolean sem_handle_own (gpointer handle, MonoW32HandleType type, guint32
 
        if (!mono_w32handle_lookup (handle, type, (gpointer *)&sem_handle)) {
                g_warning ("%s: error looking up %s handle %p",
-                       __func__, mono_w32handle_ops_typename (type), handle);
+                       __func__, mono_w32handle_get_typename (type), handle);
                return FALSE;
        }
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: owning %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
        sem_handle->val--;
 
@@ -140,7 +140,6 @@ static gpointer
 sem_handle_create (MonoW32HandleSemaphore *sem_handle, MonoW32HandleType type, gint32 initial, gint32 max)
 {
        gpointer handle;
-       int thr_ret;
 
        sem_handle->val = initial;
        sem_handle->max = max;
@@ -148,22 +147,20 @@ sem_handle_create (MonoW32HandleSemaphore *sem_handle, MonoW32HandleType type, g
        handle = mono_w32handle_new (type, sem_handle);
        if (handle == INVALID_HANDLE_VALUE) {
                g_warning ("%s: error creating %s handle",
-                       __func__, mono_w32handle_ops_typename (type));
+                       __func__, mono_w32handle_get_typename (type));
                SetLastError (ERROR_GEN_FAILURE);
                return NULL;
        }
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
 
        if (initial != 0)
                mono_w32handle_set_signal_state (handle, TRUE, FALSE);
 
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: created %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
        return handle;
 }
@@ -173,7 +170,7 @@ sem_create (gint32 initial, gint32 max)
 {
        MonoW32HandleSemaphore sem_handle;
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle, initial %d max %d",
-               __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_SEM), initial, max);
+               __func__, mono_w32handle_get_typename (MONO_W32HANDLE_SEM), initial, max);
        return sem_handle_create (&sem_handle, MONO_W32HANDLE_SEM, initial, max);
 }
 
@@ -184,7 +181,7 @@ namedsem_create (gint32 initial, gint32 max, const gunichar2 *name)
        gchar *utf8_name;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle, initial %d max %d name \"%s\"",
-               __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDSEM), initial, max, name);
+                   __func__, mono_w32handle_get_typename (MONO_W32HANDLE_NAMEDSEM), initial, max, (const char*)name);
 
        /* w32 seems to guarantee that opening named objects can't race each other */
        mono_w32handle_namespace_lock ();
@@ -260,7 +257,6 @@ ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal (gpointer handle,
 {
        MonoW32HandleType type;
        MonoW32HandleSemaphore *sem_handle;
-       int thr_ret;
        MonoBoolean ret;
 
        if (!handle) {
@@ -283,10 +279,9 @@ ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal (gpointer handle,
        }
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: releasing %s handle %p",
-               __func__, mono_w32handle_ops_typename (type), handle);
+               __func__, mono_w32handle_get_typename (type), handle);
 
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_lock_handle (handle);
 
        /* Do this before checking for count overflow, because overflowing
         * max is a listed technique for finding the current value */
@@ -296,12 +291,12 @@ ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal (gpointer handle,
        /* No idea why max is signed, but thats the spec :-( */
        if (sem_handle->val + releaseCount > (guint32)sem_handle->max) {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: %s handle %p val %d count %d max %d, max value would be exceeded",
-                       __func__, mono_w32handle_ops_typename (type), handle, sem_handle->val, releaseCount, sem_handle->max);
+                       __func__, mono_w32handle_get_typename (type), handle, sem_handle->val, releaseCount, sem_handle->max);
 
                ret = FALSE;
        } else {
                mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: %s handle %p val %d count %d max %d",
-                       __func__, mono_w32handle_ops_typename (type), handle, sem_handle->val, releaseCount, sem_handle->max);
+                       __func__, mono_w32handle_get_typename (type), handle, sem_handle->val, releaseCount, sem_handle->max);
 
                sem_handle->val += releaseCount;
                mono_w32handle_set_signal_state (handle, TRUE, TRUE);
@@ -309,8 +304,7 @@ ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal (gpointer handle,
                ret = TRUE;
        }
 
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
+       mono_w32handle_unlock_handle (handle);
 
        return ret;
 }
index d7c6b621a5cec0c9adbb964abe371f25c1a27c8b..bd6bdc97e8e3fcc7d749d0464a758e30e559e846 100644 (file)
@@ -17,6 +17,7 @@ mono_w32semaphore_init (void)
 {
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
 gpointer
 ves_icall_System_Threading_Semaphore_CreateSemaphore_internal (gint32 initialCount, gint32 maximumCount, MonoString *name, gint32 *error)
 { 
@@ -28,6 +29,7 @@ ves_icall_System_Threading_Semaphore_CreateSemaphore_internal (gint32 initialCou
 
        return sem;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT) */
 
 MonoBoolean
 ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal (gpointer handle, gint32 releaseCount, gint32 *prevcount)
index 62e771c78b912a21c14142bccfcf772d1b1fde9e..488b3cd0c4e2b9baad71d2b42eeb3599f74e1bdb 100755 (executable)
@@ -373,6 +373,7 @@ darwin_sources = \
 
 windows_sources = \
        mini-windows.c \
+       mini-windows.h \
        mini-windows-dllmain.c
 
 posix_sources = \
index 17a8e84d91a9da461fd4b40e08d5040b4d624d1e..c4c00645c1630884ba75ec654fc47124dcd2a379 100644 (file)
@@ -13,6 +13,7 @@
 #include <mono/metadata/mempool.h>
 #include <mono/metadata/opcodes.h>
 #include <mono/metadata/mempool-internals.h>
+#include <mono/utils/mono-compiler.h>
 
 #include <config.h>
 
@@ -1380,4 +1381,8 @@ mono_perform_abc_removal (MonoCompile *cfg)
        process_block (cfg, cfg->bblocks [0], &area);
 }
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (abcremoval);
+
+#endif /* !DISABLE_JIT */
index 82e3672ae1dee2f7b56abf3141204e2d2dbe844c..c419dfa2b42abf4139037e97340225628b8670b3 100644 (file)
@@ -13,6 +13,7 @@
 #include "mini.h"
 #include "ir-emit.h"
 #include "glib.h"
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_JIT
 
@@ -362,4 +363,8 @@ done:
                mono_print_code (cfg, "AFTER ALIAS_ANALYSIS");
 }
 
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (alias_analysis);
+
 #endif /* !DISABLE_JIT */
index 4a5029641218fe7804917a84c70c3fdc85eaf849..6c30c8f5bd11d92bf78f9c95192070ef72b52487 100644 (file)
@@ -4,6 +4,7 @@
  * Author:
  *   Dietmar Maurer (dietmar@ximian.com)
  *   Zoltan Varga (vargaz@gmail.com)
+ *   Johan Lorensson (lateralusx.github@gmail.com)
  *
  * (C) 2002 Ximian, Inc.
  * Copyright 2003-2011 Novell, Inc 
 
 #if !defined(DISABLE_AOT) && !defined(DISABLE_JIT)
 
+// Use MSVC toolchain, Clang for MSVC using MSVC codegen and linker, when compiling for AMD64
+// targeting WIN32 platforms running AOT compiler on WIN32 platform with VS installation.
+#if defined(TARGET_AMD64) && defined(TARGET_WIN32) && defined(HOST_WIN32) && defined(_MSC_VER)
+#define TARGET_X86_64_WIN32_MSVC
+#endif
+
+#if defined(TARGET_X86_64_WIN32_MSVC)
+#define TARGET_WIN32_MSVC
+#endif
+
 #if defined(__linux__) || defined(__native_client_codegen__)
 #define RODATA_SECT ".rodata"
 #elif defined(TARGET_MACH)
 #define RODATA_SECT ".section __TEXT, __const"
+#elif defined(TARGET_WIN32_MSVC)
+#define RODATA_SECT ".rdata"
 #else
 #define RODATA_SECT ".text"
 #endif
@@ -326,6 +339,9 @@ get_unwind_info_offset (MonoAotCompile *acfg, guint8 *encoded, guint32 encoded_l
 static char*
 get_plt_entry_debug_sym (MonoAotCompile *acfg, MonoJumpInfo *ji, GHashTable *cache);
 
+static void
+add_gsharedvt_wrappers (MonoAotCompile *acfg, MonoMethodSignature *sig, gboolean gsharedvt_in, gboolean gsharedvt_out);
+
 static void
 aot_printf (MonoAotCompile *acfg, const gchar *format, ...)
 {
@@ -602,11 +618,29 @@ emit_global_inner (MonoAotCompile *acfg, const char *name, gboolean func)
 
 #endif
 
+static inline gboolean
+link_shared_library (MonoAotCompile *acfg)
+{
+       return !acfg->aot_opts.static_link && !acfg->aot_opts.asm_only;
+}
+
+static inline gboolean
+add_to_global_symbol_table (MonoAotCompile *acfg)
+{
+#ifdef TARGET_WIN32_MSVC
+       return acfg->aot_opts.no_dlsym || link_shared_library (acfg);
+#else
+       return acfg->aot_opts.no_dlsym;
+#endif
+}
+
 static void
 emit_global (MonoAotCompile *acfg, const char *name, gboolean func)
 {
-       if (acfg->aot_opts.no_dlsym) {
+       if (add_to_global_symbol_table (acfg))
                g_ptr_array_add (acfg->globals, g_strdup (name));
+
+       if (acfg->aot_opts.no_dlsym) {
                mono_img_writer_emit_local_symbol (acfg->w, name, NULL, func);
        } else {
                emit_global_inner (acfg, name, func);
@@ -811,6 +845,10 @@ emit_code_bytes (MonoAotCompile *acfg, const guint8* buf, int size)
 #define EMIT_DWARF_INFO 1
 #endif
 
+#ifdef TARGET_WIN32_MSVC
+#undef EMIT_DWARF_INFO
+#endif
+
 #if defined(TARGET_ARM)
 #define AOT_FUNC_ALIGNMENT 4
 #else
@@ -825,7 +863,9 @@ emit_code_bytes (MonoAotCompile *acfg, const guint8* buf, int size)
 #define PPC_LDX_OP "lwzx"
 #endif
 
-#ifdef TARGET_AMD64
+#ifdef TARGET_X86_64_WIN32_MSVC
+#define AOT_TARGET_STR "AMD64 (WIN32) (MSVC codegen)"
+#elif TARGET_AMD64
 #define AOT_TARGET_STR "AMD64"
 #endif
 
@@ -1429,7 +1469,6 @@ arch_emit_got_access (MonoAotCompile *acfg, const char *got_symbol, guint8 *code
 #elif defined(TARGET_POWERPC)
        {
                guint8 buf [32];
-               guint8 *code;
 
                emit_bytes (acfg, code, mono_arch_get_patch_offset (code));
                code = buf;
@@ -2486,9 +2525,10 @@ mono_get_field_token (MonoClassField *field)
        MonoClass *klass = field->parent;
        int i;
 
-       for (i = 0; i < klass->field.count; ++i) {
+       int fcount = mono_class_get_field_count (klass);
+       for (i = 0; i < fcount; ++i) {
                if (field == &klass->fields [i])
-                       return MONO_TOKEN_FIELD_DEF | (klass->field.first + 1 + i);
+                       return MONO_TOKEN_FIELD_DEF | (mono_class_get_first_field_idx (klass) + 1 + i);
        }
 
        g_assert_not_reached ();
@@ -2767,7 +2807,7 @@ encode_klass_ref_inner (MonoAotCompile *acfg, MonoClass *klass, guint8 *buf, gui
         * information.
         */
 
-       if (klass->generic_class) {
+       if (mono_class_is_ginst (klass)) {
                guint32 token;
                g_assert (klass->type_token);
 
@@ -2777,8 +2817,8 @@ encode_klass_ref_inner (MonoAotCompile *acfg, MonoClass *klass, guint8 *buf, gui
                        encode_value (MONO_AOT_TYPEREF_TYPESPEC_TOKEN, p, &p);
                        encode_value (token, p, &p);
                } else {
-                       MonoClass *gclass = klass->generic_class->container_class;
-                       MonoGenericInst *inst = klass->generic_class->context.class_inst;
+                       MonoClass *gclass = mono_class_get_generic_class (klass)->container_class;
+                       MonoGenericInst *inst = mono_class_get_generic_class (klass)->context.class_inst;
                        static int count = 0;
                        guint8 *p1 = p;
 
@@ -2852,7 +2892,7 @@ encode_klass_ref (MonoAotCompile *acfg, MonoClass *klass, guint8 *buf, guint8 **
        /* 
         * The encoding of generic instances is large so emit them only once.
         */
-       if (klass->generic_class) {
+       if (mono_class_is_ginst (klass)) {
                guint32 token;
                g_assert (klass->type_token);
 
@@ -3613,7 +3653,7 @@ can_marshal_struct (MonoClass *klass)
        MonoMarshalType *info;
        int i;
 
-       if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
+       if (mono_class_is_auto_layout (klass))
                return FALSE;
 
        info = mono_marshal_load_type_info (klass);
@@ -3685,8 +3725,8 @@ create_gsharedvt_inst (MonoAotCompile *acfg, MonoMethod *method, MonoGenericCont
 
        memset (ctx, 0, sizeof (MonoGenericContext));
 
-       if (method->klass->generic_container) {
-               shared_context = method->klass->generic_container->context;
+       if (mono_class_is_gtd (method->klass)) {
+               shared_context = mono_class_get_generic_container (method->klass)->context;
                inst = shared_context.class_inst;
 
                args = g_new0 (MonoType*, inst->type_argc);
@@ -3844,13 +3884,14 @@ add_wrappers (MonoAotCompile *acfg)
                csig->params [1] = &mono_defaults.exception_class->byval_arg;
                add_method (acfg, get_runtime_invoke_sig (csig));
 
-               /* Assembly runtime-invoke (string, bool) [DoAssemblyResolve] */
-               csig = mono_metadata_signature_alloc (mono_defaults.corlib, 2);
+               /* Assembly runtime-invoke (string, Assembly, bool) [DoAssemblyResolve] */
+               csig = mono_metadata_signature_alloc (mono_defaults.corlib, 3);
                csig->hasthis = 1;
                csig->ret = &(mono_class_load_from_name (
                                                                                        mono_defaults.corlib, "System.Reflection", "Assembly"))->byval_arg;
                csig->params [0] = &mono_defaults.string_class->byval_arg;
-               csig->params [1] = &mono_defaults.boolean_class->byval_arg;
+               csig->params [1] = &(mono_class_load_from_name (mono_defaults.corlib, "System.Reflection", "Assembly"))->byval_arg;
+               csig->params [2] = &mono_defaults.boolean_class->byval_arg;
                add_method (acfg, get_runtime_invoke_sig (csig));
 
                /* runtime-invoke used by finalizers */
@@ -3964,7 +4005,7 @@ add_wrappers (MonoAotCompile *acfg)
                if (!klass->delegate || klass == mono_defaults.delegate_class || klass == mono_defaults.multicastdelegate_class)
                        continue;
 
-               if (!klass->generic_container) {
+               if (!mono_class_is_gtd (klass)) {
                        method = mono_get_delegate_invoke (klass);
 
                        m = mono_marshal_get_delegate_invoke (method, NULL);
@@ -4004,7 +4045,7 @@ add_wrappers (MonoAotCompile *acfg)
                                        add_method (acfg, del_invoke);
                                }
                        }
-               } else if ((acfg->opts & MONO_OPT_GSHAREDVT) && klass->generic_container) {
+               } else if ((acfg->opts & MONO_OPT_GSHAREDVT) && mono_class_is_gtd (klass)) {
                        MonoError error;
                        MonoGenericContext ctx;
                        MonoMethod *inst, *gshared;
@@ -4098,7 +4139,7 @@ add_wrappers (MonoAotCompile *acfg)
                if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) {
                        if (method->is_generic) {
                                // FIXME:
-                       } else if ((acfg->opts & MONO_OPT_GSHAREDVT) && method->klass->generic_container) {
+                       } else if ((acfg->opts & MONO_OPT_GSHAREDVT) && mono_class_is_gtd (method->klass)) {
                                MonoError error;
                                MonoGenericContext ctx;
                                MonoMethod *inst, *gshared, *m;
@@ -4132,6 +4173,13 @@ add_wrappers (MonoAotCompile *acfg)
                        (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
                        add_method (acfg, mono_marshal_get_native_wrapper (method, TRUE, TRUE));
                }
+
+               if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
+                       if (acfg->aot_opts.llvm_only) {
+                               /* The wrappers have a different signature (hasthis is not set) so need to add this too */
+                               add_gsharedvt_wrappers (acfg, mono_method_signature (method), FALSE, TRUE);
+                       }
+               }
        }
  
        /* native-to-managed wrappers */
@@ -4265,7 +4313,7 @@ add_wrappers (MonoAotCompile *acfg)
                        continue;
                }
 
-               if (klass->valuetype && !klass->generic_container && can_marshal_struct (klass) &&
+               if (klass->valuetype && !mono_class_is_gtd (klass) && can_marshal_struct (klass) &&
                        !(klass->nested_in && strstr (klass->nested_in->name, "<PrivateImplementationDetails>") == klass->nested_in->name)) {
                        add_method (acfg, mono_marshal_get_struct_to_ptr (klass));
                        add_method (acfg, mono_marshal_get_ptr_to_struct (klass));
@@ -4280,8 +4328,8 @@ has_type_vars (MonoClass *klass)
                return TRUE;
        if (klass->rank)
                return has_type_vars (klass->element_class);
-       if (klass->generic_class) {
-               MonoGenericContext *context = &klass->generic_class->context;
+       if (mono_class_is_ginst (klass)) {
+               MonoGenericContext *context = &mono_class_get_generic_class (klass)->context;
                if (context->class_inst) {
                        int i;
 
@@ -4290,7 +4338,7 @@ has_type_vars (MonoClass *klass)
                                        return TRUE;
                }
        }
-       if (klass->generic_container)
+       if (mono_class_is_gtd (klass))
                return TRUE;
        return FALSE;
 }
@@ -4400,13 +4448,13 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
 
        mono_class_init (klass);
 
-       if (klass->generic_class && klass->generic_class->context.class_inst->is_open)
+       if (mono_class_is_ginst (klass) && mono_class_get_generic_class (klass)->context.class_inst->is_open)
                return;
 
        if (has_type_vars (klass))
                return;
 
-       if (!klass->generic_class && !klass->rank)
+       if (!mono_class_is_ginst (klass) && !klass->rank)
                return;
 
        if (mono_class_has_failure (klass))
@@ -4430,7 +4478,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
         * Use gsharedvt for generic collections with vtype arguments to avoid code blowup.
         * Enable this only for some classes since gsharedvt might not support all methods.
         */
-       if ((acfg->opts & MONO_OPT_GSHAREDVT) && klass->image == mono_defaults.corlib && klass->generic_class && klass->generic_class->context.class_inst && is_vt_inst (klass->generic_class->context.class_inst) &&
+       if ((acfg->opts & MONO_OPT_GSHAREDVT) && klass->image == mono_defaults.corlib && mono_class_is_ginst (klass) && mono_class_get_generic_class (klass)->context.class_inst && is_vt_inst (mono_class_get_generic_class (klass)->context.class_inst) &&
                (!strcmp (klass->name, "Dictionary`2") || !strcmp (klass->name, "List`1") || !strcmp (klass->name, "ReadOnlyCollection`1")))
                use_gsharedvt = TRUE;
 
@@ -4487,7 +4535,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
         */
        if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") &&
                (!strcmp(klass->name, "ICollection`1") || !strcmp (klass->name, "IEnumerable`1") || !strcmp (klass->name, "IList`1") || !strcmp (klass->name, "IEnumerator`1") || !strcmp (klass->name, "IReadOnlyList`1"))) {
-               MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+               MonoClass *tclass = mono_class_from_mono_type (mono_class_get_generic_class (klass)->context.class_inst->type_argv [0]);
                MonoClass *array_class = mono_bounded_array_class_get (tclass, 1, FALSE);
                gpointer iter;
                char *name_prefix;
@@ -4508,7 +4556,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
                                        break;
                        }
                        g_assert (nclass);
-                       nclass = mono_class_inflate_generic_class_checked (nclass, mono_generic_class_get_context (klass->generic_class), &error);
+                       nclass = mono_class_inflate_generic_class_checked (nclass, mono_generic_class_get_context (mono_class_get_generic_class (klass)), &error);
                        mono_error_assert_ok (&error); /* FIXME don't swallow the error */
                        add_generic_class (acfg, nclass, FALSE, "ICollection<T>");
                }
@@ -4528,7 +4576,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
        /* Add an instance of GenericComparer<T> which is created dynamically by Comparer<T> */
        if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "Comparer`1")) {
                MonoError error;
-               MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+               MonoClass *tclass = mono_class_from_mono_type (mono_class_get_generic_class (klass)->context.class_inst->type_argv [0]);
                MonoClass *icomparable, *gcomparer, *icomparable_inst;
                MonoGenericContext ctx;
                MonoType *args [16];
@@ -4556,7 +4604,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
        /* Add an instance of GenericEqualityComparer<T> which is created dynamically by EqualityComparer<T> */
        if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "EqualityComparer`1")) {
                MonoError error;
-               MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+               MonoClass *tclass = mono_class_from_mono_type (mono_class_get_generic_class (klass)->context.class_inst->type_argv [0]);
                MonoClass *iface, *gcomparer, *iface_inst;
                MonoGenericContext ctx;
                MonoType *args [16];
@@ -4585,7 +4633,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
        /* Add an instance of EnumComparer<T> which is created dynamically by EqualityComparer<T> for enums */
        if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "EqualityComparer`1")) {
                MonoClass *enum_comparer;
-               MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+               MonoClass *tclass = mono_class_from_mono_type (mono_class_get_generic_class (klass)->context.class_inst->type_argv [0]);
                MonoGenericContext ctx;
                MonoType *args [16];
 
@@ -4607,7 +4655,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
        /* Add an instance of ObjectComparer<T> which is created dynamically by Comparer<T> for enums */
        if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "Comparer`1")) {
                MonoClass *comparer;
-               MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+               MonoClass *tclass = mono_class_from_mono_type (mono_class_get_generic_class (klass)->context.class_inst->type_argv [0]);
                MonoGenericContext ctx;
                MonoType *args [16];
 
@@ -4783,7 +4831,7 @@ add_generic_instances (MonoAotCompile *acfg)
                                g_free (type_argv);
                        }
 
-                       if (method->is_generic || method->klass->generic_container)
+                       if (method->is_generic || mono_class_is_gtd (method->klass))
                                declaring_method = method;
                        else
                                declaring_method = mono_method_get_declaring_generic_method (method);
@@ -5002,7 +5050,7 @@ is_direct_callable (MonoAotCompile *acfg, MonoMethod *method, MonoJumpInfo *patc
                if (callee_cfg) {
                        gboolean direct_callable = TRUE;
 
-                       if (direct_callable && !(!callee_cfg->has_got_slots && (callee_cfg->method->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT)))
+                       if (direct_callable && !(!callee_cfg->has_got_slots && mono_class_is_before_field_init (callee_cfg->method->klass)))
                                direct_callable = FALSE;
                        if ((callee_cfg->method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) && (!method || method->wrapper_type != MONO_WRAPPER_SYNCHRONIZED))
                                // FIXME: Maybe call the wrapper directly ?
@@ -5798,6 +5846,7 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint
                encode_method_ref (acfg, patch_info->data.virt_method->method, p, &p);
                break;
        case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
+       case MONO_PATCH_INFO_GET_TLS_TRAMP:
                break;
        default:
                g_warning ("unable to handle jump info %d", patch_info->type);
@@ -6261,11 +6310,11 @@ emit_klass_info (MonoAotCompile *acfg, guint32 token)
 
        mono_class_has_finalizer (klass);
 
-       if (klass->generic_container || cant_encode) {
+       if (mono_class_is_gtd (klass) || cant_encode) {
                encode_value (-1, p, &p);
        } else {
                encode_value (klass->vtable_size, p, &p);
-               encode_value ((klass->generic_container ? (1 << 8) : 0) | (no_special_static << 7) | (klass->has_static_refs << 6) | (klass->has_references << 5) | ((klass->blittable << 4) | ((klass->ext && klass->ext->nested_classes) ? 1 : 0) << 3) | (klass->has_cctor << 2) | (klass->has_finalize << 1) | klass->ghcimpl, p, &p);
+               encode_value ((mono_class_is_gtd (klass) ? (1 << 8) : 0) | (no_special_static << 7) | (klass->has_static_refs << 6) | (klass->has_references << 5) | ((klass->blittable << 4) | ((mono_class_get_ext (klass) && mono_class_get_ext (klass)->nested_classes) ? 1 : 0) << 3) | (klass->has_cctor << 2) | (klass->has_finalize << 1) | klass->ghcimpl, p, &p);
                if (klass->has_cctor)
                        encode_method_ref (acfg, mono_class_get_cctor (klass), p, &p);
                if (klass->has_finalize)
@@ -7318,7 +7367,7 @@ is_concrete_type (MonoType *t)
                if (!MONO_TYPE_ISSTRUCT (t))
                        return TRUE;
                klass = mono_class_from_mono_type (t);
-               orig_ctx = &klass->generic_class->context;
+               orig_ctx = &mono_class_get_generic_class (klass)->context;
 
                inst = orig_ctx->class_inst;
                if (inst) {
@@ -7455,7 +7504,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
        InterlockedIncrement (&acfg->stats.mcount);
 
 #if 0
-       if (method->is_generic || method->klass->generic_container) {
+       if (method->is_generic || mono_class_is_gtd (method->klass)) {
                InterlockedIncrement (&acfg->stats.genericcount);
                return;
        }
@@ -7478,6 +7527,8 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
                flags = (JitFlags)(flags | JIT_FLAG_LLVM_ONLY | JIT_FLAG_EXPLICIT_NULL_CHECKS);
        if (acfg->aot_opts.no_direct_calls)
                flags = (JitFlags)(flags | JIT_FLAG_NO_DIRECT_ICALLS);
+       if (acfg->aot_opts.direct_pinvoke)
+               flags = (JitFlags)(flags | JIT_FLAG_DIRECT_PINVOKE);
 
        jit_timer = mono_time_track_start ();
        cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0, index);
@@ -7634,7 +7685,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
                        case MONO_PATCH_INFO_VTABLE: {
                                MonoClass *klass = patch_info->data.klass;
 
-                               if (klass->generic_class && !mini_class_is_generic_sharable (klass))
+                               if (mono_class_is_ginst (klass) && !mini_class_is_generic_sharable (klass))
                                        add_generic_class_with_depth (acfg, klass, depth + 5, "vtable");
                                break;
                        }
@@ -7642,7 +7693,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
                                MonoClass *klass = patch_info->data.field->parent;
 
                                /* The .cctor needs to run at runtime. */
-                               if (klass->generic_class && !mono_generic_context_is_sharable_full (&klass->generic_class->context, FALSE, FALSE) && mono_class_get_cctor (klass))
+                               if (mono_class_is_ginst (klass) && !mono_generic_context_is_sharable_full (&mono_class_get_generic_class (klass)->context, FALSE, FALSE) && mono_class_get_cctor (klass))
                                        add_extra_method_with_depth (acfg, mono_class_get_cctor (klass), depth + 1);
                                break;
                        }
@@ -7782,7 +7833,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
        InterlockedIncrement (&acfg->stats.ccount);
 }
  
-static gsize WINAPI
+static mono_thread_start_return_t WINAPI
 compile_thread_main (gpointer user_data)
 {
        MonoDomain *domain = ((MonoDomain **)user_data) [0];
@@ -8181,20 +8232,20 @@ mono_aot_patch_info_dup (MonoJumpInfo* ji)
 static int
 execute_system (const char * command)
 {
-       int status;
+       int status = 0;
 
-#if _WIN32
+#if HOST_WIN32
        // We need an extra set of quotes around the whole command to properly handle commands 
        // with spaces since internally the command is called through "cmd /c.
-       command = g_strdup_printf ("\"%s\"", command);
+       char * quoted_command = g_strdup_printf ("\"%s\"", command);
 
-       int size =  MultiByteToWideChar (CP_UTF8, 0 , command , -1, NULL , 0);
+       int size =  MultiByteToWideChar (CP_UTF8, 0 , quoted_command , -1, NULL , 0);
        wchar_t* wstr = g_malloc (sizeof (wchar_t) * size);
-       MultiByteToWideChar (CP_UTF8, 0, command, -1, wstr , size);
+       MultiByteToWideChar (CP_UTF8, 0, quoted_command, -1, wstr , size);
        status = _wsystem (wstr);
        g_free (wstr);
 
-       g_free (command);
+       g_free (quoted_command);
 #elif defined (HAVE_SYSTEM)
        status = system (command);
 #else
@@ -8447,7 +8498,8 @@ emit_code (MonoAotCompile *acfg)
        emit_section_change (acfg, ".text", 1);
        emit_alignment_code (acfg, 8);
        emit_info_symbol (acfg, symbol);
-       emit_local_symbol (acfg, symbol, "method_addresses_end", TRUE);
+       if (acfg->aot_opts.write_symbols)
+               emit_local_symbol (acfg, symbol, "method_addresses_end", TRUE);
        emit_unset_mode (acfg);
        if (acfg->need_no_dead_strip)
                fprintf (acfg->fp, "    .no_dead_strip %s\n", symbol);
@@ -8619,8 +8671,8 @@ mono_aot_method_hash (MonoMethod *method)
 
        sig = mono_method_signature (method);
 
-       if (method->klass->generic_class)
-               class_ginst = method->klass->generic_class->context.class_inst;
+       if (mono_class_is_ginst (method->klass))
+               class_ginst = mono_class_get_generic_class (method->klass)->context.class_inst;
        if (method->is_inflated)
                ginst = ((MonoMethodInflated*)method)->context.method_inst;
 
@@ -8637,8 +8689,8 @@ mono_aot_method_hash (MonoMethod *method)
        if (!method->wrapper_type) {
                char *full_name;
 
-               if (klass->generic_class)
-                       full_name = mono_type_full_name (&klass->generic_class->container_class->byval_arg);
+               if (mono_class_is_ginst (klass))
+                       full_name = mono_type_full_name (&mono_class_get_generic_class (klass)->container_class->byval_arg);
                else
                        full_name = mono_type_full_name (&klass->byval_arg);
 
@@ -8895,13 +8947,13 @@ emit_extra_methods (MonoAotCompile *acfg)
 static void
 generate_aotid (guint8* aotid)
 {
-       gpointer *rand_handle;
+       gpointer rand_handle;
        MonoError error;
 
        mono_rand_open ();
        rand_handle = mono_rand_init (NULL, 0);
 
-       mono_rand_try_get_bytes (rand_handle, aotid, 16, &error);
+       mono_rand_try_get_bytes (&rand_handle, aotid, 16, &error);
        mono_error_assert_ok (&error);
 
        mono_rand_close (rand_handle);
@@ -9242,7 +9294,8 @@ emit_got (MonoAotCompile *acfg)
 #else
        emit_section_change (acfg, ".bss", 0);
        emit_alignment (acfg, 8);
-       emit_local_symbol (acfg, symbol, "got_end", FALSE);
+       if (acfg->aot_opts.write_symbols)
+               emit_local_symbol (acfg, symbol, "got_end", FALSE);
        emit_label (acfg, symbol);
        if (acfg->llvm)
                emit_info_symbol (acfg, "jit_got");
@@ -9259,6 +9312,53 @@ typedef struct GlobalsTableEntry {
        struct GlobalsTableEntry *next;
 } GlobalsTableEntry;
 
+#ifdef TARGET_WIN32_MSVC
+#define DLL_ENTRY_POINT "DllMain"
+
+static void
+emit_library_info (MonoAotCompile *acfg)
+{
+       // Only include for shared libraries linked directly from generated object.
+       if (link_shared_library (acfg)) {
+               char    *name = NULL;
+               char    symbol [MAX_SYMBOL_SIZE];
+
+               // Ask linker to export all global symbols.
+               emit_section_change (acfg, ".drectve", 0);
+               for (guint i = 0; i < acfg->globals->len; ++i) {
+                       name = (char *)g_ptr_array_index (acfg->globals, i);
+                       g_assert (name != NULL);
+                       sprintf_s (symbol, MAX_SYMBOL_SIZE, " /EXPORT:%s", name);
+                       emit_string (acfg, symbol);
+               }
+
+               // Emit DLLMain function, needed by MSVC linker for DLL's.
+               // NOTE, DllMain should not go into exports above.
+               emit_section_change (acfg, ".text", 0);
+               emit_global (acfg, DLL_ENTRY_POINT, TRUE);
+               emit_label (acfg, DLL_ENTRY_POINT);
+
+               // Simple implementation of DLLMain, just returning TRUE.
+               // For more information about DLLMain: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682583(v=vs.85).aspx
+               fprintf (acfg->fp, "movl $1, %%eax\n");
+               fprintf (acfg->fp, "ret\n");
+
+               // Inform linker about our dll entry function.
+               emit_section_change (acfg, ".drectve", 0);
+               emit_string (acfg, "/ENTRY:" DLL_ENTRY_POINT);
+               return;
+       }
+}
+
+#else
+
+static inline void
+emit_library_info (MonoAotCompile *acfg)
+{
+       return;
+}
+#endif
+
 static void
 emit_globals (MonoAotCompile *acfg)
 {
@@ -9270,6 +9370,7 @@ emit_globals (MonoAotCompile *acfg)
 
        if (!acfg->aot_opts.static_link)
                return;
+
        if (acfg->aot_opts.llvm_only) {
                g_assert (acfg->globals->len == 0);
                return;
@@ -9735,7 +9836,7 @@ collect_methods (MonoAotCompile *acfg)
                }
                */
 
-               if (method->is_generic || method->klass->generic_container)
+               if (method->is_generic || mono_class_is_gtd (method->klass))
                        /* Compile the ref shared version instead */
                        method = mini_get_shared_method (method);
 
@@ -9756,7 +9857,7 @@ collect_methods (MonoAotCompile *acfg)
                method = mono_get_method_checked (acfg->image, token, NULL, NULL, &error);
                report_loader_error (acfg, &error, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
 
-               if (method->is_generic || method->klass->generic_container) {
+               if (method->is_generic || mono_class_is_gtd (method->klass)) {
                        MonoMethod *gshared;
 
                        gshared = mini_get_shared_method_full (method, TRUE, TRUE);
@@ -9780,7 +9881,7 @@ compile_methods (MonoAotCompile *acfg)
                GPtrArray *frag;
                int len, j;
                GPtrArray *threads;
-               HANDLE handle;
+               MonoThreadHandle *thread_handle;
                gpointer *user_data;
                MonoMethod **methods;
 
@@ -9813,13 +9914,13 @@ compile_methods (MonoAotCompile *acfg)
                        user_data [1] = acfg;
                        user_data [2] = frag;
                        
-                       handle = mono_threads_create_thread (compile_thread_main, (gpointer) user_data, 0, NULL);
-                       g_ptr_array_add (threads, handle);
+                       thread_handle = mono_threads_create_thread (compile_thread_main, (gpointer) user_data, NULL, NULL);
+                       g_ptr_array_add (threads, thread_handle);
                }
                g_free (methods);
 
                for (i = 0; i < threads->len; ++i) {
-                       WaitForSingleObjectEx (g_ptr_array_index (threads, i), INFINITE, FALSE);
+                       mono_thread_info_wait_one_handle (g_ptr_array_index (threads, i), INFINITE, FALSE);
                        mono_threads_close_thread_handle (g_ptr_array_index (threads, i));
                }
        } else {
@@ -9841,7 +9942,9 @@ compile_asm (MonoAotCompile *acfg)
        const char *tool_prefix = acfg->aot_opts.tool_prefix ? acfg->aot_opts.tool_prefix : "";
        char *ld_flags = acfg->aot_opts.ld_flags ? acfg->aot_opts.ld_flags : g_strdup("");
 
-#if defined(TARGET_AMD64) && !defined(TARGET_MACH)
+#ifdef TARGET_WIN32_MSVC
+#define AS_OPTIONS "-c -x assembler"
+#elif defined(TARGET_AMD64) && !defined(TARGET_MACH)
 #define AS_OPTIONS "--64"
 #elif defined(TARGET_POWERPC64)
 #define AS_OPTIONS "-a64 -mppc64"
@@ -9861,10 +9964,18 @@ compile_asm (MonoAotCompile *acfg)
 #endif
 #elif defined(TARGET_OSX)
 #define AS_NAME "clang"
+#elif defined(TARGET_WIN32_MSVC)
+#define AS_NAME "clang.exe"
 #else
 #define AS_NAME "as"
 #endif
 
+#ifdef TARGET_WIN32_MSVC
+#define AS_OBJECT_FILE_SUFFIX "obj"
+#else
+#define AS_OBJECT_FILE_SUFFIX "o"
+#endif
+
 #if defined(sparc)
 #define LD_NAME "ld"
 #define LD_OPTIONS "-shared -G"
@@ -9874,6 +9985,9 @@ compile_asm (MonoAotCompile *acfg)
 #elif defined(TARGET_AMD64) && defined(TARGET_MACH)
 #define LD_NAME "clang"
 #define LD_OPTIONS "--shared"
+#elif defined(TARGET_WIN32_MSVC)
+#define LD_NAME "link.exe"
+#define LD_OPTIONS "/DLL /MACHINE:X64 /NOLOGO"
 #elif defined(TARGET_WIN32) && !defined(TARGET_ANDROID)
 #define LD_NAME "gcc"
 #define LD_OPTIONS "-shared"
@@ -9904,9 +10018,9 @@ compile_asm (MonoAotCompile *acfg)
                if (acfg->aot_opts.outfile)
                        objfile = g_strdup_printf ("%s", acfg->aot_opts.outfile);
                else
-                       objfile = g_strdup_printf ("%s.o", acfg->image->name);
+                       objfile = g_strdup_printf ("%s." AS_OBJECT_FILE_SUFFIX, acfg->image->name);
        } else {
-               objfile = g_strdup_printf ("%s.o", acfg->tmpfname);
+               objfile = g_strdup_printf ("%s." AS_OBJECT_FILE_SUFFIX, acfg->tmpfname);
        }
 
 #ifdef TARGET_OSX
@@ -9963,21 +10077,26 @@ compile_asm (MonoAotCompile *acfg)
        if (acfg->aot_opts.llvm_only)
                ld_flags = g_strdup_printf ("%s %s", ld_flags, "-lstdc++");
 
-#ifdef LD_NAME
+#ifdef TARGET_WIN32_MSVC
+       g_assert (tmp_outfile_name != NULL);
+       g_assert (objfile != NULL);
+       command = g_strdup_printf ("\"%s%s\" %s %s /OUT:\"%s\" \"%s\"", tool_prefix, LD_NAME, LD_OPTIONS,
+               ld_flags, tmp_outfile_name, objfile);
+#elif defined(LD_NAME)
        command = g_strdup_printf ("%s%s %s -o %s %s %s %s", tool_prefix, LD_NAME, LD_OPTIONS,
                wrap_path (tmp_outfile_name), wrap_path (llvm_ofile),
-               wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
+               wrap_path (g_strdup_printf ("%s." AS_OBJECT_FILE_SUFFIX, acfg->tmpfname)), ld_flags);
 #else
        // Default (linux)
        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);
+                                                                  wrap_path (g_strdup_printf ("%s." AS_OBJECT_FILE_SUFFIX, acfg->tmpfname)), ld_flags);
        } else {
                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);
+                                                                         wrap_path (g_strdup_printf ("%s." AS_OBJECT_FILE_SUFFIX, acfg->tmpfname)), ld_flags);
 
                if (acfg->llvm) {
                        command = g_strdup_printf ("clang++ %s", args);
@@ -9986,7 +10105,6 @@ compile_asm (MonoAotCompile *acfg)
                }
                g_free (args);
        }
-
 #endif
        aot_printf (acfg, "Executing the native linker: %s\n", command);
        if (execute_system (command) != 0) {
@@ -10371,6 +10489,11 @@ add_preinit_got_slots (MonoAotCompile *acfg)
        get_got_offset (acfg, FALSE, ji);
        get_got_offset (acfg, TRUE, ji);
 
+       ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoJumpInfo));
+       ji->type = MONO_PATCH_INFO_GET_TLS_TRAMP;
+       get_got_offset (acfg, FALSE, ji);
+       get_got_offset (acfg, TRUE, ji);
+
        for (i = 0; i < sizeof (preinited_jit_icalls) / sizeof (char*); ++i) {
                ji = (MonoJumpInfo *)mono_mempool_alloc0 (acfg->mempool, sizeof (MonoAotCompile));
                ji->type = MONO_PATCH_INFO_INTERNAL_METHOD;
@@ -10427,38 +10550,27 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
        //acfg->aot_opts.print_skipped_methods = TRUE;
 
 #if !defined(MONO_ARCH_GSHAREDVT_SUPPORTED)
-       if (opts & MONO_OPT_GSHAREDVT) {
+       if (acfg->opts & MONO_OPT_GSHAREDVT) {
                aot_printerrf (acfg, "-O=gsharedvt not supported on this platform.\n");
                return 1;
        }
-#endif
-
-#if !defined(MONO_ARCH_GSHAREDVT_SUPPORTED)
-       if (!acfg->aot_opts.llvm_only && (opts & MONO_OPT_GSHAREDVT)) {
-               aot_printerrf (acfg, "-O=gsharedvt not supported on this platform.\n");
+       if (acfg->aot_opts.llvm_only) {
+               aot_printerrf (acfg, "--aot=llvmonly requires a runtime that supports gsharedvt.\n");
                return 1;
        }
+#else
+       if (acfg->aot_opts.llvm_only || mono_aot_mode_is_full (&acfg->aot_opts) || mono_aot_mode_is_hybrid (&acfg->aot_opts))
+               acfg->opts |= MONO_OPT_GSHAREDVT;
 #endif
 
+#if !defined(ENABLE_LLVM)
        if (acfg->aot_opts.llvm_only) {
-#ifndef MONO_ARCH_GSHAREDVT_SUPPORTED
-               aot_printerrf (acfg, "--aot=llvmonly requires a runtime that supports gsharedvt.\n");
-               return 1;
-#endif
-#ifndef ENABLE_LLVM
                aot_printerrf (acfg, "--aot=llvmonly requires a runtime compiled with llvm support.\n");
                return 1;
-#endif
-       }
-
-#if defined(MONO_ARCH_GSHAREDVT_SUPPORTED)
-       if (acfg->aot_opts.llvm_only || mono_aot_mode_is_full (&acfg->aot_opts) || mono_aot_mode_is_hybrid (&acfg->aot_opts)) {
-               acfg->opts |= MONO_OPT_GSHAREDVT;
-               opts |= MONO_OPT_GSHAREDVT;
        }
 #endif
 
-       if (opts & MONO_OPT_GSHAREDVT)
+       if (acfg->opts & MONO_OPT_GSHAREDVT)
                mono_set_generic_sharing_vt_supported (TRUE);
 
        aot_printf (acfg, "Mono Ahead of Time compiler - compiling assembly %s\n", image->name);
@@ -10510,7 +10622,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                mini_llvm_init ();
 
                if (acfg->aot_opts.asm_only && !acfg->aot_opts.llvm_outfile) {
-                       aot_printerrf (acfg, "Compiling with LLVM and the asm-only option requires the llvm-outputfile= option.");
+                       aot_printerrf (acfg, "Compiling with LLVM and the asm-only option requires the llvm-outfile= option.\n");
                        return 1;
                }
        }
@@ -10583,7 +10695,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
 
        acfg->method_index = 1;
 
-       if (mono_aot_mode_is_full (&acfg->aot_opts))
+       if (mono_aot_mode_is_full (&acfg->aot_opts) || mono_aot_mode_is_hybrid (&acfg->aot_opts))
                mono_set_partial_sharing_supported (TRUE);
 
        res = collect_methods (acfg);
@@ -10647,7 +10759,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                        acfg->tmpfname = g_strdup_printf ("%s", acfg->aot_opts.outfile);
                else
                        acfg->tmpfname = g_strdup_printf ("%s.s", acfg->image->name);
-                       acfg->fp = fopen (acfg->tmpfname, "w+");
+               acfg->fp = fopen (acfg->tmpfname, "w+");
        } else {
                int i = g_file_open_tmp ("mono_aot_XXXXXX", &acfg->tmpfname, NULL);
                acfg->fp = fdopen (i, "w+");
@@ -10685,6 +10797,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                acfg->gas_line_numbers = TRUE;
        }
 
+#ifdef EMIT_DWARF_INFO
        if ((!acfg->aot_opts.nodebug || acfg->aot_opts.dwarf_debug) && acfg->has_jitted_code) {
                if (acfg->aot_opts.dwarf_debug && !mono_debug_enabled ()) {
                        aot_printerrf (acfg, "The dwarf AOT option requires the --debug option.\n");
@@ -10692,6 +10805,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                }
                acfg->dwarf = mono_dwarf_writer_create (acfg->w, NULL, 0, !acfg->gas_line_numbers);
        }
+#endif /* EMIT_DWARF_INFO */
 
        if (acfg->w)
                mono_img_writer_emit_start (acfg->w);
@@ -10742,6 +10856,8 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
 
        emit_file_info (acfg);
 
+       emit_library_info (acfg);
+
        if (acfg->dwarf) {
                emit_dwarf_info (acfg);
                mono_dwarf_writer_close (acfg->dwarf);
index 0da4ad6168d75584271a6ed781aac682d494c79d..c531afce043a4dc4ed03e3dd3909e7585c437a78 100644 (file)
@@ -473,7 +473,7 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError
                gclass = decode_klass_ref (module, p, &p, error);
                if (!gclass)
                        return NULL;
-               g_assert (gclass->generic_container);
+               g_assert (mono_class_is_gtd (gclass));
 
                memset (&ctx, 0, sizeof (ctx));
                ctx.class_inst = decode_generic_inst (module, p, &p, error);
@@ -528,7 +528,7 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError
                                        if (!class_def)
                                                return NULL;
 
-                                       container = class_def->generic_container;
+                                       container = mono_class_try_get_generic_container (class_def); //FIXME is this a case for a try_get?
                                }
                        } else {
                                // We didn't decode is_method, so we have to infer it from type enum.
@@ -684,7 +684,7 @@ decode_type (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError *err
                gclass = decode_klass_ref (module, p, &p, error);
                if (!gclass)
                        goto fail;
-               g_assert (gclass->generic_container);
+               g_assert (mono_class_is_gtd (gclass));
 
                memset (&ctx, 0, sizeof (ctx));
                ctx.class_inst = decode_generic_inst (module, p, &p, error);
@@ -694,7 +694,7 @@ decode_type (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError *err
                if (!type)
                        goto fail;
                klass = mono_class_from_mono_type (type);
-               t->data.generic_class = klass->generic_class;
+               t->data.generic_class = mono_class_get_generic_class (klass);
                break;
        }
        case MONO_TYPE_ARRAY: {
@@ -1259,8 +1259,8 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
 
                memset (&ctx, 0, sizeof (ctx));
 
-               if (FALSE && klass->generic_class) {
-                       ctx.class_inst = klass->generic_class->context.class_inst;
+               if (FALSE && mono_class_is_ginst (klass)) {
+                       ctx.class_inst = mono_class_get_generic_class (klass)->context.class_inst;
                        ctx.method_inst = NULL;
  
                        ref->method = mono_class_inflate_generic_method_full_checked (ref->method, klass, &ctx, error);
@@ -2444,7 +2444,7 @@ mono_aot_get_cached_class_info (MonoClass *klass, MonoCachedClassInfo *res)
        guint8 *p;
        gboolean err;
 
-       if (klass->rank || !amodule)
+       if (klass->rank || !klass->type_token || !amodule)
                return FALSE;
 
        p = (guint8*)&amodule->blob [mono_aot_get_offset (amodule->class_info_offsets, mono_metadata_token_index (klass->type_token) - 1)];
@@ -3702,6 +3702,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin
                break;
        }
        case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
+       case MONO_PATCH_INFO_GET_TLS_TRAMP:
                break;
        case MONO_PATCH_INFO_AOT_JIT_INFO:
                ji->data.index = decode_value (p, &p);
@@ -4212,7 +4213,7 @@ init_method (MonoAotModule *amodule, guint32 method_index, MonoMethod *method, M
        gboolean inited_ok = TRUE;
        if (init_class)
                inited_ok = mono_runtime_class_init_full (mono_class_vtable (domain, init_class), error);
-       else if (from_plt && klass_to_run_ctor && !klass_to_run_ctor->generic_container)
+       else if (from_plt && klass_to_run_ctor && !mono_class_is_gtd (klass_to_run_ctor))
                inited_ok = mono_runtime_class_init_full (mono_class_vtable (domain, klass_to_run_ctor), error);
        if (!inited_ok)
                return FALSE;
@@ -4279,10 +4280,10 @@ mono_aot_init_gshared_method_mrgctx (gpointer aot_module, guint32 method_index,
        MonoGenericContext context = { NULL, NULL };
        MonoClass *klass = rgctx->class_vtable->klass;
 
-       if (klass->generic_class)
-               context.class_inst = klass->generic_class->context.class_inst;
-       else if (klass->generic_container)
-               context.class_inst = klass->generic_container->context.class_inst;
+       if (mono_class_is_ginst (klass))
+               context.class_inst = mono_class_get_generic_class (klass)->context.class_inst;
+       else if (mono_class_is_gtd (klass))
+               context.class_inst = mono_class_get_generic_container (klass)->context.class_inst;
        context.method_inst = rgctx->method_inst;
 
        init_llvmonly_method (amodule, method_index, NULL, rgctx->class_vtable->klass, &context);
index cab90f84d3de89b717e58beaf13e98419f440afa..1602b03d59aae4ef6d211d82ce75bf61f80b17b6 100644 (file)
@@ -8,10 +8,12 @@
  * Copyright 2011 Xamarin Inc.  http://www.xamarin.com
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
- #include "mini.h"
 
+#include "config.h"
+#include <mono/utils/mono-compiler.h>
 #ifndef DISABLE_JIT
+
+#include "mini.h"
 
 /*
  * Returns true if @bb is a basic block which falls through the next block.
@@ -1478,4 +1480,8 @@ mono_optimize_branches (MonoCompile *cfg)
        } while (changed && (niterations > 0));
 }
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (branch_opts);
+
+#endif /* !DISABLE_JIT */
index d786bbad8fcc36e2a293eb5670aabf76360f42b6..846e1cd51410471e354a30ca42333def627dc127 100644 (file)
@@ -45,7 +45,7 @@
 #
 # See the code in mini-x86.c for more details on how the specifiers are used.
 #
-tailcall: len:120 clob:c
+tailcall: len:124 clob:c
 memory_barrier: len:4
 nop: len:4
 relaxed_nop: len:4
index 9bfbb44647b784d6b4181dab24f7666c35d4a123..010694bdd3206d18a1ca755d7f6f92d7614a22cd 100644 (file)
@@ -71,6 +71,7 @@
 #include <mono/utils/mono-time.h>
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/networking.h>
+#include <mono/utils/mono-proclib.h>
 #include "debugger-agent.h"
 #include "mini.h"
 #include "seq-points.h"
@@ -668,7 +669,7 @@ static MonoGHashTable *tid_to_thread_obj;
 
 static MonoNativeThreadId debugger_thread_id;
 
-static HANDLE debugger_thread_handle;
+static MonoThreadHandle *debugger_thread_handle;
 
 static int log_level;
 
@@ -932,7 +933,7 @@ mono_debugger_agent_parse_options (char *options)
                /* Waiting for deferred attachment */
                agent_config.defer = TRUE;
                if (agent_config.address == NULL) {
-                       agent_config.address = g_strdup_printf ("0.0.0.0:%u", 56000 + (getpid () % 1000));
+                       agent_config.address = g_strdup_printf ("0.0.0.0:%u", 56000 + (mono_process_current_pid () % 1000));
                }
        }
 
@@ -1628,7 +1629,7 @@ stop_debugger_thread (void)
 static void
 start_debugger_thread (void)
 {
-       debugger_thread_handle = mono_threads_create_thread (debugger_thread, NULL, 0, NULL);
+       debugger_thread_handle = mono_threads_create_thread (debugger_thread, NULL, NULL, NULL);
        g_assert (debugger_thread_handle);
 }
 
@@ -5394,7 +5395,10 @@ ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, StepFilte
        tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread);
        mono_loader_unlock ();
        g_assert (tls);
-       g_assert (tls->context.valid);
+       if (!tls->context.valid) {
+               DEBUG_PRINTF (1, "Received a single step request on a thread with no managed frames.");
+               return ERR_INVALID_ARGUMENT;
+       }
 
        if (tls->restore_state.valid && MONO_CONTEXT_GET_IP (&tls->context.ctx) != MONO_CONTEXT_GET_IP (&tls->restore_state.ctx)) {
                /*
@@ -6682,7 +6686,7 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
 
        if (!m->klass->valuetype && !(m->flags & METHOD_ATTRIBUTE_STATIC) && !this_arg) {
                if (!strcmp (m->name, ".ctor")) {
-                       if (m->klass->flags & TYPE_ATTRIBUTE_ABSTRACT)
+                       if (mono_class_is_abstract (m->klass))
                                return ERR_INVALID_ARGUMENT;
                        else {
                                MonoError error;
@@ -8035,7 +8039,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
                        buffer_add_id (buf, 0);
                buffer_add_int (buf, klass->type_token);
                buffer_add_byte (buf, klass->rank);
-               buffer_add_int (buf, klass->flags);
+               buffer_add_int (buf, mono_class_get_flags (klass));
                b = 0;
                type = &klass->byval_arg;
                // FIXME: Can't decide whenever a class represents a byref type
@@ -8049,9 +8053,9 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
                        b |= (1 << 3);
                if (klass->enumtype)
                        b |= (1 << 4);
-               if (klass->generic_container)
+               if (mono_class_is_gtd (klass))
                        b |= (1 << 5);
-               if (klass->generic_container || klass->generic_class)
+               if (mono_class_is_gtd (klass) || mono_class_is_ginst (klass))
                        b |= (1 << 6);
                buffer_add_byte (buf, b);
                nnested = 0;
@@ -8063,25 +8067,25 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint
                while ((nested = mono_class_get_nested_types (klass, &iter)))
                        buffer_add_typeid (buf, domain, nested);
                if (CHECK_PROTOCOL_VERSION (2, 12)) {
-                       if (klass->generic_container)
+                       if (mono_class_is_gtd (klass))
                                buffer_add_typeid (buf, domain, klass);
-                       else if (klass->generic_class)
-                               buffer_add_typeid (buf, domain, klass->generic_class->container_class);
+                       else if (mono_class_is_ginst (klass))
+                               buffer_add_typeid (buf, domain, mono_class_get_generic_class (klass)->container_class);
                        else
                                buffer_add_id (buf, 0);
                }
                if (CHECK_PROTOCOL_VERSION (2, 15)) {
                        int count, i;
 
-                       if (klass->generic_class) {
-                               MonoGenericInst *inst = klass->generic_class->context.class_inst;
+                       if (mono_class_is_ginst (klass)) {
+                               MonoGenericInst *inst = mono_class_get_generic_class (klass)->context.class_inst;
 
                                count = inst->type_argc;
                                buffer_add_int (buf, count);
                                for (i = 0; i < count; i++)
                                        buffer_add_typeid (buf, domain, mono_class_from_mono_type (inst->type_argv [i]));
-                       } else if (klass->generic_container) {
-                               MonoGenericContainer *container = klass->generic_container;
+                       } else if (mono_class_is_gtd (klass)) {
+                               MonoGenericContainer *container = mono_class_get_generic_container (klass);
                                MonoClass *pklass;
 
                                count = container->type_argc;
@@ -8910,7 +8914,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g
                }
                ginst = mono_metadata_get_generic_inst (type_argc, type_argv);
                g_free (type_argv);
-               tmp_context.class_inst = method->klass->generic_class ? method->klass->generic_class->context.class_inst : NULL;
+               tmp_context.class_inst = mono_class_is_ginst (method->klass) ? mono_class_get_generic_class (method->klass)->context.class_inst : NULL;
                tmp_context.method_inst = ginst;
 
                inflated = mono_class_inflate_generic_method_checked (method, &tmp_context, &error);
index a883e70ee8915fc5301082d289ab5e15c3a412d0..aaa34a3bc34fba472c49726be3bd70936bc4426a 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <mono/metadata/gc-internals.h>
 #include <mono/metadata/abi-details.h>
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_JIT
 
@@ -1968,4 +1969,8 @@ mono_local_emulate_ops (MonoCompile *cfg)
        }
 }
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (decompose);
+
+#endif /* !DISABLE_JIT */
index 6e06724a9f0ea42b1cdbde2ee17b88333099c2d2..7d0716dad90c909c3d68fd2f59b0f2af827ad276 100644 (file)
 #include <mono/metadata/gc-internals.h>
 #include <mono/metadata/coree.h>
 #include <mono/metadata/attach.h>
+#include <mono/metadata/w32process.h>
 #include "mono/utils/mono-counters.h"
 #include "mono/utils/mono-hwcap.h"
 #include "mono/utils/mono-logger-internals.h"
-#include "mono/utils/w32handle.h"
+#include "mono/metadata/w32handle.h"
 
 #include "mini.h"
 #include "jit.h"
@@ -934,7 +935,7 @@ compile_all_methods_thread_main_inner (CompileAllThreadArgs *args)
                    (method->flags & METHOD_ATTRIBUTE_ABSTRACT))
                        continue;
 
-               if (method->klass->generic_container)
+               if (mono_class_is_gtd (method->klass))
                        continue;
                sig = mono_method_signature (method);
                if (!sig) {
@@ -1274,6 +1275,7 @@ mini_usage (void)
 #ifdef HOST_WIN32
                "    --mixed-mode           Enable mixed-mode image support.\n"
 #endif
+               "    --handlers             Install custom handlers, use --help-handlers for details.\n"
          );
 }
 
@@ -1434,6 +1436,10 @@ mono_jit_parse_options (int argc, char * argv[])
                        
                        if (!mono_debugger_insert_breakpoint (argv [++i], FALSE))
                                fprintf (stderr, "Error: invalid method name '%s'\n", argv [i]);
+               } else if (strncmp (argv[i], "--gc-params=", 12) == 0) {
+                       mono_gc_params_set (argv[i] + 12);
+               } else if (strncmp (argv[i], "--gc-debug=", 11) == 0) {
+                       mono_gc_debug_set (argv[i] + 11);
                } else if (strcmp (argv [i], "--llvm") == 0) {
 #ifndef MONO_ARCH_LLVM_SUPPORTED
                        fprintf (stderr, "Mono Warning: --llvm not supported on this platform.\n");
@@ -1552,6 +1558,10 @@ switch_arch (char* argv[], const char* target_arch)
 }
 
 #endif
+
+#define MONO_HANDLERS_ARGUMENT "--handlers="
+#define MONO_HANDLERS_ARGUMENT_LEN G_N_ELEMENTS(MONO_HANDLERS_ARGUMENT)-1
+
 /**
  * mono_main:
  * @argc: number of arguments in the argv array
@@ -1679,6 +1689,10 @@ mono_main (int argc, char* argv[])
                        switch_gc (argv, "sgen");
                } else if (strcmp (argv [i], "--gc=boehm") == 0) {
                        switch_gc (argv, "boehm");
+               } else if (strncmp (argv[i], "--gc-params=", 12) == 0) {
+                       mono_gc_params_set (argv[i] + 12);
+               } else if (strncmp (argv[i], "--gc-debug=", 11) == 0) {
+                       mono_gc_debug_set (argv[i] + 11);
                }
 #ifdef TARGET_OSX
                else if (strcmp (argv [i], "--arch=32") == 0) {
@@ -1745,11 +1759,11 @@ mono_main (int argc, char* argv[])
                } else if (strcmp (argv [i], "--verify-all") == 0) {
                        mono_verifier_enable_verify_all ();
                } else if (strcmp (argv [i], "--full-aot") == 0) {
-                       mono_aot_only = TRUE;
+                       mono_jit_set_aot_mode (MONO_AOT_MODE_FULL);
                } else if (strcmp (argv [i], "--llvmonly") == 0) {
-                       mono_aot_only = TRUE;
-                       mono_llvm_only = TRUE;
+                       mono_jit_set_aot_mode (MONO_AOT_MODE_LLVMONLY);
                } else if (strcmp (argv [i], "--hybrid-aot") == 0) {
+                       mono_jit_set_aot_mode (MONO_AOT_MODE_HYBRID);
                } else if (strcmp (argv [i], "--print-vtable") == 0) {
                        mono_print_vtable = TRUE;
                } else if (strcmp (argv [i], "--stats") == 0) {
@@ -1900,6 +1914,15 @@ mono_main (int argc, char* argv[])
                } else if (strcmp (argv [i], "--nacl-null-checks-off") == 0){
                        nacl_null_checks_off = TRUE;
 #endif
+               } else if (strncmp (argv [i], MONO_HANDLERS_ARGUMENT, MONO_HANDLERS_ARGUMENT_LEN) == 0) {
+                       //Install specific custom handlers.
+                       if (!mono_runtime_install_custom_handlers (argv[i] + MONO_HANDLERS_ARGUMENT_LEN)) {
+                               fprintf (stderr, "error: " MONO_HANDLERS_ARGUMENT ", one or more unknown handlers: '%s'\n", argv [i]);
+                               return 1;
+                       }
+               } else if (strcmp (argv [i], "--help-handlers") == 0) {
+                       mono_runtime_install_custom_handlers_usage ();
+                       return 0;
                } else if (argv [i][0] == '-' && argv [i][1] == '-' && mini_parse_debug_option (argv [i] + 2)) {
                } else {
                        fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
@@ -1934,9 +1957,9 @@ mono_main (int argc, char* argv[])
        {
                char *runtime_path;
 
-               runtime_path = wapi_process_get_path (getpid ());
+               runtime_path = mono_w32process_get_path (getpid ());
                if (runtime_path) {
-                       wapi_process_set_cli_launcher (runtime_path);
+                       mono_w32process_set_cli_launcher (runtime_path);
                        g_free (runtime_path);
                }
        }
@@ -1972,12 +1995,6 @@ mono_main (int argc, char* argv[])
        /* Set rootdir before loading config */
        mono_set_rootdir ();
 
-       /*
-        * We only set the native name of the thread since MS.NET leaves the
-        * managed thread name for the main thread as null.
-        */
-       mono_native_thread_set_name (mono_native_thread_id_get (), "Main");
-
        if (enable_profile) {
                mono_profiler_load (profile_options);
                mono_profiler_thread_name (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ()), "Main");
@@ -2113,7 +2130,7 @@ mono_main (int argc, char* argv[])
                        exit (1);
                }
 
-#ifdef HOST_WIN32
+#if defined(HOST_WIN32) && G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
                /* Detach console when executing IMAGE_SUBSYSTEM_WINDOWS_GUI on win32 */
                if (!enable_debugging && !mono_compile_aot && ((MonoCLIImageInfo*)(mono_assembly_get_image (assembly)->image_info))->cli_header.nt.pe_subsys_required == IMAGE_SUBSYSTEM_WINDOWS_GUI)
                        FreeConsole ();
@@ -2304,11 +2321,21 @@ mono_jit_set_aot_only (gboolean val)
 void
 mono_jit_set_aot_mode (MonoAotMode mode)
 {
+       /* we don't want to set mono_aot_mode twice */
+       g_assert (mono_aot_mode == MONO_AOT_MODE_NONE);
        mono_aot_mode = mode;
+
        if (mono_aot_mode == MONO_AOT_MODE_LLVMONLY) {
                mono_aot_only = TRUE;
                mono_llvm_only = TRUE;
        }
+       if (mono_aot_mode == MONO_AOT_MODE_FULL) {
+               mono_aot_only = TRUE;
+       }
+       if (mono_aot_mode == MONO_AOT_MODE_HYBRID) {
+               mono_set_generic_sharing_vt_supported (TRUE);
+               mono_set_partial_sharing_supported (TRUE);
+       }
 }
 
 /**
index ad25f58728ec9c6a3de38dd253f4e0cecdb92c78..6c191d0b37ddd73527a2bc7a990cc95c964a19d8 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "config.h"
+#include <mono/utils/mono-compiler.h>
 
 #if !defined(DISABLE_AOT) && !defined(DISABLE_JIT)
 #include "dwarfwriter.h"
@@ -2002,4 +2003,9 @@ mono_dwarf_writer_emit_trampoline (MonoDwarfWriter *w, const char *tramp_name, c
        emit_fde (w, w->fde_index, start_symbol, end_symbol, code, code_size, unwind_info, FALSE);
        w->fde_index ++;
 }
+
+#else /* !defined(DISABLE_AOT) && !defined(DISABLE_JIT) */
+
+MONO_EMPTY_SOURCE_FILE (dwarfwriter);
+
 #endif /* End of: !defined(DISABLE_AOT) && !defined(DISABLE_JIT) */
index 919682acca6a9c5fb1d2d38456f16fabb01a9227..dbef0887519b5e12e85ba3320e952eef4a086c15 100644 (file)
@@ -152,6 +152,7 @@ void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler)
 
 #endif /* TARGET_WIN32 */
 
+#ifndef DISABLE_JIT
 /*
  * mono_arch_get_restore_context:
  *
@@ -285,6 +286,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 
        return start;
 }
+#endif /* !DISABLE_JIT */
 
 /* 
  * The first few arguments are dummy, to force the other arguments to be passed on
@@ -350,6 +352,7 @@ mono_amd64_resume_unwind (guint64 dummy1, guint64 dummy2, guint64 dummy3, guint6
        mono_resume_unwind (&ctx);
 }
 
+#ifndef DISABLE_JIT
 /*
  * get_throw_trampoline:
  *
@@ -496,6 +499,7 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)
 {
        return get_throw_trampoline (info, FALSE, TRUE, FALSE, FALSE, "throw_corlib_exception", aot);
 }
+#endif /* !DISABLE_JIT */
 
 /*
  * mono_arch_unwind_frame:
@@ -833,6 +837,7 @@ mono_amd64_get_original_ip (void)
        return lmf->rip;
 }
 
+#ifndef DISABLE_JIT
 GSList*
 mono_amd64_get_exception_trampolines (gboolean aot)
 {
@@ -851,6 +856,7 @@ mono_amd64_get_exception_trampolines (gboolean aot)
 
        return tramps;
 }
+#endif /* !DISABLE_JIT */
 
 void
 mono_arch_exceptions_init (void)
@@ -878,7 +884,7 @@ mono_arch_exceptions_init (void)
        }
 }
 
-#ifdef TARGET_WIN32
+#if defined(TARGET_WIN32) && !defined(DISABLE_JIT)
 
 /*
  * The mono_arch_unwindinfo* methods are used to build and add
@@ -1118,9 +1124,9 @@ mono_arch_unwindinfo_install_unwind_info (gpointer* monoui, gpointer code, guint
        RtlInstallFunctionTableCallback (((DWORD64)code) | 0x3, (DWORD64)code, code_size, MONO_GET_RUNTIME_FUNCTION_CALLBACK, code, NULL);
 }
 
-#endif
+#endif /* defined(TARGET_WIN32) !defined(DISABLE_JIT) */
 
-#if MONO_SUPPORT_TASKLETS
+#if MONO_SUPPORT_TASKLETS && !defined(DISABLE_JIT)
 MonoContinuationRestore
 mono_tasklets_arch_restore (void)
 {
@@ -1172,7 +1178,7 @@ mono_tasklets_arch_restore (void)
        saved = start;
        return (MonoContinuationRestore)saved;
 }
-#endif
+#endif /* MONO_SUPPORT_TASKLETS && !defined(DISABLE_JIT) */
 
 /*
  * mono_arch_setup_resume_sighandler_ctx:
@@ -1190,3 +1196,56 @@ mono_arch_setup_resume_sighandler_ctx (MonoContext *ctx, gpointer func)
                MONO_CONTEXT_SET_SP (ctx, (guint64)MONO_CONTEXT_GET_SP (ctx) - 8);
        MONO_CONTEXT_SET_IP (ctx, func);
 }
+
+#ifdef DISABLE_JIT
+gpointer
+mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+GSList*
+mono_amd64_get_exception_trampolines (gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+#endif /* DISABLE_JIT */
+
+#if !MONO_SUPPORT_TASKLETS || defined(DISABLE_JIT)
+MonoContinuationRestore
+mono_tasklets_arch_restore (void)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+#endif /* !MONO_SUPPORT_TASKLETS || defined(DISABLE_JIT) */
index fe210faa3a22ce14883bcad17c657328cf8bd746..9b7f762e9914a1512cbe5e6eacfa7a374e2b7a90 100644 (file)
@@ -29,15 +29,21 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
        MonoJumpInfo *ji = NULL;
        GSList *unwind_ops = NULL;
        int i, ctx_reg, size;
+       guint8 *labels [16];
 
        size = 256;
        code = start = mono_global_codeman_reserve (size);
 
        arm_movx (code, ARMREG_IP0, ARMREG_R0);
        ctx_reg = ARMREG_IP0;
+
        /* Restore fregs */
+       arm_ldrx (code, ARMREG_IP1, ctx_reg, MONO_STRUCT_OFFSET (MonoContext, has_fregs));
+       labels [0] = code;
+       arm_cbzx (code, ARMREG_IP1, 0);
        for (i = 0; i < 32; ++i)
                arm_ldrfpx (code, i, ctx_reg, MONO_STRUCT_OFFSET (MonoContext, fregs) + (i * 8));
+       mono_arm_patch (labels [0], code, MONO_R_ARM64_CBZ);
        /* Restore gregs */
        // FIXME: Restore less registers
        // FIXME: fp should be restored later
@@ -69,9 +75,10 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 {
        guint8 *code;
        guint8* start;
-       int size, offset, gregs_offset, fregs_offset, ctx_offset, num_fregs, frame_size;
+       int i, size, offset, gregs_offset, fregs_offset, ctx_offset, num_fregs, frame_size;
        MonoJumpInfo *ji = NULL;
        GSList *unwind_ops = NULL;
+       guint8 *labels [16];
 
        size = 512;
        start = code = mono_global_codeman_reserve (size);
@@ -105,10 +112,19 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        arm_strx (code, ARMREG_R0, ARMREG_FP, ctx_offset);
        /* Save gregs */
        code = mono_arm_emit_store_regarray (code, MONO_ARCH_CALLEE_SAVED_REGS | (1 << ARMREG_FP), ARMREG_FP, gregs_offset);
-       /* No need to save/restore fregs, since we don't currently use them */
+       /* Save fregs */
+       for (i = 0; i < num_fregs; ++i)
+               arm_strfpx (code, ARMREG_D8 + i, ARMREG_FP, fregs_offset + (i * 8));
 
        /* Load regs from ctx */
        code = mono_arm_emit_load_regarray (code, MONO_ARCH_CALLEE_SAVED_REGS, ARMREG_R0, MONO_STRUCT_OFFSET (MonoContext, regs));
+       /* Load fregs */
+       arm_ldrx (code, ARMREG_IP0, ARMREG_R0, MONO_STRUCT_OFFSET (MonoContext, has_fregs));
+       labels [0] = code;
+       arm_cbzx (code, ARMREG_IP0, 0);
+       for (i = 0; i < num_fregs; ++i)
+               arm_ldrfpx (code, ARMREG_D8 + i, ARMREG_R0, MONO_STRUCT_OFFSET (MonoContext, fregs) + (i * 8));
+       mono_arm_patch (labels [0], code, MONO_R_ARM64_CBZ);
        /* Load fp */
        arm_ldrx (code, ARMREG_FP, ARMREG_R0, MONO_STRUCT_OFFSET (MonoContext, regs) + (ARMREG_FP * 8));
 
@@ -126,6 +142,9 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 
        /* Restore regs */
        code = mono_arm_emit_load_regarray (code, MONO_ARCH_CALLEE_SAVED_REGS, ARMREG_FP, gregs_offset);
+       /* Restore fregs */
+       for (i = 0; i < num_fregs; ++i)
+               arm_ldrfpx (code, ARMREG_D8 + i, ARMREG_FP, fregs_offset + (i * 8));
        /* Destroy frame */
        code = mono_arm_emit_destroy_frame (code, frame_size, (1 << ARMREG_IP0));
        arm_retx (code, ARMREG_LR);
@@ -374,6 +393,7 @@ mono_arm_throw_exception (gpointer arg, mgreg_t pc, mgreg_t *int_regs, gdouble *
        memset (&ctx, 0, sizeof (MonoContext));
        memcpy (&(ctx.regs [0]), int_regs, sizeof (mgreg_t) * 32);
        memcpy (&(ctx.fregs [ARMREG_D8]), fp_regs, sizeof (double) * 8);
+       ctx.has_fregs = 1;
        ctx.pc = pc;
 
        if (mono_object_isinst_checked (exc, mono_defaults.exception_class, &error)) {
@@ -402,6 +422,7 @@ mono_arm_resume_unwind (gpointer arg, mgreg_t pc, mgreg_t *int_regs, gdouble *fp
        memset (&ctx, 0, sizeof (MonoContext));
        memcpy (&(ctx.regs [0]), int_regs, sizeof (mgreg_t) * 32);
        memcpy (&(ctx.fregs [ARMREG_D8]), fp_regs, sizeof (double) * 8);
+       ctx.has_fregs = 1;
        ctx.pc = pc;
 
        mono_resume_unwind (&ctx);
index 80a579b05eb87e539e3b1c344edf636991b4c667..684d2d9a469a757f36deb86e1d0702c018b23458 100644 (file)
@@ -697,6 +697,11 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
        }
 #else
        UCONTEXT_REG_NIP(uc) = (unsigned long)altstack_handle_and_restore;
+#if _CALL_ELF == 2
+       /* ELF v2 ABI calling convention requires to put the target address into
+       * r12 if we use the global entry point of a function. */
+       UCONTEXT_REG_Rn(uc, 12) = (unsigned long) altstack_handle_and_restore;
+#endif
 #endif
        UCONTEXT_REG_Rn(uc, 1) = (unsigned long)sp;
        UCONTEXT_REG_Rn(uc, PPC_FIRST_ARG_REG) = (unsigned long)(sp + 16);
@@ -739,6 +744,11 @@ setup_ucontext_return (void *uc, gpointer func)
        }
 #else
        UCONTEXT_REG_NIP(uc) = (unsigned long)func;
+#if _CALL_ELF == 2
+       /* ELF v2 ABI calling convention requires to put the target address into
+       * r12 if we use the global entry point of a function. */
+       UCONTEXT_REG_Rn(uc, 12) = (unsigned long) func;
+#endif
 #endif
 #endif
 }
index d737bc7f7f0768ab51457bf6008fda554de519d0..fe0957fa3f2a1a750ff8405a9b7e824a1c333c1e 100644 (file)
@@ -536,11 +536,11 @@ mono_x86_resume_unwind (mgreg_t *regs, MonoObject *exc,
 static guint8*
 get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolean corlib, gboolean llvm_abs, gboolean resume_unwind, MonoTrampInfo **info, gboolean aot)
 {
-       guint8 *start, *code;
+       guint8 *start, *code, *labels [16];
        int i, stack_size, stack_offset, arg_offsets [5], regs_offset;
        MonoJumpInfo *ji = NULL;
        GSList *unwind_ops = NULL;
-       guint kMaxCodeSize = 128;
+       guint kMaxCodeSize = 192;
 
        start = code = mono_global_codeman_reserve (kMaxCodeSize);
 
@@ -605,6 +605,18 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea
        x86_lea_membase (code, X86_EAX, X86_ESP, stack_offset);
        x86_mov_membase_reg (code, X86_ESP, regs_offset + (X86_ESP * 4), X86_EAX, 4);
 
+       /* Clear fp stack */
+       labels [0] = code;
+       x86_fnstsw (code);
+       x86_shift_reg_imm (code, X86_SHR, X86_EAX, 11);
+       x86_alu_reg_imm (code, X86_AND, X86_EAX, 7);
+       x86_alu_reg_imm (code, X86_CMP, X86_EAX, 0);
+       labels [1] = code;
+       x86_branch8 (code, X86_CC_EQ, 0, FALSE);
+       x86_fstp (code, 0);
+       x86_jump_code (code, labels [0]);
+       mono_x86_patch (labels [1], code);
+
        /* Set arg1 == regs */
        x86_lea_membase (code, X86_EAX, X86_ESP, regs_offset);
        x86_mov_membase_reg (code, X86_ESP, arg_offsets [0], X86_EAX, 4);
index 80638b5048e6edf80854c7509ee3b7d18292cd5c..018619449191a8cf24899b7d1cba6f55519a85d0 100644 (file)
@@ -1272,7 +1272,6 @@ class Tests
                c.throw_catch_t ();
                return 0;
        }
-
 }
 
 #if !__MOBILE__
index 08d2891f87c239c138f3d1e48284f3f8c8399aef..95e1fff2bb42a59abeb32870870b8c718163494f 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <config.h>
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_JIT
 
@@ -346,5 +347,9 @@ mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options)
 #endif
 }
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (graph);
+
+#endif /* !DISABLE_JIT */
 
index 88f8c2ebb22b780a3c461daf2d8b62e6370f3e68..65151b07024e8d1a2199d9b76119cd07be48c527 100644 (file)
@@ -1907,6 +1907,40 @@ public class Tests
                bool success = zz == 0xAAAAAAAAAAAAAAAA;
                return success ? 20 : 1;
        }
+
+       void gsharedvt_try_at_offset_0<T> (ref T disposable)
+               where T : class, IDisposable {
+                       try {
+                               disposable.Dispose ();
+                       } finally {
+                               disposable = null;
+                       }
+               }
+
+       [MethodImplAttribute (MethodImplOptions.NoInlining)]
+       static DateTimeOffset gsharedvt_vphi_inner<T> (T t) {
+               return DateTimeOffset.MinValue;
+       }
+
+       static DateTimeOffset gsharedvt_vphi<T> (T t) {
+               int[] arr = new int [10];
+
+               try {
+                       DateTimeOffset v;
+                       if (arr [0] == 0)
+                               v = gsharedvt_vphi_inner (t);
+                       else
+                               v = gsharedvt_vphi_inner (t);
+                       return v;
+               } catch {
+                       return DateTimeOffset.MinValue;
+               }
+       }
+
+       static int test_0_gsharedvt_vphi_volatile () {
+               gsharedvt_vphi (0);
+               return 0;
+       }
 }
 
 // #13191
index ab3bf8094a56e711648810e6ea8e7bfe3ea4c8dd..2e4619301d1b6ca24b81da6be81759e9fbef874b 100644 (file)
@@ -5,6 +5,7 @@
  *   Dietmar Maurer (dietmar@ximian.com)
  *   Zoltan Varga (vargaz@gmail.com)
  *   Paolo Molaro (lupus@ximian.com)
+ *   Johan Lorensson (lateralusx.github@gmail.com)
  *
  * (C) 2002 Ximian, Inc.
  */
@@ -88,6 +89,8 @@
 
 #if defined(TARGET_ASM_APPLE)
 #define AS_INT16_DIRECTIVE ".short"
+#elif defined(TARGET_ASM_GAS) && defined(TARGET_WIN32)
+#define AS_INT16_DIRECTIVE ".word"
 #elif defined(TARGET_ASM_GAS)
 #define AS_INT16_DIRECTIVE ".hword"
 #else
@@ -1735,8 +1738,45 @@ const char *get_label (const char *s)
        return s;
 }
 
+#ifdef TARGET_WIN32
+#define GLOBAL_SYMBOL_DEF_SCL 2
+#define LOCAL_SYMBOL_DEF_SCL 3
+
+static gboolean
+asm_writer_in_data_section (MonoImageWriter *acfg)
+{
+       gboolean        in_data_section = FALSE;
+       const char      *data_sections [] = {".data", ".bss", ".rdata"};
+
+       for (guchar i = 0; i < G_N_ELEMENTS (data_sections); ++i) {
+               if (strcmp (acfg->current_section, data_sections [i]) == 0) {
+                       in_data_section = TRUE;
+                       break;
+               }
+       }
+
+       return in_data_section;
+}
+
+static void
+asm_writer_emit_symbol_type (MonoImageWriter *acfg, const char *name, gboolean func, gboolean global)
+{
+       asm_writer_emit_unset_mode (acfg);
+
+       if (func) {
+               fprintf (acfg->fp, "\t.def %s; .scl %d; .type 32; .endef\n", name, (global == TRUE ? GLOBAL_SYMBOL_DEF_SCL : LOCAL_SYMBOL_DEF_SCL));
+       } else {
+               if (!asm_writer_in_data_section (acfg))
+                       fprintf (acfg->fp, "\t.data\n");
+       }
+
+       return;
+}
+
+#else
+
 static void
-asm_writer_emit_symbol_type (MonoImageWriter *acfg, const char *name, gboolean func)
+asm_writer_emit_symbol_type (MonoImageWriter *acfg, const char *name, gboolean func, gboolean global)
 {
        const char *stype;
 
@@ -1749,17 +1789,13 @@ asm_writer_emit_symbol_type (MonoImageWriter *acfg, const char *name, gboolean f
 
 #if defined(TARGET_ASM_APPLE)
 
-#elif defined(TARGET_WIN32)
-       if (func)
-               fprintf (acfg->fp, "\t.def %s; .scl 2; .type 32; .endef\n", name);
-       else
-               fprintf (acfg->fp, "\t.data\n");
 #elif defined(TARGET_ARM)
        fprintf (acfg->fp, "\t.type %s,#%s\n", name, stype);
 #else
        fprintf (acfg->fp, "\t.type %s,@%s\n", name, stype);
 #endif
 }
+#endif /* TARGET_WIN32 */
 
 static void
 asm_writer_emit_global (MonoImageWriter *acfg, const char *name, gboolean func)
@@ -1768,7 +1804,7 @@ asm_writer_emit_global (MonoImageWriter *acfg, const char *name, gboolean func)
 
        fprintf (acfg->fp, "\t.globl %s\n", name);
 
-       asm_writer_emit_symbol_type (acfg, name, func);
+       asm_writer_emit_symbol_type (acfg, name, func, TRUE);
 }
 
 static void
@@ -1780,7 +1816,7 @@ asm_writer_emit_local_symbol (MonoImageWriter *acfg, const char *name, const cha
        fprintf (acfg->fp, "\t.local %s\n", name);
 #endif
 
-       asm_writer_emit_symbol_type (acfg, name, func);
+       asm_writer_emit_symbol_type (acfg, name, func, FALSE);
 }
 
 static void
index bb9c73c0400956edce182fcea82cc2887e726cd9..225b9f3b2364fb861618fb8f1b94a6f32a6ea0c8 100644 (file)
@@ -72,10 +72,10 @@ ldvirtfn_internal (MonoObject *obj, MonoMethod *method, gboolean gshared)
        if (gshared && method->is_inflated && mono_method_get_context (method)->method_inst) {
                MonoGenericContext context = { NULL, NULL };
 
-               if (res->klass->generic_class)
-                       context.class_inst = res->klass->generic_class->context.class_inst;
-               else if (res->klass->generic_container)
-                       context.class_inst = res->klass->generic_container->context.class_inst;
+               if (mono_class_is_ginst (res->klass))
+                       context.class_inst = mono_class_get_generic_class (res->klass)->context.class_inst;
+               else if (mono_class_is_gtd (res->klass))
+                       context.class_inst = mono_class_get_generic_container (res->klass)->context.class_inst;
                context.method_inst = mono_method_get_context (method)->method_inst;
 
                res = mono_class_inflate_generic_method_checked (res, &context, &error);
@@ -1108,8 +1108,8 @@ mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointe
                return NULL;
        }
        vmethod = mono_object_get_virtual_method (obj, method);
-       g_assert (!vmethod->klass->generic_container);
-       g_assert (!vmethod->klass->generic_class || !vmethod->klass->generic_class->context.class_inst->is_open);
+       g_assert (!mono_class_is_gtd (vmethod->klass));
+       g_assert (!mono_class_is_ginst (vmethod->klass) || !mono_class_get_generic_class (vmethod->klass)->context.class_inst->is_open);
        g_assert (!context->method_inst || !context->method_inst->is_open);
 
        addr = mono_compile_method_checked (vmethod, &error);
@@ -1334,7 +1334,7 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k
 
        mono_error_init (error);
 
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (klass)) {
                MonoObject *this_obj;
 
                /* Have to use the receiver's type instead of klass, the receiver is a ref type */
@@ -1352,7 +1352,7 @@ constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k
                mono_class_setup_vtable (klass);
                g_assert (klass->vtable);
                vt_slot = mono_method_get_vtable_slot (cmethod);
-               if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+               if (mono_class_is_interface (cmethod->klass)) {
                        iface_offset = mono_class_interface_offset (klass, cmethod->klass);
                        g_assert (iface_offset != -1);
                        vt_slot += iface_offset;
@@ -1608,10 +1608,10 @@ resolve_vcall (MonoVTable *vt, int slot, MonoMethod *imt_method, gpointer *out_a
                else
                        declaring = m;
 
-               if (m->klass->generic_class)
-                       context.class_inst = m->klass->generic_class->context.class_inst;
+               if (mono_class_is_ginst (m->klass))
+                       context.class_inst = mono_class_get_generic_class (m->klass)->context.class_inst;
                else
-                       g_assert (!m->klass->generic_container);
+                       g_assert (!mono_class_is_gtd (m->klass));
 
                generic_virtual = imt_method;
                g_assert (generic_virtual);
@@ -1692,10 +1692,10 @@ mono_resolve_generic_virtual_call (MonoVTable *vt, int slot, MonoMethod *generic
        else
                declaring = m;
 
-       if (m->klass->generic_class)
-               context.class_inst = m->klass->generic_class->context.class_inst;
+       if (mono_class_is_ginst (m->klass))
+               context.class_inst = mono_class_get_generic_class (m->klass)->context.class_inst;
        else
-               g_assert (!m->klass->generic_container);
+               g_assert (!mono_class_is_gtd (m->klass));
 
        g_assert (generic_virtual->is_inflated);
        context.method_inst = ((MonoMethodInflated*)generic_virtual)->context.method_inst;
index 287022daad738c08857273cf5d686eb060edc1eb..faadc048ec98457f870f771ca0e919c1f03b7b0d 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "mini.h"
 #include <mono/metadata/debug-helpers.h>
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_JIT
 
@@ -512,4 +513,8 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m
        g_list_free (inactive);
 }
 
-#endif /* #ifndef DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (linear_scan);
+
+#endif /* !DISABLE_JIT */
index c897893074057b178071b619e5420ae7a36b5b6e..7cc05634123e8b4a78b0d5f3c007578e563b3c1c 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <config.h>
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_JIT
 
@@ -1158,4 +1159,8 @@ mono_analyze_liveness_gc (MonoCompile *cfg)
        g_free (vreg_to_varinfo);
 }
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (liveness);
+
+#endif /* !DISABLE_JIT */
index 04373359fb46ead9bc1ea8d96249d33ee4c15948..647d787dafcf4f72f315faf2eafa4b9e5a790c31 100644 (file)
@@ -14,6 +14,8 @@
  */
 
 #include <config.h>
+#include <mono/utils/mono-compiler.h>
+
 #ifndef DISABLE_JIT
 
 #include <string.h>
@@ -171,6 +173,8 @@ mono_strength_reduction_division (MonoCompile *cfg, MonoInst *ins)
                                ins->inst_imm = power2;
                                break;
                        }
+                       if (cfg->backend->disable_div_with_mul)
+                               break;
                        allocated_vregs = TRUE;
                        /*
                         * Replacement of unsigned division with multiplication,
@@ -243,6 +247,8 @@ mono_strength_reduction_division (MonoCompile *cfg, MonoInst *ins)
                                break;
                        }
 
+                       if (cfg->backend->disable_div_with_mul)
+                               break;
                        /*
                         * Replacement of signed division with multiplication,
                         * shifts and additions Hacker's Delight, chapter 10-6.
@@ -998,4 +1004,8 @@ mono_local_deadce (MonoCompile *cfg)
        //mono_print_code (cfg, "AFTER LOCAL-DEADCE");
 }
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (local_propagation);
+
+#endif /* !DISABLE_JIT */
index 8d73080631e424bf475d8bab179cde569b069fa9..80044897a83e48a34caee27a8aa05d1a92e74edc 100644 (file)
@@ -280,9 +280,10 @@ probe_embedded (const char *program, int *ref_argc, char **ref_argv [])
 
        mono_register_bundled_assemblies ((const MonoBundledAssembly **) assemblies->data);
        new_argv = g_new (char *, (*ref_argc)+1);
-       for (j = 0; j < *ref_argc; j++)
-               new_argv [j] = (*ref_argv)[j];
-       new_argv [j] = entry_point;
+       new_argv [0] = (*ref_argv)[0];
+       new_argv [1] = entry_point;
+       for (j = 1; j < *ref_argc; j++)
+               new_argv [j+1] = (*ref_argv)[j];
        *ref_argv = new_argv;
        (*ref_argc)++;
        
index 95b0002ea9136a17b83300f6f8e8f173bc2418cf..de0e58ab1799364ea5c1c77f129066f37d9835c1 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <config.h>
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_JIT
 
@@ -1657,7 +1658,7 @@ mini_emit_max_iid_check_vtable (MonoCompile *cfg, int vtable_reg, MonoClass *kla
 {
        int max_iid_reg = alloc_preg (cfg);
                
-       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU2_MEMBASE, max_iid_reg, vtable_reg, MONO_STRUCT_OFFSET (MonoVTable, max_interface_id));
+       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU4_MEMBASE, max_iid_reg, vtable_reg, MONO_STRUCT_OFFSET (MonoVTable, max_interface_id));
        mini_emit_max_iid_check (cfg, max_iid_reg, klass, false_target);
 }
 
@@ -1668,7 +1669,7 @@ mini_emit_max_iid_check_class (MonoCompile *cfg, int klass_reg, MonoClass *klass
 {
        int max_iid_reg = alloc_preg (cfg);
 
-       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU2_MEMBASE, max_iid_reg, klass_reg, MONO_STRUCT_OFFSET (MonoClass, max_interface_id));
+       MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU4_MEMBASE, max_iid_reg, klass_reg, MONO_STRUCT_OFFSET (MonoClass, max_interface_id));
        mini_emit_max_iid_check (cfg, max_iid_reg, klass, false_target);
 }
 
@@ -1794,7 +1795,7 @@ mini_emit_castclass_inst (MonoCompile *cfg, int obj_reg, int klass_reg, MonoClas
                        mini_emit_class_check (cfg, eclass_reg, mono_defaults.enum_class);
                } else if (klass->cast_class == mono_defaults.enum_class) {
                        mini_emit_class_check (cfg, eclass_reg, mono_defaults.enum_class);
-               } else if (klass->cast_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+               } else if (mono_class_is_interface (klass->cast_class)) {
                        mini_emit_iface_class_cast (cfg, eclass_reg, klass->cast_class, NULL, NULL);
                } else {
                        // Pass -1 as obj_reg to skip the check below for arrays of arrays
@@ -2550,7 +2551,7 @@ check_method_sharing (MonoCompile *cfg, MonoMethod *cmethod, gboolean *out_pass_
        gboolean pass_mrgctx = FALSE;
 
        if (((cmethod->flags & METHOD_ATTRIBUTE_STATIC) || cmethod->klass->valuetype) &&
-               (cmethod->klass->generic_class || cmethod->klass->generic_container)) {
+               (mono_class_is_ginst (cmethod->klass) || mono_class_is_gtd (cmethod->klass))) {
                gboolean sharable = FALSE;
 
                if (mono_method_is_generic_sharable_full (cmethod, TRUE, TRUE, TRUE))
@@ -2791,7 +2792,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
        if (!sig)
                sig = mono_method_signature (method);
 
-       if (cfg->llvm_only && (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE))
+       if (cfg->llvm_only && (mono_class_is_interface (method->klass)))
                g_assert_not_reached ();
 
        if (rgctx_arg) {
@@ -2829,7 +2830,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
        if (cfg->llvm_only && !call_target && virtual_ && (method->flags & METHOD_ATTRIBUTE_VIRTUAL))
                return emit_llvmonly_virtual_call (cfg, method, sig, 0, args);
 
-       need_unbox_trampoline = method->klass == mono_defaults.object_class || (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE);
+       need_unbox_trampoline = method->klass == mono_defaults.object_class || mono_class_is_interface (method->klass);
 
        call = mono_emit_call_args (cfg, sig, args, FALSE, virtual_, tail, rgctx_arg ? TRUE : FALSE, need_unbox_trampoline);
 
@@ -2918,7 +2919,7 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
                } else {
                        vtable_reg = alloc_preg (cfg);
                        MONO_EMIT_NEW_LOAD_MEMBASE_FAULT (cfg, vtable_reg, this_reg, MONO_STRUCT_OFFSET (MonoObject, vtable));
-                       if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+                       if (mono_class_is_interface (method->klass)) {
                                guint32 imt_slot = mono_method_get_imt_slot (method);
                                emit_imt_argument (cfg, call, call->method, imt_arg);
                                slot_reg = vtable_reg;
@@ -4258,7 +4259,7 @@ handle_alloc (MonoCompile *cfg, MonoClass *klass, gboolean for_box, int context_
                EMIT_NEW_CLASSCONST (cfg, iargs [1], klass);
 
                alloc_ftn = ves_icall_object_new;
-       } else if (cfg->compile_aot && cfg->cbb->out_of_line && klass->type_token && klass->image == mono_defaults.corlib && !klass->generic_class) {
+       } else if (cfg->compile_aot && cfg->cbb->out_of_line && klass->type_token && klass->image == mono_defaults.corlib && !mono_class_is_ginst (klass)) {
                /* This happens often in argument checking code, eg. throw new FooException... */
                /* Avoid relocations and save some space by calling a helper function specialized to mscorlib */
                EMIT_NEW_ICONST (cfg, iargs [0], mono_metadata_token_index (klass->type_token));
@@ -4432,11 +4433,11 @@ mini_class_has_reference_variant_generic_argument (MonoCompile *cfg, MonoClass *
        MonoGenericContainer *container;
        MonoGenericInst *ginst;
 
-       if (klass->generic_class) {
-               container = klass->generic_class->container_class->generic_container;
-               ginst = klass->generic_class->context.class_inst;
-       } else if (klass->generic_container && context_used) {
-               container = klass->generic_container;
+       if (mono_class_is_ginst (klass)) {
+               container = mono_class_get_generic_container (mono_class_get_generic_class (klass)->container_class);
+               ginst = mono_class_get_generic_class (klass)->context.class_inst;
+       } else if (mono_class_is_gtd (klass) && context_used) {
+               container = mono_class_get_generic_container (klass);
                ginst = container->context.class_inst;
        } else {
                return FALSE;
@@ -4495,7 +4496,7 @@ method_needs_stack_walk (MonoCompile *cfg, MonoMethod *cmethod)
        return FALSE;
 }
 
-#define is_complex_isinst(klass) ((klass->flags & TYPE_ATTRIBUTE_INTERFACE) || klass->rank || mono_class_is_nullable (klass) || mono_class_is_marshalbyref (klass) || (klass->flags & TYPE_ATTRIBUTE_SEALED) || klass->byval_arg.type == MONO_TYPE_VAR || klass->byval_arg.type == MONO_TYPE_MVAR)
+#define is_complex_isinst(klass) (mono_class_is_interface (klass) || klass->rank || mono_class_is_nullable (klass) || mono_class_is_marshalbyref (klass) || mono_class_is_sealed (klass) || klass->byval_arg.type == MONO_TYPE_VAR || klass->byval_arg.type == MONO_TYPE_MVAR)
 
 static MonoInst*
 emit_isinst_with_cache (MonoCompile *cfg, MonoClass *klass, MonoInst **args)
@@ -4572,7 +4573,7 @@ handle_castclass (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context
        int vtable_reg = alloc_preg (cfg);
        MonoInst *klass_inst = NULL;
 
-       if (src->opcode == OP_PCONST && src->inst_p0 == 0)
+       if (MONO_INS_IS_PCONST_NULL (src))
                return src;
 
        if (context_used) {
@@ -4605,7 +4606,7 @@ handle_castclass (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context
 
        save_cast_details (cfg, klass, obj_reg, FALSE);
 
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (klass)) {
                MONO_EMIT_NEW_LOAD_MEMBASE (cfg, vtable_reg, obj_reg, MONO_STRUCT_OFFSET (MonoObject, vtable));
                mini_emit_iface_cast (cfg, vtable_reg, klass, NULL, NULL);
        } else {
@@ -4613,7 +4614,7 @@ handle_castclass (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context
 
                MONO_EMIT_NEW_LOAD_MEMBASE (cfg, vtable_reg, obj_reg, MONO_STRUCT_OFFSET (MonoObject, vtable));
 
-               if (!klass->rank && !cfg->compile_aot && !(cfg->opt & MONO_OPT_SHARED) && (klass->flags & TYPE_ATTRIBUTE_SEALED)) {
+               if (!klass->rank && !cfg->compile_aot && !(cfg->opt & MONO_OPT_SHARED) && mono_class_is_sealed (klass)) {
                        /* the remoting code is broken, access the class for now */
                        if (0) { /*FIXME what exactly is broken? This change refers to r39380 from 2005 and mention some remoting fixes were due.*/
                                MonoVTable *vt = mono_class_vtable (cfg->domain, klass);
@@ -4686,7 +4687,7 @@ handle_isinst (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context_us
 
        MONO_EMIT_NEW_LOAD_MEMBASE (cfg, vtable_reg, obj_reg, MONO_STRUCT_OFFSET (MonoObject, vtable));
 
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (klass)) {
                g_assert (!context_used);
                /* the is_null_bb target simply copies the input register to the output */
                mini_emit_iface_cast (cfg, vtable_reg, klass, false_bb, is_null_bb);
@@ -4716,7 +4717,7 @@ handle_isinst (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context_us
                        } else if (klass->cast_class == mono_defaults.enum_class) {
                                mini_emit_class_check_branch (cfg, eclass_reg, mono_defaults.enum_class, OP_PBEQ, is_null_bb);
                                MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, false_bb);
-                       } else if (klass->cast_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+                       } else if (mono_class_is_interface (klass->cast_class)) {
                                mini_emit_iface_class_cast (cfg, eclass_reg, klass->cast_class, false_bb, is_null_bb);
                        } else {
                                if ((klass->rank == 1) && (klass->byval_arg.type == MONO_TYPE_SZARRAY)) {
@@ -4736,7 +4737,7 @@ handle_isinst (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context_us
                        /* the is_null_bb target simply copies the input register to the output */
                        mini_emit_isninst_cast (cfg, klass_reg, klass->cast_class, false_bb, is_null_bb);
                } else {
-                       if (!cfg->compile_aot && !(cfg->opt & MONO_OPT_SHARED) && (klass->flags & TYPE_ATTRIBUTE_SEALED)) {
+                       if (!cfg->compile_aot && !(cfg->opt & MONO_OPT_SHARED) && mono_class_is_sealed (klass)) {
                                g_assert (!context_used);
                                /* the remoting code is broken, access the class for now */
                                if (0) {/*FIXME what exactly is broken? This change refers to r39380 from 2005 and mention some remoting fixes were due.*/
@@ -4805,7 +4806,7 @@ handle_cisinst (MonoCompile *cfg, MonoClass *klass, MonoInst *src)
        MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, obj_reg, 0);
        MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBEQ, false_bb);
 
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (klass)) {
 #ifndef DISABLE_REMOTING
                NEW_BBLOCK (cfg, interface_fail_bb);
 #endif
@@ -4909,7 +4910,7 @@ handle_ccastclass (MonoCompile *cfg, MonoClass *klass, MonoInst *src)
 
        save_cast_details (cfg, klass, obj_reg, FALSE);
 
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_is_interface (klass)) {
 #ifndef DISABLE_REMOTING
                NEW_BBLOCK (cfg, interface_fail_bb);
        
@@ -5056,7 +5057,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono
 
        /* Set target field */
        /* Optimize away setting of NULL target */
-       if (!(target->opcode == OP_PCONST && target->inst_p0 == 0)) {
+       if (!MONO_INS_IS_PCONST_NULL (target)) {
                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, target), target->dreg);
                if (cfg->gen_write_barriers) {
                        dreg = alloc_preg (cfg);
@@ -5186,7 +5187,7 @@ handle_constrained_gsharedvt_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMe
         * This is hard to do with the current call code, since we would have to emit a branch and two different calls. So instead, we
         * pack the arguments into an array, and do the rest of the work in in an icall.
         */
-       if (((cmethod->klass == mono_defaults.object_class) || (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) || (!cmethod->klass->valuetype && cmethod->klass->image != mono_defaults.corlib)) &&
+       if (((cmethod->klass == mono_defaults.object_class) || mono_class_is_interface (cmethod->klass) || (!cmethod->klass->valuetype && cmethod->klass->image != mono_defaults.corlib)) &&
                (MONO_TYPE_IS_VOID (fsig->ret) || MONO_TYPE_IS_PRIMITIVE (fsig->ret) || MONO_TYPE_IS_REFERENCE (fsig->ret) || MONO_TYPE_ISSTRUCT (fsig->ret) || mini_is_gsharedvt_type (fsig->ret)) &&
                (fsig->param_count == 0 || (!fsig->hasthis && fsig->param_count == 1) || (fsig->param_count == 1 && (MONO_TYPE_IS_REFERENCE (fsig->params [0]) || fsig->params [0]->byref || mini_is_gsharedvt_type (fsig->params [0]))))) {
                MonoInst *args [16];
@@ -5359,7 +5360,7 @@ mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method)
                                        return FALSE;
                                }
                        }
-               } else if (method->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) {
+               } else if (mono_class_is_before_field_init (method->klass)) {
                        if (cfg->run_cctors && method->klass->has_cctor) {
                                /*FIXME it would easier and lazier to just use mono_class_try_get_vtable */
                                if (!method->klass->runtime_info)
@@ -5395,7 +5396,7 @@ mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method)
                 * the cctor will need to be run at aot method load time, for example,
                 * or at the end of the compilation of the inlining method.
                 */
-               if (mono_class_needs_cctor_run (method->klass, NULL) && !((method->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT)))
+               if (mono_class_needs_cctor_run (method->klass, NULL) && !mono_class_is_before_field_init (method->klass))
                        return FALSE;
        }
 
@@ -5425,7 +5426,7 @@ mini_field_access_needs_cctor_run (MonoCompile *cfg, MonoMethod *method, MonoCla
                        return FALSE;
        }
 
-       if (klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) {
+       if (mono_class_is_before_field_init (klass)) {
                if (cfg->method == method)
                        return FALSE;
        }
@@ -5698,7 +5699,7 @@ static MonoInst*
 emit_array_store (MonoCompile *cfg, MonoClass *klass, MonoInst **sp, gboolean safety_checks)
 {
        if (safety_checks && generic_class_is_reference_type (cfg, klass) &&
-               !(sp [2]->opcode == OP_PCONST && sp [2]->inst_p0 == NULL)) {
+               !(MONO_INS_IS_PCONST_NULL (sp [2]))) {
                MonoClass *obj_array = mono_array_class_get_cached (mono_defaults.object_class, 1);
                MonoMethod *helper = mono_marshal_get_virtual_stelemref (obj_array);
                MonoInst *iargs [3];
@@ -7076,11 +7077,11 @@ emit_init_local (MonoCompile *cfg, int local, MonoType *type, gboolean init)
 /*
  * inline_method:
  *
- *   Return the cost of inlining CMETHOD.
+ * Return the cost of inlining CMETHOD, or zero if it should not be inlined.
  */
 static int
 inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **sp,
-                          guchar *ip, guint real_offset, gboolean inline_always)
+              guchar *ip, guint real_offset, gboolean inline_always)
 {
        MonoError error;
        MonoInst *ins, *rvar = NULL;
@@ -7716,7 +7717,7 @@ emit_llvmonly_virtual_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSig
        MonoInst *icall_args [16];
        MonoInst *call_target, *ins, *vtable_ins;
        int arg_reg, this_reg, vtable_reg;
-       gboolean is_iface = cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE;
+       gboolean is_iface = mono_class_is_interface (cmethod->klass);
        gboolean is_gsharedvt = cfg->gsharedvt && mini_is_gsharedvt_variable_signature (fsig);
        gboolean variant_iface = FALSE;
        guint32 slot;
@@ -7952,7 +7953,7 @@ is_jit_optimizer_disabled (MonoMethod *m)
                return FALSE;
        }
 
-       attrs = mono_custom_attrs_from_assembly_checked (ass, &error);
+       attrs = mono_custom_attrs_from_assembly_checked (ass, FALSE, &error);
        mono_error_cleanup (&error); /* FIXME don't swallow the error */
        if (attrs) {
                for (i = 0; i < attrs->num_attrs; ++i) {
@@ -8151,7 +8152,22 @@ emit_setret (MonoCompile *cfg, MonoInst *val)
 /*
  * mono_method_to_ir:
  *
- *   Translate the .net IL into linear IR.
+ * Translate the .net IL into linear IR.
+ *
+ * @start_bblock: if not NULL, the starting basic block, used during inlining.
+ * @end_bblock: if not NULL, the ending basic block, used during inlining.
+ * @return_var: if not NULL, the place where the return value is stored, used during inlining.   
+ * @inline_args: if not NULL, contains the arguments to the inline call
+ * @inline_offset: if not zero, the real offset from the inline call, or zero otherwise.
+ * @is_virtual_call: whether this method is being called as a result of a call to callvirt
+ *
+ * This method is used to turn ECMA IL into Mono's internal Linear IR
+ * reprensetation.  It is used both for entire methods, as well as
+ * inlining existing methods.  In the former case, the @start_bblock,
+ * @end_bblock, @return_var, @inline_args are all set to NULL, and the
+ * inline_offset is set to zero.
+ * 
+ * Returns: the inline cost, or -1 if there was an error processing this method.
  */
 int
 mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock, 
@@ -8479,7 +8495,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
        /* we use a separate basic block for the initialization code */
        NEW_BBLOCK (cfg, init_localsbb);
-       cfg->bb_init = init_localsbb;
+       if (cfg->method == method)
+               cfg->bb_init = init_localsbb;
        init_localsbb->real_offset = cfg->real_offset;
        start_bblock->next_bb = init_localsbb;
        init_localsbb->next_bb = cfg->cbb;
@@ -9365,7 +9382,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                        n = fsig->param_count + fsig->hasthis;
 
-                       if (!cfg->gshared && cmethod->klass->generic_container)
+                       if (!cfg->gshared && mono_class_is_gtd (cmethod->klass))
                                UNVERIFIED;
 
                        if (!cfg->gshared)
@@ -9384,7 +9401,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                if (mini_is_gsharedvt_klass (constrained_class)) {
                                        if ((cmethod->klass != mono_defaults.object_class) && constrained_class->valuetype && cmethod->klass->valuetype) {
                                                /* The 'Own method' case below */
-                                       } else if (cmethod->klass->image != mono_defaults.corlib && !(cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) && !cmethod->klass->valuetype) {
+                                       } else if (cmethod->klass->image != mono_defaults.corlib && !mono_class_is_interface (cmethod->klass) && !cmethod->klass->valuetype) {
                                                /* 'The type parameter is instantiated as a reference type' case below. */
                                        } else {
                                                ins = handle_constrained_gsharedvt_call (cfg, cmethod, fsig, sp, constrained_class, &emit_widen);
@@ -9405,7 +9422,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                         * A simple solution would be to box always and make a normal virtual call, but that would
                                         * be bad performance wise.
                                         */
-                                       if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE && cmethod->klass->generic_class) {
+                                       if (mono_class_is_interface (cmethod->klass) && mono_class_is_ginst (cmethod->klass)) {
                                                /*
                                                 * The parent classes implement no generic interfaces, so the called method will be a vtype method, so no boxing neccessary.
                                                 */
@@ -9458,7 +9475,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                nonbox_call->dreg = ins->dreg;
                                                goto call_end;
                                        } else {
-                                               g_assert (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE);
+                                               g_assert (mono_class_is_interface (cmethod->klass));
                                                addr = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
                                                ins = (MonoInst*)mono_emit_calli (cfg, fsig, sp, addr, NULL, NULL);
                                                goto call_end;
@@ -9533,7 +9550,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                         * If the callee is a shared method, then its static cctor
                         * might not get called after the call was patched.
                         */
-                       if (cfg->gshared && cmethod->klass != method->klass && cmethod->klass->generic_class && mono_method_is_generic_sharable (cmethod, TRUE) && mono_class_needs_cctor_run (cmethod->klass, method)) {
+                       if (cfg->gshared && cmethod->klass != method->klass && mono_class_is_ginst (cmethod->klass) && mono_method_is_generic_sharable (cmethod, TRUE) && mono_class_needs_cctor_run (cmethod->klass, method)) {
                                emit_class_init (cfg, cmethod->klass);
                                CHECK_TYPELOAD (cmethod->klass);
                        }
@@ -9545,7 +9562,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                                context_used = mini_method_check_context_used (cfg, cmethod);
 
-                               if (context_used && (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
+                               if (context_used && mono_class_is_interface (cmethod->klass)) {
                                        /* Generic method interface
                                           calls are resolved via a
                                           helper function and don't
@@ -9788,13 +9805,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                         * This needs to be used for all generic calls, not just ones with a gsharedvt signature, to avoid
                         * patching gshared method addresses into a gsharedvt method.
                         */
-                       if (cfg->gsharedvt && (mini_is_gsharedvt_signature (fsig) || cmethod->is_inflated || cmethod->klass->generic_class) &&
+                       if (cfg->gsharedvt && (mini_is_gsharedvt_signature (fsig) || cmethod->is_inflated || mono_class_is_ginst (cmethod->klass)) &&
                                !(cmethod->klass->rank && cmethod->klass->byval_arg.type != MONO_TYPE_SZARRAY) &&
                                (!(cfg->llvm_only && virtual_ && (cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL)))) {
                                MonoRgctxInfoType info_type;
 
                                if (virtual_) {
-                                       //if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE)
+                                       //if (mono_class_is_interface (cmethod->klass))
                                                //GSHAREDVT_FAILURE (*ip);
                                        // disable for possible remoting calls
                                        if (fsig->hasthis && (mono_class_is_marshalbyref (method->klass) || method->klass == mono_defaults.object_class))
@@ -9807,7 +9824,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                                                                                 cmethod, MONO_RGCTX_INFO_METHOD);
                                                /* This is not needed, as the trampoline code will pass one, and it might be passed in the same reg as the imt arg */
                                                vtable_arg = NULL;
-                                       } else if ((cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) && !imt_arg) {
+                                       } else if (mono_class_is_interface (cmethod->klass) && !imt_arg) {
                                                /* This can happen when we call a fully instantiated iface method */
                                                imt_arg = emit_get_rgctx_method (cfg, context_used,
                                                                                                                 cmethod, MONO_RGCTX_INFO_METHOD);
@@ -9915,7 +9932,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        
                                        addr = mini_emit_ldelema_ins (cfg, cmethod, sp, ip, TRUE);
                                        EMIT_NEW_STORE_MEMBASE_TYPE (cfg, ins, fsig->params [fsig->param_count - 1], addr->dreg, 0, val->dreg);
-                                       if (cfg->gen_write_barriers && val->type == STACK_OBJ && !(val->opcode == OP_PCONST && val->inst_c0 == 0))
+                                       if (cfg->gen_write_barriers && val->type == STACK_OBJ && !MONO_INS_IS_PCONST_NULL (val))
                                                emit_write_barrier (cfg, addr, val);
                                        if (cfg->gen_write_barriers && mini_is_gsharedvt_klass (cmethod->klass))
                                                GSHAREDVT_FAILURE (*ip);
@@ -10459,7 +10476,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                        MONO_ADD_INS (cfg->cbb, ins);
 
-                       if (cfg->gen_write_barriers && *ip == CEE_STIND_REF && method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER && !((sp [1]->opcode == OP_PCONST) && (sp [1]->inst_p0 == 0)))
+                       if (cfg->gen_write_barriers && *ip == CEE_STIND_REF && method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER && !MONO_INS_IS_PCONST_NULL (sp [1]))
                                emit_write_barrier (cfg, sp [0], sp [1]);
 
                        inline_costs += 1;
@@ -10842,7 +10859,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        if (mono_security_core_clr_enabled ())
                                ensure_method_is_allowed_to_call_method (cfg, method, cmethod);
 
-                       if (cfg->gshared && cmethod && cmethod->klass != method->klass && cmethod->klass->generic_class && mono_method_is_generic_sharable (cmethod, TRUE) && mono_class_needs_cctor_run (cmethod->klass, method)) {
+                       if (cfg->gshared && cmethod && cmethod->klass != method->klass && mono_class_is_ginst (cmethod->klass) && mono_method_is_generic_sharable (cmethod, TRUE) && mono_class_needs_cctor_run (cmethod->klass, method)) {
                                emit_class_init (cfg, cmethod->klass);
                                CHECK_TYPELOAD (cmethod->klass);
                        }
@@ -11034,13 +11051,18 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                res = handle_unbox_gsharedvt (cfg, klass, *sp);
                                inline_costs += 2;
                        } else if (generic_class_is_reference_type (cfg, klass)) {
-                               MONO_INST_NEW (cfg, res, OP_CASTCLASS);
-                               res->dreg = alloc_preg (cfg);
-                               res->sreg1 = (*sp)->dreg;
-                               res->klass = klass;
-                               res->type = STACK_OBJ;
-                               MONO_ADD_INS (cfg->cbb, res);
-                               cfg->flags |= MONO_CFG_HAS_TYPE_CHECK;
+                               if (MONO_INS_IS_PCONST_NULL (*sp)) {
+                                       EMIT_NEW_PCONST (cfg, res, NULL);
+                                       res->type = STACK_OBJ;
+                               } else {
+                                       MONO_INST_NEW (cfg, res, OP_CASTCLASS);
+                                       res->dreg = alloc_preg (cfg);
+                                       res->sreg1 = (*sp)->dreg;
+                                       res->klass = klass;
+                                       res->type = STACK_OBJ;
+                                       MONO_ADD_INS (cfg->cbb, res);
+                                       cfg->flags |= MONO_CFG_HAS_TYPE_CHECK;
+                               }
                        } else if (mono_class_is_nullable (klass)) {
                                res = handle_unbox_nullable (cfg, *sp, klass, context_used);
                        } else {
@@ -11388,7 +11410,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        if (sp [0]->opcode != OP_LDADDR)
                                                store->flags |= MONO_INST_FAULT;
 
-                                       if (cfg->gen_write_barriers && mini_type_to_stind (cfg, field->type) == CEE_STIND_REF && !(sp [1]->opcode == OP_PCONST && sp [1]->inst_c0 == 0)) {
+                                       if (cfg->gen_write_barriers && mini_type_to_stind (cfg, field->type) == CEE_STIND_REF && !MONO_INS_IS_PCONST_NULL (sp [1])) {
                                                if (mini_is_gsharedvt_klass (klass)) {
                                                        g_assert (wbarrier_ptr_ins);
                                                        emit_write_barrier (cfg, wbarrier_ptr_ins, sp [1]);
@@ -11811,7 +11833,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        EMIT_NEW_STORE_MEMBASE_TYPE (cfg, ins, &klass->byval_arg, sp [0]->dreg, 0, sp [1]->dreg);
                        ins->flags |= ins_flag;
                        if (cfg->gen_write_barriers && cfg->method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER &&
-                                       generic_class_is_reference_type (cfg, klass)) {
+                               generic_class_is_reference_type (cfg, klass) && !MONO_INS_IS_PCONST_NULL (sp [1])) {
                                /* insert call to write barrier */
                                emit_write_barrier (cfg, sp [0], sp [1]);
                        }
@@ -12154,7 +12176,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREP_MEMBASE_REG, addr->dreg, MONO_STRUCT_OFFSET (MonoTypedRef, klass), const_ins->dreg);
                                MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ADD_IMM, type_reg, const_ins->dreg, MONO_STRUCT_OFFSET (MonoClass, byval_arg));
                                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREP_MEMBASE_REG, addr->dreg, MONO_STRUCT_OFFSET (MonoTypedRef, type), type_reg);
-                       } else if (cfg->compile_aot) {
+                       } else {
                                int const_reg = alloc_preg (cfg);
                                int type_reg = alloc_preg (cfg);
 
@@ -12162,9 +12184,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREP_MEMBASE_REG, addr->dreg, MONO_STRUCT_OFFSET (MonoTypedRef, klass), const_reg);
                                MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ADD_IMM, type_reg, const_reg, MONO_STRUCT_OFFSET (MonoClass, byval_arg));
                                MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREP_MEMBASE_REG, addr->dreg, MONO_STRUCT_OFFSET (MonoTypedRef, type), type_reg);
-                       } else {
-                               MONO_EMIT_NEW_STORE_MEMBASE_IMM (cfg, OP_STOREP_MEMBASE_IMM, addr->dreg, MONO_STRUCT_OFFSET (MonoTypedRef, type), &klass->byval_arg);
-                               MONO_EMIT_NEW_STORE_MEMBASE_IMM (cfg, OP_STOREP_MEMBASE_IMM, addr->dreg, MONO_STRUCT_OFFSET (MonoTypedRef, klass), klass);
                        }
                        MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREP_MEMBASE_REG, addr->dreg, MONO_STRUCT_OFFSET (MonoTypedRef, value), sp [0]->dreg);
 
@@ -12560,7 +12579,17 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                cmethod = (MonoMethod *)mono_method_get_wrapper_data (method, token);
 
                                if (cfg->compile_aot) {
-                                       EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_ICALL_ADDR, cmethod);
+                                       if (cfg->direct_pinvoke && ip + 6 < end && (ip [6] == CEE_POP)) {
+                                               /*
+                                                * This is generated by emit_native_wrapper () to resolve the pinvoke address
+                                                * before the call, its not needed when using direct pinvoke.
+                                                * This is not an optimization, but its used to avoid looking up pinvokes
+                                                * on platforms which don't support dlopen ().
+                                                */
+                                               EMIT_NEW_PCONST (cfg, ins, NULL);
+                                       } else {
+                                               EMIT_NEW_AOTCONST (cfg, ins, MONO_PATCH_INFO_ICALL_ADDR, cmethod);
+                                       }
                                } else {
                                        ptr = mono_lookup_internal_call (cmethod);
                                        g_assert (ptr);
@@ -13685,7 +13714,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
        if (cfg->method == method) {
                MonoBasicBlock *bb;
                for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
-                       bb->region = mono_find_block_region (cfg, bb->real_offset);
+                       if (bb == cfg->bb_init)
+                               bb->region = -1;
+                       else
+                               bb->region = mono_find_block_region (cfg, bb->real_offset);
                        if (cfg->spvars)
                                mono_create_spvar_for_region (cfg, bb->region);
                        if (cfg->verbose_level > 2)
@@ -15104,7 +15136,7 @@ mono_decompose_typecheck (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins)
                        ret = emit_isinst_with_cache_nonshared (cfg, source, klass);
                else
                        ret = emit_castclass_with_cache_nonshared (cfg, source, klass);
-       } else if (!context_used && (mono_class_is_marshalbyref (klass) || klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
+       } else if (!context_used && (mono_class_is_marshalbyref (klass) || mono_class_is_interface (klass))) {
                MonoInst *iargs [1];
                int costs;
 
@@ -15274,4 +15306,8 @@ NOTES
   the values on the stack before emitting the last instruction of the bb.
 */
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (method_to_ir);
+
+#endif /* !DISABLE_JIT */
index 4ed38f2b58312bd22f6697f0ad9bd2d72be8e261..b9a4503e2e2be0cbcff3491c925192b0463c21b6 100644 (file)
@@ -438,7 +438,7 @@ collect_field_info_nested (MonoClass *klass, StructFieldInfo *fields, int index,
 #define MONO_WIN64_VALUE_TYPE_FITS_REG(arg_size) (arg_size <= SIZEOF_REGISTER && (arg_size == 1 || arg_size == 2 || arg_size == 4 || arg_size == 8))
 
 static gboolean
-allocate_register_for_valuetype_win64 (ArgInfo *arg_info, ArgumentClass arg_class, guint32 arg_size, AMD64_Reg_No int_regs [], int int_reg_count, AMD64_Reg_No float_regs [], int float_reg_count, guint32 *current_int_reg, guint32 *current_float_reg)
+allocate_register_for_valuetype_win64 (ArgInfo *arg_info, ArgumentClass arg_class, guint32 arg_size, AMD64_Reg_No int_regs [], int int_reg_count, AMD64_XMM_Reg_No float_regs [], int float_reg_count, guint32 *current_int_reg, guint32 *current_float_reg)
 {
        gboolean result = FALSE;
 
index 8ac16a17176d26319836dee254922c1c16dc1632..24eb6524bf759596849b46637e9bc860c1a92d16 100644 (file)
@@ -191,11 +191,11 @@ typedef struct MonoCompileArch {
 
 static AMD64_Reg_No param_regs [] = { AMD64_RCX, AMD64_RDX, AMD64_R8, AMD64_R9 };
 
-static AMD64_Reg_No float_param_regs [] = { AMD64_XMM0, AMD64_XMM1, AMD64_XMM2, AMD64_XMM3 };
+static AMD64_XMM_Reg_No float_param_regs [] = { AMD64_XMM0, AMD64_XMM1, AMD64_XMM2, AMD64_XMM3 };
 
 static AMD64_Reg_No return_regs [] = { AMD64_RAX };
 
-static AMD64_Reg_No float_return_regs [] = { AMD64_XMM0 };
+static AMD64_XMM_Reg_No float_return_regs [] = { AMD64_XMM0 };
 
 #define PARAM_REGS G_N_ELEMENTS(param_regs)
 #define FLOAT_PARAM_REGS G_N_ELEMENTS(float_param_regs)
index 82795e5b8e87e2e46c65bcc40e55190c19b4b338..13a3ffee37f8159a3b1346bf99c09b007ab5159b 100644 (file)
@@ -127,6 +127,7 @@ static int vfp_scratch2 = ARM_VFP_D1;
 static int i8_align;
 
 static gpointer single_step_tramp, breakpoint_tramp;
+static gpointer get_tls_tramp;
 
 /*
  * The code generated for sequence points reads from this location, which is
@@ -167,6 +168,9 @@ int mono_exc_esp_offset = 0;
 static void mono_arch_compute_omit_fp (MonoCompile *cfg);
 #endif
 
+static guint8*
+emit_aotconst (MonoCompile *cfg, guint8 *code, int dreg, int patch_type, gpointer data);
+
 const char*
 mono_arch_regname (int reg)
 {
@@ -330,9 +334,21 @@ mono_arm_emit_tls_get (MonoCompile *cfg, guint8* code, int dreg, int tls_offset)
 {
 #ifdef HAVE_FAST_TLS
        code = mono_arm_emit_load_imm (code, ARMREG_R0, tls_offset);
-       mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
-                       "mono_get_tls_key");
-       code = emit_call_seq (cfg, code);
+       if (cfg->compile_aot) {
+               /*
+                * This opcode is generated by CEE_MONO_JIT_ATTACH, so it can execute on
+                * threads which are not yet attached to the runtime. This means we can't
+                * call it directly, since the call would go through the trampoline code
+                * which assumes the thread is attached. So use a separate patch info type
+                * for it, and load it from a preinitialized GOT slot.
+                */
+               code = emit_aotconst (cfg, code, ARMREG_R1, MONO_PATCH_INFO_GET_TLS_TRAMP, NULL);
+               code = emit_call_reg (code, ARMREG_R1);
+       } else {
+               mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+                                                        "mono_get_tls_key");
+               code = emit_call_seq (cfg, code);
+       }
        if (dreg != ARMREG_R0)
                ARM_MOV_REG_REG (code, dreg, ARMREG_R0);
 #else
@@ -347,9 +363,14 @@ mono_arm_emit_tls_get_reg (MonoCompile *cfg, guint8* code, int dreg, int tls_off
 #ifdef HAVE_FAST_TLS
        if (tls_offset_reg != ARMREG_R0)
                ARM_MOV_REG_REG (code, ARMREG_R0, tls_offset_reg);
-       mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
-                       "mono_get_tls_key");
-       code = emit_call_seq (cfg, code);
+       if (cfg->compile_aot) {
+               code = emit_aotconst (cfg, code, ARMREG_R1, MONO_PATCH_INFO_GET_TLS_TRAMP, NULL);
+               code = emit_call_reg (code, ARMREG_R1);
+       } else {
+               mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+                                                        "mono_get_tls_key");
+               code = emit_call_seq (cfg, code);
+       }
        if (dreg != ARMREG_R0)
                ARM_MOV_REG_REG (code, dreg, ARMREG_R0);
 #else
@@ -5989,6 +6010,8 @@ mono_arch_register_lowlevel_calls (void)
                mono_register_jit_icall (tls_imp.get_tls_thunk, "mono_get_tls_key", mono_create_icall_signature ("ptr ptr"), TRUE);
                mono_register_jit_icall (tls_imp.set_tls_thunk, "mono_set_tls_key", mono_create_icall_signature ("void ptr ptr"), TRUE);
 
+               get_tls_tramp = tls_imp.get_tls_thunk;
+
                if (tls_imp.get_tls_thunk_end) {
                        mono_tramp_info_register (
                                mono_tramp_info_create (
@@ -7512,3 +7535,23 @@ mono_arch_get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
 {
        return get_call_info (mp, sig);
 }
+
+gpointer
+mono_arch_get_get_tls_tramp (void)
+{
+       return get_tls_tramp;
+}
+
+static guint8*
+emit_aotconst (MonoCompile *cfg, guint8 *code, int dreg, int patch_type, gpointer data)
+{
+       /* OP_AOTCONST */
+       mono_add_patch_info (cfg, code - cfg->native_code, patch_type, data);
+       ARM_LDR_IMM (code, dreg, ARMREG_PC, 0);
+       ARM_B (code, 0);
+       *(gpointer*)code = NULL;
+       code += 4;
+       /* Load the value from the GOT */
+       ARM_LDR_REG_REG (code, dreg, ARMREG_PC, dreg);
+       return code;
+}
index cb31a6e8b24f64f192e21cb32e1075805fbe0a8d..694f6b87e0e2d3f43ed800123f3925add53b1b2c 100644 (file)
@@ -350,6 +350,7 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_HAVE_SDB_TRAMPOLINES 1
 #define MONO_ARCH_HAVE_PATCH_CODE_NEW 1
 #define MONO_ARCH_HAVE_OP_GENERIC_CLASS_INIT 1
+#define MONO_ARCH_HAVE_GET_TLS_TRAMP 1
 
 #define MONO_ARCH_HAVE_TLS_GET (mono_arm_have_tls_get ())
 #define MONO_ARCH_HAVE_TLS_GET_REG 1
index e19467f8945dc90d4f2b27a41abd00b30e430501..3b4dd15c8c9acb3dc3a9bed4b689f664526ffe62 100644 (file)
@@ -1789,25 +1789,21 @@ mono_arch_flush_icache (guint8 *code, gint size)
         * icache/dcache cache line sizes, that can vary between cores on
         * big.LITTLE architectures. */
        guint64 end = (guint64) (code + size);
-       guint64 addr, ctr_el0;
-       static size_t icache_line_size = 0xffff, dcache_line_size = 0xffff;
-       size_t isize, dsize;
-
-       asm volatile ("mrs %0, ctr_el0" : "=r" (ctr_el0));
-       isize = 4 << ((ctr_el0 >> 0 ) & 0xf);
-       dsize = 4 << ((ctr_el0 >> 16) & 0xf);
-
-       /* determine the global minimum cache line size */
-       icache_line_size = isize = MIN (icache_line_size, isize);
-       dcache_line_size = dsize = MIN (dcache_line_size, dsize);
-
-       addr = (guint64) code & ~(guint64) (dsize - 1);
-       for (; addr < end; addr += dsize)
+       guint64 addr;
+       /* always go with cacheline size of 4 bytes as this code isn't perf critical
+        * anyway. Reading the cache line size from a machine register can be racy
+        * on a big.LITTLE architecture if the cores don't have the same cache line
+        * sizes. */
+       const size_t icache_line_size = 4;
+       const size_t dcache_line_size = 4;
+
+       addr = (guint64) code & ~(guint64) (dcache_line_size - 1);
+       for (; addr < end; addr += dcache_line_size)
                asm volatile("dc civac, %0" : : "r" (addr) : "memory");
        asm volatile("dsb ish" : : : "memory");
 
-       addr = (guint64) code & ~(guint64) (isize - 1);
-       for (; addr < end; addr += isize)
+       addr = (guint64) code & ~(guint64) (icache_line_size - 1);
+       for (; addr < end; addr += icache_line_size)
                asm volatile("ic ivau, %0" : : "r" (addr) : "memory");
 
        asm volatile ("dsb ish" : : : "memory");
index 8af5ca7f7d72bcc37f8677c28aceaab3fe4bcef2..a22a10af76105fc85ac1460970b5661a6ef21459 100644 (file)
@@ -143,9 +143,7 @@ typedef struct {
 #define MONO_ARCH_DYN_CALL_SUPPORTED 1
 #define MONO_ARCH_DYN_CALL_PARAM_AREA (DYN_CALL_STACK_ARGS * 8)
 #define MONO_ARCH_SOFT_DEBUG_SUPPORTED 1
-#ifndef TARGET_ANDROID
 #define MONO_ARCH_GSHAREDVT_SUPPORTED 1
-#endif
 #define MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX 1
 #define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK 1
 #define MONO_ARCH_HAVE_GENERAL_RGCTX_LAZY_FETCH_TRAMPOLINE 1
index 57a7a38deef9f7845a8aaf94024d58955698e06e..a8bf46b288661920056b90f3db2aa85be401c448 100644 (file)
@@ -4,6 +4,8 @@
  * (C) 2003 Ximian, Inc.
  */
 
+#include "config.h"
+
 #include <string.h>
 #include <math.h>
 #ifdef HAVE_UNISTD_H
@@ -21,6 +23,8 @@
 #include "trace.h"
 #include "mini-arch.h"
 
+#ifndef DISABLE_JIT
+
 #ifndef MONO_MAX_XREGS
 
 #define MONO_MAX_XREGS 0
@@ -28,7 +32,6 @@
 #define MONO_ARCH_CALLEE_XREGS 0
 
 #endif
 
 #define MONO_ARCH_BANK_MIRRORED -2
 
@@ -411,47 +414,7 @@ typedef struct {
        regmask_t preferred_mask; /* the hreg where the register should be allocated, or 0 */
 } RegTrack;
 
-#if !defined(DISABLE_LOGGING) && !defined(DISABLE_JIT)
-
-static const char* const patch_info_str[] = {
-#define PATCH_INFO(a,b) "" #a,
-#include "patch-info.h"
-#undef PATCH_INFO
-};
-
-const char*
-mono_ji_type_to_string (MonoJumpInfoType type)
-{
-       return patch_info_str [type];
-}
-
-void
-mono_print_ji (const MonoJumpInfo *ji)
-{
-       switch (ji->type) {
-       case MONO_PATCH_INFO_RGCTX_FETCH: {
-               MonoJumpInfoRgctxEntry *entry = ji->data.rgctx_entry;
-
-               printf ("[RGCTX_FETCH ");
-               mono_print_ji (entry->data);
-               printf (" - %s]", mono_rgctx_info_type_to_str (entry->info_type));
-               break;
-       }
-       case MONO_PATCH_INFO_METHODCONST: {
-               char *s = mono_method_full_name (ji->data.method, TRUE);
-               printf ("[METHODCONST - %s]", s);
-               g_free (s);
-               break;
-       }
-       case MONO_PATCH_INFO_INTERNAL_METHOD: {
-               printf ("[INTERNAL_METHOD - %s]", ji->data.name);
-               break;
-       }
-       default:
-               printf ("[%s]", patch_info_str [ji->type]);
-               break;
-       }
-}
+#if !defined(DISABLE_LOGGING)
 
 void
 mono_print_ins_index (int i, MonoInst *ins)
@@ -785,22 +748,11 @@ print_regtrack (RegTrack *t, int num)
 }
 #else
 
-const char*
-mono_ji_type_to_string (MonoJumpInfoType type)
-{
-       return "";
-}
-
-void
-mono_print_ji (const MonoJumpInfo *ji)
-{
-}
-
 void
 mono_print_ins_index (int i, MonoInst *ins)
 {
 }
-#endif /* !defined(DISABLE_LOGGING) && !defined(DISABLE_JIT) */
+#endif /* !defined(DISABLE_LOGGING) */
 
 void
 mono_print_ins (MonoInst *ins)
@@ -1151,8 +1103,6 @@ get_callee_mask (const char spec)
 static gint8 desc_to_fixed_reg [256];
 static gboolean desc_to_fixed_reg_inited = FALSE;
 
-#ifndef DISABLE_JIT
-
 /*
  * Local register allocation.
  * We first scan the list of instructions and we save the liveness info of
@@ -2554,47 +2504,6 @@ mono_opcode_to_type (int opcode, int cmp_opcode)
        }
 }
 
-#endif /* DISABLE_JIT */
-
-gboolean
-mono_is_regsize_var (MonoType *t)
-{
-       t = mini_get_underlying_type (t);
-       switch (t->type) {
-       case MONO_TYPE_I1:
-       case MONO_TYPE_U1:
-       case MONO_TYPE_I2:
-       case MONO_TYPE_U2:
-       case MONO_TYPE_I4:
-       case MONO_TYPE_U4:
-       case MONO_TYPE_I:
-       case MONO_TYPE_U:
-       case MONO_TYPE_PTR:
-       case MONO_TYPE_FNPTR:
-#if SIZEOF_REGISTER == 8
-       case MONO_TYPE_I8:
-       case MONO_TYPE_U8:
-#endif
-               return TRUE;
-       case MONO_TYPE_OBJECT:
-       case MONO_TYPE_STRING:
-       case MONO_TYPE_CLASS:
-       case MONO_TYPE_SZARRAY:
-       case MONO_TYPE_ARRAY:
-               return TRUE;
-       case MONO_TYPE_GENERICINST:
-               if (!mono_type_generic_inst_is_valuetype (t))
-                       return TRUE;
-               return FALSE;
-       case MONO_TYPE_VALUETYPE:
-               return FALSE;
-       default:
-               return FALSE;
-       }
-}
-
-#ifndef DISABLE_JIT
-
 /*
  * mono_peephole_ins:
  *
@@ -2844,3 +2753,40 @@ mono_regstate_free (MonoRegState *rs) {
 }
 
 #endif /* DISABLE_JIT */
+
+gboolean
+mono_is_regsize_var (MonoType *t)
+{
+       t = mini_get_underlying_type (t);
+       switch (t->type) {
+       case MONO_TYPE_I1:
+       case MONO_TYPE_U1:
+       case MONO_TYPE_I2:
+       case MONO_TYPE_U2:
+       case MONO_TYPE_I4:
+       case MONO_TYPE_U4:
+       case MONO_TYPE_I:
+       case MONO_TYPE_U:
+       case MONO_TYPE_PTR:
+       case MONO_TYPE_FNPTR:
+#if SIZEOF_REGISTER == 8
+       case MONO_TYPE_I8:
+       case MONO_TYPE_U8:
+#endif
+               return TRUE;
+       case MONO_TYPE_OBJECT:
+       case MONO_TYPE_STRING:
+       case MONO_TYPE_CLASS:
+       case MONO_TYPE_SZARRAY:
+       case MONO_TYPE_ARRAY:
+               return TRUE;
+       case MONO_TYPE_GENERICINST:
+               if (!mono_type_generic_inst_is_valuetype (t))
+                       return TRUE;
+               return FALSE;
+       case MONO_TYPE_VALUETYPE:
+               return FALSE;
+       default:
+               return FALSE;
+       }
+}
index a52f5eb80d06aef3137d018ac67b0940961f8460..4e632071ce2028c991303e2b827a93e61e2f0d8a 100644 (file)
@@ -166,8 +166,8 @@ gboolean
 mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo *info)
 {
        kern_return_t ret;
-       mach_msg_type_number_t num_state;
-       thread_state_t state;
+       mach_msg_type_number_t num_state, num_fpstate;
+       thread_state_t state, fpstate;
        ucontext_t ctx;
        mcontext_t mctx;
        MonoJitTlsData *jit_tls;
@@ -183,15 +183,16 @@ mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo
        tctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS] = NULL;
 
        state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
+       fpstate = (thread_state_t) alloca (mono_mach_arch_get_thread_fpstate_size ());
        mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
 
        do {
-               ret = mono_mach_arch_get_thread_state (info->native_handle, state, &num_state);
+               ret = mono_mach_arch_get_thread_states (info->native_handle, state, &num_state, fpstate, &num_fpstate);
        } while (ret == KERN_ABORTED);
        if (ret != KERN_SUCCESS)
                return FALSE;
 
-       mono_mach_arch_thread_state_to_mcontext (state, mctx);
+       mono_mach_arch_thread_states_to_mcontext (state, fpstate, mctx);
        ctx.uc_mcontext = mctx;
 
        mono_sigctx_to_monoctx (&ctx, &tctx->ctx);
index fa24b73f186132b30eb3d4b358664d3f59e2d4f6..400940957fbd2e3c498784f371aaf5597e2de013 100644 (file)
@@ -613,23 +613,23 @@ get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_info)
                klass = vtable->klass;
        }
 
-       //g_assert (!method->klass->generic_container);
-       if (method->klass->generic_class)
-               method_container_class = method->klass->generic_class->container_class;
+       //g_assert (!mono_class_is_gtd (method->klass));
+       if (mono_class_is_ginst (method->klass))
+               method_container_class = mono_class_get_generic_class (method->klass)->container_class;
        else
                method_container_class = method->klass;
 
        /* class might refer to a subclass of method's class */
-       while (!(klass == method->klass || (klass->generic_class && klass->generic_class->container_class == method_container_class))) {
+       while (!(klass == method->klass || (mono_class_is_ginst (klass) && mono_class_get_generic_class (klass)->container_class == method_container_class))) {
                klass = klass->parent;
                g_assert (klass);
        }
 
-       if (klass->generic_class || klass->generic_container)
+       if (mono_class_is_ginst (klass) || mono_class_is_gtd (klass))
                context.class_inst = mini_class_get_context (klass)->class_inst;
 
-       if (klass->generic_class)
-               g_assert (mono_class_has_parent_and_ignore_generics (klass->generic_class->container_class, method_container_class));
+       if (mono_class_is_ginst (klass))
+               g_assert (mono_class_has_parent_and_ignore_generics (mono_class_get_generic_class (klass)->container_class, method_container_class));
        else
                g_assert (mono_class_has_parent_and_ignore_generics (klass, method_container_class));
 
@@ -1229,7 +1229,7 @@ wrap_non_exception_throws (MonoMethod *m)
 
        klass = mono_class_get_runtime_compat_attr_class ();
 
-       attrs = mono_custom_attrs_from_assembly_checked (ass, &error);
+       attrs = mono_custom_attrs_from_assembly_checked (ass, FALSE, &error);
        mono_error_cleanup (&error); /* FIXME don't swallow the error */
        if (attrs) {
                for (i = 0; i < attrs->num_attrs; ++i) {
@@ -1290,7 +1290,10 @@ build_native_trace (MonoError *error)
 #if defined (HAVE_BACKTRACE_SYMBOLS) && defined (TARGET_ARM)
        MonoArray *res;
        void *native_trace [MAX_UNMANAGED_BACKTRACE];
-       int size = backtrace (native_trace, MAX_UNMANAGED_BACKTRACE);
+       int size = -1;
+       MONO_ENTER_GC_SAFE;
+       size = backtrace (native_trace, MAX_UNMANAGED_BACKTRACE);
+       MONO_EXIT_GC_SAFE;
        int i;
 
        if (!size)
@@ -2721,7 +2724,7 @@ mono_thread_state_init_from_sigctx (MonoThreadUnwindState *ctx, void *sigctx)
        MonoThreadInfo *thread = mono_thread_info_current_unchecked ();
        if (!thread) {
                ctx->valid = FALSE;
-               G_BREAKPOINT ();
+               g_error ("Invoked mono_thread_state_init_from_sigctx from non-Mono thread");
                return FALSE;
        }
 
index 736493198ed3b9556beb77bd842805959f7e862e..563a3a5b5de5caa4e94c8cbc673b04cb1e61ac32 100644 (file)
@@ -76,7 +76,7 @@ type_check_context_used (MonoType *type, gboolean recursive)
                if (recursive) {
                        MonoGenericClass *gclass = type->data.generic_class;
 
-                       g_assert (gclass->container_class->generic_container);
+                       g_assert (mono_class_is_gtd (gclass->container_class));
                        return mono_generic_context_check_used (&gclass->context);
                } else {
                        return 0;
@@ -137,10 +137,10 @@ mono_class_check_context_used (MonoClass *klass)
        context_used |= type_check_context_used (&klass->this_arg, FALSE);
        context_used |= type_check_context_used (&klass->byval_arg, FALSE);
 
-       if (klass->generic_class)
-               context_used |= mono_generic_context_check_used (&klass->generic_class->context);
-       else if (klass->generic_container)
-               context_used |= mono_generic_context_check_used (&klass->generic_container->context);
+       if (mono_class_is_ginst (klass))
+               context_used |= mono_generic_context_check_used (&mono_class_get_generic_class (klass)->context);
+       else if (mono_class_is_gtd (klass))
+               context_used |= mono_generic_context_check_used (&mono_class_get_generic_container (klass)->context);
 
        return context_used;
 }
@@ -274,8 +274,8 @@ register_generic_subclass (MonoClass *klass)
 
        g_assert (rgctx_template);
 
-       if (parent->generic_class)
-               parent = parent->generic_class->container_class;
+       if (mono_class_is_ginst (parent))
+               parent = mono_class_get_generic_class (parent)->container_class;
 
        if (!generic_subclass_hash)
                generic_subclass_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
@@ -475,21 +475,22 @@ mono_class_get_method_generic (MonoClass *klass, MonoMethod *method)
                declaring = method;
 
        m = NULL;
-       if (klass->generic_class)
+       if (mono_class_is_ginst (klass))
                m = mono_class_get_inflated_method (klass, declaring);
 
        if (!m) {
                mono_class_setup_methods (klass);
                if (mono_class_has_failure (klass))
                        return NULL;
-               for (i = 0; i < klass->method.count; ++i) {
+               int mcount = mono_class_get_method_count (klass);
+               for (i = 0; i < mcount; ++i) {
                        m = klass->methods [i];
                        if (m == declaring)
                                break;
                        if (m->is_inflated && mono_method_get_declaring_generic_method (m) == declaring)
                                break;
                }
-               if (i >= klass->method.count)
+               if (i >= mcount)
                        return NULL;
        }
 
@@ -734,8 +735,8 @@ class_get_rgctx_template_oti (MonoClass *klass, int type_argc, guint32 slot, gbo
 static MonoClass*
 class_uninstantiated (MonoClass *klass)
 {
-       if (klass->generic_class)
-               return klass->generic_class->container_class;
+       if (mono_class_is_ginst (klass))
+               return mono_class_get_generic_class (klass)->container_class;
        return klass;
 }
 
@@ -835,15 +836,15 @@ class_get_rgctx_template_oti (MonoClass *klass, int type_argc, guint32 slot, gbo
 
        DEBUG (printf ("get slot: %s %d\n", mono_type_full_name (&class->byval_arg), slot));
 
-       if (klass->generic_class && !shared) {
+       if (mono_class_is_ginst (klass) && !shared) {
                MonoRuntimeGenericContextInfoTemplate oti;
                gboolean tmp_do_free;
 
-               oti = class_get_rgctx_template_oti (klass->generic_class->container_class,
+               oti = class_get_rgctx_template_oti (mono_class_get_generic_class (klass)->container_class,
                                                                                        type_argc, slot, TRUE, FALSE, &tmp_do_free);
                if (oti.data) {
                        gpointer info = oti.data;
-                       oti.data = inflate_info (&oti, &klass->generic_class->context, klass, temporary);
+                       oti.data = inflate_info (&oti, &mono_class_get_generic_class (klass)->context, klass, temporary);
                        if (tmp_do_free)
                                free_inflated_info (oti.info_type, info);
                }
@@ -1118,7 +1119,7 @@ get_wrapper_shared_type (MonoType *t)
                        return get_wrapper_shared_type (&mono_defaults.object_class->byval_arg);
 
                klass = mono_class_from_mono_type (t);
-               orig_ctx = &klass->generic_class->context;
+               orig_ctx = &mono_class_get_generic_class (klass)->context;
 
                memset (&ctx, 0, sizeof (MonoGenericContext));
 
@@ -1136,7 +1137,7 @@ get_wrapper_shared_type (MonoType *t)
                                args [i] = get_wrapper_shared_type (inst->type_argv [i]);
                        ctx.method_inst = mono_metadata_get_generic_inst (inst->type_argc, args);
                }
-               klass = mono_class_inflate_generic_class_checked (klass->generic_class->container_class, &ctx, &error);
+               klass = mono_class_inflate_generic_class_checked (mono_class_get_generic_class (klass)->container_class, &ctx, &error);
                mono_error_assert_ok (&error); /* FIXME don't swallow the error */
                return &klass->byval_arg;
        }
@@ -1183,7 +1184,7 @@ mini_get_gsharedvt_in_sig_wrapper (MonoMethodSignature *sig)
        MonoMethod *res, *cached;
        WrapperInfo *info;
        MonoMethodSignature *csig, *gsharedvt_sig;
-       int i, pindex, retval_var;
+       int i, pindex, retval_var = 0;
        static GHashTable *cache;
 
        // FIXME: Memory management
@@ -1646,7 +1647,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
 
                mono_class_setup_vtable (info->klass);
                // FIXME: Check type load
-               if (iface_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+               if (mono_class_is_interface (iface_class)) {
                        ioffset = mono_class_interface_offset (info->klass, iface_class);
                        g_assert (ioffset != -1);
                } else {
@@ -1672,7 +1673,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
 
                mono_class_setup_vtable (info->klass);
                // FIXME: Check type load
-               if (iface_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+               if (mono_class_is_interface (iface_class)) {
                        ioffset = mono_class_interface_offset (info->klass, iface_class);
                        g_assert (ioffset != -1);
                } else {
@@ -1786,7 +1787,7 @@ instantiate_info (MonoDomain *domain, MonoRuntimeGenericContextInfoTemplate *oti
                                /* See mono_emit_method_call_full () */
                                /* The gsharedvt trampoline will recognize this constant */
                                vcall_offset = MONO_GSHAREDVT_DEL_INVOKE_VT_OFFSET;
-                       } else if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+                       } else if (mono_class_is_interface (method->klass)) {
                                guint32 imt_slot = mono_method_get_imt_slot (method);
                                vcall_offset = ((gint32)imt_slot - MONO_IMT_SIZE) * SIZEOF_VOID_P;
                        } else {
@@ -2058,8 +2059,8 @@ register_info (MonoClass *klass, int type_argc, gpointer data, MonoRgctxInfoType
                MonoRuntimeGenericContextTemplate *parent_template;
                MonoRuntimeGenericContextInfoTemplate *oti;
 
-               if (parent->generic_class)
-                       parent = parent->generic_class->container_class;
+               if (mono_class_is_ginst (parent))
+                       parent = mono_class_get_generic_class (parent)->container_class;
 
                parent_template = mono_class_get_runtime_generic_context_template (parent);
                oti = rgctx_template_get_other_slot (parent_template, type_argc, i);
@@ -2313,7 +2314,7 @@ fill_runtime_generic_context (MonoVTable *class_vtable, MonoRuntimeGenericContex
        int i, first_slot, size;
        MonoDomain *domain = class_vtable->domain;
        MonoClass *klass = class_vtable->klass;
-       MonoGenericContext *class_context = klass->generic_class ? &klass->generic_class->context : NULL;
+       MonoGenericContext *class_context = mono_class_is_ginst (klass) ? &mono_class_get_generic_class (klass)->context : NULL;
        MonoRuntimeGenericContextInfoTemplate oti;
        MonoGenericContext context = { class_context ? class_context->class_inst : NULL, method_inst };
        int rgctx_index;
@@ -2483,7 +2484,7 @@ mono_method_lookup_rgctx (MonoVTable *class_vtable, MonoGenericInst *method_inst
        MonoMethodRuntimeGenericContext *mrgctx;
        MonoMethodRuntimeGenericContext key;
 
-       g_assert (!class_vtable->klass->generic_container);
+       g_assert (!mono_class_is_gtd (class_vtable->klass));
        g_assert (!method_inst->is_open);
 
        mono_domain_lock (domain);
@@ -2634,7 +2635,7 @@ mono_method_is_generic_impl (MonoMethod *method)
           if not compiled with sharing. */
        if (method->wrapper_type != MONO_WRAPPER_NONE)
                return FALSE;
-       if (method->klass->generic_container)
+       if (mono_class_is_gtd (method->klass))
                return TRUE;
        return FALSE;
 }
@@ -2786,18 +2787,18 @@ mono_method_is_generic_sharable_full (MonoMethod *method, gboolean allow_type_va
                }
        }
 
-       if (method->klass->generic_class) {
-               if (!mono_generic_context_is_sharable_full (&method->klass->generic_class->context, allow_type_vars, allow_partial))
+       if (mono_class_is_ginst (method->klass)) {
+               if (!mono_generic_context_is_sharable_full (&mono_class_get_generic_class (method->klass)->context, allow_type_vars, allow_partial))
                        return FALSE;
 
-               g_assert (method->klass->generic_class->container_class &&
-                               method->klass->generic_class->container_class->generic_container);
+               g_assert (mono_class_get_generic_class (method->klass)->container_class &&
+                               mono_class_is_gtd (mono_class_get_generic_class (method->klass)->container_class));
 
-               if (has_constraints (method->klass->generic_class->container_class->generic_container))
+               if (has_constraints (mono_class_get_generic_container (mono_class_get_generic_class (method->klass)->container_class)))
                        return FALSE;
        }
 
-       if (method->klass->generic_container && !allow_type_vars)
+       if (mono_class_is_gtd (method->klass) && !allow_type_vars)
                return FALSE;
 
        /* This does potentially expensive cattr checks, so do it at the end */
@@ -2838,7 +2839,7 @@ mono_method_needs_static_rgctx_invoke (MonoMethod *method, gboolean allow_type_v
 
        return ((method->flags & METHOD_ATTRIBUTE_STATIC) ||
                        method->klass->valuetype) &&
-               (method->klass->generic_class || method->klass->generic_container);
+               (mono_class_is_ginst (method->klass) || mono_class_is_gtd (method->klass));
 }
 
 static MonoGenericInst*
@@ -2867,9 +2868,9 @@ mono_method_construct_object_context (MonoMethod *method)
 {
        MonoGenericContext object_context;
 
-       g_assert (!method->klass->generic_class);
-       if (method->klass->generic_container) {
-               int type_argc = method->klass->generic_container->type_argc;
+       g_assert (!mono_class_is_ginst (method->klass));
+       if (mono_class_is_gtd (method->klass)) {
+               int type_argc = mono_class_get_generic_container (method->klass)->type_argc;
 
                object_context.class_inst = get_object_generic_inst (type_argc);
        } else {
@@ -3003,10 +3004,10 @@ mono_generic_context_equal_deep (MonoGenericContext *context1, MonoGenericContex
 MonoClass*
 mini_class_get_container_class (MonoClass *klass)
 {
-       if (klass->generic_class)
-               return klass->generic_class->container_class;
+       if (mono_class_is_ginst (klass))
+               return mono_class_get_generic_class (klass)->container_class;
 
-       g_assert (klass->generic_container);
+       g_assert (mono_class_is_gtd (klass));
        return klass;
 }
 
@@ -3019,11 +3020,11 @@ mini_class_get_container_class (MonoClass *klass)
 MonoGenericContext*
 mini_class_get_context (MonoClass *klass)
 {
-       if (klass->generic_class)
-               return &klass->generic_class->context;
+       if (mono_class_is_ginst (klass))
+               return &mono_class_get_generic_class (klass)->context;
 
-       g_assert (klass->generic_container);
-       return &klass->generic_container->context;
+       g_assert (mono_class_is_gtd (klass));
+       return &mono_class_get_generic_container (klass)->context;
 }
 
 /*
@@ -3205,10 +3206,10 @@ mini_type_is_vtype (MonoType *t)
 gboolean
 mini_class_is_generic_sharable (MonoClass *klass)
 {
-       if (klass->generic_class && is_async_state_machine_class (klass))
+       if (mono_class_is_ginst (klass) && is_async_state_machine_class (klass))
                return FALSE;
 
-       return (klass->generic_class && mono_generic_context_is_sharable (&klass->generic_class->context, FALSE));
+       return (mono_class_is_ginst (klass) && mono_generic_context_is_sharable (&mono_class_get_generic_class (klass)->context, FALSE));
 }
 
 gboolean
@@ -3351,9 +3352,9 @@ get_shared_type (MonoType *t, MonoType *type)
 
                memset (&context, 0, sizeof (context));
                if (gclass->context.class_inst)
-                       context.class_inst = get_shared_inst (gclass->context.class_inst, gclass->container_class->generic_container->context.class_inst, NULL, FALSE, FALSE, TRUE);
+                       context.class_inst = get_shared_inst (gclass->context.class_inst, mono_class_get_generic_container (gclass->container_class)->context.class_inst, NULL, FALSE, FALSE, TRUE);
                if (gclass->context.method_inst)
-                       context.method_inst = get_shared_inst (gclass->context.method_inst, gclass->container_class->generic_container->context.method_inst, NULL, FALSE, FALSE, TRUE);
+                       context.method_inst = get_shared_inst (gclass->context.method_inst, mono_class_get_generic_container (gclass->container_class)->context.method_inst, NULL, FALSE, FALSE, TRUE);
 
                k = mono_class_inflate_generic_class_checked (gclass->container_class, &context, &error);
                mono_error_assert_ok (&error); /* FIXME don't swallow the error */
@@ -3450,11 +3451,13 @@ mini_get_shared_method_full (MonoMethod *method, gboolean all_vt, gboolean is_gs
        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 (info->subtype == WRAPPER_SUBTYPE_NONE) {
+                       MonoMethod *m = mono_marshal_get_delegate_invoke (mini_get_shared_method_full (info->d.delegate_invoke.method, all_vt, is_gsharedvt), NULL);
+                       return m;
+               }
        }
 
-       if (method->is_generic || (method->klass->generic_container && !method->is_inflated)) {
+       if (method->is_generic || (mono_class_is_gtd (method->klass) && !method->is_inflated)) {
                declaring_method = method;
        } else {
                declaring_method = mono_method_get_declaring_generic_method (method);
@@ -3464,14 +3467,14 @@ mini_get_shared_method_full (MonoMethod *method, gboolean all_vt, gboolean is_gs
        if (declaring_method->is_generic)
                shared_context = mono_method_get_generic_container (declaring_method)->context;
        else
-               shared_context = declaring_method->klass->generic_container->context;
+               shared_context = mono_class_get_generic_container (declaring_method->klass)->context;
 
        if (!is_gsharedvt)
                partial = mono_method_is_generic_sharable_full (method, FALSE, TRUE, FALSE);
 
        gsharedvt = is_gsharedvt || (!partial && mini_is_gsharedvt_sharable_method (method));
 
-       class_container = declaring_method->klass->generic_container;
+       class_container = mono_class_try_get_generic_container (declaring_method->klass); //FIXME is this a case for a try_get?
        method_container = mono_method_get_generic_container (declaring_method);
 
        /*
index 1bf14393db25142339add6f35a4e311d3ccbc728..a93ee9d9111282efa41f7bbf365408f93ad5f96b 100644 (file)
@@ -233,7 +233,7 @@ void
 mono_llvm_set_call_notail (LLVMValueRef func)
 {
 #if LLVM_API_VERSION > 100
-       //unwrap<CallInst>(func)->setTailCallKind (CallInst::TailCallKind::TCK_NoTail);
+       unwrap<CallInst>(func)->setTailCallKind (CallInst::TailCallKind::TCK_NoTail);
 #endif
 }
 
index 54873523202042720ff13d345b428e48f2bbab1e..98802978e85ef78a054087c0e0fe85fe7d106ce3 100644 (file)
@@ -6,7 +6,8 @@
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
-#include "mini.h"
+#include "config.h"
+
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/debug-mono-symfile.h>
 #include <mono/metadata/mempool-internals.h>
@@ -33,6 +34,8 @@
 #include "aot-compiler.h"
 #include "mini-llvm.h"
 
+#ifndef DISABLE_JIT
+
 #ifdef __MINGW32__
 
 #include <stddef.h>
@@ -148,6 +151,7 @@ typedef struct {
        LLVMValueRef rgctx_arg;
        LLVMValueRef this_arg;
        LLVMTypeRef *vreg_types;
+       gboolean *is_vphi;
        LLVMTypeRef method_type;
        LLVMBasicBlockRef init_bb, inited_bb;
        gboolean *is_dead;
@@ -1740,6 +1744,8 @@ get_handler_clause (MonoCompile *cfg, MonoBasicBlock *bb)
 static MonoExceptionClause *
 get_most_deep_clause (MonoCompile *cfg, EmitContext *ctx, MonoBasicBlock *bb)
 {
+       if (bb == cfg->bb_init)
+               return NULL;
        // Since they're sorted by nesting we just need
        // the first one that the bb is a member of
        for (int i = 0; i < cfg->header->num_clauses; i++) {
@@ -3484,6 +3490,9 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
 
        lcall = emit_call (ctx, bb, &builder, callee, args, LLVMCountParamTypes (llvm_sig));
 
+       if (ins->opcode != OP_TAILCALL && LLVMGetInstructionOpcode (lcall) == LLVMCall)
+               mono_llvm_set_call_notail (lcall);
+
        /*
         * Modify cconv and parameter attributes to pass rgctx/imt correctly.
         */
@@ -6566,7 +6575,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
 
                /* Convert the value to the type required by phi nodes */
                if (spec [MONO_INST_DEST] != ' ' && !MONO_IS_STORE_MEMBASE (ins) && ctx->vreg_types [ins->dreg]) {
-                       if (!values [ins->dreg])
+                       if (ctx->is_vphi [ins->dreg])
                                /* vtypes */
                                values [ins->dreg] = addresses [ins->dreg];
                        else
@@ -6715,6 +6724,7 @@ free_ctx (EmitContext *ctx)
        g_free (ctx->values);
        g_free (ctx->addresses);
        g_free (ctx->vreg_types);
+       g_free (ctx->is_vphi);
        g_free (ctx->vreg_cli_types);
        g_free (ctx->is_dead);
        g_free (ctx->unreachable);
@@ -6775,6 +6785,7 @@ mono_llvm_emit_method (MonoCompile *cfg)
         */
        ctx->addresses = g_new0 (LLVMValueRef, cfg->next_vreg);
        ctx->vreg_types = g_new0 (LLVMTypeRef, cfg->next_vreg);
+       ctx->is_vphi = g_new0 (gboolean, cfg->next_vreg);
        ctx->vreg_cli_types = g_new0 (MonoType*, cfg->next_vreg);
        ctx->phi_values = g_ptr_array_sized_new (256);
        /* 
@@ -7123,8 +7134,11 @@ emit_method_inner (EmitContext *ctx)
                                for (i = 0; i < ins->inst_phi_args [0]; i++) {
                                        int sreg1 = ins->inst_phi_args [i + 1];
                                        
-                                       if (sreg1 != -1)
+                                       if (sreg1 != -1) {
+                                               if (ins->opcode == OP_VPHI)
+                                                       ctx->is_vphi [sreg1] = TRUE;
                                                ctx->vreg_types [sreg1] = phi_type;
+                                       }
                                }
                                break;
                                }
@@ -8381,7 +8395,7 @@ mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix,
        module->llvm_only = llvm_only;
        /* The first few entries are reserved */
        module->max_got_offset = 16;
-       module->context = LLVMContextCreate ();
+       module->context = LLVMGetGlobalContext ();
 
        if (llvm_only)
                /* clang ignores our debug info because it has an invalid version */
@@ -9189,3 +9203,27 @@ default_mono_llvm_unhandled_exception (void)
  *   code.
  * - use pointer types to help optimizations.
  */
+
+#else /* DISABLE_JIT */
+
+void
+mono_llvm_cleanup (void)
+{
+}
+
+void
+mono_llvm_free_domain_info (MonoDomain *domain)
+{
+}
+
+void
+mono_llvm_init (void)
+{
+}
+
+void
+default_mono_llvm_unhandled_exception (void)
+{
+}
+
+#endif /* DISABLE_JIT */
index 8af84338759ecf8629b8b541dfb679058df08b2e..ea7474dd28bbfbfdd1a6bf703467bf5e23b37141 100644 (file)
@@ -2175,12 +2175,6 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *ins)
        int tmp5 = -1;
 
        switch (ins->opcode) {
-#if 0
-       case OP_LCOMPARE:
-       case OP_LCOMPARE_IMM:
-               mono_print_ins (ins);
-               g_assert_not_reached ();
-#endif
        case OP_LADD:
                tmp1 = mono_alloc_ireg (cfg);
                MONO_EMIT_NEW_BIALU (cfg, OP_IADD, ins->dreg+1, ins->sreg1+1, ins->sreg2+1);
@@ -2217,17 +2211,6 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *ins)
                NULLIFY_INS(ins);
                break;
 
-       case OP_LMUL:
-       case OP_LDIV:
-       case OP_LDIV_UN:
-       case OP_LREM:
-       case OP_LREM_UN:
-       case OP_LSHL:
-       case OP_LSHR:
-       case OP_LSHR_UN:
-               mono_print_ins (ins);
-               g_assert_not_reached ();
-
        case OP_LNEG:
                tmp1 = mono_alloc_ireg (cfg);
                MONO_EMIT_NEW_BIALU (cfg, OP_ISUB, ins->dreg+1, mips_zero, ins->sreg1+1);
@@ -2237,27 +2220,6 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *ins)
                NULLIFY_INS(ins);
                break;
 
-#if 0
-       case OP_LNOT:
-#endif
-#if 0
-       case OP_LCONV_TO_I1:
-       case OP_LCONV_TO_I2:
-       case OP_LCONV_TO_I4:
-       case OP_LCONV_TO_I8:
-       case OP_LCONV_TO_R4:
-       case OP_LCONV_TO_R8:
-       case OP_LCONV_TO_U4:
-       case OP_LCONV_TO_U8:
-       case OP_LCONV_TO_U2:
-       case OP_LCONV_TO_U1:
-       case OP_LCONV_TO_I:
-       case OP_LCONV_TO_OVF_I:
-       case OP_LCONV_TO_OVF_U:
-#endif
-               mono_print_ins (ins);
-               g_assert_not_reached ();
-
        case OP_LADD_OVF:
                tmp1 = mono_alloc_ireg (cfg);
                tmp2 = mono_alloc_ireg (cfg);
@@ -2310,11 +2272,6 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *ins)
                NULLIFY_INS(ins);
                break;
 
-       case OP_LMUL_OVF:
-       case OP_LMUL_OVF_UN:
-               mono_print_ins (ins);
-               g_assert_not_reached ();
-
        case OP_LSUB_OVF:
                tmp1 = mono_alloc_ireg (cfg);
                tmp2 = mono_alloc_ireg (cfg);
@@ -2361,60 +2318,6 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *ins)
                MONO_EMIT_NEW_COMPARE_EXC (cfg, NE_UN, tmp2, mips_zero, "OverflowException");
                NULLIFY_INS(ins);
                break;
-#if 0
-       case OP_LCONV_TO_OVF_I1_UN:
-       case OP_LCONV_TO_OVF_I2_UN:
-       case OP_LCONV_TO_OVF_I4_UN:
-       case OP_LCONV_TO_OVF_I8_UN:
-       case OP_LCONV_TO_OVF_U1_UN:
-       case OP_LCONV_TO_OVF_U2_UN:
-       case OP_LCONV_TO_OVF_U4_UN:
-       case OP_LCONV_TO_OVF_U8_UN:
-       case OP_LCONV_TO_OVF_I_UN:
-       case OP_LCONV_TO_OVF_U_UN:
-       case OP_LCONV_TO_OVF_I1:
-       case OP_LCONV_TO_OVF_U1:
-       case OP_LCONV_TO_OVF_I2:
-       case OP_LCONV_TO_OVF_U2:
-       case OP_LCONV_TO_OVF_I4:
-       case OP_LCONV_TO_OVF_U4:
-       case OP_LCONV_TO_OVF_I8:
-       case OP_LCONV_TO_OVF_U8:
-#endif
-       case OP_LCEQ:
-       case OP_LCGT:
-       case OP_LCGT_UN:
-       case OP_LCLT:
-       case OP_LCLT_UN:
-#if 0
-       case OP_LCONV_TO_R_UN:
-       case OP_LCONV_TO_U:
-#endif
-       case OP_LMUL_IMM:
-       case OP_LSHL_IMM:
-       case OP_LSHR_IMM:
-       case OP_LSHR_UN_IMM:
-       case OP_LDIV_IMM:
-       case OP_LDIV_UN_IMM:
-       case OP_LREM_IMM:
-       case OP_LREM_UN_IMM:
-       case OP_LBEQ:
-       case OP_LBGE:
-       case OP_LBGT:
-       case OP_LBLE:
-       case OP_LBLT:
-       case OP_LBNE_UN:
-       case OP_LBGE_UN:
-       case OP_LBGT_UN:
-       case OP_LBLE_UN:
-       case OP_LBLT_UN:
-               mono_print_ins (ins);
-               g_assert_not_reached ();
-#if 0
-       case OP_LCONV_TO_R8_2:
-       case OP_LCONV_TO_R4_2:
-       case OP_LCONV_TO_R_UN_2:
-#endif
        case OP_LCONV_TO_OVF_I4_2:
                tmp1 = mono_alloc_ireg (cfg);
 
@@ -2424,14 +2327,6 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *ins)
                MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, ins->dreg, ins->sreg1);
                NULLIFY_INS(ins);
                break;
-
-       case OP_LMIN_UN:
-       case OP_LMAX_UN:
-       case OP_LMIN:
-       case OP_LMAX:
-               mono_print_ins (ins);
-               g_assert_not_reached ();
-
        default:
                break;
        }
index 06c533aee46cffa33e738dfd1b665dd6685f85e9..df179bd2545334cd8cf1eca629efc0f54b487a43 100644 (file)
@@ -233,6 +233,15 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_EMULATE_FREM 1
 #endif
 
+/*
+ * mips backend misses some instructions that enable emitting of optimal
+ * code on other targets and, additionally, the register allocator gets
+ * confused by this optimization, failing to allocate all hw regs.
+ */
+#if SIZEOF_REGISTER == 4
+#define MONO_ARCH_NO_DIV_WITH_MUL
+#endif
+
 #if SIZEOF_REGISTER == 8
 #define MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
 #endif
index b0d7a0709db70da65da166e78c821cdd66b50743..14c13a4c683d03803203ba0b6dcc753605fc7f73 100644 (file)
@@ -59,7 +59,6 @@
 #include <mono/utils/dtrace.h>
 #include <mono/utils/mono-signal-handler.h>
 #include <mono/utils/mono-threads.h>
-#include <mono/utils/mono-threads-posix-signals.h>
 
 #include "mini.h"
 #include <string.h>
@@ -335,14 +334,8 @@ MONO_SIG_HANDLER_FUNC (static, profiler_signal_handler)
 
        /* See the comment in mono_runtime_shutdown_stat_profiler (). */
        if (mono_native_thread_id_get () == sampling_thread) {
-#ifdef HAVE_CLOCK_NANOSLEEP
-               if (mono_profiler_get_sampling_mode () == MONO_PROFILER_STAT_MODE_PROCESS) {
-                       InterlockedIncrement (&profiler_interrupt_signals_received);
-                       return;
-               }
-#endif
-
-               g_error ("%s: Unexpected profiler signal received by the sampler thread", __func__);
+               InterlockedIncrement (&profiler_interrupt_signals_received);
+               return;
        }
 
        InterlockedIncrement (&profiler_signals_received);
@@ -761,7 +754,7 @@ mono_runtime_shutdown_stat_profiler (void)
 {
        InterlockedWrite (&sampling_thread_running, 0);
 
-#ifdef HAVE_CLOCK_NANOSLEEP
+#ifndef PLATFORM_MACOSX
        /*
         * There is a slight problem when we're using CLOCK_PROCESS_CPUTIME_ID: If
         * we're shutting down and there's largely no activity in the process other
@@ -774,28 +767,22 @@ mono_runtime_shutdown_stat_profiler (void)
         * sampling_thread_running upon an interrupt and return immediately if it's
         * zero. profiler_signal_handler () has a special case to ignore the signal
         * for the sampler thread.
-        *
-        * We do not need to do this on platforms where we use a regular sleep
-        * based on a monotonic clock. The sleep will return in a reasonable amount
-        * of time in those cases.
         */
-       if (mono_profiler_get_sampling_mode () == MONO_PROFILER_STAT_MODE_PROCESS) {
-               MonoThreadInfo *info;
-
-               // Did it shut down already?
-               if ((info = mono_thread_info_lookup (sampling_thread))) {
-                       while (!InterlockedRead (&sampling_thread_exiting)) {
-                               mono_threads_pthread_kill (info, profiler_signal);
-                               mono_thread_info_usleep (10 * 1000 /* 10ms */);
-                       }
+       MonoThreadInfo *info;
 
-                       // Make sure info can be freed.
-                       mono_hazard_pointer_clear (mono_hazard_pointer_get (), 1);
+       // Did it shut down already?
+       if ((info = mono_thread_info_lookup (sampling_thread))) {
+               while (!InterlockedRead (&sampling_thread_exiting)) {
+                       mono_threads_pthread_kill (info, profiler_signal);
+                       mono_thread_info_usleep (10 * 1000 /* 10ms */);
                }
+
+               // Make sure info can be freed.
+               mono_hazard_pointer_clear (mono_hazard_pointer_get (), 1);
        }
 #endif
 
-       pthread_join (sampling_thread, NULL);
+       mono_native_thread_join (sampling_thread);
 
        /*
         * We can't safely remove the signal handler because we have no guarantee
@@ -825,7 +812,7 @@ mono_runtime_setup_stat_profiler (void)
         */
 #if defined (USE_POSIX_BACKEND) && defined (SIGRTMIN) && !defined (PLATFORM_ANDROID)
        /* Just take the first real-time signal we can get. */
-       profiler_signal = mono_threads_posix_signal_search_alternative (-1);
+       profiler_signal = mono_threads_suspend_search_alternative_signal ();
 #else
        profiler_signal = SIGPROF;
 #endif
index 2ea49cc45689839ed2262a3a372731b8fa5a69b6..bf56b43d45ad23dd9dc30cace177d3819d6df1b0 100644 (file)
@@ -77,13 +77,8 @@ typedef struct MonoCompileArch {
 #define PPC_USES_FUNCTION_DESCRIPTOR
 #endif
 
-#ifndef __mono_ilp32__
-#define MONO_ARCH_HAVE_TLS_GET 1
-#endif
-
 #else /* must be __mono_ppc__ */
 
-#define MONO_ARCH_HAVE_TLS_GET 1
 #define MONO_ARCH_EMULATE_FCONV_TO_I8 1
 #define MONO_ARCH_EMULATE_LCONV_TO_R8 1
 #define MONO_ARCH_EMULATE_LCONV_TO_R4 1
@@ -183,7 +178,6 @@ typedef struct MonoCompileArch {
 #define PPC_LAST_FPARG_REG ppc_f13
 #define PPC_PASS_STRUCTS_BY_VALUE 1
 #define PPC_THREAD_PTR_REG ppc_r13
-#define MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX 1
 #else
 #define PPC_RET_ADDR_OFFSET 4
 #define PPC_STACK_PARAM_OFFSET 8
@@ -200,6 +194,7 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_RETURN_CAN_USE_MULTIPLE_REGISTERS 0
 #define PPC_THREAD_PTR_REG ppc_r2
 #endif
+#define MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX 1
 #define PPC_FIRST_ARG_REG ppc_r3
 #define PPC_LAST_ARG_REG ppc_r10
 #define PPC_FIRST_FPARG_REG ppc_f1
index 231b44d65ecda7a9d32996d8283a86df082d2682..572048ff5ff8b401b415ab6ba0fe9de8e88cc02f 100644 (file)
@@ -65,7 +65,7 @@
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/mono-threads-coop.h>
 #include <mono/utils/checked-build.h>
-#include <mono/utils/w32handle.h>
+#include <mono/metadata/w32handle.h>
 #include <mono/io-layer/io-layer.h>
 
 #include "mini.h"
@@ -341,7 +341,7 @@ void *mono_global_codeman_reserve (int size)
        void *ptr;
 
        if (mono_aot_only)
-               g_error ("Attempting to allocate from the global code manager while running with --aot-only.\n");
+               g_error ("Attempting to allocate from the global code manager while running in aot-only mode.\n");
 
        if (!global_codeman) {
                /* This can happen during startup */
@@ -1094,6 +1094,63 @@ mono_patch_info_list_prepend (MonoJumpInfo *list, int ip, MonoJumpInfoType type,
        return ji;
 }
 
+#if !defined(DISABLE_LOGGING) && !defined(DISABLE_JIT)
+
+static const char* const patch_info_str[] = {
+#define PATCH_INFO(a,b) "" #a,
+#include "patch-info.h"
+#undef PATCH_INFO
+};
+
+const char*
+mono_ji_type_to_string (MonoJumpInfoType type)
+{
+       return patch_info_str [type];
+}
+
+void
+mono_print_ji (const MonoJumpInfo *ji)
+{
+       switch (ji->type) {
+       case MONO_PATCH_INFO_RGCTX_FETCH: {
+               MonoJumpInfoRgctxEntry *entry = ji->data.rgctx_entry;
+
+               printf ("[RGCTX_FETCH ");
+               mono_print_ji (entry->data);
+               printf (" - %s]", mono_rgctx_info_type_to_str (entry->info_type));
+               break;
+       }
+       case MONO_PATCH_INFO_METHODCONST: {
+               char *s = mono_method_full_name (ji->data.method, TRUE);
+               printf ("[METHODCONST - %s]", s);
+               g_free (s);
+               break;
+       }
+       case MONO_PATCH_INFO_INTERNAL_METHOD: {
+               printf ("[INTERNAL_METHOD - %s]", ji->data.name);
+               break;
+       }
+       default:
+               printf ("[%s]", patch_info_str [ji->type]);
+               break;
+       }
+}
+
+#else
+
+const char*
+mono_ji_type_to_string (MonoJumpInfoType type)
+{
+       return "";
+}
+
+void
+mono_print_ji (const MonoJumpInfo *ji)
+{
+}
+
+#endif
+
 /**
  * mono_patch_info_dup_mp:
  *
@@ -1222,6 +1279,7 @@ mono_patch_info_hash (gconstpointer data)
        case MONO_PATCH_INFO_GOT_OFFSET:
        case MONO_PATCH_INFO_GC_SAFE_POINT_FLAG:
        case MONO_PATCH_INFO_AOT_MODULE:
+       case MONO_PATCH_INFO_GET_TLS_TRAMP:
                return (ji->type << 8);
        case MONO_PATCH_INFO_CASTCLASS_CACHE:
                return (ji->type << 8) | (ji->data.index);
@@ -1441,11 +1499,11 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
                break;
        case MONO_PATCH_INFO_IID:
                mono_class_init (patch_info->data.klass);
-               target = GINT_TO_POINTER ((int)patch_info->data.klass->interface_id);
+               target = GUINT_TO_POINTER (patch_info->data.klass->interface_id);
                break;
        case MONO_PATCH_INFO_ADJUSTED_IID:
                mono_class_init (patch_info->data.klass);
-               target = GINT_TO_POINTER ((int)(-((patch_info->data.klass->interface_id + 1) * SIZEOF_VOID_P)));
+               target = GUINT_TO_POINTER ((guint32)(-((patch_info->data.klass->interface_id + 1) * SIZEOF_VOID_P)));
                break;
        case MONO_PATCH_INFO_VTABLE:
                target = mono_class_vtable (domain, patch_info->data.klass);
@@ -1475,7 +1533,7 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
                }
 
                g_assert (vtable);
-               if (!vtable->initialized && !(vtable->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) && (method && mono_class_needs_cctor_run (vtable->klass, method)))
+               if (!vtable->initialized && !mono_class_is_before_field_init (vtable->klass) && (method && mono_class_needs_cctor_run (vtable->klass, method)))
                        /* Done by the generated code */
                        ;
                else {
@@ -1661,6 +1719,13 @@ mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code,
        case MONO_PATCH_INFO_GSHAREDVT_IN_WRAPPER:
                target = mini_get_gsharedvt_wrapper (TRUE, NULL, patch_info->data.sig, NULL, -1, FALSE);
                break;
+       case MONO_PATCH_INFO_GET_TLS_TRAMP:
+#ifdef MONO_ARCH_HAVE_GET_TLS_TRAMP
+               target = mono_arch_get_get_tls_tramp ();
+#else
+               target = NULL;
+#endif
+               break;
        default:
                g_assert_not_reached ();
        }
@@ -1879,6 +1944,15 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoError *er
                if ((code = mono_aot_get_method_checked (domain, method, error))) {
                        MonoVTable *vtable;
 
+                       if (mono_runtime_is_critical_method (method) || mono_gc_is_critical_method (method)) {
+                               /*
+                                * The suspend code needs to be able to lookup these methods by ip in async context,
+                                * so preload their jit info.
+                                */
+                               MonoJitInfo *ji = mono_jit_info_table_find (domain, code);
+                               g_assert (ji);
+                       }
+
                        /*
                         * In llvm-only mode, method might be a shared method, so we can't initialize its class.
                         * This is not a problem, since it will be initialized when the method is first
@@ -3086,7 +3160,7 @@ mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *met
                return NULL;
 
        is_virtual_generic = method->is_inflated && mono_method_get_declaring_generic_method (method)->is_generic;
-       is_interface = method->klass->flags & TYPE_ATTRIBUTE_INTERFACE ? TRUE : FALSE;
+       is_interface = mono_class_is_interface (method->klass);
        load_imt_reg = is_virtual_generic || is_interface;
 
        if (is_interface)
@@ -4201,7 +4275,7 @@ mono_precompile_assembly (MonoAssembly *ass, void *user_data)
                }
                if (method->flags & METHOD_ATTRIBUTE_ABSTRACT)
                        continue;
-               if (method->is_generic || method->klass->generic_container)
+               if (method->is_generic || mono_class_is_gtd (method->klass))
                        continue;
 
                count++;
@@ -4256,3 +4330,23 @@ mono_personality (void)
        /* Not used */
        g_assert_not_reached ();
 }
+
+// Custom handlers currently only implemented by Windows.
+#ifndef HOST_WIN32
+gboolean
+mono_runtime_install_custom_handlers (const char *handlers)
+{
+       return FALSE;
+}
+
+void
+mono_runtime_install_custom_handlers_usage (void)
+{
+       fprintf (stdout,
+                "Custom Handlers:\n"
+                "   --handlers=HANDLERS            Enable handler support, HANDLERS is a comma\n"
+                "                                  separated list of available handlers to install.\n"
+                "\n"
+                "No handlers supported on current platform.\n");
+}
+#endif /* HOST_WIN32 */
index 420a7b1a3bf6e0ce0c8dc951b45fa71049e34eb9..c3f763ac5d0670b23b3a9373ff2f428f730ece1a 100644 (file)
@@ -1292,6 +1292,7 @@ handle_enum:
 
        ip = ((gint64) __builtin_extract_return_addr (__builtin_return_address (0)));
        printf (" ip: %p\n", (gpointer) ip);
+       va_end (ap);
 }
 
 /*========================= End of Function ========================*/
index 122334e6ea6519613d4bd8e741fac583c13bafc7..7f37b4d8595122215981e9ac372ad48ab5b732fe 100644 (file)
@@ -198,8 +198,8 @@ mini_resolve_imt_method (MonoVTable *vt, gpointer *vtable_slot, MonoMethod *imt_
                /* imt_method->slot might not be set */
                impl = mono_class_get_vtable_entry (vt->klass, interface_offset + mono_method_get_declaring_generic_method (imt_method)->slot);
 
-               if (impl->klass->generic_class)
-                       context.class_inst = impl->klass->generic_class->context.class_inst;
+               if (mono_class_is_ginst (impl->klass))
+                       context.class_inst = mono_class_get_generic_class (impl->klass)->context.class_inst;
                context.method_inst = ((MonoMethodInflated*)imt_method)->context.method_inst;
                impl = mono_class_inflate_generic_method_checked (impl, &context, error);
                mono_error_assert_ok (error);
@@ -591,10 +591,10 @@ common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTable *
                else
                        declaring = m;
 
-               if (m->klass->generic_class)
-                       context.class_inst = m->klass->generic_class->context.class_inst;
+               if (mono_class_is_ginst (m->klass))
+                       context.class_inst = mono_class_get_generic_class (m->klass)->context.class_inst;
                else
-                       g_assert (!m->klass->generic_container);
+                       g_assert (!mono_class_is_gtd (m->klass));
 
                generic_virtual = mono_arch_find_imt_method (regs, code);
                g_assert (generic_virtual);
@@ -662,10 +662,10 @@ common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTable *
                        else
                                declaring = m;
 
-                       if (klass->generic_class)
-                               context.class_inst = klass->generic_class->context.class_inst;
-                       else if (klass->generic_container)
-                               context.class_inst = klass->generic_container->context.class_inst;
+                       if (mono_class_is_ginst (klass))
+                               context.class_inst = mono_class_get_generic_class (klass)->context.class_inst;
+                       else if (mono_class_is_gtd (klass))
+                               context.class_inst = mono_class_get_generic_container (klass)->context.class_inst;
                        context.method_inst = method_inst;
 
                        actual_method = mono_class_inflate_generic_method_checked (declaring, &context, error);
@@ -850,7 +850,7 @@ mono_vcall_trampoline (mgreg_t *regs, guint8 *code, int slot, guint8 *tramp)
        gpointer *vtable_slot;
        MonoMethod *m;
        MonoError error;
-       gpointer addr, res;
+       gpointer addr, res = NULL;
 
        trampoline_calls ++;
 
@@ -935,10 +935,10 @@ mono_generic_virtual_remoting_trampoline (mgreg_t *regs, guint8 *code, MonoMetho
        else
                declaring = m;
 
-       if (m->klass->generic_class)
-               context.class_inst = m->klass->generic_class->context.class_inst;
+       if (mono_class_is_ginst (m->klass))
+               context.class_inst = mono_class_get_generic_class (m->klass)->context.class_inst;
        else
-               g_assert (!m->klass->generic_container);
+               g_assert (!mono_class_is_gtd (m->klass));
 
        imt_method = mono_arch_find_imt_method (regs, code);
        if (imt_method->is_inflated)
@@ -1188,7 +1188,7 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr
                         * If the call doesn't return a valuetype, then the vcall uses the same calling
                         * convention as a normal call.
                         */
-                       if (((method->klass->flags & TYPE_ATTRIBUTE_SEALED) || !(method->flags & METHOD_ATTRIBUTE_VIRTUAL)) && !MONO_TYPE_ISSTRUCT (sig->ret)) {
+                       if ((mono_class_is_sealed (method->klass) || !(method->flags & METHOD_ATTRIBUTE_VIRTUAL)) && !MONO_TYPE_ISSTRUCT (sig->ret)) {
                                callvirt = FALSE;
                                enable_caching = FALSE;
                        }
@@ -1197,7 +1197,7 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *arg, guint8* tr
                if (delegate->target && 
                        method->flags & METHOD_ATTRIBUTE_VIRTUAL && 
                        method->flags & METHOD_ATTRIBUTE_ABSTRACT &&
-                       method->klass->flags & TYPE_ATTRIBUTE_ABSTRACT) {
+                       mono_class_is_abstract (method->klass)) {
                        method = mono_object_get_virtual_method (delegate->target, method);
                        enable_caching = FALSE;
                }
diff --git a/mono/mini/mini-windows-uwp.c b/mono/mini/mini-windows-uwp.c
new file mode 100644 (file)
index 0000000..2d47970
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * mini-windows-uwp.c: UWP profiler stat support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+
+void
+mono_runtime_setup_stat_profiler (void)
+{
+       g_unsupported_api ("OpenThread, GetThreadContext");
+       SetLastError (ERROR_NOT_SUPPORTED);
+       return;
+}
+
+void
+mono_runtime_shutdown_stat_profiler (void)
+{
+       g_unsupported_api ("OpenThread, GetThreadContext");
+       SetLastError (ERROR_NOT_SUPPORTED);
+       return;
+}
+
+static gboolean
+mono_setup_thread_context(DWORD thread_id, MonoContext *mono_context)
+{
+       memset (mono_context, 0, sizeof (MonoContext));
+       return FALSE;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (mini_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
index e7764e91beb749709474b294aef00cb5c30932ce..728583f3bf1b6c504ffbf9b82614cad8dce5d701 100644 (file)
@@ -13,6 +13,8 @@
 #include <config.h>
 #include <signal.h>
 #include <math.h>
+#include <conio.h>
+#include <assert.h>
 
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/loader.h>
@@ -44,6 +46,7 @@
 #include <mono/utils/dtrace.h>
 
 #include "mini.h"
+#include "mini-windows.h"
 #include <string.h>
 #include <ctype.h>
 #include "trace.h"
 
 #include "jit-icalls.h"
 
-#ifdef _WIN32
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 #include <mmsystem.h>
 #endif
 
+#define MONO_HANDLER_DELIMITER ','
+#define MONO_HANDLER_DELIMITER_LEN G_N_ELEMENTS(MONO_HANDLER_DELIMITER)-1
+
+#define MONO_HANDLER_ATEXIT_WAIT_KEYPRESS "atexit-waitkeypress"
+#define MONO_HANDLER_ATEXIT_WAIT_KEYPRESS_LEN G_N_ELEMENTS(MONO_HANDLER_ATEXIT_WAIT_KEYPRESS)-1
+
+// Typedefs used to setup handler table.
+typedef void (*handler)(void);
+
+typedef struct {
+       const char * cmd;
+       const int cmd_len;
+       handler handler;
+} HandlerItem;
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+/**
+* atexit_wait_keypress:
+*
+* This function is installed as an atexit function making sure that the console is not terminated before the end user has a chance to read the result.
+* This can be handy in debug scenarios (running from within the debugger) since an exit of the process will close the console window
+* without giving the end user a chance to look at the output before closed.
+*/
+static void
+atexit_wait_keypress (void)
+{
+
+       fflush (stdin);
+
+       printf ("Press any key to continue . . . ");
+       fflush (stdout);
+
+       _getch ();
+
+       return;
+}
+
+/**
+* install_atexit_wait_keypress:
+*
+* This function installs the wait keypress exit handler.
+*/
+static void
+install_atexit_wait_keypress (void)
+{
+       atexit (atexit_wait_keypress);
+       return;
+}
+
+#else
+
+/**
+* install_atexit_wait_keypress:
+*
+* Not supported on WINAPI family.
+*/
+static void
+install_atexit_wait_keypress (void)
+{
+       return;
+}
+
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+// Table describing handlers that can be installed at process startup. Adding a new handler can be done by adding a new item to the table together with an install handler function.
+const HandlerItem g_handler_items[] = { { MONO_HANDLER_ATEXIT_WAIT_KEYPRESS, MONO_HANDLER_ATEXIT_WAIT_KEYPRESS_LEN, install_atexit_wait_keypress },
+                                       { NULL, 0, NULL } };
+
+/**
+ * get_handler_arg_len:
+ * @handlers: Get length of next handler.
+ *
+ * This function calculates the length of next handler included in argument.
+ *
+ * Returns: The length of next handler, if available.
+ */
+static size_t
+get_next_handler_arg_len (const char *handlers)
+{
+       assert (handlers != NULL);
+
+       size_t current_len = 0;
+       const char *handler = strchr (handlers, MONO_HANDLER_DELIMITER);
+       if (handler != NULL) {
+               // Get length of next handler arg.
+               current_len = (handler - handlers);
+       } else {
+               // Consume rest as length of next handler arg.
+               current_len = strlen (handlers);
+       }
+
+       return current_len;
+}
+
+/**
+ * install_custom_handler:
+ * @handlers: Handlers included in --handler argument, example "atexit-waitkeypress,someothercmd,yetanothercmd".
+ * @handler_arg_len: Output, length of consumed handler.
+ *
+ * This function installs the next handler included in @handlers parameter.
+ *
+ * Returns: TRUE on successful install, FALSE on failure or unrecognized handler.
+ */
+static gboolean
+install_custom_handler (const char *handlers, size_t *handler_arg_len)
+{
+       gboolean result = FALSE;
+
+       assert (handlers != NULL);
+       assert (handler_arg_len);
+
+       *handler_arg_len = get_next_handler_arg_len (handlers);
+       for (int current_item = 0; current_item < G_N_ELEMENTS (g_handler_items); ++current_item) {
+               const HandlerItem * handler_item = &g_handler_items [current_item];
+
+               if (handler_item->cmd == NULL)
+                       continue;
+
+               if (*handler_arg_len == handler_item->cmd_len && strncmp (handlers, handler_item->cmd, *handler_arg_len) == 0) {
+                       assert (handler_item->handler != NULL);
+                       handler_item->handler ();
+                       result = TRUE;
+                       break;
+               }
+       }
+       return result;
+}
+
 void
 mono_runtime_install_handlers (void)
 {
@@ -68,6 +199,44 @@ mono_runtime_install_handlers (void)
 #endif
 }
 
+gboolean
+mono_runtime_install_custom_handlers (const char *handlers)
+{
+       gboolean result = FALSE;
+
+       assert (handlers != NULL);
+       while (*handlers != '\0') {
+               size_t handler_arg_len = 0;
+
+               result = install_custom_handler (handlers, &handler_arg_len);
+               handlers += handler_arg_len;
+
+               if (*handlers == MONO_HANDLER_DELIMITER)
+                       handlers++;
+               if (!result)
+                       break;
+       }
+
+       return result;
+}
+
+void
+mono_runtime_install_custom_handlers_usage (void)
+{
+       fprintf (stdout,
+                "Custom Handlers:\n"
+                "   --handlers=HANDLERS            Enable handler support, HANDLERS is a comma\n"
+                "                                  separated list of available handlers to install.\n"
+                "\n"
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+                "HANDLERS is composed of:\n"
+                "    atexit-waitkeypress           Install an atexit handler waiting for a keypress\n"
+                "                                  before exiting process.\n");
+#else
+                "No handlers supported on current platform.\n");
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+}
+
 void
 mono_runtime_cleanup_handlers (void)
 {
@@ -91,16 +260,17 @@ MONO_SIG_HANDLER_SIGNATURE (mono_chain_signal)
        return TRUE;
 }
 
-static HANDLE win32_main_thread;
-static MMRESULT win32_timer;
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+static MMRESULT        g_timer_event = 0;
+static HANDLE g_timer_main_thread = INVALID_HANDLE_VALUE;
 
-static void CALLBACK
-win32_time_proc (UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
+static VOID
+thread_timer_expired (HANDLE thread)
 {
        CONTEXT context;
 
        context.ContextFlags = CONTEXT_CONTROL;
-       if (GetThreadContext (win32_main_thread, &context)) {
+       if (GetThreadContext (thread, &context)) {
 #ifdef _WIN64
                mono_profiler_stat_hit ((guchar *) context.Rip, &context);
 #else
@@ -109,57 +279,75 @@ win32_time_proc (UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
        }
 }
 
-void
-mono_runtime_setup_stat_profiler (void)
+static VOID CALLBACK
+timer_event_proc (UINT uID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2)
 {
-       static int inited = 0;
-       TIMECAPS timecaps;
+       thread_timer_expired ((HANDLE)dwUser);
+}
 
-       if (inited)
-               return;
+static VOID
+stop_profiler_timer_event (void)
+{
+       if (g_timer_event != 0) {
+
+               timeKillEvent (g_timer_event);
+               g_timer_event = 0;
+       }
+
+       if (g_timer_main_thread != INVALID_HANDLE_VALUE) {
+
+               CloseHandle (g_timer_main_thread);
+               g_timer_main_thread = INVALID_HANDLE_VALUE;
+       }
+}
+
+static VOID
+start_profiler_timer_event (void)
+{
+       g_return_if_fail (g_timer_main_thread == INVALID_HANDLE_VALUE && g_timer_event == 0);
+
+       TIMECAPS timecaps;
 
-       inited = 1;
        if (timeGetDevCaps (&timecaps, sizeof (timecaps)) != TIMERR_NOERROR)
                return;
 
-       if ((win32_main_thread = OpenThread (READ_CONTROL | THREAD_GET_CONTEXT, FALSE, GetCurrentThreadId ())) == NULL)
+       g_timer_main_thread = OpenThread (READ_CONTROL | THREAD_GET_CONTEXT, FALSE, GetCurrentThreadId ());
+       if (g_timer_main_thread == NULL)
                return;
 
        if (timeBeginPeriod (1) != TIMERR_NOERROR)
                return;
 
-       if ((win32_timer = timeSetEvent (1, 0, (LPTIMECALLBACK)win32_time_proc, (DWORD_PTR)NULL, TIME_PERIODIC)) == 0) {
+       g_timer_event = timeSetEvent (1, 0, (LPTIMECALLBACK)timer_event_proc, (DWORD_PTR)g_timer_main_thread, TIME_PERIODIC | TIME_KILL_SYNCHRONOUS);
+       if (g_timer_event == 0) {
                timeEndPeriod (1);
                return;
        }
 }
 
+void
+mono_runtime_setup_stat_profiler (void)
+{
+       start_profiler_timer_event ();
+       return;
+}
+
 void
 mono_runtime_shutdown_stat_profiler (void)
 {
+       stop_profiler_timer_event ();
+       return;
 }
 
 gboolean
-mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo *info)
+mono_setup_thread_context(DWORD thread_id, MonoContext *mono_context)
 {
-       DWORD id = mono_thread_info_get_tid (info);
        HANDLE handle;
        CONTEXT context;
-       DWORD result;
-       MonoContext *ctx;
-       MonoJitTlsData *jit_tls;
-       void *domain;
-       MonoLMF *lmf = NULL;
-       gpointer *addr;
-
-       tctx->valid = FALSE;
-       tctx->unwind_data [MONO_UNWIND_DATA_DOMAIN] = NULL;
-       tctx->unwind_data [MONO_UNWIND_DATA_LMF] = NULL;
-       tctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS] = NULL;
 
-       g_assert (id != GetCurrentThreadId ());
+       g_assert (thread_id != GetCurrentThreadId ());
 
-       handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
+       handle = OpenThread (THREAD_ALL_ACCESS, FALSE, thread_id);
        g_assert (handle);
 
        context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL;
@@ -172,10 +360,29 @@ mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo
        g_assert (context.ContextFlags & CONTEXT_INTEGER);
        g_assert (context.ContextFlags & CONTEXT_CONTROL);
 
-       ctx = &tctx->ctx;
+       memset (mono_context, 0, sizeof (MonoContext));
+       mono_sigctx_to_monoctx (&context, mono_context);
 
-       memset (ctx, 0, sizeof (MonoContext));
-       mono_sigctx_to_monoctx (&context, ctx);
+       CloseHandle (handle);
+       return TRUE;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+gboolean
+mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo *info)
+{
+       DWORD id = mono_thread_info_get_tid (info);
+       MonoJitTlsData *jit_tls;
+       void *domain;
+       MonoLMF *lmf = NULL;
+       gpointer *addr;
+
+       tctx->valid = FALSE;
+       tctx->unwind_data [MONO_UNWIND_DATA_DOMAIN] = NULL;
+       tctx->unwind_data [MONO_UNWIND_DATA_LMF] = NULL;
+       tctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS] = NULL;
+
+       mono_setup_thread_context(id, &tctx->ctx);
 
        /* mono_set_jit_tls () sets this */
        jit_tls = mono_thread_info_tls_get (info, TLS_KEY_JIT_TLS);
@@ -203,4 +410,3 @@ mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo
 
        return TRUE;
 }
-
diff --git a/mono/mini/mini-windows.h b/mono/mini/mini-windows.h
new file mode 100644 (file)
index 0000000..ba823c3
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef __MONO_MINI_WINDOWS_H__
+#define __MONO_MINI_WINDOWS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include "windows.h"
+#include "mini.h"
+#include "mono/utils/mono-context.h"
+
+gboolean
+mono_setup_thread_context(DWORD thread_id, MonoContext *mono_context);
+#endif /* HOST_WIN32 */
+#endif /* __MONO_MINI_WINDOWS_H__ */
index ac92addeac2ad6de6f3fe5228a5bf6833bddf549..5b42ca510f34ffa07def506ffdb86ffff3612339 100644 (file)
@@ -1052,7 +1052,7 @@ mini_method_verify (MonoCompile *cfg, MonoMethod *method, gboolean fail_compile)
                                        else if (info->exception_type == MONO_EXCEPTION_FIELD_ACCESS)
                                                mono_error_set_generic_error (&cfg->error, "System", "FieldAccessException", "%s", msg);
                                        else if (info->exception_type == MONO_EXCEPTION_UNVERIFIABLE_IL)
-                                               mono_error_set_generic_error (&cfg->error, "System.Security", "VerificationException", msg);
+                                               mono_error_set_generic_error (&cfg->error, "System.Security", "VerificationException", "%s", msg);
                                        if (!mono_error_ok (&cfg->error)) {
                                                mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
                                                g_free (msg);
@@ -2422,7 +2422,7 @@ mono_codegen (MonoCompile *cfg)
                gboolean is_generic = FALSE;
 
                if (cfg->method->is_inflated || mono_method_get_generic_container (cfg->method) ||
-                               cfg->method->klass->generic_container || cfg->method->klass->generic_class) {
+                               mono_class_is_gtd (cfg->method->klass) || mono_class_is_ginst (cfg->method->klass)) {
                        is_generic = TRUE;
                }
 
@@ -3175,6 +3175,9 @@ init_backend (MonoBackend *backend)
 #ifdef MONO_ARCH_DYN_CALL_PARAM_AREA
        backend->dyn_call_param_area = MONO_ARCH_DYN_CALL_PARAM_AREA;
 #endif
+#ifdef MONO_ARCH_NO_DIV_WITH_MUL
+       backend->disable_div_with_mul = 1;
+#endif
 }
 
 /*
@@ -3312,6 +3315,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        cfg->soft_breakpoints = debug_options.soft_breakpoints;
        cfg->check_pinvoke_callconv = debug_options.check_pinvoke_callconv;
        cfg->disable_direct_icalls = disable_direct_icalls;
+       cfg->direct_pinvoke = (flags & JIT_FLAG_DIRECT_PINVOKE) != 0;
        if (try_generic_shared)
                cfg->gshared = TRUE;
        cfg->compile_llvm = try_llvm;
@@ -3332,7 +3336,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                cfg->seq_points = g_ptr_array_new ();
        mono_error_init (&cfg->error);
 
-       if (cfg->compile_aot && !try_generic_shared && (method->is_generic || method->klass->generic_container || method_is_gshared)) {
+       if (cfg->compile_aot && !try_generic_shared && (method->is_generic || mono_class_is_gtd (method->klass) || method_is_gshared)) {
                cfg->exception_type = MONO_EXCEPTION_GENERIC_SHARING_FAILED;
                return cfg;
        }
@@ -4053,7 +4057,7 @@ void
 mono_cfg_set_exception_invalid_program (MonoCompile *cfg, char *msg)
 {
        mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
-       mono_error_set_generic_error (&cfg->error, "System", "InvalidProgramException", msg);
+       mono_error_set_generic_error (&cfg->error, "System", "InvalidProgramException", "%s", msg);
 }
 
 #endif /* DISABLE_JIT */
@@ -4241,7 +4245,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
 
        if (mono_aot_only) {
                char *fullname = mono_method_full_name (method, TRUE);
-               mono_error_set_execution_engine (error, "Attempting to JIT compile method '%s' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.\n", fullname);
+               mono_error_set_execution_engine (error, "Attempting to JIT compile method '%s' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.\n", fullname);
                g_free (fullname);
 
                return NULL;
index d3a550946013f217c8c53ccb20b118d2d844badf..9e6f8f7523f5702fccc496b9433cd0abc5a02422 100644 (file)
@@ -507,7 +507,9 @@ enum {
 /* INEG sets the condition codes, and the OP_LNEG decomposition depends on this on x86 */
 #define MONO_INS_HAS_NO_SIDE_EFFECT(ins) (MONO_IS_MOVE (ins) || (ins->opcode == OP_ICONST) || (ins->opcode == OP_I8CONST) || MONO_IS_ZERO (ins) || (ins->opcode == OP_ADD_IMM) || (ins->opcode == OP_R8CONST) || (ins->opcode == OP_LADD_IMM) || (ins->opcode == OP_ISUB_IMM) || (ins->opcode == OP_IADD_IMM) || (ins->opcode == OP_LNEG) || (ins->opcode == OP_ISUB) || (ins->opcode == OP_CMOV_IGE) || (ins->opcode == OP_ISHL_IMM) || (ins->opcode == OP_ISHR_IMM) || (ins->opcode == OP_ISHR_UN_IMM) || (ins->opcode == OP_IAND_IMM) || (ins->opcode == OP_ICONV_TO_U1) || (ins->opcode == OP_ICONV_TO_I1) || (ins->opcode == OP_SEXT_I4) || (ins->opcode == OP_LCONV_TO_U1) || (ins->opcode == OP_ICONV_TO_U2) || (ins->opcode == OP_ICONV_TO_I2) || (ins->opcode == OP_LCONV_TO_I2) || (ins->opcode == OP_LDADDR) || (ins->opcode == OP_PHI) || (ins->opcode == OP_NOP) || (ins->opcode == OP_ZEXT_I4) || (ins->opcode == OP_NOT_NULL) || (ins->opcode == OP_IL_SEQ_POINT))
 
-#define MONO_METHOD_IS_FINAL(m) (((m)->flags & METHOD_ATTRIBUTE_FINAL) || ((m)->klass && ((m)->klass->flags & TYPE_ATTRIBUTE_SEALED)))
+#define MONO_INS_IS_PCONST_NULL(ins) ((ins)->opcode == OP_PCONST && (ins)->inst_p0 == 0)
+
+#define MONO_METHOD_IS_FINAL(m) (((m)->flags & METHOD_ATTRIBUTE_FINAL) || ((m)->klass && (mono_class_get_flags ((m)->klass) & TYPE_ATTRIBUTE_SEALED)))
 
 
 #ifdef MONO_ARCH_SIMD_INTRINSICS
@@ -1496,6 +1498,7 @@ typedef struct {
        guint            need_got_var : 1;
        guint            need_div_check : 1;
        guint            no_unaligned_access : 1;
+       guint            disable_div_with_mul : 1;
        int              monitor_enter_adjustment;
        int              dyn_call_param_area;
 } MonoBackend;
@@ -1510,12 +1513,14 @@ typedef enum {
        JIT_FLAG_FULL_AOT = (1 << 2),
        /* Whenever to compile with LLVM */
        JIT_FLAG_LLVM = (1 << 3),
-       /* Whenever to disable direct calls to direct calls to icall functions */
+       /* Whenever to disable direct calls to icall functions */
        JIT_FLAG_NO_DIRECT_ICALLS = (1 << 4),
        /* Emit explicit null checks */
        JIT_FLAG_EXPLICIT_NULL_CHECKS = (1 << 5),
        /* Whenever to compile in llvm-only mode */
        JIT_FLAG_LLVM_ONLY = (1 << 6),
+       /* Whenever calls to pinvoke functions are made directly */
+       JIT_FLAG_DIRECT_PINVOKE = (1 << 7)
 } JitFlags;
 
 /* Bit-fields in the MonoBasicBlock.region */
@@ -1685,6 +1690,7 @@ typedef struct {
        guint            disable_out_of_line_bblocks : 1;
        guint            disable_direct_icalls : 1;
        guint            disable_gc_safe_points : 1;
+       guint            direct_pinvoke : 1;
        guint            create_lmf_var : 1;
        /*
         * When this is set, the code to push/pop the LMF from the LMF stack is generated as IR
@@ -1740,7 +1746,7 @@ typedef struct {
        guint8          *thunks;
        /* Offset between the start of code and the thunks area */
        int              thunks_offset;
-       guint32          exception_type;        /* MONO_EXCEPTION_* */
+       MonoExceptionType exception_type;       /* MONO_EXCEPTION_* */
        guint32          exception_data;
        char*            exception_message;
        gpointer         exception_ptr;
@@ -2676,6 +2682,7 @@ guint8*   mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo *
 gpointer  mono_arch_create_monitor_enter_trampoline (MonoTrampInfo **info, gboolean is_v4, gboolean aot);
 gpointer  mono_arch_create_monitor_exit_trampoline (MonoTrampInfo **info, gboolean aot);
 guint8   *mono_arch_create_llvm_native_thunk     (MonoDomain *domain, guint8* addr) MONO_LLVM_INTERNAL;
+gpointer  mono_arch_get_get_tls_tramp (void);
 GList    *mono_arch_get_allocatable_int_vars    (MonoCompile *cfg);
 GList    *mono_arch_get_global_int_regs         (MonoCompile *cfg);
 GList    *mono_arch_get_global_fp_regs          (MonoCompile *cfg);
@@ -3149,6 +3156,8 @@ gboolean mono_jit_map_is_enabled (void);
  * Per-OS implementation functions.
  */
 void mono_runtime_install_handlers (void);
+gboolean mono_runtime_install_custom_handlers (const char *handlers);
+void mono_runtime_install_custom_handlers_usage (void);
 void mono_runtime_cleanup_handlers (void);
 void mono_runtime_setup_stat_profiler (void);
 void mono_runtime_shutdown_stat_profiler (void);
index e6635a4b49c8cfe2bf945c3efeb683bf9ea44a18..a55700355721adf50355dbc89013664042f1d700 100644 (file)
@@ -57,3 +57,4 @@ PATCH_INFO(AOT_JIT_INFO, "aot_jit_info")
 PATCH_INFO(GC_NURSERY_BITS, "gc_nursery_bits")
 PATCH_INFO(GSHAREDVT_IN_WRAPPER, "gsharedvt_in_wrapper")
 PATCH_INFO(ICALL_ADDR_CALL, "icall_addr_call")
+PATCH_INFO(GET_TLS_TRAMP, "get_tls_tramp")
index cb100267ef706a6c3608f7b09e12f5dcb92e1cfb..d70788c6afb39ce430fcde647838b3ca7689e66b 100644 (file)
@@ -13,6 +13,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/mempool.h>
 #include <mono/metadata/mempool-internals.h>
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_JIT
 
@@ -1515,4 +1516,8 @@ mono_ssa_loop_invariant_code_motion (MonoCompile *cfg)
        }
 }
 
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (ssa);
+
+#endif /* !DISABLE_JIT */
index 98f89d63500b7fe89ea677a7bbe041a911dd4a00..90f0af81b5a2c2e606f9e4b2d7be094f7be8d357 100644 (file)
@@ -101,17 +101,21 @@ mono_trace_eval (MonoMethod *method)
                
                switch (op->op){
                case MONO_TRACEOP_ALL:
-                       inc = 1; break;
+                       inc = 1;
+                       break;
                case MONO_TRACEOP_PROGRAM:
                        if (trace_spec.assembly && (method->klass->image == mono_assembly_get_image (trace_spec.assembly)))
-                               inc = 1; break;
+                               inc = 1;
+                       break;
                case MONO_TRACEOP_WRAPPER:
                        if ((method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) ||
                                (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE))
-                               inc = 1; break;
+                               inc = 1;
+                       break;
                case MONO_TRACEOP_METHOD:
                        if (mono_method_desc_full_match ((MonoMethodDesc *) op->data, method))
-                               inc = 1; break;
+                               inc = 1;
+                       break;
                case MONO_TRACEOP_CLASS:
                        if (strcmp (method->klass->name_space, op->data) == 0)
                                if (strcmp (method->klass->name, op->data2) == 0)
@@ -119,18 +123,21 @@ mono_trace_eval (MonoMethod *method)
                        break;
                case MONO_TRACEOP_ASSEMBLY:
                        if (strcmp (mono_image_get_name (method->klass->image), op->data) == 0)
-                               inc = 1; break;
+                               inc = 1;
+                       break;
                case MONO_TRACEOP_NAMESPACE:
                        if (strcmp (method->klass->name_space, op->data) == 0)
                                inc = 1;
+                       break;
                case MONO_TRACEOP_EXCEPTION:
                        break;
                }
-               if (op->exclude){
+               if (op->exclude) {
                        if (inc)
                                include = 0;
-               } else if (inc)
+               } else if (inc) {
                        include = 1;
+               }
        }
        return include;
 }
index cf769a9e5305d3319ac8e1eed0e4167cc6102b6c..03e2af6fd3943a8f6afcbb50c8c4994f98bde7f6 100644 (file)
@@ -33,6 +33,7 @@
 
 #define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
 
+#ifndef DISABLE_JIT
 /*
  * mono_arch_get_unbox_trampoline:
  * @m: method pointer
@@ -110,6 +111,7 @@ mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericCo
 
        return start;
 }
+#endif /* !DISABLE_JIT */
 
 #ifdef _WIN64
 // Workaround lack of Valgrind support for 64-bit Windows
@@ -171,6 +173,7 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr)
        }
 }
 
+#ifndef DISABLE_JIT
 guint8*
 mono_arch_create_llvm_native_thunk (MonoDomain *domain, guint8 *addr)
 {
@@ -190,6 +193,7 @@ mono_arch_create_llvm_native_thunk (MonoDomain *domain, guint8 *addr)
        mono_profiler_code_buffer_new (thunk_start, thunk_code - thunk_start, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
        return addr;
 }
+#endif /* !DISABLE_JIT */
 
 void
 mono_arch_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *addr)
@@ -208,6 +212,7 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *a
        InterlockedExchangePointer (plt_jump_table_entry, addr);
 }
 
+#ifndef DISABLE_JIT
 static void
 stack_unaligned (MonoTrampolineType tramp_type)
 {
@@ -756,6 +761,7 @@ mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
        x86_push_imm (code, (guint64)func_arg);
        amd64_call_reg (code, AMD64_R11);
 }
+#endif /* !DISABLE_JIT */
 
 gpointer
 mono_amd64_handler_block_trampoline_helper (void)
@@ -764,6 +770,7 @@ mono_amd64_handler_block_trampoline_helper (void)
        return jit_tls->handler_block_return_address;
 }
 
+#ifndef DISABLE_JIT
 gpointer
 mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
 {
@@ -832,6 +839,7 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
 
        return buf;
 }
+#endif /* !DISABLE_JIT */
 
 /*
  * mono_arch_get_call_target:
@@ -862,6 +870,7 @@ mono_arch_get_plt_info_offset (guint8 *plt_entry, mgreg_t *regs, guint8 *code)
        return *(guint32*)(plt_entry + 6);
 }
 
+#ifndef DISABLE_JIT
 /*
  * mono_arch_create_sdb_trampoline:
  *
@@ -872,7 +881,7 @@ mono_arch_get_plt_info_offset (guint8 *plt_entry, mgreg_t *regs, guint8 *code)
 guint8*
 mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gboolean aot)
 {
-       int tramp_size = 256;
+       int tramp_size = 512;
        int i, framesize, ctx_offset, cfa_offset, gregs_offset;
        guint8 *code, *buf;
        GSList *unwind_ops = NULL;
@@ -960,3 +969,69 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo
 
        return buf;
 }
+#endif /* !DISABLE_JIT */
+
+#ifdef DISABLE_JIT
+gpointer
+mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_get_static_rgctx_trampoline (MonoMethod *m, MonoMethodRuntimeGenericContext *mrgctx, gpointer addr)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+guchar*
+mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+
+gpointer
+mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
+{
+        g_assert_not_reached ();
+        return NULL;
+}
+
+void
+mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
+{
+       g_assert_not_reached ();
+       return;
+}
+
+guint8*
+mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gboolean aot)
+{
+       g_assert_not_reached ();
+       return NULL;
+}
+#endif /* DISABLE_JIT */
index 3d7eb62e4004b07a10c4644c3086e9eedf21b66a..4f6c4acb204fc26e059d4c7c08d3e4c6315c8938 100644 (file)
@@ -73,10 +73,10 @@ libmono_profiler_iomap_la_LDFLAGS = $(prof_ldflags)
 libmono_profiler_iomap_static_la_SOURCES = mono-profiler-iomap.c
 libmono_profiler_iomap_static_la_LDFLAGS = -static
 
-libmono_profiler_log_la_SOURCES = proflog.c
+libmono_profiler_log_la_SOURCES = mono-profiler-log.c
 libmono_profiler_log_la_LIBADD = $(monodir)/mono/mini/$(LIBMONO_LA) $(GLIB_LIBS) $(Z_LIBS)
 libmono_profiler_log_la_LDFLAGS = $(prof_ldflags)
-libmono_profiler_log_static_la_SOURCES = proflog.c
+libmono_profiler_log_static_la_SOURCES = mono-profiler-log.c
 libmono_profiler_log_static_la_LDFLAGS = -static
 
 if HAVE_VTUNE
@@ -88,7 +88,7 @@ libmono_profiler_vtune_static_la_SOURCES = mono-profiler-vtune.c
 libmono_profiler_vtune_static_la_LDFLAGS = -static
 endif
 
-mprof_report_SOURCES = decode.c
+mprof_report_SOURCES = mprof-report.c
 mprof_report_LDADD = $(Z_LIBS) $(GLIB_LIBS) $(LIBICONV)
 
 PLOG_TESTS_SRC=test-alloc.cs test-busy.cs test-monitor.cs test-excleave.cs \
@@ -110,6 +110,7 @@ testlog: $(PLOG_TESTS)
 
 check-local: $(check_targets)
 
-EXTRA_DIST=utils.c utils.h proflog.h \
-       $(PLOG_TESTS_SRC) ptestrunner.pl \
+EXTRA_DIST=mono-profiler-log.h \
+       $(PLOG_TESTS_SRC) \
+       ptestrunner.pl \
        $(suppression_DATA)
diff --git a/mono/profiler/decode.c b/mono/profiler/decode.c
deleted file mode 100644 (file)
index 3381504..0000000
+++ /dev/null
@@ -1,4258 +0,0 @@
-/*
- * decode.c: mprof-report program source: decode and analyze the log profiler data
- *
- * Authors:
- *   Paolo Molaro (lupus@ximian.com)
- *   Alex Rønne Petersen (alexrp@xamarin.com)
- *
- * Copyright 2010 Novell, Inc (http://www.novell.com)
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-/*
- * The Coverage XML output schema
- * <coverage>
- *   <assembly/>
- *   <class/>
- *   <method>
- *     <statement/>
- *   </method>
- * </coverage>
- *
- * Elements:
- *   <coverage> - The root element of the documentation. It can contain any number of
- *                <assembly>, <class> or <method> elements.
- *                Attributes:
- *                   - version: The version number for the file format - (eg: "0.3")
- *   <assembly> - Contains data about assemblies. Has no child elements
- *                Attributes:
- *                   - name: The name of the assembly - (eg: "System.Xml")
- *                   - guid: The GUID of the assembly
- *                   - filename: The filename of the assembly
- *                   - method-count: The number of methods in the assembly
- *                   - full: The number of fully covered methods
- *                   - partial: The number of partially covered methods
- *   <class> - Contains data about classes. Has no child elements
- *             Attributes:
- *                - name: The name of the class
- *                - method-count: The number of methods in the class
- *                - full: The number of fully covered methods
- *                - partial: The number of partially covered methods
- *   <method> - Contains data about methods. Can contain any number of <statement> elements
- *              Attributes:
- *                 - assembly: The name of the parent assembly
- *                 - class: The name of the parent class
- *                 - name: The name of the method, with all it's parameters
- *                 - filename: The name of the source file containing this method
- *                 - token
- *   <statement> - Contains data about IL statements. Has no child elements
- *                 Attributes:
- *                    - offset: The offset of the statement in the IL code after the previous
- *                              statement's offset
- *                    - counter: 1 if the line was covered, 0 if it was not
- *                    - line: The line number in the parent method's file
- *                    - column: The column on the line
- */
-#include <config.h>
-#include "utils.c"
-#include "proflog.h"
-#include <string.h>
-#include <assert.h>
-#include <stdio.h>
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
-#include <malloc.h>
-#endif
-#include <unistd.h>
-#include <stdlib.h>
-#if defined (HAVE_SYS_ZLIB)
-#include <zlib.h>
-#endif
-#include <glib.h>
-#include <mono/metadata/profiler.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/utils/mono-counters.h>
-
-#define HASH_SIZE 9371
-#define SMALL_HASH_SIZE 31
-
-#if defined(__native_client__) || defined(__native_client_codegen__)
-volatile int __nacl_thread_suspension_needed = 0;
-void __nacl_suspend_thread_if_needed() {}
-#endif
-
-static int debug = 0;
-static int collect_traces = 0;
-static int show_traces = 0;
-static int trace_max = 6;
-static int verbose = 0;
-static uintptr_t *tracked_objects = 0;
-static int num_tracked_objects = 0;
-static uintptr_t thread_filter = 0;
-static uint64_t find_size = 0;
-static const char* find_name = NULL;
-static uint64_t time_from = 0;
-static uint64_t time_to = 0xffffffffffffffffULL;
-static int use_time_filter = 0;
-static uint64_t startup_time = 0;
-static FILE* outfile = NULL;
-static FILE* coverage_outfile = NULL;
-
-static int32_t
-read_int16 (unsigned char *p)
-{
-       int32_t value = *p++;
-       value |= (*p++) << 8;
-       return value;
-}
-
-static int32_t
-read_int32 (unsigned char *p)
-{
-       int32_t value = *p++;
-       value |= (*p++) << 8;
-       value |= (*p++) << 16;
-       value |= (uint32_t)(*p++) << 24;
-       return value;
-}
-
-static int64_t
-read_int64 (unsigned char *p)
-{
-       uint64_t value = *p++;
-       value |= (*p++) << 8;
-       value |= (*p++) << 16;
-       value |= (uint64_t)(*p++) << 24;
-       value |= (uint64_t)(*p++) << 32;
-       value |= (uint64_t)(*p++) << 40;
-       value |= (uint64_t)(*p++) << 48;
-       value |= (uint64_t)(*p++) << 54;
-       return value;
-}
-
-static char*
-pstrdup (const char *s)
-{
-       int len = strlen (s) + 1;
-       char *p = (char *)malloc (len);
-       memcpy (p, s, len);
-       return p;
-}
-
-typedef struct _CounterValue CounterValue;
-struct _CounterValue {
-       uint64_t timestamp;
-       unsigned char *buffer;
-       CounterValue *next;
-};
-
-typedef struct _Counter Counter;
-struct _Counter {
-       int index;
-       const char *section;
-       const char *name;
-       int type;
-       int unit;
-       int variance;
-       CounterValue *values;
-       CounterValue *values_last;
-};
-
-typedef struct _CounterList CounterList;
-struct _CounterList {
-       Counter *counter;
-       CounterList *next;
-};
-
-typedef struct _CounterSection CounterSection;
-struct _CounterSection {
-       const char *value;
-       CounterList *counters;
-       CounterList *counters_last;
-       CounterSection *next;
-};
-
-typedef struct _CounterTimestamp CounterTimestamp;
-struct _CounterTimestamp {
-       uint64_t value;
-       CounterSection *sections;
-       CounterSection *sections_last;
-       CounterTimestamp *next;
-};
-
-static CounterList *counters = NULL;
-static CounterSection *counters_sections = NULL;
-static CounterTimestamp *counters_timestamps = NULL;
-
-enum {
-       COUNTERS_SORT_TIME,
-       COUNTERS_SORT_CATEGORY
-};
-
-static int counters_sort_mode = COUNTERS_SORT_TIME;
-
-static void
-add_counter_to_section (Counter *counter)
-{
-       CounterSection *csection, *s;
-       CounterList *clist;
-
-       clist = (CounterList *)calloc (1, sizeof (CounterList));
-       clist->counter = counter;
-
-       for (csection = counters_sections; csection; csection = csection->next) {
-               if (strcmp (csection->value, counter->section) == 0) {
-                       /* If section exist */
-                       if (!csection->counters)
-                               csection->counters = clist;
-                       else
-                               csection->counters_last->next = clist;
-                       csection->counters_last = clist;
-                       return;
-               }
-       }
-
-       /* If section does not exist */
-       csection = (CounterSection *)calloc (1, sizeof (CounterSection));
-       csection->value = counter->section;
-       csection->counters = clist;
-       csection->counters_last = clist;
-
-       if (!counters_sections) {
-               counters_sections = csection;
-       } else {
-               s = counters_sections;
-               while (s->next)
-                       s = s->next;
-               s->next = csection;
-       }
-}
-
-static void
-add_counter (const char *section, const char *name, int type, int unit, int variance, int index)
-{
-       CounterList *list, *l;
-       Counter *counter;
-
-       for (list = counters; list; list = list->next)
-               if (list->counter->index == index)
-                       return;
-
-       counter = (Counter *)calloc (1, sizeof (Counter));
-       counter->section = section;
-       counter->name = name;
-       counter->type = type;
-       counter->unit = unit;
-       counter->variance = variance;
-       counter->index = index;
-
-       list = (CounterList *)calloc (1, sizeof (CounterList));
-       list->counter = counter;
-
-       if (!counters) {
-               counters = list;
-       } else {
-               l = counters;
-               while (l->next)
-                       l = l->next;
-               l->next = list;
-       }
-
-       if (counters_sort_mode == COUNTERS_SORT_CATEGORY || !verbose)
-               add_counter_to_section (counter);
-}
-
-static void
-add_counter_to_timestamp (uint64_t timestamp, Counter *counter)
-{
-       CounterTimestamp *ctimestamp, *t;
-       CounterSection *csection;
-       CounterList *clist;
-
-       clist = (CounterList *)calloc (1, sizeof (CounterList));
-       clist->counter = counter;
-
-       for (ctimestamp = counters_timestamps; ctimestamp; ctimestamp = ctimestamp->next) {
-               if (ctimestamp->value == timestamp) {
-                       for (csection = ctimestamp->sections; csection; csection = csection->next) {
-                               if (strcmp (csection->value, counter->section) == 0) {
-                                       /* if timestamp exist and section exist */
-                                       if (!csection->counters)
-                                               csection->counters = clist;
-                                       else
-                                               csection->counters_last->next = clist;
-                                       csection->counters_last = clist;
-                                       return;
-                               }
-                       }
-
-                       /* if timestamp exist and section does not exist */
-                       csection = (CounterSection *)calloc (1, sizeof (CounterSection));
-                       csection->value = counter->section;
-                       csection->counters = clist;
-                       csection->counters_last = clist;
-
-                       if (!ctimestamp->sections)
-                               ctimestamp->sections = csection;
-                       else
-                               ctimestamp->sections_last->next = csection;
-                       ctimestamp->sections_last = csection;
-                       return;
-               }
-       }
-
-       /* If timestamp do not exist and section does not exist */
-       csection = (CounterSection *)calloc (1, sizeof (CounterSection));
-       csection->value = counter->section;
-       csection->counters = clist;
-       csection->counters_last = clist;
-
-       ctimestamp = (CounterTimestamp *)calloc (1, sizeof (CounterTimestamp));
-       ctimestamp->value = timestamp;
-       ctimestamp->sections = csection;
-       ctimestamp->sections_last = csection;
-
-       if (!counters_timestamps) {
-               counters_timestamps = ctimestamp;
-       } else {
-               t = counters_timestamps;
-               while (t->next)
-                       t = t->next;
-               t->next = ctimestamp;
-       }
-}
-
-static void
-add_counter_value (int index, CounterValue *value)
-{
-       CounterList *list;
-
-       for (list = counters; list; list = list->next) {
-               if (list->counter->index == index) {
-                       if (!list->counter->values)
-                               list->counter->values = value;
-                       else
-                               list->counter->values_last->next = value;
-                       list->counter->values_last = value;
-
-                       if (counters_sort_mode == COUNTERS_SORT_TIME)
-                               add_counter_to_timestamp (value->timestamp, list->counter);
-
-                       return;
-               }
-       }
-}
-
-static const char*
-section_name (int section)
-{
-       switch (section) {
-       case MONO_COUNTER_JIT: return "Mono JIT";
-       case MONO_COUNTER_GC: return "Mono GC";
-       case MONO_COUNTER_METADATA: return "Mono Metadata";
-       case MONO_COUNTER_GENERICS: return "Mono Generics";
-       case MONO_COUNTER_SECURITY: return "Mono Security";
-       case MONO_COUNTER_RUNTIME: return "Mono Runtime";
-       case MONO_COUNTER_SYSTEM: return "Mono System";
-       case MONO_COUNTER_PROFILER: return "Mono Profiler";
-       default: return "<unknown>";
-       }
-}
-
-static const char*
-type_name (int type)
-{
-       switch (type) {
-       case MONO_COUNTER_INT: return "Int";
-       case MONO_COUNTER_UINT: return "UInt";
-       case MONO_COUNTER_WORD: return "Word";
-       case MONO_COUNTER_LONG: return "Long";
-       case MONO_COUNTER_ULONG: return "ULong";
-       case MONO_COUNTER_DOUBLE: return "Double";
-       case MONO_COUNTER_STRING: return "String";
-       case MONO_COUNTER_TIME_INTERVAL: return "Time Interval";
-       default: return "<unknown>";
-       }
-}
-
-static const char*
-unit_name (int unit)
-{
-       switch (unit) {
-       case MONO_COUNTER_RAW: return "Raw";
-       case MONO_COUNTER_BYTES: return "Bytes";
-       case MONO_COUNTER_TIME: return "Time";
-       case MONO_COUNTER_COUNT: return "Count";
-       case MONO_COUNTER_PERCENTAGE: return "Percentage";
-       default: return "<unknown>";
-       }
-}
-
-static const char*
-variance_name (int variance)
-{
-       switch (variance) {
-       case MONO_COUNTER_MONOTONIC: return "Monotonic";
-       case MONO_COUNTER_CONSTANT: return "Constant";
-       case MONO_COUNTER_VARIABLE: return "Variable";
-       default: return "<unknown>";
-       }
-}
-
-static void
-dump_counters_value (Counter *counter, const char *key_format, const char *key, void *value)
-{
-       char format[32];
-
-       if (value == NULL) {
-               snprintf (format, sizeof (format), "%s : %%s\n", key_format);
-               fprintf (outfile, format, key, "<null>");
-       } else {
-               switch (counter->type) {
-               case MONO_COUNTER_INT:
-#if SIZEOF_VOID_P == 4
-               case MONO_COUNTER_WORD:
-#endif
-                       snprintf (format, sizeof (format), "%s : %%d\n", key_format);
-                       fprintf (outfile, format, key, *(int32_t*)value);
-                       break;
-               case MONO_COUNTER_UINT:
-                       snprintf (format, sizeof (format), "%s : %%u\n", key_format);
-                       fprintf (outfile, format, key, *(uint32_t*)value);
-                       break;
-               case MONO_COUNTER_LONG:
-#if SIZEOF_VOID_P == 8
-               case MONO_COUNTER_WORD:
-#endif
-               case MONO_COUNTER_TIME_INTERVAL:
-                       if (counter->type == MONO_COUNTER_LONG && counter->unit == MONO_COUNTER_TIME) {
-                               snprintf (format, sizeof (format), "%s : %%0.3fms\n", key_format);
-                               fprintf (outfile, format, key, (double)*(int64_t*)value / 10000.0);
-                       } else if (counter->type == MONO_COUNTER_TIME_INTERVAL) {
-                               snprintf (format, sizeof (format), "%s : %%0.3fms\n", key_format);
-                               fprintf (outfile, format, key, (double)*(int64_t*)value / 1000.0);
-                       } else {
-                               snprintf (format, sizeof (format), "%s : %%u\n", key_format);
-                               fprintf (outfile, format, key, *(int64_t*)value);
-                       }
-                       break;
-               case MONO_COUNTER_ULONG:
-                       snprintf (format, sizeof (format), "%s : %%llu\n", key_format);
-                       fprintf (outfile, format, key, *(uint64_t*)value);
-                       break;
-               case MONO_COUNTER_DOUBLE:
-                       snprintf (format, sizeof (format), "%s : %%f\n", key_format);
-                       fprintf (outfile, format, key, *(double*)value);
-                       break;
-               case MONO_COUNTER_STRING:
-                       snprintf (format, sizeof (format), "%s : %%s\n", key_format);
-                       fprintf (outfile, format, key, *(char*)value);
-                       break;
-               }
-       }
-}
-
-static void
-dump_counters (void)
-{
-       Counter *counter;
-       CounterValue *cvalue;
-       CounterTimestamp *ctimestamp;
-       CounterSection *csection;
-       CounterList *clist;
-       char strtimestamp[17];
-       int i, section_printed;
-
-       fprintf (outfile, "\nCounters:\n");
-
-       if (!verbose) {
-               char counters_to_print[][64] = {
-                       "Methods from AOT",
-                       "Methods JITted using mono JIT",
-                       "Methods JITted using LLVM",
-                       "Total time spent JITting (sec)",
-                       "User Time",
-                       "System Time",
-                       "Total Time",
-                       "Working Set",
-                       "Private Bytes",
-                       "Virtual Bytes",
-                       "Page Faults",
-                       "CPU Load Average - 1min",
-                       "CPU Load Average - 5min",
-                       "CPU Load Average - 15min",
-                       ""
-               };
-
-               for (csection = counters_sections; csection; csection = csection->next) {
-                       section_printed = 0;
-
-                       for (clist = csection->counters; clist; clist = clist->next) {
-                               counter = clist->counter;
-                               if (!counter->values_last)
-                                       continue;
-
-                               for (i = 0; counters_to_print [i][0] != 0; i++) {
-                                       if (strcmp (counters_to_print [i], counter->name) == 0) {
-                                               if (!section_printed) {
-                                                       fprintf (outfile, "\t%s:\n", csection->value);
-                                                       section_printed = 1;
-                                               }
-
-                                               dump_counters_value (counter, "\t\t%-30s", counter->name, counter->values_last->buffer);
-                                               break;
-                                       }
-                               }
-                       }
-               }
-       } else if (counters_sort_mode == COUNTERS_SORT_TIME) {
-               for (ctimestamp = counters_timestamps; ctimestamp; ctimestamp = ctimestamp->next) {
-                       fprintf (outfile, "\t%llu:%02llu:%02llu:%02llu.%03llu:\n",
-                               (unsigned long long) (ctimestamp->value / 1000 / 60 / 60 / 24 % 1000),
-                               (unsigned long long) (ctimestamp->value / 1000 / 60 / 60 % 24),
-                               (unsigned long long) (ctimestamp->value / 1000 / 60 % 60),
-                               (unsigned long long) (ctimestamp->value / 1000 % 60),
-                               (unsigned long long) (ctimestamp->value % 1000));
-
-                       for (csection = ctimestamp->sections; csection; csection = csection->next) {
-                               fprintf (outfile, "\t\t%s:\n", csection->value);
-
-                               for (clist = csection->counters; clist; clist = clist->next) {
-                                       counter = clist->counter;
-                                       for (cvalue = counter->values; cvalue; cvalue = cvalue->next) {
-                                               if (cvalue->timestamp != ctimestamp->value)
-                                                       continue;
-
-                                               dump_counters_value (counter, "\t\t\t%-30s", counter->name, cvalue->buffer);
-                                       }
-                               }
-                       }
-               }
-       } else if (counters_sort_mode == COUNTERS_SORT_CATEGORY) {
-               for (csection = counters_sections; csection; csection = csection->next) {
-                       fprintf (outfile, "\t%s:\n", csection->value);
-
-                       for (clist = csection->counters; clist; clist = clist->next) {
-                               counter = clist->counter;
-                               fprintf (outfile, "\t\t%s: [type: %s, unit: %s, variance: %s]\n",
-                                       counter->name, type_name (counter->type), unit_name (counter->unit), variance_name (counter->variance));
-
-                               for (cvalue = counter->values; cvalue; cvalue = cvalue->next) {
-                                       snprintf (strtimestamp, sizeof (strtimestamp), "%llu:%02llu:%02llu:%02llu.%03llu",
-                                               (unsigned long long) (cvalue->timestamp / 1000 / 60 / 60 / 24 % 1000),
-                                               (unsigned long long) (cvalue->timestamp / 1000 / 60 / 60 % 24),
-                                               (unsigned long long) (cvalue->timestamp / 1000 / 60 % 60),
-                                               (unsigned long long) (cvalue->timestamp / 1000 % 60),
-                                               (unsigned long long) (cvalue->timestamp % 1000));
-
-                                       dump_counters_value (counter, "\t\t\t%s", strtimestamp, cvalue->buffer);
-                               }
-                       }
-               }
-       }
-}
-
-static int num_images;
-typedef struct _ImageDesc ImageDesc;
-struct _ImageDesc {
-       ImageDesc *next;
-       intptr_t image;
-       char *filename;
-};
-
-static ImageDesc* image_hash [SMALL_HASH_SIZE] = {0};
-
-static void
-add_image (intptr_t image, char *name)
-{
-       int slot = ((image >> 2) & 0xffff) % SMALL_HASH_SIZE;
-       ImageDesc *cd = (ImageDesc *)malloc (sizeof (ImageDesc));
-       cd->image = image;
-       cd->filename = pstrdup (name);
-       cd->next = image_hash [slot];
-       image_hash [slot] = cd;
-       num_images++;
-}
-
-static int num_assemblies;
-
-typedef struct _AssemblyDesc AssemblyDesc;
-struct _AssemblyDesc {
-       AssemblyDesc *next;
-       intptr_t assembly;
-       char *asmname;
-};
-
-static AssemblyDesc* assembly_hash [SMALL_HASH_SIZE] = {0};
-
-static void
-add_assembly (intptr_t assembly, char *name)
-{
-       int slot = ((assembly >> 2) & 0xffff) % SMALL_HASH_SIZE;
-       AssemblyDesc *cd = (AssemblyDesc *)malloc (sizeof (AssemblyDesc));
-       cd->assembly = assembly;
-       cd->asmname = pstrdup (name);
-       cd->next = assembly_hash [slot];
-       assembly_hash [slot] = cd;
-       num_assemblies++;
-}
-
-typedef struct _BackTrace BackTrace;
-typedef struct {
-       uint64_t count;
-       BackTrace *bt;
-} CallContext;
-
-typedef struct {
-       int count;
-       int size;
-       CallContext *traces;
-} TraceDesc;
-
-typedef struct _ClassDesc ClassDesc;
-struct _ClassDesc {
-       ClassDesc *next;
-       intptr_t klass;
-       char *name;
-       intptr_t allocs;
-       uint64_t alloc_size;
-       TraceDesc traces;
-};
-
-static ClassDesc* class_hash [HASH_SIZE] = {0};
-static int num_classes = 0;
-
-static ClassDesc*
-add_class (intptr_t klass, const char *name)
-{
-       int slot = ((klass >> 2) & 0xffff) % HASH_SIZE;
-       ClassDesc *cd;
-       cd = class_hash [slot];
-       while (cd && cd->klass != klass)
-               cd = cd->next;
-       /* we resolved an unknown class (unless we had the code unloaded) */
-       if (cd) {
-               /*printf ("resolved unknown: %s\n", name);*/
-               g_free (cd->name);
-               cd->name = pstrdup (name);
-               return cd;
-       }
-       cd = (ClassDesc *)calloc (sizeof (ClassDesc), 1);
-       cd->klass = klass;
-       cd->name = pstrdup (name);
-       cd->next = class_hash [slot];
-       cd->allocs = 0;
-       cd->alloc_size = 0;
-       cd->traces.count = 0;
-       cd->traces.size = 0;
-       cd->traces.traces = NULL;
-       class_hash [slot] = cd;
-       num_classes++;
-       return cd;
-}
-
-static ClassDesc *
-lookup_class (intptr_t klass)
-{
-       int slot = ((klass >> 2) & 0xffff) % HASH_SIZE;
-       ClassDesc *cd = class_hash [slot];
-       while (cd && cd->klass != klass)
-               cd = cd->next;
-       if (!cd) {
-               char buf [128];
-               snprintf (buf, sizeof (buf), "unresolved class %p", (void*)klass);
-               return add_class (klass, buf);
-       }
-       return cd;
-}
-
-typedef struct _MethodDesc MethodDesc;
-struct _MethodDesc {
-       MethodDesc *next;
-       intptr_t method;
-       char *name;
-       intptr_t code;
-       int len;
-       int recurse_count;
-       int sample_hits;
-       int ignore_jit; /* when this is set, we collect the metadata but don't count this method fot jit time and code size, when filtering events */
-       uint64_t calls;
-       uint64_t total_time;
-       uint64_t callee_time;
-       uint64_t self_time;
-       TraceDesc traces;
-};
-
-static MethodDesc* method_hash [HASH_SIZE] = {0};
-static int num_methods = 0;
-
-static MethodDesc*
-add_method (intptr_t method, const char *name, intptr_t code, int len)
-{
-       int slot = ((method >> 2) & 0xffff) % HASH_SIZE;
-       MethodDesc *cd;
-       cd = method_hash [slot];
-       while (cd && cd->method != method)
-               cd = cd->next;
-       /* we resolved an unknown method (unless we had the code unloaded) */
-       if (cd) {
-               cd->code = code;
-               cd->len = len;
-               /*printf ("resolved unknown: %s\n", name);*/
-               g_free (cd->name);
-               cd->name = pstrdup (name);
-               return cd;
-       }
-       cd = (MethodDesc *)calloc (sizeof (MethodDesc), 1);
-       cd->method = method;
-       cd->name = pstrdup (name);
-       cd->code = code;
-       cd->len = len;
-       cd->calls = 0;
-       cd->total_time = 0;
-       cd->traces.count = 0;
-       cd->traces.size = 0;
-       cd->traces.traces = NULL;
-       cd->next = method_hash [slot];
-       method_hash [slot] = cd;
-       num_methods++;
-       return cd;
-}
-
-static MethodDesc *
-lookup_method (intptr_t method)
-{
-       int slot = ((method >> 2) & 0xffff) % HASH_SIZE;
-       MethodDesc *cd = method_hash [slot];
-       while (cd && cd->method != method)
-               cd = cd->next;
-       if (!cd) {
-               char buf [128];
-               snprintf (buf, sizeof (buf), "unknown method %p", (void*)method);
-               return add_method (method, buf, 0, 0);
-       }
-       return cd;
-}
-
-static int num_stat_samples = 0;
-static int size_stat_samples = 0;
-uintptr_t *stat_samples = NULL;
-int *stat_sample_desc = NULL;
-
-static void
-add_stat_sample (int type, uintptr_t ip) {
-       if (num_stat_samples == size_stat_samples) {
-               size_stat_samples *= 2;
-               if (!size_stat_samples)
-               size_stat_samples = 32;
-               stat_samples = (uintptr_t *)realloc (stat_samples, size_stat_samples * sizeof (uintptr_t));
-               stat_sample_desc = (int *)realloc (stat_sample_desc, size_stat_samples * sizeof (int));
-       }
-       stat_samples [num_stat_samples] = ip;
-       stat_sample_desc [num_stat_samples++] = type;
-}
-
-static MethodDesc*
-lookup_method_by_ip (uintptr_t ip)
-{
-       int i;
-       MethodDesc* m;
-       /* dumb */
-       for (i = 0; i < HASH_SIZE; ++i) {
-               m = method_hash [i];
-               while (m) {
-                       //printf ("checking %p against %p-%p\n", (void*)ip, (void*)(m->code), (void*)(m->code + m->len));
-                       if (ip >= (uintptr_t)m->code && ip < (uintptr_t)m->code + m->len) {
-                               return m;
-                       }
-                       m = m->next;
-               }
-       }
-       return NULL;
-}
-
-static int
-compare_method_samples (const void *a, const void *b)
-{
-       MethodDesc *const *A = (MethodDesc *const *)a;
-       MethodDesc *const *B = (MethodDesc *const *)b;
-       if ((*A)->sample_hits == (*B)->sample_hits)
-               return 0;
-       if ((*B)->sample_hits < (*A)->sample_hits)
-               return -1;
-       return 1;
-}
-
-typedef struct _UnmanagedSymbol UnmanagedSymbol;
-struct _UnmanagedSymbol {
-       UnmanagedSymbol *parent;
-       char *name;
-       int is_binary;
-       uintptr_t addr;
-       uintptr_t size;
-       uintptr_t sample_hits;
-};
-
-static UnmanagedSymbol **usymbols = NULL;
-static int usymbols_size = 0;
-static int usymbols_num = 0;
-
-static int
-compare_usymbol_addr (const void *a, const void *b)
-{
-       UnmanagedSymbol *const *A = (UnmanagedSymbol *const *)a;
-       UnmanagedSymbol *const *B = (UnmanagedSymbol *const *)b;
-       if ((*B)->addr == (*A)->addr)
-               return 0;
-       if ((*B)->addr > (*A)->addr)
-               return -1;
-       return 1;
-}
-
-static int
-compare_usymbol_samples (const void *a, const void *b)
-{
-       UnmanagedSymbol *const *A = (UnmanagedSymbol *const *)a;
-       UnmanagedSymbol *const *B = (UnmanagedSymbol *const *)b;
-       if ((*B)->sample_hits == (*A)->sample_hits)
-               return 0;
-       if ((*B)->sample_hits < (*A)->sample_hits)
-               return -1;
-       return 1;
-}
-
-static void
-add_unmanaged_symbol (uintptr_t addr, char *name, uintptr_t size)
-{
-       UnmanagedSymbol *sym;
-       if (usymbols_num == usymbols_size) {
-               int new_size = usymbols_size * 2;
-               if (!new_size)
-                       new_size = 16;
-               usymbols = (UnmanagedSymbol **)realloc (usymbols, sizeof (void*) * new_size);
-               usymbols_size = new_size;
-       }
-       sym = (UnmanagedSymbol *)calloc (sizeof (UnmanagedSymbol), 1);
-       sym->addr = addr;
-       sym->name = name;
-       sym->size = size;
-       usymbols [usymbols_num++] = sym;
-}
-
-/* only valid after the symbols are sorted */
-static UnmanagedSymbol*
-lookup_unmanaged_symbol (uintptr_t addr)
-{
-       int r = usymbols_num - 1;
-       int l = 0;
-       UnmanagedSymbol *sym;
-       int last_best = -1;
-       while (r >= l) {
-               int m = (l + r) / 2;
-               sym = usymbols [m];
-               if (addr == sym->addr)
-                       return sym;
-               if (addr < sym->addr) {
-                       r = m - 1;
-               } else if (addr > sym->addr) {
-                       l = m + 1;
-                       last_best = m;
-               }
-       }
-       if (last_best >= 0 && (addr - usymbols [last_best]->addr) < 4096)
-               return usymbols [last_best];
-       return NULL;
-}
-
-/* we use the same structure for binaries */
-static UnmanagedSymbol **ubinaries = NULL;
-static int ubinaries_size = 0;
-static int ubinaries_num = 0;
-
-static void
-add_unmanaged_binary (uintptr_t addr, char *name, uintptr_t size)
-{
-       UnmanagedSymbol *sym;
-       if (ubinaries_num == ubinaries_size) {
-               int new_size = ubinaries_size * 2;
-               if (!new_size)
-                       new_size = 16;
-               ubinaries = (UnmanagedSymbol **)realloc (ubinaries, sizeof (void*) * new_size);
-               ubinaries_size = new_size;
-       }
-       sym = (UnmanagedSymbol *)calloc (sizeof (UnmanagedSymbol), 1);
-       sym->addr = addr;
-       sym->name = name;
-       sym->size = size;
-       sym->is_binary = 1;
-       ubinaries [ubinaries_num++] = sym;
-}
-
-static UnmanagedSymbol*
-lookup_unmanaged_binary (uintptr_t addr)
-{
-       int i;
-       for (i = 0; i < ubinaries_num; ++i) {
-               UnmanagedSymbol *ubin = ubinaries [i];
-               if (addr >= ubin->addr && addr < ubin->addr + ubin->size) {
-                       return ubin;
-               }
-       }
-       return NULL;
-}
-
-static const char*
-sample_type_name (int type)
-{
-       switch (type) {
-       case SAMPLE_CYCLES: return "cycles";
-       case SAMPLE_INSTRUCTIONS: return "instructions retired";
-       case SAMPLE_CACHE_MISSES: return "cache misses";
-       case SAMPLE_CACHE_REFS: return "cache references";
-       case SAMPLE_BRANCHES: return "executed branches";
-       case SAMPLE_BRANCH_MISSES: return "unpredicted branches";
-       }
-       return "unknown";
-}
-
-static void
-set_usym_parent (UnmanagedSymbol** cachedus, int count)
-{
-       int i;
-       for (i = 0; i < count; ++i) {
-               UnmanagedSymbol *ubin = lookup_unmanaged_binary (cachedus [i]->addr);
-               if (ubin == cachedus [i])
-                       continue;
-               cachedus [i]->parent = ubin;
-       }
-}
-
-static void
-print_usym (UnmanagedSymbol* um)
-{
-       if (um->parent)
-               fprintf (outfile, "\t%6zd %6.2f %-36s in %s\n", um->sample_hits, um->sample_hits*100.0/num_stat_samples, um->name, um->parent->name);
-       else
-               fprintf (outfile, "\t%6zd %6.2f %s\n", um->sample_hits, um->sample_hits*100.0/num_stat_samples, um->name);
-}
-
-static int
-sym_percent (uintptr_t sample_hits)
-{
-       double pc;
-       if (verbose)
-               return 1;
-       pc = sample_hits*100.0/num_stat_samples;
-       return pc >= 0.1;
-}
-
-static void
-dump_samples (void)
-{
-       int i, u;
-       int count = 0, msize = 0;
-       int unmanaged_hits = 0;
-       int unresolved_hits = 0;
-       MethodDesc** cachedm = NULL;
-       int ucount = 0, usize = 0;
-       UnmanagedSymbol** cachedus = NULL;
-       if (!num_stat_samples)
-               return;
-       qsort (usymbols, usymbols_num, sizeof (UnmanagedSymbol*), compare_usymbol_addr);
-       for (i = 0; i < num_stat_samples; ++i) {
-               MethodDesc *m = lookup_method_by_ip (stat_samples [i]);
-               if (m) {
-                       if (!m->sample_hits) {
-                               if (count == msize) {
-                                       msize *= 2;
-                                       if (!msize)
-                                               msize = 4;
-                                       cachedm = (MethodDesc **)realloc (cachedm, sizeof (void*) * msize);
-                               }
-                               cachedm [count++] = m;
-                       }
-                       m->sample_hits++;
-               } else {
-                       UnmanagedSymbol *usym = lookup_unmanaged_symbol (stat_samples [i]);
-                       if (!usym) {
-                               unresolved_hits++;
-                               //printf ("unmanaged hit at %p\n", (void*)stat_samples [i]);
-                               usym = lookup_unmanaged_binary (stat_samples [i]);
-                       }
-                       if (usym) {
-                               if (!usym->sample_hits) {
-                                       if (ucount == usize) {
-                                               usize *= 2;
-                                               if (!usize)
-                                                       usize = 4;
-                                               cachedus = (UnmanagedSymbol **)realloc (cachedus, sizeof (void*) * usize);
-                                       }
-                                       cachedus [ucount++] = usym;
-                               }
-                               usym->sample_hits++;
-                       }
-                       unmanaged_hits++;
-               }
-       }
-       qsort (cachedm, count, sizeof (MethodDesc*), compare_method_samples);
-       qsort (cachedus, ucount, sizeof (UnmanagedSymbol*), compare_usymbol_samples);
-       set_usym_parent (cachedus, ucount);
-       fprintf (outfile, "\nStatistical samples summary\n");
-       fprintf (outfile, "\tSample type: %s\n", sample_type_name (stat_sample_desc [0]));
-       fprintf (outfile, "\tUnmanaged hits:  %6d (%4.1f%%)\n", unmanaged_hits, (100.0*unmanaged_hits)/num_stat_samples);
-       fprintf (outfile, "\tManaged hits:    %6d (%4.1f%%)\n", num_stat_samples - unmanaged_hits, (100.0*(num_stat_samples-unmanaged_hits))/num_stat_samples);
-       fprintf (outfile, "\tUnresolved hits: %6d (%4.1f%%)\n", unresolved_hits, (100.0*unresolved_hits)/num_stat_samples);
-       fprintf (outfile, "\t%6s %6s %s\n", "Hits", "%", "Method name");
-       i = 0;
-       u = 0;
-       while (i < count || u < ucount) {
-               if (i < count) {
-                       MethodDesc *m = cachedm [i];
-                       if (u < ucount) {
-                               UnmanagedSymbol *um = cachedus [u];
-                               if (um->sample_hits > m->sample_hits) {
-                                       if (!sym_percent (um->sample_hits))
-                                               break;
-                                       print_usym (um);
-                                       u++;
-                                       continue;
-                               }
-                       }
-                       if (!sym_percent (m->sample_hits))
-                               break;
-                       fprintf (outfile, "\t%6d %6.2f %s\n", m->sample_hits, m->sample_hits*100.0/num_stat_samples, m->name);
-                       i++;
-                       continue;
-               }
-               if (u < ucount) {
-                       UnmanagedSymbol *um = cachedus [u];
-                       if (!sym_percent (um->sample_hits))
-                               break;
-                       print_usym (um);
-                       u++;
-                       continue;
-               }
-       }
-}
-
-typedef struct _HeapClassDesc HeapClassDesc;
-typedef struct {
-       HeapClassDesc *klass;
-       uint64_t count;
-} HeapClassRevRef;
-
-struct _HeapClassDesc {
-       ClassDesc *klass;
-       int64_t count;
-       int64_t total_size;
-       HeapClassRevRef *rev_hash;
-       int rev_hash_size;
-       int rev_count;
-       uintptr_t pinned_references;
-       uintptr_t root_references;
-};
-
-static int
-add_rev_class_hashed (HeapClassRevRef *rev_hash, uintptr_t size, HeapClassDesc *hklass, uint64_t value)
-{
-       uintptr_t i;
-       uintptr_t start_pos;
-       start_pos = (hklass->klass->klass >> 2) % size;
-       assert (start_pos < size);
-       i = start_pos;
-       do {
-               if (rev_hash [i].klass == hklass) {
-                       rev_hash [i].count += value;
-                       return 0;
-               } else if (!rev_hash [i].klass) {
-                       rev_hash [i].klass = hklass;
-                       rev_hash [i].count += value;
-                       start_pos = 0;
-                       for (i = 0; i < size; ++i)
-                               if (rev_hash [i].klass && rev_hash [i].klass->klass == hklass->klass)
-                                       start_pos ++;
-                       assert (start_pos == 1);
-                       return 1;
-               }
-               /* wrap around */
-               if (++i == size)
-                       i = 0;
-       } while (i != start_pos);
-       /* should not happen */
-       printf ("failed revref store\n");
-       return 0;
-}
-
-static void
-add_heap_class_rev (HeapClassDesc *from, HeapClassDesc *to)
-{
-       uintptr_t i;
-       if (to->rev_count * 2 >= to->rev_hash_size) {
-               HeapClassRevRef *n;
-               uintptr_t old_size = to->rev_hash_size;
-               to->rev_hash_size *= 2;
-               if (to->rev_hash_size == 0)
-                       to->rev_hash_size = 4;
-               n = (HeapClassRevRef *)calloc (sizeof (HeapClassRevRef) * to->rev_hash_size, 1);
-               for (i = 0; i < old_size; ++i) {
-                       if (to->rev_hash [i].klass)
-                               add_rev_class_hashed (n, to->rev_hash_size, to->rev_hash [i].klass, to->rev_hash [i].count);
-               }
-               if (to->rev_hash)
-                       g_free (to->rev_hash);
-               to->rev_hash = n;
-       }
-       to->rev_count += add_rev_class_hashed (to->rev_hash, to->rev_hash_size, from, 1);
-}
-
-typedef struct {
-       uintptr_t objaddr;
-       HeapClassDesc *hklass;
-       uintptr_t num_refs;
-       uintptr_t refs [0];
-} HeapObjectDesc;
-
-typedef struct _HeapShot HeapShot;
-struct _HeapShot {
-       HeapShot *next;
-       uint64_t timestamp;
-       int class_count;
-       int hash_size;
-       HeapClassDesc **class_hash;
-       HeapClassDesc **sorted;
-       HeapObjectDesc **objects_hash;
-       uintptr_t objects_count;
-       uintptr_t objects_hash_size;
-       uintptr_t num_roots;
-       uintptr_t *roots;
-       uintptr_t *roots_extra;
-       int *roots_types;
-};
-
-static HeapShot *heap_shots = NULL;
-static int num_heap_shots = 0;
-
-static HeapShot*
-new_heap_shot (uint64_t timestamp)
-{
-       HeapShot *hs = (HeapShot *)calloc (sizeof (HeapShot), 1);
-       hs->hash_size = 4;
-       hs->class_hash = (HeapClassDesc **)calloc (sizeof (void*), hs->hash_size);
-       hs->timestamp = timestamp;
-       num_heap_shots++;
-       hs->next = heap_shots;
-       heap_shots = hs;
-       return hs;
-}
-
-static HeapClassDesc*
-heap_class_lookup (HeapShot *hs, ClassDesc *klass)
-{
-       int i;
-       unsigned int start_pos;
-       start_pos = ((uintptr_t)klass->klass >> 2) % hs->hash_size;
-       i = start_pos;
-       do {
-               HeapClassDesc* cd = hs->class_hash [i];
-               if (!cd)
-                       return NULL;
-               if (cd->klass == klass)
-                       return cd;
-               /* wrap around */
-               if (++i == hs->hash_size)
-                       i = 0;
-       } while (i != start_pos);
-       return NULL;
-}
-
-static int
-add_heap_hashed (HeapClassDesc **hash, HeapClassDesc **retv, uintptr_t hsize, ClassDesc *klass, uint64_t size, uint64_t count)
-{
-       uintptr_t i;
-       uintptr_t start_pos;
-       start_pos = ((uintptr_t)klass->klass >> 2) % hsize;
-       i = start_pos;
-       do {
-               if (hash [i] && hash [i]->klass == klass) {
-                       hash [i]->total_size += size;
-                       hash [i]->count += count;
-                       *retv = hash [i];
-                       return 0;
-               } else if (!hash [i]) {
-                       if (*retv) {
-                               hash [i] = *retv;
-                               return 1;
-                       }
-                       hash [i] = (HeapClassDesc *)calloc (sizeof (HeapClassDesc), 1);
-                       hash [i]->klass = klass;
-                       hash [i]->total_size += size;
-                       hash [i]->count += count;
-                       *retv = hash [i];
-                       return 1;
-               }
-               /* wrap around */
-               if (++i == hsize)
-                       i = 0;
-       } while (i != start_pos);
-       /* should not happen */
-       printf ("failed heap class store\n");
-       return 0;
-}
-
-static HeapClassDesc*
-add_heap_shot_class (HeapShot *hs, ClassDesc *klass, uint64_t size)
-{
-       HeapClassDesc *res;
-       int i;
-       if (hs->class_count * 2 >= hs->hash_size) {
-               HeapClassDesc **n;
-               int old_size = hs->hash_size;
-               hs->hash_size *= 2;
-               if (hs->hash_size == 0)
-                       hs->hash_size = 4;
-               n = (HeapClassDesc **)calloc (sizeof (void*) * hs->hash_size, 1);
-               for (i = 0; i < old_size; ++i) {
-                       res = hs->class_hash [i];
-                       if (hs->class_hash [i])
-                               add_heap_hashed (n, &res, hs->hash_size, hs->class_hash [i]->klass, hs->class_hash [i]->total_size, hs->class_hash [i]->count);
-               }
-               if (hs->class_hash)
-                       g_free (hs->class_hash);
-               hs->class_hash = n;
-       }
-       res = NULL;
-       hs->class_count += add_heap_hashed (hs->class_hash, &res, hs->hash_size, klass, size, 1);
-       //if (res->count == 1)
-       //      printf ("added heap class: %s\n", res->klass->name);
-       return res;
-}
-
-static HeapObjectDesc*
-alloc_heap_obj (uintptr_t objaddr, HeapClassDesc *hklass, uintptr_t num_refs)
-{
-       HeapObjectDesc* ho = (HeapObjectDesc *)calloc (sizeof (HeapObjectDesc) + num_refs * sizeof (uintptr_t), 1);
-       ho->objaddr = objaddr;
-       ho->hklass = hklass;
-       ho->num_refs = num_refs;
-       return ho;
-}
-
-static uintptr_t
-heap_shot_find_obj_slot (HeapShot *hs, uintptr_t objaddr)
-{
-       uintptr_t i;
-       uintptr_t start_pos;
-       HeapObjectDesc **hash = hs->objects_hash;
-       start_pos = ((uintptr_t)objaddr >> 3) % hs->objects_hash_size;
-       i = start_pos;
-       do {
-               if (hash [i] && hash [i]->objaddr == objaddr) {
-                       return i;
-               } else if (!hash [i]) {
-                       break; /* fail */
-               }
-               /* wrap around */
-               if (++i == hs->objects_hash_size)
-                       i = 0;
-       } while (i != start_pos);
-       /* should not happen */
-       //printf ("failed heap obj slot\n");
-       return -1;
-}
-
-static HeapObjectDesc*
-heap_shot_obj_add_refs (HeapShot *hs, uintptr_t objaddr, uintptr_t num, uintptr_t *ref_offset)
-{
-       HeapObjectDesc **hash = hs->objects_hash;
-       uintptr_t i = heap_shot_find_obj_slot (hs, objaddr);
-       if (i >= 0) {
-               HeapObjectDesc* ho = alloc_heap_obj (objaddr, hash [i]->hklass, hash [i]->num_refs + num);
-               *ref_offset = hash [i]->num_refs;
-               memcpy (ho->refs, hash [i]->refs, hash [i]->num_refs * sizeof (uintptr_t));
-               g_free (hash [i]);
-               hash [i] = ho;
-               return ho;
-       }
-       /* should not happen */
-       printf ("failed heap obj update\n");
-       return NULL;
-
-}
-
-static uintptr_t
-add_heap_hashed_obj (HeapObjectDesc **hash, uintptr_t hsize, HeapObjectDesc *obj)
-{
-       uintptr_t i;
-       uintptr_t start_pos;
-       start_pos = ((uintptr_t)obj->objaddr >> 3) % hsize;
-       i = start_pos;
-       do {
-               if (hash [i] && hash [i]->objaddr == obj->objaddr) {
-                       printf ("duplicate object!\n");
-                       return 0;
-               } else if (!hash [i]) {
-                       hash [i] = obj;
-                       return 1;
-               }
-               /* wrap around */
-               if (++i == hsize)
-                       i = 0;
-       } while (i != start_pos);
-       /* should not happen */
-       printf ("failed heap obj store\n");
-       return 0;
-}
-
-static void
-add_heap_shot_obj (HeapShot *hs, HeapObjectDesc *obj)
-{
-       uintptr_t i;
-       if (hs->objects_count * 2 >= hs->objects_hash_size) {
-               HeapObjectDesc **n;
-               uintptr_t old_size = hs->objects_hash_size;
-               hs->objects_hash_size *= 2;
-               if (hs->objects_hash_size == 0)
-                       hs->objects_hash_size = 4;
-               n = (HeapObjectDesc **)calloc (sizeof (void*) * hs->objects_hash_size, 1);
-               for (i = 0; i < old_size; ++i) {
-                       if (hs->objects_hash [i])
-                               add_heap_hashed_obj (n, hs->objects_hash_size, hs->objects_hash [i]);
-               }
-               if (hs->objects_hash)
-                       g_free (hs->objects_hash);
-               hs->objects_hash = n;
-       }
-       hs->objects_count += add_heap_hashed_obj (hs->objects_hash, hs->objects_hash_size, obj);
-}
-
-static void
-heap_shot_resolve_reverse_refs (HeapShot *hs)
-{
-       uintptr_t i;
-       for (i = 0; i < hs->objects_hash_size; ++i) {
-               uintptr_t r;
-               HeapObjectDesc *ho = hs->objects_hash [i];
-               if (!ho)
-                       continue;
-               for (r = 0; r < ho->num_refs; ++r) {
-                       uintptr_t oi = heap_shot_find_obj_slot (hs, ho->refs [r]);
-                       add_heap_class_rev (ho->hklass, hs->objects_hash [oi]->hklass);
-               }
-       }
-}
-
-#define MARK_GRAY 1
-#define MARK_BLACK 2
-
-static void
-heap_shot_mark_objects (HeapShot *hs)
-{
-       uintptr_t i, oi, r;
-       unsigned char *marks;
-       HeapObjectDesc *obj, *ref;
-       int marked_some;
-       uintptr_t num_marked = 0, num_unmarked;
-       for (i = 0; i < hs->num_roots; ++i) {
-               HeapClassDesc *cd;
-               oi = heap_shot_find_obj_slot (hs, hs->roots [i]);
-               if (oi == -1) {
-                       continue;
-               }
-               obj = hs->objects_hash [oi];
-               cd = obj->hklass;
-               if (hs->roots_types [i] & MONO_PROFILE_GC_ROOT_PINNING)
-                       cd->pinned_references++;
-               cd->root_references++;
-       }
-       if (!debug)
-               return;
-       /* consistency checks: it seems not all the objects are walked in the heap in some cases */
-       marks = (unsigned char *)calloc (hs->objects_hash_size, 1);
-       if (!marks)
-               return;
-       for (i = 0; i < hs->num_roots; ++i) {
-               oi = heap_shot_find_obj_slot (hs, hs->roots [i]);
-               if (oi == -1) {
-                       fprintf (outfile, "root type 0x%x for obj %p (%s) not found in heap\n", hs->roots_types [i], (void*)hs->roots [i], lookup_class (hs->roots_extra [i])->name);
-                       continue;
-               }
-               obj = hs->objects_hash [oi];
-               if (!marks [oi]) {
-                       marks [oi] = obj->num_refs? MARK_GRAY: MARK_BLACK;
-                       num_marked++;
-               }
-       }
-       marked_some = 1;
-       while (marked_some) {
-               marked_some = 0;
-               for (i = 0; i < hs->objects_hash_size; ++i) {
-                       if (marks [i] != MARK_GRAY)
-                               continue;
-                       marks [i] = MARK_BLACK;
-                       obj = hs->objects_hash [i];
-                       for (r = 0; r < obj->num_refs; ++r) {
-                               oi = heap_shot_find_obj_slot (hs, obj->refs [r]);
-                               if (oi == -1) {
-                                       fprintf (outfile, "referenced obj %p not found in heap\n", (void*)obj->refs [r]);
-                                       continue;
-                               }
-                               ref = hs->objects_hash [oi];
-                               if (!marks [oi]) {
-                                       marks [oi] = ref->num_refs? MARK_GRAY: MARK_BLACK;
-                               }
-                       }
-                       marked_some++;
-               }
-       }
-
-       num_unmarked = 0;
-       for (i = 0; i < hs->objects_hash_size; ++i) {
-               if (hs->objects_hash [i] && !marks [i]) {
-                       num_unmarked++;
-                       fprintf (outfile, "object %p (%s) unmarked\n", (void*)hs->objects_hash [i], hs->objects_hash [i]->hklass->klass->name);
-               }
-       }
-       fprintf (outfile, "Total unmarked: %zd/%zd\n", num_unmarked, hs->objects_count);
-       g_free (marks);
-}
-
-static void
-heap_shot_free_objects (HeapShot *hs)
-{
-       uintptr_t i;
-       for (i = 0; i < hs->objects_hash_size; ++i) {
-               HeapObjectDesc *ho = hs->objects_hash [i];
-               if (ho)
-                       g_free (ho);
-       }
-       if (hs->objects_hash)
-               g_free (hs->objects_hash);
-       hs->objects_hash = NULL;
-       hs->objects_hash_size = 0;
-       hs->objects_count = 0;
-}
-
-
-struct _BackTrace {
-       BackTrace *next;
-       unsigned int hash;
-       int count;
-       int id;
-       MethodDesc *methods [1];
-};
-
-static BackTrace *backtrace_hash [HASH_SIZE];
-static BackTrace **backtraces = NULL;
-static int num_backtraces = 0;
-static int next_backtrace = 0;
-
-static int
-hash_backtrace (int count, MethodDesc **methods)
-{
-       int hash = count;
-       int i;
-       for (i = 0; i < count; ++i) {
-               hash = (hash << 5) - hash + methods [i]->method;
-       }
-       return hash;
-}
-
-static int
-compare_backtrace (BackTrace *bt, int count, MethodDesc **methods)
-{
-       int i;
-       if (bt->count != count)
-               return 0;
-       for (i = 0; i < count; ++i)
-               if (methods [i] != bt->methods [i])
-                       return 0;
-       return 1;
-}
-
-static BackTrace*
-add_backtrace (int count, MethodDesc **methods)
-{
-       int hash = hash_backtrace (count, methods);
-       int slot = (hash & 0xffff) % HASH_SIZE;
-       BackTrace *bt = backtrace_hash [slot];
-       while (bt) {
-               if (bt->hash == hash && compare_backtrace (bt, count, methods))
-                       return bt;
-               bt = bt->next;
-       }
-       bt = (BackTrace *)malloc (sizeof (BackTrace) + ((count - 1) * sizeof (void*)));
-       bt->next = backtrace_hash [slot];
-       backtrace_hash [slot] = bt;
-       if (next_backtrace == num_backtraces) {
-               num_backtraces *= 2;
-               if (!num_backtraces)
-                       num_backtraces = 16;
-               backtraces = (BackTrace **)realloc (backtraces, sizeof (void*) * num_backtraces);
-       }
-       bt->id = next_backtrace++;
-       backtraces [bt->id] = bt;
-       bt->count = count;
-       bt->hash = hash;
-       for (slot = 0; slot < count; ++slot)
-               bt->methods [slot] = methods [slot];
-
-       return bt;
-}
-
-typedef struct _MonitorDesc MonitorDesc;
-typedef struct _ThreadContext ThreadContext;
-typedef struct _DomainContext DomainContext;
-typedef struct _RemCtxContext RemCtxContext;
-
-typedef struct {
-       FILE *file;
-#if defined (HAVE_SYS_ZLIB)
-       gzFile gzfile;
-#endif
-       unsigned char *buf;
-       int size;
-       int data_version;
-       int version_major;
-       int version_minor;
-       int timer_overhead;
-       int pid;
-       int port;
-       char *args;
-       char *arch;
-       char *os;
-       uint64_t startup_time;
-       ThreadContext *threads;
-       ThreadContext *current_thread;
-       DomainContext *domains;
-       DomainContext *current_domain;
-       RemCtxContext *remctxs;
-       RemCtxContext *current_remctx;
-} ProfContext;
-
-struct _ThreadContext {
-       ThreadContext *next;
-       intptr_t thread_id;
-       char *name;
-       /* emulated stack */
-       MethodDesc **stack;
-       uint64_t *time_stack;
-       uint64_t *callee_time_stack;
-       uint64_t last_time;
-       uint64_t contention_start;
-       MonitorDesc *monitor;
-       int stack_size;
-       int stack_id;
-       HeapShot *current_heap_shot;
-       uintptr_t num_roots;
-       uintptr_t size_roots;
-       uintptr_t *roots;
-       uintptr_t *roots_extra;
-       int *roots_types;
-       uint64_t gc_start_times [3];
-};
-
-struct _DomainContext {
-       DomainContext *next;
-       intptr_t domain_id;
-       const char *friendly_name;
-};
-
-struct _RemCtxContext {
-       RemCtxContext *next;
-       intptr_t remctx_id;
-       intptr_t domain_id;
-};
-
-static void
-ensure_buffer (ProfContext *ctx, int size)
-{
-       if (ctx->size < size) {
-               ctx->buf = (unsigned char *)realloc (ctx->buf, size);
-               ctx->size = size;
-       }
-}
-
-static int
-load_data (ProfContext *ctx, int size)
-{
-       ensure_buffer (ctx, size);
-#if defined (HAVE_SYS_ZLIB)
-       if (ctx->gzfile) {
-               int r = gzread (ctx->gzfile, ctx->buf, size);
-               if (r == 0)
-                       return size == 0? 1: 0;
-               return r == size;
-       } else
-#endif
-       {
-               int r = fread (ctx->buf, size, 1, ctx->file);
-               if (r == 0)
-                       return size == 0? 1: 0;
-               return r;
-       }
-}
-
-static ThreadContext*
-get_thread (ProfContext *ctx, intptr_t thread_id)
-{
-       ThreadContext *thread;
-       if (ctx->current_thread && ctx->current_thread->thread_id == thread_id)
-               return ctx->current_thread;
-       thread = ctx->threads;
-       while (thread) {
-               if (thread->thread_id == thread_id) {
-                       return thread;
-               }
-               thread = thread->next;
-       }
-       thread = (ThreadContext *)calloc (sizeof (ThreadContext), 1);
-       thread->next = ctx->threads;
-       ctx->threads = thread;
-       thread->thread_id = thread_id;
-       thread->last_time = 0;
-       thread->stack_id = 0;
-       thread->stack_size = 32;
-       thread->stack = (MethodDesc **)malloc (thread->stack_size * sizeof (void*));
-       thread->time_stack = (uint64_t *)malloc (thread->stack_size * sizeof (uint64_t));
-       thread->callee_time_stack = (uint64_t *)malloc (thread->stack_size * sizeof (uint64_t));
-       return thread;
-}
-
-static DomainContext *
-get_domain (ProfContext *ctx, intptr_t domain_id)
-{
-       if (ctx->current_domain && ctx->current_domain->domain_id == domain_id)
-               return ctx->current_domain;
-
-       DomainContext *domain = ctx->domains;
-
-       while (domain) {
-               if (domain->domain_id == domain_id)
-                       return domain;
-
-               domain = domain->next;
-       }
-
-       domain = (DomainContext *)calloc (sizeof (DomainContext), 1);
-       domain->next = ctx->domains;
-       ctx->domains = domain;
-       domain->domain_id = domain_id;
-
-       return domain;
-}
-
-static RemCtxContext *
-get_remctx (ProfContext *ctx, intptr_t remctx_id)
-{
-       if (ctx->current_remctx && ctx->current_remctx->remctx_id == remctx_id)
-               return ctx->current_remctx;
-
-       RemCtxContext *remctx = ctx->remctxs;
-
-       while (remctx) {
-               if (remctx->remctx_id == remctx_id)
-                       return remctx;
-
-               remctx = remctx->next;
-       }
-
-       remctx = (RemCtxContext *)calloc (sizeof (RemCtxContext), 1);
-       remctx->next = ctx->remctxs;
-       ctx->remctxs = remctx;
-       remctx->remctx_id = remctx_id;
-
-       return remctx;
-}
-
-static ThreadContext*
-load_thread (ProfContext *ctx, intptr_t thread_id)
-{
-       ThreadContext *thread = get_thread (ctx, thread_id);
-       ctx->current_thread = thread;
-       return thread;
-}
-
-static void
-ensure_thread_stack (ThreadContext *thread)
-{
-       if (thread->stack_id == thread->stack_size) {
-               thread->stack_size *= 2;
-               thread->stack = (MethodDesc **)realloc (thread->stack, thread->stack_size * sizeof (void*));
-               thread->time_stack = (uint64_t *)realloc (thread->time_stack, thread->stack_size * sizeof (uint64_t));
-               thread->callee_time_stack = (uint64_t *)realloc (thread->callee_time_stack, thread->stack_size * sizeof (uint64_t));
-       }
-}
-
-static int
-add_trace_hashed (CallContext *traces, int size, BackTrace *bt, uint64_t value)
-{
-       int i;
-       unsigned int start_pos;
-       start_pos = bt->hash % size;
-       i = start_pos;
-       do {
-               if (traces [i].bt == bt) {
-                       traces [i].count += value;
-                       return 0;
-               } else if (!traces [i].bt) {
-                       traces [i].bt = bt;
-                       traces [i].count += value;
-                       return 1;
-               }
-               /* wrap around */
-               if (++i == size)
-                       i = 0;
-       } while (i != start_pos);
-       /* should not happen */
-       printf ("failed trace store\n");
-       return 0;
-}
-
-static void
-add_trace_bt (BackTrace *bt, TraceDesc *trace, uint64_t value)
-{
-       int i;
-       if (!collect_traces)
-               return;
-       if (trace->count * 2 >= trace->size) {
-               CallContext *n;
-               int old_size = trace->size;
-               trace->size *= 2;
-               if (trace->size == 0)
-                       trace->size = 4;
-               n = (CallContext *)calloc (sizeof (CallContext) * trace->size, 1);
-               for (i = 0; i < old_size; ++i) {
-                       if (trace->traces [i].bt)
-                               add_trace_hashed (n, trace->size, trace->traces [i].bt, trace->traces [i].count);
-               }
-               if (trace->traces)
-                       g_free (trace->traces);
-               trace->traces = n;
-       }
-       trace->count += add_trace_hashed (trace->traces, trace->size, bt, value);
-}
-
-static BackTrace*
-add_trace_thread (ThreadContext *thread, TraceDesc *trace, uint64_t value)
-{
-       BackTrace *bt;
-       int count = thread->stack_id;
-       if (!collect_traces)
-               return NULL;
-       if (count > trace_max)
-               count = trace_max;
-       bt = add_backtrace (count, thread->stack + thread->stack_id - count);
-       add_trace_bt (bt, trace, value);
-       return bt;
-}
-
-static BackTrace*
-add_trace_methods (MethodDesc **methods, int count, TraceDesc *trace, uint64_t value)
-{
-       BackTrace *bt;
-       if (!collect_traces)
-               return NULL;
-       if (count > trace_max)
-               count = trace_max;
-       bt = add_backtrace (count, methods);
-       add_trace_bt (bt, trace, value);
-       return bt;
-}
-
-static void
-thread_add_root (ThreadContext *ctx, uintptr_t obj, int root_type, uintptr_t extra_info)
-{
-       if (ctx->num_roots == ctx->size_roots) {
-               int new_size = ctx->size_roots * 2;
-               if (!new_size)
-                       new_size = 4;
-               ctx->roots = (uintptr_t *)realloc (ctx->roots, new_size * sizeof (uintptr_t));
-               ctx->roots_extra = (uintptr_t *)realloc (ctx->roots_extra, new_size * sizeof (uintptr_t));
-               ctx->roots_types = (int *)realloc (ctx->roots_types, new_size * sizeof (int));
-               ctx->size_roots = new_size;
-       }
-       ctx->roots_types [ctx->num_roots] = root_type;
-       ctx->roots_extra [ctx->num_roots] = extra_info;
-       ctx->roots [ctx->num_roots++] = obj;
-}
-
-static int
-compare_callc (const void *a, const void *b)
-{
-       const CallContext *A = (const CallContext *)a;
-       const CallContext *B = (const CallContext *)b;
-       if (B->count == A->count)
-               return 0;
-       if (B->count < A->count)
-               return -1;
-       return 1;
-}
-
-static void
-sort_context_array (TraceDesc* traces)
-{
-       int i, j;
-       for (i = 0, j = 0; i < traces->size; ++i) {
-               if (traces->traces [i].bt) {
-                       traces->traces [j].bt = traces->traces [i].bt;
-                       traces->traces [j].count = traces->traces [i].count;
-                       j++;
-               }
-       }
-       qsort (traces->traces, traces->count, sizeof (CallContext), compare_callc);
-}
-
-static void
-push_method (ThreadContext *thread, MethodDesc *method, uint64_t timestamp)
-{
-       ensure_thread_stack (thread);
-       thread->time_stack [thread->stack_id] = timestamp;
-       thread->callee_time_stack [thread->stack_id] = 0;
-       thread->stack [thread->stack_id++] = method;
-       method->recurse_count++;
-}
-
-static void
-pop_method (ThreadContext *thread, MethodDesc *method, uint64_t timestamp)
-{
-       method->recurse_count--;
-       if (thread->stack_id > 0 && thread->stack [thread->stack_id - 1] == method) {
-               uint64_t tdiff;
-               thread->stack_id--;
-               method->calls++;
-               if (timestamp < thread->time_stack [thread->stack_id])
-                       fprintf (outfile, "time went backwards for %s\n", method->name);
-               tdiff = timestamp - thread->time_stack [thread->stack_id];
-               if (thread->callee_time_stack [thread->stack_id] > tdiff)
-                       fprintf (outfile, "callee time bigger for %s\n", method->name);
-               method->self_time += tdiff - thread->callee_time_stack [thread->stack_id];
-               method->callee_time += thread->callee_time_stack [thread->stack_id];
-               if (thread->stack_id)
-                       thread->callee_time_stack [thread->stack_id - 1] += tdiff;
-               //fprintf (outfile, "method %s took %d\n", method->name, (int)(tdiff/1000));
-       } else {
-               fprintf (outfile, "unmatched leave at stack pos: %d for method %s\n", thread->stack_id, method->name);
-       }
-}
-
-typedef struct {
-       uint64_t total_time;
-       uint64_t max_time;
-       int count;
-} GCDesc;
-static GCDesc gc_info [3];
-static uint64_t max_heap_size;
-static uint64_t gc_object_moves;
-static int gc_resizes;
-typedef struct {
-       uint64_t created;
-       uint64_t destroyed;
-       uint64_t live;
-       uint64_t max_live;
-       TraceDesc traces;
-       TraceDesc destroy_traces;
-} HandleInfo;
-static HandleInfo handle_info [4];
-
-static const char*
-gc_event_name (int ev)
-{
-       switch (ev) {
-       case MONO_GC_EVENT_START: return "start";
-       case MONO_GC_EVENT_MARK_START: return "mark start";
-       case MONO_GC_EVENT_MARK_END: return "mark end";
-       case MONO_GC_EVENT_RECLAIM_START: return "reclaim start";
-       case MONO_GC_EVENT_RECLAIM_END: return "reclaim end";
-       case MONO_GC_EVENT_END: return "end";
-       case MONO_GC_EVENT_PRE_STOP_WORLD: return "pre stop";
-       case MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED: return "pre stop lock";
-       case MONO_GC_EVENT_POST_STOP_WORLD: return "post stop";
-       case MONO_GC_EVENT_PRE_START_WORLD: return "pre start";
-       case MONO_GC_EVENT_POST_START_WORLD: return "post start";
-       case MONO_GC_EVENT_POST_START_WORLD_UNLOCKED: return "post start unlock";
-       default:
-               return "unknown";
-       }
-}
-
-static const char*
-sync_point_name (int type)
-{
-       switch (type) {
-       case SYNC_POINT_PERIODIC: return "periodic";
-       case SYNC_POINT_WORLD_STOP: return "world stop";
-       case SYNC_POINT_WORLD_START: return "world start";
-       default:
-               return "unknown";
-       }
-}
-
-static uint64_t clause_summary [MONO_EXCEPTION_CLAUSE_FAULT + 1];
-static uint64_t throw_count = 0;
-static TraceDesc exc_traces;
-
-static const char*
-clause_name (int type)
-{
-       switch (type) {
-       case MONO_EXCEPTION_CLAUSE_NONE: return "catch";
-       case MONO_EXCEPTION_CLAUSE_FILTER: return "filter";
-       case MONO_EXCEPTION_CLAUSE_FINALLY: return "finally";
-       case MONO_EXCEPTION_CLAUSE_FAULT: return "fault";
-       default: return "invalid";
-       }
-}
-
-static uint64_t monitor_contention;
-static uint64_t monitor_failed;
-static uint64_t monitor_acquired;
-
-struct _MonitorDesc {
-       MonitorDesc *next;
-       uintptr_t objid;
-       uintptr_t contentions;
-       uint64_t wait_time;
-       uint64_t max_wait_time;
-       TraceDesc traces;
-};
-
-static MonitorDesc* monitor_hash [SMALL_HASH_SIZE] = {0};
-static int num_monitors = 0;
-
-static MonitorDesc*
-lookup_monitor (uintptr_t objid)
-{
-       int slot = ((objid >> 3) & 0xffff) % SMALL_HASH_SIZE;
-       MonitorDesc *cd = monitor_hash [slot];
-       while (cd && cd->objid != objid)
-               cd = cd->next;
-       if (!cd) {
-               cd = (MonitorDesc *)calloc (sizeof (MonitorDesc), 1);
-               cd->objid = objid;
-               cd->next = monitor_hash [slot];
-               monitor_hash [slot] = cd;
-               num_monitors++;
-       }
-       return cd;
-}
-
-static const char*
-monitor_ev_name (int ev)
-{
-       switch (ev) {
-       case MONO_PROFILER_MONITOR_CONTENTION: return "contended";
-       case MONO_PROFILER_MONITOR_DONE: return "acquired";
-       case MONO_PROFILER_MONITOR_FAIL: return "not taken";
-       default: return "invalid";
-       }
-}
-
-static const char*
-get_handle_name (int htype)
-{
-       switch (htype) {
-       case 0: return "weak";
-       case 1: return "weaktrack";
-       case 2: return "normal";
-       case 3: return "pinned";
-       default: return "unknown";
-       }
-}
-
-static const char*
-get_root_name (int rtype)
-{
-       switch (rtype & MONO_PROFILE_GC_ROOT_TYPEMASK) {
-       case MONO_PROFILE_GC_ROOT_STACK: return "stack";
-       case MONO_PROFILE_GC_ROOT_FINALIZER: return "finalizer";
-       case MONO_PROFILE_GC_ROOT_HANDLE: return "handle";
-       case MONO_PROFILE_GC_ROOT_OTHER: return "other";
-       case MONO_PROFILE_GC_ROOT_MISC: return "misc";
-       default: return "unknown";
-       }
-}
-
-static MethodDesc**
-decode_bt (ProfContext *ctx, MethodDesc** sframes, int *size, unsigned char *p, unsigned char **endp, intptr_t ptr_base, intptr_t *method_base)
-{
-       MethodDesc **frames;
-       int i;
-       if (ctx->data_version < 13)
-               decode_uleb128 (p, &p); /* flags */
-       int count = decode_uleb128 (p, &p);
-       if (count > *size)
-               frames = (MethodDesc **)malloc (count * sizeof (void*));
-       else
-               frames = sframes;
-       for (i = 0; i < count; ++i) {
-               intptr_t ptrdiff = decode_sleb128 (p, &p);
-               if (ctx->data_version > 12) {
-                       *method_base += ptrdiff;
-                       frames [i] = lookup_method (*method_base);
-               } else {
-                       frames [i] = lookup_method (ptr_base + ptrdiff);
-               }
-       }
-       *size = count;
-       *endp = p;
-       return frames;
-}
-
-static void
-tracked_creation (uintptr_t obj, ClassDesc *cd, uint64_t size, BackTrace *bt, uint64_t timestamp)
-{
-       int i;
-       for (i = 0; i < num_tracked_objects; ++i) {
-               if (tracked_objects [i] != obj)
-                       continue;
-               fprintf (outfile, "Object %p created (%s, %llu bytes) at %.3f secs.\n", (void*)obj, cd->name, (unsigned long long) size, (timestamp - startup_time)/1000000000.0);
-               if (bt && bt->count) {
-                       int k;
-                       for (k = 0; k < bt->count; ++k)
-                               fprintf (outfile, "\t%s\n", bt->methods [k]->name);
-               }
-       }
-}
-
-static void
-track_handle (uintptr_t obj, int htype, uint32_t handle, BackTrace *bt, uint64_t timestamp)
-{
-       int i;
-       for (i = 0; i < num_tracked_objects; ++i) {
-               if (tracked_objects [i] != obj)
-                       continue;
-               fprintf (outfile, "Object %p referenced from handle %u at %.3f secs.\n", (void*)obj, handle, (timestamp - startup_time) / 1000000000.0);
-               if (bt && bt->count) {
-                       int k;
-                       for (k = 0; k < bt->count; ++k)
-                               fprintf (outfile, "\t%s\n", bt->methods [k]->name);
-               }
-       }
-}
-
-static void
-track_move (uintptr_t src, uintptr_t dst)
-{
-       int i;
-       for (i = 0; i < num_tracked_objects; ++i) {
-               if (tracked_objects [i] == src)
-                       fprintf (outfile, "Object %p moved to %p\n", (void*)src, (void*)dst);
-               else if (tracked_objects [i] == dst)
-                       fprintf (outfile, "Object %p moved from %p\n", (void*)dst, (void*)src);
-       }
-}
-
-static void
-track_obj_reference (uintptr_t obj, uintptr_t parent, ClassDesc *cd)
-{
-       int i;
-       for (i = 0; i < num_tracked_objects; ++i) {
-               if (tracked_objects [i] == obj)
-                       fprintf (outfile, "Object %p referenced from %p (%s).\n", (void*)obj, (void*)parent, cd->name);
-       }
-}
-
-static void
-found_object (uintptr_t obj)
-{
-       num_tracked_objects ++;
-       tracked_objects = (uintptr_t *)realloc (tracked_objects, num_tracked_objects * sizeof (tracked_objects [0]));
-       tracked_objects [num_tracked_objects - 1] = obj;
-}
-
-static int num_jit_helpers = 0;
-static int jit_helpers_code_size = 0;
-
-static const char*
-code_buffer_desc (int type)
-{
-       switch (type) {
-       case MONO_PROFILER_CODE_BUFFER_METHOD:
-               return "method";
-       case MONO_PROFILER_CODE_BUFFER_METHOD_TRAMPOLINE:
-               return "method trampoline";
-       case MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE:
-               return "unbox trampoline";
-       case MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE:
-               return "imt trampoline";
-       case MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE:
-               return "generics trampoline";
-       case MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE:
-               return "specific trampoline";
-       case MONO_PROFILER_CODE_BUFFER_HELPER:
-               return "misc helper";
-       case MONO_PROFILER_CODE_BUFFER_MONITOR:
-               return "monitor/lock";
-       case MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE:
-               return "delegate invoke";
-       case MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING:
-               return "exception handling";
-       default:
-               return "unspecified";
-       }
-}
-
-typedef struct _CoverageAssembly CoverageAssembly;
-struct _CoverageAssembly {
-       char *name;
-       char *guid;
-       char *filename;
-       int number_of_methods;
-       int fully_covered;
-       int partially_covered;
-};
-
-typedef struct _CoverageClass CoverageClass;
-struct _CoverageClass {
-       char *assembly_name;
-       char *class_name;
-       int number_of_methods;
-       int fully_covered;
-       int partially_covered;
-};
-
-typedef struct _CoverageCoverage CoverageCoverage;
-struct _CoverageCoverage {
-       int method_id;
-       int offset;
-       int count;
-       int line;
-       int column;
-};
-
-typedef struct _CoverageMethod CoverageMethod;
-struct _CoverageMethod {
-       char *assembly_name;
-       char *class_name;
-       char *method_name;
-       char *method_signature;
-       char *filename;
-       int token;
-       int n_statements;
-       int method_id;
-       GPtrArray *coverage;
-};
-static GPtrArray *coverage_assemblies = NULL;
-static GPtrArray *coverage_methods = NULL;
-static GPtrArray *coverage_statements = NULL;
-static GHashTable *coverage_methods_hash = NULL;
-static GPtrArray *coverage_classes = NULL;
-static GHashTable *coverage_assembly_classes = NULL;
-
-static void
-gather_coverage_statements (void)
-{
-       for (guint i = 0; i < coverage_statements->len; i++) {
-               CoverageCoverage *coverage = (CoverageCoverage *)coverage_statements->pdata[i];
-               CoverageMethod *method = (CoverageMethod *)g_hash_table_lookup (coverage_methods_hash, GINT_TO_POINTER (coverage->method_id));
-               if (method == NULL) {
-                       fprintf (outfile, "Cannot find method with ID: %d\n", coverage->method_id);
-                       continue;
-               }
-
-               g_ptr_array_add (method->coverage, coverage);
-       }
-}
-
-static void
-coverage_add_assembly (CoverageAssembly *assembly)
-{
-       if (coverage_assemblies == NULL)
-               coverage_assemblies = g_ptr_array_new ();
-
-       g_ptr_array_add (coverage_assemblies, assembly);
-}
-
-static void
-coverage_add_method (CoverageMethod *method)
-{
-       if (coverage_methods == NULL) {
-               coverage_methods = g_ptr_array_new ();
-               coverage_methods_hash = g_hash_table_new (NULL, NULL);
-       }
-
-       g_ptr_array_add (coverage_methods, method);
-       g_hash_table_insert (coverage_methods_hash, GINT_TO_POINTER (method->method_id), method);
-}
-
-static void
-coverage_add_class (CoverageClass *klass)
-{
-       GPtrArray *classes = NULL;
-
-       if (coverage_classes == NULL) {
-               coverage_classes = g_ptr_array_new ();
-               coverage_assembly_classes = g_hash_table_new (g_str_hash, g_str_equal);
-       }
-
-       g_ptr_array_add (coverage_classes, klass);
-       classes = (GPtrArray *)g_hash_table_lookup (coverage_assembly_classes, klass->assembly_name);
-       if (classes == NULL) {
-               classes = g_ptr_array_new ();
-               g_hash_table_insert (coverage_assembly_classes, klass->assembly_name, classes);
-       }
-       g_ptr_array_add (classes, klass);
-}
-
-static void
-coverage_add_coverage (CoverageCoverage *coverage)
-{
-       if (coverage_statements == NULL)
-               coverage_statements = g_ptr_array_new ();
-
-       g_ptr_array_add (coverage_statements, coverage);
-}
-
-#define OBJ_ADDR(diff) ((obj_base + diff) << 3)
-#define LOG_TIME(base,diff) /*fprintf("outfile, time %llu + %llu near offset %d\n", base, diff, p - ctx->buf)*/
-
-
-/* Stats */
-#define BUFFER_HEADER_SIZE 48
-
-typedef struct {
-       int count, min_size, max_size, bytes;
-} EventStat;
-
-static int buffer_count;
-static EventStat stats [256];
-
-static void
-record_event_stats (int type, int size)
-{
-       ++stats [type].count;
-       if (!stats [type].min_size)
-               stats [type].min_size = size;
-       stats [type].min_size = MIN (stats [type].min_size, size);
-       stats [type].max_size = MAX (stats [type].max_size, size);
-       stats [type].bytes += size;
-}
-
-static int
-decode_buffer (ProfContext *ctx)
-{
-       unsigned char *p;
-       unsigned char *end;
-       intptr_t thread_id;
-       intptr_t ptr_base;
-       intptr_t obj_base;
-       intptr_t method_base;
-       uint64_t time_base;
-       uint64_t file_offset;
-       int len, i;
-       ThreadContext *thread;
-
-#ifdef HAVE_SYS_ZLIB
-       if (ctx->gzfile)
-               file_offset = gztell (ctx->gzfile);
-       else
-#endif
-               file_offset = ftell (ctx->file);
-       if (!load_data (ctx, 48))
-               return 0;
-       p = ctx->buf;
-       if (read_int32 (p) != BUF_ID) {
-               fprintf (outfile, "Incorrect buffer id: 0x%x\n", read_int32 (p));
-               for (i = 0; i < 48; ++i) {
-                       fprintf (outfile, "0x%x%s", p [i], i % 8?" ":"\n");
-               }
-               return 0;
-       }
-       len = read_int32 (p + 4);
-       time_base = read_int64 (p + 8);
-       ptr_base = read_int64 (p + 16);
-       obj_base = read_int64 (p + 24);
-       thread_id = read_int64 (p + 32);
-       method_base = read_int64 (p + 40);
-       if (debug)
-               fprintf (outfile, "buf: thread:%zx, len: %d, time: %llu, file offset: %llu\n", thread_id, len, (unsigned long long) time_base, (unsigned long long) file_offset);
-       thread = load_thread (ctx, thread_id);
-       if (!load_data (ctx, len))
-               return 0;
-
-       ++buffer_count;
-
-       if (!startup_time) {
-               startup_time = time_base;
-               if (use_time_filter) {
-                       time_from += startup_time;
-                       time_to += startup_time;
-               }
-       }
-       for (i = 0; i < thread->stack_id; ++i)
-               thread->stack [i]->recurse_count++;
-       p = ctx->buf;
-       end = p + len;
-       while (p < end) {
-               unsigned char *start = p;
-               unsigned char event = *p;
-               switch (*p & 0xf) {
-               case TYPE_GC: {
-                       int subtype = *p & 0xf0;
-                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                       LOG_TIME (time_base, tdiff);
-                       time_base += tdiff;
-                       if (subtype == TYPE_GC_RESIZE) {
-                               uint64_t new_size = decode_uleb128 (p, &p);
-                               if (debug)
-                                       fprintf (outfile, "gc heap resized to %llu\n", (unsigned long long) new_size);
-                               gc_resizes++;
-                               if (new_size > max_heap_size)
-                                       max_heap_size = new_size;
-                       } else if (subtype == TYPE_GC_EVENT) {
-                               uint64_t ev;
-                               if (ctx->data_version > 12)
-                                       ev = *p++;
-                               else
-                                       ev = decode_uleb128 (p, &p);
-                               int gen;
-                               if (ctx->data_version > 12)
-                                       gen = *p++;
-                               else
-                                       gen = decode_uleb128 (p, &p);
-                               if (debug)
-                                       fprintf (outfile, "gc event for gen%d: %s at %llu (thread: 0x%zx)\n", gen, gc_event_name (ev), (unsigned long long) time_base, thread->thread_id);
-                               if (gen > 2) {
-                                       fprintf (outfile, "incorrect gc gen: %d\n", gen);
-                                       break;
-                               }
-                               if (ev == MONO_GC_EVENT_START) {
-                                       thread->gc_start_times [gen] = time_base;
-                                       gc_info [gen].count++;
-                               } else if (ev == MONO_GC_EVENT_END) {
-                                       tdiff = time_base - thread->gc_start_times [gen];
-                                       gc_info [gen].total_time += tdiff;
-                                       if (tdiff > gc_info [gen].max_time)
-                                               gc_info [gen].max_time = tdiff;
-                               }
-                       } else if (subtype == TYPE_GC_MOVE) {
-                               int j, num = decode_uleb128 (p, &p);
-                               gc_object_moves += num / 2;
-                               for (j = 0; j < num; j += 2) {
-                                       intptr_t obj1diff = decode_sleb128 (p, &p);
-                                       intptr_t obj2diff = decode_sleb128 (p, &p);
-                                       if (num_tracked_objects)
-                                               track_move (OBJ_ADDR (obj1diff), OBJ_ADDR (obj2diff));
-                                       if (debug) {
-                                               fprintf (outfile, "moved obj %p to %p\n", (void*)OBJ_ADDR (obj1diff), (void*)OBJ_ADDR (obj2diff));
-                                       }
-                               }
-                       } else if (subtype == TYPE_GC_HANDLE_CREATED || subtype == TYPE_GC_HANDLE_CREATED_BT) {
-                               int has_bt = subtype == TYPE_GC_HANDLE_CREATED_BT;
-                               int num_bt = 0;
-                               MethodDesc *sframes [8];
-                               MethodDesc **frames = sframes;
-                               int htype = decode_uleb128 (p, &p);
-                               uint32_t handle = decode_uleb128 (p, &p);
-                               intptr_t objdiff = decode_sleb128 (p, &p);
-                               if (has_bt) {
-                                       num_bt = 8;
-                                       frames = decode_bt (ctx, sframes, &num_bt, p, &p, ptr_base, &method_base);
-                                       if (!frames) {
-                                               fprintf (outfile, "Cannot load backtrace\n");
-                                               return 0;
-                                       }
-                               }
-                               if (htype > 3)
-                                       return 0;
-                               if ((thread_filter && thread_filter == thread->thread_id) || (time_base >= time_from && time_base < time_to)) {
-                                       handle_info [htype].created++;
-                                       handle_info [htype].live++;
-                                       if (handle_info [htype].live > handle_info [htype].max_live)
-                                               handle_info [htype].max_live = handle_info [htype].live;
-                                       BackTrace *bt;
-                                       if (has_bt)
-                                               bt = add_trace_methods (frames, num_bt, &handle_info [htype].traces, 1);
-                                       else
-                                               bt = add_trace_thread (thread, &handle_info [htype].traces, 1);
-                                       if (num_tracked_objects)
-                                               track_handle (OBJ_ADDR (objdiff), htype, handle, bt, time_base);
-                               }
-                               if (debug)
-                                       fprintf (outfile, "handle (%s) %u created for object %p\n", get_handle_name (htype), handle, (void*)OBJ_ADDR (objdiff));
-                               if (frames != sframes)
-                                       g_free (frames);
-                       } else if (subtype == TYPE_GC_HANDLE_DESTROYED || subtype == TYPE_GC_HANDLE_DESTROYED_BT) {
-                               int has_bt = subtype == TYPE_GC_HANDLE_DESTROYED_BT;
-                               int num_bt = 0;
-                               MethodDesc *sframes [8];
-                               MethodDesc **frames = sframes;
-                               int htype = decode_uleb128 (p, &p);
-                               uint32_t handle = decode_uleb128 (p, &p);
-                               if (has_bt) {
-                                       num_bt = 8;
-                                       frames = decode_bt (ctx, sframes, &num_bt, p, &p, ptr_base, &method_base);
-                                       if (!frames) {
-                                               fprintf (outfile, "Cannot load backtrace\n");
-                                               return 0;
-                                       }
-                               }
-                               if (htype > 3)
-                                       return 0;
-                               if ((thread_filter && thread_filter == thread->thread_id) || (time_base >= time_from && time_base < time_to)) {
-                                       handle_info [htype].destroyed ++;
-                                       handle_info [htype].live--;
-                                       BackTrace *bt;
-                                       if (has_bt)
-                                               bt = add_trace_methods (frames, num_bt, &handle_info [htype].destroy_traces, 1);
-                                       else
-                                               bt = add_trace_thread (thread, &handle_info [htype].destroy_traces, 1);
-                                       /* TODO: track_handle_free () - would need to record and keep track of the associated object address... */
-                               }
-                               if (debug)
-                                       fprintf (outfile, "handle (%s) %u destroyed\n", get_handle_name (htype), handle);
-                               if (frames != sframes)
-                                       g_free (frames);
-                       } else if (subtype == TYPE_GC_FINALIZE_START) {
-                               // TODO: Generate a finalizer report based on these events.
-                               if (debug)
-                                       fprintf (outfile, "gc finalizer queue being processed at %llu\n", (unsigned long long) time_base);
-                       } else if (subtype == TYPE_GC_FINALIZE_END) {
-                               if (debug)
-                                       fprintf (outfile, "gc finalizer queue finished processing at %llu\n", (unsigned long long) time_base);
-                       } else if (subtype == TYPE_GC_FINALIZE_OBJECT_START) {
-                               intptr_t objdiff = decode_sleb128 (p, &p);
-                               if (debug)
-                                       fprintf (outfile, "gc finalizing object %p at %llu\n", (void *) OBJ_ADDR (objdiff), (unsigned long long) time_base);
-                       } else if (subtype == TYPE_GC_FINALIZE_OBJECT_END) {
-                               intptr_t objdiff = decode_sleb128 (p, &p);
-                               if (debug)
-                                       fprintf (outfile, "gc finalized object %p at %llu\n", (void *) OBJ_ADDR (objdiff), (unsigned long long) time_base);
-                       }
-                       break;
-               }
-               case TYPE_METADATA: {
-                       int subtype = *p & 0xf0;
-                       const char *load_str = subtype == TYPE_END_LOAD ? "loaded" : "unloaded";
-                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                       int mtype = *p++;
-                       intptr_t ptrdiff = decode_sleb128 (p, &p);
-                       LOG_TIME (time_base, tdiff);
-                       time_base += tdiff;
-                       if (mtype == TYPE_CLASS) {
-                               intptr_t imptrdiff = decode_sleb128 (p, &p);
-                               if (ctx->data_version < 13)
-                                       decode_uleb128 (p, &p); /* flags */
-                               if (debug)
-                                       fprintf (outfile, "%s class %p (%s in %p) at %llu\n", load_str, (void*)(ptr_base + ptrdiff), p, (void*)(ptr_base + imptrdiff), (unsigned long long) time_base);
-                               if (subtype == TYPE_END_LOAD)
-                                       add_class (ptr_base + ptrdiff, (char*)p);
-                               while (*p) p++;
-                               p++;
-                       } else if (mtype == TYPE_IMAGE) {
-                               if (ctx->data_version < 13)
-                                       decode_uleb128 (p, &p); /* flags */
-                               if (debug)
-                                       fprintf (outfile, "%s image %p (%s) at %llu\n", load_str, (void*)(ptr_base + ptrdiff), p, (unsigned long long) time_base);
-                               if (subtype == TYPE_END_LOAD)
-                                       add_image (ptr_base + ptrdiff, (char*)p);
-                               while (*p) p++;
-                               p++;
-                       } else if (mtype == TYPE_ASSEMBLY) {
-                               if (ctx->data_version < 13)
-                                       decode_uleb128 (p, &p); /* flags */
-                               if (debug)
-                                       fprintf (outfile, "%s assembly %p (%s) at %llu\n", load_str, (void*)(ptr_base + ptrdiff), p, (unsigned long long) time_base);
-                               if (subtype == TYPE_END_LOAD)
-                                       add_assembly (ptr_base + ptrdiff, (char*)p);
-                               while (*p) p++;
-                               p++;
-                       } else if (mtype == TYPE_DOMAIN) {
-                               if (ctx->data_version < 13)
-                                       decode_uleb128 (p, &p); /* flags */
-                               DomainContext *nd = get_domain (ctx, ptr_base + ptrdiff);
-                               /* no subtype means it's a name event, rather than start/stop */
-                               if (subtype == 0)
-                                       nd->friendly_name = pstrdup ((char *) p);
-                               if (debug) {
-                                       if (subtype == 0)
-                                               fprintf (outfile, "domain %p named at %llu: %s\n", (void *) (ptr_base + ptrdiff), (unsigned long long) time_base, p);
-                                       else
-                                               fprintf (outfile, "%s thread %p at %llu\n", load_str, (void *) (ptr_base + ptrdiff), (unsigned long long) time_base);
-                               }
-                               if (subtype == 0) {
-                                       while (*p) p++;
-                                       p++;
-                               }
-                       } else if (mtype == TYPE_CONTEXT) {
-                               if (ctx->data_version < 13)
-                                       decode_uleb128 (p, &p); /* flags */
-                               intptr_t domaindiff = decode_sleb128 (p, &p);
-                               if (debug)
-                                       fprintf (outfile, "%s context %p (%p) at %llu\n", load_str, (void*)(ptr_base + ptrdiff), (void *) (ptr_base + domaindiff), (unsigned long long) time_base);
-                               if (subtype == TYPE_END_LOAD)
-                                       get_remctx (ctx, ptr_base + ptrdiff)->domain_id = ptr_base + domaindiff;
-                       } else if (mtype == TYPE_THREAD) {
-                               if (ctx->data_version < 13)
-                                       decode_uleb128 (p, &p); /* flags */
-                               ThreadContext *nt = get_thread (ctx, ptr_base + ptrdiff);
-                               /* no subtype means it's a name event, rather than start/stop */
-                               if (subtype == 0)
-                                       nt->name = pstrdup ((char*)p);
-                               if (debug) {
-                                       if (subtype == 0)
-                                               fprintf (outfile, "thread %p named at %llu: %s\n", (void*)(ptr_base + ptrdiff), (unsigned long long) time_base, p);
-                                       else
-                                               fprintf (outfile, "%s thread %p at %llu\n", load_str, (void *) (ptr_base + ptrdiff), (unsigned long long) time_base);
-                               }
-                               if (subtype == 0) {
-                                       while (*p) p++;
-                                       p++;
-                               }
-                       }
-                       break;
-               }
-               case TYPE_ALLOC: {
-                       int has_bt = *p & TYPE_ALLOC_BT;
-                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                       intptr_t ptrdiff = decode_sleb128 (p, &p);
-                       intptr_t objdiff = decode_sleb128 (p, &p);
-                       uint64_t len;
-                       int num_bt = 0;
-                       MethodDesc* sframes [8];
-                       MethodDesc** frames = sframes;
-                       ClassDesc *cd = lookup_class (ptr_base + ptrdiff);
-                       len = decode_uleb128 (p, &p);
-                       LOG_TIME (time_base, tdiff);
-                       time_base += tdiff;
-                       if (debug)
-                               fprintf (outfile, "alloced object %p, size %llu (%s) at %llu\n", (void*)OBJ_ADDR (objdiff), (unsigned long long) len, lookup_class (ptr_base + ptrdiff)->name, (unsigned long long) time_base);
-                       if (has_bt) {
-                               num_bt = 8;
-                               frames = decode_bt (ctx, sframes, &num_bt, p, &p, ptr_base, &method_base);
-                               if (!frames) {
-                                       fprintf (outfile, "Cannot load backtrace\n");
-                                       return 0;
-                               }
-                       }
-                       if ((thread_filter && thread_filter == thread->thread_id) || (time_base >= time_from && time_base < time_to)) {
-                               BackTrace *bt;
-                               cd->allocs++;
-                               cd->alloc_size += len;
-                               if (has_bt)
-                                       bt = add_trace_methods (frames, num_bt, &cd->traces, len);
-                               else
-                                       bt = add_trace_thread (thread, &cd->traces, len);
-                               if (find_size && len >= find_size) {
-                                       if (!find_name || strstr (cd->name, find_name))
-                                               found_object (OBJ_ADDR (objdiff));
-                               } else if (!find_size && find_name && strstr (cd->name, find_name)) {
-                                       found_object (OBJ_ADDR (objdiff));
-                               }
-                               if (num_tracked_objects)
-                                       tracked_creation (OBJ_ADDR (objdiff), cd, len, bt, time_base);
-                       }
-                       if (frames != sframes)
-                               g_free (frames);
-                       break;
-               }
-               case TYPE_METHOD: {
-                       int subtype = *p & 0xf0;
-                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                       int64_t ptrdiff = decode_sleb128 (p, &p);
-                       LOG_TIME (time_base, tdiff);
-                       time_base += tdiff;
-                       method_base += ptrdiff;
-                       if (subtype == TYPE_JIT) {
-                               intptr_t codediff = decode_sleb128 (p, &p);
-                               int codelen = decode_uleb128 (p, &p);
-                               MethodDesc *jitted_method;
-                               if (debug)
-                                       fprintf (outfile, "jitted method %p (%s), size: %d, code: %p\n", (void*)(method_base), p, codelen, (void*)(ptr_base + codediff));
-                               jitted_method = add_method (method_base, (char*)p, ptr_base + codediff, codelen);
-                               if (!(time_base >= time_from && time_base < time_to))
-                                       jitted_method->ignore_jit = 1;
-                               while (*p) p++;
-                               p++;
-                       } else {
-                               MethodDesc *method;
-                               if ((thread_filter && thread_filter != thread->thread_id))
-                                       break;
-                               if (!(time_base >= time_from && time_base < time_to))
-                                       break;
-                               method = lookup_method (method_base);
-                               if (subtype == TYPE_ENTER) {
-                                       add_trace_thread (thread, &method->traces, 1);
-                                       push_method (thread, method, time_base);
-                               } else {
-                                       pop_method (thread, method, time_base);
-                               }
-                               if (debug)
-                                       fprintf (outfile, "%s method %s\n", subtype == TYPE_ENTER? "enter": subtype == TYPE_EXC_LEAVE? "exleave": "leave", method->name);
-                       }
-                       break;
-               }
-               case TYPE_HEAP: {
-                       int subtype = *p & 0xf0;
-                       if (subtype == TYPE_HEAP_OBJECT) {
-                               HeapObjectDesc *ho = NULL;
-                               int i;
-                               intptr_t objdiff;
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                                       objdiff = decode_sleb128 (p, &p);
-                               } else
-                                       objdiff = decode_sleb128 (p + 1, &p);
-                               intptr_t ptrdiff = decode_sleb128 (p, &p);
-                               uint64_t size = decode_uleb128 (p, &p);
-                               uintptr_t num = decode_uleb128 (p, &p);
-                               uintptr_t ref_offset = 0;
-                               uintptr_t last_obj_offset = 0;
-                               ClassDesc *cd = lookup_class (ptr_base + ptrdiff);
-                               if (size) {
-                                       HeapClassDesc *hcd = add_heap_shot_class (thread->current_heap_shot, cd, size);
-                                       if (collect_traces) {
-                                               ho = alloc_heap_obj (OBJ_ADDR (objdiff), hcd, num);
-                                               add_heap_shot_obj (thread->current_heap_shot, ho);
-                                               ref_offset = 0;
-                                       }
-                               } else {
-                                       if (collect_traces)
-                                               ho = heap_shot_obj_add_refs (thread->current_heap_shot, OBJ_ADDR (objdiff), num, &ref_offset);
-                               }
-                               for (i = 0; i < num; ++i) {
-                                       /* FIXME: use object distance to measure how good
-                                        * the GC is at keeping related objects close
-                                        */
-                                       uintptr_t offset = ctx->data_version > 1? last_obj_offset + decode_uleb128 (p, &p): -1;
-                                       intptr_t obj1diff = decode_sleb128 (p, &p);
-                                       last_obj_offset = offset;
-                                       if (collect_traces)
-                                               ho->refs [ref_offset + i] = OBJ_ADDR (obj1diff);
-                                       if (num_tracked_objects)
-                                               track_obj_reference (OBJ_ADDR (obj1diff), OBJ_ADDR (objdiff), cd);
-                               }
-                               if (debug && size)
-                                       fprintf (outfile, "traced object %p, size %llu (%s), refs: %zd\n", (void*)OBJ_ADDR (objdiff), (unsigned long long) size, cd->name, num);
-                       } else if (subtype == TYPE_HEAP_ROOT) {
-                               uintptr_t num;
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                                       num = decode_uleb128 (p, &p);
-                               } else
-                                       num = decode_uleb128 (p + 1, &p);
-                               uintptr_t gc_num G_GNUC_UNUSED = decode_uleb128 (p, &p);
-                               int i;
-                               for (i = 0; i < num; ++i) {
-                                       intptr_t objdiff = decode_sleb128 (p, &p);
-                                       int root_type;
-                                       if (ctx->data_version > 12)
-                                               root_type = *p++;
-                                       else
-                                               root_type = decode_uleb128 (p, &p);
-                                       /* we just discard the extra info for now */
-                                       uintptr_t extra_info = decode_uleb128 (p, &p);
-                                       if (debug)
-                                               fprintf (outfile, "object %p is a %s root\n", (void*)OBJ_ADDR (objdiff), get_root_name (root_type));
-                                       if (collect_traces)
-                                               thread_add_root (thread, OBJ_ADDR (objdiff), root_type, extra_info);
-                               }
-                       } else if (subtype == TYPE_HEAP_END) {
-                               uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                               LOG_TIME (time_base, tdiff);
-                               time_base += tdiff;
-                               if (debug)
-                                       fprintf (outfile, "heap shot end\n");
-                               if (collect_traces) {
-                                       HeapShot *hs = thread->current_heap_shot;
-                                       if (hs && thread->num_roots) {
-                                               /* transfer the root ownershipt to the heapshot */
-                                               hs->num_roots = thread->num_roots;
-                                               hs->roots = thread->roots;
-                                               hs->roots_extra = thread->roots_extra;
-                                               hs->roots_types = thread->roots_types;
-                                       } else {
-                                               g_free (thread->roots);
-                                               g_free (thread->roots_extra);
-                                               g_free (thread->roots_types);
-                                       }
-                                       thread->num_roots = 0;
-                                       thread->size_roots = 0;
-                                       thread->roots = NULL;
-                                       thread->roots_extra = NULL;
-                                       thread->roots_types = NULL;
-                                       heap_shot_resolve_reverse_refs (hs);
-                                       heap_shot_mark_objects (hs);
-                                       heap_shot_free_objects (hs);
-                               }
-                               thread->current_heap_shot = NULL;
-                       } else if (subtype == TYPE_HEAP_START) {
-                               uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                               LOG_TIME (time_base, tdiff);
-                               time_base += tdiff;
-                               if (debug)
-                                       fprintf (outfile, "heap shot start\n");
-                               thread->current_heap_shot = new_heap_shot (time_base);
-                       }
-                       break;
-               }
-               case TYPE_MONITOR: {
-                       int event = (*p >> 4) & 0x3;
-                       int has_bt = *p & TYPE_MONITOR_BT;
-                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                       intptr_t objdiff = decode_sleb128 (p, &p);
-                       MethodDesc* sframes [8];
-                       MethodDesc** frames = sframes;
-                       int record;
-                       int num_bt = 0;
-                       LOG_TIME (time_base, tdiff);
-                       time_base += tdiff;
-                       record = (!thread_filter || thread_filter == thread->thread_id);
-                       if (!(time_base >= time_from && time_base < time_to))
-                               record = 0;
-                       if (event == MONO_PROFILER_MONITOR_CONTENTION) {
-                               MonitorDesc *mdesc = lookup_monitor (OBJ_ADDR (objdiff));
-                               if (record) {
-                                       monitor_contention++;
-                                       mdesc->contentions++;
-                                       thread->monitor = mdesc;
-                                       thread->contention_start = time_base;
-                               }
-                               if (has_bt) {
-                                       num_bt = 8;
-                                       frames = decode_bt (ctx, sframes, &num_bt, p, &p, ptr_base, &method_base);
-                                       if (!frames) {
-                                               fprintf (outfile, "Cannot load backtrace\n");
-                                               return 0;
-                                       }
-                                       if (record)
-                                               add_trace_methods (frames, num_bt, &mdesc->traces, 1);
-                               } else {
-                                       if (record)
-                                               add_trace_thread (thread, &mdesc->traces, 1);
-                               }
-                       } else if (event == MONO_PROFILER_MONITOR_FAIL) {
-                               if (record) {
-                                       monitor_failed++;
-                                       if (thread->monitor && thread->contention_start) {
-                                               uint64_t wait_time = time_base - thread->contention_start;
-                                               if (wait_time > thread->monitor->max_wait_time)
-                                                       thread->monitor->max_wait_time = wait_time;
-                                               thread->monitor->wait_time += wait_time;
-                                               thread->monitor = NULL;
-                                               thread->contention_start = 0;
-                                       }
-                               }
-                       } else if (event == MONO_PROFILER_MONITOR_DONE) {
-                               if (record) {
-                                       monitor_acquired++;
-                                       if (thread->monitor && thread->contention_start) {
-                                               uint64_t wait_time = time_base - thread->contention_start;
-                                               if (wait_time > thread->monitor->max_wait_time)
-                                                       thread->monitor->max_wait_time = wait_time;
-                                               thread->monitor->wait_time += wait_time;
-                                               thread->monitor = NULL;
-                                               thread->contention_start = 0;
-                                       }
-                               }
-                       }
-                       if (debug)
-                               fprintf (outfile, "monitor %s for object %p\n", monitor_ev_name (event), (void*)OBJ_ADDR (objdiff));
-                       if (frames != sframes)
-                               g_free (frames);
-                       break;
-               }
-               case TYPE_EXCEPTION: {
-                       int subtype = *p & 0x70;
-                       int has_bt = *p & TYPE_THROW_BT;
-                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                       MethodDesc* sframes [8];
-                       MethodDesc** frames = sframes;
-                       int record;
-                       LOG_TIME (time_base, tdiff);
-                       time_base += tdiff;
-                       record = (!thread_filter || thread_filter == thread->thread_id);
-                       if (!(time_base >= time_from && time_base < time_to))
-                               record = 0;
-                       if (subtype == TYPE_CLAUSE) {
-                               int clause_type;
-                               if (ctx->data_version > 12)
-                                       clause_type = *p++;
-                               else
-                                       clause_type = decode_uleb128 (p, &p);
-                               int clause_num = decode_uleb128 (p, &p);
-                               int64_t ptrdiff = decode_sleb128 (p, &p);
-                               method_base += ptrdiff;
-                               if (record)
-                                       clause_summary [clause_type]++;
-                               if (debug)
-                                       fprintf (outfile, "clause %s (%d) in method %s\n", clause_name (clause_type), clause_num, lookup_method (method_base)->name);
-                       } else {
-                               intptr_t objdiff = decode_sleb128 (p, &p);
-                               if (record)
-                                       throw_count++;
-                               if (has_bt) {
-                                       has_bt = 8;
-                                       frames = decode_bt (ctx, sframes, &has_bt, p, &p, ptr_base, &method_base);
-                                       if (!frames) {
-                                               fprintf (outfile, "Cannot load backtrace\n");
-                                               return 0;
-                                       }
-                                       if (record)
-                                               add_trace_methods (frames, has_bt, &exc_traces, 1);
-                               } else {
-                                       if (record)
-                                               add_trace_thread (thread, &exc_traces, 1);
-                               }
-                               if (frames != sframes)
-                                       g_free (frames);
-                               if (debug)
-                                       fprintf (outfile, "throw %p\n", (void*)OBJ_ADDR (objdiff));
-                       }
-                       break;
-               }
-               case TYPE_RUNTIME: {
-                       int subtype = *p & 0xf0;
-                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                       LOG_TIME (time_base, tdiff);
-                       time_base += tdiff;
-                       if (subtype == TYPE_JITHELPER) {
-                               int type;
-                               if (ctx->data_version > 12)
-                                       type = *p++;
-                               else
-                                       type = decode_uleb128 (p, &p);
-                               intptr_t codediff = decode_sleb128 (p, &p);
-                               int codelen = decode_uleb128 (p, &p);
-                               const char *name;
-                               if (type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE) {
-                                       name = (const char *)p;
-                                       while (*p) p++;
-                                               p++;
-                               } else {
-                                       name = code_buffer_desc (type);
-                               }
-                               num_jit_helpers++;
-                               jit_helpers_code_size += codelen;
-                               if (debug)
-                                       fprintf (outfile, "jit helper %s, size: %d, code: %p\n", name, codelen, (void*)(ptr_base + codediff));
-                       }
-                       break;
-               }
-               case TYPE_SAMPLE: {
-                       int subtype = *p & 0xf0;
-                       if (subtype == TYPE_SAMPLE_HIT) {
-                               int i;
-                               int sample_type;
-                               uint64_t tstamp;
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                                       sample_type = *p++;
-                                       tstamp = time_base;
-                               } else {
-                                       sample_type = decode_uleb128 (p + 1, &p);
-                                       tstamp = decode_uleb128 (p, &p);
-                               }
-                               void *tid = (void *) thread_id;
-                               if (ctx->data_version > 10)
-                                       tid = (void *) (ptr_base + decode_sleb128 (p, &p));
-                               int count = decode_uleb128 (p, &p);
-                               for (i = 0; i < count; ++i) {
-                                       uintptr_t ip = ptr_base + decode_sleb128 (p, &p);
-                                       if ((tstamp >= time_from && tstamp < time_to))
-                                               add_stat_sample (sample_type, ip);
-                                       if (debug)
-                                               fprintf (outfile, "sample hit, type: %d at %p for thread %p\n", sample_type, (void*)ip, tid);
-                               }
-                               if (ctx->data_version > 5) {
-                                       count = decode_uleb128 (p, &p);
-                                       for (i = 0; i < count; ++i) {
-                                               MethodDesc *method;
-                                               int64_t ptrdiff = decode_sleb128 (p, &p);
-                                               method_base += ptrdiff;
-                                               method = lookup_method (method_base);
-                                               if (debug)
-                                                       fprintf (outfile, "sample hit bt %d: %s\n", i, method->name);
-                                               if (ctx->data_version < 13) {
-                                                       decode_sleb128 (p, &p); /* il offset */
-                                                       decode_sleb128 (p, &p); /* native offset */
-                                               }
-                                       }
-                               }
-                       } else if (subtype == TYPE_SAMPLE_USYM) {
-                               /* un unmanaged symbol description */
-                               uintptr_t addr;
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                                       addr = ptr_base + decode_sleb128 (p, &p);
-                               } else
-                                       addr = ptr_base + decode_sleb128 (p + 1, &p);
-                               uintptr_t size = decode_uleb128 (p, &p);
-                               char *name;
-                               name = pstrdup ((char*)p);
-                               add_unmanaged_symbol (addr, name, size);
-                               if (debug)
-                                       fprintf (outfile, "unmanaged symbol %s at %p\n", name, (void*)addr);
-                               while (*p) p++;
-                               p++;
-                       } else if (subtype == TYPE_SAMPLE_UBIN) {
-                               /* un unmanaged binary loaded in memory */
-                               uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                               uintptr_t addr = decode_sleb128 (p, &p);
-                               uint64_t offset G_GNUC_UNUSED = decode_uleb128 (p, &p);
-                               uintptr_t size = decode_uleb128 (p, &p);
-                               char *name;
-                               LOG_TIME (time_base, tdiff);
-                               time_base += tdiff;
-                               name = pstrdup ((char*)p);
-                               add_unmanaged_binary (addr, name, size);
-                               if (debug)
-                                       fprintf (outfile, "unmanaged binary %s at %p\n", name, (void*)addr);
-                               while (*p) p++;
-                               p++;
-                       } else if (subtype == TYPE_SAMPLE_COUNTERS_DESC) {
-                               uint64_t i, len;
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                                       len = decode_uleb128 (p, &p);
-                               } else
-                                       len = decode_uleb128 (p + 1, &p);
-                               for (i = 0; i < len; i++) {
-                                       uint64_t type, unit, variance, index;
-                                       uint64_t section = decode_uleb128 (p, &p);
-                                       char *section_str, *name;
-                                       if (section != MONO_COUNTER_PERFCOUNTERS) {
-                                               section_str = (char*) section_name (section);
-                                       } else {
-                                               section_str = pstrdup ((char*)p);
-                                               while (*p++);
-                                       }
-                                       name = pstrdup ((char*)p);
-                                       while (*p++);
-                                       if (ctx->data_version > 12) {
-                                               type = *p++;
-                                               unit = *p++;
-                                               variance = *p++;
-                                       } else {
-                                               type = decode_uleb128 (p, &p);
-                                               unit = decode_uleb128 (p, &p);
-                                               variance = decode_uleb128 (p, &p);
-                                       }
-                                       index = decode_uleb128 (p, &p);
-                                       add_counter (section_str, name, (int)type, (int)unit, (int)variance, (int)index);
-                               }
-                       } else if (subtype == TYPE_SAMPLE_COUNTERS) {
-                               int i;
-                               CounterValue *value, *previous = NULL;
-                               CounterList *list;
-                               uint64_t timestamp; // milliseconds since startup
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                                       timestamp = (time_base - startup_time) / 1000 / 1000;
-                               } else
-                                       timestamp = decode_uleb128 (p + 1, &p);
-                               uint64_t time_between = timestamp / 1000 * 1000 * 1000 * 1000 + startup_time;
-                               while (1) {
-                                       uint64_t type, index = decode_uleb128 (p, &p);
-                                       if (index == 0)
-                                               break;
-
-                                       for (list = counters; list; list = list->next) {
-                                               if (list->counter->index == (int)index) {
-                                                       previous = list->counter->values_last;
-                                                       break;
-                                               }
-                                       }
-
-                                       if (ctx->data_version > 12)
-                                               type = *p++;
-                                       else
-                                               type = decode_uleb128 (p, &p);
-
-                                       value = (CounterValue *)calloc (1, sizeof (CounterValue));
-                                       value->timestamp = timestamp;
-
-                                       switch (type) {
-                                       case MONO_COUNTER_INT:
-#if SIZEOF_VOID_P == 4
-                                       case MONO_COUNTER_WORD:
-#endif
-                                               value->buffer = (unsigned char *)malloc (sizeof (int32_t));
-                                               *(int32_t*)value->buffer = (int32_t)decode_sleb128 (p, &p) + (previous ? (*(int32_t*)previous->buffer) : 0);
-                                               break;
-                                       case MONO_COUNTER_UINT:
-                                               value->buffer = (unsigned char *)malloc (sizeof (uint32_t));
-                                               *(uint32_t*)value->buffer = (uint32_t)decode_uleb128 (p, &p) + (previous ? (*(uint32_t*)previous->buffer) : 0);
-                                               break;
-                                       case MONO_COUNTER_LONG:
-#if SIZEOF_VOID_P == 8
-                                       case MONO_COUNTER_WORD:
-#endif
-                                       case MONO_COUNTER_TIME_INTERVAL:
-                                               value->buffer = (unsigned char *)malloc (sizeof (int64_t));
-                                               *(int64_t*)value->buffer = (int64_t)decode_sleb128 (p, &p) + (previous ? (*(int64_t*)previous->buffer) : 0);
-                                               break;
-                                       case MONO_COUNTER_ULONG:
-                                               value->buffer = (unsigned char *)malloc (sizeof (uint64_t));
-                                               *(uint64_t*)value->buffer = (uint64_t)decode_uleb128 (p, &p) + (previous ? (*(uint64_t*)previous->buffer) : 0);
-                                               break;
-                                       case MONO_COUNTER_DOUBLE:
-                                               value->buffer = (unsigned char *)malloc (sizeof (double));
-#if TARGET_BYTE_ORDER == G_LITTLE_ENDIAN
-                                               for (i = 0; i < sizeof (double); i++)
-#else
-                                               for (i = sizeof (double) - 1; i >= 0; i--)
-#endif
-                                                       value->buffer[i] = *p++;
-                                               break;
-                                       case MONO_COUNTER_STRING:
-                                               if (*p++ == 0) {
-                                                       value->buffer = NULL;
-                                               } else {
-                                                       value->buffer = (unsigned char*) pstrdup ((char*)p);
-                                                       while (*p++);
-                                               }
-                                               break;
-                                       }
-                                       if (time_between >= time_from && time_between <= time_to)
-                                               add_counter_value (index, value);
-                               }
-                       } else {
-                               return 0;
-                       }
-                       break;
-               }
-               case TYPE_COVERAGE:{
-                       int subtype = *p & 0xf0;
-                       switch (subtype) {
-                       case TYPE_COVERAGE_METHOD: {
-                               CoverageMethod *method = g_new0 (CoverageMethod, 1);
-                               const char *assembly, *klass, *name, *sig, *filename;
-                               int token, n_offsets, method_id;
-
-                               p++;
-
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                               }
-
-                               assembly = (const char *)p; while (*p) p++; p++;
-                               klass = (const char *)p; while (*p) p++; p++;
-                               name = (const char *)p; while (*p) p++; p++;
-                               sig = (const char *)p; while (*p) p++; p++;
-                               filename = (const char *)p; while (*p) p++; p++;
-
-                               token = decode_uleb128 (p, &p);
-                               method_id = decode_uleb128 (p, &p);
-                               n_offsets = decode_uleb128 (p, &p);
-
-                               method->assembly_name = g_strdup (assembly);
-                               method->class_name = g_strdup (klass);
-                               method->method_name = g_strdup (name);
-                               method->method_signature = g_strdup (sig);
-                               method->filename = g_strdup (filename);
-                               method->token = token;
-                               method->n_statements = n_offsets;
-                               method->coverage = g_ptr_array_new ();
-                               method->method_id = method_id;
-
-                               coverage_add_method (method);
-
-                               break;
-                       }
-                       case TYPE_COVERAGE_STATEMENT: {
-                               CoverageCoverage *coverage = g_new0 (CoverageCoverage, 1);
-                               int offset, count, line, column, method_id;
-
-                               p++;
-
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                               }
-
-                               method_id = decode_uleb128 (p, &p);
-                               offset = decode_uleb128 (p, &p);
-                               count = decode_uleb128 (p, &p);
-                               line = decode_uleb128 (p, &p);
-                               column = decode_uleb128 (p, &p);
-
-                               coverage->method_id = method_id;
-                               coverage->offset = offset;
-                               coverage->count = count;
-                               coverage->line = line;
-                               coverage->column = column;
-
-                               coverage_add_coverage (coverage);
-                               break;
-                       }
-                       case TYPE_COVERAGE_ASSEMBLY: {
-                               CoverageAssembly *assembly = g_new0 (CoverageAssembly, 1);
-                               char *name, *guid, *filename;
-                               int number_of_methods, fully_covered, partially_covered;
-                               p++;
-
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                               }
-
-                               name = (char *)p; while (*p) p++; p++;
-                               guid = (char *)p; while (*p) p++; p++;
-                               filename = (char *)p; while (*p) p++; p++;
-                               number_of_methods = decode_uleb128 (p, &p);
-                               fully_covered = decode_uleb128 (p, &p);
-                               partially_covered = decode_uleb128 (p, &p);
-
-                               assembly->name = g_strdup (name);
-                               assembly->guid = g_strdup (guid);
-                               assembly->filename = g_strdup (filename);
-                               assembly->number_of_methods = number_of_methods;
-                               assembly->fully_covered = fully_covered;
-                               assembly->partially_covered = partially_covered;
-
-                               coverage_add_assembly (assembly);
-                               break;
-                       }
-                       case TYPE_COVERAGE_CLASS: {
-                               CoverageClass *klass = g_new0 (CoverageClass, 1);
-                               char *assembly_name, *class_name;
-                               int number_of_methods, fully_covered, partially_covered;
-                               p++;
-
-                               if (ctx->data_version > 12) {
-                                       uint64_t tdiff = decode_uleb128 (p, &p);
-                                       LOG_TIME (time_base, tdiff);
-                                       time_base += tdiff;
-                               }
-
-                               assembly_name = (char *)p; while (*p) p++; p++;
-                               class_name = (char *)p; while (*p) p++; p++;
-                               number_of_methods = decode_uleb128 (p, &p);
-                               fully_covered = decode_uleb128 (p, &p);
-                               partially_covered = decode_uleb128 (p, &p);
-
-                               klass->assembly_name = g_strdup (assembly_name);
-                               klass->class_name = g_strdup (class_name);
-                               klass->number_of_methods = number_of_methods;
-                               klass->fully_covered = fully_covered;
-                               klass->partially_covered = partially_covered;
-
-                               coverage_add_class (klass);
-                               break;
-                       }
-
-                       default:
-                               break;
-                       }
-                       break;
-               }
-               case TYPE_META: {
-                       int subtype = *p & 0xf0;
-                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
-                       LOG_TIME (time_base, tdiff);
-                       time_base += tdiff;
-                       if (subtype == TYPE_SYNC_POINT) {
-                               int type = *p++;
-                               if (debug)
-                                       fprintf (outfile, "sync point %i (%s)\n", type, sync_point_name (type));
-                       }
-                       break;
-               }
-               default:
-                       fprintf (outfile, "unhandled profiler event: 0x%x at file offset: %llu + %lld (len: %d\n)\n", *p, (unsigned long long) file_offset, (long long) (p - ctx->buf), len);
-                       exit (1);
-               }
-               record_event_stats (event, p - start);
-       }
-       thread->last_time = time_base;
-       for (i = 0; i < thread->stack_id; ++i)
-               thread->stack [i]->recurse_count = 0;
-       return 1;
-}
-
-static int
-read_header_string (ProfContext *ctx, char **field)
-{
-       if (!load_data (ctx, 4))
-               return 0;
-
-       if (!load_data (ctx, read_int32 (ctx->buf)))
-               return 0;
-
-       *field = pstrdup ((const char *) ctx->buf);
-
-       return 1;
-}
-
-static ProfContext*
-load_file (char *name)
-{
-       unsigned char *p;
-       ProfContext *ctx = (ProfContext *)calloc (sizeof (ProfContext), 1);
-       if (strcmp (name, "-") == 0)
-               ctx->file = stdin;
-       else
-               ctx->file = fopen (name, "rb");
-       if (!ctx->file) {
-               printf ("Cannot open file: %s\n", name);
-               exit (1);
-       }
-#if defined (HAVE_SYS_ZLIB)
-       if (ctx->file != stdin)
-               ctx->gzfile = gzdopen (fileno (ctx->file), "rb");
-#endif
-       if (!load_data (ctx, 30))
-               return NULL;
-       p = ctx->buf;
-       if (read_int32 (p) != LOG_HEADER_ID || p [6] > LOG_DATA_VERSION)
-               return NULL;
-       ctx->version_major = p [4];
-       ctx->version_minor = p [5];
-       ctx->data_version = p [6];
-       /* reading 64 bit files on 32 bit systems not supported yet */
-       if (p [7] > sizeof (void*))
-               return NULL;
-       if (read_int32 (p + 20)) /* flags must be 0 */
-               return NULL;
-       ctx->startup_time = read_int64 (p + 8);
-       ctx->timer_overhead = read_int32 (p + 16);
-       ctx->pid = read_int32 (p + 24);
-       ctx->port = read_int16 (p + 28);
-       if (ctx->version_major >= 1) {
-               if (!read_header_string (ctx, &ctx->args))
-                       return NULL;
-               if (!read_header_string (ctx, &ctx->arch))
-                       return NULL;
-               if (!read_header_string (ctx, &ctx->os))
-                       return NULL;
-       } else {
-               if (!load_data (ctx, 2)) /* old opsys field, was never used */
-                       return NULL;
-       }
-       return ctx;
-}
-
-enum {
-       ALLOC_SORT_BYTES,
-       ALLOC_SORT_COUNT
-};
-static int alloc_sort_mode = ALLOC_SORT_BYTES;
-
-static int
-compare_class (const void *a, const void *b)
-{
-       ClassDesc *const *A = (ClassDesc *const *)a;
-       ClassDesc *const *B = (ClassDesc *const *)b;
-       uint64_t vala, valb;
-       if (alloc_sort_mode == ALLOC_SORT_BYTES) {
-               vala = (*A)->alloc_size;
-               valb = (*B)->alloc_size;
-       } else {
-               vala = (*A)->allocs;
-               valb = (*B)->allocs;
-       }
-       if (valb == vala)
-               return 0;
-       if (valb < vala)
-               return -1;
-       return 1;
-}
-
-static void
-dump_header (ProfContext *ctx)
-{
-       time_t st = ctx->startup_time / 1000;
-       char *t = ctime (&st);
-       fprintf (outfile, "\nMono log profiler data\n");
-       fprintf (outfile, "\tProfiler version: %d.%d\n", ctx->version_major, ctx->version_minor);
-       fprintf (outfile, "\tData version: %d\n", ctx->data_version);
-       if (ctx->version_major >= 1) {
-               fprintf (outfile, "\tArguments: %s\n", ctx->args);
-               fprintf (outfile, "\tArchitecture: %s\n", ctx->arch);
-               fprintf (outfile, "\tOperating system: %s\n", ctx->os);
-       }
-       fprintf (outfile, "\tMean timer overhead: %d nanoseconds\n", ctx->timer_overhead);
-       fprintf (outfile, "\tProgram startup: %s", t);
-       if (ctx->pid)
-               fprintf (outfile, "\tProgram ID: %d\n", ctx->pid);
-       if (ctx->port)
-               fprintf (outfile, "\tServer listening on: %d\n", ctx->port);
-}
-
-static void
-dump_traces (TraceDesc *traces, const char *desc)
-{
-       int j;
-       if (!show_traces)
-               return;
-       if (!traces->count)
-               return;
-       sort_context_array (traces);
-       for (j = 0; j < traces->count; ++j) {
-               int k;
-               BackTrace *bt;
-               bt = traces->traces [j].bt;
-               if (!bt->count)
-                       continue;
-               fprintf (outfile, "\t%llu %s from:\n", (unsigned long long) traces->traces [j].count, desc);
-               for (k = 0; k < bt->count; ++k)
-                       fprintf (outfile, "\t\t%s\n", bt->methods [k]->name);
-       }
-}
-
-static void
-dump_threads (ProfContext *ctx)
-{
-       ThreadContext *thread;
-       fprintf (outfile, "\nThread summary\n");
-       for (thread = ctx->threads; thread; thread = thread->next) {
-               if (thread->thread_id) {
-                       fprintf (outfile, "\tThread: %p, name: \"%s\"\n", (void*)thread->thread_id, thread->name? thread->name: "");
-               }
-       }
-}
-
-static void
-dump_domains (ProfContext *ctx)
-{
-       fprintf (outfile, "\nDomain summary\n");
-
-       for (DomainContext *domain = ctx->domains; domain; domain = domain->next)
-               fprintf (outfile, "\tDomain: %p, friendly name: \"%s\"\n", (void *) domain->domain_id, domain->friendly_name);
-}
-
-static void
-dump_remctxs (ProfContext *ctx)
-{
-       fprintf (outfile, "\nContext summary\n");
-
-       for (RemCtxContext *remctx = ctx->remctxs; remctx; remctx = remctx->next)
-               fprintf (outfile, "\tContext: %p, domain: %p\n", (void *) remctx->remctx_id, (void *) remctx->domain_id);
-}
-
-static void
-dump_exceptions (void)
-{
-       int i;
-       fprintf (outfile, "\nException summary\n");
-       fprintf (outfile, "\tThrows: %llu\n", (unsigned long long) throw_count);
-       dump_traces (&exc_traces, "throws");
-       for (i = 0; i <= MONO_EXCEPTION_CLAUSE_FAULT; ++i) {
-               if (!clause_summary [i])
-                       continue;
-               fprintf (outfile, "\tExecuted %s clauses: %llu\n", clause_name (i), (unsigned long long) clause_summary [i]);
-       }
-}
-
-static int
-compare_monitor (const void *a, const void *b)
-{
-       MonitorDesc *const *A = (MonitorDesc *const *)a;
-       MonitorDesc *const *B = (MonitorDesc *const *)b;
-       if ((*B)->wait_time == (*A)->wait_time)
-               return 0;
-       if ((*B)->wait_time < (*A)->wait_time)
-               return -1;
-       return 1;
-}
-
-static void
-dump_monitors (void)
-{
-       MonitorDesc **monitors;
-       int i, j;
-       if (!num_monitors)
-               return;
-       monitors = (MonitorDesc **)malloc (sizeof (void*) * num_monitors);
-       for (i = 0, j = 0; i < SMALL_HASH_SIZE; ++i) {
-               MonitorDesc *mdesc = monitor_hash [i];
-               while (mdesc) {
-                       monitors [j++] = mdesc;
-                       mdesc = mdesc->next;
-               }
-       }
-       qsort (monitors, num_monitors, sizeof (void*), compare_monitor);
-       fprintf (outfile, "\nMonitor lock summary\n");
-       for (i = 0; i < num_monitors; ++i) {
-               MonitorDesc *mdesc = monitors [i];
-               fprintf (outfile, "\tLock object %p: %d contentions\n", (void*)mdesc->objid, (int)mdesc->contentions);
-               fprintf (outfile, "\t\t%.6f secs total wait time, %.6f max, %.6f average\n",
-                       mdesc->wait_time/1000000000.0, mdesc->max_wait_time/1000000000.0, mdesc->wait_time/1000000000.0/mdesc->contentions);
-               dump_traces (&mdesc->traces, "contentions");
-       }
-       fprintf (outfile, "\tLock contentions: %llu\n", (unsigned long long) monitor_contention);
-       fprintf (outfile, "\tLock acquired: %llu\n", (unsigned long long) monitor_acquired);
-       fprintf (outfile, "\tLock failures: %llu\n", (unsigned long long) monitor_failed);
-}
-
-static void
-dump_gcs (void)
-{
-       int i;
-       fprintf (outfile, "\nGC summary\n");
-       fprintf (outfile, "\tGC resizes: %d\n", gc_resizes);
-       fprintf (outfile, "\tMax heap size: %llu\n", (unsigned long long) max_heap_size);
-       fprintf (outfile, "\tObject moves: %llu\n", (unsigned long long) gc_object_moves);
-       for (i = 0; i < 3; ++i) {
-               if (!gc_info [i].count)
-                       continue;
-               fprintf (outfile, "\tGen%d collections: %d, max time: %lluus, total time: %lluus, average: %lluus\n",
-                       i, gc_info [i].count,
-                       (unsigned long long) (gc_info [i].max_time / 1000),
-                       (unsigned long long) (gc_info [i].total_time / 1000),
-                       (unsigned long long) (gc_info [i].total_time / gc_info [i].count / 1000));
-       }
-       for (i = 0; i < 3; ++i) {
-               if (!handle_info [i].max_live)
-                       continue;
-               fprintf (outfile, "\tGC handles %s: created: %llu, destroyed: %llu, max: %llu\n",
-                       get_handle_name (i),
-                       (unsigned long long) (handle_info [i].created),
-                       (unsigned long long) (handle_info [i].destroyed),
-                       (unsigned long long) (handle_info [i].max_live));
-               dump_traces (&handle_info [i].traces, "created");
-               dump_traces (&handle_info [i].destroy_traces, "destroyed");
-       }
-}
-
-static void
-dump_jit (void)
-{
-       int i;
-       int code_size = 0;
-       int compiled_methods = 0;
-       MethodDesc* m;
-       fprintf (outfile, "\nJIT summary\n");
-       for (i = 0; i < HASH_SIZE; ++i) {
-               m = method_hash [i];
-               for (m = method_hash [i]; m; m = m->next) {
-                       if (!m->code || m->ignore_jit)
-                               continue;
-                       compiled_methods++;
-                       code_size += m->len;
-               }
-       }
-       fprintf (outfile, "\tCompiled methods: %d\n", compiled_methods);
-       fprintf (outfile, "\tGenerated code size: %d\n", code_size);
-       fprintf (outfile, "\tJIT helpers: %d\n", num_jit_helpers);
-       fprintf (outfile, "\tJIT helpers code size: %d\n", jit_helpers_code_size);
-}
-
-static void
-dump_allocations (void)
-{
-       int i, c;
-       intptr_t allocs = 0;
-       uint64_t size = 0;
-       int header_done = 0;
-       ClassDesc **classes = (ClassDesc **)malloc (num_classes * sizeof (void*));
-       ClassDesc *cd;
-       c = 0;
-       for (i = 0; i < HASH_SIZE; ++i) {
-               cd = class_hash [i];
-               while (cd) {
-                       classes [c++] = cd;
-                       cd = cd->next;
-               }
-       }
-       qsort (classes, num_classes, sizeof (void*), compare_class);
-       for (i = 0; i < num_classes; ++i) {
-               cd = classes [i];
-               if (!cd->allocs)
-                       continue;
-               allocs += cd->allocs;
-               size += cd->alloc_size;
-               if (!header_done++) {
-                       fprintf (outfile, "\nAllocation summary\n");
-                       fprintf (outfile, "%10s %10s %8s Type name\n", "Bytes", "Count", "Average");
-               }
-               fprintf (outfile, "%10llu %10zd %8llu %s\n",
-                       (unsigned long long) (cd->alloc_size),
-                       cd->allocs,
-                       (unsigned long long) (cd->alloc_size / cd->allocs),
-                       cd->name);
-               dump_traces (&cd->traces, "bytes");
-       }
-       if (allocs)
-               fprintf (outfile, "Total memory allocated: %llu bytes in %zd objects\n", (unsigned long long) size, allocs);
-}
-
-enum {
-       METHOD_SORT_TOTAL,
-       METHOD_SORT_SELF,
-       METHOD_SORT_CALLS
-};
-
-static int method_sort_mode = METHOD_SORT_TOTAL;
-
-static int
-compare_method (const void *a, const void *b)
-{
-       MethodDesc *const *A = (MethodDesc *const *)a;
-       MethodDesc *const *B = (MethodDesc *const *)b;
-       uint64_t vala, valb;
-       if (method_sort_mode == METHOD_SORT_SELF) {
-               vala = (*A)->self_time;
-               valb = (*B)->self_time;
-       } else if (method_sort_mode == METHOD_SORT_CALLS) {
-               vala = (*A)->calls;
-               valb = (*B)->calls;
-       } else {
-               vala = (*A)->total_time;
-               valb = (*B)->total_time;
-       }
-       if (vala == valb)
-               return 0;
-       if (valb < vala)
-               return -1;
-       return 1;
-}
-
-static void
-dump_metadata (void)
-{
-       fprintf (outfile, "\nMetadata summary\n");
-       fprintf (outfile, "\tLoaded images: %d\n", num_images);
-       if (verbose) {
-               ImageDesc *image;
-               int i;
-               for (i = 0; i < SMALL_HASH_SIZE; ++i) {
-                       image = image_hash [i];
-                       while (image) {
-                               fprintf (outfile, "\t\t%s\n", image->filename);
-                               image = image->next;
-                       }
-               }
-       }
-       fprintf (outfile, "\tLoaded assemblies: %d\n", num_assemblies);
-       if (verbose) {
-               AssemblyDesc *assembly;
-               int i;
-               for (i = 0; i < SMALL_HASH_SIZE; ++i) {
-                       assembly = assembly_hash [i];
-                       while (assembly) {
-                               fprintf (outfile, "\t\t%s\n", assembly->asmname);
-                               assembly = assembly->next;
-                       }
-               }
-       }
-}
-
-static void
-dump_methods (void)
-{
-       int i, c;
-       uint64_t calls = 0;
-       int header_done = 0;
-       MethodDesc **methods = (MethodDesc **)malloc (num_methods * sizeof (void*));
-       MethodDesc *cd;
-       c = 0;
-       for (i = 0; i < HASH_SIZE; ++i) {
-               cd = method_hash [i];
-               while (cd) {
-                       cd->total_time = cd->self_time + cd->callee_time;
-                       methods [c++] = cd;
-                       cd = cd->next;
-               }
-       }
-       qsort (methods, num_methods, sizeof (void*), compare_method);
-       for (i = 0; i < num_methods; ++i) {
-               uint64_t msecs;
-               uint64_t smsecs;
-               cd = methods [i];
-               if (!cd->calls)
-                       continue;
-               calls += cd->calls;
-               msecs = cd->total_time / 1000000;
-               smsecs = (cd->total_time - cd->callee_time) / 1000000;
-               if (!msecs && !verbose)
-                       continue;
-               if (!header_done++) {
-                       fprintf (outfile, "\nMethod call summary\n");
-                       fprintf (outfile, "%8s %8s %10s Method name\n", "Total(ms)", "Self(ms)", "Calls");
-               }
-               fprintf (outfile, "%8llu %8llu %10llu %s\n",
-                       (unsigned long long) (msecs),
-                       (unsigned long long) (smsecs),
-                       (unsigned long long) (cd->calls),
-                       cd->name);
-               dump_traces (&cd->traces, "calls");
-       }
-       if (calls)
-               fprintf (outfile, "Total calls: %llu\n", (unsigned long long) calls);
-}
-
-static int
-compare_heap_class (const void *a, const void *b)
-{
-       HeapClassDesc *const *A = (HeapClassDesc *const *)a;
-       HeapClassDesc *const *B = (HeapClassDesc *const *)b;
-       uint64_t vala, valb;
-       if (alloc_sort_mode == ALLOC_SORT_BYTES) {
-               vala = (*A)->total_size;
-               valb = (*B)->total_size;
-       } else {
-               vala = (*A)->count;
-               valb = (*B)->count;
-       }
-       if (valb == vala)
-               return 0;
-       if (valb < vala)
-               return -1;
-       return 1;
-}
-
-static int
-compare_rev_class (const void *a, const void *b)
-{
-       const HeapClassRevRef *A = (const HeapClassRevRef *)a;
-       const HeapClassRevRef *B = (const HeapClassRevRef *)b;
-       if (B->count == A->count)
-               return 0;
-       if (B->count < A->count)
-               return -1;
-       return 1;
-}
-
-static void
-dump_rev_claases (HeapClassRevRef *revs, int count)
-{
-       int j;
-       if (!show_traces)
-               return;
-       if (!count)
-               return;
-       for (j = 0; j < count; ++j) {
-               HeapClassDesc *cd = revs [j].klass;
-               fprintf (outfile, "\t\t%llu references from: %s\n",
-                       (unsigned long long) (revs [j].count),
-                       cd->klass->name);
-       }
-}
-
-static void
-heap_shot_summary (HeapShot *hs, int hs_num, HeapShot *last_hs)
-{
-       uint64_t size = 0;
-       uint64_t count = 0;
-       int ccount = 0;
-       int i;
-       HeapClassDesc *cd;
-       HeapClassDesc **sorted;
-       sorted = (HeapClassDesc **)malloc (sizeof (void*) * hs->class_count);
-       for (i = 0; i < hs->hash_size; ++i) {
-               cd = hs->class_hash [i];
-               if (!cd)
-                       continue;
-               count += cd->count;
-               size += cd->total_size;
-               sorted [ccount++] = cd;
-       }
-       hs->sorted = sorted;
-       qsort (sorted, ccount, sizeof (void*), compare_heap_class);
-       fprintf (outfile, "\n\tHeap shot %d at %.3f secs: size: %llu, object count: %llu, class count: %d, roots: %zd\n",
-               hs_num,
-               (hs->timestamp - startup_time)/1000000000.0,
-               (unsigned long long) (size),
-               (unsigned long long) (count),
-               ccount, hs->num_roots);
-       if (!verbose && ccount > 30)
-               ccount = 30;
-       fprintf (outfile, "\t%10s %10s %8s Class name\n", "Bytes", "Count", "Average");
-       for (i = 0; i < ccount; ++i) {
-               HeapClassRevRef *rev_sorted;
-               int j, k;
-               HeapClassDesc *ocd = NULL;
-               cd = sorted [i];
-               if (last_hs)
-                       ocd = heap_class_lookup (last_hs, cd->klass);
-               fprintf (outfile, "\t%10llu %10llu %8llu %s",
-                       (unsigned long long) (cd->total_size),
-                       (unsigned long long) (cd->count),
-                       (unsigned long long) (cd->total_size / cd->count),
-                       cd->klass->name);
-               if (ocd) {
-                       int64_t bdiff = cd->total_size - ocd->total_size;
-                       int64_t cdiff = cd->count - ocd->count;
-                       fprintf (outfile, " (bytes: %+lld, count: %+lld)\n", (long long) bdiff, (long long) cdiff);
-               } else {
-                       fprintf (outfile, "\n");
-               }
-               if (!collect_traces)
-                       continue;
-               rev_sorted = (HeapClassRevRef *)malloc (cd->rev_count * sizeof (HeapClassRevRef));
-               k = 0;
-               for (j = 0; j < cd->rev_hash_size; ++j) {
-                       if (cd->rev_hash [j].klass)
-                               rev_sorted [k++] = cd->rev_hash [j];
-               }
-               assert (cd->rev_count == k);
-               qsort (rev_sorted, cd->rev_count, sizeof (HeapClassRevRef), compare_rev_class);
-               if (cd->root_references)
-                       fprintf (outfile, "\t\t%zd root references (%zd pinning)\n", cd->root_references, cd->pinned_references);
-               dump_rev_claases (rev_sorted, cd->rev_count);
-               g_free (rev_sorted);
-       }
-       g_free (sorted);
-}
-
-static int
-compare_heap_shots (const void *a, const void *b)
-{
-       HeapShot *const *A = (HeapShot *const *)a;
-       HeapShot *const *B = (HeapShot *const *)b;
-       if ((*B)->timestamp == (*A)->timestamp)
-               return 0;
-       if ((*B)->timestamp > (*A)->timestamp)
-               return -1;
-       return 1;
-}
-
-static void
-dump_heap_shots (void)
-{
-       HeapShot **hs_sorted;
-       HeapShot *hs;
-       HeapShot *last_hs = NULL;
-       int i;
-       if (!heap_shots)
-               return;
-       hs_sorted = (HeapShot **)malloc (num_heap_shots * sizeof (void*));
-       fprintf (outfile, "\nHeap shot summary\n");
-       i = 0;
-       for (hs = heap_shots; hs; hs = hs->next)
-               hs_sorted [i++] = hs;
-       qsort (hs_sorted, num_heap_shots, sizeof (void*), compare_heap_shots);
-       for (i = 0; i < num_heap_shots; ++i) {
-               hs = hs_sorted [i];
-               heap_shot_summary (hs, i, last_hs);
-               last_hs = hs;
-       }
-}
-
-/* This is a very basic escape function that escapes < > and &
-   Ideally we'd use g_markup_escape_string but that function isn't
-        available in Mono's eglib. This was written without looking at the
-        source of that function in glib. */
-static char *
-escape_string_for_xml (const char *string)
-{
-       GString *string_builder = g_string_new (NULL);
-       const char *start, *p;
-
-       start = p = string;
-       while (*p) {
-               while (*p && *p != '&' && *p != '<' && *p != '>')
-                       p++;
-
-               g_string_append_len (string_builder, start, p - start);
-
-               if (*p == '\0')
-                       break;
-
-               switch (*p) {
-               case '<':
-                       g_string_append (string_builder, "&lt;");
-                       break;
-
-               case '>':
-                       g_string_append (string_builder, "&gt;");
-                       break;
-
-               case '&':
-                       g_string_append (string_builder, "&amp;");
-                       break;
-
-               default:
-                       break;
-               }
-
-               p++;
-               start = p;
-       }
-
-       return g_string_free (string_builder, FALSE);
-}
-
-static int
-sort_assemblies (gconstpointer a, gconstpointer b)
-{
-       CoverageAssembly *assembly_a = *(CoverageAssembly **)a;
-       CoverageAssembly *assembly_b = *(CoverageAssembly **)b;
-
-       if (assembly_a->name == NULL && assembly_b->name == NULL)
-               return 0;
-       else if (assembly_a->name == NULL)
-               return -1;
-       else if (assembly_b->name == NULL)
-               return 1;
-
-       return strcmp (assembly_a->name, assembly_b->name);
-}
-
-static void
-dump_coverage (void)
-{
-       if (!coverage_methods && !coverage_assemblies)
-               return;
-
-       gather_coverage_statements ();
-       fprintf (outfile, "\nCoverage Summary:\n");
-
-       if (coverage_outfile) {
-               fprintf (coverage_outfile, "<?xml version=\"1.0\"?>\n");
-               fprintf (coverage_outfile, "<coverage version=\"0.3\">\n");
-       }
-
-       g_ptr_array_sort (coverage_assemblies, sort_assemblies);
-
-       for (guint i = 0; i < coverage_assemblies->len; i++) {
-               CoverageAssembly *assembly = (CoverageAssembly *)coverage_assemblies->pdata[i];
-               GPtrArray *classes;
-
-               if (assembly->number_of_methods != 0) {
-                       int percentage = ((assembly->fully_covered + assembly->partially_covered) * 100) / assembly->number_of_methods;
-                       fprintf (outfile, "\t%s (%s) %d%% covered (%d methods - %d covered)\n", assembly->name, assembly->filename, percentage, assembly->number_of_methods, assembly->fully_covered);
-               } else
-                       fprintf (outfile, "\t%s (%s) ?%% covered (%d methods - %d covered)\n", assembly->name, assembly->filename, assembly->number_of_methods, assembly->fully_covered);
-
-               if (coverage_outfile) {
-                       char *escaped_name, *escaped_filename;
-                       escaped_name = escape_string_for_xml (assembly->name);
-                       escaped_filename = escape_string_for_xml (assembly->filename);
-
-                       fprintf (coverage_outfile, "\t<assembly name=\"%s\" guid=\"%s\" filename=\"%s\" method-count=\"%d\" full=\"%d\" partial=\"%d\"/>\n", escaped_name, assembly->guid, escaped_filename, assembly->number_of_methods, assembly->fully_covered, assembly->partially_covered);
-
-                       g_free (escaped_name);
-                       g_free (escaped_filename);
-               }
-
-               classes = (GPtrArray *)g_hash_table_lookup (coverage_assembly_classes, assembly->name);
-               if (classes) {
-                       for (guint j = 0; j < classes->len; j++) {
-                               CoverageClass *klass = (CoverageClass *)classes->pdata [j];
-
-                               if (klass->number_of_methods > 0) {
-                                       int percentage = ((klass->fully_covered + klass->partially_covered) * 100) / klass->number_of_methods;
-                                       fprintf (outfile, "\t\t%s %d%% covered (%d methods - %d covered)\n", klass->class_name, percentage, klass->number_of_methods, klass->fully_covered);
-                               } else
-                                       fprintf (outfile, "\t\t%s ?%% covered (%d methods - %d covered)\n", klass->class_name, klass->number_of_methods, klass->fully_covered);
-
-                               if (coverage_outfile) {
-                                       char *escaped_name;
-                                       escaped_name = escape_string_for_xml (klass->class_name);
-
-                                       fprintf (coverage_outfile, "\t\t<class name=\"%s\" method-count=\"%d\" full=\"%d\" partial=\"%d\"/>\n", escaped_name, klass->number_of_methods, klass->fully_covered, klass->partially_covered);
-                                       g_free (escaped_name);
-                               }
-                       }
-               }
-       }
-
-       for (guint i = 0; i < coverage_methods->len; i++) {
-               CoverageMethod *method = (CoverageMethod *)coverage_methods->pdata [i];
-
-               if (coverage_outfile) {
-                       char *escaped_assembly, *escaped_class, *escaped_method, *escaped_sig, *escaped_filename;
-
-                       escaped_assembly = escape_string_for_xml (method->assembly_name);
-                       escaped_class = escape_string_for_xml (method->class_name);
-                       escaped_method = escape_string_for_xml (method->method_name);
-                       escaped_sig = escape_string_for_xml (method->method_signature);
-                       escaped_filename = escape_string_for_xml (method->filename);
-
-                       fprintf (coverage_outfile, "\t<method assembly=\"%s\" class=\"%s\" name=\"%s (%s)\" filename=\"%s\" token=\"%d\">\n", escaped_assembly, escaped_class, escaped_method, escaped_sig, escaped_filename, method->token);
-
-                       g_free (escaped_assembly);
-                       g_free (escaped_class);
-                       g_free (escaped_method);
-                       g_free (escaped_sig);
-                       g_free (escaped_filename);
-
-                       for (guint j = 0; j < method->coverage->len; j++) {
-                               CoverageCoverage *coverage = (CoverageCoverage *)method->coverage->pdata [j];
-                               fprintf (coverage_outfile, "\t\t<statement offset=\"%d\" counter=\"%d\" line=\"%d\" column=\"%d\"/>\n", coverage->offset, coverage->count, coverage->line, coverage->column);
-                       }
-                       fprintf (coverage_outfile, "\t</method>\n");
-               }
-       }
-
-       if (coverage_outfile) {
-               fprintf (coverage_outfile, "</coverage>\n");
-               fclose (coverage_outfile);
-               coverage_outfile = NULL;
-       }
-}
-
-#define DUMP_EVENT_STAT(EVENT,SUBTYPE) dump_event (#EVENT, #SUBTYPE, EVENT, SUBTYPE);
-
-static void
-dump_event (const char *event_name, const char *subtype_name, int event, int subtype)
-{
-       int idx = event | subtype;
-       EventStat evt = stats [idx];
-       if (!evt.count)
-               return;
-
-       fprintf (outfile, "\t%16s\t%26s\tcount %6d\tmin %3d\tmax %6d\tbytes %d\n", event_name, subtype_name, evt.count, evt.min_size, evt.max_size, evt.bytes);
-}
-
-static void
-dump_stats (void)
-{
-       fprintf (outfile, "\nMlpd statistics\n");
-       fprintf (outfile, "\tBuffer count %d\toverhead %d (%d bytes per header)\n", buffer_count, buffer_count * BUFFER_HEADER_SIZE, BUFFER_HEADER_SIZE);
-       fprintf (outfile, "\nEvent details:\n");
-
-       DUMP_EVENT_STAT (TYPE_ALLOC, TYPE_ALLOC_NO_BT);
-       DUMP_EVENT_STAT (TYPE_ALLOC, TYPE_ALLOC_BT);
-
-       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_EVENT);
-       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_RESIZE);
-       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_MOVE);
-       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_HANDLE_CREATED);
-       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_HANDLE_DESTROYED);
-       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_HANDLE_CREATED_BT);
-       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_HANDLE_DESTROYED_BT);
-
-       DUMP_EVENT_STAT (TYPE_METADATA, TYPE_END_LOAD);
-       DUMP_EVENT_STAT (TYPE_METADATA, TYPE_END_UNLOAD);
-
-       DUMP_EVENT_STAT (TYPE_METHOD, TYPE_LEAVE);
-       DUMP_EVENT_STAT (TYPE_METHOD, TYPE_ENTER);
-       DUMP_EVENT_STAT (TYPE_METHOD, TYPE_EXC_LEAVE);
-       DUMP_EVENT_STAT (TYPE_METHOD, TYPE_JIT);
-
-       DUMP_EVENT_STAT (TYPE_EXCEPTION, TYPE_THROW_NO_BT);
-       DUMP_EVENT_STAT (TYPE_EXCEPTION, TYPE_THROW_BT);
-       DUMP_EVENT_STAT (TYPE_EXCEPTION, TYPE_CLAUSE);
-
-       DUMP_EVENT_STAT (TYPE_MONITOR, TYPE_MONITOR_NO_BT);
-       DUMP_EVENT_STAT (TYPE_MONITOR, TYPE_MONITOR_BT);
-
-       DUMP_EVENT_STAT (TYPE_HEAP, TYPE_HEAP_START);
-       DUMP_EVENT_STAT (TYPE_HEAP, TYPE_HEAP_END);
-       DUMP_EVENT_STAT (TYPE_HEAP, TYPE_HEAP_OBJECT);
-       DUMP_EVENT_STAT (TYPE_HEAP, TYPE_HEAP_ROOT);
-
-       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_HIT);
-       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_USYM);
-       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_UBIN);
-       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_COUNTERS_DESC);
-       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_COUNTERS);
-
-       DUMP_EVENT_STAT (TYPE_RUNTIME, TYPE_JITHELPER);
-
-       DUMP_EVENT_STAT (TYPE_COVERAGE, TYPE_COVERAGE_ASSEMBLY);
-       DUMP_EVENT_STAT (TYPE_COVERAGE, TYPE_COVERAGE_METHOD);
-       DUMP_EVENT_STAT (TYPE_COVERAGE, TYPE_COVERAGE_STATEMENT);
-       DUMP_EVENT_STAT (TYPE_COVERAGE, TYPE_COVERAGE_CLASS);
-
-       DUMP_EVENT_STAT (TYPE_META, TYPE_SYNC_POINT);
-}
-
-
-
-static void
-flush_context (ProfContext *ctx)
-{
-       ThreadContext *thread;
-       /* FIXME: sometimes there are leftovers: indagate */
-       for (thread = ctx->threads; thread; thread = thread->next) {
-               while (thread->stack_id) {
-                       if (debug)
-                               fprintf (outfile, "thread %p has %d items on stack\n", (void*)thread->thread_id, thread->stack_id);
-                       pop_method (thread, thread->stack [thread->stack_id - 1], thread->last_time);
-               }
-       }
-}
-
-static const char *reports = "header,jit,gc,sample,alloc,call,metadata,exception,monitor,thread,heapshot,counters,coverage";
-
-static const char*
-match_option (const char *p, const char *opt)
-{
-       int len = strlen (opt);
-       if (strncmp (p, opt, len) == 0) {
-               if (p [len] == ',')
-                       len++;
-               return p + len;
-       }
-       return p;
-}
-
-static int
-print_reports (ProfContext *ctx, const char *reps, int parse_only)
-{
-       const char *opt;
-       const char *p;
-       for (p = reps; *p; p = opt) {
-               if ((opt = match_option (p, "header")) != p) {
-                       if (!parse_only)
-                               dump_header (ctx);
-                       continue;
-               }
-               if ((opt = match_option (p, "thread")) != p) {
-                       if (!parse_only)
-                               dump_threads (ctx);
-                       continue;
-               }
-               if ((opt = match_option (p, "domain")) != p) {
-                       if (!parse_only)
-                               dump_domains (ctx);
-                       continue;
-               }
-               if ((opt = match_option (p, "context")) != p) {
-                       if (!parse_only)
-                               dump_remctxs (ctx);
-                       continue;
-               }
-               if ((opt = match_option (p, "gc")) != p) {
-                       if (!parse_only)
-                               dump_gcs ();
-                       continue;
-               }
-               if ((opt = match_option (p, "jit")) != p) {
-                       if (!parse_only)
-                               dump_jit ();
-                       continue;
-               }
-               if ((opt = match_option (p, "alloc")) != p) {
-                       if (!parse_only)
-                               dump_allocations ();
-                       continue;
-               }
-               if ((opt = match_option (p, "call")) != p) {
-                       if (!parse_only)
-                               dump_methods ();
-                       continue;
-               }
-               if ((opt = match_option (p, "metadata")) != p) {
-                       if (!parse_only)
-                               dump_metadata ();
-                       continue;
-               }
-               if ((opt = match_option (p, "exception")) != p) {
-                       if (!parse_only)
-                               dump_exceptions ();
-                       continue;
-               }
-               if ((opt = match_option (p, "monitor")) != p) {
-                       if (!parse_only)
-                               dump_monitors ();
-                       continue;
-               }
-               if ((opt = match_option (p, "heapshot")) != p) {
-                       if (!parse_only)
-                               dump_heap_shots ();
-                       continue;
-               }
-               if ((opt = match_option (p, "sample")) != p) {
-                       if (!parse_only)
-                               dump_samples ();
-                       continue;
-               }
-               if ((opt = match_option (p, "counters")) != p) {
-                       if (!parse_only)
-                               dump_counters ();
-                       continue;
-               }
-               if ((opt = match_option (p, "coverage")) != p) {
-                       if (!parse_only)
-                               dump_coverage ();
-                       continue;
-               }
-               if ((opt = match_option (p, "stats")) != p) {
-                       if (!parse_only)
-                               dump_stats ();
-                       continue;
-               }
-               return 0;
-       }
-       return 1;
-}
-
-static int
-add_find_spec (const char *p)
-{
-       if (p [0] == 'S' && p [1] == ':') {
-               char *vale;
-               find_size = strtoul (p + 2, &vale, 10);
-               return 1;
-       } else if (p [0] == 'T' && p [1] == ':') {
-               find_name = p + 2;
-               return 1;
-       }
-       return 0;
-}
-
-static void
-usage (void)
-{
-       printf ("Mono log profiler report version %d.%d\n", LOG_VERSION_MAJOR, LOG_VERSION_MINOR);
-       printf ("Usage: mprof-report [OPTIONS] FILENAME\n");
-       printf ("FILENAME can be '-' to read from standard input.\n");
-       printf ("Options:\n");
-       printf ("\t--help               display this help\n");
-       printf ("\t--out=FILE           write to FILE instead of stdout\n");
-       printf ("\t--traces             collect and show backtraces\n");
-       printf ("\t--maxframes=NUM      limit backtraces to NUM entries\n");
-       printf ("\t--reports=R1[,R2...] print the specified reports. Defaults are:\n");
-       printf ("\t                     %s\n", reports);
-       printf ("\t--method-sort=MODE   sort methods according to MODE: total, self, calls\n");
-       printf ("\t--alloc-sort=MODE    sort allocations according to MODE: bytes, count\n");
-       printf ("\t--counters-sort=MODE sort counters according to MODE: time, category\n");
-       printf ("\t                     only accessible in verbose mode\n");
-       printf ("\t--track=OB1[,OB2...] track what happens to objects OBJ1, O2 etc.\n");
-       printf ("\t--find=FINDSPEC      find and track objects matching FINFSPEC, where FINDSPEC is:\n");
-       printf ("\t                     S:minimum_size or T:partial_name\n");
-       printf ("\t--thread=THREADID    consider just the data for thread THREADID\n");
-       printf ("\t--time=FROM-TO       consider data FROM seconds from startup up to TO seconds\n");
-       printf ("\t--verbose            increase verbosity level\n");
-       printf ("\t--debug              display decoding debug info for mprof-report devs\n");
-       printf ("\t--coverage-out=FILE  write the coverage info to FILE as XML\n");
-}
-
-int
-main (int argc, char *argv[])
-{
-       ProfContext *ctx;
-       int i;
-       outfile = stdout;
-       for (i = 1; i < argc; ++i) {
-               if (strcmp ("--debug", argv [i]) == 0) {
-                       debug++;
-               } else if (strcmp ("--help", argv [i]) == 0) {
-                       usage ();
-                       return 0;
-               } else if (strncmp ("--alloc-sort=", argv [i], 13) == 0) {
-                       const char *val = argv [i] + 13;
-                       if (strcmp (val, "bytes") == 0) {
-                               alloc_sort_mode = ALLOC_SORT_BYTES;
-                       } else if (strcmp (val, "count") == 0) {
-                               alloc_sort_mode = ALLOC_SORT_COUNT;
-                       } else {
-                               usage ();
-                               return 1;
-                       }
-               } else if (strncmp ("--method-sort=", argv [i], 14) == 0) {
-                       const char *val = argv [i] + 14;
-                       if (strcmp (val, "total") == 0) {
-                               method_sort_mode = METHOD_SORT_TOTAL;
-                       } else if (strcmp (val, "self") == 0) {
-                               method_sort_mode = METHOD_SORT_SELF;
-                       } else if (strcmp (val, "calls") == 0) {
-                               method_sort_mode = METHOD_SORT_CALLS;
-                       } else {
-                               usage ();
-                               return 1;
-                       }
-               } else if (strncmp ("--counters-sort=", argv [i], 16) == 0) {
-                       const char *val = argv [i] + 16;
-                       if (strcmp (val, "time") == 0) {
-                               counters_sort_mode = COUNTERS_SORT_TIME;
-                       } else if (strcmp (val, "category") == 0) {
-                               counters_sort_mode = COUNTERS_SORT_CATEGORY;
-                       } else {
-                               usage ();
-                               return 1;
-                       }
-               } else if (strncmp ("--reports=", argv [i], 10) == 0) {
-                       const char *val = argv [i] + 10;
-                       if (!print_reports (NULL, val, 1)) {
-                               usage ();
-                               return 1;
-                       }
-                       reports = val;
-               } else if (strncmp ("--out=", argv [i], 6) == 0) {
-                       const char *val = argv [i] + 6;
-                       outfile = fopen (val, "w");
-                       if (!outfile) {
-                               printf ("Cannot open output file: %s\n", val);
-                               return 1;
-                       }
-               } else if (strncmp ("--maxframes=", argv [i], 12) == 0) {
-                       const char *val = argv [i] + 12;
-                       char *vale;
-                       trace_max = strtoul (val, &vale, 10);
-               } else if (strncmp ("--find=", argv [i], 7) == 0) {
-                       const char *val = argv [i] + 7;
-                       if (!add_find_spec (val)) {
-                               usage ();
-                               return 1;
-                       }
-               } else if (strncmp ("--track=", argv [i], 8) == 0) {
-                       const char *val = argv [i] + 8;
-                       char *vale;
-                       while (*val) {
-                               uintptr_t tracked_obj;
-                               if (*val == ',') {
-                                       val++;
-                                       continue;
-                               }
-                               tracked_obj = strtoul (val, &vale, 0);
-                               found_object (tracked_obj);
-                               val = vale;
-                       }
-               } else if (strncmp ("--thread=", argv [i], 9) == 0) {
-                       const char *val = argv [i] + 9;
-                       char *vale;
-                       thread_filter = strtoul (val, &vale, 0);
-               } else if (strncmp ("--time=", argv [i], 7) == 0) {
-                       char *val = pstrdup (argv [i] + 7);
-                       double from_secs, to_secs;
-                       char *top = strchr (val, '-');
-                       if (!top) {
-                               usage ();
-                               return 1;
-                       }
-                       *top++ = 0;
-                       from_secs = atof (val);
-                       to_secs = atof (top);
-                       g_free (val);
-                       if (from_secs > to_secs) {
-                               usage ();
-                               return 1;
-                       }
-                       time_from = from_secs * 1000000000;
-                       time_to = to_secs * 1000000000;
-                       use_time_filter = 1;
-               } else if (strcmp ("--verbose", argv [i]) == 0) {
-                       verbose++;
-               } else if (strcmp ("--traces", argv [i]) == 0) {
-                       show_traces = 1;
-                       collect_traces = 1;
-               } else if (strncmp ("--coverage-out=", argv [i], 15) == 0) {
-                       const char *val = argv [i] + 15;
-                       coverage_outfile = fopen (val, "w");
-                       if (!coverage_outfile) {
-                               printf ("Cannot open output file: %s\n", val);
-                               return 1;
-                       }
-               } else {
-                       break;
-               }
-       }
-       if (i >= argc) {
-               usage ();
-               return 2;
-       }
-       ctx = load_file (argv [i]);
-       if (!ctx) {
-               printf ("Not a log profiler data file (or unsupported version).\n");
-               return 1;
-       }
-       while (decode_buffer (ctx));
-       flush_context (ctx);
-       if (num_tracked_objects)
-               return 0;
-       print_reports (ctx, reports, 0);
-       return 0;
-}
diff --git a/mono/profiler/mono-profiler-log.c b/mono/profiler/mono-profiler-log.c
new file mode 100644 (file)
index 0000000..67741d9
--- /dev/null
@@ -0,0 +1,5029 @@
+/*
+ * mono-profiler-log.c: mono log profiler
+ *
+ * Authors:
+ *   Paolo Molaro (lupus@ximian.com)
+ *   Alex Rønne Petersen (alexrp@xamarin.com)
+ *
+ * Copyright 2010 Novell, Inc (http://www.novell.com)
+ * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include <config.h>
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/debug-helpers.h>
+#include "../metadata/metadata-internals.h"
+#include <mono/metadata/mono-config.h>
+#include <mono/metadata/mono-gc.h>
+#include <mono/metadata/mono-perfcounters.h>
+#include <mono/metadata/profiler.h>
+#include <mono/utils/atomic.h>
+#include <mono/utils/hazard-pointer.h>
+#include <mono/utils/lock-free-alloc.h>
+#include <mono/utils/lock-free-queue.h>
+#include <mono/utils/mono-conc-hashtable.h>
+#include <mono/utils/mono-counters.h>
+#include <mono/utils/mono-linked-list-set.h>
+#include <mono/utils/mono-membar.h>
+#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-os-mutex.h>
+#include <mono/utils/mono-os-semaphore.h>
+#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-threads-api.h>
+#include "mono-profiler-log.h"
+
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+#include <fcntl.h>
+#ifdef HAVE_LINK_H
+#include <link.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if defined(__APPLE__)
+#include <mach/mach_time.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+#include <sys/socket.h>
+#if defined (HAVE_SYS_ZLIB)
+#include <zlib.h>
+#endif
+
+#define BUFFER_SIZE (4096 * 16)
+
+/* Worst-case size in bytes of a 64-bit value encoded with LEB128. */
+#define LEB128_SIZE 10
+
+/* Size of a value encoded as a single byte. */
+#undef BYTE_SIZE // mach/i386/vm_param.h on OS X defines this to 8, but it isn't used for anything.
+#define BYTE_SIZE 1
+
+/* Size in bytes of the event prefix (ID + time). */
+#define EVENT_SIZE (BYTE_SIZE + LEB128_SIZE)
+
+static volatile gint32 runtime_inited;
+static volatile gint32 in_shutdown;
+
+static gboolean no_counters;
+static int nocalls = 0;
+static int notraces = 0;
+static int use_zip = 0;
+static int do_report = 0;
+static int do_heap_shot = 0;
+static int max_call_depth = 100;
+static int command_port = 0;
+static int heapshot_requested = 0;
+static int sample_freq = 0;
+static int do_mono_sample = 0;
+static int do_debug = 0;
+static int do_coverage = 0;
+static gboolean only_coverage;
+static gboolean debug_coverage = FALSE;
+static MonoProfileSamplingMode sampling_mode = MONO_PROFILER_STAT_MODE_PROCESS;
+static int max_allocated_sample_hits;
+
+// Statistics for internal profiler data structures.
+static gint32 sample_allocations_ctr,
+              buffer_allocations_ctr;
+
+// Statistics for profiler events.
+static gint32 sync_points_ctr,
+              heap_objects_ctr,
+              heap_starts_ctr,
+              heap_ends_ctr,
+              heap_roots_ctr,
+              gc_events_ctr,
+              gc_resizes_ctr,
+              gc_allocs_ctr,
+              gc_moves_ctr,
+              gc_handle_creations_ctr,
+              gc_handle_deletions_ctr,
+              finalize_begins_ctr,
+              finalize_ends_ctr,
+              finalize_object_begins_ctr,
+              finalize_object_ends_ctr,
+              image_loads_ctr,
+              image_unloads_ctr,
+              assembly_loads_ctr,
+              assembly_unloads_ctr,
+              class_loads_ctr,
+              class_unloads_ctr,
+              method_entries_ctr,
+              method_exits_ctr,
+              method_exception_exits_ctr,
+              method_jits_ctr,
+              code_buffers_ctr,
+              exception_throws_ctr,
+              exception_clauses_ctr,
+              monitor_contentions_ctr,
+              monitor_acquisitions_ctr,
+              monitor_failures_ctr,
+              thread_starts_ctr,
+              thread_ends_ctr,
+              thread_names_ctr,
+              domain_loads_ctr,
+              domain_unloads_ctr,
+              domain_names_ctr,
+              context_loads_ctr,
+              context_unloads_ctr,
+              sample_ubins_ctr,
+              sample_usyms_ctr,
+              sample_hits_ctr,
+              counter_descriptors_ctr,
+              counter_samples_ctr,
+              perfcounter_descriptors_ctr,
+              perfcounter_samples_ctr,
+              coverage_methods_ctr,
+              coverage_statements_ctr,
+              coverage_classes_ctr,
+              coverage_assemblies_ctr;
+
+static MonoLinkedListSet profiler_thread_list;
+
+/*
+ * file format:
+ * [header] [buffer]*
+ *
+ * The file is composed by a header followed by 0 or more buffers.
+ * Each buffer contains events that happened on a thread: for a given thread
+ * buffers that appear later in the file are guaranteed to contain events
+ * that happened later in time. Buffers from separate threads could be interleaved,
+ * though.
+ * Buffers are not required to be aligned.
+ *
+ * header format:
+ * [id: 4 bytes] constant value: LOG_HEADER_ID
+ * [major: 1 byte] [minor: 1 byte] major and minor version of the log profiler
+ * [format: 1 byte] version of the data format for the rest of the file
+ * [ptrsize: 1 byte] size in bytes of a pointer in the profiled program
+ * [startup time: 8 bytes] time in milliseconds since the unix epoch when the program started
+ * [timer overhead: 4 bytes] approximate overhead in nanoseconds of the timer
+ * [flags: 4 bytes] file format flags, should be 0 for now
+ * [pid: 4 bytes] pid of the profiled process
+ * [port: 2 bytes] tcp port for server if != 0
+ * [args size: 4 bytes] size of args
+ * [args: string] arguments passed to the profiler
+ * [arch size: 4 bytes] size of arch
+ * [arch: string] architecture the profiler is running on
+ * [os size: 4 bytes] size of os
+ * [os: string] operating system the profiler is running on
+ *
+ * The multiple byte integers are in little-endian format.
+ *
+ * buffer format:
+ * [buffer header] [event]*
+ * Buffers have a fixed-size header followed by 0 or more bytes of event data.
+ * Timing information and other values in the event data are usually stored
+ * as uleb128 or sleb128 integers. To save space, as noted for each item below,
+ * some data is represented as a difference between the actual value and
+ * either the last value of the same type (like for timing information) or
+ * as the difference from a value stored in a buffer header.
+ *
+ * For timing information the data is stored as uleb128, since timing
+ * increases in a monotonic way in each thread: the value is the number of
+ * nanoseconds to add to the last seen timing data in a buffer. The first value
+ * in a buffer will be calculated from the time_base field in the buffer head.
+ *
+ * Object or heap sizes are stored as uleb128.
+ * Pointer differences are stored as sleb128, instead.
+ *
+ * If an unexpected value is found, the rest of the buffer should be ignored,
+ * as generally the later values need the former to be interpreted correctly.
+ *
+ * buffer header format:
+ * [bufid: 4 bytes] constant value: BUF_ID
+ * [len: 4 bytes] size of the data following the buffer header
+ * [time_base: 8 bytes] time base in nanoseconds since an unspecified epoch
+ * [ptr_base: 8 bytes] base value for pointers
+ * [obj_base: 8 bytes] base value for object addresses
+ * [thread id: 8 bytes] system-specific thread ID (pthread_t for example)
+ * [method_base: 8 bytes] base value for MonoMethod pointers
+ *
+ * event format:
+ * [extended info: upper 4 bits] [type: lower 4 bits]
+ * [time diff: uleb128] nanoseconds since last timing
+ * [data]*
+ * The data that follows depends on type and the extended info.
+ * Type is one of the enum values in mono-profiler-log.h: TYPE_ALLOC, TYPE_GC,
+ * TYPE_METADATA, TYPE_METHOD, TYPE_EXCEPTION, TYPE_MONITOR, TYPE_HEAP.
+ * The extended info bits are interpreted based on type, see
+ * each individual event description below.
+ * strings are represented as a 0-terminated utf8 sequence.
+ *
+ * backtrace format:
+ * [num: uleb128] number of frames following
+ * [frame: sleb128]* mum MonoMethod* as a pointer difference from the last such
+ * pointer or the buffer method_base
+ *
+ * type alloc format:
+ * type: TYPE_ALLOC
+ * exinfo: flags: TYPE_ALLOC_BT
+ * [ptr: sleb128] class as a byte difference from ptr_base
+ * [obj: sleb128] object address as a byte difference from obj_base
+ * [size: uleb128] size of the object in the heap
+ * If the TYPE_ALLOC_BT flag is set, a backtrace follows.
+ *
+ * type GC format:
+ * type: TYPE_GC
+ * exinfo: one of TYPE_GC_EVENT, TYPE_GC_RESIZE, TYPE_GC_MOVE, TYPE_GC_HANDLE_CREATED[_BT],
+ * TYPE_GC_HANDLE_DESTROYED[_BT], TYPE_GC_FINALIZE_START, TYPE_GC_FINALIZE_END,
+ * TYPE_GC_FINALIZE_OBJECT_START, TYPE_GC_FINALIZE_OBJECT_END
+ * if exinfo == TYPE_GC_RESIZE
+ *     [heap_size: uleb128] new heap size
+ * if exinfo == TYPE_GC_EVENT
+ *     [event type: byte] GC event (MONO_GC_EVENT_* from profiler.h)
+ *     [generation: byte] GC generation event refers to
+ * if exinfo == TYPE_GC_MOVE
+ *     [num_objects: uleb128] number of object moves that follow
+ *     [objaddr: sleb128]+ num_objects object pointer differences from obj_base
+ *     num is always an even number: the even items are the old
+ *     addresses, the odd numbers are the respective new object addresses
+ * if exinfo == TYPE_GC_HANDLE_CREATED[_BT]
+ *     [handle_type: uleb128] GC handle type (System.Runtime.InteropServices.GCHandleType)
+ *     upper bits reserved as flags
+ *     [handle: uleb128] GC handle value
+ *     [objaddr: sleb128] object pointer differences from obj_base
+ *     If exinfo == TYPE_GC_HANDLE_CREATED_BT, a backtrace follows.
+ * if exinfo == TYPE_GC_HANDLE_DESTROYED[_BT]
+ *     [handle_type: uleb128] GC handle type (System.Runtime.InteropServices.GCHandleType)
+ *     upper bits reserved as flags
+ *     [handle: uleb128] GC handle value
+ *     If exinfo == TYPE_GC_HANDLE_DESTROYED_BT, a backtrace follows.
+ * if exinfo == TYPE_GC_FINALIZE_OBJECT_{START,END}
+ *     [object: sleb128] the object as a difference from obj_base
+ *
+ * type metadata format:
+ * type: TYPE_METADATA
+ * exinfo: one of: TYPE_END_LOAD, TYPE_END_UNLOAD (optional for TYPE_THREAD and TYPE_DOMAIN)
+ * [mtype: byte] metadata type, one of: TYPE_CLASS, TYPE_IMAGE, TYPE_ASSEMBLY, TYPE_DOMAIN,
+ * TYPE_THREAD, TYPE_CONTEXT
+ * [pointer: sleb128] pointer of the metadata type depending on mtype
+ * if mtype == TYPE_CLASS
+ *     [image: sleb128] MonoImage* as a pointer difference from ptr_base
+ *     [name: string] full class name
+ * if mtype == TYPE_IMAGE
+ *     [name: string] image file name
+ * if mtype == TYPE_ASSEMBLY
+ *     [name: string] assembly name
+ * if mtype == TYPE_DOMAIN && exinfo == 0
+ *     [name: string] domain friendly name
+ * if mtype == TYPE_CONTEXT
+ *     [domain: sleb128] domain id as pointer
+ * if mtype == TYPE_THREAD && exinfo == 0
+ *     [name: string] thread name
+ *
+ * type method format:
+ * type: TYPE_METHOD
+ * exinfo: one of: TYPE_LEAVE, TYPE_ENTER, TYPE_EXC_LEAVE, TYPE_JIT
+ * [method: sleb128] MonoMethod* as a pointer difference from the last such
+ * pointer or the buffer method_base
+ * if exinfo == TYPE_JIT
+ *     [code address: sleb128] pointer to the native code as a diff from ptr_base
+ *     [code size: uleb128] size of the generated code
+ *     [name: string] full method name
+ *
+ * type exception format:
+ * type: TYPE_EXCEPTION
+ * exinfo: TYPE_THROW_BT flag or one of: TYPE_CLAUSE
+ * if exinfo == TYPE_CLAUSE
+ *     [clause type: byte] MonoExceptionEnum enum value
+ *     [clause index: uleb128] index of the current clause
+ *     [method: sleb128] MonoMethod* as a pointer difference from the last such
+ *     pointer or the buffer method_base
+ * else
+ *     [object: sleb128] the exception object as a difference from obj_base
+ *     if exinfo has TYPE_THROW_BT set, a backtrace follows.
+ *
+ * type runtime format:
+ * type: TYPE_RUNTIME
+ * exinfo: one of: TYPE_JITHELPER
+ * if exinfo == TYPE_JITHELPER
+ *     [type: byte] MonoProfilerCodeBufferType enum value
+ *     [buffer address: sleb128] pointer to the native code as a diff from ptr_base
+ *     [buffer size: uleb128] size of the generated code
+ *     if type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE
+ *             [name: string] buffer description name
+ *
+ * type monitor format:
+ * type: TYPE_MONITOR
+ * exinfo: TYPE_MONITOR_BT flag and one of: MONO_PROFILER_MONITOR_(CONTENTION|FAIL|DONE)
+ * [object: sleb128] the lock object as a difference from obj_base
+ * if exinfo.low3bits == MONO_PROFILER_MONITOR_CONTENTION
+ *     If the TYPE_MONITOR_BT flag is set, a backtrace follows.
+ *
+ * type heap format
+ * type: TYPE_HEAP
+ * exinfo: one of TYPE_HEAP_START, TYPE_HEAP_END, TYPE_HEAP_OBJECT, TYPE_HEAP_ROOT
+ * if exinfo == TYPE_HEAP_OBJECT
+ *     [object: sleb128] the object as a difference from obj_base
+ *     [class: sleb128] the object MonoClass* as a difference from ptr_base
+ *     [size: uleb128] size of the object on the heap
+ *     [num_refs: uleb128] number of object references
+ *     each referenced objref is preceded by a uleb128 encoded offset: the
+ *     first offset is from the object address and each next offset is relative
+ *     to the previous one
+ *     [objrefs: sleb128]+ object referenced as a difference from obj_base
+ *     The same object can appear multiple times, but only the first time
+ *     with size != 0: in the other cases this data will only be used to
+ *     provide additional referenced objects.
+ * if exinfo == TYPE_HEAP_ROOT
+ *     [num_roots: uleb128] number of root references
+ *     [num_gc: uleb128] number of major gcs
+ *     [object: sleb128] the object as a difference from obj_base
+ *     [root_type: byte] the root_type: MonoProfileGCRootType (profiler.h)
+ *     [extra_info: uleb128] the extra_info value
+ *     object, root_type and extra_info are repeated num_roots times
+ *
+ * type sample format
+ * type: TYPE_SAMPLE
+ * exinfo: one of TYPE_SAMPLE_HIT, TYPE_SAMPLE_USYM, TYPE_SAMPLE_UBIN, TYPE_SAMPLE_COUNTERS_DESC, TYPE_SAMPLE_COUNTERS
+ * if exinfo == TYPE_SAMPLE_HIT
+ *     [thread: sleb128] thread id as difference from ptr_base
+ *     [count: uleb128] number of following instruction addresses
+ *     [ip: sleb128]* instruction pointer as difference from ptr_base
+ *     [mbt_count: uleb128] number of managed backtrace frames
+ *     [method: sleb128]* MonoMethod* as a pointer difference from the last such
+ *     pointer or the buffer method_base (the first such method can be also indentified by ip, but this is not neccessarily true)
+ * if exinfo == TYPE_SAMPLE_USYM
+ *     [address: sleb128] symbol address as a difference from ptr_base
+ *     [size: uleb128] symbol size (may be 0 if unknown)
+ *     [name: string] symbol name
+ * if exinfo == TYPE_SAMPLE_UBIN
+ *     [address: sleb128] address where binary has been loaded
+ *     [offset: uleb128] file offset of mapping (the same file can be mapped multiple times)
+ *     [size: uleb128] memory size
+ *     [name: string] binary name
+ * if exinfo == TYPE_SAMPLE_COUNTERS_DESC
+ *     [len: uleb128] number of counters
+ *     for i = 0 to len
+ *             [section: uleb128] section of counter
+ *             if section == MONO_COUNTER_PERFCOUNTERS:
+ *                     [section_name: string] section name of counter
+ *             [name: string] name of counter
+ *             [type: byte] type of counter
+ *             [unit: byte] unit of counter
+ *             [variance: byte] variance of counter
+ *             [index: uleb128] unique index of counter
+ * if exinfo == TYPE_SAMPLE_COUNTERS
+ *     while true:
+ *             [index: uleb128] unique index of counter
+ *             if index == 0:
+ *                     break
+ *             [type: byte] type of counter value
+ *             if type == string:
+ *                     if value == null:
+ *                             [0: uleb128] 0 -> value is null
+ *                     else:
+ *                             [1: uleb128] 1 -> value is not null
+ *                             [value: string] counter value
+ *             else:
+ *                     [value: uleb128/sleb128/double] counter value, can be sleb128, uleb128 or double (determined by using type)
+ *
+ * type coverage format
+ * type: TYPE_COVERAGE
+ * exinfo: one of TYPE_COVERAGE_METHOD, TYPE_COVERAGE_STATEMENT, TYPE_COVERAGE_ASSEMBLY, TYPE_COVERAGE_CLASS
+ * if exinfo == TYPE_COVERAGE_METHOD
+ *  [assembly: string] name of assembly
+ *  [class: string] name of the class
+ *  [name: string] name of the method
+ *  [signature: string] the signature of the method
+ *  [filename: string] the file path of the file that contains this method
+ *  [token: uleb128] the method token
+ *  [method_id: uleb128] an ID for this data to associate with the buffers of TYPE_COVERAGE_STATEMENTS
+ *  [len: uleb128] the number of TYPE_COVERAGE_BUFFERS associated with this method
+ * if exinfo == TYPE_COVERAGE_STATEMENTS
+ *  [method_id: uleb128] an the TYPE_COVERAGE_METHOD buffer to associate this with
+ *  [offset: uleb128] the il offset relative to the previous offset
+ *  [counter: uleb128] the counter for this instruction
+ *  [line: uleb128] the line of filename containing this instruction
+ *  [column: uleb128] the column containing this instruction
+ * if exinfo == TYPE_COVERAGE_ASSEMBLY
+ *  [name: string] assembly name
+ *  [guid: string] assembly GUID
+ *  [filename: string] assembly filename
+ *  [number_of_methods: uleb128] the number of methods in this assembly
+ *  [fully_covered: uleb128] the number of fully covered methods
+ *  [partially_covered: uleb128] the number of partially covered methods
+ *    currently partially_covered will always be 0, and fully_covered is the
+ *    number of methods that are fully and partially covered.
+ * if exinfo == TYPE_COVERAGE_CLASS
+ *  [name: string] assembly name
+ *  [class: string] class name
+ *  [number_of_methods: uleb128] the number of methods in this class
+ *  [fully_covered: uleb128] the number of fully covered methods
+ *  [partially_covered: uleb128] the number of partially covered methods
+ *    currently partially_covered will always be 0, and fully_covered is the
+ *    number of methods that are fully and partially covered.
+ *
+ * type meta format:
+ * type: TYPE_META
+ * exinfo: one of: TYPE_SYNC_POINT
+ * if exinfo == TYPE_SYNC_POINT
+ *     [type: byte] MonoProfilerSyncPointType enum value
+ */
+
+// Pending data to be written to the log, for a single thread.
+// Threads periodically flush their own LogBuffers by calling safe_send
+typedef struct _LogBuffer LogBuffer;
+struct _LogBuffer {
+       // Next (older) LogBuffer in processing queue
+       LogBuffer *next;
+
+       uint64_t time_base;
+       uint64_t last_time;
+       uintptr_t ptr_base;
+       uintptr_t method_base;
+       uintptr_t last_method;
+       uintptr_t obj_base;
+       uintptr_t thread_id;
+
+       // Bytes allocated for this LogBuffer
+       int size;
+
+       // Start of currently unused space in buffer
+       unsigned char* cursor;
+
+       // Pointer to start-of-structure-plus-size (for convenience)
+       unsigned char* buf_end;
+
+       // Start of data in buffer. Contents follow "buffer format" described above.
+       unsigned char buf [1];
+};
+
+typedef struct {
+       MonoLinkedListSetNode node;
+
+       // Convenience pointer to the profiler structure.
+       MonoProfiler *profiler;
+
+       // Was this thread added to the LLS?
+       gboolean attached;
+
+       // The current log buffer for this thread.
+       LogBuffer *buffer;
+
+       // Methods referenced by events in `buffer`, see `MethodInfo`.
+       GPtrArray *methods;
+
+       // Current call depth for enter/leave events.
+       int call_depth;
+
+       // Indicates whether this thread is currently writing to its `buffer`.
+       gboolean busy;
+
+       // Has this thread written a thread end event to `buffer`?
+       gboolean ended;
+} MonoProfilerThread;
+
+static uintptr_t
+thread_id (void)
+{
+       return (uintptr_t) mono_native_thread_id_get ();
+}
+
+static uintptr_t
+process_id (void)
+{
+#ifdef HOST_WIN32
+       return (uintptr_t) GetCurrentProcessId ();
+#else
+       return (uintptr_t) getpid ();
+#endif
+}
+
+#ifdef __APPLE__
+static mach_timebase_info_data_t timebase_info;
+#elif defined (HOST_WIN32)
+static LARGE_INTEGER pcounter_freq;
+#endif
+
+#define TICKS_PER_SEC 1000000000LL
+
+static uint64_t
+current_time (void)
+{
+#ifdef __APPLE__
+       uint64_t time = mach_absolute_time ();
+
+       time *= timebase_info.numer;
+       time /= timebase_info.denom;
+
+       return time;
+#elif defined (HOST_WIN32)
+       LARGE_INTEGER value;
+
+       QueryPerformanceCounter (&value);
+
+       return value.QuadPart * TICKS_PER_SEC / pcounter_freq.QuadPart;
+#elif defined (CLOCK_MONOTONIC)
+       struct timespec tspec;
+
+       clock_gettime (CLOCK_MONOTONIC, &tspec);
+
+       return ((uint64_t) tspec.tv_sec * TICKS_PER_SEC + tspec.tv_nsec);
+#else
+       struct timeval tv;
+
+       gettimeofday (&tv, NULL);
+
+       return ((uint64_t) tv.tv_sec * TICKS_PER_SEC + tv.tv_usec * 1000);
+#endif
+}
+
+static int timer_overhead;
+
+static void
+init_time (void)
+{
+#ifdef __APPLE__
+       mach_timebase_info (&timebase_info);
+#elif defined (HOST_WIN32)
+       QueryPerformanceFrequency (&pcounter_freq);
+#endif
+
+       uint64_t time_start = current_time ();
+
+       for (int i = 0; i < 256; ++i)
+               current_time ();
+
+       uint64_t time_end = current_time ();
+
+       timer_overhead = (time_end - time_start) / 256;
+}
+
+/*
+ * These macros should be used when writing an event to a log buffer. They take
+ * care of a bunch of stuff that can be repetitive and error-prone, such as
+ * acquiring/releasing the buffer lock, incrementing the event counter,
+ * expanding the log buffer, processing requests, etc. They also create a scope
+ * so that it's harder to leak the LogBuffer pointer, which can be problematic
+ * as the pointer is unstable when the buffer lock isn't acquired.
+ */
+
+#define ENTER_LOG(COUNTER, BUFFER, SIZE) \
+       do { \
+               MonoProfilerThread *thread__ = PROF_TLS_GET (); \
+               if (thread__->attached) \
+                       buffer_lock (); \
+               g_assert (!thread__->busy && "Why are we trying to write a new event while already writing one?"); \
+               thread__->busy = TRUE; \
+               InterlockedIncrement ((COUNTER)); \
+               LogBuffer *BUFFER = ensure_logbuf_unsafe (thread__, (SIZE))
+
+#define EXIT_LOG_EXPLICIT(SEND, REQUESTS) \
+               thread__->busy = FALSE; \
+               if ((SEND)) \
+                       send_log_unsafe (TRUE); \
+               if (thread__->attached) \
+                       buffer_unlock (); \
+               if ((REQUESTS)) \
+                       process_requests (); \
+       } while (0)
+
+// Pass these to EXIT_LOG_EXPLICIT () for easier reading.
+#define DO_SEND TRUE
+#define NO_SEND FALSE
+#define DO_REQUESTS TRUE
+#define NO_REQUESTS FALSE
+
+#define EXIT_LOG EXIT_LOG_EXPLICIT (DO_SEND, DO_REQUESTS)
+
+static volatile gint32 buffer_rwlock_count;
+static volatile gpointer buffer_rwlock_exclusive;
+
+// Can be used recursively.
+static void
+buffer_lock (void)
+{
+       /*
+        * If the thread holding the exclusive lock tries to modify the
+        * reader count, just make it a no-op. This way, we also avoid
+        * invoking the GC safe point macros below, which could break if
+        * done from a thread that is currently the initiator of STW.
+        *
+        * In other words, we rely on the fact that the GC thread takes
+        * the exclusive lock in the gc_event () callback when the world
+        * is about to stop.
+        */
+       if (InterlockedReadPointer (&buffer_rwlock_exclusive) != (gpointer) thread_id ()) {
+               MONO_ENTER_GC_SAFE;
+
+               while (InterlockedReadPointer (&buffer_rwlock_exclusive))
+                       mono_thread_info_yield ();
+
+               InterlockedIncrement (&buffer_rwlock_count);
+
+               MONO_EXIT_GC_SAFE;
+       }
+
+       mono_memory_barrier ();
+}
+
+static void
+buffer_unlock (void)
+{
+       mono_memory_barrier ();
+
+       // See the comment in buffer_lock ().
+       if (InterlockedReadPointer (&buffer_rwlock_exclusive) == (gpointer) thread_id ())
+               return;
+
+       g_assert (InterlockedRead (&buffer_rwlock_count) && "Why are we trying to decrement a zero reader count?");
+
+       InterlockedDecrement (&buffer_rwlock_count);
+}
+
+// Cannot be used recursively.
+static void
+buffer_lock_excl (void)
+{
+       gpointer tid = (gpointer) thread_id ();
+
+       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) != tid && "Why are we taking the exclusive lock twice?");
+
+       MONO_ENTER_GC_SAFE;
+
+       while (InterlockedCompareExchangePointer (&buffer_rwlock_exclusive, tid, 0))
+               mono_thread_info_yield ();
+
+       while (InterlockedRead (&buffer_rwlock_count))
+               mono_thread_info_yield ();
+
+       MONO_EXIT_GC_SAFE;
+
+       mono_memory_barrier ();
+}
+
+static void
+buffer_unlock_excl (void)
+{
+       mono_memory_barrier ();
+
+       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) && "Why is the exclusive lock not held?");
+       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) == (gpointer) thread_id () && "Why does another thread hold the exclusive lock?");
+       g_assert (!InterlockedRead (&buffer_rwlock_count) && "Why are there readers when the exclusive lock is held?");
+
+       InterlockedWritePointer (&buffer_rwlock_exclusive, NULL);
+}
+
+typedef struct _BinaryObject BinaryObject;
+struct _BinaryObject {
+       BinaryObject *next;
+       void *addr;
+       char *name;
+};
+
+struct _MonoProfiler {
+       FILE* file;
+#if defined (HAVE_SYS_ZLIB)
+       gzFile gzfile;
+#endif
+       char *args;
+       uint64_t startup_time;
+       int pipe_output;
+       int command_port;
+       int server_socket;
+       int pipes [2];
+       MonoNativeThreadId helper_thread;
+       MonoNativeThreadId writer_thread;
+       MonoNativeThreadId dumper_thread;
+       volatile gint32 run_writer_thread;
+       MonoLockFreeAllocSizeClass writer_entry_size_class;
+       MonoLockFreeAllocator writer_entry_allocator;
+       MonoLockFreeQueue writer_queue;
+       MonoSemType writer_queue_sem;
+       MonoConcurrentHashTable *method_table;
+       mono_mutex_t method_table_mutex;
+       volatile gint32 run_dumper_thread;
+       MonoLockFreeQueue dumper_queue;
+       MonoSemType dumper_queue_sem;
+       MonoLockFreeAllocSizeClass sample_size_class;
+       MonoLockFreeAllocator sample_allocator;
+       MonoLockFreeQueue sample_reuse_queue;
+       BinaryObject *binary_objects;
+       GPtrArray *coverage_filters;
+};
+
+typedef struct {
+       MonoLockFreeQueueNode node;
+       GPtrArray *methods;
+       LogBuffer *buffer;
+} WriterQueueEntry;
+
+#define WRITER_ENTRY_BLOCK_SIZE (mono_pagesize ())
+
+typedef struct {
+       MonoMethod *method;
+       MonoJitInfo *ji;
+       uint64_t time;
+} MethodInfo;
+
+#ifdef HOST_WIN32
+
+#define PROF_TLS_SET(VAL) (TlsSetValue (profiler_tls, (VAL)))
+#define PROF_TLS_GET() ((MonoProfilerThread *) TlsGetValue (profiler_tls))
+#define PROF_TLS_INIT() (profiler_tls = TlsAlloc ())
+#define PROF_TLS_FREE() (TlsFree (profiler_tls))
+
+static DWORD profiler_tls;
+
+#elif HAVE_KW_THREAD
+
+#define PROF_TLS_SET(VAL) (profiler_tls = (VAL))
+#define PROF_TLS_GET() (profiler_tls)
+#define PROF_TLS_INIT()
+#define PROF_TLS_FREE()
+
+static __thread MonoProfilerThread *profiler_tls;
+
+#else
+
+#define PROF_TLS_SET(VAL) (pthread_setspecific (profiler_tls, (VAL)))
+#define PROF_TLS_GET() ((MonoProfilerThread *) pthread_getspecific (profiler_tls))
+#define PROF_TLS_INIT() (pthread_key_create (&profiler_tls, NULL))
+#define PROF_TLS_FREE() (pthread_key_delete (profiler_tls))
+
+static pthread_key_t profiler_tls;
+
+#endif
+
+static char*
+pstrdup (const char *s)
+{
+       int len = strlen (s) + 1;
+       char *p = (char *) g_malloc (len);
+       memcpy (p, s, len);
+       return p;
+}
+
+static void *
+alloc_buffer (int size)
+{
+       return mono_valloc (NULL, size, MONO_MMAP_READ | MONO_MMAP_WRITE | MONO_MMAP_ANON | MONO_MMAP_PRIVATE, MONO_MEM_ACCOUNT_PROFILER);
+}
+
+static void
+free_buffer (void *buf, int size)
+{
+       mono_vfree (buf, size, MONO_MEM_ACCOUNT_PROFILER);
+}
+
+static LogBuffer*
+create_buffer (uintptr_t tid)
+{
+       LogBuffer* buf = (LogBuffer *) alloc_buffer (BUFFER_SIZE);
+
+       InterlockedIncrement (&buffer_allocations_ctr);
+
+       buf->size = BUFFER_SIZE;
+       buf->time_base = current_time ();
+       buf->last_time = buf->time_base;
+       buf->buf_end = (unsigned char *) buf + buf->size;
+       buf->cursor = buf->buf;
+       buf->thread_id = tid;
+
+       return buf;
+}
+
+/*
+ * Must be called with the reader lock held if thread is the current thread, or
+ * the exclusive lock if thread is a different thread. However, if thread is
+ * the current thread, and init_thread () was called with add_to_lls = FALSE,
+ * then no locking is necessary.
+ */
+static void
+init_buffer_state (MonoProfilerThread *thread)
+{
+       thread->buffer = create_buffer (thread->node.key);
+       thread->methods = NULL;
+}
+
+static void
+clear_hazard_pointers (MonoThreadHazardPointers *hp)
+{
+       mono_hazard_pointer_clear (hp, 0);
+       mono_hazard_pointer_clear (hp, 1);
+       mono_hazard_pointer_clear (hp, 2);
+}
+
+static MonoProfilerThread *
+init_thread (MonoProfiler *prof, gboolean add_to_lls)
+{
+       MonoProfilerThread *thread = PROF_TLS_GET ();
+
+       /*
+        * Sometimes we may try to initialize a thread twice. One example is the
+        * main thread: We initialize it when setting up the profiler, but we will
+        * also get a thread_start () callback for it. Another example is when
+        * attaching new threads to the runtime: We may get a gc_alloc () callback
+        * for that thread's thread object (where we initialize it), soon followed
+        * by a thread_start () callback.
+        *
+        * These cases are harmless anyhow. Just return if we've already done the
+        * initialization work.
+        */
+       if (thread)
+               return thread;
+
+       thread = g_malloc (sizeof (MonoProfilerThread));
+       thread->node.key = thread_id ();
+       thread->profiler = prof;
+       thread->attached = add_to_lls;
+       thread->call_depth = 0;
+       thread->busy = 0;
+       thread->ended = FALSE;
+
+       init_buffer_state (thread);
+
+       /*
+        * Some internal profiler threads don't need to be cleaned up
+        * by the main thread on shutdown.
+        */
+       if (add_to_lls) {
+               MonoThreadHazardPointers *hp = mono_hazard_pointer_get ();
+               g_assert (mono_lls_insert (&profiler_thread_list, hp, &thread->node) && "Why can't we insert the thread in the LLS?");
+               clear_hazard_pointers (hp);
+       }
+
+       PROF_TLS_SET (thread);
+
+       return thread;
+}
+
+// Only valid if init_thread () was called with add_to_lls = FALSE.
+static void
+deinit_thread (MonoProfilerThread *thread)
+{
+       g_assert (!thread->attached && "Why are we manually freeing an attached thread?");
+
+       g_free (thread);
+       PROF_TLS_SET (NULL);
+}
+
+// Only valid if init_thread () was called with add_to_lls = FALSE.
+static LogBuffer *
+ensure_logbuf_unsafe (MonoProfilerThread *thread, int bytes)
+{
+       LogBuffer *old = thread->buffer;
+
+       if (old && old->cursor + bytes + 100 < old->buf_end)
+               return old;
+
+       LogBuffer *new_ = create_buffer (thread->node.key);
+       new_->next = old;
+       thread->buffer = new_;
+
+       return new_;
+}
+
+static void
+encode_uleb128 (uint64_t value, uint8_t *buf, uint8_t **endbuf)
+{
+       uint8_t *p = buf;
+
+       do {
+               uint8_t b = value & 0x7f;
+               value >>= 7;
+
+               if (value != 0) /* more bytes to come */
+                       b |= 0x80;
+
+               *p ++ = b;
+       } while (value);
+
+       *endbuf = p;
+}
+
+static void
+encode_sleb128 (intptr_t value, uint8_t *buf, uint8_t **endbuf)
+{
+       int more = 1;
+       int negative = (value < 0);
+       unsigned int size = sizeof (intptr_t) * 8;
+       uint8_t byte;
+       uint8_t *p = buf;
+
+       while (more) {
+               byte = value & 0x7f;
+               value >>= 7;
+
+               /* the following is unnecessary if the
+                * implementation of >>= uses an arithmetic rather
+                * than logical shift for a signed left operand
+                */
+               if (negative)
+                       /* sign extend */
+                       value |= - ((intptr_t) 1 <<(size - 7));
+
+               /* sign bit of byte is second high order bit (0x40) */
+               if ((value == 0 && !(byte & 0x40)) ||
+                   (value == -1 && (byte & 0x40)))
+                       more = 0;
+               else
+                       byte |= 0x80;
+
+               *p ++= byte;
+       }
+
+       *endbuf = p;
+}
+
+static void
+emit_byte (LogBuffer *logbuffer, int value)
+{
+       logbuffer->cursor [0] = value;
+       logbuffer->cursor++;
+
+       g_assert (logbuffer->cursor <= logbuffer->buf_end && "Why are we writing past the buffer end?");
+}
+
+static void
+emit_value (LogBuffer *logbuffer, int value)
+{
+       encode_uleb128 (value, logbuffer->cursor, &logbuffer->cursor);
+
+       g_assert (logbuffer->cursor <= logbuffer->buf_end && "Why are we writing past the buffer end?");
+}
+
+static void
+emit_time (LogBuffer *logbuffer, uint64_t value)
+{
+       uint64_t tdiff = value - logbuffer->last_time;
+       encode_uleb128 (tdiff, logbuffer->cursor, &logbuffer->cursor);
+       logbuffer->last_time = value;
+
+       g_assert (logbuffer->cursor <= logbuffer->buf_end && "Why are we writing past the buffer end?");
+}
+
+static void
+emit_event_time (LogBuffer *logbuffer, int event, uint64_t time)
+{
+       emit_byte (logbuffer, event);
+       emit_time (logbuffer, time);
+}
+
+static void
+emit_event (LogBuffer *logbuffer, int event)
+{
+       emit_event_time (logbuffer, event, current_time ());
+}
+
+static void
+emit_svalue (LogBuffer *logbuffer, int64_t value)
+{
+       encode_sleb128 (value, logbuffer->cursor, &logbuffer->cursor);
+
+       g_assert (logbuffer->cursor <= logbuffer->buf_end && "Why are we writing past the buffer end?");
+}
+
+static void
+emit_uvalue (LogBuffer *logbuffer, uint64_t value)
+{
+       encode_uleb128 (value, logbuffer->cursor, &logbuffer->cursor);
+
+       g_assert (logbuffer->cursor <= logbuffer->buf_end && "Why are we writing past the buffer end?");
+}
+
+static void
+emit_ptr (LogBuffer *logbuffer, void *ptr)
+{
+       if (!logbuffer->ptr_base)
+               logbuffer->ptr_base = (uintptr_t) ptr;
+
+       emit_svalue (logbuffer, (intptr_t) ptr - logbuffer->ptr_base);
+
+       g_assert (logbuffer->cursor <= logbuffer->buf_end && "Why are we writing past the buffer end?");
+}
+
+static void
+emit_method_inner (LogBuffer *logbuffer, void *method)
+{
+       if (!logbuffer->method_base) {
+               logbuffer->method_base = (intptr_t) method;
+               logbuffer->last_method = (intptr_t) method;
+       }
+
+       encode_sleb128 ((intptr_t) ((char *) method - (char *) logbuffer->last_method), logbuffer->cursor, &logbuffer->cursor);
+       logbuffer->last_method = (intptr_t) method;
+
+       g_assert (logbuffer->cursor <= logbuffer->buf_end && "Why are we writing past the buffer end?");
+}
+
+static void
+register_method_local (MonoMethod *method, MonoJitInfo *ji)
+{
+       MonoProfilerThread *thread = PROF_TLS_GET ();
+
+       if (!mono_conc_hashtable_lookup (thread->profiler->method_table, method)) {
+               MethodInfo *info = (MethodInfo *) g_malloc (sizeof (MethodInfo));
+
+               info->method = method;
+               info->ji = ji;
+               info->time = current_time ();
+
+               GPtrArray *arr = thread->methods ? thread->methods : (thread->methods = g_ptr_array_new ());
+               g_ptr_array_add (arr, info);
+       }
+}
+
+static void
+emit_method (LogBuffer *logbuffer, MonoMethod *method)
+{
+       register_method_local (method, NULL);
+       emit_method_inner (logbuffer, method);
+}
+
+static void
+emit_obj (LogBuffer *logbuffer, void *ptr)
+{
+       if (!logbuffer->obj_base)
+               logbuffer->obj_base = (uintptr_t) ptr >> 3;
+
+       emit_svalue (logbuffer, ((uintptr_t) ptr >> 3) - logbuffer->obj_base);
+
+       g_assert (logbuffer->cursor <= logbuffer->buf_end && "Why are we writing past the buffer end?");
+}
+
+static void
+emit_string (LogBuffer *logbuffer, const char *str, size_t size)
+{
+       size_t i = 0;
+       if (str) {
+               for (; i < size; i++) {
+                       if (str[i] == '\0')
+                               break;
+                       emit_byte (logbuffer, str [i]);
+               }
+       }
+       emit_byte (logbuffer, '\0');
+}
+
+static void
+emit_double (LogBuffer *logbuffer, double value)
+{
+       int i;
+       unsigned char buffer[8];
+       memcpy (buffer, &value, 8);
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+       for (i = 7; i >= 0; i--)
+#else
+       for (i = 0; i < 8; i++)
+#endif
+               emit_byte (logbuffer, buffer[i]);
+}
+
+static char*
+write_int16 (char *buf, int32_t value)
+{
+       int i;
+       for (i = 0; i < 2; ++i) {
+               buf [i] = value;
+               value >>= 8;
+       }
+       return buf + 2;
+}
+
+static char*
+write_int32 (char *buf, int32_t value)
+{
+       int i;
+       for (i = 0; i < 4; ++i) {
+               buf [i] = value;
+               value >>= 8;
+       }
+       return buf + 4;
+}
+
+static char*
+write_int64 (char *buf, int64_t value)
+{
+       int i;
+       for (i = 0; i < 8; ++i) {
+               buf [i] = value;
+               value >>= 8;
+       }
+       return buf + 8;
+}
+
+static char *
+write_header_string (char *p, const char *str)
+{
+       size_t len = strlen (str) + 1;
+
+       p = write_int32 (p, len);
+       strcpy (p, str);
+
+       return p + len;
+}
+
+static void
+dump_header (MonoProfiler *profiler)
+{
+       const char *args = profiler->args;
+       const char *arch = mono_config_get_cpu ();
+       const char *os = mono_config_get_os ();
+
+       char *hbuf = g_malloc (
+               sizeof (gint32) /* header id */ +
+               sizeof (gint8) /* major version */ +
+               sizeof (gint8) /* minor version */ +
+               sizeof (gint8) /* data version */ +
+               sizeof (gint8) /* word size */ +
+               sizeof (gint64) /* startup time */ +
+               sizeof (gint32) /* timer overhead */ +
+               sizeof (gint32) /* flags */ +
+               sizeof (gint32) /* process id */ +
+               sizeof (gint16) /* command port */ +
+               sizeof (gint32) + strlen (args) + 1 /* arguments */ +
+               sizeof (gint32) + strlen (arch) + 1 /* architecture */ +
+               sizeof (gint32) + strlen (os) + 1 /* operating system */
+       );
+       char *p = hbuf;
+
+       p = write_int32 (p, LOG_HEADER_ID);
+       *p++ = LOG_VERSION_MAJOR;
+       *p++ = LOG_VERSION_MINOR;
+       *p++ = LOG_DATA_VERSION;
+       *p++ = sizeof (void *);
+       p = write_int64 (p, ((uint64_t) time (NULL)) * 1000);
+       p = write_int32 (p, timer_overhead);
+       p = write_int32 (p, 0); /* flags */
+       p = write_int32 (p, process_id ());
+       p = write_int16 (p, profiler->command_port);
+       p = write_header_string (p, args);
+       p = write_header_string (p, arch);
+       p = write_header_string (p, os);
+
+#if defined (HAVE_SYS_ZLIB)
+       if (profiler->gzfile) {
+               gzwrite (profiler->gzfile, hbuf, p - hbuf);
+       } else
+#endif
+       {
+               fwrite (hbuf, p - hbuf, 1, profiler->file);
+               fflush (profiler->file);
+       }
+
+       g_free (hbuf);
+}
+
+/*
+ * Must be called with the reader lock held if thread is the current thread, or
+ * the exclusive lock if thread is a different thread. However, if thread is
+ * the current thread, and init_thread () was called with add_to_lls = FALSE,
+ * then no locking is necessary.
+ */
+static void
+send_buffer (MonoProfilerThread *thread)
+{
+       WriterQueueEntry *entry = mono_lock_free_alloc (&thread->profiler->writer_entry_allocator);
+       entry->methods = thread->methods;
+       entry->buffer = thread->buffer;
+
+       mono_lock_free_queue_node_init (&entry->node, FALSE);
+
+       mono_lock_free_queue_enqueue (&thread->profiler->writer_queue, &entry->node);
+       mono_os_sem_post (&thread->profiler->writer_queue_sem);
+}
+
+static void
+free_thread (gpointer p)
+{
+       MonoProfilerThread *thread = p;
+
+       if (!thread->ended) {
+               /*
+                * The thread is being cleaned up by the main thread during
+                * shutdown. This typically happens for internal runtime
+                * threads. We need to synthesize a thread end event.
+                */
+
+               InterlockedIncrement (&thread_ends_ctr);
+
+               LogBuffer *buf = ensure_logbuf_unsafe (thread,
+                       EVENT_SIZE /* event */ +
+                       BYTE_SIZE /* type */ +
+                       LEB128_SIZE /* tid */
+               );
+
+               emit_event (buf, TYPE_END_UNLOAD | TYPE_METADATA);
+               emit_byte (buf, TYPE_THREAD);
+               emit_ptr (buf, (void *) thread->node.key);
+       }
+
+       send_buffer (thread);
+
+       g_free (thread);
+}
+
+static void
+remove_thread (MonoProfilerThread *thread)
+{
+       MonoThreadHazardPointers *hp = mono_hazard_pointer_get ();
+
+       if (mono_lls_remove (&profiler_thread_list, hp, &thread->node))
+               mono_thread_hazardous_try_free (thread, free_thread);
+
+       clear_hazard_pointers (hp);
+}
+
+static void
+dump_buffer (MonoProfiler *profiler, LogBuffer *buf)
+{
+       char hbuf [128];
+       char *p = hbuf;
+
+       if (buf->next)
+               dump_buffer (profiler, buf->next);
+
+       if (buf->cursor - buf->buf) {
+               p = write_int32 (p, BUF_ID);
+               p = write_int32 (p, buf->cursor - buf->buf);
+               p = write_int64 (p, buf->time_base);
+               p = write_int64 (p, buf->ptr_base);
+               p = write_int64 (p, buf->obj_base);
+               p = write_int64 (p, buf->thread_id);
+               p = write_int64 (p, buf->method_base);
+
+#if defined (HAVE_SYS_ZLIB)
+               if (profiler->gzfile) {
+                       gzwrite (profiler->gzfile, hbuf, p - hbuf);
+                       gzwrite (profiler->gzfile, buf->buf, buf->cursor - buf->buf);
+               } else
+#endif
+               {
+                       fwrite (hbuf, p - hbuf, 1, profiler->file);
+                       fwrite (buf->buf, buf->cursor - buf->buf, 1, profiler->file);
+                       fflush (profiler->file);
+               }
+       }
+
+       free_buffer (buf, buf->size);
+}
+
+static void
+dump_buffer_threadless (MonoProfiler *profiler, LogBuffer *buf)
+{
+       for (LogBuffer *iter = buf; iter; iter = iter->next)
+               iter->thread_id = 0;
+
+       dump_buffer (profiler, buf);
+}
+
+static void
+process_requests (void)
+{
+       if (heapshot_requested)
+               mono_gc_collect (mono_gc_max_generation ());
+}
+
+// Only valid if init_thread () was called with add_to_lls = FALSE.
+static void
+send_log_unsafe (gboolean if_needed)
+{
+       MonoProfilerThread *thread = PROF_TLS_GET ();
+
+       if (!if_needed || (if_needed && thread->buffer->next)) {
+               if (!thread->attached)
+                       for (LogBuffer *iter = thread->buffer; iter; iter = iter->next)
+                               iter->thread_id = 0;
+
+               send_buffer (thread);
+               init_buffer_state (thread);
+       }
+}
+
+// Assumes that the exclusive lock is held.
+static void
+sync_point_flush (void)
+{
+       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) == (gpointer) thread_id () && "Why don't we hold the exclusive lock?");
+
+       MONO_LLS_FOREACH_SAFE (&profiler_thread_list, MonoProfilerThread, thread) {
+               g_assert (thread->attached && "Why is a thread in the LLS not attached?");
+
+               send_buffer (thread);
+               init_buffer_state (thread);
+       } MONO_LLS_FOREACH_SAFE_END
+}
+
+// Assumes that the exclusive lock is held.
+static void
+sync_point_mark (MonoProfilerSyncPointType type)
+{
+       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) == (gpointer) thread_id () && "Why don't we hold the exclusive lock?");
+
+       ENTER_LOG (&sync_points_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* type */
+       );
+
+       emit_event (logbuffer, TYPE_META | TYPE_SYNC_POINT);
+       emit_byte (logbuffer, type);
+
+       EXIT_LOG_EXPLICIT (NO_SEND, NO_REQUESTS);
+
+       send_log_unsafe (FALSE);
+}
+
+// Assumes that the exclusive lock is held.
+static void
+sync_point (MonoProfilerSyncPointType type)
+{
+       sync_point_flush ();
+       sync_point_mark (type);
+}
+
+static int
+gc_reference (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data)
+{
+       /* account for object alignment in the heap */
+       size += 7;
+       size &= ~7;
+
+       ENTER_LOG (&heap_objects_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* obj */ +
+               LEB128_SIZE /* klass */ +
+               LEB128_SIZE /* size */ +
+               LEB128_SIZE /* num */ +
+               num * (
+                       LEB128_SIZE /* offset */ +
+                       LEB128_SIZE /* ref */
+               )
+       );
+
+       emit_event (logbuffer, TYPE_HEAP_OBJECT | TYPE_HEAP);
+       emit_obj (logbuffer, obj);
+       emit_ptr (logbuffer, klass);
+       emit_value (logbuffer, size);
+       emit_value (logbuffer, num);
+
+       uintptr_t last_offset = 0;
+
+       for (int i = 0; i < num; ++i) {
+               emit_value (logbuffer, offsets [i] - last_offset);
+               last_offset = offsets [i];
+               emit_obj (logbuffer, refs [i]);
+       }
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+
+       return 0;
+}
+
+static unsigned int hs_mode_ms = 0;
+static unsigned int hs_mode_gc = 0;
+static unsigned int hs_mode_ondemand = 0;
+static unsigned int gc_count = 0;
+static uint64_t last_hs_time = 0;
+static gboolean do_heap_walk = FALSE;
+
+static void
+heap_walk (MonoProfiler *profiler)
+{
+       ENTER_LOG (&heap_starts_ctr, logbuffer,
+               EVENT_SIZE /* event */
+       );
+
+       emit_event (logbuffer, TYPE_HEAP_START | TYPE_HEAP);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+
+       mono_gc_walk_heap (0, gc_reference, NULL);
+
+       ENTER_LOG (&heap_ends_ctr, logbuffer,
+               EVENT_SIZE /* event */
+       );
+
+       emit_event (logbuffer, TYPE_HEAP_END | TYPE_HEAP);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+}
+
+static void
+gc_roots (MonoProfiler *prof, int num, void **objects, int *root_types, uintptr_t *extra_info)
+{
+       ENTER_LOG (&heap_roots_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* num */ +
+               LEB128_SIZE /* collections */ +
+               num * (
+                       LEB128_SIZE /* object */ +
+                       LEB128_SIZE /* root type */ +
+                       LEB128_SIZE /* extra info */
+               )
+       );
+
+       emit_event (logbuffer, TYPE_HEAP_ROOT | TYPE_HEAP);
+       emit_value (logbuffer, num);
+       emit_value (logbuffer, mono_gc_collection_count (mono_gc_max_generation ()));
+
+       for (int i = 0; i < num; ++i) {
+               emit_obj (logbuffer, objects [i]);
+               emit_byte (logbuffer, root_types [i]);
+               emit_value (logbuffer, extra_info [i]);
+       }
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+}
+
+static void
+gc_event (MonoProfiler *profiler, MonoGCEvent ev, int generation)
+{
+       ENTER_LOG (&gc_events_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* gc event */ +
+               BYTE_SIZE /* generation */
+       );
+
+       emit_event (logbuffer, TYPE_GC_EVENT | TYPE_GC);
+       emit_byte (logbuffer, ev);
+       emit_byte (logbuffer, generation);
+
+       EXIT_LOG_EXPLICIT (NO_SEND, NO_REQUESTS);
+
+       switch (ev) {
+       case MONO_GC_EVENT_START:
+               if (generation == mono_gc_max_generation ())
+                       gc_count++;
+
+               uint64_t now = current_time ();
+
+               if (hs_mode_ms && (now - last_hs_time) / 1000 * 1000 >= hs_mode_ms)
+                       do_heap_walk = TRUE;
+               else if (hs_mode_gc && !(gc_count % hs_mode_gc))
+                       do_heap_walk = TRUE;
+               else if (hs_mode_ondemand)
+                       do_heap_walk = heapshot_requested;
+               else if (!hs_mode_ms && !hs_mode_gc && generation == mono_gc_max_generation ())
+                       do_heap_walk = TRUE;
+               break;
+       case MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED:
+               /*
+                * Ensure that no thread can be in the middle of writing to
+                * a buffer when the world stops...
+                */
+               buffer_lock_excl ();
+               break;
+       case MONO_GC_EVENT_POST_STOP_WORLD:
+               /*
+                * ... So that we now have a consistent view of all buffers.
+                * This allows us to flush them. We need to do this because
+                * they may contain object allocation events that need to be
+                * committed to the log file before any object move events
+                * that will be produced during this GC.
+                */
+               sync_point (SYNC_POINT_WORLD_STOP);
+               break;
+       case MONO_GC_EVENT_PRE_START_WORLD:
+               if (do_heap_shot && do_heap_walk) {
+                       heap_walk (profiler);
+
+                       do_heap_walk = FALSE;
+                       heapshot_requested = 0;
+                       last_hs_time = current_time ();
+               }
+               break;
+       case MONO_GC_EVENT_POST_START_WORLD_UNLOCKED:
+               /*
+                * Similarly, we must now make sure that any object moves
+                * written to the GC thread's buffer are flushed. Otherwise,
+                * object allocation events for certain addresses could come
+                * after the move events that made those addresses available.
+                */
+               sync_point_mark (SYNC_POINT_WORLD_START);
+
+               /*
+                * Finally, it is safe to allow other threads to write to
+                * their buffers again.
+                */
+               buffer_unlock_excl ();
+               break;
+       default:
+               break;
+       }
+}
+
+static void
+gc_resize (MonoProfiler *profiler, int64_t new_size)
+{
+       ENTER_LOG (&gc_resizes_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* new size */
+       );
+
+       emit_event (logbuffer, TYPE_GC_RESIZE | TYPE_GC);
+       emit_value (logbuffer, new_size);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+}
+
+// If you alter MAX_FRAMES, you may need to alter SAMPLE_BLOCK_SIZE too.
+#define MAX_FRAMES 32
+
+typedef struct {
+       int count;
+       MonoMethod* methods [MAX_FRAMES];
+       int32_t il_offsets [MAX_FRAMES];
+       int32_t native_offsets [MAX_FRAMES];
+} FrameData;
+
+static int num_frames = MAX_FRAMES;
+
+static mono_bool
+walk_stack (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data)
+{
+       FrameData *frame = (FrameData *)data;
+       if (method && frame->count < num_frames) {
+               frame->il_offsets [frame->count] = il_offset;
+               frame->native_offsets [frame->count] = native_offset;
+               frame->methods [frame->count++] = method;
+               //printf ("In %d %s at %d (native: %d)\n", frame->count, mono_method_get_name (method), il_offset, native_offset);
+       }
+       return frame->count == num_frames;
+}
+
+/*
+ * a note about stack walks: they can cause more profiler events to fire,
+ * so we need to make sure they don't happen after we started emitting an
+ * event, hence the collect_bt/emit_bt split.
+ */
+static void
+collect_bt (FrameData *data)
+{
+       data->count = 0;
+       mono_stack_walk_no_il (walk_stack, data);
+}
+
+static void
+emit_bt (MonoProfiler *prof, LogBuffer *logbuffer, FrameData *data)
+{
+       /* FIXME: this is actually tons of data and we should
+        * just output it the first time and use an id the next
+        */
+       if (data->count > num_frames)
+               printf ("bad num frames: %d\n", data->count);
+       emit_value (logbuffer, data->count);
+       //if (*p != data.count) {
+       //      printf ("bad num frames enc at %d: %d -> %d\n", count, data.count, *p); printf ("frames end: %p->%p\n", p, logbuffer->cursor); exit(0);}
+       while (data->count) {
+               emit_method (logbuffer, data->methods [--data->count]);
+       }
+}
+
+static void
+gc_alloc (MonoProfiler *prof, MonoObject *obj, MonoClass *klass)
+{
+       init_thread (prof, TRUE);
+
+       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces) ? TYPE_ALLOC_BT : 0;
+       FrameData data;
+       uintptr_t len = mono_object_get_size (obj);
+       /* account for object alignment in the heap */
+       len += 7;
+       len &= ~7;
+
+       if (do_bt)
+               collect_bt (&data);
+
+       ENTER_LOG (&gc_allocs_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* klass */ +
+               LEB128_SIZE /* obj */ +
+               LEB128_SIZE /* size */ +
+               (do_bt ? (
+                       LEB128_SIZE /* count */ +
+                       data.count * (
+                               LEB128_SIZE /* method */
+                       )
+               ) : 0)
+       );
+
+       emit_event (logbuffer, do_bt | TYPE_ALLOC);
+       emit_ptr (logbuffer, klass);
+       emit_obj (logbuffer, obj);
+       emit_value (logbuffer, len);
+
+       if (do_bt)
+               emit_bt (prof, logbuffer, &data);
+
+       EXIT_LOG;
+}
+
+static void
+gc_moves (MonoProfiler *prof, void **objects, int num)
+{
+       ENTER_LOG (&gc_moves_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* num */ +
+               num * (
+                       LEB128_SIZE /* object */
+               )
+       );
+
+       emit_event (logbuffer, TYPE_GC_MOVE | TYPE_GC);
+       emit_value (logbuffer, num);
+
+       for (int i = 0; i < num; ++i)
+               emit_obj (logbuffer, objects [i]);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+}
+
+static void
+gc_handle (MonoProfiler *prof, int op, int type, uintptr_t handle, MonoObject *obj)
+{
+       int do_bt = nocalls && InterlockedRead (&runtime_inited) && !notraces;
+       FrameData data;
+
+       if (do_bt)
+               collect_bt (&data);
+
+       gint32 *ctr = op == MONO_PROFILER_GC_HANDLE_CREATED ? &gc_handle_creations_ctr : &gc_handle_deletions_ctr;
+
+       ENTER_LOG (ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* type */ +
+               LEB128_SIZE /* handle */ +
+               (op == MONO_PROFILER_GC_HANDLE_CREATED ? (
+                       LEB128_SIZE /* obj */
+               ) : 0) +
+               (do_bt ? (
+                       LEB128_SIZE /* count */ +
+                       data.count * (
+                               LEB128_SIZE /* method */
+                       )
+               ) : 0)
+       );
+
+       if (op == MONO_PROFILER_GC_HANDLE_CREATED)
+               emit_event (logbuffer, (do_bt ? TYPE_GC_HANDLE_CREATED_BT : TYPE_GC_HANDLE_CREATED) | TYPE_GC);
+       else if (op == MONO_PROFILER_GC_HANDLE_DESTROYED)
+               emit_event (logbuffer, (do_bt ? TYPE_GC_HANDLE_DESTROYED_BT : TYPE_GC_HANDLE_DESTROYED) | TYPE_GC);
+       else
+               g_assert_not_reached ();
+
+       emit_value (logbuffer, type);
+       emit_value (logbuffer, handle);
+
+       if (op == MONO_PROFILER_GC_HANDLE_CREATED)
+               emit_obj (logbuffer, obj);
+
+       if (do_bt)
+               emit_bt (prof, logbuffer, &data);
+
+       EXIT_LOG;
+}
+
+static void
+finalize_begin (MonoProfiler *prof)
+{
+       ENTER_LOG (&finalize_begins_ctr, buf,
+               EVENT_SIZE /* event */
+       );
+
+       emit_event (buf, TYPE_GC_FINALIZE_START | TYPE_GC);
+
+       EXIT_LOG;
+}
+
+static void
+finalize_end (MonoProfiler *prof)
+{
+       ENTER_LOG (&finalize_ends_ctr, buf,
+               EVENT_SIZE /* event */
+       );
+
+       emit_event (buf, TYPE_GC_FINALIZE_END | TYPE_GC);
+
+       EXIT_LOG;
+}
+
+static void
+finalize_object_begin (MonoProfiler *prof, MonoObject *obj)
+{
+       ENTER_LOG (&finalize_object_begins_ctr, buf,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* obj */
+       );
+
+       emit_event (buf, TYPE_GC_FINALIZE_OBJECT_START | TYPE_GC);
+       emit_obj (buf, obj);
+
+       EXIT_LOG;
+}
+
+static void
+finalize_object_end (MonoProfiler *prof, MonoObject *obj)
+{
+       ENTER_LOG (&finalize_object_ends_ctr, buf,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* obj */
+       );
+
+       emit_event (buf, TYPE_GC_FINALIZE_OBJECT_END | TYPE_GC);
+       emit_obj (buf, obj);
+
+       EXIT_LOG;
+}
+
+static char*
+push_nesting (char *p, MonoClass *klass)
+{
+       MonoClass *nesting;
+       const char *name;
+       const char *nspace;
+       nesting = mono_class_get_nesting_type (klass);
+       if (nesting) {
+               p = push_nesting (p, nesting);
+               *p++ = '/';
+               *p = 0;
+       }
+       name = mono_class_get_name (klass);
+       nspace = mono_class_get_namespace (klass);
+       if (*nspace) {
+               strcpy (p, nspace);
+               p += strlen (nspace);
+               *p++ = '.';
+               *p = 0;
+       }
+       strcpy (p, name);
+       p += strlen (name);
+       return p;
+}
+
+static char*
+type_name (MonoClass *klass)
+{
+       char buf [1024];
+       char *p;
+       push_nesting (buf, klass);
+       p = (char *) g_malloc (strlen (buf) + 1);
+       strcpy (p, buf);
+       return p;
+}
+
+static void
+image_loaded (MonoProfiler *prof, MonoImage *image, int result)
+{
+       if (result != MONO_PROFILE_OK)
+               return;
+
+       const char *name = mono_image_get_filename (image);
+       int nlen = strlen (name) + 1;
+
+       ENTER_LOG (&image_loads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* image */ +
+               nlen /* name */
+       );
+
+       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_IMAGE);
+       emit_ptr (logbuffer, image);
+       memcpy (logbuffer->cursor, name, nlen);
+       logbuffer->cursor += nlen;
+
+       EXIT_LOG;
+}
+
+static void
+image_unloaded (MonoProfiler *prof, MonoImage *image)
+{
+       const char *name = mono_image_get_filename (image);
+       int nlen = strlen (name) + 1;
+
+       ENTER_LOG (&image_unloads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* image */ +
+               nlen /* name */
+       );
+
+       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_IMAGE);
+       emit_ptr (logbuffer, image);
+       memcpy (logbuffer->cursor, name, nlen);
+       logbuffer->cursor += nlen;
+
+       EXIT_LOG;
+}
+
+static void
+assembly_loaded (MonoProfiler *prof, MonoAssembly *assembly, int result)
+{
+       if (result != MONO_PROFILE_OK)
+               return;
+
+       char *name = mono_stringify_assembly_name (mono_assembly_get_name (assembly));
+       int nlen = strlen (name) + 1;
+
+       ENTER_LOG (&assembly_loads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* assembly */ +
+               nlen /* name */
+       );
+
+       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_ASSEMBLY);
+       emit_ptr (logbuffer, assembly);
+       memcpy (logbuffer->cursor, name, nlen);
+       logbuffer->cursor += nlen;
+
+       EXIT_LOG;
+
+       mono_free (name);
+}
+
+static void
+assembly_unloaded (MonoProfiler *prof, MonoAssembly *assembly)
+{
+       char *name = mono_stringify_assembly_name (mono_assembly_get_name (assembly));
+       int nlen = strlen (name) + 1;
+
+       ENTER_LOG (&assembly_unloads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* assembly */ +
+               nlen /* name */
+       );
+
+       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_ASSEMBLY);
+       emit_ptr (logbuffer, assembly);
+       memcpy (logbuffer->cursor, name, nlen);
+       logbuffer->cursor += nlen;
+
+       EXIT_LOG;
+
+       mono_free (name);
+}
+
+static void
+class_loaded (MonoProfiler *prof, MonoClass *klass, int result)
+{
+       if (result != MONO_PROFILE_OK)
+               return;
+
+       char *name;
+
+       if (InterlockedRead (&runtime_inited))
+               name = mono_type_get_name (mono_class_get_type (klass));
+       else
+               name = type_name (klass);
+
+       int nlen = strlen (name) + 1;
+       MonoImage *image = mono_class_get_image (klass);
+
+       ENTER_LOG (&class_loads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* klass */ +
+               LEB128_SIZE /* image */ +
+               nlen /* name */
+       );
+
+       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_CLASS);
+       emit_ptr (logbuffer, klass);
+       emit_ptr (logbuffer, image);
+       memcpy (logbuffer->cursor, name, nlen);
+       logbuffer->cursor += nlen;
+
+       EXIT_LOG;
+
+       if (runtime_inited)
+               mono_free (name);
+       else
+               g_free (name);
+}
+
+static void
+class_unloaded (MonoProfiler *prof, MonoClass *klass)
+{
+       char *name;
+
+       if (InterlockedRead (&runtime_inited))
+               name = mono_type_get_name (mono_class_get_type (klass));
+       else
+               name = type_name (klass);
+
+       int nlen = strlen (name) + 1;
+       MonoImage *image = mono_class_get_image (klass);
+
+       ENTER_LOG (&class_unloads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* klass */ +
+               LEB128_SIZE /* image */ +
+               nlen /* name */
+       );
+
+       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_CLASS);
+       emit_ptr (logbuffer, klass);
+       emit_ptr (logbuffer, image);
+       memcpy (logbuffer->cursor, name, nlen);
+       logbuffer->cursor += nlen;
+
+       EXIT_LOG;
+
+       if (runtime_inited)
+               mono_free (name);
+       else
+               g_free (name);
+}
+
+static void process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method);
+
+static void
+method_enter (MonoProfiler *prof, MonoMethod *method)
+{
+       process_method_enter_coverage (prof, method);
+
+       if (!only_coverage && PROF_TLS_GET ()->call_depth++ <= max_call_depth) {
+               ENTER_LOG (&method_entries_ctr, logbuffer,
+                       EVENT_SIZE /* event */ +
+                       LEB128_SIZE /* method */
+               );
+
+               emit_event (logbuffer, TYPE_ENTER | TYPE_METHOD);
+               emit_method (logbuffer, method);
+
+               EXIT_LOG;
+       }
+}
+
+static void
+method_leave (MonoProfiler *prof, MonoMethod *method)
+{
+       if (!only_coverage && --PROF_TLS_GET ()->call_depth <= max_call_depth) {
+               ENTER_LOG (&method_exits_ctr, logbuffer,
+                       EVENT_SIZE /* event */ +
+                       LEB128_SIZE /* method */
+               );
+
+               emit_event (logbuffer, TYPE_LEAVE | TYPE_METHOD);
+               emit_method (logbuffer, method);
+
+               EXIT_LOG;
+       }
+}
+
+static void
+method_exc_leave (MonoProfiler *prof, MonoMethod *method)
+{
+       if (!only_coverage && !nocalls && --PROF_TLS_GET ()->call_depth <= max_call_depth) {
+               ENTER_LOG (&method_exception_exits_ctr, logbuffer,
+                       EVENT_SIZE /* event */ +
+                       LEB128_SIZE /* method */
+               );
+
+               emit_event (logbuffer, TYPE_EXC_LEAVE | TYPE_METHOD);
+               emit_method (logbuffer, method);
+
+               EXIT_LOG;
+       }
+}
+
+static void
+method_jitted (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji, int result)
+{
+       if (result != MONO_PROFILE_OK)
+               return;
+
+       register_method_local (method, ji);
+
+       process_requests ();
+}
+
+static void
+code_buffer_new (MonoProfiler *prof, void *buffer, int size, MonoProfilerCodeBufferType type, void *data)
+{
+       char *name;
+       int nlen;
+
+       if (type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE) {
+               name = (char *) data;
+               nlen = strlen (name) + 1;
+       } else {
+               name = NULL;
+               nlen = 0;
+       }
+
+       ENTER_LOG (&code_buffers_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* buffer */ +
+               LEB128_SIZE /* size */ +
+               (name ? (
+                       nlen /* name */
+               ) : 0)
+       );
+
+       emit_event (logbuffer, TYPE_JITHELPER | TYPE_RUNTIME);
+       emit_byte (logbuffer, type);
+       emit_ptr (logbuffer, buffer);
+       emit_value (logbuffer, size);
+
+       if (name) {
+               memcpy (logbuffer->cursor, name, nlen);
+               logbuffer->cursor += nlen;
+       }
+
+       EXIT_LOG;
+}
+
+static void
+throw_exc (MonoProfiler *prof, MonoObject *object)
+{
+       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces) ? TYPE_THROW_BT : 0;
+       FrameData data;
+
+       if (do_bt)
+               collect_bt (&data);
+
+       ENTER_LOG (&exception_throws_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* object */ +
+               (do_bt ? (
+                       LEB128_SIZE /* count */ +
+                       data.count * (
+                               LEB128_SIZE /* method */
+                       )
+               ) : 0)
+       );
+
+       emit_event (logbuffer, do_bt | TYPE_EXCEPTION);
+       emit_obj (logbuffer, object);
+
+       if (do_bt)
+               emit_bt (prof, logbuffer, &data);
+
+       EXIT_LOG;
+}
+
+static void
+clause_exc (MonoProfiler *prof, MonoMethod *method, int clause_type, int clause_num)
+{
+       ENTER_LOG (&exception_clauses_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* clause type */ +
+               LEB128_SIZE /* clause num */ +
+               LEB128_SIZE /* method */
+       );
+
+       emit_event (logbuffer, TYPE_EXCEPTION | TYPE_CLAUSE);
+       emit_byte (logbuffer, clause_type);
+       emit_value (logbuffer, clause_num);
+       emit_method (logbuffer, method);
+
+       EXIT_LOG;
+}
+
+static void
+monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEvent event)
+{
+       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces && event == MONO_PROFILER_MONITOR_CONTENTION) ? TYPE_MONITOR_BT : 0;
+       FrameData data;
+
+       if (do_bt)
+               collect_bt (&data);
+
+       gint32 *ctr;
+
+       switch (event) {
+       case MONO_PROFILER_MONITOR_CONTENTION:
+               ctr = &monitor_contentions_ctr;
+               break;
+       case MONO_PROFILER_MONITOR_DONE:
+               ctr = &monitor_acquisitions_ctr;
+               break;
+       case MONO_PROFILER_MONITOR_FAIL:
+               ctr = &monitor_failures_ctr;
+               break;
+       default:
+               g_assert_not_reached ();
+               break;
+       }
+
+       ENTER_LOG (ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* object */ +
+               (do_bt ? (
+                       LEB128_SIZE /* count */ +
+                       data.count * (
+                               LEB128_SIZE /* method */
+                       )
+               ) : 0)
+       );
+
+       emit_event (logbuffer, (event << 4) | do_bt | TYPE_MONITOR);
+       emit_obj (logbuffer, object);
+
+       if (do_bt)
+               emit_bt (profiler, logbuffer, &data);
+
+       EXIT_LOG;
+}
+
+static void
+thread_start (MonoProfiler *prof, uintptr_t tid)
+{
+       init_thread (prof, TRUE);
+
+       ENTER_LOG (&thread_starts_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* tid */
+       );
+
+       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_THREAD);
+       emit_ptr (logbuffer, (void*) tid);
+
+       EXIT_LOG;
+}
+
+static void
+thread_end (MonoProfiler *prof, uintptr_t tid)
+{
+       ENTER_LOG (&thread_ends_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* tid */
+       );
+
+       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_THREAD);
+       emit_ptr (logbuffer, (void*) tid);
+
+       EXIT_LOG_EXPLICIT (NO_SEND, NO_REQUESTS);
+
+       MonoProfilerThread *thread = PROF_TLS_GET ();
+
+       thread->ended = TRUE;
+       remove_thread (thread);
+
+       PROF_TLS_SET (NULL);
+}
+
+static void
+thread_name (MonoProfiler *prof, uintptr_t tid, const char *name)
+{
+       int len = strlen (name) + 1;
+
+       ENTER_LOG (&thread_names_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* tid */ +
+               len /* name */
+       );
+
+       emit_event (logbuffer, TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_THREAD);
+       emit_ptr (logbuffer, (void*)tid);
+       memcpy (logbuffer->cursor, name, len);
+       logbuffer->cursor += len;
+
+       EXIT_LOG;
+}
+
+static void
+domain_loaded (MonoProfiler *prof, MonoDomain *domain, int result)
+{
+       if (result != MONO_PROFILE_OK)
+               return;
+
+       ENTER_LOG (&domain_loads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* domain id */
+       );
+
+       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_DOMAIN);
+       emit_ptr (logbuffer, (void*)(uintptr_t) mono_domain_get_id (domain));
+
+       EXIT_LOG;
+}
+
+static void
+domain_unloaded (MonoProfiler *prof, MonoDomain *domain)
+{
+       ENTER_LOG (&domain_unloads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* domain id */
+       );
+
+       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_DOMAIN);
+       emit_ptr (logbuffer, (void*)(uintptr_t) mono_domain_get_id (domain));
+
+       EXIT_LOG;
+}
+
+static void
+domain_name (MonoProfiler *prof, MonoDomain *domain, const char *name)
+{
+       int nlen = strlen (name) + 1;
+
+       ENTER_LOG (&domain_names_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* domain id */ +
+               nlen /* name */
+       );
+
+       emit_event (logbuffer, TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_DOMAIN);
+       emit_ptr (logbuffer, (void*)(uintptr_t) mono_domain_get_id (domain));
+       memcpy (logbuffer->cursor, name, nlen);
+       logbuffer->cursor += nlen;
+
+       EXIT_LOG;
+}
+
+static void
+context_loaded (MonoProfiler *prof, MonoAppContext *context)
+{
+       ENTER_LOG (&context_loads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* context id */ +
+               LEB128_SIZE /* domain id */
+       );
+
+       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_CONTEXT);
+       emit_ptr (logbuffer, (void*)(uintptr_t) mono_context_get_id (context));
+       emit_ptr (logbuffer, (void*)(uintptr_t) mono_context_get_domain_id (context));
+
+       EXIT_LOG;
+}
+
+static void
+context_unloaded (MonoProfiler *prof, MonoAppContext *context)
+{
+       ENTER_LOG (&context_unloads_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               BYTE_SIZE /* type */ +
+               LEB128_SIZE /* context id */ +
+               LEB128_SIZE /* domain id */
+       );
+
+       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
+       emit_byte (logbuffer, TYPE_CONTEXT);
+       emit_ptr (logbuffer, (void*)(uintptr_t) mono_context_get_id (context));
+       emit_ptr (logbuffer, (void*)(uintptr_t) mono_context_get_domain_id (context));
+
+       EXIT_LOG;
+}
+
+typedef struct {
+       MonoMethod *method;
+       MonoDomain *domain;
+       void *base_address;
+       int offset;
+} AsyncFrameInfo;
+
+typedef struct {
+       MonoLockFreeQueueNode node;
+       MonoProfiler *prof;
+       uint64_t time;
+       uintptr_t tid;
+       void *ip;
+       int count;
+       AsyncFrameInfo frames [MONO_ZERO_LEN_ARRAY];
+} SampleHit;
+
+static mono_bool
+async_walk_stack (MonoMethod *method, MonoDomain *domain, void *base_address, int offset, void *data)
+{
+       SampleHit *sample = (SampleHit *) data;
+
+       if (sample->count < num_frames) {
+               int i = sample->count;
+
+               sample->frames [i].method = method;
+               sample->frames [i].domain = domain;
+               sample->frames [i].base_address = base_address;
+               sample->frames [i].offset = offset;
+
+               sample->count++;
+       }
+
+       return sample->count == num_frames;
+}
+
+#define SAMPLE_SLOT_SIZE(FRAMES) (sizeof (SampleHit) + sizeof (AsyncFrameInfo) * (FRAMES - MONO_ZERO_LEN_ARRAY))
+#define SAMPLE_BLOCK_SIZE (mono_pagesize ())
+
+static void
+enqueue_sample_hit (gpointer p)
+{
+       SampleHit *sample = p;
+
+       mono_lock_free_queue_node_unpoison (&sample->node);
+       mono_lock_free_queue_enqueue (&sample->prof->dumper_queue, &sample->node);
+       mono_os_sem_post (&sample->prof->dumper_queue_sem);
+}
+
+static void
+mono_sample_hit (MonoProfiler *profiler, unsigned char *ip, void *context)
+{
+       /*
+        * Please note: We rely on the runtime loading the profiler with
+        * MONO_DL_EAGER (RTLD_NOW) so that references to runtime functions within
+        * this function (and its siblings) are resolved when the profiler is
+        * loaded. Otherwise, we would potentially invoke the dynamic linker when
+        * invoking runtime functions, which is not async-signal-safe.
+        */
+
+       if (InterlockedRead (&in_shutdown))
+               return;
+
+       SampleHit *sample = (SampleHit *) mono_lock_free_queue_dequeue (&profiler->sample_reuse_queue);
+
+       if (!sample) {
+               /*
+                * If we're out of reusable sample events and we're not allowed to
+                * allocate more, we have no choice but to drop the event.
+                */
+               if (InterlockedRead (&sample_allocations_ctr) >= max_allocated_sample_hits)
+                       return;
+
+               sample = mono_lock_free_alloc (&profiler->sample_allocator);
+               sample->prof = profiler;
+               mono_lock_free_queue_node_init (&sample->node, TRUE);
+
+               InterlockedIncrement (&sample_allocations_ctr);
+       }
+
+       sample->count = 0;
+       mono_stack_walk_async_safe (&async_walk_stack, context, sample);
+
+       sample->time = current_time ();
+       sample->tid = thread_id ();
+       sample->ip = ip;
+
+       mono_thread_hazardous_try_free (sample, enqueue_sample_hit);
+}
+
+static uintptr_t *code_pages = 0;
+static int num_code_pages = 0;
+static int size_code_pages = 0;
+#define CPAGE_SHIFT (9)
+#define CPAGE_SIZE (1 << CPAGE_SHIFT)
+#define CPAGE_MASK (~(CPAGE_SIZE - 1))
+#define CPAGE_ADDR(p) ((p) & CPAGE_MASK)
+
+static uintptr_t
+add_code_page (uintptr_t *hash, uintptr_t hsize, uintptr_t page)
+{
+       uintptr_t i;
+       uintptr_t start_pos;
+       start_pos = (page >> CPAGE_SHIFT) % hsize;
+       i = start_pos;
+       do {
+               if (hash [i] && CPAGE_ADDR (hash [i]) == CPAGE_ADDR (page)) {
+                       return 0;
+               } else if (!hash [i]) {
+                       hash [i] = page;
+                       return 1;
+               }
+               /* wrap around */
+               if (++i == hsize)
+                       i = 0;
+       } while (i != start_pos);
+       /* should not happen */
+       printf ("failed code page store\n");
+       return 0;
+}
+
+static void
+add_code_pointer (uintptr_t ip)
+{
+       uintptr_t i;
+       if (num_code_pages * 2 >= size_code_pages) {
+               uintptr_t *n;
+               uintptr_t old_size = size_code_pages;
+               size_code_pages *= 2;
+               if (size_code_pages == 0)
+                       size_code_pages = 16;
+               n = (uintptr_t *) g_calloc (sizeof (uintptr_t) * size_code_pages, 1);
+               for (i = 0; i < old_size; ++i) {
+                       if (code_pages [i])
+                               add_code_page (n, size_code_pages, code_pages [i]);
+               }
+               if (code_pages)
+                       g_free (code_pages);
+               code_pages = n;
+       }
+       num_code_pages += add_code_page (code_pages, size_code_pages, ip & CPAGE_MASK);
+}
+
+/* ELF code crashes on some systems. */
+//#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+#if 0
+static void
+dump_ubin (MonoProfiler *prof, const char *filename, uintptr_t load_addr, uint64_t offset, uintptr_t size)
+{
+       int len = strlen (filename) + 1;
+
+       ENTER_LOG (&sample_ubins_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* load address */ +
+               LEB128_SIZE /* offset */ +
+               LEB128_SIZE /* size */ +
+               nlen /* file name */
+       );
+
+       emit_event (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_UBIN);
+       emit_svalue (logbuffer, load_addr);
+       emit_uvalue (logbuffer, offset);
+       emit_uvalue (logbuffer, size);
+       memcpy (logbuffer->cursor, filename, len);
+       logbuffer->cursor += len;
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+}
+#endif
+
+static void
+dump_usym (MonoProfiler *prof, const char *name, uintptr_t value, uintptr_t size)
+{
+       int len = strlen (name) + 1;
+
+       ENTER_LOG (&sample_usyms_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* value */ +
+               LEB128_SIZE /* size */ +
+               len /* name */
+       );
+
+       emit_event (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_USYM);
+       emit_ptr (logbuffer, (void*)value);
+       emit_value (logbuffer, size);
+       memcpy (logbuffer->cursor, name, len);
+       logbuffer->cursor += len;
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+}
+
+/* ELF code crashes on some systems. */
+//#if defined(ELFMAG0)
+#if 0
+
+#if SIZEOF_VOID_P == 4
+#define ELF_WSIZE 32
+#else
+#define ELF_WSIZE 64
+#endif
+#ifndef ElfW
+#define ElfW(type)      _ElfW (Elf, ELF_WSIZE, type)
+#define _ElfW(e,w,t)    _ElfW_1 (e, w, _##t)
+#define _ElfW_1(e,w,t)  e##w##t
+#endif
+
+static void
+dump_elf_symbols (MonoProfiler *prof, ElfW(Sym) *symbols, int num_symbols, const char *strtab, void *load_addr)
+{
+       int i;
+       for (i = 0; i < num_symbols; ++i) {
+               const char* sym;
+               sym =  strtab + symbols [i].st_name;
+               if (!symbols [i].st_name || !symbols [i].st_size || (symbols [i].st_info & 0xf) != STT_FUNC)
+                       continue;
+               //printf ("symbol %s at %d\n", sym, symbols [i].st_value);
+               dump_usym (sym, (uintptr_t)load_addr + symbols [i].st_value, symbols [i].st_size);
+       }
+}
+
+static int
+read_elf_symbols (MonoProfiler *prof, const char *filename, void *load_addr)
+{
+       int fd, i;
+       void *data;
+       struct stat statb;
+       uint64_t file_size;
+       ElfW(Ehdr) *header;
+       ElfW(Shdr) *sheader;
+       ElfW(Shdr) *shstrtabh;
+       ElfW(Shdr) *symtabh = NULL;
+       ElfW(Shdr) *strtabh = NULL;
+       ElfW(Sym) *symbols = NULL;
+       const char *strtab;
+       int num_symbols;
+
+       fd = open (filename, O_RDONLY);
+       if (fd < 0)
+               return 0;
+       if (fstat (fd, &statb) != 0) {
+               close (fd);
+               return 0;
+       }
+       file_size = statb.st_size;
+       data = mmap (NULL, file_size, PROT_READ, MAP_PRIVATE, fd, 0);
+       close (fd);
+       if (data == MAP_FAILED)
+               return 0;
+       header = data;
+       if (header->e_ident [EI_MAG0] != ELFMAG0 ||
+                       header->e_ident [EI_MAG1] != ELFMAG1 ||
+                       header->e_ident [EI_MAG2] != ELFMAG2 ||
+                       header->e_ident [EI_MAG3] != ELFMAG3 ) {
+               munmap (data, file_size);
+               return 0;
+       }
+       sheader = (void*)((char*)data + header->e_shoff);
+       shstrtabh = (void*)((char*)sheader + (header->e_shentsize * header->e_shstrndx));
+       strtab = (const char*)data + shstrtabh->sh_offset;
+       for (i = 0; i < header->e_shnum; ++i) {
+               //printf ("section header: %d\n", sheader->sh_type);
+               if (sheader->sh_type == SHT_SYMTAB) {
+                       symtabh = sheader;
+                       strtabh = (void*)((char*)data + header->e_shoff + sheader->sh_link * header->e_shentsize);
+                       /*printf ("symtab section header: %d, .strstr: %d\n", i, sheader->sh_link);*/
+                       break;
+               }
+               sheader = (void*)((char*)sheader + header->e_shentsize);
+       }
+       if (!symtabh || !strtabh) {
+               munmap (data, file_size);
+               return 0;
+       }
+       strtab = (const char*)data + strtabh->sh_offset;
+       num_symbols = symtabh->sh_size / symtabh->sh_entsize;
+       symbols = (void*)((char*)data + symtabh->sh_offset);
+       dump_elf_symbols (symbols, num_symbols, strtab, load_addr);
+       munmap (data, file_size);
+       return 1;
+}
+#endif
+
+/* ELF code crashes on some systems. */
+//#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+#if 0
+static int
+elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
+{
+       MonoProfiler *prof = data;
+       char buf [256];
+       const char *filename;
+       BinaryObject *obj;
+       char *a = (void*)info->dlpi_addr;
+       int i, num_sym;
+       ElfW(Dyn) *dyn = NULL;
+       ElfW(Sym) *symtab = NULL;
+       ElfW(Word) *hash_table = NULL;
+       ElfW(Ehdr) *header = NULL;
+       const char* strtab = NULL;
+       for (obj = prof->binary_objects; obj; obj = obj->next) {
+               if (obj->addr == a)
+                       return 0;
+       }
+       filename = info->dlpi_name;
+       if (!filename)
+               return 0;
+       if (!info->dlpi_addr && !filename [0]) {
+               int l = readlink ("/proc/self/exe", buf, sizeof (buf) - 1);
+               if (l > 0) {
+                       buf [l] = 0;
+                       filename = buf;
+               }
+       }
+       obj = g_calloc (sizeof (BinaryObject), 1);
+       obj->addr = (void*)info->dlpi_addr;
+       obj->name = pstrdup (filename);
+       obj->next = prof->binary_objects;
+       prof->binary_objects = obj;
+       //printf ("loaded file: %s at %p, segments: %d\n", filename, (void*)info->dlpi_addr, info->dlpi_phnum);
+       a = NULL;
+       for (i = 0; i < info->dlpi_phnum; ++i) {
+               //printf ("segment type %d file offset: %d, size: %d\n", info->dlpi_phdr[i].p_type, info->dlpi_phdr[i].p_offset, info->dlpi_phdr[i].p_memsz);
+               if (info->dlpi_phdr[i].p_type == PT_LOAD && !header) {
+                       header = (ElfW(Ehdr)*)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
+                       if (header->e_ident [EI_MAG0] != ELFMAG0 ||
+                                       header->e_ident [EI_MAG1] != ELFMAG1 ||
+                                       header->e_ident [EI_MAG2] != ELFMAG2 ||
+                                       header->e_ident [EI_MAG3] != ELFMAG3 ) {
+                               header = NULL;
+                       }
+                       dump_ubin (prof, filename, info->dlpi_addr + info->dlpi_phdr[i].p_vaddr, info->dlpi_phdr[i].p_offset, info->dlpi_phdr[i].p_memsz);
+               } else if (info->dlpi_phdr[i].p_type == PT_DYNAMIC) {
+                       dyn = (ElfW(Dyn) *)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
+               }
+       }
+       if (read_elf_symbols (prof, filename, (void*)info->dlpi_addr))
+               return 0;
+       if (!info->dlpi_name || !info->dlpi_name[0])
+               return 0;
+       if (!dyn)
+               return 0;
+       for (i = 0; dyn [i].d_tag != DT_NULL; ++i) {
+               if (dyn [i].d_tag == DT_SYMTAB) {
+                       if (symtab && do_debug)
+                               printf ("multiple symtabs: %d\n", i);
+                       symtab = (ElfW(Sym) *)(a + dyn [i].d_un.d_ptr);
+               } else if (dyn [i].d_tag == DT_HASH) {
+                       hash_table = (ElfW(Word) *)(a + dyn [i].d_un.d_ptr);
+               } else if (dyn [i].d_tag == DT_STRTAB) {
+                       strtab = (const char*)(a + dyn [i].d_un.d_ptr);
+               }
+       }
+       if (!hash_table)
+               return 0;
+       num_sym = hash_table [1];
+       dump_elf_symbols (prof, symtab, num_sym, strtab, (void*)info->dlpi_addr);
+       return 0;
+}
+
+static int
+load_binaries (MonoProfiler *prof)
+{
+       dl_iterate_phdr (elf_dl_callback, prof);
+       return 1;
+}
+#else
+static int
+load_binaries (MonoProfiler *prof)
+{
+       return 0;
+}
+#endif
+
+static const char*
+symbol_for (uintptr_t code)
+{
+#ifdef HAVE_DLADDR
+       void *ip = (void*)code;
+       Dl_info di;
+       if (dladdr (ip, &di)) {
+               if (di.dli_sname)
+                       return di.dli_sname;
+       } else {
+       /*      char **names;
+               names = backtrace_symbols (&ip, 1);
+               if (names) {
+                       const char* p = names [0];
+                       g_free (names);
+                       return p;
+               }
+               */
+       }
+#endif
+       return NULL;
+}
+
+static void
+dump_unmanaged_coderefs (MonoProfiler *prof)
+{
+       int i;
+       const char* last_symbol;
+       uintptr_t addr, page_end;
+
+       if (load_binaries (prof))
+               return;
+       for (i = 0; i < size_code_pages; ++i) {
+               const char* sym;
+               if (!code_pages [i] || code_pages [i] & 1)
+                       continue;
+               last_symbol = NULL;
+               addr = CPAGE_ADDR (code_pages [i]);
+               page_end = addr + CPAGE_SIZE;
+               code_pages [i] |= 1;
+               /* we dump the symbols for the whole page */
+               for (; addr < page_end; addr += 16) {
+                       sym = symbol_for (addr);
+                       if (sym && sym == last_symbol)
+                               continue;
+                       last_symbol = sym;
+                       if (!sym)
+                               continue;
+                       dump_usym (prof, sym, addr, 0); /* let's not guess the size */
+                       //printf ("found symbol at %p: %s\n", (void*)addr, sym);
+               }
+       }
+}
+
+static int
+mono_cpu_count (void)
+{
+#ifdef PLATFORM_ANDROID
+       /* Android tries really hard to save power by powering off CPUs on SMP phones which
+        * means the normal way to query cpu count returns a wrong value with userspace API.
+        * Instead we use /sys entries to query the actual hardware CPU count.
+        */
+       int count = 0;
+       char buffer[8] = {'\0'};
+       int present = open ("/sys/devices/system/cpu/present", O_RDONLY);
+       /* Format of the /sys entry is a cpulist of indexes which in the case
+        * of present is always of the form "0-(n-1)" when there is more than
+        * 1 core, n being the number of CPU cores in the system. Otherwise
+        * the value is simply 0
+        */
+       if (present != -1 && read (present, (char*)buffer, sizeof (buffer)) > 3)
+               count = strtol (((char*)buffer) + 2, NULL, 10);
+       if (present != -1)
+               close (present);
+       if (count > 0)
+               return count + 1;
+#endif
+
+#if defined(HOST_ARM) || defined (HOST_ARM64)
+
+       /* ARM platforms tries really hard to save power by powering off CPUs on SMP phones which
+        * means the normal way to query cpu count returns a wrong value with userspace API. */
+
+#ifdef _SC_NPROCESSORS_CONF
+       {
+               int count = sysconf (_SC_NPROCESSORS_CONF);
+               if (count > 0)
+                       return count;
+       }
+#endif
+
+#else
+
+#ifdef HAVE_SCHED_GETAFFINITY
+       {
+               cpu_set_t set;
+               if (sched_getaffinity (getpid (), sizeof (set), &set) == 0)
+                       return CPU_COUNT (&set);
+       }
+#endif
+#ifdef _SC_NPROCESSORS_ONLN
+       {
+               int count = sysconf (_SC_NPROCESSORS_ONLN);
+               if (count > 0)
+                       return count;
+       }
+#endif
+
+#endif /* defined(HOST_ARM) || defined (HOST_ARM64) */
+
+#ifdef USE_SYSCTL
+       {
+               int count;
+               int mib [2];
+               size_t len = sizeof (int);
+               mib [0] = CTL_HW;
+               mib [1] = HW_NCPU;
+               if (sysctl (mib, 2, &count, &len, NULL, 0) == 0)
+                       return count;
+       }
+#endif
+#ifdef HOST_WIN32
+       {
+               SYSTEM_INFO info;
+               GetSystemInfo (&info);
+               return info.dwNumberOfProcessors;
+       }
+#endif
+
+       static gboolean warned;
+
+       if (!warned) {
+               g_warning ("Don't know how to determine CPU count on this platform; assuming 1");
+               warned = TRUE;
+       }
+
+       return 1;
+}
+
+typedef struct MonoCounterAgent {
+       MonoCounter *counter;
+       // MonoCounterAgent specific data :
+       void *value;
+       size_t value_size;
+       short index;
+       short emitted;
+       struct MonoCounterAgent *next;
+} MonoCounterAgent;
+
+static MonoCounterAgent* counters;
+static int counters_index = 1;
+static mono_mutex_t counters_mutex;
+
+static void
+counters_add_agent (MonoCounter *counter)
+{
+       if (InterlockedRead (&in_shutdown))
+               return;
+
+       MonoCounterAgent *agent, *item;
+
+       mono_os_mutex_lock (&counters_mutex);
+
+       for (agent = counters; agent; agent = agent->next) {
+               if (agent->counter == counter) {
+                       agent->value_size = 0;
+                       if (agent->value) {
+                               g_free (agent->value);
+                               agent->value = NULL;
+                       }
+                       goto done;
+               }
+       }
+
+       agent = (MonoCounterAgent *) g_malloc (sizeof (MonoCounterAgent));
+       agent->counter = counter;
+       agent->value = NULL;
+       agent->value_size = 0;
+       agent->index = counters_index++;
+       agent->emitted = 0;
+       agent->next = NULL;
+
+       if (!counters) {
+               counters = agent;
+       } else {
+               item = counters;
+               while (item->next)
+                       item = item->next;
+               item->next = agent;
+       }
+
+done:
+       mono_os_mutex_unlock (&counters_mutex);
+}
+
+static mono_bool
+counters_init_foreach_callback (MonoCounter *counter, gpointer data)
+{
+       counters_add_agent (counter);
+       return TRUE;
+}
+
+static void
+counters_init (MonoProfiler *profiler)
+{
+       mono_os_mutex_init (&counters_mutex);
+
+       mono_counters_on_register (&counters_add_agent);
+       mono_counters_foreach (counters_init_foreach_callback, NULL);
+}
+
+static void
+counters_emit (MonoProfiler *profiler)
+{
+       MonoCounterAgent *agent;
+       int len = 0;
+       int size =
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* len */
+       ;
+
+       mono_os_mutex_lock (&counters_mutex);
+
+       for (agent = counters; agent; agent = agent->next) {
+               if (agent->emitted)
+                       continue;
+
+               size +=
+                       LEB128_SIZE /* section */ +
+                       strlen (mono_counter_get_name (agent->counter)) + 1 /* name */ +
+                       BYTE_SIZE /* type */ +
+                       BYTE_SIZE /* unit */ +
+                       BYTE_SIZE /* variance */ +
+                       LEB128_SIZE /* index */
+               ;
+
+               len++;
+       }
+
+       if (!len)
+               goto done;
+
+       ENTER_LOG (&counter_descriptors_ctr, logbuffer, size);
+
+       emit_event (logbuffer, TYPE_SAMPLE_COUNTERS_DESC | TYPE_SAMPLE);
+       emit_value (logbuffer, len);
+
+       for (agent = counters; agent; agent = agent->next) {
+               const char *name;
+
+               if (agent->emitted)
+                       continue;
+
+               name = mono_counter_get_name (agent->counter);
+               emit_value (logbuffer, mono_counter_get_section (agent->counter));
+               emit_string (logbuffer, name, strlen (name) + 1);
+               emit_byte (logbuffer, mono_counter_get_type (agent->counter));
+               emit_byte (logbuffer, mono_counter_get_unit (agent->counter));
+               emit_byte (logbuffer, mono_counter_get_variance (agent->counter));
+               emit_value (logbuffer, agent->index);
+
+               agent->emitted = 1;
+       }
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+
+done:
+       mono_os_mutex_unlock (&counters_mutex);
+}
+
+static void
+counters_sample (MonoProfiler *profiler, uint64_t timestamp)
+{
+       MonoCounterAgent *agent;
+       MonoCounter *counter;
+       int type;
+       int buffer_size;
+       void *buffer;
+       int size;
+
+       counters_emit (profiler);
+
+       buffer_size = 8;
+       buffer = g_calloc (1, buffer_size);
+
+       mono_os_mutex_lock (&counters_mutex);
+
+       size =
+               EVENT_SIZE /* event */
+       ;
+
+       for (agent = counters; agent; agent = agent->next) {
+               size +=
+                       LEB128_SIZE /* index */ +
+                       BYTE_SIZE /* type */ +
+                       mono_counter_get_size (agent->counter) /* value */
+               ;
+       }
+
+       size +=
+               LEB128_SIZE /* stop marker */
+       ;
+
+       ENTER_LOG (&counter_samples_ctr, logbuffer, size);
+
+       emit_event_time (logbuffer, TYPE_SAMPLE_COUNTERS | TYPE_SAMPLE, timestamp);
+
+       for (agent = counters; agent; agent = agent->next) {
+               size_t size;
+
+               counter = agent->counter;
+
+               size = mono_counter_get_size (counter);
+
+               if (size > buffer_size) {
+                       buffer_size = size;
+                       buffer = g_realloc (buffer, buffer_size);
+               }
+
+               memset (buffer, 0, buffer_size);
+
+               g_assert (mono_counters_sample (counter, buffer, size));
+
+               type = mono_counter_get_type (counter);
+
+               if (!agent->value) {
+                       agent->value = g_calloc (1, size);
+                       agent->value_size = size;
+               } else {
+                       if (type == MONO_COUNTER_STRING) {
+                               if (strcmp (agent->value, buffer) == 0)
+                                       continue;
+                       } else {
+                               if (agent->value_size == size && memcmp (agent->value, buffer, size) == 0)
+                                       continue;
+                       }
+               }
+
+               emit_uvalue (logbuffer, agent->index);
+               emit_byte (logbuffer, type);
+               switch (type) {
+               case MONO_COUNTER_INT:
+#if SIZEOF_VOID_P == 4
+               case MONO_COUNTER_WORD:
+#endif
+                       emit_svalue (logbuffer, *(int*)buffer - *(int*)agent->value);
+                       break;
+               case MONO_COUNTER_UINT:
+                       emit_uvalue (logbuffer, *(guint*)buffer - *(guint*)agent->value);
+                       break;
+               case MONO_COUNTER_TIME_INTERVAL:
+               case MONO_COUNTER_LONG:
+#if SIZEOF_VOID_P == 8
+               case MONO_COUNTER_WORD:
+#endif
+                       emit_svalue (logbuffer, *(gint64*)buffer - *(gint64*)agent->value);
+                       break;
+               case MONO_COUNTER_ULONG:
+                       emit_uvalue (logbuffer, *(guint64*)buffer - *(guint64*)agent->value);
+                       break;
+               case MONO_COUNTER_DOUBLE:
+                       emit_double (logbuffer, *(double*)buffer);
+                       break;
+               case MONO_COUNTER_STRING:
+                       if (size == 0) {
+                               emit_byte (logbuffer, 0);
+                       } else {
+                               emit_byte (logbuffer, 1);
+                               emit_string (logbuffer, (char*)buffer, size);
+                       }
+                       break;
+               default:
+                       g_assert_not_reached ();
+               }
+
+               if (type == MONO_COUNTER_STRING && size > agent->value_size) {
+                       agent->value = g_realloc (agent->value, size);
+                       agent->value_size = size;
+               }
+
+               if (size > 0)
+                       memcpy (agent->value, buffer, size);
+       }
+       g_free (buffer);
+
+       emit_value (logbuffer, 0);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+
+       mono_os_mutex_unlock (&counters_mutex);
+}
+
+typedef struct _PerfCounterAgent PerfCounterAgent;
+struct _PerfCounterAgent {
+       PerfCounterAgent *next;
+       int index;
+       char *category_name;
+       char *name;
+       int type;
+       gint64 value;
+       guint8 emitted;
+       guint8 updated;
+       guint8 deleted;
+};
+
+static PerfCounterAgent *perfcounters = NULL;
+
+static void
+perfcounters_emit (MonoProfiler *profiler)
+{
+       PerfCounterAgent *pcagent;
+       int len = 0;
+       int size =
+               EVENT_SIZE /* event */ +
+               LEB128_SIZE /* len */
+       ;
+
+       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+               if (pcagent->emitted)
+                       continue;
+
+               size +=
+                       LEB128_SIZE /* section */ +
+                       strlen (pcagent->category_name) + 1 /* category name */ +
+                       strlen (pcagent->name) + 1 /* name */ +
+                       BYTE_SIZE /* type */ +
+                       BYTE_SIZE /* unit */ +
+                       BYTE_SIZE /* variance */ +
+                       LEB128_SIZE /* index */
+               ;
+
+               len++;
+       }
+
+       if (!len)
+               return;
+
+       ENTER_LOG (&perfcounter_descriptors_ctr, logbuffer, size);
+
+       emit_event (logbuffer, TYPE_SAMPLE_COUNTERS_DESC | TYPE_SAMPLE);
+       emit_value (logbuffer, len);
+
+       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+               if (pcagent->emitted)
+                       continue;
+
+               emit_value (logbuffer, MONO_COUNTER_PERFCOUNTERS);
+               emit_string (logbuffer, pcagent->category_name, strlen (pcagent->category_name) + 1);
+               emit_string (logbuffer, pcagent->name, strlen (pcagent->name) + 1);
+               emit_byte (logbuffer, MONO_COUNTER_LONG);
+               emit_byte (logbuffer, MONO_COUNTER_RAW);
+               emit_byte (logbuffer, MONO_COUNTER_VARIABLE);
+               emit_value (logbuffer, pcagent->index);
+
+               pcagent->emitted = 1;
+       }
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+}
+
+static gboolean
+perfcounters_foreach (char *category_name, char *name, unsigned char type, gint64 value, gpointer user_data)
+{
+       PerfCounterAgent *pcagent;
+
+       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+               if (strcmp (pcagent->category_name, category_name) != 0 || strcmp (pcagent->name, name) != 0)
+                       continue;
+               if (pcagent->value == value)
+                       return TRUE;
+
+               pcagent->value = value;
+               pcagent->updated = 1;
+               pcagent->deleted = 0;
+               return TRUE;
+       }
+
+       pcagent = g_new0 (PerfCounterAgent, 1);
+       pcagent->next = perfcounters;
+       pcagent->index = counters_index++;
+       pcagent->category_name = g_strdup (category_name);
+       pcagent->name = g_strdup (name);
+       pcagent->type = (int) type;
+       pcagent->value = value;
+       pcagent->emitted = 0;
+       pcagent->updated = 1;
+       pcagent->deleted = 0;
+
+       perfcounters = pcagent;
+
+       return TRUE;
+}
+
+static void
+perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp)
+{
+       PerfCounterAgent *pcagent;
+       int len = 0;
+       int size;
+
+       mono_os_mutex_lock (&counters_mutex);
+
+       /* mark all perfcounters as deleted, foreach will unmark them as necessary */
+       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next)
+               pcagent->deleted = 1;
+
+       mono_perfcounter_foreach (perfcounters_foreach, perfcounters);
+
+       perfcounters_emit (profiler);
+
+       size =
+               EVENT_SIZE /* event */
+       ;
+
+       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+               if (pcagent->deleted || !pcagent->updated)
+                       continue;
+
+               size +=
+                       LEB128_SIZE /* index */ +
+                       BYTE_SIZE /* type */ +
+                       LEB128_SIZE /* value */
+               ;
+
+               len++;
+       }
+
+       if (!len)
+               goto done;
+
+       size +=
+               LEB128_SIZE /* stop marker */
+       ;
+
+       ENTER_LOG (&perfcounter_samples_ctr, logbuffer, size);
+
+       emit_event_time (logbuffer, TYPE_SAMPLE_COUNTERS | TYPE_SAMPLE, timestamp);
+
+       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
+               if (pcagent->deleted || !pcagent->updated)
+                       continue;
+               emit_uvalue (logbuffer, pcagent->index);
+               emit_byte (logbuffer, MONO_COUNTER_LONG);
+               emit_svalue (logbuffer, pcagent->value);
+
+               pcagent->updated = 0;
+       }
+
+       emit_value (logbuffer, 0);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+
+done:
+       mono_os_mutex_unlock (&counters_mutex);
+}
+
+static void
+counters_and_perfcounters_sample (MonoProfiler *prof)
+{
+       uint64_t now = current_time ();
+
+       counters_sample (prof, now);
+       perfcounters_sample (prof, now);
+}
+
+#define COVERAGE_DEBUG(x) if (debug_coverage) {x}
+static mono_mutex_t coverage_mutex;
+static MonoConcurrentHashTable *coverage_methods = NULL;
+static MonoConcurrentHashTable *coverage_assemblies = NULL;
+static MonoConcurrentHashTable *coverage_classes = NULL;
+
+static MonoConcurrentHashTable *filtered_classes = NULL;
+static MonoConcurrentHashTable *entered_methods = NULL;
+static MonoConcurrentHashTable *image_to_methods = NULL;
+static MonoConcurrentHashTable *suppressed_assemblies = NULL;
+static gboolean coverage_initialized = FALSE;
+
+static GPtrArray *coverage_data = NULL;
+static int previous_offset = 0;
+
+typedef struct {
+       MonoLockFreeQueueNode node;
+       MonoMethod *method;
+} MethodNode;
+
+typedef struct {
+       int offset;
+       int counter;
+       char *filename;
+       int line;
+       int column;
+} CoverageEntry;
+
+static void
+free_coverage_entry (gpointer data, gpointer userdata)
+{
+       CoverageEntry *entry = (CoverageEntry *)data;
+       g_free (entry->filename);
+       g_free (entry);
+}
+
+static void
+obtain_coverage_for_method (MonoProfiler *prof, const MonoProfileCoverageEntry *entry)
+{
+       int offset = entry->iloffset - previous_offset;
+       CoverageEntry *e = g_new (CoverageEntry, 1);
+
+       previous_offset = entry->iloffset;
+
+       e->offset = offset;
+       e->counter = entry->counter;
+       e->filename = g_strdup(entry->filename ? entry->filename : "");
+       e->line = entry->line;
+       e->column = entry->col;
+
+       g_ptr_array_add (coverage_data, e);
+}
+
+static char *
+parse_generic_type_names(char *name)
+{
+       char *new_name, *ret;
+       int within_generic_declaration = 0, generic_members = 1;
+
+       if (name == NULL || *name == '\0')
+               return g_strdup ("");
+
+       if (!(ret = new_name = (char *) g_calloc (strlen (name) * 4 + 1, sizeof (char))))
+               return NULL;
+
+       do {
+               switch (*name) {
+                       case '<':
+                               within_generic_declaration = 1;
+                               break;
+
+                       case '>':
+                               within_generic_declaration = 0;
+
+                               if (*(name - 1) != '<') {
+                                       *new_name++ = '`';
+                                       *new_name++ = '0' + generic_members;
+                               } else {
+                                       memcpy (new_name, "&lt;&gt;", 8);
+                                       new_name += 8;
+                               }
+
+                               generic_members = 0;
+                               break;
+
+                       case ',':
+                               generic_members++;
+                               break;
+
+                       default:
+                               if (!within_generic_declaration)
+                                       *new_name++ = *name;
+
+                               break;
+               }
+       } while (*name++);
+
+       return ret;
+}
+
+static int method_id;
+static void
+build_method_buffer (gpointer key, gpointer value, gpointer userdata)
+{
+       MonoMethod *method = (MonoMethod *)value;
+       MonoProfiler *prof = (MonoProfiler *)userdata;
+       MonoClass *klass;
+       MonoImage *image;
+       char *class_name;
+       const char *image_name, *method_name, *sig, *first_filename;
+       guint i;
+
+       previous_offset = 0;
+       coverage_data = g_ptr_array_new ();
+
+       mono_profiler_coverage_get (prof, method, obtain_coverage_for_method);
+
+       klass = mono_method_get_class (method);
+       image = mono_class_get_image (klass);
+       image_name = mono_image_get_name (image);
+
+       sig = mono_signature_get_desc (mono_method_signature (method), TRUE);
+       class_name = parse_generic_type_names (mono_type_get_name (mono_class_get_type (klass)));
+       method_name = mono_method_get_name (method);
+
+       if (coverage_data->len != 0) {
+               CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[0];
+               first_filename = entry->filename ? entry->filename : "";
+       } else
+               first_filename = "";
+
+       image_name = image_name ? image_name : "";
+       sig = sig ? sig : "";
+       method_name = method_name ? method_name : "";
+
+       ENTER_LOG (&coverage_methods_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               strlen (image_name) + 1 /* image name */ +
+               strlen (class_name) + 1 /* class name */ +
+               strlen (method_name) + 1 /* method name */ +
+               strlen (sig) + 1 /* signature */ +
+               strlen (first_filename) + 1 /* first file name */ +
+               LEB128_SIZE /* token */ +
+               LEB128_SIZE /* method id */ +
+               LEB128_SIZE /* entries */
+       );
+
+       emit_event (logbuffer, TYPE_COVERAGE_METHOD | TYPE_COVERAGE);
+       emit_string (logbuffer, image_name, strlen (image_name) + 1);
+       emit_string (logbuffer, class_name, strlen (class_name) + 1);
+       emit_string (logbuffer, method_name, strlen (method_name) + 1);
+       emit_string (logbuffer, sig, strlen (sig) + 1);
+       emit_string (logbuffer, first_filename, strlen (first_filename) + 1);
+
+       emit_uvalue (logbuffer, mono_method_get_token (method));
+       emit_uvalue (logbuffer, method_id);
+       emit_value (logbuffer, coverage_data->len);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+
+       for (i = 0; i < coverage_data->len; i++) {
+               CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[i];
+
+               ENTER_LOG (&coverage_statements_ctr, logbuffer,
+                       EVENT_SIZE /* event */ +
+                       LEB128_SIZE /* method id */ +
+                       LEB128_SIZE /* offset */ +
+                       LEB128_SIZE /* counter */ +
+                       LEB128_SIZE /* line */ +
+                       LEB128_SIZE /* column */
+               );
+
+               emit_event (logbuffer, TYPE_COVERAGE_STATEMENT | TYPE_COVERAGE);
+               emit_uvalue (logbuffer, method_id);
+               emit_uvalue (logbuffer, entry->offset);
+               emit_uvalue (logbuffer, entry->counter);
+               emit_uvalue (logbuffer, entry->line);
+               emit_uvalue (logbuffer, entry->column);
+
+               EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+       }
+
+       method_id++;
+
+       g_free (class_name);
+
+       g_ptr_array_foreach (coverage_data, free_coverage_entry, NULL);
+       g_ptr_array_free (coverage_data, TRUE);
+       coverage_data = NULL;
+}
+
+/* This empties the queue */
+static guint
+count_queue (MonoLockFreeQueue *queue)
+{
+       MonoLockFreeQueueNode *node;
+       guint count = 0;
+
+       while ((node = mono_lock_free_queue_dequeue (queue))) {
+               count++;
+               mono_thread_hazardous_try_free (node, g_free);
+       }
+
+       return count;
+}
+
+static void
+build_class_buffer (gpointer key, gpointer value, gpointer userdata)
+{
+       MonoClass *klass = (MonoClass *)key;
+       MonoLockFreeQueue *class_methods = (MonoLockFreeQueue *)value;
+       MonoImage *image;
+       char *class_name;
+       const char *assembly_name;
+       int number_of_methods, partially_covered;
+       guint fully_covered;
+
+       image = mono_class_get_image (klass);
+       assembly_name = mono_image_get_name (image);
+       class_name = mono_type_get_name (mono_class_get_type (klass));
+
+       assembly_name = assembly_name ? assembly_name : "";
+       number_of_methods = mono_class_num_methods (klass);
+       fully_covered = count_queue (class_methods);
+       /* We don't handle partial covered yet */
+       partially_covered = 0;
+
+       ENTER_LOG (&coverage_classes_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               strlen (assembly_name) + 1 /* assembly name */ +
+               strlen (class_name) + 1 /* class name */ +
+               LEB128_SIZE /* no. methods */ +
+               LEB128_SIZE /* fully covered */ +
+               LEB128_SIZE /* partially covered */
+       );
+
+       emit_event (logbuffer, TYPE_COVERAGE_CLASS | TYPE_COVERAGE);
+       emit_string (logbuffer, assembly_name, strlen (assembly_name) + 1);
+       emit_string (logbuffer, class_name, strlen (class_name) + 1);
+       emit_uvalue (logbuffer, number_of_methods);
+       emit_uvalue (logbuffer, fully_covered);
+       emit_uvalue (logbuffer, partially_covered);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+
+       g_free (class_name);
+}
+
+static void
+get_coverage_for_image (MonoImage *image, int *number_of_methods, guint *fully_covered, int *partially_covered)
+{
+       MonoLockFreeQueue *image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (image_to_methods, image);
+
+       *number_of_methods = mono_image_get_table_rows (image, MONO_TABLE_METHOD);
+       if (image_methods)
+               *fully_covered = count_queue (image_methods);
+       else
+               *fully_covered = 0;
+
+       // FIXME: We don't handle partially covered yet.
+       *partially_covered = 0;
+}
+
+static void
+build_assembly_buffer (gpointer key, gpointer value, gpointer userdata)
+{
+       MonoAssembly *assembly = (MonoAssembly *)value;
+       MonoImage *image = mono_assembly_get_image (assembly);
+       const char *name, *guid, *filename;
+       int number_of_methods = 0, partially_covered = 0;
+       guint fully_covered = 0;
+
+       name = mono_image_get_name (image);
+       guid = mono_image_get_guid (image);
+       filename = mono_image_get_filename (image);
+
+       name = name ? name : "";
+       guid = guid ? guid : "";
+       filename = filename ? filename : "";
+
+       get_coverage_for_image (image, &number_of_methods, &fully_covered, &partially_covered);
+
+       ENTER_LOG (&coverage_assemblies_ctr, logbuffer,
+               EVENT_SIZE /* event */ +
+               strlen (name) + 1 /* name */ +
+               strlen (guid) + 1 /* guid */ +
+               strlen (filename) + 1 /* file name */ +
+               LEB128_SIZE /* no. methods */ +
+               LEB128_SIZE /* fully covered */ +
+               LEB128_SIZE /* partially covered */
+       );
+
+       emit_event (logbuffer, TYPE_COVERAGE_ASSEMBLY | TYPE_COVERAGE);
+       emit_string (logbuffer, name, strlen (name) + 1);
+       emit_string (logbuffer, guid, strlen (guid) + 1);
+       emit_string (logbuffer, filename, strlen (filename) + 1);
+       emit_uvalue (logbuffer, number_of_methods);
+       emit_uvalue (logbuffer, fully_covered);
+       emit_uvalue (logbuffer, partially_covered);
+
+       EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+}
+
+static void
+dump_coverage (MonoProfiler *prof)
+{
+       if (!coverage_initialized)
+               return;
+
+       COVERAGE_DEBUG(fprintf (stderr, "Coverage: Started dump\n");)
+       method_id = 0;
+
+       mono_os_mutex_lock (&coverage_mutex);
+       mono_conc_hashtable_foreach (coverage_assemblies, build_assembly_buffer, NULL);
+       mono_conc_hashtable_foreach (coverage_classes, build_class_buffer, NULL);
+       mono_conc_hashtable_foreach (coverage_methods, build_method_buffer, prof);
+       mono_os_mutex_unlock (&coverage_mutex);
+
+       COVERAGE_DEBUG(fprintf (stderr, "Coverage: Finished dump\n");)
+}
+
+static void
+process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method)
+{
+       MonoClass *klass;
+       MonoImage *image;
+
+       if (!coverage_initialized)
+               return;
+
+       klass = mono_method_get_class (method);
+       image = mono_class_get_image (klass);
+
+       if (mono_conc_hashtable_lookup (suppressed_assemblies, (gpointer) mono_image_get_name (image)))
+               return;
+
+       mono_os_mutex_lock (&coverage_mutex);
+       mono_conc_hashtable_insert (entered_methods, method, method);
+       mono_os_mutex_unlock (&coverage_mutex);
+}
+
+static MonoLockFreeQueueNode *
+create_method_node (MonoMethod *method)
+{
+       MethodNode *node = (MethodNode *) g_malloc (sizeof (MethodNode));
+       mono_lock_free_queue_node_init ((MonoLockFreeQueueNode *) node, FALSE);
+       node->method = method;
+
+       return (MonoLockFreeQueueNode *) node;
+}
+
+static gboolean
+coverage_filter (MonoProfiler *prof, MonoMethod *method)
+{
+       MonoError error;
+       MonoClass *klass;
+       MonoImage *image;
+       MonoAssembly *assembly;
+       MonoMethodHeader *header;
+       guint32 iflags, flags, code_size;
+       char *fqn, *classname;
+       gboolean has_positive, found;
+       MonoLockFreeQueue *image_methods, *class_methods;
+       MonoLockFreeQueueNode *node;
+
+       g_assert (coverage_initialized && "Why are we being asked for coverage filter info when we're not doing coverage?");
+
+       COVERAGE_DEBUG(fprintf (stderr, "Coverage filter for %s\n", mono_method_get_name (method));)
+
+       flags = mono_method_get_flags (method, &iflags);
+       if ((iflags & 0x1000 /*METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL*/) ||
+           (flags & 0x2000 /*METHOD_ATTRIBUTE_PINVOKE_IMPL*/)) {
+               COVERAGE_DEBUG(fprintf (stderr, "   Internal call or pinvoke - ignoring\n");)
+               return FALSE;
+       }
+
+       // Don't need to do anything else if we're already tracking this method
+       if (mono_conc_hashtable_lookup (coverage_methods, method)) {
+               COVERAGE_DEBUG(fprintf (stderr, "   Already tracking\n");)
+               return TRUE;
+       }
+
+       klass = mono_method_get_class (method);
+       image = mono_class_get_image (klass);
+
+       // Don't handle coverage for the core assemblies
+       if (mono_conc_hashtable_lookup (suppressed_assemblies, (gpointer) mono_image_get_name (image)) != NULL)
+               return FALSE;
+
+       if (prof->coverage_filters) {
+               /* Check already filtered classes first */
+               if (mono_conc_hashtable_lookup (filtered_classes, klass)) {
+                       COVERAGE_DEBUG(fprintf (stderr, "   Already filtered\n");)
+                       return FALSE;
+               }
+
+               classname = mono_type_get_name (mono_class_get_type (klass));
+
+               fqn = g_strdup_printf ("[%s]%s", mono_image_get_name (image), classname);
+
+               COVERAGE_DEBUG(fprintf (stderr, "   Looking for %s in filter\n", fqn);)
+               // Check positive filters first
+               has_positive = FALSE;
+               found = FALSE;
+               for (guint i = 0; i < prof->coverage_filters->len; ++i) {
+                       char *filter = (char *)g_ptr_array_index (prof->coverage_filters, i);
+
+                       if (filter [0] == '+') {
+                               filter = &filter [1];
+
+                               COVERAGE_DEBUG(fprintf (stderr, "   Checking against +%s ...", filter);)
+
+                               if (strstr (fqn, filter) != NULL) {
+                                       COVERAGE_DEBUG(fprintf (stderr, "matched\n");)
+                                       found = TRUE;
+                               } else
+                                       COVERAGE_DEBUG(fprintf (stderr, "no match\n");)
+
+                               has_positive = TRUE;
+                       }
+               }
+
+               if (has_positive && !found) {
+                       COVERAGE_DEBUG(fprintf (stderr, "   Positive match was not found\n");)
+
+                       mono_os_mutex_lock (&coverage_mutex);
+                       mono_conc_hashtable_insert (filtered_classes, klass, klass);
+                       mono_os_mutex_unlock (&coverage_mutex);
+                       g_free (fqn);
+                       g_free (classname);
+
+                       return FALSE;
+               }
+
+               for (guint i = 0; i < prof->coverage_filters->len; ++i) {
+                       // FIXME: Is substring search sufficient?
+                       char *filter = (char *)g_ptr_array_index (prof->coverage_filters, i);
+                       if (filter [0] == '+')
+                               continue;
+
+                       // Skip '-'
+                       filter = &filter [1];
+                       COVERAGE_DEBUG(fprintf (stderr, "   Checking against -%s ...", filter);)
+
+                       if (strstr (fqn, filter) != NULL) {
+                               COVERAGE_DEBUG(fprintf (stderr, "matched\n");)
+
+                               mono_os_mutex_lock (&coverage_mutex);
+                               mono_conc_hashtable_insert (filtered_classes, klass, klass);
+                               mono_os_mutex_unlock (&coverage_mutex);
+                               g_free (fqn);
+                               g_free (classname);
+
+                               return FALSE;
+                       } else
+                               COVERAGE_DEBUG(fprintf (stderr, "no match\n");)
+
+               }
+
+               g_free (fqn);
+               g_free (classname);
+       }
+
+       COVERAGE_DEBUG(fprintf (stderr, "   Handling coverage for %s\n", mono_method_get_name (method));)
+       header = mono_method_get_header_checked (method, &error);
+       mono_error_cleanup (&error);
+
+       mono_method_header_get_code (header, &code_size, NULL);
+
+       assembly = mono_image_get_assembly (image);
+
+       // Need to keep the assemblies around for as long as they are kept in the hashtable
+       // Nunit, for example, has a habit of unloading them before the coverage statistics are
+       // generated causing a crash. See https://bugzilla.xamarin.com/show_bug.cgi?id=39325
+       mono_assembly_addref (assembly);
+
+       mono_os_mutex_lock (&coverage_mutex);
+       mono_conc_hashtable_insert (coverage_methods, method, method);
+       mono_conc_hashtable_insert (coverage_assemblies, assembly, assembly);
+       mono_os_mutex_unlock (&coverage_mutex);
+
+       image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (image_to_methods, image);
+
+       if (image_methods == NULL) {
+               image_methods = (MonoLockFreeQueue *) g_malloc (sizeof (MonoLockFreeQueue));
+               mono_lock_free_queue_init (image_methods);
+               mono_os_mutex_lock (&coverage_mutex);
+               mono_conc_hashtable_insert (image_to_methods, image, image_methods);
+               mono_os_mutex_unlock (&coverage_mutex);
+       }
+
+       node = create_method_node (method);
+       mono_lock_free_queue_enqueue (image_methods, node);
+
+       class_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (coverage_classes, klass);
+
+       if (class_methods == NULL) {
+               class_methods = (MonoLockFreeQueue *) g_malloc (sizeof (MonoLockFreeQueue));
+               mono_lock_free_queue_init (class_methods);
+               mono_os_mutex_lock (&coverage_mutex);
+               mono_conc_hashtable_insert (coverage_classes, klass, class_methods);
+               mono_os_mutex_unlock (&coverage_mutex);
+       }
+
+       node = create_method_node (method);
+       mono_lock_free_queue_enqueue (class_methods, node);
+
+       return TRUE;
+}
+
+#define LINE_BUFFER_SIZE 4096
+/* Max file limit of 128KB */
+#define MAX_FILE_SIZE 128 * 1024
+static char *
+get_file_content (FILE *stream)
+{
+       char *buffer;
+       ssize_t bytes_read;
+       long filesize;
+       int res, offset = 0;
+
+       res = fseek (stream, 0, SEEK_END);
+       if (res < 0)
+         return NULL;
+
+       filesize = ftell (stream);
+       if (filesize < 0)
+         return NULL;
+
+       res = fseek (stream, 0, SEEK_SET);
+       if (res < 0)
+         return NULL;
+
+       if (filesize > MAX_FILE_SIZE)
+         return NULL;
+
+       buffer = (char *) g_malloc ((filesize + 1) * sizeof (char));
+       while ((bytes_read = fread (buffer + offset, 1, LINE_BUFFER_SIZE, stream)) > 0)
+               offset += bytes_read;
+
+       /* NULL terminate our buffer */
+       buffer[filesize] = '\0';
+       return buffer;
+}
+
+static char *
+get_next_line (char *contents, char **next_start)
+{
+       char *p = contents;
+
+       if (p == NULL || *p == '\0') {
+               *next_start = NULL;
+               return NULL;
+       }
+
+       while (*p != '\n' && *p != '\0')
+               p++;
+
+       if (*p == '\n') {
+               *p = '\0';
+               *next_start = p + 1;
+       } else
+               *next_start = NULL;
+
+       return contents;
+}
+
+static void
+init_suppressed_assemblies (void)
+{
+       char *content;
+       char *line;
+       FILE *sa_file;
+
+       suppressed_assemblies = mono_conc_hashtable_new (g_str_hash, g_str_equal);
+       sa_file = fopen (SUPPRESSION_DIR "/mono-profiler-log.suppression", "r");
+       if (sa_file == NULL)
+               return;
+
+       /* Don't need to free @content as it is referred to by the lines stored in @suppressed_assemblies */
+       content = get_file_content (sa_file);
+       if (content == NULL) {
+               g_error ("mono-profiler-log.suppression is greater than 128kb - aborting\n");
+       }
+
+       while ((line = get_next_line (content, &content))) {
+               line = g_strchomp (g_strchug (line));
+               /* No locking needed as we're doing initialization */
+               mono_conc_hashtable_insert (suppressed_assemblies, line, line);
+       }
+
+       fclose (sa_file);
+}
+
+static void
+coverage_init (MonoProfiler *prof)
+{
+       g_assert (!coverage_initialized && "Why are we initializing coverage twice?");
+
+       COVERAGE_DEBUG(fprintf (stderr, "Coverage initialized\n");)
+
+       mono_os_mutex_init (&coverage_mutex);
+       coverage_methods = mono_conc_hashtable_new (NULL, NULL);
+       coverage_assemblies = mono_conc_hashtable_new (NULL, NULL);
+       coverage_classes = mono_conc_hashtable_new (NULL, NULL);
+       filtered_classes = mono_conc_hashtable_new (NULL, NULL);
+       entered_methods = mono_conc_hashtable_new (NULL, NULL);
+       image_to_methods = mono_conc_hashtable_new (NULL, NULL);
+       init_suppressed_assemblies ();
+
+       coverage_initialized = TRUE;
+}
+
+static void
+unref_coverage_assemblies (gpointer key, gpointer value, gpointer userdata)
+{
+       MonoAssembly *assembly = (MonoAssembly *)value;
+       mono_assembly_close (assembly);
+}
+
+static void
+free_sample_hit (gpointer p)
+{
+       mono_lock_free_free (p, SAMPLE_BLOCK_SIZE);
+}
+
+static void
+cleanup_reusable_samples (MonoProfiler *prof)
+{
+       SampleHit *sample;
+
+       while ((sample = (SampleHit *) mono_lock_free_queue_dequeue (&prof->sample_reuse_queue)))
+               mono_thread_hazardous_try_free (sample, free_sample_hit);
+}
+
+static void
+log_shutdown (MonoProfiler *prof)
+{
+       InterlockedWrite (&in_shutdown, 1);
+
+       if (!no_counters)
+               counters_and_perfcounters_sample (prof);
+
+       dump_coverage (prof);
+
+       char c = 1;
+
+       if (write (prof->pipes [1], &c, 1) != 1) {
+               fprintf (stderr, "Could not write to pipe: %s\n", strerror (errno));
+               exit (1);
+       }
+
+       mono_native_thread_join (prof->helper_thread);
+
+       mono_os_mutex_destroy (&counters_mutex);
+
+       MonoCounterAgent *mc_next;
+
+       for (MonoCounterAgent *cur = counters; cur; cur = mc_next) {
+               mc_next = cur->next;
+               g_free (cur);
+       }
+
+       PerfCounterAgent *pc_next;
+
+       for (PerfCounterAgent *cur = perfcounters; cur; cur = pc_next) {
+               pc_next = cur->next;
+               g_free (cur);
+       }
+
+       /*
+        * Ensure that we empty the LLS completely, even if some nodes are
+        * not immediately removed upon calling mono_lls_remove (), by
+        * iterating until the head is NULL.
+        */
+       while (profiler_thread_list.head) {
+               MONO_LLS_FOREACH_SAFE (&profiler_thread_list, MonoProfilerThread, thread) {
+                       g_assert (thread->attached && "Why is a thread in the LLS not attached?");
+
+                       remove_thread (thread);
+               } MONO_LLS_FOREACH_SAFE_END
+       }
+
+       /*
+        * Ensure that all threads have been freed, so that we don't miss any
+        * buffers when we shut down the writer thread below.
+        */
+       mono_thread_hazardous_try_free_all ();
+
+       InterlockedWrite (&prof->run_dumper_thread, 0);
+       mono_os_sem_post (&prof->dumper_queue_sem);
+       mono_native_thread_join (prof->dumper_thread);
+       mono_os_sem_destroy (&prof->dumper_queue_sem);
+
+       InterlockedWrite (&prof->run_writer_thread, 0);
+       mono_os_sem_post (&prof->writer_queue_sem);
+       mono_native_thread_join (prof->writer_thread);
+       mono_os_sem_destroy (&prof->writer_queue_sem);
+
+       /*
+        * Free all writer queue entries, and ensure that all sample hits will be
+        * added to the sample reuse queue.
+        */
+       mono_thread_hazardous_try_free_all ();
+
+       cleanup_reusable_samples (prof);
+
+       /*
+        * Finally, make sure that all sample hits are freed. This should cover all
+        * hazardous data from the profiler. We can now be sure that the runtime
+        * won't later invoke free functions in the profiler library after it has
+        * been unloaded.
+        */
+       mono_thread_hazardous_try_free_all ();
+
+       g_assert (!InterlockedRead (&buffer_rwlock_count) && "Why is the reader count still non-zero?");
+       g_assert (!InterlockedReadPointer (&buffer_rwlock_exclusive) && "Why does someone still hold the exclusive lock?");
+
+#if defined (HAVE_SYS_ZLIB)
+       if (prof->gzfile)
+               gzclose (prof->gzfile);
+#endif
+       if (prof->pipe_output)
+               pclose (prof->file);
+       else
+               fclose (prof->file);
+
+       mono_conc_hashtable_destroy (prof->method_table);
+       mono_os_mutex_destroy (&prof->method_table_mutex);
+
+       if (coverage_initialized) {
+               mono_os_mutex_lock (&coverage_mutex);
+               mono_conc_hashtable_foreach (coverage_assemblies, unref_coverage_assemblies, prof);
+               mono_os_mutex_unlock (&coverage_mutex);
+
+               mono_conc_hashtable_destroy (coverage_methods);
+               mono_conc_hashtable_destroy (coverage_assemblies);
+               mono_conc_hashtable_destroy (coverage_classes);
+               mono_conc_hashtable_destroy (filtered_classes);
+
+               mono_conc_hashtable_destroy (entered_methods);
+               mono_conc_hashtable_destroy (image_to_methods);
+               mono_conc_hashtable_destroy (suppressed_assemblies);
+               mono_os_mutex_destroy (&coverage_mutex);
+       }
+
+       PROF_TLS_FREE ();
+
+       g_free (prof->args);
+       g_free (prof);
+}
+
+static char*
+new_filename (const char* filename)
+{
+       time_t t = time (NULL);
+       int pid = process_id ();
+       char pid_buf [16];
+       char time_buf [16];
+       char *res, *d;
+       const char *p;
+       int count_dates = 0;
+       int count_pids = 0;
+       int s_date, s_pid;
+       struct tm *ts;
+       for (p = filename; *p; p++) {
+               if (*p != '%')
+                       continue;
+               p++;
+               if (*p == 't')
+                       count_dates++;
+               else if (*p == 'p')
+                       count_pids++;
+               else if (*p == 0)
+                       break;
+       }
+       if (!count_dates && !count_pids)
+               return pstrdup (filename);
+       snprintf (pid_buf, sizeof (pid_buf), "%d", pid);
+       ts = gmtime (&t);
+       snprintf (time_buf, sizeof (time_buf), "%d%02d%02d%02d%02d%02d",
+               1900 + ts->tm_year, 1 + ts->tm_mon, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
+       s_date = strlen (time_buf);
+       s_pid = strlen (pid_buf);
+       d = res = (char *) g_malloc (strlen (filename) + s_date * count_dates + s_pid * count_pids);
+       for (p = filename; *p; p++) {
+               if (*p != '%') {
+                       *d++ = *p;
+                       continue;
+               }
+               p++;
+               if (*p == 't') {
+                       strcpy (d, time_buf);
+                       d += s_date;
+                       continue;
+               } else if (*p == 'p') {
+                       strcpy (d, pid_buf);
+                       d += s_pid;
+                       continue;
+               } else if (*p == '%') {
+                       *d++ = '%';
+                       continue;
+               } else if (*p == 0)
+                       break;
+               *d++ = '%';
+               *d++ = *p;
+       }
+       *d = 0;
+       return res;
+}
+
+static void
+add_to_fd_set (fd_set *set, int fd, int *max_fd)
+{
+       /*
+        * This should only trigger for the basic FDs (server socket, pipes) at
+        * startup if for some mysterious reason they're too large. In this case,
+        * the profiler really can't function, and we're better off printing an
+        * error and exiting.
+        */
+       if (fd >= FD_SETSIZE) {
+               fprintf (stderr, "File descriptor is out of bounds for fd_set: %d\n", fd);
+               exit (1);
+       }
+
+       FD_SET (fd, set);
+
+       if (*max_fd < fd)
+               *max_fd = fd;
+}
+
+static void *
+helper_thread (void *arg)
+{
+       MonoProfiler *prof = (MonoProfiler *) arg;
+
+       mono_threads_attach_tools_thread ();
+       mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler helper");
+
+       MonoProfilerThread *thread = init_thread (prof, FALSE);
+
+       GArray *command_sockets = g_array_new (FALSE, FALSE, sizeof (int));
+
+       while (1) {
+               fd_set rfds;
+               int max_fd = -1;
+
+               FD_ZERO (&rfds);
+
+               add_to_fd_set (&rfds, prof->server_socket, &max_fd);
+               add_to_fd_set (&rfds, prof->pipes [0], &max_fd);
+
+               for (gint i = 0; i < command_sockets->len; i++)
+                       add_to_fd_set (&rfds, g_array_index (command_sockets, int, i), &max_fd);
+
+               struct timeval tv = { .tv_sec = 1, .tv_usec = 0 };
+
+               // Sleep for 1sec or until a file descriptor has data.
+               if (select (max_fd + 1, &rfds, NULL, NULL, &tv) == -1) {
+                       if (errno == EINTR)
+                               continue;
+
+                       fprintf (stderr, "Error in mono-profiler-log server: %s", strerror (errno));
+                       exit (1);
+               }
+
+               if (!no_counters)
+                       counters_and_perfcounters_sample (prof);
+
+               buffer_lock_excl ();
+
+               sync_point (SYNC_POINT_PERIODIC);
+
+               buffer_unlock_excl ();
+
+               // Are we shutting down?
+               if (FD_ISSET (prof->pipes [0], &rfds)) {
+                       char c;
+                       read (prof->pipes [0], &c, 1);
+                       break;
+               }
+
+               for (gint i = 0; i < command_sockets->len; i++) {
+                       int fd = g_array_index (command_sockets, int, i);
+
+                       if (!FD_ISSET (fd, &rfds))
+                               continue;
+
+                       char buf [64];
+                       int len = read (fd, buf, sizeof (buf) - 1);
+
+                       if (len == -1)
+                               continue;
+
+                       if (!len) {
+                               // The other end disconnected.
+                               g_array_remove_index (command_sockets, i);
+                               close (fd);
+
+                               continue;
+                       }
+
+                       buf [len] = 0;
+
+                       if (!strcmp (buf, "heapshot\n") && hs_mode_ondemand) {
+                               // Rely on the finalization callbacks invoking process_requests ().
+                               heapshot_requested = 1;
+                               mono_gc_finalize_notify ();
+                       }
+               }
+
+               if (FD_ISSET (prof->server_socket, &rfds)) {
+                       int fd = accept (prof->server_socket, NULL, NULL);
+
+                       if (fd != -1) {
+                               if (fd >= FD_SETSIZE)
+                                       close (fd);
+                               else
+                                       g_array_append_val (command_sockets, fd);
+                       }
+               }
+       }
+
+       for (gint i = 0; i < command_sockets->len; i++)
+               close (g_array_index (command_sockets, int, i));
+
+       g_array_free (command_sockets, TRUE);
+
+       send_log_unsafe (FALSE);
+       deinit_thread (thread);
+
+       mono_thread_info_detach ();
+
+       return NULL;
+}
+
+static void
+start_helper_thread (MonoProfiler* prof)
+{
+       if (pipe (prof->pipes) == -1) {
+               fprintf (stderr, "Cannot create pipe: %s\n", strerror (errno));
+               exit (1);
+       }
+
+       prof->server_socket = socket (PF_INET, SOCK_STREAM, 0);
+
+       if (prof->server_socket == -1) {
+               fprintf (stderr, "Cannot create server socket: %s\n", strerror (errno));
+               exit (1);
+       }
+
+       struct sockaddr_in server_address;
+
+       memset (&server_address, 0, sizeof (server_address));
+       server_address.sin_family = AF_INET;
+       server_address.sin_addr.s_addr = INADDR_ANY;
+       server_address.sin_port = htons (prof->command_port);
+
+       if (bind (prof->server_socket, (struct sockaddr *) &server_address, sizeof (server_address)) == -1) {
+               fprintf (stderr, "Cannot bind server socket on port %d: %s\n", prof->command_port, strerror (errno));
+               close (prof->server_socket);
+               exit (1);
+       }
+
+       if (listen (prof->server_socket, 1) == -1) {
+               fprintf (stderr, "Cannot listen on server socket: %s\n", strerror (errno));
+               close (prof->server_socket);
+               exit (1);
+       }
+
+       socklen_t slen = sizeof (server_address);
+
+       if (getsockname (prof->server_socket, (struct sockaddr *) &server_address, &slen)) {
+               fprintf (stderr, "Could not get assigned port: %s\n", strerror (errno));
+               close (prof->server_socket);
+               exit (1);
+       }
+
+       prof->command_port = ntohs (server_address.sin_port);
+
+       if (!mono_native_thread_create (&prof->helper_thread, helper_thread, prof)) {
+               fprintf (stderr, "Could not start helper thread\n");
+               close (prof->server_socket);
+               exit (1);
+       }
+}
+
+static void
+free_writer_entry (gpointer p)
+{
+       mono_lock_free_free (p, WRITER_ENTRY_BLOCK_SIZE);
+}
+
+static gboolean
+handle_writer_queue_entry (MonoProfiler *prof)
+{
+       WriterQueueEntry *entry;
+
+       if ((entry = (WriterQueueEntry *) mono_lock_free_queue_dequeue (&prof->writer_queue))) {
+               if (!entry->methods)
+                       goto no_methods;
+
+               gboolean wrote_methods = FALSE;
+
+               /*
+                * Encode the method events in a temporary log buffer that we
+                * flush to disk before the main buffer, ensuring that all
+                * methods have metadata emitted before they're referenced.
+                *
+                * We use a 'proper' thread-local buffer for this as opposed
+                * to allocating and freeing a buffer by hand because the call
+                * to mono_method_full_name () below may trigger class load
+                * events when it retrieves the signature of the method. So a
+                * thread-local buffer needs to exist when such events occur.
+                */
+               for (guint i = 0; i < entry->methods->len; i++) {
+                       MethodInfo *info = (MethodInfo *) g_ptr_array_index (entry->methods, i);
+
+                       if (mono_conc_hashtable_lookup (prof->method_table, info->method))
+                               goto free_info; // This method already has metadata emitted.
+
+                       /*
+                        * Other threads use this hash table to get a general
+                        * idea of whether a method has already been emitted to
+                        * the stream. Due to the way we add to this table, it
+                        * can easily happen that multiple threads queue up the
+                        * same methods, but that's OK since eventually all
+                        * methods will be in this table and the thread-local
+                        * method lists will just be empty for the rest of the
+                        * app's lifetime.
+                        */
+                       mono_os_mutex_lock (&prof->method_table_mutex);
+                       mono_conc_hashtable_insert (prof->method_table, info->method, info->method);
+                       mono_os_mutex_unlock (&prof->method_table_mutex);
+
+                       char *name = mono_method_full_name (info->method, 1);
+                       int nlen = strlen (name) + 1;
+                       void *cstart = info->ji ? mono_jit_info_get_code_start (info->ji) : NULL;
+                       int csize = info->ji ? mono_jit_info_get_code_size (info->ji) : 0;
+
+                       ENTER_LOG (&method_jits_ctr, logbuffer,
+                               EVENT_SIZE /* event */ +
+                               LEB128_SIZE /* method */ +
+                               LEB128_SIZE /* start */ +
+                               LEB128_SIZE /* size */ +
+                               nlen /* name */
+                       );
+
+                       emit_event_time (logbuffer, TYPE_JIT | TYPE_METHOD, info->time);
+                       emit_method_inner (logbuffer, info->method);
+                       emit_ptr (logbuffer, cstart);
+                       emit_value (logbuffer, csize);
+
+                       memcpy (logbuffer->cursor, name, nlen);
+                       logbuffer->cursor += nlen;
+
+                       EXIT_LOG_EXPLICIT (NO_SEND, NO_REQUESTS);
+
+                       mono_free (name);
+
+                       wrote_methods = TRUE;
+
+               free_info:
+                       g_free (info);
+               }
+
+               g_ptr_array_free (entry->methods, TRUE);
+
+               if (wrote_methods) {
+                       dump_buffer_threadless (prof, PROF_TLS_GET ()->buffer);
+                       init_buffer_state (PROF_TLS_GET ());
+               }
+
+       no_methods:
+               dump_buffer (prof, entry->buffer);
+
+               mono_thread_hazardous_try_free (entry, free_writer_entry);
+
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+static void *
+writer_thread (void *arg)
+{
+       MonoProfiler *prof = (MonoProfiler *)arg;
+
+       mono_threads_attach_tools_thread ();
+       mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler writer");
+
+       dump_header (prof);
+
+       MonoProfilerThread *thread = init_thread (prof, FALSE);
+
+       while (InterlockedRead (&prof->run_writer_thread)) {
+               mono_os_sem_wait (&prof->writer_queue_sem, MONO_SEM_FLAGS_NONE);
+               handle_writer_queue_entry (prof);
+       }
+
+       /* Drain any remaining entries on shutdown. */
+       while (handle_writer_queue_entry (prof));
+
+       free_buffer (thread->buffer, thread->buffer->size);
+       deinit_thread (thread);
+
+       mono_thread_info_detach ();
+
+       return NULL;
+}
+
+static void
+start_writer_thread (MonoProfiler* prof)
+{
+       InterlockedWrite (&prof->run_writer_thread, 1);
+
+       if (!mono_native_thread_create (&prof->writer_thread, writer_thread, prof)) {
+               fprintf (stderr, "Could not start writer thread\n");
+               exit (1);
+       }
+}
+
+static void
+reuse_sample_hit (gpointer p)
+{
+       SampleHit *sample = p;
+
+       mono_lock_free_queue_node_unpoison (&sample->node);
+       mono_lock_free_queue_enqueue (&sample->prof->sample_reuse_queue, &sample->node);
+}
+
+static gboolean
+handle_dumper_queue_entry (MonoProfiler *prof)
+{
+       SampleHit *sample;
+
+       if ((sample = (SampleHit *) mono_lock_free_queue_dequeue (&prof->dumper_queue))) {
+               for (int i = 0; i < sample->count; ++i) {
+                       MonoMethod *method = sample->frames [i].method;
+                       MonoDomain *domain = sample->frames [i].domain;
+                       void *address = sample->frames [i].base_address;
+
+                       if (!method) {
+                               g_assert (domain && "What happened to the domain pointer?");
+                               g_assert (address && "What happened to the instruction pointer?");
+
+                               MonoJitInfo *ji = mono_jit_info_table_find (domain, (char *) address);
+
+                               if (ji)
+                                       sample->frames [i].method = mono_jit_info_get_method (ji);
+                       }
+               }
+
+               ENTER_LOG (&sample_hits_ctr, logbuffer,
+                       EVENT_SIZE /* event */ +
+                       BYTE_SIZE /* type */ +
+                       LEB128_SIZE /* tid */ +
+                       LEB128_SIZE /* count */ +
+                       1 * (
+                               LEB128_SIZE /* ip */
+                       ) +
+                       LEB128_SIZE /* managed count */ +
+                       sample->count * (
+                               LEB128_SIZE /* method */
+                       )
+               );
+
+               emit_event_time (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_HIT, sample->time);
+               emit_byte (logbuffer, SAMPLE_CYCLES);
+               emit_ptr (logbuffer, (void *) sample->tid);
+               emit_value (logbuffer, 1);
+
+               // TODO: Actual native unwinding.
+               for (int i = 0; i < 1; ++i) {
+                       emit_ptr (logbuffer, sample->ip);
+                       add_code_pointer ((uintptr_t) sample->ip);
+               }
+
+               /* new in data version 6 */
+               emit_uvalue (logbuffer, sample->count);
+
+               for (int i = 0; i < sample->count; ++i)
+                       emit_method (logbuffer, sample->frames [i].method);
+
+               EXIT_LOG_EXPLICIT (DO_SEND, NO_REQUESTS);
+
+               mono_thread_hazardous_try_free (sample, reuse_sample_hit);
+
+               dump_unmanaged_coderefs (prof);
+       }
+
+       return FALSE;
+}
+
+static void *
+dumper_thread (void *arg)
+{
+       MonoProfiler *prof = (MonoProfiler *)arg;
+
+       mono_threads_attach_tools_thread ();
+       mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler dumper");
+
+       MonoProfilerThread *thread = init_thread (prof, FALSE);
+
+       while (InterlockedRead (&prof->run_dumper_thread)) {
+               mono_os_sem_wait (&prof->dumper_queue_sem, MONO_SEM_FLAGS_NONE);
+               handle_dumper_queue_entry (prof);
+       }
+
+       /* Drain any remaining entries on shutdown. */
+       while (handle_dumper_queue_entry (prof));
+
+       send_log_unsafe (FALSE);
+       deinit_thread (thread);
+
+       mono_thread_info_detach ();
+
+       return NULL;
+}
+
+static void
+start_dumper_thread (MonoProfiler* prof)
+{
+       InterlockedWrite (&prof->run_dumper_thread, 1);
+
+       if (!mono_native_thread_create (&prof->dumper_thread, dumper_thread, prof)) {
+               fprintf (stderr, "Could not start dumper thread\n");
+               exit (1);
+       }
+}
+
+static void
+register_counter (const char *name, gint32 *counter)
+{
+       mono_counters_register (name, MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, counter);
+}
+
+static void
+runtime_initialized (MonoProfiler *profiler)
+{
+       InterlockedWrite (&runtime_inited, 1);
+
+       register_counter ("Sample events allocated", &sample_allocations_ctr);
+       register_counter ("Log buffers allocated", &buffer_allocations_ctr);
+
+       register_counter ("Event: Sync points", &sync_points_ctr);
+       register_counter ("Event: Heap objects", &heap_objects_ctr);
+       register_counter ("Event: Heap starts", &heap_starts_ctr);
+       register_counter ("Event: Heap ends", &heap_ends_ctr);
+       register_counter ("Event: Heap roots", &heap_roots_ctr);
+       register_counter ("Event: GC events", &gc_events_ctr);
+       register_counter ("Event: GC resizes", &gc_resizes_ctr);
+       register_counter ("Event: GC allocations", &gc_allocs_ctr);
+       register_counter ("Event: GC moves", &gc_moves_ctr);
+       register_counter ("Event: GC handle creations", &gc_handle_creations_ctr);
+       register_counter ("Event: GC handle deletions", &gc_handle_deletions_ctr);
+       register_counter ("Event: GC finalize starts", &finalize_begins_ctr);
+       register_counter ("Event: GC finalize ends", &finalize_ends_ctr);
+       register_counter ("Event: GC finalize object starts", &finalize_object_begins_ctr);
+       register_counter ("Event: GC finalize object ends", &finalize_object_ends_ctr);
+       register_counter ("Event: Image loads", &image_loads_ctr);
+       register_counter ("Event: Image unloads", &image_unloads_ctr);
+       register_counter ("Event: Assembly loads", &assembly_loads_ctr);
+       register_counter ("Event: Assembly unloads", &assembly_unloads_ctr);
+       register_counter ("Event: Class loads", &class_loads_ctr);
+       register_counter ("Event: Class unloads", &class_unloads_ctr);
+       register_counter ("Event: Method entries", &method_entries_ctr);
+       register_counter ("Event: Method exits", &method_exits_ctr);
+       register_counter ("Event: Method exception leaves", &method_exception_exits_ctr);
+       register_counter ("Event: Method JITs", &method_jits_ctr);
+       register_counter ("Event: Code buffers", &code_buffers_ctr);
+       register_counter ("Event: Exception throws", &exception_throws_ctr);
+       register_counter ("Event: Exception clauses", &exception_clauses_ctr);
+       register_counter ("Event: Monitor contentions", &monitor_contentions_ctr);
+       register_counter ("Event: Monitor acquisitions", &monitor_acquisitions_ctr);
+       register_counter ("Event: Monitor failures", &monitor_failures_ctr);
+       register_counter ("Event: Thread starts", &thread_starts_ctr);
+       register_counter ("Event: Thread ends", &thread_ends_ctr);
+       register_counter ("Event: Thread names", &thread_names_ctr);
+       register_counter ("Event: Domain loads", &domain_loads_ctr);
+       register_counter ("Event: Domain unloads", &domain_unloads_ctr);
+       register_counter ("Event: Domain names", &domain_names_ctr);
+       register_counter ("Event: Context loads", &context_loads_ctr);
+       register_counter ("Event: Context unloads", &context_unloads_ctr);
+       register_counter ("Event: Sample binaries", &sample_ubins_ctr);
+       register_counter ("Event: Sample symbols", &sample_usyms_ctr);
+       register_counter ("Event: Sample hits", &sample_hits_ctr);
+       register_counter ("Event: Counter descriptors", &counter_descriptors_ctr);
+       register_counter ("Event: Counter samples", &counter_samples_ctr);
+       register_counter ("Event: Performance counter descriptors", &perfcounter_descriptors_ctr);
+       register_counter ("Event: Performance counter samples", &perfcounter_samples_ctr);
+       register_counter ("Event: Coverage methods", &coverage_methods_ctr);
+       register_counter ("Event: Coverage statements", &coverage_statements_ctr);
+       register_counter ("Event: Coverage classes", &coverage_classes_ctr);
+       register_counter ("Event: Coverage assemblies", &coverage_assemblies_ctr);
+
+       counters_init (profiler);
+
+       /*
+        * We must start the helper thread before the writer thread. This is
+        * because the helper thread sets up the command port which is written to
+        * the log header by the writer thread.
+        */
+       start_helper_thread (profiler);
+       start_writer_thread (profiler);
+       start_dumper_thread (profiler);
+}
+
+static MonoProfiler*
+create_profiler (const char *args, const char *filename, GPtrArray *filters)
+{
+       MonoProfiler *prof;
+       char *nf;
+       int force_delete = 0;
+       prof = (MonoProfiler *) g_calloc (1, sizeof (MonoProfiler));
+
+       prof->args = pstrdup (args);
+       prof->command_port = command_port;
+       if (filename && *filename == '-') {
+               force_delete = 1;
+               filename++;
+       }
+       if (!filename) {
+               if (do_report)
+                       filename = "|mprof-report -";
+               else
+                       filename = "output.mlpd";
+               nf = (char*)filename;
+       } else {
+               nf = new_filename (filename);
+               if (do_report) {
+                       int s = strlen (nf) + 32;
+                       char *p = (char *) g_malloc (s);
+                       snprintf (p, s, "|mprof-report '--out=%s' -", nf);
+                       g_free (nf);
+                       nf = p;
+               }
+       }
+       if (*nf == '|') {
+               prof->file = popen (nf + 1, "w");
+               prof->pipe_output = 1;
+       } else if (*nf == '#') {
+               int fd = strtol (nf + 1, NULL, 10);
+               prof->file = fdopen (fd, "a");
+       } else {
+               if (force_delete)
+                       unlink (nf);
+               prof->file = fopen (nf, "wb");
+       }
+       if (!prof->file) {
+               fprintf (stderr, "Cannot create profiler output: %s\n", nf);
+               exit (1);
+       }
+
+#if defined (HAVE_SYS_ZLIB)
+       if (use_zip)
+               prof->gzfile = gzdopen (fileno (prof->file), "wb");
+#endif
+
+       /*
+        * If you hit this assert while increasing MAX_FRAMES, you need to increase
+        * SAMPLE_BLOCK_SIZE as well.
+        */
+       g_assert (SAMPLE_SLOT_SIZE (MAX_FRAMES) * 2 < LOCK_FREE_ALLOC_SB_USABLE_SIZE (SAMPLE_BLOCK_SIZE));
+
+       // FIXME: We should free this stuff too.
+       mono_lock_free_allocator_init_size_class (&prof->sample_size_class, SAMPLE_SLOT_SIZE (num_frames), SAMPLE_BLOCK_SIZE);
+       mono_lock_free_allocator_init_allocator (&prof->sample_allocator, &prof->sample_size_class, MONO_MEM_ACCOUNT_PROFILER);
+
+       mono_lock_free_queue_init (&prof->sample_reuse_queue);
+
+       g_assert (sizeof (WriterQueueEntry) * 2 < LOCK_FREE_ALLOC_SB_USABLE_SIZE (WRITER_ENTRY_BLOCK_SIZE));
+
+       // FIXME: We should free this stuff too.
+       mono_lock_free_allocator_init_size_class (&prof->writer_entry_size_class, sizeof (WriterQueueEntry), WRITER_ENTRY_BLOCK_SIZE);
+       mono_lock_free_allocator_init_allocator (&prof->writer_entry_allocator, &prof->writer_entry_size_class, MONO_MEM_ACCOUNT_PROFILER);
+
+       mono_lock_free_queue_init (&prof->writer_queue);
+       mono_os_sem_init (&prof->writer_queue_sem, 0);
+
+       mono_lock_free_queue_init (&prof->dumper_queue);
+       mono_os_sem_init (&prof->dumper_queue_sem, 0);
+
+       mono_os_mutex_init (&prof->method_table_mutex);
+       prof->method_table = mono_conc_hashtable_new (NULL, NULL);
+
+       if (do_coverage)
+               coverage_init (prof);
+       prof->coverage_filters = filters;
+
+       prof->startup_time = current_time ();
+       return prof;
+}
+
+static void
+usage (int do_exit)
+{
+       printf ("Log profiler version %d.%d (format: %d)\n", LOG_VERSION_MAJOR, LOG_VERSION_MINOR, LOG_DATA_VERSION);
+       printf ("Usage: mono --profile=log[:OPTION1[,OPTION2...]] program.exe\n");
+       printf ("Options:\n");
+       printf ("\thelp                 show this usage info\n");
+       printf ("\t[no]alloc            enable/disable recording allocation info\n");
+       printf ("\t[no]calls            enable/disable recording enter/leave method events\n");
+       printf ("\theapshot[=MODE]      record heap shot info (by default at each major collection)\n");
+       printf ("\t                     MODE: every XXms milliseconds, every YYgc collections, ondemand\n");
+       printf ("\tcounters             sample counters every 1s\n");
+       printf ("\tsample[=TYPE]        use statistical sampling mode (by default cycles/100)\n");
+       printf ("\t                     TYPE: cycles,instr,cacherefs,cachemiss,branches,branchmiss\n");
+       printf ("\t                     TYPE can be followed by /FREQUENCY\n");
+       printf ("\tmaxframes=NUM        collect up to NUM stack frames\n");
+       printf ("\tcalldepth=NUM        ignore method events for call chain depth bigger than NUM\n");
+       printf ("\toutput=FILENAME      write the data to file FILENAME (-FILENAME to overwrite)\n");
+       printf ("\toutput=|PROGRAM      write the data to the stdin of PROGRAM\n");
+       printf ("\t                     %%t is subtituted with date and time, %%p with the pid\n");
+       printf ("\treport               create a report instead of writing the raw data to a file\n");
+       printf ("\tzip                  compress the output data\n");
+       printf ("\tport=PORTNUM         use PORTNUM for the listening command server\n");
+       printf ("\tcoverage             enable collection of code coverage data\n");
+       printf ("\tcovfilter=ASSEMBLY   add an assembly to the code coverage filters\n");
+       printf ("\t                     add a + to include the assembly or a - to exclude it\n");
+       printf ("\t                     filter=-mscorlib\n");
+       printf ("\tcovfilter-file=FILE  use FILE to generate the list of assemblies to be filtered\n");
+       if (do_exit)
+               exit (1);
+}
+
+static const char*
+match_option (const char* p, const char *opt, char **rval)
+{
+       int len = strlen (opt);
+       if (strncmp (p, opt, len) == 0) {
+               if (rval) {
+                       if (p [len] == '=' && p [len + 1]) {
+                               const char *opt = p + len + 1;
+                               const char *end = strchr (opt, ',');
+                               char *val;
+                               int l;
+                               if (end == NULL) {
+                                       l = strlen (opt);
+                               } else {
+                                       l = end - opt;
+                               }
+                               val = (char *) g_malloc (l + 1);
+                               memcpy (val, opt, l);
+                               val [l] = 0;
+                               *rval = val;
+                               return opt + l;
+                       }
+                       if (p [len] == 0 || p [len] == ',') {
+                               *rval = NULL;
+                               return p + len + (p [len] == ',');
+                       }
+                       usage (1);
+               } else {
+                       if (p [len] == 0)
+                               return p + len;
+                       if (p [len] == ',')
+                               return p + len + 1;
+               }
+       }
+       return p;
+}
+
+static void
+set_sample_freq (char *val)
+{
+       do_mono_sample = 1;
+       sample_freq = 100;
+
+       if (!val)
+               return;
+
+       char *p = val;
+
+       // Is it only the frequency (new option style)?
+       if (isdigit (*p))
+               goto parse;
+
+       // Skip the sample type for backwards compatibility.
+       while (isalpha (*p))
+               p++;
+
+       // Skip the forward slash only if we got a sample type.
+       if (p != val && *p == '/') {
+               p++;
+
+               char *end;
+
+       parse:
+               sample_freq = strtoul (p, &end, 10);
+
+               if (p == end)
+                       usage (1);
+
+               p = end;
+       }
+
+       if (*p)
+               usage (1);
+
+       g_free (val);
+}
+
+static void
+set_hsmode (char* val, int allow_empty)
+{
+       char *end;
+       unsigned int count;
+       if (allow_empty && !val)
+               return;
+       if (strcmp (val, "ondemand") == 0) {
+               hs_mode_ondemand = 1;
+               g_free (val);
+               return;
+       }
+       count = strtoul (val, &end, 10);
+       if (val == end)
+               usage (1);
+       if (strcmp (end, "ms") == 0)
+               hs_mode_ms = count;
+       else if (strcmp (end, "gc") == 0)
+               hs_mode_gc = count;
+       else
+               usage (1);
+       g_free (val);
+}
+
+/*
+ * declaration to silence the compiler: this is the entry point that
+ * mono will load from the shared library and call.
+ */
+extern void
+mono_profiler_startup (const char *desc);
+
+extern void
+mono_profiler_startup_log (const char *desc);
+
+/*
+ * this is the entry point that will be used when the profiler
+ * is embedded inside the main executable.
+ */
+void
+mono_profiler_startup_log (const char *desc)
+{
+       mono_profiler_startup (desc);
+}
+
+void
+mono_profiler_startup (const char *desc)
+{
+       MonoProfiler *prof;
+       GPtrArray *filters = NULL;
+       char *filename = NULL;
+       const char *p;
+       const char *opt;
+       int calls_enabled = 0;
+       int allocs_enabled = 0;
+       int events = MONO_PROFILE_GC|MONO_PROFILE_ALLOCATIONS|
+               MONO_PROFILE_GC_MOVES|MONO_PROFILE_CLASS_EVENTS|MONO_PROFILE_THREADS|
+               MONO_PROFILE_ENTER_LEAVE|MONO_PROFILE_JIT_COMPILATION|MONO_PROFILE_EXCEPTIONS|
+               MONO_PROFILE_MONITOR_EVENTS|MONO_PROFILE_MODULE_EVENTS|MONO_PROFILE_GC_ROOTS|
+               MONO_PROFILE_INS_COVERAGE|MONO_PROFILE_APPDOMAIN_EVENTS|MONO_PROFILE_CONTEXT_EVENTS|
+               MONO_PROFILE_ASSEMBLY_EVENTS|MONO_PROFILE_GC_FINALIZATION;
+
+       max_allocated_sample_hits = mono_cpu_count () * 1000;
+
+       p = desc;
+       if (strncmp (p, "log", 3))
+               usage (1);
+       p += 3;
+       if (*p == ':')
+               p++;
+       for (; *p; p = opt) {
+               char *val;
+               if (*p == ',') {
+                       opt = p + 1;
+                       continue;
+               }
+               if ((opt = match_option (p, "help", NULL)) != p) {
+                       usage (0);
+                       continue;
+               }
+               if ((opt = match_option (p, "calls", NULL)) != p) {
+                       calls_enabled = 1;
+                       continue;
+               }
+               if ((opt = match_option (p, "nocalls", NULL)) != p) {
+                       events &= ~MONO_PROFILE_ENTER_LEAVE;
+                       nocalls = 1;
+                       continue;
+               }
+               if ((opt = match_option (p, "alloc", NULL)) != p) {
+                       allocs_enabled = 1;
+                       continue;
+               }
+               if ((opt = match_option (p, "noalloc", NULL)) != p) {
+                       events &= ~MONO_PROFILE_ALLOCATIONS;
+                       events &= ~MONO_PROFILE_GC_MOVES;
+                       continue;
+               }
+               if ((opt = match_option (p, "nocounters", NULL)) != p) {
+                       no_counters = TRUE;
+                       continue;
+               }
+               if ((opt = match_option (p, "time", &val)) != p) {
+                       // For backwards compatibility.
+                       if (strcmp (val, "fast") && strcmp (val, "null"))
+                               usage (1);
+                       g_free (val);
+                       continue;
+               }
+               if ((opt = match_option (p, "report", NULL)) != p) {
+                       do_report = 1;
+                       continue;
+               }
+               if ((opt = match_option (p, "debug", NULL)) != p) {
+                       do_debug = 1;
+                       continue;
+               }
+               if ((opt = match_option (p, "sampling-real", NULL)) != p) {
+                       sampling_mode = MONO_PROFILER_STAT_MODE_REAL;
+                       continue;
+               }
+               if ((opt = match_option (p, "sampling-process", NULL)) != p) {
+                       sampling_mode = MONO_PROFILER_STAT_MODE_PROCESS;
+                       continue;
+               }
+               if ((opt = match_option (p, "heapshot", &val)) != p) {
+                       events &= ~MONO_PROFILE_ALLOCATIONS;
+                       events &= ~MONO_PROFILE_GC_MOVES;
+                       events &= ~MONO_PROFILE_ENTER_LEAVE;
+                       nocalls = 1;
+                       do_heap_shot = 1;
+                       set_hsmode (val, 1);
+                       continue;
+               }
+               if ((opt = match_option (p, "sample", &val)) != p) {
+                       events &= ~MONO_PROFILE_ALLOCATIONS;
+                       events &= ~MONO_PROFILE_GC_MOVES;
+                       events &= ~MONO_PROFILE_ENTER_LEAVE;
+                       nocalls = 1;
+                       set_sample_freq (val);
+                       continue;
+               }
+               if ((opt = match_option (p, "zip", NULL)) != p) {
+                       use_zip = 1;
+                       continue;
+               }
+               if ((opt = match_option (p, "output", &val)) != p) {
+                       filename = val;
+                       continue;
+               }
+               if ((opt = match_option (p, "port", &val)) != p) {
+                       char *end;
+                       command_port = strtoul (val, &end, 10);
+                       g_free (val);
+                       continue;
+               }
+               if ((opt = match_option (p, "maxframes", &val)) != p) {
+                       char *end;
+                       num_frames = strtoul (val, &end, 10);
+                       if (num_frames > MAX_FRAMES)
+                               num_frames = MAX_FRAMES;
+                       g_free (val);
+                       notraces = num_frames == 0;
+                       continue;
+               }
+               if ((opt = match_option (p, "maxsamples", &val)) != p) {
+                       char *end;
+                       max_allocated_sample_hits = strtoul (val, &end, 10);
+                       if (!max_allocated_sample_hits)
+                               max_allocated_sample_hits = G_MAXINT32;
+                       g_free (val);
+                       continue;
+               }
+               if ((opt = match_option (p, "calldepth", &val)) != p) {
+                       char *end;
+                       max_call_depth = strtoul (val, &end, 10);
+                       g_free (val);
+                       continue;
+               }
+               if ((opt = match_option (p, "counters", NULL)) != p) {
+                       // For backwards compatibility.
+                       continue;
+               }
+               if ((opt = match_option (p, "coverage", NULL)) != p) {
+                       do_coverage = 1;
+                       events |= MONO_PROFILE_ENTER_LEAVE;
+                       debug_coverage = (g_getenv ("MONO_PROFILER_DEBUG_COVERAGE") != NULL);
+                       continue;
+               }
+               if ((opt = match_option (p, "onlycoverage", NULL)) != p) {
+                       only_coverage = TRUE;
+                       continue;
+               }
+               if ((opt = match_option (p, "covfilter-file", &val)) != p) {
+                       FILE *filter_file;
+                       char *line, *content;
+
+                       if (filters == NULL)
+                               filters = g_ptr_array_new ();
+
+                       filter_file = fopen (val, "r");
+                       if (filter_file == NULL) {
+                               fprintf (stderr, "Unable to open %s\n", val);
+                               exit (0);
+                       }
+
+                       /* Don't need to free content as it is referred to by the lines stored in @filters */
+                       content = get_file_content (filter_file);
+                       if (content == NULL)
+                               fprintf (stderr, "WARNING: %s is greater than 128kb - ignoring\n", val);
+
+                       while ((line = get_next_line (content, &content)))
+                               g_ptr_array_add (filters, g_strchug (g_strchomp (line)));
+
+                       fclose (filter_file);
+                       continue;
+               }
+               if ((opt = match_option (p, "covfilter", &val)) != p) {
+                       if (filters == NULL)
+                               filters = g_ptr_array_new ();
+
+                       g_ptr_array_add (filters, val);
+                       continue;
+               }
+               if (opt == p) {
+                       usage (0);
+                       exit (0);
+               }
+       }
+
+       if (calls_enabled) {
+               events |= MONO_PROFILE_ENTER_LEAVE;
+               nocalls = 0;
+       }
+
+       if (allocs_enabled) {
+               events |= MONO_PROFILE_ALLOCATIONS;
+               events |= MONO_PROFILE_GC_MOVES;
+       }
+
+       // Only activate the bare minimum events the profiler needs to function.
+       if (only_coverage) {
+               if (!do_coverage) {
+                       fprintf (stderr, "The onlycoverage option is only valid when paired with the coverage option\n");
+                       exit (1);
+               }
+
+               no_counters = TRUE;
+               events = MONO_PROFILE_GC | MONO_PROFILE_THREADS | MONO_PROFILE_ENTER_LEAVE | MONO_PROFILE_INS_COVERAGE;
+       }
+
+       init_time ();
+
+       PROF_TLS_INIT ();
+
+       prof = create_profiler (desc, filename, filters);
+       if (!prof) {
+               PROF_TLS_FREE ();
+               return;
+       }
+
+       mono_lls_init (&profiler_thread_list, NULL);
+
+       init_thread (prof, TRUE);
+
+       mono_profiler_install (prof, log_shutdown);
+       mono_profiler_install_gc (gc_event, gc_resize);
+       mono_profiler_install_allocation (gc_alloc);
+       mono_profiler_install_gc_moves (gc_moves);
+       mono_profiler_install_gc_roots (gc_handle, gc_roots);
+       mono_profiler_install_gc_finalize (finalize_begin, finalize_object_begin, finalize_object_end, finalize_end);
+       mono_profiler_install_appdomain (NULL, domain_loaded, domain_unloaded, NULL);
+       mono_profiler_install_appdomain_name (domain_name);
+       mono_profiler_install_context (context_loaded, context_unloaded);
+       mono_profiler_install_class (NULL, class_loaded, class_unloaded, NULL);
+       mono_profiler_install_module (NULL, image_loaded, image_unloaded, NULL);
+       mono_profiler_install_assembly (NULL, assembly_loaded, assembly_unloaded, NULL);
+       mono_profiler_install_thread (thread_start, thread_end);
+       mono_profiler_install_thread_name (thread_name);
+       mono_profiler_install_enter_leave (method_enter, method_leave);
+       mono_profiler_install_jit_end (method_jitted);
+       mono_profiler_install_code_buffer_new (code_buffer_new);
+       mono_profiler_install_exception (throw_exc, method_exc_leave, clause_exc);
+       mono_profiler_install_monitor (monitor_event);
+       mono_profiler_install_runtime_initialized (runtime_initialized);
+       if (do_coverage)
+               mono_profiler_install_coverage_filter (coverage_filter);
+
+       if (do_mono_sample && sample_freq) {
+               events |= MONO_PROFILE_STATISTICAL;
+               mono_profiler_set_statistical_mode (sampling_mode, sample_freq);
+               mono_profiler_install_statistical (mono_sample_hit);
+       }
+
+       mono_profiler_set_events ((MonoProfileFlags)events);
+}
diff --git a/mono/profiler/mono-profiler-log.h b/mono/profiler/mono-profiler-log.h
new file mode 100644 (file)
index 0000000..99b5782
--- /dev/null
@@ -0,0 +1,156 @@
+#ifndef __MONO_PROFLOG_H__
+#define __MONO_PROFLOG_H__
+
+#define BUF_ID 0x4D504C01
+#define LOG_HEADER_ID 0x4D505A01
+#define LOG_VERSION_MAJOR 1
+#define LOG_VERSION_MINOR 1
+#define LOG_DATA_VERSION 13
+
+/*
+ * Changes in major/minor versions:
+ * version 1.0: removed sysid field from header
+ *              added args, arch, os fields to header
+ *
+ * Changes in data versions:
+ * version 2: added offsets in heap walk
+ * version 3: added GC roots
+ * version 4: added sample/statistical profiling
+ * version 5: added counters sampling
+ * version 6: added optional backtrace in sampling info
+ * version 8: added TYPE_RUNTIME and JIT helpers/trampolines
+ * version 9: added MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING
+ * version 10: added TYPE_COVERAGE
+ * version 11: added thread ID to TYPE_SAMPLE_HIT
+               added more load/unload events
+                   unload for class
+                   unload for image
+                   load/unload for appdomain
+                   load/unload for contexts
+                   load/unload/name for assemblies
+               removed TYPE_LOAD_ERR flag (profiler never generated it, now removed from the format itself)
+               added TYPE_GC_HANDLE_{CREATED,DESTROYED}_BT
+               TYPE_JIT events are no longer guaranteed to have code start/size info (can be zero)
+ * version 12: added MONO_COUNTER_PROFILER
+ * version 13: added MONO_GC_EVENT_{PRE_STOP_WORLD_LOCKED,POST_START_WORLD_UNLOCKED}
+               added TYPE_META + TYPE_SYNC_POINT
+               removed il and native offset in TYPE_SAMPLE_HIT
+               methods in backtraces are now encoded as proper method pointers
+               removed flags in backtrace format
+               removed flags in metadata events
+               changed the following fields to a single byte rather than leb128
+                   TYPE_GC_EVENT: event_type, generation
+                   TYPE_HEAP_ROOT: root_type
+                   TYPE_JITHELPER: type
+                   TYPE_SAMPLE_HIT: sample_type
+                   TYPE_CLAUSE: clause_type
+                   TYPE_SAMPLE_COUNTERS_DESC: type, unit, variance
+                   TYPE_SAMPLE_COUNTERS: type
+               added time fields to all events that were missing one
+                   TYPE_HEAP_OBJECT
+                   TYPE_HEAP_ROOT
+                   TYPE_SAMPLE_USYM
+                   TYPE_SAMPLE_COUNTERS_DESC
+                   TYPE_COVERAGE_METHOD
+                   TYPE_COVERAGE_STATEMENT
+                   TYPE_COVERAGE_CLASS
+                   TYPE_COVERAGE_ASSEMBLY
+               moved the time field in TYPE_SAMPLE_HIT to right after the event byte, now encoded as a regular time field
+               changed the time field in TYPE_SAMPLE_COUNTERS to be encoded as a regular time field (in nanoseconds)
+               added TYPE_GC_FINALIZE_{START,END,OBJECT_START,OBJECT_END}
+ */
+
+enum {
+       TYPE_ALLOC,
+       TYPE_GC,
+       TYPE_METADATA,
+       TYPE_METHOD,
+       TYPE_EXCEPTION,
+       TYPE_MONITOR,
+       TYPE_HEAP,
+       TYPE_SAMPLE,
+       TYPE_RUNTIME,
+       TYPE_COVERAGE,
+       TYPE_META,
+       /* extended type for TYPE_HEAP */
+       TYPE_HEAP_START  = 0 << 4,
+       TYPE_HEAP_END    = 1 << 4,
+       TYPE_HEAP_OBJECT = 2 << 4,
+       TYPE_HEAP_ROOT   = 3 << 4,
+       /* extended type for TYPE_METADATA */
+       TYPE_END_LOAD     = 2 << 4,
+       TYPE_END_UNLOAD   = 4 << 4,
+       /* extended type for TYPE_GC */
+       TYPE_GC_EVENT  = 1 << 4,
+       TYPE_GC_RESIZE = 2 << 4,
+       TYPE_GC_MOVE   = 3 << 4,
+       TYPE_GC_HANDLE_CREATED      = 4 << 4,
+       TYPE_GC_HANDLE_DESTROYED    = 5 << 4,
+       TYPE_GC_HANDLE_CREATED_BT   = 6 << 4,
+       TYPE_GC_HANDLE_DESTROYED_BT = 7 << 4,
+       TYPE_GC_FINALIZE_START = 8 << 4,
+       TYPE_GC_FINALIZE_END = 9 << 4,
+       TYPE_GC_FINALIZE_OBJECT_START = 10 << 4,
+       TYPE_GC_FINALIZE_OBJECT_END = 11 << 4,
+       /* extended type for TYPE_METHOD */
+       TYPE_LEAVE     = 1 << 4,
+       TYPE_ENTER     = 2 << 4,
+       TYPE_EXC_LEAVE = 3 << 4,
+       TYPE_JIT       = 4 << 4,
+       /* extended type for TYPE_EXCEPTION */
+       TYPE_THROW_NO_BT = 0 << 7,
+       TYPE_THROW_BT    = 1 << 7,
+       TYPE_CLAUSE      = 1 << 4,
+       /* extended type for TYPE_ALLOC */
+       TYPE_ALLOC_NO_BT  = 0 << 4,
+       TYPE_ALLOC_BT     = 1 << 4,
+       /* extended type for TYPE_MONITOR */
+       TYPE_MONITOR_NO_BT  = 0 << 7,
+       TYPE_MONITOR_BT     = 1 << 7,
+       /* extended type for TYPE_SAMPLE */
+       TYPE_SAMPLE_HIT           = 0 << 4,
+       TYPE_SAMPLE_USYM          = 1 << 4,
+       TYPE_SAMPLE_UBIN          = 2 << 4,
+       TYPE_SAMPLE_COUNTERS_DESC = 3 << 4,
+       TYPE_SAMPLE_COUNTERS      = 4 << 4,
+       /* extended type for TYPE_RUNTIME */
+       TYPE_JITHELPER = 1 << 4,
+       /* extended type for TYPE_COVERAGE */
+       TYPE_COVERAGE_ASSEMBLY = 0 << 4,
+       TYPE_COVERAGE_METHOD   = 1 << 4,
+       TYPE_COVERAGE_STATEMENT = 2 << 4,
+       TYPE_COVERAGE_CLASS = 3 << 4,
+       /* extended type for TYPE_META */
+       TYPE_SYNC_POINT = 0 << 4,
+       TYPE_END
+};
+
+enum {
+       /* metadata type byte for TYPE_METADATA */
+       TYPE_CLASS    = 1,
+       TYPE_IMAGE    = 2,
+       TYPE_ASSEMBLY = 3,
+       TYPE_DOMAIN   = 4,
+       TYPE_THREAD   = 5,
+       TYPE_CONTEXT  = 6,
+};
+
+typedef enum {
+       SYNC_POINT_PERIODIC,
+       SYNC_POINT_WORLD_STOP,
+       SYNC_POINT_WORLD_START
+} MonoProfilerSyncPointType;
+
+// Sampling sources
+// Unless you have compiled with --enable-perf-events, only SAMPLE_CYCLES is available
+enum {
+       SAMPLE_CYCLES = 1,
+       SAMPLE_INSTRUCTIONS,
+       SAMPLE_CACHE_MISSES,
+       SAMPLE_CACHE_REFS,
+       SAMPLE_BRANCHES,
+       SAMPLE_BRANCH_MISSES,
+       SAMPLE_LAST
+};
+
+#endif /* __MONO_PROFLOG_H__ */
diff --git a/mono/profiler/mprof-report.c b/mono/profiler/mprof-report.c
new file mode 100644 (file)
index 0000000..1017d1f
--- /dev/null
@@ -0,0 +1,4306 @@
+/*
+ * mprof-report.c: mprof-report program source: decode and analyze the log profiler data
+ *
+ * Authors:
+ *   Paolo Molaro (lupus@ximian.com)
+ *   Alex Rønne Petersen (alexrp@xamarin.com)
+ *
+ * Copyright 2010 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+/*
+ * The Coverage XML output schema
+ * <coverage>
+ *   <assembly/>
+ *   <class/>
+ *   <method>
+ *     <statement/>
+ *   </method>
+ * </coverage>
+ *
+ * Elements:
+ *   <coverage> - The root element of the documentation. It can contain any number of
+ *                <assembly>, <class> or <method> elements.
+ *                Attributes:
+ *                   - version: The version number for the file format - (eg: "0.3")
+ *   <assembly> - Contains data about assemblies. Has no child elements
+ *                Attributes:
+ *                   - name: The name of the assembly - (eg: "System.Xml")
+ *                   - guid: The GUID of the assembly
+ *                   - filename: The filename of the assembly
+ *                   - method-count: The number of methods in the assembly
+ *                   - full: The number of fully covered methods
+ *                   - partial: The number of partially covered methods
+ *   <class> - Contains data about classes. Has no child elements
+ *             Attributes:
+ *                - name: The name of the class
+ *                - method-count: The number of methods in the class
+ *                - full: The number of fully covered methods
+ *                - partial: The number of partially covered methods
+ *   <method> - Contains data about methods. Can contain any number of <statement> elements
+ *              Attributes:
+ *                 - assembly: The name of the parent assembly
+ *                 - class: The name of the parent class
+ *                 - name: The name of the method, with all it's parameters
+ *                 - filename: The name of the source file containing this method
+ *                 - token
+ *   <statement> - Contains data about IL statements. Has no child elements
+ *                 Attributes:
+ *                    - offset: The offset of the statement in the IL code after the previous
+ *                              statement's offset
+ *                    - counter: 1 if the line was covered, 0 if it was not
+ *                    - line: The line number in the parent method's file
+ *                    - column: The column on the line
+ */
+#include <config.h>
+#include "mono-profiler-log.h"
+#include <string.h>
+#include <assert.h>
+#include <stdio.h>
+#include <time.h>
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#include <malloc.h>
+#endif
+#include <unistd.h>
+#include <stdlib.h>
+#if defined (HAVE_SYS_ZLIB)
+#include <zlib.h>
+#endif
+#include <glib.h>
+#include <mono/metadata/profiler.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/utils/mono-counters.h>
+
+#define HASH_SIZE 9371
+#define SMALL_HASH_SIZE 31
+
+#if defined(__native_client__) || defined(__native_client_codegen__)
+volatile int __nacl_thread_suspension_needed = 0;
+void __nacl_suspend_thread_if_needed() {}
+#endif
+
+static int debug = 0;
+static int collect_traces = 0;
+static int show_traces = 0;
+static int trace_max = 6;
+static int verbose = 0;
+static uintptr_t *tracked_objects = 0;
+static int num_tracked_objects = 0;
+static uintptr_t thread_filter = 0;
+static uint64_t find_size = 0;
+static const char* find_name = NULL;
+static uint64_t time_from = 0;
+static uint64_t time_to = 0xffffffffffffffffULL;
+static int use_time_filter = 0;
+static uint64_t startup_time = 0;
+static FILE* outfile = NULL;
+static FILE* coverage_outfile = NULL;
+
+static int32_t
+read_int16 (unsigned char *p)
+{
+       int32_t value = *p++;
+       value |= (*p++) << 8;
+       return value;
+}
+
+static int32_t
+read_int32 (unsigned char *p)
+{
+       int32_t value = *p++;
+       value |= (*p++) << 8;
+       value |= (*p++) << 16;
+       value |= (uint32_t)(*p++) << 24;
+       return value;
+}
+
+static int64_t
+read_int64 (unsigned char *p)
+{
+       uint64_t value = *p++;
+       value |= (*p++) << 8;
+       value |= (*p++) << 16;
+       value |= (uint64_t)(*p++) << 24;
+       value |= (uint64_t)(*p++) << 32;
+       value |= (uint64_t)(*p++) << 40;
+       value |= (uint64_t)(*p++) << 48;
+       value |= (uint64_t)(*p++) << 54;
+       return value;
+}
+
+static char*
+pstrdup (const char *s)
+{
+       int len = strlen (s) + 1;
+       char *p = (char *) g_malloc (len);
+       memcpy (p, s, len);
+       return p;
+}
+
+typedef struct _CounterValue CounterValue;
+struct _CounterValue {
+       uint64_t timestamp;
+       unsigned char *buffer;
+       CounterValue *next;
+};
+
+typedef struct _Counter Counter;
+struct _Counter {
+       int index;
+       const char *section;
+       const char *name;
+       int type;
+       int unit;
+       int variance;
+       CounterValue *values;
+       CounterValue *values_last;
+};
+
+typedef struct _CounterList CounterList;
+struct _CounterList {
+       Counter *counter;
+       CounterList *next;
+};
+
+typedef struct _CounterSection CounterSection;
+struct _CounterSection {
+       const char *value;
+       CounterList *counters;
+       CounterList *counters_last;
+       CounterSection *next;
+};
+
+typedef struct _CounterTimestamp CounterTimestamp;
+struct _CounterTimestamp {
+       uint64_t value;
+       CounterSection *sections;
+       CounterSection *sections_last;
+       CounterTimestamp *next;
+};
+
+static CounterList *counters = NULL;
+static CounterSection *counters_sections = NULL;
+static CounterTimestamp *counters_timestamps = NULL;
+
+enum {
+       COUNTERS_SORT_TIME,
+       COUNTERS_SORT_CATEGORY
+};
+
+static int counters_sort_mode = COUNTERS_SORT_TIME;
+
+static void
+add_counter_to_section (Counter *counter)
+{
+       CounterSection *csection, *s;
+       CounterList *clist;
+
+       clist = (CounterList *) g_calloc (1, sizeof (CounterList));
+       clist->counter = counter;
+
+       for (csection = counters_sections; csection; csection = csection->next) {
+               if (strcmp (csection->value, counter->section) == 0) {
+                       /* If section exist */
+                       if (!csection->counters)
+                               csection->counters = clist;
+                       else
+                               csection->counters_last->next = clist;
+                       csection->counters_last = clist;
+                       return;
+               }
+       }
+
+       /* If section does not exist */
+       csection = (CounterSection *) g_calloc (1, sizeof (CounterSection));
+       csection->value = counter->section;
+       csection->counters = clist;
+       csection->counters_last = clist;
+
+       if (!counters_sections) {
+               counters_sections = csection;
+       } else {
+               s = counters_sections;
+               while (s->next)
+                       s = s->next;
+               s->next = csection;
+       }
+}
+
+static void
+add_counter (const char *section, const char *name, int type, int unit, int variance, int index)
+{
+       CounterList *list, *l;
+       Counter *counter;
+
+       for (list = counters; list; list = list->next)
+               if (list->counter->index == index)
+                       return;
+
+       counter = (Counter *) g_calloc (1, sizeof (Counter));
+       counter->section = section;
+       counter->name = name;
+       counter->type = type;
+       counter->unit = unit;
+       counter->variance = variance;
+       counter->index = index;
+
+       list = (CounterList *) g_calloc (1, sizeof (CounterList));
+       list->counter = counter;
+
+       if (!counters) {
+               counters = list;
+       } else {
+               l = counters;
+               while (l->next)
+                       l = l->next;
+               l->next = list;
+       }
+
+       if (counters_sort_mode == COUNTERS_SORT_CATEGORY || !verbose)
+               add_counter_to_section (counter);
+}
+
+static void
+add_counter_to_timestamp (uint64_t timestamp, Counter *counter)
+{
+       CounterTimestamp *ctimestamp, *t;
+       CounterSection *csection;
+       CounterList *clist;
+
+       clist = (CounterList *) g_calloc (1, sizeof (CounterList));
+       clist->counter = counter;
+
+       for (ctimestamp = counters_timestamps; ctimestamp; ctimestamp = ctimestamp->next) {
+               if (ctimestamp->value == timestamp) {
+                       for (csection = ctimestamp->sections; csection; csection = csection->next) {
+                               if (strcmp (csection->value, counter->section) == 0) {
+                                       /* if timestamp exist and section exist */
+                                       if (!csection->counters)
+                                               csection->counters = clist;
+                                       else
+                                               csection->counters_last->next = clist;
+                                       csection->counters_last = clist;
+                                       return;
+                               }
+                       }
+
+                       /* if timestamp exist and section does not exist */
+                       csection = (CounterSection *) g_calloc (1, sizeof (CounterSection));
+                       csection->value = counter->section;
+                       csection->counters = clist;
+                       csection->counters_last = clist;
+
+                       if (!ctimestamp->sections)
+                               ctimestamp->sections = csection;
+                       else
+                               ctimestamp->sections_last->next = csection;
+                       ctimestamp->sections_last = csection;
+                       return;
+               }
+       }
+
+       /* If timestamp do not exist and section does not exist */
+       csection = (CounterSection *) g_calloc (1, sizeof (CounterSection));
+       csection->value = counter->section;
+       csection->counters = clist;
+       csection->counters_last = clist;
+
+       ctimestamp = (CounterTimestamp *) g_calloc (1, sizeof (CounterTimestamp));
+       ctimestamp->value = timestamp;
+       ctimestamp->sections = csection;
+       ctimestamp->sections_last = csection;
+
+       if (!counters_timestamps) {
+               counters_timestamps = ctimestamp;
+       } else {
+               t = counters_timestamps;
+               while (t->next)
+                       t = t->next;
+               t->next = ctimestamp;
+       }
+}
+
+static void
+add_counter_value (int index, CounterValue *value)
+{
+       CounterList *list;
+
+       for (list = counters; list; list = list->next) {
+               if (list->counter->index == index) {
+                       if (!list->counter->values)
+                               list->counter->values = value;
+                       else
+                               list->counter->values_last->next = value;
+                       list->counter->values_last = value;
+
+                       if (counters_sort_mode == COUNTERS_SORT_TIME)
+                               add_counter_to_timestamp (value->timestamp, list->counter);
+
+                       return;
+               }
+       }
+}
+
+static const char*
+section_name (int section)
+{
+       switch (section) {
+       case MONO_COUNTER_JIT: return "Mono JIT";
+       case MONO_COUNTER_GC: return "Mono GC";
+       case MONO_COUNTER_METADATA: return "Mono Metadata";
+       case MONO_COUNTER_GENERICS: return "Mono Generics";
+       case MONO_COUNTER_SECURITY: return "Mono Security";
+       case MONO_COUNTER_RUNTIME: return "Mono Runtime";
+       case MONO_COUNTER_SYSTEM: return "Mono System";
+       case MONO_COUNTER_PROFILER: return "Mono Profiler";
+       default: return "<unknown>";
+       }
+}
+
+static const char*
+type_name (int type)
+{
+       switch (type) {
+       case MONO_COUNTER_INT: return "Int";
+       case MONO_COUNTER_UINT: return "UInt";
+       case MONO_COUNTER_WORD: return "Word";
+       case MONO_COUNTER_LONG: return "Long";
+       case MONO_COUNTER_ULONG: return "ULong";
+       case MONO_COUNTER_DOUBLE: return "Double";
+       case MONO_COUNTER_STRING: return "String";
+       case MONO_COUNTER_TIME_INTERVAL: return "Time Interval";
+       default: return "<unknown>";
+       }
+}
+
+static const char*
+unit_name (int unit)
+{
+       switch (unit) {
+       case MONO_COUNTER_RAW: return "Raw";
+       case MONO_COUNTER_BYTES: return "Bytes";
+       case MONO_COUNTER_TIME: return "Time";
+       case MONO_COUNTER_COUNT: return "Count";
+       case MONO_COUNTER_PERCENTAGE: return "Percentage";
+       default: return "<unknown>";
+       }
+}
+
+static const char*
+variance_name (int variance)
+{
+       switch (variance) {
+       case MONO_COUNTER_MONOTONIC: return "Monotonic";
+       case MONO_COUNTER_CONSTANT: return "Constant";
+       case MONO_COUNTER_VARIABLE: return "Variable";
+       default: return "<unknown>";
+       }
+}
+
+static void
+dump_counters_value (Counter *counter, const char *key_format, const char *key, void *value)
+{
+       char format[32];
+
+       if (value == NULL) {
+               snprintf (format, sizeof (format), "%s : %%s\n", key_format);
+               fprintf (outfile, format, key, "<null>");
+       } else {
+               switch (counter->type) {
+               case MONO_COUNTER_INT:
+#if SIZEOF_VOID_P == 4
+               case MONO_COUNTER_WORD:
+#endif
+                       snprintf (format, sizeof (format), "%s : %%d\n", key_format);
+                       fprintf (outfile, format, key, *(int32_t*)value);
+                       break;
+               case MONO_COUNTER_UINT:
+                       snprintf (format, sizeof (format), "%s : %%u\n", key_format);
+                       fprintf (outfile, format, key, *(uint32_t*)value);
+                       break;
+               case MONO_COUNTER_LONG:
+#if SIZEOF_VOID_P == 8
+               case MONO_COUNTER_WORD:
+#endif
+               case MONO_COUNTER_TIME_INTERVAL:
+                       if (counter->type == MONO_COUNTER_LONG && counter->unit == MONO_COUNTER_TIME) {
+                               snprintf (format, sizeof (format), "%s : %%0.3fms\n", key_format);
+                               fprintf (outfile, format, key, (double)*(int64_t*)value / 10000.0);
+                       } else if (counter->type == MONO_COUNTER_TIME_INTERVAL) {
+                               snprintf (format, sizeof (format), "%s : %%0.3fms\n", key_format);
+                               fprintf (outfile, format, key, (double)*(int64_t*)value / 1000.0);
+                       } else {
+                               snprintf (format, sizeof (format), "%s : %%u\n", key_format);
+                               fprintf (outfile, format, key, *(int64_t*)value);
+                       }
+                       break;
+               case MONO_COUNTER_ULONG:
+                       snprintf (format, sizeof (format), "%s : %%llu\n", key_format);
+                       fprintf (outfile, format, key, *(uint64_t*)value);
+                       break;
+               case MONO_COUNTER_DOUBLE:
+                       snprintf (format, sizeof (format), "%s : %%f\n", key_format);
+                       fprintf (outfile, format, key, *(double*)value);
+                       break;
+               case MONO_COUNTER_STRING:
+                       snprintf (format, sizeof (format), "%s : %%s\n", key_format);
+                       fprintf (outfile, format, key, *(char*)value);
+                       break;
+               }
+       }
+}
+
+static void
+dump_counters (void)
+{
+       Counter *counter;
+       CounterValue *cvalue;
+       CounterTimestamp *ctimestamp;
+       CounterSection *csection;
+       CounterList *clist;
+       char strtimestamp[17];
+       int i, section_printed;
+
+       fprintf (outfile, "\nCounters:\n");
+
+       if (!verbose) {
+               char counters_to_print[][64] = {
+                       "Methods from AOT",
+                       "Methods JITted using mono JIT",
+                       "Methods JITted using LLVM",
+                       "Total time spent JITting (sec)",
+                       "User Time",
+                       "System Time",
+                       "Total Time",
+                       "Working Set",
+                       "Private Bytes",
+                       "Virtual Bytes",
+                       "Page Faults",
+                       "CPU Load Average - 1min",
+                       "CPU Load Average - 5min",
+                       "CPU Load Average - 15min",
+                       ""
+               };
+
+               for (csection = counters_sections; csection; csection = csection->next) {
+                       section_printed = 0;
+
+                       for (clist = csection->counters; clist; clist = clist->next) {
+                               counter = clist->counter;
+                               if (!counter->values_last)
+                                       continue;
+
+                               for (i = 0; counters_to_print [i][0] != 0; i++) {
+                                       if (strcmp (counters_to_print [i], counter->name) == 0) {
+                                               if (!section_printed) {
+                                                       fprintf (outfile, "\t%s:\n", csection->value);
+                                                       section_printed = 1;
+                                               }
+
+                                               dump_counters_value (counter, "\t\t%-30s", counter->name, counter->values_last->buffer);
+                                               break;
+                                       }
+                               }
+                       }
+               }
+       } else if (counters_sort_mode == COUNTERS_SORT_TIME) {
+               for (ctimestamp = counters_timestamps; ctimestamp; ctimestamp = ctimestamp->next) {
+                       fprintf (outfile, "\t%llu:%02llu:%02llu:%02llu.%03llu:\n",
+                               (unsigned long long) (ctimestamp->value / 1000 / 60 / 60 / 24 % 1000),
+                               (unsigned long long) (ctimestamp->value / 1000 / 60 / 60 % 24),
+                               (unsigned long long) (ctimestamp->value / 1000 / 60 % 60),
+                               (unsigned long long) (ctimestamp->value / 1000 % 60),
+                               (unsigned long long) (ctimestamp->value % 1000));
+
+                       for (csection = ctimestamp->sections; csection; csection = csection->next) {
+                               fprintf (outfile, "\t\t%s:\n", csection->value);
+
+                               for (clist = csection->counters; clist; clist = clist->next) {
+                                       counter = clist->counter;
+                                       for (cvalue = counter->values; cvalue; cvalue = cvalue->next) {
+                                               if (cvalue->timestamp != ctimestamp->value)
+                                                       continue;
+
+                                               dump_counters_value (counter, "\t\t\t%-30s", counter->name, cvalue->buffer);
+                                       }
+                               }
+                       }
+               }
+       } else if (counters_sort_mode == COUNTERS_SORT_CATEGORY) {
+               for (csection = counters_sections; csection; csection = csection->next) {
+                       fprintf (outfile, "\t%s:\n", csection->value);
+
+                       for (clist = csection->counters; clist; clist = clist->next) {
+                               counter = clist->counter;
+                               fprintf (outfile, "\t\t%s: [type: %s, unit: %s, variance: %s]\n",
+                                       counter->name, type_name (counter->type), unit_name (counter->unit), variance_name (counter->variance));
+
+                               for (cvalue = counter->values; cvalue; cvalue = cvalue->next) {
+                                       snprintf (strtimestamp, sizeof (strtimestamp), "%llu:%02llu:%02llu:%02llu.%03llu",
+                                               (unsigned long long) (cvalue->timestamp / 1000 / 60 / 60 / 24 % 1000),
+                                               (unsigned long long) (cvalue->timestamp / 1000 / 60 / 60 % 24),
+                                               (unsigned long long) (cvalue->timestamp / 1000 / 60 % 60),
+                                               (unsigned long long) (cvalue->timestamp / 1000 % 60),
+                                               (unsigned long long) (cvalue->timestamp % 1000));
+
+                                       dump_counters_value (counter, "\t\t\t%s", strtimestamp, cvalue->buffer);
+                               }
+                       }
+               }
+       }
+}
+
+static int num_images;
+typedef struct _ImageDesc ImageDesc;
+struct _ImageDesc {
+       ImageDesc *next;
+       intptr_t image;
+       char *filename;
+};
+
+static ImageDesc* image_hash [SMALL_HASH_SIZE] = {0};
+
+static void
+add_image (intptr_t image, char *name)
+{
+       int slot = ((image >> 2) & 0xffff) % SMALL_HASH_SIZE;
+       ImageDesc *cd = (ImageDesc *) g_malloc (sizeof (ImageDesc));
+       cd->image = image;
+       cd->filename = pstrdup (name);
+       cd->next = image_hash [slot];
+       image_hash [slot] = cd;
+       num_images++;
+}
+
+static int num_assemblies;
+
+typedef struct _AssemblyDesc AssemblyDesc;
+struct _AssemblyDesc {
+       AssemblyDesc *next;
+       intptr_t assembly;
+       char *asmname;
+};
+
+static AssemblyDesc* assembly_hash [SMALL_HASH_SIZE] = {0};
+
+static void
+add_assembly (intptr_t assembly, char *name)
+{
+       int slot = ((assembly >> 2) & 0xffff) % SMALL_HASH_SIZE;
+       AssemblyDesc *cd = (AssemblyDesc *) g_malloc (sizeof (AssemblyDesc));
+       cd->assembly = assembly;
+       cd->asmname = pstrdup (name);
+       cd->next = assembly_hash [slot];
+       assembly_hash [slot] = cd;
+       num_assemblies++;
+}
+
+typedef struct _BackTrace BackTrace;
+typedef struct {
+       uint64_t count;
+       BackTrace *bt;
+} CallContext;
+
+typedef struct {
+       int count;
+       int size;
+       CallContext *traces;
+} TraceDesc;
+
+typedef struct _ClassDesc ClassDesc;
+struct _ClassDesc {
+       ClassDesc *next;
+       intptr_t klass;
+       char *name;
+       intptr_t allocs;
+       uint64_t alloc_size;
+       TraceDesc traces;
+};
+
+static ClassDesc* class_hash [HASH_SIZE] = {0};
+static int num_classes = 0;
+
+static ClassDesc*
+add_class (intptr_t klass, const char *name)
+{
+       int slot = ((klass >> 2) & 0xffff) % HASH_SIZE;
+       ClassDesc *cd;
+       cd = class_hash [slot];
+       while (cd && cd->klass != klass)
+               cd = cd->next;
+       /* we resolved an unknown class (unless we had the code unloaded) */
+       if (cd) {
+               /*printf ("resolved unknown: %s\n", name);*/
+               g_free (cd->name);
+               cd->name = pstrdup (name);
+               return cd;
+       }
+       cd = (ClassDesc *) g_calloc (sizeof (ClassDesc), 1);
+       cd->klass = klass;
+       cd->name = pstrdup (name);
+       cd->next = class_hash [slot];
+       cd->allocs = 0;
+       cd->alloc_size = 0;
+       cd->traces.count = 0;
+       cd->traces.size = 0;
+       cd->traces.traces = NULL;
+       class_hash [slot] = cd;
+       num_classes++;
+       return cd;
+}
+
+static ClassDesc *
+lookup_class (intptr_t klass)
+{
+       int slot = ((klass >> 2) & 0xffff) % HASH_SIZE;
+       ClassDesc *cd = class_hash [slot];
+       while (cd && cd->klass != klass)
+               cd = cd->next;
+       if (!cd) {
+               char buf [128];
+               snprintf (buf, sizeof (buf), "unresolved class %p", (void*)klass);
+               return add_class (klass, buf);
+       }
+       return cd;
+}
+
+typedef struct _MethodDesc MethodDesc;
+struct _MethodDesc {
+       MethodDesc *next;
+       intptr_t method;
+       char *name;
+       intptr_t code;
+       int len;
+       int recurse_count;
+       int sample_hits;
+       int ignore_jit; /* when this is set, we collect the metadata but don't count this method fot jit time and code size, when filtering events */
+       uint64_t calls;
+       uint64_t total_time;
+       uint64_t callee_time;
+       uint64_t self_time;
+       TraceDesc traces;
+};
+
+static MethodDesc* method_hash [HASH_SIZE] = {0};
+static int num_methods = 0;
+
+static MethodDesc*
+add_method (intptr_t method, const char *name, intptr_t code, int len)
+{
+       int slot = ((method >> 2) & 0xffff) % HASH_SIZE;
+       MethodDesc *cd;
+       cd = method_hash [slot];
+       while (cd && cd->method != method)
+               cd = cd->next;
+       /* we resolved an unknown method (unless we had the code unloaded) */
+       if (cd) {
+               cd->code = code;
+               cd->len = len;
+               /*printf ("resolved unknown: %s\n", name);*/
+               g_free (cd->name);
+               cd->name = pstrdup (name);
+               return cd;
+       }
+       cd = (MethodDesc *) g_calloc (sizeof (MethodDesc), 1);
+       cd->method = method;
+       cd->name = pstrdup (name);
+       cd->code = code;
+       cd->len = len;
+       cd->calls = 0;
+       cd->total_time = 0;
+       cd->traces.count = 0;
+       cd->traces.size = 0;
+       cd->traces.traces = NULL;
+       cd->next = method_hash [slot];
+       method_hash [slot] = cd;
+       num_methods++;
+       return cd;
+}
+
+static MethodDesc *
+lookup_method (intptr_t method)
+{
+       int slot = ((method >> 2) & 0xffff) % HASH_SIZE;
+       MethodDesc *cd = method_hash [slot];
+       while (cd && cd->method != method)
+               cd = cd->next;
+       if (!cd) {
+               char buf [128];
+               snprintf (buf, sizeof (buf), "unknown method %p", (void*)method);
+               return add_method (method, buf, 0, 0);
+       }
+       return cd;
+}
+
+static int num_stat_samples = 0;
+static int size_stat_samples = 0;
+uintptr_t *stat_samples = NULL;
+int *stat_sample_desc = NULL;
+
+static void
+add_stat_sample (int type, uintptr_t ip) {
+       if (num_stat_samples == size_stat_samples) {
+               size_stat_samples *= 2;
+               if (!size_stat_samples)
+               size_stat_samples = 32;
+               stat_samples = (uintptr_t *) g_realloc (stat_samples, size_stat_samples * sizeof (uintptr_t));
+               stat_sample_desc = (int *) g_realloc (stat_sample_desc, size_stat_samples * sizeof (int));
+       }
+       stat_samples [num_stat_samples] = ip;
+       stat_sample_desc [num_stat_samples++] = type;
+}
+
+static MethodDesc*
+lookup_method_by_ip (uintptr_t ip)
+{
+       int i;
+       MethodDesc* m;
+       /* dumb */
+       for (i = 0; i < HASH_SIZE; ++i) {
+               m = method_hash [i];
+               while (m) {
+                       //printf ("checking %p against %p-%p\n", (void*)ip, (void*)(m->code), (void*)(m->code + m->len));
+                       if (ip >= (uintptr_t)m->code && ip < (uintptr_t)m->code + m->len) {
+                               return m;
+                       }
+                       m = m->next;
+               }
+       }
+       return NULL;
+}
+
+static int
+compare_method_samples (const void *a, const void *b)
+{
+       MethodDesc *const *A = (MethodDesc *const *)a;
+       MethodDesc *const *B = (MethodDesc *const *)b;
+       if ((*A)->sample_hits == (*B)->sample_hits)
+               return 0;
+       if ((*B)->sample_hits < (*A)->sample_hits)
+               return -1;
+       return 1;
+}
+
+typedef struct _UnmanagedSymbol UnmanagedSymbol;
+struct _UnmanagedSymbol {
+       UnmanagedSymbol *parent;
+       char *name;
+       int is_binary;
+       uintptr_t addr;
+       uintptr_t size;
+       uintptr_t sample_hits;
+};
+
+static UnmanagedSymbol **usymbols = NULL;
+static int usymbols_size = 0;
+static int usymbols_num = 0;
+
+static int
+compare_usymbol_addr (const void *a, const void *b)
+{
+       UnmanagedSymbol *const *A = (UnmanagedSymbol *const *)a;
+       UnmanagedSymbol *const *B = (UnmanagedSymbol *const *)b;
+       if ((*B)->addr == (*A)->addr)
+               return 0;
+       if ((*B)->addr > (*A)->addr)
+               return -1;
+       return 1;
+}
+
+static int
+compare_usymbol_samples (const void *a, const void *b)
+{
+       UnmanagedSymbol *const *A = (UnmanagedSymbol *const *)a;
+       UnmanagedSymbol *const *B = (UnmanagedSymbol *const *)b;
+       if ((*B)->sample_hits == (*A)->sample_hits)
+               return 0;
+       if ((*B)->sample_hits < (*A)->sample_hits)
+               return -1;
+       return 1;
+}
+
+static void
+add_unmanaged_symbol (uintptr_t addr, char *name, uintptr_t size)
+{
+       UnmanagedSymbol *sym;
+       if (usymbols_num == usymbols_size) {
+               int new_size = usymbols_size * 2;
+               if (!new_size)
+                       new_size = 16;
+               usymbols = (UnmanagedSymbol **) g_realloc (usymbols, sizeof (void*) * new_size);
+               usymbols_size = new_size;
+       }
+       sym = (UnmanagedSymbol *) g_calloc (sizeof (UnmanagedSymbol), 1);
+       sym->addr = addr;
+       sym->name = name;
+       sym->size = size;
+       usymbols [usymbols_num++] = sym;
+}
+
+/* only valid after the symbols are sorted */
+static UnmanagedSymbol*
+lookup_unmanaged_symbol (uintptr_t addr)
+{
+       int r = usymbols_num - 1;
+       int l = 0;
+       UnmanagedSymbol *sym;
+       int last_best = -1;
+       while (r >= l) {
+               int m = (l + r) / 2;
+               sym = usymbols [m];
+               if (addr == sym->addr)
+                       return sym;
+               if (addr < sym->addr) {
+                       r = m - 1;
+               } else if (addr > sym->addr) {
+                       l = m + 1;
+                       last_best = m;
+               }
+       }
+       if (last_best >= 0 && (addr - usymbols [last_best]->addr) < 4096)
+               return usymbols [last_best];
+       return NULL;
+}
+
+/* we use the same structure for binaries */
+static UnmanagedSymbol **ubinaries = NULL;
+static int ubinaries_size = 0;
+static int ubinaries_num = 0;
+
+static void
+add_unmanaged_binary (uintptr_t addr, char *name, uintptr_t size)
+{
+       UnmanagedSymbol *sym;
+       if (ubinaries_num == ubinaries_size) {
+               int new_size = ubinaries_size * 2;
+               if (!new_size)
+                       new_size = 16;
+               ubinaries = (UnmanagedSymbol **) g_realloc (ubinaries, sizeof (void*) * new_size);
+               ubinaries_size = new_size;
+       }
+       sym = (UnmanagedSymbol *) g_calloc (sizeof (UnmanagedSymbol), 1);
+       sym->addr = addr;
+       sym->name = name;
+       sym->size = size;
+       sym->is_binary = 1;
+       ubinaries [ubinaries_num++] = sym;
+}
+
+static UnmanagedSymbol*
+lookup_unmanaged_binary (uintptr_t addr)
+{
+       int i;
+       for (i = 0; i < ubinaries_num; ++i) {
+               UnmanagedSymbol *ubin = ubinaries [i];
+               if (addr >= ubin->addr && addr < ubin->addr + ubin->size) {
+                       return ubin;
+               }
+       }
+       return NULL;
+}
+
+static const char*
+sample_type_name (int type)
+{
+       switch (type) {
+       case SAMPLE_CYCLES: return "cycles";
+       case SAMPLE_INSTRUCTIONS: return "instructions retired";
+       case SAMPLE_CACHE_MISSES: return "cache misses";
+       case SAMPLE_CACHE_REFS: return "cache references";
+       case SAMPLE_BRANCHES: return "executed branches";
+       case SAMPLE_BRANCH_MISSES: return "unpredicted branches";
+       }
+       return "unknown";
+}
+
+static void
+set_usym_parent (UnmanagedSymbol** cachedus, int count)
+{
+       int i;
+       for (i = 0; i < count; ++i) {
+               UnmanagedSymbol *ubin = lookup_unmanaged_binary (cachedus [i]->addr);
+               if (ubin == cachedus [i])
+                       continue;
+               cachedus [i]->parent = ubin;
+       }
+}
+
+static void
+print_usym (UnmanagedSymbol* um)
+{
+       if (um->parent)
+               fprintf (outfile, "\t%6zd %6.2f %-36s in %s\n", um->sample_hits, um->sample_hits*100.0/num_stat_samples, um->name, um->parent->name);
+       else
+               fprintf (outfile, "\t%6zd %6.2f %s\n", um->sample_hits, um->sample_hits*100.0/num_stat_samples, um->name);
+}
+
+static int
+sym_percent (uintptr_t sample_hits)
+{
+       double pc;
+       if (verbose)
+               return 1;
+       pc = sample_hits*100.0/num_stat_samples;
+       return pc >= 0.1;
+}
+
+static void
+dump_samples (void)
+{
+       int i, u;
+       int count = 0, msize = 0;
+       int unmanaged_hits = 0;
+       int unresolved_hits = 0;
+       MethodDesc** cachedm = NULL;
+       int ucount = 0, usize = 0;
+       UnmanagedSymbol** cachedus = NULL;
+       if (!num_stat_samples)
+               return;
+       qsort (usymbols, usymbols_num, sizeof (UnmanagedSymbol*), compare_usymbol_addr);
+       for (i = 0; i < num_stat_samples; ++i) {
+               MethodDesc *m = lookup_method_by_ip (stat_samples [i]);
+               if (m) {
+                       if (!m->sample_hits) {
+                               if (count == msize) {
+                                       msize *= 2;
+                                       if (!msize)
+                                               msize = 4;
+                                       cachedm = (MethodDesc **) g_realloc (cachedm, sizeof (void*) * msize);
+                               }
+                               cachedm [count++] = m;
+                       }
+                       m->sample_hits++;
+               } else {
+                       UnmanagedSymbol *usym = lookup_unmanaged_symbol (stat_samples [i]);
+                       if (!usym) {
+                               unresolved_hits++;
+                               //printf ("unmanaged hit at %p\n", (void*)stat_samples [i]);
+                               usym = lookup_unmanaged_binary (stat_samples [i]);
+                       }
+                       if (usym) {
+                               if (!usym->sample_hits) {
+                                       if (ucount == usize) {
+                                               usize *= 2;
+                                               if (!usize)
+                                                       usize = 4;
+                                               cachedus = (UnmanagedSymbol **) g_realloc (cachedus, sizeof (void*) * usize);
+                                       }
+                                       cachedus [ucount++] = usym;
+                               }
+                               usym->sample_hits++;
+                       }
+                       unmanaged_hits++;
+               }
+       }
+       qsort (cachedm, count, sizeof (MethodDesc*), compare_method_samples);
+       qsort (cachedus, ucount, sizeof (UnmanagedSymbol*), compare_usymbol_samples);
+       set_usym_parent (cachedus, ucount);
+       fprintf (outfile, "\nStatistical samples summary\n");
+       fprintf (outfile, "\tSample type: %s\n", sample_type_name (stat_sample_desc [0]));
+       fprintf (outfile, "\tUnmanaged hits:  %6d (%4.1f%%)\n", unmanaged_hits, (100.0*unmanaged_hits)/num_stat_samples);
+       fprintf (outfile, "\tManaged hits:    %6d (%4.1f%%)\n", num_stat_samples - unmanaged_hits, (100.0*(num_stat_samples-unmanaged_hits))/num_stat_samples);
+       fprintf (outfile, "\tUnresolved hits: %6d (%4.1f%%)\n", unresolved_hits, (100.0*unresolved_hits)/num_stat_samples);
+       fprintf (outfile, "\t%6s %6s %s\n", "Hits", "%", "Method name");
+       i = 0;
+       u = 0;
+       while (i < count || u < ucount) {
+               if (i < count) {
+                       MethodDesc *m = cachedm [i];
+                       if (u < ucount) {
+                               UnmanagedSymbol *um = cachedus [u];
+                               if (um->sample_hits > m->sample_hits) {
+                                       if (!sym_percent (um->sample_hits))
+                                               break;
+                                       print_usym (um);
+                                       u++;
+                                       continue;
+                               }
+                       }
+                       if (!sym_percent (m->sample_hits))
+                               break;
+                       fprintf (outfile, "\t%6d %6.2f %s\n", m->sample_hits, m->sample_hits*100.0/num_stat_samples, m->name);
+                       i++;
+                       continue;
+               }
+               if (u < ucount) {
+                       UnmanagedSymbol *um = cachedus [u];
+                       if (!sym_percent (um->sample_hits))
+                               break;
+                       print_usym (um);
+                       u++;
+                       continue;
+               }
+       }
+}
+
+typedef struct _HeapClassDesc HeapClassDesc;
+typedef struct {
+       HeapClassDesc *klass;
+       uint64_t count;
+} HeapClassRevRef;
+
+struct _HeapClassDesc {
+       ClassDesc *klass;
+       int64_t count;
+       int64_t total_size;
+       HeapClassRevRef *rev_hash;
+       int rev_hash_size;
+       int rev_count;
+       uintptr_t pinned_references;
+       uintptr_t root_references;
+};
+
+static int
+add_rev_class_hashed (HeapClassRevRef *rev_hash, uintptr_t size, HeapClassDesc *hklass, uint64_t value)
+{
+       uintptr_t i;
+       uintptr_t start_pos;
+       start_pos = (hklass->klass->klass >> 2) % size;
+       assert (start_pos < size);
+       i = start_pos;
+       do {
+               if (rev_hash [i].klass == hklass) {
+                       rev_hash [i].count += value;
+                       return 0;
+               } else if (!rev_hash [i].klass) {
+                       rev_hash [i].klass = hklass;
+                       rev_hash [i].count += value;
+                       start_pos = 0;
+                       for (i = 0; i < size; ++i)
+                               if (rev_hash [i].klass && rev_hash [i].klass->klass == hklass->klass)
+                                       start_pos ++;
+                       assert (start_pos == 1);
+                       return 1;
+               }
+               /* wrap around */
+               if (++i == size)
+                       i = 0;
+       } while (i != start_pos);
+       /* should not happen */
+       printf ("failed revref store\n");
+       return 0;
+}
+
+static void
+add_heap_class_rev (HeapClassDesc *from, HeapClassDesc *to)
+{
+       uintptr_t i;
+       if (to->rev_count * 2 >= to->rev_hash_size) {
+               HeapClassRevRef *n;
+               uintptr_t old_size = to->rev_hash_size;
+               to->rev_hash_size *= 2;
+               if (to->rev_hash_size == 0)
+                       to->rev_hash_size = 4;
+               n = (HeapClassRevRef *) g_calloc (sizeof (HeapClassRevRef) * to->rev_hash_size, 1);
+               for (i = 0; i < old_size; ++i) {
+                       if (to->rev_hash [i].klass)
+                               add_rev_class_hashed (n, to->rev_hash_size, to->rev_hash [i].klass, to->rev_hash [i].count);
+               }
+               if (to->rev_hash)
+                       g_free (to->rev_hash);
+               to->rev_hash = n;
+       }
+       to->rev_count += add_rev_class_hashed (to->rev_hash, to->rev_hash_size, from, 1);
+}
+
+typedef struct {
+       uintptr_t objaddr;
+       HeapClassDesc *hklass;
+       uintptr_t num_refs;
+       uintptr_t refs [0];
+} HeapObjectDesc;
+
+typedef struct _HeapShot HeapShot;
+struct _HeapShot {
+       HeapShot *next;
+       uint64_t timestamp;
+       int class_count;
+       int hash_size;
+       HeapClassDesc **class_hash;
+       HeapClassDesc **sorted;
+       HeapObjectDesc **objects_hash;
+       uintptr_t objects_count;
+       uintptr_t objects_hash_size;
+       uintptr_t num_roots;
+       uintptr_t *roots;
+       uintptr_t *roots_extra;
+       int *roots_types;
+};
+
+static HeapShot *heap_shots = NULL;
+static int num_heap_shots = 0;
+
+static HeapShot*
+new_heap_shot (uint64_t timestamp)
+{
+       HeapShot *hs = (HeapShot *) g_calloc (sizeof (HeapShot), 1);
+       hs->hash_size = 4;
+       hs->class_hash = (HeapClassDesc **) g_calloc (sizeof (void*), hs->hash_size);
+       hs->timestamp = timestamp;
+       num_heap_shots++;
+       hs->next = heap_shots;
+       heap_shots = hs;
+       return hs;
+}
+
+static HeapClassDesc*
+heap_class_lookup (HeapShot *hs, ClassDesc *klass)
+{
+       int i;
+       unsigned int start_pos;
+       start_pos = ((uintptr_t)klass->klass >> 2) % hs->hash_size;
+       i = start_pos;
+       do {
+               HeapClassDesc* cd = hs->class_hash [i];
+               if (!cd)
+                       return NULL;
+               if (cd->klass == klass)
+                       return cd;
+               /* wrap around */
+               if (++i == hs->hash_size)
+                       i = 0;
+       } while (i != start_pos);
+       return NULL;
+}
+
+static int
+add_heap_hashed (HeapClassDesc **hash, HeapClassDesc **retv, uintptr_t hsize, ClassDesc *klass, uint64_t size, uint64_t count)
+{
+       uintptr_t i;
+       uintptr_t start_pos;
+       start_pos = ((uintptr_t)klass->klass >> 2) % hsize;
+       i = start_pos;
+       do {
+               if (hash [i] && hash [i]->klass == klass) {
+                       hash [i]->total_size += size;
+                       hash [i]->count += count;
+                       *retv = hash [i];
+                       return 0;
+               } else if (!hash [i]) {
+                       if (*retv) {
+                               hash [i] = *retv;
+                               return 1;
+                       }
+                       hash [i] = (HeapClassDesc *) g_calloc (sizeof (HeapClassDesc), 1);
+                       hash [i]->klass = klass;
+                       hash [i]->total_size += size;
+                       hash [i]->count += count;
+                       *retv = hash [i];
+                       return 1;
+               }
+               /* wrap around */
+               if (++i == hsize)
+                       i = 0;
+       } while (i != start_pos);
+       /* should not happen */
+       printf ("failed heap class store\n");
+       return 0;
+}
+
+static HeapClassDesc*
+add_heap_shot_class (HeapShot *hs, ClassDesc *klass, uint64_t size)
+{
+       HeapClassDesc *res;
+       int i;
+       if (hs->class_count * 2 >= hs->hash_size) {
+               HeapClassDesc **n;
+               int old_size = hs->hash_size;
+               hs->hash_size *= 2;
+               if (hs->hash_size == 0)
+                       hs->hash_size = 4;
+               n = (HeapClassDesc **) g_calloc (sizeof (void*) * hs->hash_size, 1);
+               for (i = 0; i < old_size; ++i) {
+                       res = hs->class_hash [i];
+                       if (hs->class_hash [i])
+                               add_heap_hashed (n, &res, hs->hash_size, hs->class_hash [i]->klass, hs->class_hash [i]->total_size, hs->class_hash [i]->count);
+               }
+               if (hs->class_hash)
+                       g_free (hs->class_hash);
+               hs->class_hash = n;
+       }
+       res = NULL;
+       hs->class_count += add_heap_hashed (hs->class_hash, &res, hs->hash_size, klass, size, 1);
+       //if (res->count == 1)
+       //      printf ("added heap class: %s\n", res->klass->name);
+       return res;
+}
+
+static HeapObjectDesc*
+alloc_heap_obj (uintptr_t objaddr, HeapClassDesc *hklass, uintptr_t num_refs)
+{
+       HeapObjectDesc* ho = (HeapObjectDesc *) g_calloc (sizeof (HeapObjectDesc) + num_refs * sizeof (uintptr_t), 1);
+       ho->objaddr = objaddr;
+       ho->hklass = hklass;
+       ho->num_refs = num_refs;
+       return ho;
+}
+
+static uintptr_t
+heap_shot_find_obj_slot (HeapShot *hs, uintptr_t objaddr)
+{
+       uintptr_t i;
+       uintptr_t start_pos;
+       HeapObjectDesc **hash = hs->objects_hash;
+       start_pos = ((uintptr_t)objaddr >> 3) % hs->objects_hash_size;
+       i = start_pos;
+       do {
+               if (hash [i] && hash [i]->objaddr == objaddr) {
+                       return i;
+               } else if (!hash [i]) {
+                       break; /* fail */
+               }
+               /* wrap around */
+               if (++i == hs->objects_hash_size)
+                       i = 0;
+       } while (i != start_pos);
+       /* should not happen */
+       //printf ("failed heap obj slot\n");
+       return -1;
+}
+
+static HeapObjectDesc*
+heap_shot_obj_add_refs (HeapShot *hs, uintptr_t objaddr, uintptr_t num, uintptr_t *ref_offset)
+{
+       HeapObjectDesc **hash = hs->objects_hash;
+       uintptr_t i = heap_shot_find_obj_slot (hs, objaddr);
+       if (i >= 0) {
+               HeapObjectDesc* ho = alloc_heap_obj (objaddr, hash [i]->hklass, hash [i]->num_refs + num);
+               *ref_offset = hash [i]->num_refs;
+               memcpy (ho->refs, hash [i]->refs, hash [i]->num_refs * sizeof (uintptr_t));
+               g_free (hash [i]);
+               hash [i] = ho;
+               return ho;
+       }
+       /* should not happen */
+       printf ("failed heap obj update\n");
+       return NULL;
+
+}
+
+static uintptr_t
+add_heap_hashed_obj (HeapObjectDesc **hash, uintptr_t hsize, HeapObjectDesc *obj)
+{
+       uintptr_t i;
+       uintptr_t start_pos;
+       start_pos = ((uintptr_t)obj->objaddr >> 3) % hsize;
+       i = start_pos;
+       do {
+               if (hash [i] && hash [i]->objaddr == obj->objaddr) {
+                       printf ("duplicate object!\n");
+                       return 0;
+               } else if (!hash [i]) {
+                       hash [i] = obj;
+                       return 1;
+               }
+               /* wrap around */
+               if (++i == hsize)
+                       i = 0;
+       } while (i != start_pos);
+       /* should not happen */
+       printf ("failed heap obj store\n");
+       return 0;
+}
+
+static void
+add_heap_shot_obj (HeapShot *hs, HeapObjectDesc *obj)
+{
+       uintptr_t i;
+       if (hs->objects_count * 2 >= hs->objects_hash_size) {
+               HeapObjectDesc **n;
+               uintptr_t old_size = hs->objects_hash_size;
+               hs->objects_hash_size *= 2;
+               if (hs->objects_hash_size == 0)
+                       hs->objects_hash_size = 4;
+               n = (HeapObjectDesc **) g_calloc (sizeof (void*) * hs->objects_hash_size, 1);
+               for (i = 0; i < old_size; ++i) {
+                       if (hs->objects_hash [i])
+                               add_heap_hashed_obj (n, hs->objects_hash_size, hs->objects_hash [i]);
+               }
+               if (hs->objects_hash)
+                       g_free (hs->objects_hash);
+               hs->objects_hash = n;
+       }
+       hs->objects_count += add_heap_hashed_obj (hs->objects_hash, hs->objects_hash_size, obj);
+}
+
+static void
+heap_shot_resolve_reverse_refs (HeapShot *hs)
+{
+       uintptr_t i;
+       for (i = 0; i < hs->objects_hash_size; ++i) {
+               uintptr_t r;
+               HeapObjectDesc *ho = hs->objects_hash [i];
+               if (!ho)
+                       continue;
+               for (r = 0; r < ho->num_refs; ++r) {
+                       uintptr_t oi = heap_shot_find_obj_slot (hs, ho->refs [r]);
+                       add_heap_class_rev (ho->hklass, hs->objects_hash [oi]->hklass);
+               }
+       }
+}
+
+#define MARK_GRAY 1
+#define MARK_BLACK 2
+
+static void
+heap_shot_mark_objects (HeapShot *hs)
+{
+       uintptr_t i, oi, r;
+       unsigned char *marks;
+       HeapObjectDesc *obj, *ref;
+       int marked_some;
+       uintptr_t num_marked = 0, num_unmarked;
+       for (i = 0; i < hs->num_roots; ++i) {
+               HeapClassDesc *cd;
+               oi = heap_shot_find_obj_slot (hs, hs->roots [i]);
+               if (oi == -1) {
+                       continue;
+               }
+               obj = hs->objects_hash [oi];
+               cd = obj->hklass;
+               if (hs->roots_types [i] & MONO_PROFILE_GC_ROOT_PINNING)
+                       cd->pinned_references++;
+               cd->root_references++;
+       }
+       if (!debug)
+               return;
+       /* consistency checks: it seems not all the objects are walked in the heap in some cases */
+       marks = (unsigned char *) g_calloc (hs->objects_hash_size, 1);
+       if (!marks)
+               return;
+       for (i = 0; i < hs->num_roots; ++i) {
+               oi = heap_shot_find_obj_slot (hs, hs->roots [i]);
+               if (oi == -1) {
+                       fprintf (outfile, "root type 0x%x for obj %p (%s) not found in heap\n", hs->roots_types [i], (void*)hs->roots [i], lookup_class (hs->roots_extra [i])->name);
+                       continue;
+               }
+               obj = hs->objects_hash [oi];
+               if (!marks [oi]) {
+                       marks [oi] = obj->num_refs? MARK_GRAY: MARK_BLACK;
+                       num_marked++;
+               }
+       }
+       marked_some = 1;
+       while (marked_some) {
+               marked_some = 0;
+               for (i = 0; i < hs->objects_hash_size; ++i) {
+                       if (marks [i] != MARK_GRAY)
+                               continue;
+                       marks [i] = MARK_BLACK;
+                       obj = hs->objects_hash [i];
+                       for (r = 0; r < obj->num_refs; ++r) {
+                               oi = heap_shot_find_obj_slot (hs, obj->refs [r]);
+                               if (oi == -1) {
+                                       fprintf (outfile, "referenced obj %p not found in heap\n", (void*)obj->refs [r]);
+                                       continue;
+                               }
+                               ref = hs->objects_hash [oi];
+                               if (!marks [oi]) {
+                                       marks [oi] = ref->num_refs? MARK_GRAY: MARK_BLACK;
+                               }
+                       }
+                       marked_some++;
+               }
+       }
+
+       num_unmarked = 0;
+       for (i = 0; i < hs->objects_hash_size; ++i) {
+               if (hs->objects_hash [i] && !marks [i]) {
+                       num_unmarked++;
+                       fprintf (outfile, "object %p (%s) unmarked\n", (void*)hs->objects_hash [i], hs->objects_hash [i]->hklass->klass->name);
+               }
+       }
+       fprintf (outfile, "Total unmarked: %zd/%zd\n", num_unmarked, hs->objects_count);
+       g_free (marks);
+}
+
+static void
+heap_shot_free_objects (HeapShot *hs)
+{
+       uintptr_t i;
+       for (i = 0; i < hs->objects_hash_size; ++i) {
+               HeapObjectDesc *ho = hs->objects_hash [i];
+               if (ho)
+                       g_free (ho);
+       }
+       if (hs->objects_hash)
+               g_free (hs->objects_hash);
+       hs->objects_hash = NULL;
+       hs->objects_hash_size = 0;
+       hs->objects_count = 0;
+}
+
+
+struct _BackTrace {
+       BackTrace *next;
+       unsigned int hash;
+       int count;
+       int id;
+       MethodDesc *methods [1];
+};
+
+static BackTrace *backtrace_hash [HASH_SIZE];
+static BackTrace **backtraces = NULL;
+static int num_backtraces = 0;
+static int next_backtrace = 0;
+
+static int
+hash_backtrace (int count, MethodDesc **methods)
+{
+       int hash = count;
+       int i;
+       for (i = 0; i < count; ++i) {
+               hash = (hash << 5) - hash + methods [i]->method;
+       }
+       return hash;
+}
+
+static int
+compare_backtrace (BackTrace *bt, int count, MethodDesc **methods)
+{
+       int i;
+       if (bt->count != count)
+               return 0;
+       for (i = 0; i < count; ++i)
+               if (methods [i] != bt->methods [i])
+                       return 0;
+       return 1;
+}
+
+static BackTrace*
+add_backtrace (int count, MethodDesc **methods)
+{
+       int hash = hash_backtrace (count, methods);
+       int slot = (hash & 0xffff) % HASH_SIZE;
+       BackTrace *bt = backtrace_hash [slot];
+       while (bt) {
+               if (bt->hash == hash && compare_backtrace (bt, count, methods))
+                       return bt;
+               bt = bt->next;
+       }
+       bt = (BackTrace *) g_malloc (sizeof (BackTrace) + ((count - 1) * sizeof (void*)));
+       bt->next = backtrace_hash [slot];
+       backtrace_hash [slot] = bt;
+       if (next_backtrace == num_backtraces) {
+               num_backtraces *= 2;
+               if (!num_backtraces)
+                       num_backtraces = 16;
+               backtraces = (BackTrace **) g_realloc (backtraces, sizeof (void*) * num_backtraces);
+       }
+       bt->id = next_backtrace++;
+       backtraces [bt->id] = bt;
+       bt->count = count;
+       bt->hash = hash;
+       for (slot = 0; slot < count; ++slot)
+               bt->methods [slot] = methods [slot];
+
+       return bt;
+}
+
+typedef struct _MonitorDesc MonitorDesc;
+typedef struct _ThreadContext ThreadContext;
+typedef struct _DomainContext DomainContext;
+typedef struct _RemCtxContext RemCtxContext;
+
+typedef struct {
+       FILE *file;
+#if defined (HAVE_SYS_ZLIB)
+       gzFile gzfile;
+#endif
+       unsigned char *buf;
+       int size;
+       int data_version;
+       int version_major;
+       int version_minor;
+       int timer_overhead;
+       int pid;
+       int port;
+       char *args;
+       char *arch;
+       char *os;
+       uint64_t startup_time;
+       ThreadContext *threads;
+       ThreadContext *current_thread;
+       DomainContext *domains;
+       DomainContext *current_domain;
+       RemCtxContext *remctxs;
+       RemCtxContext *current_remctx;
+} ProfContext;
+
+struct _ThreadContext {
+       ThreadContext *next;
+       intptr_t thread_id;
+       char *name;
+       /* emulated stack */
+       MethodDesc **stack;
+       uint64_t *time_stack;
+       uint64_t *callee_time_stack;
+       uint64_t last_time;
+       uint64_t contention_start;
+       MonitorDesc *monitor;
+       int stack_size;
+       int stack_id;
+       HeapShot *current_heap_shot;
+       uintptr_t num_roots;
+       uintptr_t size_roots;
+       uintptr_t *roots;
+       uintptr_t *roots_extra;
+       int *roots_types;
+       uint64_t gc_start_times [3];
+};
+
+struct _DomainContext {
+       DomainContext *next;
+       intptr_t domain_id;
+       const char *friendly_name;
+};
+
+struct _RemCtxContext {
+       RemCtxContext *next;
+       intptr_t remctx_id;
+       intptr_t domain_id;
+};
+
+static void
+ensure_buffer (ProfContext *ctx, int size)
+{
+       if (ctx->size < size) {
+               ctx->buf = (unsigned char *) g_realloc (ctx->buf, size);
+               ctx->size = size;
+       }
+}
+
+static int
+load_data (ProfContext *ctx, int size)
+{
+       ensure_buffer (ctx, size);
+#if defined (HAVE_SYS_ZLIB)
+       if (ctx->gzfile) {
+               int r = gzread (ctx->gzfile, ctx->buf, size);
+               if (r == 0)
+                       return size == 0? 1: 0;
+               return r == size;
+       } else
+#endif
+       {
+               int r = fread (ctx->buf, size, 1, ctx->file);
+               if (r == 0)
+                       return size == 0? 1: 0;
+               return r;
+       }
+}
+
+static ThreadContext*
+get_thread (ProfContext *ctx, intptr_t thread_id)
+{
+       ThreadContext *thread;
+       if (ctx->current_thread && ctx->current_thread->thread_id == thread_id)
+               return ctx->current_thread;
+       thread = ctx->threads;
+       while (thread) {
+               if (thread->thread_id == thread_id) {
+                       return thread;
+               }
+               thread = thread->next;
+       }
+       thread = (ThreadContext *) g_calloc (sizeof (ThreadContext), 1);
+       thread->next = ctx->threads;
+       ctx->threads = thread;
+       thread->thread_id = thread_id;
+       thread->last_time = 0;
+       thread->stack_id = 0;
+       thread->stack_size = 32;
+       thread->stack = (MethodDesc **) g_malloc (thread->stack_size * sizeof (void*));
+       thread->time_stack = (uint64_t *) g_malloc (thread->stack_size * sizeof (uint64_t));
+       thread->callee_time_stack = (uint64_t *) g_malloc (thread->stack_size * sizeof (uint64_t));
+       return thread;
+}
+
+static DomainContext *
+get_domain (ProfContext *ctx, intptr_t domain_id)
+{
+       if (ctx->current_domain && ctx->current_domain->domain_id == domain_id)
+               return ctx->current_domain;
+
+       DomainContext *domain = ctx->domains;
+
+       while (domain) {
+               if (domain->domain_id == domain_id)
+                       return domain;
+
+               domain = domain->next;
+       }
+
+       domain = (DomainContext *) g_calloc (sizeof (DomainContext), 1);
+       domain->next = ctx->domains;
+       ctx->domains = domain;
+       domain->domain_id = domain_id;
+
+       return domain;
+}
+
+static RemCtxContext *
+get_remctx (ProfContext *ctx, intptr_t remctx_id)
+{
+       if (ctx->current_remctx && ctx->current_remctx->remctx_id == remctx_id)
+               return ctx->current_remctx;
+
+       RemCtxContext *remctx = ctx->remctxs;
+
+       while (remctx) {
+               if (remctx->remctx_id == remctx_id)
+                       return remctx;
+
+               remctx = remctx->next;
+       }
+
+       remctx = (RemCtxContext *) g_calloc (sizeof (RemCtxContext), 1);
+       remctx->next = ctx->remctxs;
+       ctx->remctxs = remctx;
+       remctx->remctx_id = remctx_id;
+
+       return remctx;
+}
+
+static ThreadContext*
+load_thread (ProfContext *ctx, intptr_t thread_id)
+{
+       ThreadContext *thread = get_thread (ctx, thread_id);
+       ctx->current_thread = thread;
+       return thread;
+}
+
+static void
+ensure_thread_stack (ThreadContext *thread)
+{
+       if (thread->stack_id == thread->stack_size) {
+               thread->stack_size *= 2;
+               thread->stack = (MethodDesc **) g_realloc (thread->stack, thread->stack_size * sizeof (void*));
+               thread->time_stack = (uint64_t *) g_realloc (thread->time_stack, thread->stack_size * sizeof (uint64_t));
+               thread->callee_time_stack = (uint64_t *) g_realloc (thread->callee_time_stack, thread->stack_size * sizeof (uint64_t));
+       }
+}
+
+static int
+add_trace_hashed (CallContext *traces, int size, BackTrace *bt, uint64_t value)
+{
+       int i;
+       unsigned int start_pos;
+       start_pos = bt->hash % size;
+       i = start_pos;
+       do {
+               if (traces [i].bt == bt) {
+                       traces [i].count += value;
+                       return 0;
+               } else if (!traces [i].bt) {
+                       traces [i].bt = bt;
+                       traces [i].count += value;
+                       return 1;
+               }
+               /* wrap around */
+               if (++i == size)
+                       i = 0;
+       } while (i != start_pos);
+       /* should not happen */
+       printf ("failed trace store\n");
+       return 0;
+}
+
+static void
+add_trace_bt (BackTrace *bt, TraceDesc *trace, uint64_t value)
+{
+       int i;
+       if (!collect_traces)
+               return;
+       if (trace->count * 2 >= trace->size) {
+               CallContext *n;
+               int old_size = trace->size;
+               trace->size *= 2;
+               if (trace->size == 0)
+                       trace->size = 4;
+               n = (CallContext *) g_calloc (sizeof (CallContext) * trace->size, 1);
+               for (i = 0; i < old_size; ++i) {
+                       if (trace->traces [i].bt)
+                               add_trace_hashed (n, trace->size, trace->traces [i].bt, trace->traces [i].count);
+               }
+               if (trace->traces)
+                       g_free (trace->traces);
+               trace->traces = n;
+       }
+       trace->count += add_trace_hashed (trace->traces, trace->size, bt, value);
+}
+
+static BackTrace*
+add_trace_thread (ThreadContext *thread, TraceDesc *trace, uint64_t value)
+{
+       BackTrace *bt;
+       int count = thread->stack_id;
+       if (!collect_traces)
+               return NULL;
+       if (count > trace_max)
+               count = trace_max;
+       bt = add_backtrace (count, thread->stack + thread->stack_id - count);
+       add_trace_bt (bt, trace, value);
+       return bt;
+}
+
+static BackTrace*
+add_trace_methods (MethodDesc **methods, int count, TraceDesc *trace, uint64_t value)
+{
+       BackTrace *bt;
+       if (!collect_traces)
+               return NULL;
+       if (count > trace_max)
+               count = trace_max;
+       bt = add_backtrace (count, methods);
+       add_trace_bt (bt, trace, value);
+       return bt;
+}
+
+static void
+thread_add_root (ThreadContext *ctx, uintptr_t obj, int root_type, uintptr_t extra_info)
+{
+       if (ctx->num_roots == ctx->size_roots) {
+               int new_size = ctx->size_roots * 2;
+               if (!new_size)
+                       new_size = 4;
+               ctx->roots = (uintptr_t *) g_realloc (ctx->roots, new_size * sizeof (uintptr_t));
+               ctx->roots_extra = (uintptr_t *) g_realloc (ctx->roots_extra, new_size * sizeof (uintptr_t));
+               ctx->roots_types = (int *) g_realloc (ctx->roots_types, new_size * sizeof (int));
+               ctx->size_roots = new_size;
+       }
+       ctx->roots_types [ctx->num_roots] = root_type;
+       ctx->roots_extra [ctx->num_roots] = extra_info;
+       ctx->roots [ctx->num_roots++] = obj;
+}
+
+static int
+compare_callc (const void *a, const void *b)
+{
+       const CallContext *A = (const CallContext *)a;
+       const CallContext *B = (const CallContext *)b;
+       if (B->count == A->count)
+               return 0;
+       if (B->count < A->count)
+               return -1;
+       return 1;
+}
+
+static void
+sort_context_array (TraceDesc* traces)
+{
+       int i, j;
+       for (i = 0, j = 0; i < traces->size; ++i) {
+               if (traces->traces [i].bt) {
+                       traces->traces [j].bt = traces->traces [i].bt;
+                       traces->traces [j].count = traces->traces [i].count;
+                       j++;
+               }
+       }
+       qsort (traces->traces, traces->count, sizeof (CallContext), compare_callc);
+}
+
+static void
+push_method (ThreadContext *thread, MethodDesc *method, uint64_t timestamp)
+{
+       ensure_thread_stack (thread);
+       thread->time_stack [thread->stack_id] = timestamp;
+       thread->callee_time_stack [thread->stack_id] = 0;
+       thread->stack [thread->stack_id++] = method;
+       method->recurse_count++;
+}
+
+static void
+pop_method (ThreadContext *thread, MethodDesc *method, uint64_t timestamp)
+{
+       method->recurse_count--;
+       if (thread->stack_id > 0 && thread->stack [thread->stack_id - 1] == method) {
+               uint64_t tdiff;
+               thread->stack_id--;
+               method->calls++;
+               if (timestamp < thread->time_stack [thread->stack_id])
+                       fprintf (outfile, "time went backwards for %s\n", method->name);
+               tdiff = timestamp - thread->time_stack [thread->stack_id];
+               if (thread->callee_time_stack [thread->stack_id] > tdiff)
+                       fprintf (outfile, "callee time bigger for %s\n", method->name);
+               method->self_time += tdiff - thread->callee_time_stack [thread->stack_id];
+               method->callee_time += thread->callee_time_stack [thread->stack_id];
+               if (thread->stack_id)
+                       thread->callee_time_stack [thread->stack_id - 1] += tdiff;
+               //fprintf (outfile, "method %s took %d\n", method->name, (int)(tdiff/1000));
+       } else {
+               fprintf (outfile, "unmatched leave at stack pos: %d for method %s\n", thread->stack_id, method->name);
+       }
+}
+
+typedef struct {
+       uint64_t total_time;
+       uint64_t max_time;
+       int count;
+} GCDesc;
+static GCDesc gc_info [3];
+static uint64_t max_heap_size;
+static uint64_t gc_object_moves;
+static int gc_resizes;
+typedef struct {
+       uint64_t created;
+       uint64_t destroyed;
+       uint64_t live;
+       uint64_t max_live;
+       TraceDesc traces;
+       TraceDesc destroy_traces;
+} HandleInfo;
+static HandleInfo handle_info [4];
+
+static const char*
+gc_event_name (int ev)
+{
+       switch (ev) {
+       case MONO_GC_EVENT_START: return "start";
+       case MONO_GC_EVENT_MARK_START: return "mark start";
+       case MONO_GC_EVENT_MARK_END: return "mark end";
+       case MONO_GC_EVENT_RECLAIM_START: return "reclaim start";
+       case MONO_GC_EVENT_RECLAIM_END: return "reclaim end";
+       case MONO_GC_EVENT_END: return "end";
+       case MONO_GC_EVENT_PRE_STOP_WORLD: return "pre stop";
+       case MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED: return "pre stop lock";
+       case MONO_GC_EVENT_POST_STOP_WORLD: return "post stop";
+       case MONO_GC_EVENT_PRE_START_WORLD: return "pre start";
+       case MONO_GC_EVENT_POST_START_WORLD: return "post start";
+       case MONO_GC_EVENT_POST_START_WORLD_UNLOCKED: return "post start unlock";
+       default:
+               return "unknown";
+       }
+}
+
+static const char*
+sync_point_name (int type)
+{
+       switch (type) {
+       case SYNC_POINT_PERIODIC: return "periodic";
+       case SYNC_POINT_WORLD_STOP: return "world stop";
+       case SYNC_POINT_WORLD_START: return "world start";
+       default:
+               return "unknown";
+       }
+}
+
+static uint64_t clause_summary [MONO_EXCEPTION_CLAUSE_FAULT + 1];
+static uint64_t throw_count = 0;
+static TraceDesc exc_traces;
+
+static const char*
+clause_name (int type)
+{
+       switch (type) {
+       case MONO_EXCEPTION_CLAUSE_NONE: return "catch";
+       case MONO_EXCEPTION_CLAUSE_FILTER: return "filter";
+       case MONO_EXCEPTION_CLAUSE_FINALLY: return "finally";
+       case MONO_EXCEPTION_CLAUSE_FAULT: return "fault";
+       default: return "invalid";
+       }
+}
+
+static uint64_t monitor_contention;
+static uint64_t monitor_failed;
+static uint64_t monitor_acquired;
+
+struct _MonitorDesc {
+       MonitorDesc *next;
+       uintptr_t objid;
+       uintptr_t contentions;
+       uint64_t wait_time;
+       uint64_t max_wait_time;
+       TraceDesc traces;
+};
+
+static MonitorDesc* monitor_hash [SMALL_HASH_SIZE] = {0};
+static int num_monitors = 0;
+
+static MonitorDesc*
+lookup_monitor (uintptr_t objid)
+{
+       int slot = ((objid >> 3) & 0xffff) % SMALL_HASH_SIZE;
+       MonitorDesc *cd = monitor_hash [slot];
+       while (cd && cd->objid != objid)
+               cd = cd->next;
+       if (!cd) {
+               cd = (MonitorDesc *) g_calloc (sizeof (MonitorDesc), 1);
+               cd->objid = objid;
+               cd->next = monitor_hash [slot];
+               monitor_hash [slot] = cd;
+               num_monitors++;
+       }
+       return cd;
+}
+
+static const char*
+monitor_ev_name (int ev)
+{
+       switch (ev) {
+       case MONO_PROFILER_MONITOR_CONTENTION: return "contended";
+       case MONO_PROFILER_MONITOR_DONE: return "acquired";
+       case MONO_PROFILER_MONITOR_FAIL: return "not taken";
+       default: return "invalid";
+       }
+}
+
+static const char*
+get_handle_name (int htype)
+{
+       switch (htype) {
+       case 0: return "weak";
+       case 1: return "weaktrack";
+       case 2: return "normal";
+       case 3: return "pinned";
+       default: return "unknown";
+       }
+}
+
+static const char*
+get_root_name (int rtype)
+{
+       switch (rtype & MONO_PROFILE_GC_ROOT_TYPEMASK) {
+       case MONO_PROFILE_GC_ROOT_STACK: return "stack";
+       case MONO_PROFILE_GC_ROOT_FINALIZER: return "finalizer";
+       case MONO_PROFILE_GC_ROOT_HANDLE: return "handle";
+       case MONO_PROFILE_GC_ROOT_OTHER: return "other";
+       case MONO_PROFILE_GC_ROOT_MISC: return "misc";
+       default: return "unknown";
+       }
+}
+
+static uint64_t
+decode_uleb128 (uint8_t *buf, uint8_t **endbuf)
+{
+       uint64_t res = 0;
+       int shift = 0;
+
+       while (1) {
+               uint8_t b = *buf++;
+               res |= (((uint64_t) (b & 0x7f)) << shift);
+
+               if (!(b & 0x80))
+                       break;
+
+               shift += 7;
+       }
+
+       *endbuf = buf;
+
+       return res;
+}
+
+static intptr_t
+decode_sleb128 (uint8_t *buf, uint8_t **endbuf)
+{
+       uint8_t *p = buf;
+       intptr_t res = 0;
+       int shift = 0;
+
+       while (1) {
+               uint8_t b = *p;
+               p++;
+
+               res = res | (((intptr_t) (b & 0x7f)) << shift);
+               shift += 7;
+
+               if (!(b & 0x80)) {
+                       if (shift < sizeof (intptr_t) * 8 && (b & 0x40))
+                               res |= - ((intptr_t) 1 << shift);
+
+                       break;
+               }
+       }
+
+       *endbuf = p;
+
+       return res;
+}
+
+static MethodDesc**
+decode_bt (ProfContext *ctx, MethodDesc** sframes, int *size, unsigned char *p, unsigned char **endp, intptr_t ptr_base, intptr_t *method_base)
+{
+       MethodDesc **frames;
+       int i;
+       if (ctx->data_version < 13)
+               decode_uleb128 (p, &p); /* flags */
+       int count = decode_uleb128 (p, &p);
+       if (count > *size)
+               frames = (MethodDesc **) g_malloc (count * sizeof (void*));
+       else
+               frames = sframes;
+       for (i = 0; i < count; ++i) {
+               intptr_t ptrdiff = decode_sleb128 (p, &p);
+               if (ctx->data_version > 12) {
+                       *method_base += ptrdiff;
+                       frames [i] = lookup_method (*method_base);
+               } else {
+                       frames [i] = lookup_method (ptr_base + ptrdiff);
+               }
+       }
+       *size = count;
+       *endp = p;
+       return frames;
+}
+
+static void
+tracked_creation (uintptr_t obj, ClassDesc *cd, uint64_t size, BackTrace *bt, uint64_t timestamp)
+{
+       int i;
+       for (i = 0; i < num_tracked_objects; ++i) {
+               if (tracked_objects [i] != obj)
+                       continue;
+               fprintf (outfile, "Object %p created (%s, %llu bytes) at %.3f secs.\n", (void*)obj, cd->name, (unsigned long long) size, (timestamp - startup_time)/1000000000.0);
+               if (bt && bt->count) {
+                       int k;
+                       for (k = 0; k < bt->count; ++k)
+                               fprintf (outfile, "\t%s\n", bt->methods [k]->name);
+               }
+       }
+}
+
+static void
+track_handle (uintptr_t obj, int htype, uint32_t handle, BackTrace *bt, uint64_t timestamp)
+{
+       int i;
+       for (i = 0; i < num_tracked_objects; ++i) {
+               if (tracked_objects [i] != obj)
+                       continue;
+               fprintf (outfile, "Object %p referenced from handle %u at %.3f secs.\n", (void*)obj, handle, (timestamp - startup_time) / 1000000000.0);
+               if (bt && bt->count) {
+                       int k;
+                       for (k = 0; k < bt->count; ++k)
+                               fprintf (outfile, "\t%s\n", bt->methods [k]->name);
+               }
+       }
+}
+
+static void
+track_move (uintptr_t src, uintptr_t dst)
+{
+       int i;
+       for (i = 0; i < num_tracked_objects; ++i) {
+               if (tracked_objects [i] == src)
+                       fprintf (outfile, "Object %p moved to %p\n", (void*)src, (void*)dst);
+               else if (tracked_objects [i] == dst)
+                       fprintf (outfile, "Object %p moved from %p\n", (void*)dst, (void*)src);
+       }
+}
+
+static void
+track_obj_reference (uintptr_t obj, uintptr_t parent, ClassDesc *cd)
+{
+       int i;
+       for (i = 0; i < num_tracked_objects; ++i) {
+               if (tracked_objects [i] == obj)
+                       fprintf (outfile, "Object %p referenced from %p (%s).\n", (void*)obj, (void*)parent, cd->name);
+       }
+}
+
+static void
+found_object (uintptr_t obj)
+{
+       num_tracked_objects ++;
+       tracked_objects = (uintptr_t *) g_realloc (tracked_objects, num_tracked_objects * sizeof (tracked_objects [0]));
+       tracked_objects [num_tracked_objects - 1] = obj;
+}
+
+static int num_jit_helpers = 0;
+static int jit_helpers_code_size = 0;
+
+static const char*
+code_buffer_desc (int type)
+{
+       switch (type) {
+       case MONO_PROFILER_CODE_BUFFER_METHOD:
+               return "method";
+       case MONO_PROFILER_CODE_BUFFER_METHOD_TRAMPOLINE:
+               return "method trampoline";
+       case MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE:
+               return "unbox trampoline";
+       case MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE:
+               return "imt trampoline";
+       case MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE:
+               return "generics trampoline";
+       case MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE:
+               return "specific trampoline";
+       case MONO_PROFILER_CODE_BUFFER_HELPER:
+               return "misc helper";
+       case MONO_PROFILER_CODE_BUFFER_MONITOR:
+               return "monitor/lock";
+       case MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE:
+               return "delegate invoke";
+       case MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING:
+               return "exception handling";
+       default:
+               return "unspecified";
+       }
+}
+
+typedef struct _CoverageAssembly CoverageAssembly;
+struct _CoverageAssembly {
+       char *name;
+       char *guid;
+       char *filename;
+       int number_of_methods;
+       int fully_covered;
+       int partially_covered;
+};
+
+typedef struct _CoverageClass CoverageClass;
+struct _CoverageClass {
+       char *assembly_name;
+       char *class_name;
+       int number_of_methods;
+       int fully_covered;
+       int partially_covered;
+};
+
+typedef struct _CoverageCoverage CoverageCoverage;
+struct _CoverageCoverage {
+       int method_id;
+       int offset;
+       int count;
+       int line;
+       int column;
+};
+
+typedef struct _CoverageMethod CoverageMethod;
+struct _CoverageMethod {
+       char *assembly_name;
+       char *class_name;
+       char *method_name;
+       char *method_signature;
+       char *filename;
+       int token;
+       int n_statements;
+       int method_id;
+       GPtrArray *coverage;
+};
+static GPtrArray *coverage_assemblies = NULL;
+static GPtrArray *coverage_methods = NULL;
+static GPtrArray *coverage_statements = NULL;
+static GHashTable *coverage_methods_hash = NULL;
+static GPtrArray *coverage_classes = NULL;
+static GHashTable *coverage_assembly_classes = NULL;
+
+static void
+gather_coverage_statements (void)
+{
+       for (guint i = 0; i < coverage_statements->len; i++) {
+               CoverageCoverage *coverage = (CoverageCoverage *)coverage_statements->pdata[i];
+               CoverageMethod *method = (CoverageMethod *)g_hash_table_lookup (coverage_methods_hash, GINT_TO_POINTER (coverage->method_id));
+               if (method == NULL) {
+                       fprintf (outfile, "Cannot find method with ID: %d\n", coverage->method_id);
+                       continue;
+               }
+
+               g_ptr_array_add (method->coverage, coverage);
+       }
+}
+
+static void
+coverage_add_assembly (CoverageAssembly *assembly)
+{
+       if (coverage_assemblies == NULL)
+               coverage_assemblies = g_ptr_array_new ();
+
+       g_ptr_array_add (coverage_assemblies, assembly);
+}
+
+static void
+coverage_add_method (CoverageMethod *method)
+{
+       if (coverage_methods == NULL) {
+               coverage_methods = g_ptr_array_new ();
+               coverage_methods_hash = g_hash_table_new (NULL, NULL);
+       }
+
+       g_ptr_array_add (coverage_methods, method);
+       g_hash_table_insert (coverage_methods_hash, GINT_TO_POINTER (method->method_id), method);
+}
+
+static void
+coverage_add_class (CoverageClass *klass)
+{
+       GPtrArray *classes = NULL;
+
+       if (coverage_classes == NULL) {
+               coverage_classes = g_ptr_array_new ();
+               coverage_assembly_classes = g_hash_table_new (g_str_hash, g_str_equal);
+       }
+
+       g_ptr_array_add (coverage_classes, klass);
+       classes = (GPtrArray *)g_hash_table_lookup (coverage_assembly_classes, klass->assembly_name);
+       if (classes == NULL) {
+               classes = g_ptr_array_new ();
+               g_hash_table_insert (coverage_assembly_classes, klass->assembly_name, classes);
+       }
+       g_ptr_array_add (classes, klass);
+}
+
+static void
+coverage_add_coverage (CoverageCoverage *coverage)
+{
+       if (coverage_statements == NULL)
+               coverage_statements = g_ptr_array_new ();
+
+       g_ptr_array_add (coverage_statements, coverage);
+}
+
+#define OBJ_ADDR(diff) ((obj_base + diff) << 3)
+#define LOG_TIME(base,diff) /*fprintf("outfile, time %llu + %llu near offset %d\n", base, diff, p - ctx->buf)*/
+
+
+/* Stats */
+#define BUFFER_HEADER_SIZE 48
+
+typedef struct {
+       int count, min_size, max_size, bytes;
+} EventStat;
+
+static int buffer_count;
+static EventStat stats [256];
+
+static void
+record_event_stats (int type, int size)
+{
+       ++stats [type].count;
+       if (!stats [type].min_size)
+               stats [type].min_size = size;
+       stats [type].min_size = MIN (stats [type].min_size, size);
+       stats [type].max_size = MAX (stats [type].max_size, size);
+       stats [type].bytes += size;
+}
+
+static int
+decode_buffer (ProfContext *ctx)
+{
+       unsigned char *p;
+       unsigned char *end;
+       intptr_t thread_id;
+       intptr_t ptr_base;
+       intptr_t obj_base;
+       intptr_t method_base;
+       uint64_t time_base;
+       uint64_t file_offset;
+       int len, i;
+       ThreadContext *thread;
+
+#ifdef HAVE_SYS_ZLIB
+       if (ctx->gzfile)
+               file_offset = gztell (ctx->gzfile);
+       else
+#endif
+               file_offset = ftell (ctx->file);
+       if (!load_data (ctx, 48))
+               return 0;
+       p = ctx->buf;
+       if (read_int32 (p) != BUF_ID) {
+               fprintf (outfile, "Incorrect buffer id: 0x%x\n", read_int32 (p));
+               for (i = 0; i < 48; ++i) {
+                       fprintf (outfile, "0x%x%s", p [i], i % 8?" ":"\n");
+               }
+               return 0;
+       }
+       len = read_int32 (p + 4);
+       time_base = read_int64 (p + 8);
+       ptr_base = read_int64 (p + 16);
+       obj_base = read_int64 (p + 24);
+       thread_id = read_int64 (p + 32);
+       method_base = read_int64 (p + 40);
+       if (debug)
+               fprintf (outfile, "buf: thread:%zx, len: %d, time: %llu, file offset: %llu\n", thread_id, len, (unsigned long long) time_base, (unsigned long long) file_offset);
+       thread = load_thread (ctx, thread_id);
+       if (!load_data (ctx, len))
+               return 0;
+
+       ++buffer_count;
+
+       if (!startup_time) {
+               startup_time = time_base;
+               if (use_time_filter) {
+                       time_from += startup_time;
+                       time_to += startup_time;
+               }
+       }
+       for (i = 0; i < thread->stack_id; ++i)
+               thread->stack [i]->recurse_count++;
+       p = ctx->buf;
+       end = p + len;
+       while (p < end) {
+               unsigned char *start = p;
+               unsigned char event = *p;
+               switch (*p & 0xf) {
+               case TYPE_GC: {
+                       int subtype = *p & 0xf0;
+                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                       LOG_TIME (time_base, tdiff);
+                       time_base += tdiff;
+                       if (subtype == TYPE_GC_RESIZE) {
+                               uint64_t new_size = decode_uleb128 (p, &p);
+                               if (debug)
+                                       fprintf (outfile, "gc heap resized to %llu\n", (unsigned long long) new_size);
+                               gc_resizes++;
+                               if (new_size > max_heap_size)
+                                       max_heap_size = new_size;
+                       } else if (subtype == TYPE_GC_EVENT) {
+                               uint64_t ev;
+                               if (ctx->data_version > 12)
+                                       ev = *p++;
+                               else
+                                       ev = decode_uleb128 (p, &p);
+                               int gen;
+                               if (ctx->data_version > 12)
+                                       gen = *p++;
+                               else
+                                       gen = decode_uleb128 (p, &p);
+                               if (debug)
+                                       fprintf (outfile, "gc event for gen%d: %s at %llu (thread: 0x%zx)\n", gen, gc_event_name (ev), (unsigned long long) time_base, thread->thread_id);
+                               if (gen > 2) {
+                                       fprintf (outfile, "incorrect gc gen: %d\n", gen);
+                                       break;
+                               }
+                               if (ev == MONO_GC_EVENT_START) {
+                                       thread->gc_start_times [gen] = time_base;
+                                       gc_info [gen].count++;
+                               } else if (ev == MONO_GC_EVENT_END) {
+                                       tdiff = time_base - thread->gc_start_times [gen];
+                                       gc_info [gen].total_time += tdiff;
+                                       if (tdiff > gc_info [gen].max_time)
+                                               gc_info [gen].max_time = tdiff;
+                               }
+                       } else if (subtype == TYPE_GC_MOVE) {
+                               int j, num = decode_uleb128 (p, &p);
+                               gc_object_moves += num / 2;
+                               for (j = 0; j < num; j += 2) {
+                                       intptr_t obj1diff = decode_sleb128 (p, &p);
+                                       intptr_t obj2diff = decode_sleb128 (p, &p);
+                                       if (num_tracked_objects)
+                                               track_move (OBJ_ADDR (obj1diff), OBJ_ADDR (obj2diff));
+                                       if (debug) {
+                                               fprintf (outfile, "moved obj %p to %p\n", (void*)OBJ_ADDR (obj1diff), (void*)OBJ_ADDR (obj2diff));
+                                       }
+                               }
+                       } else if (subtype == TYPE_GC_HANDLE_CREATED || subtype == TYPE_GC_HANDLE_CREATED_BT) {
+                               int has_bt = subtype == TYPE_GC_HANDLE_CREATED_BT;
+                               int num_bt = 0;
+                               MethodDesc *sframes [8];
+                               MethodDesc **frames = sframes;
+                               int htype = decode_uleb128 (p, &p);
+                               uint32_t handle = decode_uleb128 (p, &p);
+                               intptr_t objdiff = decode_sleb128 (p, &p);
+                               if (has_bt) {
+                                       num_bt = 8;
+                                       frames = decode_bt (ctx, sframes, &num_bt, p, &p, ptr_base, &method_base);
+                                       if (!frames) {
+                                               fprintf (outfile, "Cannot load backtrace\n");
+                                               return 0;
+                                       }
+                               }
+                               if (htype > 3)
+                                       return 0;
+                               if ((thread_filter && thread_filter == thread->thread_id) || (time_base >= time_from && time_base < time_to)) {
+                                       handle_info [htype].created++;
+                                       handle_info [htype].live++;
+                                       if (handle_info [htype].live > handle_info [htype].max_live)
+                                               handle_info [htype].max_live = handle_info [htype].live;
+                                       BackTrace *bt;
+                                       if (has_bt)
+                                               bt = add_trace_methods (frames, num_bt, &handle_info [htype].traces, 1);
+                                       else
+                                               bt = add_trace_thread (thread, &handle_info [htype].traces, 1);
+                                       if (num_tracked_objects)
+                                               track_handle (OBJ_ADDR (objdiff), htype, handle, bt, time_base);
+                               }
+                               if (debug)
+                                       fprintf (outfile, "handle (%s) %u created for object %p\n", get_handle_name (htype), handle, (void*)OBJ_ADDR (objdiff));
+                               if (frames != sframes)
+                                       g_free (frames);
+                       } else if (subtype == TYPE_GC_HANDLE_DESTROYED || subtype == TYPE_GC_HANDLE_DESTROYED_BT) {
+                               int has_bt = subtype == TYPE_GC_HANDLE_DESTROYED_BT;
+                               int num_bt = 0;
+                               MethodDesc *sframes [8];
+                               MethodDesc **frames = sframes;
+                               int htype = decode_uleb128 (p, &p);
+                               uint32_t handle = decode_uleb128 (p, &p);
+                               if (has_bt) {
+                                       num_bt = 8;
+                                       frames = decode_bt (ctx, sframes, &num_bt, p, &p, ptr_base, &method_base);
+                                       if (!frames) {
+                                               fprintf (outfile, "Cannot load backtrace\n");
+                                               return 0;
+                                       }
+                               }
+                               if (htype > 3)
+                                       return 0;
+                               if ((thread_filter && thread_filter == thread->thread_id) || (time_base >= time_from && time_base < time_to)) {
+                                       handle_info [htype].destroyed ++;
+                                       handle_info [htype].live--;
+                                       BackTrace *bt;
+                                       if (has_bt)
+                                               bt = add_trace_methods (frames, num_bt, &handle_info [htype].destroy_traces, 1);
+                                       else
+                                               bt = add_trace_thread (thread, &handle_info [htype].destroy_traces, 1);
+                                       /* TODO: track_handle_free () - would need to record and keep track of the associated object address... */
+                               }
+                               if (debug)
+                                       fprintf (outfile, "handle (%s) %u destroyed\n", get_handle_name (htype), handle);
+                               if (frames != sframes)
+                                       g_free (frames);
+                       } else if (subtype == TYPE_GC_FINALIZE_START) {
+                               // TODO: Generate a finalizer report based on these events.
+                               if (debug)
+                                       fprintf (outfile, "gc finalizer queue being processed at %llu\n", (unsigned long long) time_base);
+                       } else if (subtype == TYPE_GC_FINALIZE_END) {
+                               if (debug)
+                                       fprintf (outfile, "gc finalizer queue finished processing at %llu\n", (unsigned long long) time_base);
+                       } else if (subtype == TYPE_GC_FINALIZE_OBJECT_START) {
+                               intptr_t objdiff = decode_sleb128 (p, &p);
+                               if (debug)
+                                       fprintf (outfile, "gc finalizing object %p at %llu\n", (void *) OBJ_ADDR (objdiff), (unsigned long long) time_base);
+                       } else if (subtype == TYPE_GC_FINALIZE_OBJECT_END) {
+                               intptr_t objdiff = decode_sleb128 (p, &p);
+                               if (debug)
+                                       fprintf (outfile, "gc finalized object %p at %llu\n", (void *) OBJ_ADDR (objdiff), (unsigned long long) time_base);
+                       }
+                       break;
+               }
+               case TYPE_METADATA: {
+                       int subtype = *p & 0xf0;
+                       const char *load_str = subtype == TYPE_END_LOAD ? "loaded" : "unloaded";
+                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                       int mtype = *p++;
+                       intptr_t ptrdiff = decode_sleb128 (p, &p);
+                       LOG_TIME (time_base, tdiff);
+                       time_base += tdiff;
+                       if (mtype == TYPE_CLASS) {
+                               intptr_t imptrdiff = decode_sleb128 (p, &p);
+                               if (ctx->data_version < 13)
+                                       decode_uleb128 (p, &p); /* flags */
+                               if (debug)
+                                       fprintf (outfile, "%s class %p (%s in %p) at %llu\n", load_str, (void*)(ptr_base + ptrdiff), p, (void*)(ptr_base + imptrdiff), (unsigned long long) time_base);
+                               if (subtype == TYPE_END_LOAD)
+                                       add_class (ptr_base + ptrdiff, (char*)p);
+                               while (*p) p++;
+                               p++;
+                       } else if (mtype == TYPE_IMAGE) {
+                               if (ctx->data_version < 13)
+                                       decode_uleb128 (p, &p); /* flags */
+                               if (debug)
+                                       fprintf (outfile, "%s image %p (%s) at %llu\n", load_str, (void*)(ptr_base + ptrdiff), p, (unsigned long long) time_base);
+                               if (subtype == TYPE_END_LOAD)
+                                       add_image (ptr_base + ptrdiff, (char*)p);
+                               while (*p) p++;
+                               p++;
+                       } else if (mtype == TYPE_ASSEMBLY) {
+                               if (ctx->data_version < 13)
+                                       decode_uleb128 (p, &p); /* flags */
+                               if (debug)
+                                       fprintf (outfile, "%s assembly %p (%s) at %llu\n", load_str, (void*)(ptr_base + ptrdiff), p, (unsigned long long) time_base);
+                               if (subtype == TYPE_END_LOAD)
+                                       add_assembly (ptr_base + ptrdiff, (char*)p);
+                               while (*p) p++;
+                               p++;
+                       } else if (mtype == TYPE_DOMAIN) {
+                               if (ctx->data_version < 13)
+                                       decode_uleb128 (p, &p); /* flags */
+                               DomainContext *nd = get_domain (ctx, ptr_base + ptrdiff);
+                               /* no subtype means it's a name event, rather than start/stop */
+                               if (subtype == 0)
+                                       nd->friendly_name = pstrdup ((char *) p);
+                               if (debug) {
+                                       if (subtype == 0)
+                                               fprintf (outfile, "domain %p named at %llu: %s\n", (void *) (ptr_base + ptrdiff), (unsigned long long) time_base, p);
+                                       else
+                                               fprintf (outfile, "%s thread %p at %llu\n", load_str, (void *) (ptr_base + ptrdiff), (unsigned long long) time_base);
+                               }
+                               if (subtype == 0) {
+                                       while (*p) p++;
+                                       p++;
+                               }
+                       } else if (mtype == TYPE_CONTEXT) {
+                               if (ctx->data_version < 13)
+                                       decode_uleb128 (p, &p); /* flags */
+                               intptr_t domaindiff = decode_sleb128 (p, &p);
+                               if (debug)
+                                       fprintf (outfile, "%s context %p (%p) at %llu\n", load_str, (void*)(ptr_base + ptrdiff), (void *) (ptr_base + domaindiff), (unsigned long long) time_base);
+                               if (subtype == TYPE_END_LOAD)
+                                       get_remctx (ctx, ptr_base + ptrdiff)->domain_id = ptr_base + domaindiff;
+                       } else if (mtype == TYPE_THREAD) {
+                               if (ctx->data_version < 13)
+                                       decode_uleb128 (p, &p); /* flags */
+                               ThreadContext *nt = get_thread (ctx, ptr_base + ptrdiff);
+                               /* no subtype means it's a name event, rather than start/stop */
+                               if (subtype == 0)
+                                       nt->name = pstrdup ((char*)p);
+                               if (debug) {
+                                       if (subtype == 0)
+                                               fprintf (outfile, "thread %p named at %llu: %s\n", (void*)(ptr_base + ptrdiff), (unsigned long long) time_base, p);
+                                       else
+                                               fprintf (outfile, "%s thread %p at %llu\n", load_str, (void *) (ptr_base + ptrdiff), (unsigned long long) time_base);
+                               }
+                               if (subtype == 0) {
+                                       while (*p) p++;
+                                       p++;
+                               }
+                       }
+                       break;
+               }
+               case TYPE_ALLOC: {
+                       int has_bt = *p & TYPE_ALLOC_BT;
+                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                       intptr_t ptrdiff = decode_sleb128 (p, &p);
+                       intptr_t objdiff = decode_sleb128 (p, &p);
+                       uint64_t len;
+                       int num_bt = 0;
+                       MethodDesc* sframes [8];
+                       MethodDesc** frames = sframes;
+                       ClassDesc *cd = lookup_class (ptr_base + ptrdiff);
+                       len = decode_uleb128 (p, &p);
+                       LOG_TIME (time_base, tdiff);
+                       time_base += tdiff;
+                       if (debug)
+                               fprintf (outfile, "alloced object %p, size %llu (%s) at %llu\n", (void*)OBJ_ADDR (objdiff), (unsigned long long) len, lookup_class (ptr_base + ptrdiff)->name, (unsigned long long) time_base);
+                       if (has_bt) {
+                               num_bt = 8;
+                               frames = decode_bt (ctx, sframes, &num_bt, p, &p, ptr_base, &method_base);
+                               if (!frames) {
+                                       fprintf (outfile, "Cannot load backtrace\n");
+                                       return 0;
+                               }
+                       }
+                       if ((thread_filter && thread_filter == thread->thread_id) || (time_base >= time_from && time_base < time_to)) {
+                               BackTrace *bt;
+                               cd->allocs++;
+                               cd->alloc_size += len;
+                               if (has_bt)
+                                       bt = add_trace_methods (frames, num_bt, &cd->traces, len);
+                               else
+                                       bt = add_trace_thread (thread, &cd->traces, len);
+                               if (find_size && len >= find_size) {
+                                       if (!find_name || strstr (cd->name, find_name))
+                                               found_object (OBJ_ADDR (objdiff));
+                               } else if (!find_size && find_name && strstr (cd->name, find_name)) {
+                                       found_object (OBJ_ADDR (objdiff));
+                               }
+                               if (num_tracked_objects)
+                                       tracked_creation (OBJ_ADDR (objdiff), cd, len, bt, time_base);
+                       }
+                       if (frames != sframes)
+                               g_free (frames);
+                       break;
+               }
+               case TYPE_METHOD: {
+                       int subtype = *p & 0xf0;
+                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                       int64_t ptrdiff = decode_sleb128 (p, &p);
+                       LOG_TIME (time_base, tdiff);
+                       time_base += tdiff;
+                       method_base += ptrdiff;
+                       if (subtype == TYPE_JIT) {
+                               intptr_t codediff = decode_sleb128 (p, &p);
+                               int codelen = decode_uleb128 (p, &p);
+                               MethodDesc *jitted_method;
+                               if (debug)
+                                       fprintf (outfile, "jitted method %p (%s), size: %d, code: %p\n", (void*)(method_base), p, codelen, (void*)(ptr_base + codediff));
+                               jitted_method = add_method (method_base, (char*)p, ptr_base + codediff, codelen);
+                               if (!(time_base >= time_from && time_base < time_to))
+                                       jitted_method->ignore_jit = 1;
+                               while (*p) p++;
+                               p++;
+                       } else {
+                               MethodDesc *method;
+                               if ((thread_filter && thread_filter != thread->thread_id))
+                                       break;
+                               if (!(time_base >= time_from && time_base < time_to))
+                                       break;
+                               method = lookup_method (method_base);
+                               if (subtype == TYPE_ENTER) {
+                                       add_trace_thread (thread, &method->traces, 1);
+                                       push_method (thread, method, time_base);
+                               } else {
+                                       pop_method (thread, method, time_base);
+                               }
+                               if (debug)
+                                       fprintf (outfile, "%s method %s\n", subtype == TYPE_ENTER? "enter": subtype == TYPE_EXC_LEAVE? "exleave": "leave", method->name);
+                       }
+                       break;
+               }
+               case TYPE_HEAP: {
+                       int subtype = *p & 0xf0;
+                       if (subtype == TYPE_HEAP_OBJECT) {
+                               HeapObjectDesc *ho = NULL;
+                               int i;
+                               intptr_t objdiff;
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                                       objdiff = decode_sleb128 (p, &p);
+                               } else
+                                       objdiff = decode_sleb128 (p + 1, &p);
+                               intptr_t ptrdiff = decode_sleb128 (p, &p);
+                               uint64_t size = decode_uleb128 (p, &p);
+                               uintptr_t num = decode_uleb128 (p, &p);
+                               uintptr_t ref_offset = 0;
+                               uintptr_t last_obj_offset = 0;
+                               ClassDesc *cd = lookup_class (ptr_base + ptrdiff);
+                               if (size) {
+                                       HeapClassDesc *hcd = add_heap_shot_class (thread->current_heap_shot, cd, size);
+                                       if (collect_traces) {
+                                               ho = alloc_heap_obj (OBJ_ADDR (objdiff), hcd, num);
+                                               add_heap_shot_obj (thread->current_heap_shot, ho);
+                                               ref_offset = 0;
+                                       }
+                               } else {
+                                       if (collect_traces)
+                                               ho = heap_shot_obj_add_refs (thread->current_heap_shot, OBJ_ADDR (objdiff), num, &ref_offset);
+                               }
+                               for (i = 0; i < num; ++i) {
+                                       /* FIXME: use object distance to measure how good
+                                        * the GC is at keeping related objects close
+                                        */
+                                       uintptr_t offset = ctx->data_version > 1? last_obj_offset + decode_uleb128 (p, &p): -1;
+                                       intptr_t obj1diff = decode_sleb128 (p, &p);
+                                       last_obj_offset = offset;
+                                       if (collect_traces)
+                                               ho->refs [ref_offset + i] = OBJ_ADDR (obj1diff);
+                                       if (num_tracked_objects)
+                                               track_obj_reference (OBJ_ADDR (obj1diff), OBJ_ADDR (objdiff), cd);
+                               }
+                               if (debug && size)
+                                       fprintf (outfile, "traced object %p, size %llu (%s), refs: %zd\n", (void*)OBJ_ADDR (objdiff), (unsigned long long) size, cd->name, num);
+                       } else if (subtype == TYPE_HEAP_ROOT) {
+                               uintptr_t num;
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                                       num = decode_uleb128 (p, &p);
+                               } else
+                                       num = decode_uleb128 (p + 1, &p);
+                               uintptr_t gc_num G_GNUC_UNUSED = decode_uleb128 (p, &p);
+                               int i;
+                               for (i = 0; i < num; ++i) {
+                                       intptr_t objdiff = decode_sleb128 (p, &p);
+                                       int root_type;
+                                       if (ctx->data_version > 12)
+                                               root_type = *p++;
+                                       else
+                                               root_type = decode_uleb128 (p, &p);
+                                       /* we just discard the extra info for now */
+                                       uintptr_t extra_info = decode_uleb128 (p, &p);
+                                       if (debug)
+                                               fprintf (outfile, "object %p is a %s root\n", (void*)OBJ_ADDR (objdiff), get_root_name (root_type));
+                                       if (collect_traces)
+                                               thread_add_root (thread, OBJ_ADDR (objdiff), root_type, extra_info);
+                               }
+                       } else if (subtype == TYPE_HEAP_END) {
+                               uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                               LOG_TIME (time_base, tdiff);
+                               time_base += tdiff;
+                               if (debug)
+                                       fprintf (outfile, "heap shot end\n");
+                               if (collect_traces) {
+                                       HeapShot *hs = thread->current_heap_shot;
+                                       if (hs && thread->num_roots) {
+                                               /* transfer the root ownershipt to the heapshot */
+                                               hs->num_roots = thread->num_roots;
+                                               hs->roots = thread->roots;
+                                               hs->roots_extra = thread->roots_extra;
+                                               hs->roots_types = thread->roots_types;
+                                       } else {
+                                               g_free (thread->roots);
+                                               g_free (thread->roots_extra);
+                                               g_free (thread->roots_types);
+                                       }
+                                       thread->num_roots = 0;
+                                       thread->size_roots = 0;
+                                       thread->roots = NULL;
+                                       thread->roots_extra = NULL;
+                                       thread->roots_types = NULL;
+                                       heap_shot_resolve_reverse_refs (hs);
+                                       heap_shot_mark_objects (hs);
+                                       heap_shot_free_objects (hs);
+                               }
+                               thread->current_heap_shot = NULL;
+                       } else if (subtype == TYPE_HEAP_START) {
+                               uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                               LOG_TIME (time_base, tdiff);
+                               time_base += tdiff;
+                               if (debug)
+                                       fprintf (outfile, "heap shot start\n");
+                               thread->current_heap_shot = new_heap_shot (time_base);
+                       }
+                       break;
+               }
+               case TYPE_MONITOR: {
+                       int event = (*p >> 4) & 0x3;
+                       int has_bt = *p & TYPE_MONITOR_BT;
+                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                       intptr_t objdiff = decode_sleb128 (p, &p);
+                       MethodDesc* sframes [8];
+                       MethodDesc** frames = sframes;
+                       int record;
+                       int num_bt = 0;
+                       LOG_TIME (time_base, tdiff);
+                       time_base += tdiff;
+                       record = (!thread_filter || thread_filter == thread->thread_id);
+                       if (!(time_base >= time_from && time_base < time_to))
+                               record = 0;
+                       if (event == MONO_PROFILER_MONITOR_CONTENTION) {
+                               MonitorDesc *mdesc = lookup_monitor (OBJ_ADDR (objdiff));
+                               if (record) {
+                                       monitor_contention++;
+                                       mdesc->contentions++;
+                                       thread->monitor = mdesc;
+                                       thread->contention_start = time_base;
+                               }
+                               if (has_bt) {
+                                       num_bt = 8;
+                                       frames = decode_bt (ctx, sframes, &num_bt, p, &p, ptr_base, &method_base);
+                                       if (!frames) {
+                                               fprintf (outfile, "Cannot load backtrace\n");
+                                               return 0;
+                                       }
+                                       if (record)
+                                               add_trace_methods (frames, num_bt, &mdesc->traces, 1);
+                               } else {
+                                       if (record)
+                                               add_trace_thread (thread, &mdesc->traces, 1);
+                               }
+                       } else if (event == MONO_PROFILER_MONITOR_FAIL) {
+                               if (record) {
+                                       monitor_failed++;
+                                       if (thread->monitor && thread->contention_start) {
+                                               uint64_t wait_time = time_base - thread->contention_start;
+                                               if (wait_time > thread->monitor->max_wait_time)
+                                                       thread->monitor->max_wait_time = wait_time;
+                                               thread->monitor->wait_time += wait_time;
+                                               thread->monitor = NULL;
+                                               thread->contention_start = 0;
+                                       }
+                               }
+                       } else if (event == MONO_PROFILER_MONITOR_DONE) {
+                               if (record) {
+                                       monitor_acquired++;
+                                       if (thread->monitor && thread->contention_start) {
+                                               uint64_t wait_time = time_base - thread->contention_start;
+                                               if (wait_time > thread->monitor->max_wait_time)
+                                                       thread->monitor->max_wait_time = wait_time;
+                                               thread->monitor->wait_time += wait_time;
+                                               thread->monitor = NULL;
+                                               thread->contention_start = 0;
+                                       }
+                               }
+                       }
+                       if (debug)
+                               fprintf (outfile, "monitor %s for object %p\n", monitor_ev_name (event), (void*)OBJ_ADDR (objdiff));
+                       if (frames != sframes)
+                               g_free (frames);
+                       break;
+               }
+               case TYPE_EXCEPTION: {
+                       int subtype = *p & 0x70;
+                       int has_bt = *p & TYPE_THROW_BT;
+                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                       MethodDesc* sframes [8];
+                       MethodDesc** frames = sframes;
+                       int record;
+                       LOG_TIME (time_base, tdiff);
+                       time_base += tdiff;
+                       record = (!thread_filter || thread_filter == thread->thread_id);
+                       if (!(time_base >= time_from && time_base < time_to))
+                               record = 0;
+                       if (subtype == TYPE_CLAUSE) {
+                               int clause_type;
+                               if (ctx->data_version > 12)
+                                       clause_type = *p++;
+                               else
+                                       clause_type = decode_uleb128 (p, &p);
+                               int clause_num = decode_uleb128 (p, &p);
+                               int64_t ptrdiff = decode_sleb128 (p, &p);
+                               method_base += ptrdiff;
+                               if (record)
+                                       clause_summary [clause_type]++;
+                               if (debug)
+                                       fprintf (outfile, "clause %s (%d) in method %s\n", clause_name (clause_type), clause_num, lookup_method (method_base)->name);
+                       } else {
+                               intptr_t objdiff = decode_sleb128 (p, &p);
+                               if (record)
+                                       throw_count++;
+                               if (has_bt) {
+                                       has_bt = 8;
+                                       frames = decode_bt (ctx, sframes, &has_bt, p, &p, ptr_base, &method_base);
+                                       if (!frames) {
+                                               fprintf (outfile, "Cannot load backtrace\n");
+                                               return 0;
+                                       }
+                                       if (record)
+                                               add_trace_methods (frames, has_bt, &exc_traces, 1);
+                               } else {
+                                       if (record)
+                                               add_trace_thread (thread, &exc_traces, 1);
+                               }
+                               if (frames != sframes)
+                                       g_free (frames);
+                               if (debug)
+                                       fprintf (outfile, "throw %p\n", (void*)OBJ_ADDR (objdiff));
+                       }
+                       break;
+               }
+               case TYPE_RUNTIME: {
+                       int subtype = *p & 0xf0;
+                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                       LOG_TIME (time_base, tdiff);
+                       time_base += tdiff;
+                       if (subtype == TYPE_JITHELPER) {
+                               int type;
+                               if (ctx->data_version > 12)
+                                       type = *p++;
+                               else
+                                       type = decode_uleb128 (p, &p);
+                               intptr_t codediff = decode_sleb128 (p, &p);
+                               int codelen = decode_uleb128 (p, &p);
+                               const char *name;
+                               if (type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE) {
+                                       name = (const char *)p;
+                                       while (*p) p++;
+                                               p++;
+                               } else {
+                                       name = code_buffer_desc (type);
+                               }
+                               num_jit_helpers++;
+                               jit_helpers_code_size += codelen;
+                               if (debug)
+                                       fprintf (outfile, "jit helper %s, size: %d, code: %p\n", name, codelen, (void*)(ptr_base + codediff));
+                       }
+                       break;
+               }
+               case TYPE_SAMPLE: {
+                       int subtype = *p & 0xf0;
+                       if (subtype == TYPE_SAMPLE_HIT) {
+                               int i;
+                               int sample_type;
+                               uint64_t tstamp;
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                                       sample_type = *p++;
+                                       tstamp = time_base;
+                               } else {
+                                       sample_type = decode_uleb128 (p + 1, &p);
+                                       tstamp = decode_uleb128 (p, &p);
+                               }
+                               void *tid = (void *) thread_id;
+                               if (ctx->data_version > 10)
+                                       tid = (void *) (ptr_base + decode_sleb128 (p, &p));
+                               int count = decode_uleb128 (p, &p);
+                               for (i = 0; i < count; ++i) {
+                                       uintptr_t ip = ptr_base + decode_sleb128 (p, &p);
+                                       if ((tstamp >= time_from && tstamp < time_to))
+                                               add_stat_sample (sample_type, ip);
+                                       if (debug)
+                                               fprintf (outfile, "sample hit, type: %d at %p for thread %p\n", sample_type, (void*)ip, tid);
+                               }
+                               if (ctx->data_version > 5) {
+                                       count = decode_uleb128 (p, &p);
+                                       for (i = 0; i < count; ++i) {
+                                               MethodDesc *method;
+                                               int64_t ptrdiff = decode_sleb128 (p, &p);
+                                               method_base += ptrdiff;
+                                               method = lookup_method (method_base);
+                                               if (debug)
+                                                       fprintf (outfile, "sample hit bt %d: %s\n", i, method->name);
+                                               if (ctx->data_version < 13) {
+                                                       decode_sleb128 (p, &p); /* il offset */
+                                                       decode_sleb128 (p, &p); /* native offset */
+                                               }
+                                       }
+                               }
+                       } else if (subtype == TYPE_SAMPLE_USYM) {
+                               /* un unmanaged symbol description */
+                               uintptr_t addr;
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                                       addr = ptr_base + decode_sleb128 (p, &p);
+                               } else
+                                       addr = ptr_base + decode_sleb128 (p + 1, &p);
+                               uintptr_t size = decode_uleb128 (p, &p);
+                               char *name;
+                               name = pstrdup ((char*)p);
+                               add_unmanaged_symbol (addr, name, size);
+                               if (debug)
+                                       fprintf (outfile, "unmanaged symbol %s at %p\n", name, (void*)addr);
+                               while (*p) p++;
+                               p++;
+                       } else if (subtype == TYPE_SAMPLE_UBIN) {
+                               /* un unmanaged binary loaded in memory */
+                               uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                               uintptr_t addr = decode_sleb128 (p, &p);
+                               uint64_t offset G_GNUC_UNUSED = decode_uleb128 (p, &p);
+                               uintptr_t size = decode_uleb128 (p, &p);
+                               char *name;
+                               LOG_TIME (time_base, tdiff);
+                               time_base += tdiff;
+                               name = pstrdup ((char*)p);
+                               add_unmanaged_binary (addr, name, size);
+                               if (debug)
+                                       fprintf (outfile, "unmanaged binary %s at %p\n", name, (void*)addr);
+                               while (*p) p++;
+                               p++;
+                       } else if (subtype == TYPE_SAMPLE_COUNTERS_DESC) {
+                               uint64_t i, len;
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                                       len = decode_uleb128 (p, &p);
+                               } else
+                                       len = decode_uleb128 (p + 1, &p);
+                               for (i = 0; i < len; i++) {
+                                       uint64_t type, unit, variance, index;
+                                       uint64_t section = decode_uleb128 (p, &p);
+                                       char *section_str, *name;
+                                       if (section != MONO_COUNTER_PERFCOUNTERS) {
+                                               section_str = (char*) section_name (section);
+                                       } else {
+                                               section_str = pstrdup ((char*)p);
+                                               while (*p++);
+                                       }
+                                       name = pstrdup ((char*)p);
+                                       while (*p++);
+                                       if (ctx->data_version > 12) {
+                                               type = *p++;
+                                               unit = *p++;
+                                               variance = *p++;
+                                       } else {
+                                               type = decode_uleb128 (p, &p);
+                                               unit = decode_uleb128 (p, &p);
+                                               variance = decode_uleb128 (p, &p);
+                                       }
+                                       index = decode_uleb128 (p, &p);
+                                       add_counter (section_str, name, (int)type, (int)unit, (int)variance, (int)index);
+                               }
+                       } else if (subtype == TYPE_SAMPLE_COUNTERS) {
+                               int i;
+                               CounterValue *value, *previous = NULL;
+                               CounterList *list;
+                               uint64_t timestamp; // milliseconds since startup
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                                       timestamp = (time_base - startup_time) / 1000 / 1000;
+                               } else
+                                       timestamp = decode_uleb128 (p + 1, &p);
+                               uint64_t time_between = timestamp / 1000 * 1000 * 1000 * 1000 + startup_time;
+                               while (1) {
+                                       uint64_t type, index = decode_uleb128 (p, &p);
+                                       if (index == 0)
+                                               break;
+
+                                       for (list = counters; list; list = list->next) {
+                                               if (list->counter->index == (int)index) {
+                                                       previous = list->counter->values_last;
+                                                       break;
+                                               }
+                                       }
+
+                                       if (ctx->data_version > 12)
+                                               type = *p++;
+                                       else
+                                               type = decode_uleb128 (p, &p);
+
+                                       value = (CounterValue *) g_calloc (1, sizeof (CounterValue));
+                                       value->timestamp = timestamp;
+
+                                       switch (type) {
+                                       case MONO_COUNTER_INT:
+#if SIZEOF_VOID_P == 4
+                                       case MONO_COUNTER_WORD:
+#endif
+                                               value->buffer = (unsigned char *)g_malloc (sizeof (int32_t));
+                                               *(int32_t*)value->buffer = (int32_t)decode_sleb128 (p, &p) + (previous ? (*(int32_t*)previous->buffer) : 0);
+                                               break;
+                                       case MONO_COUNTER_UINT:
+                                               value->buffer = (unsigned char *) g_malloc (sizeof (uint32_t));
+                                               *(uint32_t*)value->buffer = (uint32_t)decode_uleb128 (p, &p) + (previous ? (*(uint32_t*)previous->buffer) : 0);
+                                               break;
+                                       case MONO_COUNTER_LONG:
+#if SIZEOF_VOID_P == 8
+                                       case MONO_COUNTER_WORD:
+#endif
+                                       case MONO_COUNTER_TIME_INTERVAL:
+                                               value->buffer = (unsigned char *) g_malloc (sizeof (int64_t));
+                                               *(int64_t*)value->buffer = (int64_t)decode_sleb128 (p, &p) + (previous ? (*(int64_t*)previous->buffer) : 0);
+                                               break;
+                                       case MONO_COUNTER_ULONG:
+                                               value->buffer = (unsigned char *) g_malloc (sizeof (uint64_t));
+                                               *(uint64_t*)value->buffer = (uint64_t)decode_uleb128 (p, &p) + (previous ? (*(uint64_t*)previous->buffer) : 0);
+                                               break;
+                                       case MONO_COUNTER_DOUBLE:
+                                               value->buffer = (unsigned char *) g_malloc (sizeof (double));
+#if TARGET_BYTE_ORDER == G_LITTLE_ENDIAN
+                                               for (i = 0; i < sizeof (double); i++)
+#else
+                                               for (i = sizeof (double) - 1; i >= 0; i--)
+#endif
+                                                       value->buffer[i] = *p++;
+                                               break;
+                                       case MONO_COUNTER_STRING:
+                                               if (*p++ == 0) {
+                                                       value->buffer = NULL;
+                                               } else {
+                                                       value->buffer = (unsigned char*) pstrdup ((char*)p);
+                                                       while (*p++);
+                                               }
+                                               break;
+                                       }
+                                       if (time_between >= time_from && time_between <= time_to)
+                                               add_counter_value (index, value);
+                               }
+                       } else {
+                               return 0;
+                       }
+                       break;
+               }
+               case TYPE_COVERAGE:{
+                       int subtype = *p & 0xf0;
+                       switch (subtype) {
+                       case TYPE_COVERAGE_METHOD: {
+                               CoverageMethod *method = g_new0 (CoverageMethod, 1);
+                               const char *assembly, *klass, *name, *sig, *filename;
+                               int token, n_offsets, method_id;
+
+                               p++;
+
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                               }
+
+                               assembly = (const char *)p; while (*p) p++; p++;
+                               klass = (const char *)p; while (*p) p++; p++;
+                               name = (const char *)p; while (*p) p++; p++;
+                               sig = (const char *)p; while (*p) p++; p++;
+                               filename = (const char *)p; while (*p) p++; p++;
+
+                               token = decode_uleb128 (p, &p);
+                               method_id = decode_uleb128 (p, &p);
+                               n_offsets = decode_uleb128 (p, &p);
+
+                               method->assembly_name = g_strdup (assembly);
+                               method->class_name = g_strdup (klass);
+                               method->method_name = g_strdup (name);
+                               method->method_signature = g_strdup (sig);
+                               method->filename = g_strdup (filename);
+                               method->token = token;
+                               method->n_statements = n_offsets;
+                               method->coverage = g_ptr_array_new ();
+                               method->method_id = method_id;
+
+                               coverage_add_method (method);
+
+                               break;
+                       }
+                       case TYPE_COVERAGE_STATEMENT: {
+                               CoverageCoverage *coverage = g_new0 (CoverageCoverage, 1);
+                               int offset, count, line, column, method_id;
+
+                               p++;
+
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                               }
+
+                               method_id = decode_uleb128 (p, &p);
+                               offset = decode_uleb128 (p, &p);
+                               count = decode_uleb128 (p, &p);
+                               line = decode_uleb128 (p, &p);
+                               column = decode_uleb128 (p, &p);
+
+                               coverage->method_id = method_id;
+                               coverage->offset = offset;
+                               coverage->count = count;
+                               coverage->line = line;
+                               coverage->column = column;
+
+                               coverage_add_coverage (coverage);
+                               break;
+                       }
+                       case TYPE_COVERAGE_ASSEMBLY: {
+                               CoverageAssembly *assembly = g_new0 (CoverageAssembly, 1);
+                               char *name, *guid, *filename;
+                               int number_of_methods, fully_covered, partially_covered;
+                               p++;
+
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                               }
+
+                               name = (char *)p; while (*p) p++; p++;
+                               guid = (char *)p; while (*p) p++; p++;
+                               filename = (char *)p; while (*p) p++; p++;
+                               number_of_methods = decode_uleb128 (p, &p);
+                               fully_covered = decode_uleb128 (p, &p);
+                               partially_covered = decode_uleb128 (p, &p);
+
+                               assembly->name = g_strdup (name);
+                               assembly->guid = g_strdup (guid);
+                               assembly->filename = g_strdup (filename);
+                               assembly->number_of_methods = number_of_methods;
+                               assembly->fully_covered = fully_covered;
+                               assembly->partially_covered = partially_covered;
+
+                               coverage_add_assembly (assembly);
+                               break;
+                       }
+                       case TYPE_COVERAGE_CLASS: {
+                               CoverageClass *klass = g_new0 (CoverageClass, 1);
+                               char *assembly_name, *class_name;
+                               int number_of_methods, fully_covered, partially_covered;
+                               p++;
+
+                               if (ctx->data_version > 12) {
+                                       uint64_t tdiff = decode_uleb128 (p, &p);
+                                       LOG_TIME (time_base, tdiff);
+                                       time_base += tdiff;
+                               }
+
+                               assembly_name = (char *)p; while (*p) p++; p++;
+                               class_name = (char *)p; while (*p) p++; p++;
+                               number_of_methods = decode_uleb128 (p, &p);
+                               fully_covered = decode_uleb128 (p, &p);
+                               partially_covered = decode_uleb128 (p, &p);
+
+                               klass->assembly_name = g_strdup (assembly_name);
+                               klass->class_name = g_strdup (class_name);
+                               klass->number_of_methods = number_of_methods;
+                               klass->fully_covered = fully_covered;
+                               klass->partially_covered = partially_covered;
+
+                               coverage_add_class (klass);
+                               break;
+                       }
+
+                       default:
+                               break;
+                       }
+                       break;
+               }
+               case TYPE_META: {
+                       int subtype = *p & 0xf0;
+                       uint64_t tdiff = decode_uleb128 (p + 1, &p);
+                       LOG_TIME (time_base, tdiff);
+                       time_base += tdiff;
+                       if (subtype == TYPE_SYNC_POINT) {
+                               int type = *p++;
+                               if (debug)
+                                       fprintf (outfile, "sync point %i (%s)\n", type, sync_point_name (type));
+                       }
+                       break;
+               }
+               default:
+                       fprintf (outfile, "unhandled profiler event: 0x%x at file offset: %llu + %lld (len: %d\n)\n", *p, (unsigned long long) file_offset, (long long) (p - ctx->buf), len);
+                       exit (1);
+               }
+               record_event_stats (event, p - start);
+       }
+       thread->last_time = time_base;
+       for (i = 0; i < thread->stack_id; ++i)
+               thread->stack [i]->recurse_count = 0;
+       return 1;
+}
+
+static int
+read_header_string (ProfContext *ctx, char **field)
+{
+       if (!load_data (ctx, 4))
+               return 0;
+
+       if (!load_data (ctx, read_int32 (ctx->buf)))
+               return 0;
+
+       *field = pstrdup ((const char *) ctx->buf);
+
+       return 1;
+}
+
+static ProfContext*
+load_file (char *name)
+{
+       unsigned char *p;
+       ProfContext *ctx = (ProfContext *) g_calloc (sizeof (ProfContext), 1);
+       if (strcmp (name, "-") == 0)
+               ctx->file = stdin;
+       else
+               ctx->file = fopen (name, "rb");
+       if (!ctx->file) {
+               printf ("Cannot open file: %s\n", name);
+               exit (1);
+       }
+#if defined (HAVE_SYS_ZLIB)
+       if (ctx->file != stdin)
+               ctx->gzfile = gzdopen (fileno (ctx->file), "rb");
+#endif
+       if (!load_data (ctx, 30))
+               return NULL;
+       p = ctx->buf;
+       if (read_int32 (p) != LOG_HEADER_ID || p [6] > LOG_DATA_VERSION)
+               return NULL;
+       ctx->version_major = p [4];
+       ctx->version_minor = p [5];
+       ctx->data_version = p [6];
+       /* reading 64 bit files on 32 bit systems not supported yet */
+       if (p [7] > sizeof (void*))
+               return NULL;
+       if (read_int32 (p + 20)) /* flags must be 0 */
+               return NULL;
+       ctx->startup_time = read_int64 (p + 8);
+       ctx->timer_overhead = read_int32 (p + 16);
+       ctx->pid = read_int32 (p + 24);
+       ctx->port = read_int16 (p + 28);
+       if (ctx->version_major >= 1) {
+               if (!read_header_string (ctx, &ctx->args))
+                       return NULL;
+               if (!read_header_string (ctx, &ctx->arch))
+                       return NULL;
+               if (!read_header_string (ctx, &ctx->os))
+                       return NULL;
+       } else {
+               if (!load_data (ctx, 2)) /* old opsys field, was never used */
+                       return NULL;
+       }
+       return ctx;
+}
+
+enum {
+       ALLOC_SORT_BYTES,
+       ALLOC_SORT_COUNT
+};
+static int alloc_sort_mode = ALLOC_SORT_BYTES;
+
+static int
+compare_class (const void *a, const void *b)
+{
+       ClassDesc *const *A = (ClassDesc *const *)a;
+       ClassDesc *const *B = (ClassDesc *const *)b;
+       uint64_t vala, valb;
+       if (alloc_sort_mode == ALLOC_SORT_BYTES) {
+               vala = (*A)->alloc_size;
+               valb = (*B)->alloc_size;
+       } else {
+               vala = (*A)->allocs;
+               valb = (*B)->allocs;
+       }
+       if (valb == vala)
+               return 0;
+       if (valb < vala)
+               return -1;
+       return 1;
+}
+
+static void
+dump_header (ProfContext *ctx)
+{
+       time_t st = ctx->startup_time / 1000;
+       char *t = ctime (&st);
+       fprintf (outfile, "\nMono log profiler data\n");
+       fprintf (outfile, "\tProfiler version: %d.%d\n", ctx->version_major, ctx->version_minor);
+       fprintf (outfile, "\tData version: %d\n", ctx->data_version);
+       if (ctx->version_major >= 1) {
+               fprintf (outfile, "\tArguments: %s\n", ctx->args);
+               fprintf (outfile, "\tArchitecture: %s\n", ctx->arch);
+               fprintf (outfile, "\tOperating system: %s\n", ctx->os);
+       }
+       fprintf (outfile, "\tMean timer overhead: %d nanoseconds\n", ctx->timer_overhead);
+       fprintf (outfile, "\tProgram startup: %s", t);
+       if (ctx->pid)
+               fprintf (outfile, "\tProgram ID: %d\n", ctx->pid);
+       if (ctx->port)
+               fprintf (outfile, "\tServer listening on: %d\n", ctx->port);
+}
+
+static void
+dump_traces (TraceDesc *traces, const char *desc)
+{
+       int j;
+       if (!show_traces)
+               return;
+       if (!traces->count)
+               return;
+       sort_context_array (traces);
+       for (j = 0; j < traces->count; ++j) {
+               int k;
+               BackTrace *bt;
+               bt = traces->traces [j].bt;
+               if (!bt->count)
+                       continue;
+               fprintf (outfile, "\t%llu %s from:\n", (unsigned long long) traces->traces [j].count, desc);
+               for (k = 0; k < bt->count; ++k)
+                       fprintf (outfile, "\t\t%s\n", bt->methods [k]->name);
+       }
+}
+
+static void
+dump_threads (ProfContext *ctx)
+{
+       ThreadContext *thread;
+       fprintf (outfile, "\nThread summary\n");
+       for (thread = ctx->threads; thread; thread = thread->next) {
+               if (thread->thread_id) {
+                       fprintf (outfile, "\tThread: %p, name: \"%s\"\n", (void*)thread->thread_id, thread->name? thread->name: "");
+               }
+       }
+}
+
+static void
+dump_domains (ProfContext *ctx)
+{
+       fprintf (outfile, "\nDomain summary\n");
+
+       for (DomainContext *domain = ctx->domains; domain; domain = domain->next)
+               fprintf (outfile, "\tDomain: %p, friendly name: \"%s\"\n", (void *) domain->domain_id, domain->friendly_name);
+}
+
+static void
+dump_remctxs (ProfContext *ctx)
+{
+       fprintf (outfile, "\nContext summary\n");
+
+       for (RemCtxContext *remctx = ctx->remctxs; remctx; remctx = remctx->next)
+               fprintf (outfile, "\tContext: %p, domain: %p\n", (void *) remctx->remctx_id, (void *) remctx->domain_id);
+}
+
+static void
+dump_exceptions (void)
+{
+       int i;
+       fprintf (outfile, "\nException summary\n");
+       fprintf (outfile, "\tThrows: %llu\n", (unsigned long long) throw_count);
+       dump_traces (&exc_traces, "throws");
+       for (i = 0; i <= MONO_EXCEPTION_CLAUSE_FAULT; ++i) {
+               if (!clause_summary [i])
+                       continue;
+               fprintf (outfile, "\tExecuted %s clauses: %llu\n", clause_name (i), (unsigned long long) clause_summary [i]);
+       }
+}
+
+static int
+compare_monitor (const void *a, const void *b)
+{
+       MonitorDesc *const *A = (MonitorDesc *const *)a;
+       MonitorDesc *const *B = (MonitorDesc *const *)b;
+       if ((*B)->wait_time == (*A)->wait_time)
+               return 0;
+       if ((*B)->wait_time < (*A)->wait_time)
+               return -1;
+       return 1;
+}
+
+static void
+dump_monitors (void)
+{
+       MonitorDesc **monitors;
+       int i, j;
+       if (!num_monitors)
+               return;
+       monitors = (MonitorDesc **) g_malloc (sizeof (void*) * num_monitors);
+       for (i = 0, j = 0; i < SMALL_HASH_SIZE; ++i) {
+               MonitorDesc *mdesc = monitor_hash [i];
+               while (mdesc) {
+                       monitors [j++] = mdesc;
+                       mdesc = mdesc->next;
+               }
+       }
+       qsort (monitors, num_monitors, sizeof (void*), compare_monitor);
+       fprintf (outfile, "\nMonitor lock summary\n");
+       for (i = 0; i < num_monitors; ++i) {
+               MonitorDesc *mdesc = monitors [i];
+               fprintf (outfile, "\tLock object %p: %d contentions\n", (void*)mdesc->objid, (int)mdesc->contentions);
+               fprintf (outfile, "\t\t%.6f secs total wait time, %.6f max, %.6f average\n",
+                       mdesc->wait_time/1000000000.0, mdesc->max_wait_time/1000000000.0, mdesc->wait_time/1000000000.0/mdesc->contentions);
+               dump_traces (&mdesc->traces, "contentions");
+       }
+       fprintf (outfile, "\tLock contentions: %llu\n", (unsigned long long) monitor_contention);
+       fprintf (outfile, "\tLock acquired: %llu\n", (unsigned long long) monitor_acquired);
+       fprintf (outfile, "\tLock failures: %llu\n", (unsigned long long) monitor_failed);
+}
+
+static void
+dump_gcs (void)
+{
+       int i;
+       fprintf (outfile, "\nGC summary\n");
+       fprintf (outfile, "\tGC resizes: %d\n", gc_resizes);
+       fprintf (outfile, "\tMax heap size: %llu\n", (unsigned long long) max_heap_size);
+       fprintf (outfile, "\tObject moves: %llu\n", (unsigned long long) gc_object_moves);
+       for (i = 0; i < 3; ++i) {
+               if (!gc_info [i].count)
+                       continue;
+               fprintf (outfile, "\tGen%d collections: %d, max time: %lluus, total time: %lluus, average: %lluus\n",
+                       i, gc_info [i].count,
+                       (unsigned long long) (gc_info [i].max_time / 1000),
+                       (unsigned long long) (gc_info [i].total_time / 1000),
+                       (unsigned long long) (gc_info [i].total_time / gc_info [i].count / 1000));
+       }
+       for (i = 0; i < 3; ++i) {
+               if (!handle_info [i].max_live)
+                       continue;
+               fprintf (outfile, "\tGC handles %s: created: %llu, destroyed: %llu, max: %llu\n",
+                       get_handle_name (i),
+                       (unsigned long long) (handle_info [i].created),
+                       (unsigned long long) (handle_info [i].destroyed),
+                       (unsigned long long) (handle_info [i].max_live));
+               dump_traces (&handle_info [i].traces, "created");
+               dump_traces (&handle_info [i].destroy_traces, "destroyed");
+       }
+}
+
+static void
+dump_jit (void)
+{
+       int i;
+       int code_size = 0;
+       int compiled_methods = 0;
+       MethodDesc* m;
+       fprintf (outfile, "\nJIT summary\n");
+       for (i = 0; i < HASH_SIZE; ++i) {
+               m = method_hash [i];
+               for (m = method_hash [i]; m; m = m->next) {
+                       if (!m->code || m->ignore_jit)
+                               continue;
+                       compiled_methods++;
+                       code_size += m->len;
+               }
+       }
+       fprintf (outfile, "\tCompiled methods: %d\n", compiled_methods);
+       fprintf (outfile, "\tGenerated code size: %d\n", code_size);
+       fprintf (outfile, "\tJIT helpers: %d\n", num_jit_helpers);
+       fprintf (outfile, "\tJIT helpers code size: %d\n", jit_helpers_code_size);
+}
+
+static void
+dump_allocations (void)
+{
+       int i, c;
+       intptr_t allocs = 0;
+       uint64_t size = 0;
+       int header_done = 0;
+       ClassDesc **classes = (ClassDesc **) g_malloc (num_classes * sizeof (void*));
+       ClassDesc *cd;
+       c = 0;
+       for (i = 0; i < HASH_SIZE; ++i) {
+               cd = class_hash [i];
+               while (cd) {
+                       classes [c++] = cd;
+                       cd = cd->next;
+               }
+       }
+       qsort (classes, num_classes, sizeof (void*), compare_class);
+       for (i = 0; i < num_classes; ++i) {
+               cd = classes [i];
+               if (!cd->allocs)
+                       continue;
+               allocs += cd->allocs;
+               size += cd->alloc_size;
+               if (!header_done++) {
+                       fprintf (outfile, "\nAllocation summary\n");
+                       fprintf (outfile, "%10s %10s %8s Type name\n", "Bytes", "Count", "Average");
+               }
+               fprintf (outfile, "%10llu %10zd %8llu %s\n",
+                       (unsigned long long) (cd->alloc_size),
+                       cd->allocs,
+                       (unsigned long long) (cd->alloc_size / cd->allocs),
+                       cd->name);
+               dump_traces (&cd->traces, "bytes");
+       }
+       if (allocs)
+               fprintf (outfile, "Total memory allocated: %llu bytes in %zd objects\n", (unsigned long long) size, allocs);
+}
+
+enum {
+       METHOD_SORT_TOTAL,
+       METHOD_SORT_SELF,
+       METHOD_SORT_CALLS
+};
+
+static int method_sort_mode = METHOD_SORT_TOTAL;
+
+static int
+compare_method (const void *a, const void *b)
+{
+       MethodDesc *const *A = (MethodDesc *const *)a;
+       MethodDesc *const *B = (MethodDesc *const *)b;
+       uint64_t vala, valb;
+       if (method_sort_mode == METHOD_SORT_SELF) {
+               vala = (*A)->self_time;
+               valb = (*B)->self_time;
+       } else if (method_sort_mode == METHOD_SORT_CALLS) {
+               vala = (*A)->calls;
+               valb = (*B)->calls;
+       } else {
+               vala = (*A)->total_time;
+               valb = (*B)->total_time;
+       }
+       if (vala == valb)
+               return 0;
+       if (valb < vala)
+               return -1;
+       return 1;
+}
+
+static void
+dump_metadata (void)
+{
+       fprintf (outfile, "\nMetadata summary\n");
+       fprintf (outfile, "\tLoaded images: %d\n", num_images);
+       if (verbose) {
+               ImageDesc *image;
+               int i;
+               for (i = 0; i < SMALL_HASH_SIZE; ++i) {
+                       image = image_hash [i];
+                       while (image) {
+                               fprintf (outfile, "\t\t%s\n", image->filename);
+                               image = image->next;
+                       }
+               }
+       }
+       fprintf (outfile, "\tLoaded assemblies: %d\n", num_assemblies);
+       if (verbose) {
+               AssemblyDesc *assembly;
+               int i;
+               for (i = 0; i < SMALL_HASH_SIZE; ++i) {
+                       assembly = assembly_hash [i];
+                       while (assembly) {
+                               fprintf (outfile, "\t\t%s\n", assembly->asmname);
+                               assembly = assembly->next;
+                       }
+               }
+       }
+}
+
+static void
+dump_methods (void)
+{
+       int i, c;
+       uint64_t calls = 0;
+       int header_done = 0;
+       MethodDesc **methods = (MethodDesc **) g_malloc (num_methods * sizeof (void*));
+       MethodDesc *cd;
+       c = 0;
+       for (i = 0; i < HASH_SIZE; ++i) {
+               cd = method_hash [i];
+               while (cd) {
+                       cd->total_time = cd->self_time + cd->callee_time;
+                       methods [c++] = cd;
+                       cd = cd->next;
+               }
+       }
+       qsort (methods, num_methods, sizeof (void*), compare_method);
+       for (i = 0; i < num_methods; ++i) {
+               uint64_t msecs;
+               uint64_t smsecs;
+               cd = methods [i];
+               if (!cd->calls)
+                       continue;
+               calls += cd->calls;
+               msecs = cd->total_time / 1000000;
+               smsecs = (cd->total_time - cd->callee_time) / 1000000;
+               if (!msecs && !verbose)
+                       continue;
+               if (!header_done++) {
+                       fprintf (outfile, "\nMethod call summary\n");
+                       fprintf (outfile, "%8s %8s %10s Method name\n", "Total(ms)", "Self(ms)", "Calls");
+               }
+               fprintf (outfile, "%8llu %8llu %10llu %s\n",
+                       (unsigned long long) (msecs),
+                       (unsigned long long) (smsecs),
+                       (unsigned long long) (cd->calls),
+                       cd->name);
+               dump_traces (&cd->traces, "calls");
+       }
+       if (calls)
+               fprintf (outfile, "Total calls: %llu\n", (unsigned long long) calls);
+}
+
+static int
+compare_heap_class (const void *a, const void *b)
+{
+       HeapClassDesc *const *A = (HeapClassDesc *const *)a;
+       HeapClassDesc *const *B = (HeapClassDesc *const *)b;
+       uint64_t vala, valb;
+       if (alloc_sort_mode == ALLOC_SORT_BYTES) {
+               vala = (*A)->total_size;
+               valb = (*B)->total_size;
+       } else {
+               vala = (*A)->count;
+               valb = (*B)->count;
+       }
+       if (valb == vala)
+               return 0;
+       if (valb < vala)
+               return -1;
+       return 1;
+}
+
+static int
+compare_rev_class (const void *a, const void *b)
+{
+       const HeapClassRevRef *A = (const HeapClassRevRef *)a;
+       const HeapClassRevRef *B = (const HeapClassRevRef *)b;
+       if (B->count == A->count)
+               return 0;
+       if (B->count < A->count)
+               return -1;
+       return 1;
+}
+
+static void
+dump_rev_claases (HeapClassRevRef *revs, int count)
+{
+       int j;
+       if (!show_traces)
+               return;
+       if (!count)
+               return;
+       for (j = 0; j < count; ++j) {
+               HeapClassDesc *cd = revs [j].klass;
+               fprintf (outfile, "\t\t%llu references from: %s\n",
+                       (unsigned long long) (revs [j].count),
+                       cd->klass->name);
+       }
+}
+
+static void
+heap_shot_summary (HeapShot *hs, int hs_num, HeapShot *last_hs)
+{
+       uint64_t size = 0;
+       uint64_t count = 0;
+       int ccount = 0;
+       int i;
+       HeapClassDesc *cd;
+       HeapClassDesc **sorted;
+       sorted = (HeapClassDesc **) g_malloc (sizeof (void*) * hs->class_count);
+       for (i = 0; i < hs->hash_size; ++i) {
+               cd = hs->class_hash [i];
+               if (!cd)
+                       continue;
+               count += cd->count;
+               size += cd->total_size;
+               sorted [ccount++] = cd;
+       }
+       hs->sorted = sorted;
+       qsort (sorted, ccount, sizeof (void*), compare_heap_class);
+       fprintf (outfile, "\n\tHeap shot %d at %.3f secs: size: %llu, object count: %llu, class count: %d, roots: %zd\n",
+               hs_num,
+               (hs->timestamp - startup_time)/1000000000.0,
+               (unsigned long long) (size),
+               (unsigned long long) (count),
+               ccount, hs->num_roots);
+       if (!verbose && ccount > 30)
+               ccount = 30;
+       fprintf (outfile, "\t%10s %10s %8s Class name\n", "Bytes", "Count", "Average");
+       for (i = 0; i < ccount; ++i) {
+               HeapClassRevRef *rev_sorted;
+               int j, k;
+               HeapClassDesc *ocd = NULL;
+               cd = sorted [i];
+               if (last_hs)
+                       ocd = heap_class_lookup (last_hs, cd->klass);
+               fprintf (outfile, "\t%10llu %10llu %8llu %s",
+                       (unsigned long long) (cd->total_size),
+                       (unsigned long long) (cd->count),
+                       (unsigned long long) (cd->total_size / cd->count),
+                       cd->klass->name);
+               if (ocd) {
+                       int64_t bdiff = cd->total_size - ocd->total_size;
+                       int64_t cdiff = cd->count - ocd->count;
+                       fprintf (outfile, " (bytes: %+lld, count: %+lld)\n", (long long) bdiff, (long long) cdiff);
+               } else {
+                       fprintf (outfile, "\n");
+               }
+               if (!collect_traces)
+                       continue;
+               rev_sorted = (HeapClassRevRef *) g_malloc (cd->rev_count * sizeof (HeapClassRevRef));
+               k = 0;
+               for (j = 0; j < cd->rev_hash_size; ++j) {
+                       if (cd->rev_hash [j].klass)
+                               rev_sorted [k++] = cd->rev_hash [j];
+               }
+               assert (cd->rev_count == k);
+               qsort (rev_sorted, cd->rev_count, sizeof (HeapClassRevRef), compare_rev_class);
+               if (cd->root_references)
+                       fprintf (outfile, "\t\t%zd root references (%zd pinning)\n", cd->root_references, cd->pinned_references);
+               dump_rev_claases (rev_sorted, cd->rev_count);
+               g_free (rev_sorted);
+       }
+       g_free (sorted);
+}
+
+static int
+compare_heap_shots (const void *a, const void *b)
+{
+       HeapShot *const *A = (HeapShot *const *)a;
+       HeapShot *const *B = (HeapShot *const *)b;
+       if ((*B)->timestamp == (*A)->timestamp)
+               return 0;
+       if ((*B)->timestamp > (*A)->timestamp)
+               return -1;
+       return 1;
+}
+
+static void
+dump_heap_shots (void)
+{
+       HeapShot **hs_sorted;
+       HeapShot *hs;
+       HeapShot *last_hs = NULL;
+       int i;
+       if (!heap_shots)
+               return;
+       hs_sorted = (HeapShot **) g_malloc (num_heap_shots * sizeof (void*));
+       fprintf (outfile, "\nHeap shot summary\n");
+       i = 0;
+       for (hs = heap_shots; hs; hs = hs->next)
+               hs_sorted [i++] = hs;
+       qsort (hs_sorted, num_heap_shots, sizeof (void*), compare_heap_shots);
+       for (i = 0; i < num_heap_shots; ++i) {
+               hs = hs_sorted [i];
+               heap_shot_summary (hs, i, last_hs);
+               last_hs = hs;
+       }
+}
+
+/* This is a very basic escape function that escapes < > and &
+   Ideally we'd use g_markup_escape_string but that function isn't
+        available in Mono's eglib. This was written without looking at the
+        source of that function in glib. */
+static char *
+escape_string_for_xml (const char *string)
+{
+       GString *string_builder = g_string_new (NULL);
+       const char *start, *p;
+
+       start = p = string;
+       while (*p) {
+               while (*p && *p != '&' && *p != '<' && *p != '>')
+                       p++;
+
+               g_string_append_len (string_builder, start, p - start);
+
+               if (*p == '\0')
+                       break;
+
+               switch (*p) {
+               case '<':
+                       g_string_append (string_builder, "&lt;");
+                       break;
+
+               case '>':
+                       g_string_append (string_builder, "&gt;");
+                       break;
+
+               case '&':
+                       g_string_append (string_builder, "&amp;");
+                       break;
+
+               default:
+                       break;
+               }
+
+               p++;
+               start = p;
+       }
+
+       return g_string_free (string_builder, FALSE);
+}
+
+static int
+sort_assemblies (gconstpointer a, gconstpointer b)
+{
+       CoverageAssembly *assembly_a = *(CoverageAssembly **)a;
+       CoverageAssembly *assembly_b = *(CoverageAssembly **)b;
+
+       if (assembly_a->name == NULL && assembly_b->name == NULL)
+               return 0;
+       else if (assembly_a->name == NULL)
+               return -1;
+       else if (assembly_b->name == NULL)
+               return 1;
+
+       return strcmp (assembly_a->name, assembly_b->name);
+}
+
+static void
+dump_coverage (void)
+{
+       if (!coverage_methods && !coverage_assemblies)
+               return;
+
+       gather_coverage_statements ();
+       fprintf (outfile, "\nCoverage Summary:\n");
+
+       if (coverage_outfile) {
+               fprintf (coverage_outfile, "<?xml version=\"1.0\"?>\n");
+               fprintf (coverage_outfile, "<coverage version=\"0.3\">\n");
+       }
+
+       g_ptr_array_sort (coverage_assemblies, sort_assemblies);
+
+       for (guint i = 0; i < coverage_assemblies->len; i++) {
+               CoverageAssembly *assembly = (CoverageAssembly *)coverage_assemblies->pdata[i];
+               GPtrArray *classes;
+
+               if (assembly->number_of_methods != 0) {
+                       int percentage = ((assembly->fully_covered + assembly->partially_covered) * 100) / assembly->number_of_methods;
+                       fprintf (outfile, "\t%s (%s) %d%% covered (%d methods - %d covered)\n", assembly->name, assembly->filename, percentage, assembly->number_of_methods, assembly->fully_covered);
+               } else
+                       fprintf (outfile, "\t%s (%s) ?%% covered (%d methods - %d covered)\n", assembly->name, assembly->filename, assembly->number_of_methods, assembly->fully_covered);
+
+               if (coverage_outfile) {
+                       char *escaped_name, *escaped_filename;
+                       escaped_name = escape_string_for_xml (assembly->name);
+                       escaped_filename = escape_string_for_xml (assembly->filename);
+
+                       fprintf (coverage_outfile, "\t<assembly name=\"%s\" guid=\"%s\" filename=\"%s\" method-count=\"%d\" full=\"%d\" partial=\"%d\"/>\n", escaped_name, assembly->guid, escaped_filename, assembly->number_of_methods, assembly->fully_covered, assembly->partially_covered);
+
+                       g_free (escaped_name);
+                       g_free (escaped_filename);
+               }
+
+               classes = (GPtrArray *)g_hash_table_lookup (coverage_assembly_classes, assembly->name);
+               if (classes) {
+                       for (guint j = 0; j < classes->len; j++) {
+                               CoverageClass *klass = (CoverageClass *)classes->pdata [j];
+
+                               if (klass->number_of_methods > 0) {
+                                       int percentage = ((klass->fully_covered + klass->partially_covered) * 100) / klass->number_of_methods;
+                                       fprintf (outfile, "\t\t%s %d%% covered (%d methods - %d covered)\n", klass->class_name, percentage, klass->number_of_methods, klass->fully_covered);
+                               } else
+                                       fprintf (outfile, "\t\t%s ?%% covered (%d methods - %d covered)\n", klass->class_name, klass->number_of_methods, klass->fully_covered);
+
+                               if (coverage_outfile) {
+                                       char *escaped_name;
+                                       escaped_name = escape_string_for_xml (klass->class_name);
+
+                                       fprintf (coverage_outfile, "\t\t<class name=\"%s\" method-count=\"%d\" full=\"%d\" partial=\"%d\"/>\n", escaped_name, klass->number_of_methods, klass->fully_covered, klass->partially_covered);
+                                       g_free (escaped_name);
+                               }
+                       }
+               }
+       }
+
+       for (guint i = 0; i < coverage_methods->len; i++) {
+               CoverageMethod *method = (CoverageMethod *)coverage_methods->pdata [i];
+
+               if (coverage_outfile) {
+                       char *escaped_assembly, *escaped_class, *escaped_method, *escaped_sig, *escaped_filename;
+
+                       escaped_assembly = escape_string_for_xml (method->assembly_name);
+                       escaped_class = escape_string_for_xml (method->class_name);
+                       escaped_method = escape_string_for_xml (method->method_name);
+                       escaped_sig = escape_string_for_xml (method->method_signature);
+                       escaped_filename = escape_string_for_xml (method->filename);
+
+                       fprintf (coverage_outfile, "\t<method assembly=\"%s\" class=\"%s\" name=\"%s (%s)\" filename=\"%s\" token=\"%d\">\n", escaped_assembly, escaped_class, escaped_method, escaped_sig, escaped_filename, method->token);
+
+                       g_free (escaped_assembly);
+                       g_free (escaped_class);
+                       g_free (escaped_method);
+                       g_free (escaped_sig);
+                       g_free (escaped_filename);
+
+                       for (guint j = 0; j < method->coverage->len; j++) {
+                               CoverageCoverage *coverage = (CoverageCoverage *)method->coverage->pdata [j];
+                               fprintf (coverage_outfile, "\t\t<statement offset=\"%d\" counter=\"%d\" line=\"%d\" column=\"%d\"/>\n", coverage->offset, coverage->count, coverage->line, coverage->column);
+                       }
+                       fprintf (coverage_outfile, "\t</method>\n");
+               }
+       }
+
+       if (coverage_outfile) {
+               fprintf (coverage_outfile, "</coverage>\n");
+               fclose (coverage_outfile);
+               coverage_outfile = NULL;
+       }
+}
+
+#define DUMP_EVENT_STAT(EVENT,SUBTYPE) dump_event (#EVENT, #SUBTYPE, EVENT, SUBTYPE);
+
+static void
+dump_event (const char *event_name, const char *subtype_name, int event, int subtype)
+{
+       int idx = event | subtype;
+       EventStat evt = stats [idx];
+       if (!evt.count)
+               return;
+
+       fprintf (outfile, "\t%16s\t%26s\tcount %6d\tmin %3d\tmax %6d\tbytes %d\n", event_name, subtype_name, evt.count, evt.min_size, evt.max_size, evt.bytes);
+}
+
+static void
+dump_stats (void)
+{
+       fprintf (outfile, "\nMlpd statistics\n");
+       fprintf (outfile, "\tBuffer count %d\toverhead %d (%d bytes per header)\n", buffer_count, buffer_count * BUFFER_HEADER_SIZE, BUFFER_HEADER_SIZE);
+       fprintf (outfile, "\nEvent details:\n");
+
+       DUMP_EVENT_STAT (TYPE_ALLOC, TYPE_ALLOC_NO_BT);
+       DUMP_EVENT_STAT (TYPE_ALLOC, TYPE_ALLOC_BT);
+
+       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_EVENT);
+       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_RESIZE);
+       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_MOVE);
+       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_HANDLE_CREATED);
+       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_HANDLE_DESTROYED);
+       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_HANDLE_CREATED_BT);
+       DUMP_EVENT_STAT (TYPE_GC, TYPE_GC_HANDLE_DESTROYED_BT);
+
+       DUMP_EVENT_STAT (TYPE_METADATA, TYPE_END_LOAD);
+       DUMP_EVENT_STAT (TYPE_METADATA, TYPE_END_UNLOAD);
+
+       DUMP_EVENT_STAT (TYPE_METHOD, TYPE_LEAVE);
+       DUMP_EVENT_STAT (TYPE_METHOD, TYPE_ENTER);
+       DUMP_EVENT_STAT (TYPE_METHOD, TYPE_EXC_LEAVE);
+       DUMP_EVENT_STAT (TYPE_METHOD, TYPE_JIT);
+
+       DUMP_EVENT_STAT (TYPE_EXCEPTION, TYPE_THROW_NO_BT);
+       DUMP_EVENT_STAT (TYPE_EXCEPTION, TYPE_THROW_BT);
+       DUMP_EVENT_STAT (TYPE_EXCEPTION, TYPE_CLAUSE);
+
+       DUMP_EVENT_STAT (TYPE_MONITOR, TYPE_MONITOR_NO_BT);
+       DUMP_EVENT_STAT (TYPE_MONITOR, TYPE_MONITOR_BT);
+
+       DUMP_EVENT_STAT (TYPE_HEAP, TYPE_HEAP_START);
+       DUMP_EVENT_STAT (TYPE_HEAP, TYPE_HEAP_END);
+       DUMP_EVENT_STAT (TYPE_HEAP, TYPE_HEAP_OBJECT);
+       DUMP_EVENT_STAT (TYPE_HEAP, TYPE_HEAP_ROOT);
+
+       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_HIT);
+       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_USYM);
+       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_UBIN);
+       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_COUNTERS_DESC);
+       DUMP_EVENT_STAT (TYPE_SAMPLE, TYPE_SAMPLE_COUNTERS);
+
+       DUMP_EVENT_STAT (TYPE_RUNTIME, TYPE_JITHELPER);
+
+       DUMP_EVENT_STAT (TYPE_COVERAGE, TYPE_COVERAGE_ASSEMBLY);
+       DUMP_EVENT_STAT (TYPE_COVERAGE, TYPE_COVERAGE_METHOD);
+       DUMP_EVENT_STAT (TYPE_COVERAGE, TYPE_COVERAGE_STATEMENT);
+       DUMP_EVENT_STAT (TYPE_COVERAGE, TYPE_COVERAGE_CLASS);
+
+       DUMP_EVENT_STAT (TYPE_META, TYPE_SYNC_POINT);
+}
+
+
+
+static void
+flush_context (ProfContext *ctx)
+{
+       ThreadContext *thread;
+       /* FIXME: sometimes there are leftovers: indagate */
+       for (thread = ctx->threads; thread; thread = thread->next) {
+               while (thread->stack_id) {
+                       if (debug)
+                               fprintf (outfile, "thread %p has %d items on stack\n", (void*)thread->thread_id, thread->stack_id);
+                       pop_method (thread, thread->stack [thread->stack_id - 1], thread->last_time);
+               }
+       }
+}
+
+static const char *reports = "header,jit,gc,sample,alloc,call,metadata,exception,monitor,thread,heapshot,counters,coverage";
+
+static const char*
+match_option (const char *p, const char *opt)
+{
+       int len = strlen (opt);
+       if (strncmp (p, opt, len) == 0) {
+               if (p [len] == ',')
+                       len++;
+               return p + len;
+       }
+       return p;
+}
+
+static int
+print_reports (ProfContext *ctx, const char *reps, int parse_only)
+{
+       const char *opt;
+       const char *p;
+       for (p = reps; *p; p = opt) {
+               if ((opt = match_option (p, "header")) != p) {
+                       if (!parse_only)
+                               dump_header (ctx);
+                       continue;
+               }
+               if ((opt = match_option (p, "thread")) != p) {
+                       if (!parse_only)
+                               dump_threads (ctx);
+                       continue;
+               }
+               if ((opt = match_option (p, "domain")) != p) {
+                       if (!parse_only)
+                               dump_domains (ctx);
+                       continue;
+               }
+               if ((opt = match_option (p, "context")) != p) {
+                       if (!parse_only)
+                               dump_remctxs (ctx);
+                       continue;
+               }
+               if ((opt = match_option (p, "gc")) != p) {
+                       if (!parse_only)
+                               dump_gcs ();
+                       continue;
+               }
+               if ((opt = match_option (p, "jit")) != p) {
+                       if (!parse_only)
+                               dump_jit ();
+                       continue;
+               }
+               if ((opt = match_option (p, "alloc")) != p) {
+                       if (!parse_only)
+                               dump_allocations ();
+                       continue;
+               }
+               if ((opt = match_option (p, "call")) != p) {
+                       if (!parse_only)
+                               dump_methods ();
+                       continue;
+               }
+               if ((opt = match_option (p, "metadata")) != p) {
+                       if (!parse_only)
+                               dump_metadata ();
+                       continue;
+               }
+               if ((opt = match_option (p, "exception")) != p) {
+                       if (!parse_only)
+                               dump_exceptions ();
+                       continue;
+               }
+               if ((opt = match_option (p, "monitor")) != p) {
+                       if (!parse_only)
+                               dump_monitors ();
+                       continue;
+               }
+               if ((opt = match_option (p, "heapshot")) != p) {
+                       if (!parse_only)
+                               dump_heap_shots ();
+                       continue;
+               }
+               if ((opt = match_option (p, "sample")) != p) {
+                       if (!parse_only)
+                               dump_samples ();
+                       continue;
+               }
+               if ((opt = match_option (p, "counters")) != p) {
+                       if (!parse_only)
+                               dump_counters ();
+                       continue;
+               }
+               if ((opt = match_option (p, "coverage")) != p) {
+                       if (!parse_only)
+                               dump_coverage ();
+                       continue;
+               }
+               if ((opt = match_option (p, "stats")) != p) {
+                       if (!parse_only)
+                               dump_stats ();
+                       continue;
+               }
+               return 0;
+       }
+       return 1;
+}
+
+static int
+add_find_spec (const char *p)
+{
+       if (p [0] == 'S' && p [1] == ':') {
+               char *vale;
+               find_size = strtoul (p + 2, &vale, 10);
+               return 1;
+       } else if (p [0] == 'T' && p [1] == ':') {
+               find_name = p + 2;
+               return 1;
+       }
+       return 0;
+}
+
+static void
+usage (void)
+{
+       printf ("Mono log profiler report version %d.%d\n", LOG_VERSION_MAJOR, LOG_VERSION_MINOR);
+       printf ("Usage: mprof-report [OPTIONS] FILENAME\n");
+       printf ("FILENAME can be '-' to read from standard input.\n");
+       printf ("Options:\n");
+       printf ("\t--help               display this help\n");
+       printf ("\t--out=FILE           write to FILE instead of stdout\n");
+       printf ("\t--traces             collect and show backtraces\n");
+       printf ("\t--maxframes=NUM      limit backtraces to NUM entries\n");
+       printf ("\t--reports=R1[,R2...] print the specified reports. Defaults are:\n");
+       printf ("\t                     %s\n", reports);
+       printf ("\t--method-sort=MODE   sort methods according to MODE: total, self, calls\n");
+       printf ("\t--alloc-sort=MODE    sort allocations according to MODE: bytes, count\n");
+       printf ("\t--counters-sort=MODE sort counters according to MODE: time, category\n");
+       printf ("\t                     only accessible in verbose mode\n");
+       printf ("\t--track=OB1[,OB2...] track what happens to objects OBJ1, O2 etc.\n");
+       printf ("\t--find=FINDSPEC      find and track objects matching FINFSPEC, where FINDSPEC is:\n");
+       printf ("\t                     S:minimum_size or T:partial_name\n");
+       printf ("\t--thread=THREADID    consider just the data for thread THREADID\n");
+       printf ("\t--time=FROM-TO       consider data FROM seconds from startup up to TO seconds\n");
+       printf ("\t--verbose            increase verbosity level\n");
+       printf ("\t--debug              display decoding debug info for mprof-report devs\n");
+       printf ("\t--coverage-out=FILE  write the coverage info to FILE as XML\n");
+}
+
+int
+main (int argc, char *argv[])
+{
+       ProfContext *ctx;
+       int i;
+       outfile = stdout;
+       for (i = 1; i < argc; ++i) {
+               if (strcmp ("--debug", argv [i]) == 0) {
+                       debug++;
+               } else if (strcmp ("--help", argv [i]) == 0) {
+                       usage ();
+                       return 0;
+               } else if (strncmp ("--alloc-sort=", argv [i], 13) == 0) {
+                       const char *val = argv [i] + 13;
+                       if (strcmp (val, "bytes") == 0) {
+                               alloc_sort_mode = ALLOC_SORT_BYTES;
+                       } else if (strcmp (val, "count") == 0) {
+                               alloc_sort_mode = ALLOC_SORT_COUNT;
+                       } else {
+                               usage ();
+                               return 1;
+                       }
+               } else if (strncmp ("--method-sort=", argv [i], 14) == 0) {
+                       const char *val = argv [i] + 14;
+                       if (strcmp (val, "total") == 0) {
+                               method_sort_mode = METHOD_SORT_TOTAL;
+                       } else if (strcmp (val, "self") == 0) {
+                               method_sort_mode = METHOD_SORT_SELF;
+                       } else if (strcmp (val, "calls") == 0) {
+                               method_sort_mode = METHOD_SORT_CALLS;
+                       } else {
+                               usage ();
+                               return 1;
+                       }
+               } else if (strncmp ("--counters-sort=", argv [i], 16) == 0) {
+                       const char *val = argv [i] + 16;
+                       if (strcmp (val, "time") == 0) {
+                               counters_sort_mode = COUNTERS_SORT_TIME;
+                       } else if (strcmp (val, "category") == 0) {
+                               counters_sort_mode = COUNTERS_SORT_CATEGORY;
+                       } else {
+                               usage ();
+                               return 1;
+                       }
+               } else if (strncmp ("--reports=", argv [i], 10) == 0) {
+                       const char *val = argv [i] + 10;
+                       if (!print_reports (NULL, val, 1)) {
+                               usage ();
+                               return 1;
+                       }
+                       reports = val;
+               } else if (strncmp ("--out=", argv [i], 6) == 0) {
+                       const char *val = argv [i] + 6;
+                       outfile = fopen (val, "w");
+                       if (!outfile) {
+                               printf ("Cannot open output file: %s\n", val);
+                               return 1;
+                       }
+               } else if (strncmp ("--maxframes=", argv [i], 12) == 0) {
+                       const char *val = argv [i] + 12;
+                       char *vale;
+                       trace_max = strtoul (val, &vale, 10);
+               } else if (strncmp ("--find=", argv [i], 7) == 0) {
+                       const char *val = argv [i] + 7;
+                       if (!add_find_spec (val)) {
+                               usage ();
+                               return 1;
+                       }
+               } else if (strncmp ("--track=", argv [i], 8) == 0) {
+                       const char *val = argv [i] + 8;
+                       char *vale;
+                       while (*val) {
+                               uintptr_t tracked_obj;
+                               if (*val == ',') {
+                                       val++;
+                                       continue;
+                               }
+                               tracked_obj = strtoul (val, &vale, 0);
+                               found_object (tracked_obj);
+                               val = vale;
+                       }
+               } else if (strncmp ("--thread=", argv [i], 9) == 0) {
+                       const char *val = argv [i] + 9;
+                       char *vale;
+                       thread_filter = strtoul (val, &vale, 0);
+               } else if (strncmp ("--time=", argv [i], 7) == 0) {
+                       char *val = pstrdup (argv [i] + 7);
+                       double from_secs, to_secs;
+                       char *top = strchr (val, '-');
+                       if (!top) {
+                               usage ();
+                               return 1;
+                       }
+                       *top++ = 0;
+                       from_secs = atof (val);
+                       to_secs = atof (top);
+                       g_free (val);
+                       if (from_secs > to_secs) {
+                               usage ();
+                               return 1;
+                       }
+                       time_from = from_secs * 1000000000;
+                       time_to = to_secs * 1000000000;
+                       use_time_filter = 1;
+               } else if (strcmp ("--verbose", argv [i]) == 0) {
+                       verbose++;
+               } else if (strcmp ("--traces", argv [i]) == 0) {
+                       show_traces = 1;
+                       collect_traces = 1;
+               } else if (strncmp ("--coverage-out=", argv [i], 15) == 0) {
+                       const char *val = argv [i] + 15;
+                       coverage_outfile = fopen (val, "w");
+                       if (!coverage_outfile) {
+                               printf ("Cannot open output file: %s\n", val);
+                               return 1;
+                       }
+               } else {
+                       break;
+               }
+       }
+       if (i >= argc) {
+               usage ();
+               return 2;
+       }
+       ctx = load_file (argv [i]);
+       if (!ctx) {
+               printf ("Not a log profiler data file (or unsupported version).\n");
+               return 1;
+       }
+       while (decode_buffer (ctx));
+       flush_context (ctx);
+       if (num_tracked_objects)
+               return 0;
+       print_reports (ctx, reports, 0);
+       return 0;
+}
diff --git a/mono/profiler/proflog.c b/mono/profiler/proflog.c
deleted file mode 100644 (file)
index 17f4383..0000000
+++ /dev/null
@@ -1,5394 +0,0 @@
-/*
- * proflog.c: mono log profiler
- *
- * Authors:
- *   Paolo Molaro (lupus@ximian.com)
- *   Alex Rønne Petersen (alexrp@xamarin.com)
- *
- * Copyright 2010 Novell, Inc (http://www.novell.com)
- * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include <config.h>
-#include "../mini/jit.h"
-#include "../metadata/metadata-internals.h"
-#include <mono/metadata/profiler.h>
-#include <mono/metadata/threads.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/mono-config.h>
-#include <mono/metadata/mono-gc.h>
-#include <mono/metadata/mono-perfcounters.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/assembly.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/utils/atomic.h>
-#include <mono/utils/mono-membar.h>
-#include <mono/utils/mono-mmap.h>
-#include <mono/utils/mono-counters.h>
-#include <mono/utils/mono-os-mutex.h>
-#include <mono/utils/mono-os-semaphore.h>
-#include <mono/utils/mono-conc-hashtable.h>
-#include <mono/utils/mono-linked-list-set.h>
-#include <mono/utils/lock-free-alloc.h>
-#include <mono/utils/lock-free-queue.h>
-#include <mono/utils/hazard-pointer.h>
-#include <mono/utils/mono-threads.h>
-#include <mono/utils/mono-threads-api.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <glib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_SCHED_GETAFFINITY
-#include <sched.h>
-#endif
-#include <fcntl.h>
-#include <errno.h>
-#if defined(HOST_WIN32) || defined(DISABLE_SOCKETS)
-#define DISABLE_HELPER_THREAD 1
-#endif
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-#ifdef HAVE_EXECINFO_H
-#include <execinfo.h>
-#endif
-#ifdef HAVE_LINK_H
-#include <link.h>
-#endif
-
-#ifndef DISABLE_HELPER_THREAD
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/select.h>
-#endif
-
-#ifdef HOST_WIN32
-#include <windows.h>
-#else
-#include <pthread.h>
-#endif
-
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#include "utils.c"
-#include "proflog.h"
-
-#if defined (HAVE_SYS_ZLIB)
-#include <zlib.h>
-#endif
-
-#if defined(__linux__)
-
-#include <unistd.h>
-#include <sys/syscall.h>
-
-#ifdef ENABLE_PERF_EVENTS
-#include <linux/perf_event.h>
-
-#define USE_PERF_EVENTS 1
-
-static int read_perf_mmap (MonoProfiler* prof, int cpu);
-#endif
-
-#endif
-
-#define BUFFER_SIZE (4096 * 16)
-
-/* Worst-case size in bytes of a 64-bit value encoded with LEB128. */
-#define LEB128_SIZE 10
-/* Size of a value encoded as a single byte. */
-#define BYTE_SIZE 1
-/* Size in bytes of the event prefix (ID + time). */
-#define EVENT_SIZE (BYTE_SIZE + LEB128_SIZE)
-
-static int nocalls = 0;
-static int notraces = 0;
-static int use_zip = 0;
-static int do_report = 0;
-static int do_heap_shot = 0;
-static int max_call_depth = 100;
-static volatile int runtime_inited = 0;
-static int need_helper_thread = 0;
-static int command_port = 0;
-static int heapshot_requested = 0;
-static int sample_type = 0;
-static int sample_freq = 0;
-static int do_mono_sample = 0;
-static int in_shutdown = 0;
-static int do_debug = 0;
-static int do_counters = 0;
-static int do_coverage = 0;
-static gboolean debug_coverage = FALSE;
-static MonoProfileSamplingMode sampling_mode = MONO_PROFILER_STAT_MODE_PROCESS;
-static int max_allocated_sample_hits;
-
-static gint32 sample_hits;
-static gint32 sample_flushes;
-static gint32 sample_allocations;
-static gint32 buffer_allocations;
-static gint32 thread_starts;
-static gint32 thread_ends;
-static gint32 domain_loads;
-static gint32 domain_unloads;
-static gint32 context_loads;
-static gint32 context_unloads;
-static gint32 assembly_loads;
-static gint32 assembly_unloads;
-static gint32 image_loads;
-static gint32 image_unloads;
-static gint32 class_loads;
-static gint32 class_unloads;
-
-static MonoLinkedListSet profiler_thread_list;
-
-/*
- * file format:
- * [header] [buffer]*
- *
- * The file is composed by a header followed by 0 or more buffers.
- * Each buffer contains events that happened on a thread: for a given thread
- * buffers that appear later in the file are guaranteed to contain events
- * that happened later in time. Buffers from separate threads could be interleaved,
- * though.
- * Buffers are not required to be aligned.
- *
- * header format:
- * [id: 4 bytes] constant value: LOG_HEADER_ID
- * [major: 1 byte] [minor: 1 byte] major and minor version of the log profiler
- * [format: 1 byte] version of the data format for the rest of the file
- * [ptrsize: 1 byte] size in bytes of a pointer in the profiled program
- * [startup time: 8 bytes] time in milliseconds since the unix epoch when the program started
- * [timer overhead: 4 bytes] approximate overhead in nanoseconds of the timer
- * [flags: 4 bytes] file format flags, should be 0 for now
- * [pid: 4 bytes] pid of the profiled process
- * [port: 2 bytes] tcp port for server if != 0
- * [args size: 4 bytes] size of args
- * [args: string] arguments passed to the profiler
- * [arch size: 4 bytes] size of arch
- * [arch: string] architecture the profiler is running on
- * [os size: 4 bytes] size of os
- * [os: string] operating system the profiler is running on
- *
- * The multiple byte integers are in little-endian format.
- *
- * buffer format:
- * [buffer header] [event]*
- * Buffers have a fixed-size header followed by 0 or more bytes of event data.
- * Timing information and other values in the event data are usually stored
- * as uleb128 or sleb128 integers. To save space, as noted for each item below,
- * some data is represented as a difference between the actual value and
- * either the last value of the same type (like for timing information) or
- * as the difference from a value stored in a buffer header.
- *
- * For timing information the data is stored as uleb128, since timing
- * increases in a monotonic way in each thread: the value is the number of
- * nanoseconds to add to the last seen timing data in a buffer. The first value
- * in a buffer will be calculated from the time_base field in the buffer head.
- *
- * Object or heap sizes are stored as uleb128.
- * Pointer differences are stored as sleb128, instead.
- *
- * If an unexpected value is found, the rest of the buffer should be ignored,
- * as generally the later values need the former to be interpreted correctly.
- *
- * buffer header format:
- * [bufid: 4 bytes] constant value: BUF_ID
- * [len: 4 bytes] size of the data following the buffer header
- * [time_base: 8 bytes] time base in nanoseconds since an unspecified epoch
- * [ptr_base: 8 bytes] base value for pointers
- * [obj_base: 8 bytes] base value for object addresses
- * [thread id: 8 bytes] system-specific thread ID (pthread_t for example)
- * [method_base: 8 bytes] base value for MonoMethod pointers
- *
- * event format:
- * [extended info: upper 4 bits] [type: lower 4 bits]
- * [time diff: uleb128] nanoseconds since last timing
- * [data]*
- * The data that follows depends on type and the extended info.
- * Type is one of the enum values in proflog.h: TYPE_ALLOC, TYPE_GC,
- * TYPE_METADATA, TYPE_METHOD, TYPE_EXCEPTION, TYPE_MONITOR, TYPE_HEAP.
- * The extended info bits are interpreted based on type, see
- * each individual event description below.
- * strings are represented as a 0-terminated utf8 sequence.
- *
- * backtrace format:
- * [num: uleb128] number of frames following
- * [frame: sleb128]* mum MonoMethod* as a pointer difference from the last such
- * pointer or the buffer method_base
- *
- * type alloc format:
- * type: TYPE_ALLOC
- * exinfo: flags: TYPE_ALLOC_BT
- * [ptr: sleb128] class as a byte difference from ptr_base
- * [obj: sleb128] object address as a byte difference from obj_base
- * [size: uleb128] size of the object in the heap
- * If the TYPE_ALLOC_BT flag is set, a backtrace follows.
- *
- * type GC format:
- * type: TYPE_GC
- * exinfo: one of TYPE_GC_EVENT, TYPE_GC_RESIZE, TYPE_GC_MOVE, TYPE_GC_HANDLE_CREATED[_BT],
- * TYPE_GC_HANDLE_DESTROYED[_BT], TYPE_GC_FINALIZE_START, TYPE_GC_FINALIZE_END,
- * TYPE_GC_FINALIZE_OBJECT_START, TYPE_GC_FINALIZE_OBJECT_END
- * if exinfo == TYPE_GC_RESIZE
- *     [heap_size: uleb128] new heap size
- * if exinfo == TYPE_GC_EVENT
- *     [event type: byte] GC event (MONO_GC_EVENT_* from profiler.h)
- *     [generation: byte] GC generation event refers to
- * if exinfo == TYPE_GC_MOVE
- *     [num_objects: uleb128] number of object moves that follow
- *     [objaddr: sleb128]+ num_objects object pointer differences from obj_base
- *     num is always an even number: the even items are the old
- *     addresses, the odd numbers are the respective new object addresses
- * if exinfo == TYPE_GC_HANDLE_CREATED[_BT]
- *     [handle_type: uleb128] GC handle type (System.Runtime.InteropServices.GCHandleType)
- *     upper bits reserved as flags
- *     [handle: uleb128] GC handle value
- *     [objaddr: sleb128] object pointer differences from obj_base
- *     If exinfo == TYPE_GC_HANDLE_CREATED_BT, a backtrace follows.
- * if exinfo == TYPE_GC_HANDLE_DESTROYED[_BT]
- *     [handle_type: uleb128] GC handle type (System.Runtime.InteropServices.GCHandleType)
- *     upper bits reserved as flags
- *     [handle: uleb128] GC handle value
- *     If exinfo == TYPE_GC_HANDLE_DESTROYED_BT, a backtrace follows.
- * if exinfo == TYPE_GC_FINALIZE_OBJECT_{START,END}
- *     [object: sleb128] the object as a difference from obj_base
- *
- * type metadata format:
- * type: TYPE_METADATA
- * exinfo: one of: TYPE_END_LOAD, TYPE_END_UNLOAD (optional for TYPE_THREAD and TYPE_DOMAIN)
- * [mtype: byte] metadata type, one of: TYPE_CLASS, TYPE_IMAGE, TYPE_ASSEMBLY, TYPE_DOMAIN,
- * TYPE_THREAD, TYPE_CONTEXT
- * [pointer: sleb128] pointer of the metadata type depending on mtype
- * if mtype == TYPE_CLASS
- *     [image: sleb128] MonoImage* as a pointer difference from ptr_base
- *     [name: string] full class name
- * if mtype == TYPE_IMAGE
- *     [name: string] image file name
- * if mtype == TYPE_ASSEMBLY
- *     [name: string] assembly name
- * if mtype == TYPE_DOMAIN && exinfo == 0
- *     [name: string] domain friendly name
- * if mtype == TYPE_CONTEXT
- *     [domain: sleb128] domain id as pointer
- * if mtype == TYPE_THREAD && exinfo == 0
- *     [name: string] thread name
- *
- * type method format:
- * type: TYPE_METHOD
- * exinfo: one of: TYPE_LEAVE, TYPE_ENTER, TYPE_EXC_LEAVE, TYPE_JIT
- * [method: sleb128] MonoMethod* as a pointer difference from the last such
- * pointer or the buffer method_base
- * if exinfo == TYPE_JIT
- *     [code address: sleb128] pointer to the native code as a diff from ptr_base
- *     [code size: uleb128] size of the generated code
- *     [name: string] full method name
- *
- * type exception format:
- * type: TYPE_EXCEPTION
- * exinfo: TYPE_THROW_BT flag or one of: TYPE_CLAUSE
- * if exinfo == TYPE_CLAUSE
- *     [clause type: byte] MonoExceptionEnum enum value
- *     [clause index: uleb128] index of the current clause
- *     [method: sleb128] MonoMethod* as a pointer difference from the last such
- *     pointer or the buffer method_base
- * else
- *     [object: sleb128] the exception object as a difference from obj_base
- *     if exinfo has TYPE_THROW_BT set, a backtrace follows.
- *
- * type runtime format:
- * type: TYPE_RUNTIME
- * exinfo: one of: TYPE_JITHELPER
- * if exinfo == TYPE_JITHELPER
- *     [type: byte] MonoProfilerCodeBufferType enum value
- *     [buffer address: sleb128] pointer to the native code as a diff from ptr_base
- *     [buffer size: uleb128] size of the generated code
- *     if type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE
- *             [name: string] buffer description name
- *
- * type monitor format:
- * type: TYPE_MONITOR
- * exinfo: TYPE_MONITOR_BT flag and one of: MONO_PROFILER_MONITOR_(CONTENTION|FAIL|DONE)
- * [object: sleb128] the lock object as a difference from obj_base
- * if exinfo.low3bits == MONO_PROFILER_MONITOR_CONTENTION
- *     If the TYPE_MONITOR_BT flag is set, a backtrace follows.
- *
- * type heap format
- * type: TYPE_HEAP
- * exinfo: one of TYPE_HEAP_START, TYPE_HEAP_END, TYPE_HEAP_OBJECT, TYPE_HEAP_ROOT
- * if exinfo == TYPE_HEAP_OBJECT
- *     [object: sleb128] the object as a difference from obj_base
- *     [class: sleb128] the object MonoClass* as a difference from ptr_base
- *     [size: uleb128] size of the object on the heap
- *     [num_refs: uleb128] number of object references
- *     each referenced objref is preceded by a uleb128 encoded offset: the
- *     first offset is from the object address and each next offset is relative
- *     to the previous one
- *     [objrefs: sleb128]+ object referenced as a difference from obj_base
- *     The same object can appear multiple times, but only the first time
- *     with size != 0: in the other cases this data will only be used to
- *     provide additional referenced objects.
- * if exinfo == TYPE_HEAP_ROOT
- *     [num_roots: uleb128] number of root references
- *     [num_gc: uleb128] number of major gcs
- *     [object: sleb128] the object as a difference from obj_base
- *     [root_type: byte] the root_type: MonoProfileGCRootType (profiler.h)
- *     [extra_info: uleb128] the extra_info value
- *     object, root_type and extra_info are repeated num_roots times
- *
- * type sample format
- * type: TYPE_SAMPLE
- * exinfo: one of TYPE_SAMPLE_HIT, TYPE_SAMPLE_USYM, TYPE_SAMPLE_UBIN, TYPE_SAMPLE_COUNTERS_DESC, TYPE_SAMPLE_COUNTERS
- * if exinfo == TYPE_SAMPLE_HIT
- *     [sample_type: byte] type of sample (SAMPLE_*)
- *     [thread: sleb128] thread id as difference from ptr_base
- *     [count: uleb128] number of following instruction addresses
- *     [ip: sleb128]* instruction pointer as difference from ptr_base
- *     [mbt_count: uleb128] number of managed backtrace frames
- *     [method: sleb128]* MonoMethod* as a pointer difference from the last such
- *     pointer or the buffer method_base (the first such method can be also indentified by ip, but this is not neccessarily true)
- * if exinfo == TYPE_SAMPLE_USYM
- *     [address: sleb128] symbol address as a difference from ptr_base
- *     [size: uleb128] symbol size (may be 0 if unknown)
- *     [name: string] symbol name
- * if exinfo == TYPE_SAMPLE_UBIN
- *     [address: sleb128] address where binary has been loaded
- *     [offset: uleb128] file offset of mapping (the same file can be mapped multiple times)
- *     [size: uleb128] memory size
- *     [name: string] binary name
- * if exinfo == TYPE_SAMPLE_COUNTERS_DESC
- *     [len: uleb128] number of counters
- *     for i = 0 to len
- *             [section: uleb128] section of counter
- *             if section == MONO_COUNTER_PERFCOUNTERS:
- *                     [section_name: string] section name of counter
- *             [name: string] name of counter
- *             [type: byte] type of counter
- *             [unit: byte] unit of counter
- *             [variance: byte] variance of counter
- *             [index: uleb128] unique index of counter
- * if exinfo == TYPE_SAMPLE_COUNTERS
- *     while true:
- *             [index: uleb128] unique index of counter
- *             if index == 0:
- *                     break
- *             [type: byte] type of counter value
- *             if type == string:
- *                     if value == null:
- *                             [0: uleb128] 0 -> value is null
- *                     else:
- *                             [1: uleb128] 1 -> value is not null
- *                             [value: string] counter value
- *             else:
- *                     [value: uleb128/sleb128/double] counter value, can be sleb128, uleb128 or double (determined by using type)
- *
- * type coverage format
- * type: TYPE_COVERAGE
- * exinfo: one of TYPE_COVERAGE_METHOD, TYPE_COVERAGE_STATEMENT, TYPE_COVERAGE_ASSEMBLY, TYPE_COVERAGE_CLASS
- * if exinfo == TYPE_COVERAGE_METHOD
- *  [assembly: string] name of assembly
- *  [class: string] name of the class
- *  [name: string] name of the method
- *  [signature: string] the signature of the method
- *  [filename: string] the file path of the file that contains this method
- *  [token: uleb128] the method token
- *  [method_id: uleb128] an ID for this data to associate with the buffers of TYPE_COVERAGE_STATEMENTS
- *  [len: uleb128] the number of TYPE_COVERAGE_BUFFERS associated with this method
- * if exinfo == TYPE_COVERAGE_STATEMENTS
- *  [method_id: uleb128] an the TYPE_COVERAGE_METHOD buffer to associate this with
- *  [offset: uleb128] the il offset relative to the previous offset
- *  [counter: uleb128] the counter for this instruction
- *  [line: uleb128] the line of filename containing this instruction
- *  [column: uleb128] the column containing this instruction
- * if exinfo == TYPE_COVERAGE_ASSEMBLY
- *  [name: string] assembly name
- *  [guid: string] assembly GUID
- *  [filename: string] assembly filename
- *  [number_of_methods: uleb128] the number of methods in this assembly
- *  [fully_covered: uleb128] the number of fully covered methods
- *  [partially_covered: uleb128] the number of partially covered methods
- *    currently partially_covered will always be 0, and fully_covered is the
- *    number of methods that are fully and partially covered.
- * if exinfo == TYPE_COVERAGE_CLASS
- *  [name: string] assembly name
- *  [class: string] class name
- *  [number_of_methods: uleb128] the number of methods in this class
- *  [fully_covered: uleb128] the number of fully covered methods
- *  [partially_covered: uleb128] the number of partially covered methods
- *    currently partially_covered will always be 0, and fully_covered is the
- *    number of methods that are fully and partially covered.
- *
- * type meta format:
- * type: TYPE_META
- * exinfo: one of: TYPE_SYNC_POINT
- * if exinfo == TYPE_SYNC_POINT
- *     [type: byte] MonoProfilerSyncPointType enum value
- */
-
-// Pending data to be written to the log, for a single thread.
-// Threads periodically flush their own LogBuffers by calling safe_send
-typedef struct _LogBuffer LogBuffer;
-struct _LogBuffer {
-       // Next (older) LogBuffer in processing queue
-       LogBuffer *next;
-
-       uint64_t time_base;
-       uint64_t last_time;
-       uintptr_t ptr_base;
-       uintptr_t method_base;
-       uintptr_t last_method;
-       uintptr_t obj_base;
-       uintptr_t thread_id;
-
-       // Bytes allocated for this LogBuffer
-       int size;
-
-       // Start of currently unused space in buffer
-       unsigned char* cursor;
-
-       // Pointer to start-of-structure-plus-size (for convenience)
-       unsigned char* buf_end;
-
-       // Start of data in buffer. Contents follow "buffer format" described above.
-       unsigned char buf [1];
-};
-
-typedef struct {
-       MonoLinkedListSetNode node;
-
-       // The current log buffer for this thread.
-       LogBuffer *buffer;
-
-       // Methods referenced by events in `buffer`, see `MethodInfo`.
-       GPtrArray *methods;
-
-       // Current call depth for enter/leave events.
-       int call_depth;
-
-       // Indicates whether this thread is currently writing to its `buffer`.
-       int busy;
-} MonoProfilerThread;
-
-static inline void
-ign_res (int G_GNUC_UNUSED unused, ...)
-{
-}
-
-/*
- * These macros create a scope to avoid leaking the buffer returned
- * from ensure_logbuf () as it may have been invalidated by a GC
- * thread during STW. If you called init_thread () with add_to_lls =
- * FALSE, then don't use these macros.
- */
-
-#define ENTER_LOG \
-       do { \
-               buffer_lock (); \
-               g_assert (!PROF_TLS_GET ()->busy++ && "Why are we trying to write a new event while already writing one?")
-
-#define EXIT_LOG \
-               PROF_TLS_GET ()->busy--; \
-               buffer_unlock (); \
-       } while (0)
-
-static volatile gint32 buffer_rwlock_count;
-static volatile gpointer buffer_rwlock_exclusive;
-
-// Can be used recursively.
-static void
-buffer_lock (void)
-{
-       /*
-        * If the thread holding the exclusive lock tries to modify the
-        * reader count, just make it a no-op. This way, we also avoid
-        * invoking the GC safe point macros below, which could break if
-        * done from a thread that is currently the initiator of STW.
-        *
-        * In other words, we rely on the fact that the GC thread takes
-        * the exclusive lock in the gc_event () callback when the world
-        * is about to stop.
-        */
-       if (InterlockedReadPointer (&buffer_rwlock_exclusive) != (gpointer) thread_id ()) {
-               MONO_ENTER_GC_SAFE;
-
-               while (InterlockedReadPointer (&buffer_rwlock_exclusive))
-                       mono_thread_info_yield ();
-
-               InterlockedIncrement (&buffer_rwlock_count);
-
-               MONO_EXIT_GC_SAFE;
-       }
-
-       mono_memory_barrier ();
-}
-
-static void
-buffer_unlock (void)
-{
-       mono_memory_barrier ();
-
-       // See the comment in buffer_lock ().
-       if (InterlockedReadPointer (&buffer_rwlock_exclusive) == (gpointer) thread_id ())
-               return;
-
-       g_assert (InterlockedRead (&buffer_rwlock_count) && "Why are we trying to decrement a zero reader count?");
-
-       InterlockedDecrement (&buffer_rwlock_count);
-}
-
-// Cannot be used recursively.
-static void
-buffer_lock_excl (void)
-{
-       gpointer tid = (gpointer) thread_id ();
-
-       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) != tid && "Why are we taking the exclusive lock twice?");
-
-       MONO_ENTER_GC_SAFE;
-
-       while (InterlockedCompareExchangePointer (&buffer_rwlock_exclusive, tid, 0))
-               mono_thread_info_yield ();
-
-       while (InterlockedRead (&buffer_rwlock_count))
-               mono_thread_info_yield ();
-
-       MONO_EXIT_GC_SAFE;
-
-       mono_memory_barrier ();
-}
-
-static void
-buffer_unlock_excl (void)
-{
-       mono_memory_barrier ();
-
-       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) && "Why is the exclusive lock not held?");
-       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) == (gpointer) thread_id () && "Why does another thread hold the exclusive lock?");
-       g_assert (!InterlockedRead (&buffer_rwlock_count) && "Why are there readers when the exclusive lock is held?");
-
-       InterlockedWritePointer (&buffer_rwlock_exclusive, NULL);
-}
-
-typedef struct _BinaryObject BinaryObject;
-struct _BinaryObject {
-       BinaryObject *next;
-       void *addr;
-       char *name;
-};
-
-struct _MonoProfiler {
-       FILE* file;
-#if defined (HAVE_SYS_ZLIB)
-       gzFile gzfile;
-#endif
-       char *args;
-       uint64_t startup_time;
-       int pipe_output;
-       int last_gc_gen_started;
-       int command_port;
-       int server_socket;
-       int pipes [2];
-#ifndef HOST_WIN32
-       pthread_t helper_thread;
-       pthread_t writer_thread;
-       pthread_t dumper_thread;
-#endif
-       volatile gint32 run_writer_thread;
-       MonoLockFreeAllocSizeClass writer_entry_size_class;
-       MonoLockFreeAllocator writer_entry_allocator;
-       MonoLockFreeQueue writer_queue;
-       MonoSemType writer_queue_sem;
-       MonoConcurrentHashTable *method_table;
-       mono_mutex_t method_table_mutex;
-       volatile gint32 run_dumper_thread;
-       MonoLockFreeQueue dumper_queue;
-       MonoSemType dumper_queue_sem;
-       MonoLockFreeAllocSizeClass sample_size_class;
-       MonoLockFreeAllocator sample_allocator;
-       MonoLockFreeQueue sample_reuse_queue;
-       BinaryObject *binary_objects;
-       GPtrArray *coverage_filters;
-};
-
-typedef struct {
-       MonoLockFreeQueueNode node;
-       GPtrArray *methods;
-       LogBuffer *buffer;
-} WriterQueueEntry;
-
-#define WRITER_ENTRY_BLOCK_SIZE (mono_pagesize ())
-
-typedef struct {
-       MonoMethod *method;
-       MonoJitInfo *ji;
-       uint64_t time;
-} MethodInfo;
-
-#ifdef HOST_WIN32
-
-#define PROF_TLS_SET(VAL) (TlsSetValue (profiler_tls, (VAL)))
-#define PROF_TLS_GET() ((MonoProfilerThread *) TlsGetValue (profiler_tls))
-#define PROF_TLS_INIT() (profiler_tls = TlsAlloc ())
-#define PROF_TLS_FREE() (TlsFree (profiler_tls))
-
-static DWORD profiler_tls;
-
-#elif HAVE_KW_THREAD
-
-#define PROF_TLS_SET(VAL) (profiler_tls = (VAL))
-#define PROF_TLS_GET() (profiler_tls)
-#define PROF_TLS_INIT()
-#define PROF_TLS_FREE()
-
-static __thread MonoProfilerThread *profiler_tls;
-
-#else
-
-#define PROF_TLS_SET(VAL) (pthread_setspecific (profiler_tls, (VAL)))
-#define PROF_TLS_GET() ((MonoProfilerThread *) pthread_getspecific (profiler_tls))
-#define PROF_TLS_INIT() (pthread_key_create (&profiler_tls, NULL))
-#define PROF_TLS_FREE() (pthread_key_delete (&profiler_tls))
-
-static pthread_key_t profiler_tls;
-
-#endif
-
-static char*
-pstrdup (const char *s)
-{
-       int len = strlen (s) + 1;
-       char *p = (char *)malloc (len);
-       memcpy (p, s, len);
-       return p;
-}
-
-static LogBuffer*
-create_buffer (void)
-{
-       LogBuffer* buf = (LogBuffer *)alloc_buffer (BUFFER_SIZE);
-
-       InterlockedIncrement (&buffer_allocations);
-
-       buf->size = BUFFER_SIZE;
-       buf->time_base = current_time ();
-       buf->last_time = buf->time_base;
-       buf->buf_end = (unsigned char*)buf + buf->size;
-       buf->cursor = buf->buf;
-       return buf;
-}
-
-static void
-init_buffer_state (MonoProfilerThread *thread)
-{
-       thread->buffer = create_buffer ();
-       thread->methods = NULL;
-}
-
-static void
-clear_hazard_pointers (MonoThreadHazardPointers *hp)
-{
-       mono_hazard_pointer_clear (hp, 0);
-       mono_hazard_pointer_clear (hp, 1);
-       mono_hazard_pointer_clear (hp, 2);
-}
-
-static MonoProfilerThread *
-init_thread (gboolean add_to_lls)
-{
-       MonoProfilerThread *thread = PROF_TLS_GET ();
-
-       /*
-        * Sometimes we may try to initialize a thread twice. One example is the
-        * main thread: We initialize it when setting up the profiler, but we will
-        * also get a thread_start () callback for it. Another example is when
-        * attaching new threads to the runtime: We may get a gc_alloc () callback
-        * for that thread's thread object (where we initialize it), soon followed
-        * by a thread_start () callback.
-        *
-        * These cases are harmless anyhow. Just return if we've already done the
-        * initialization work.
-        */
-       if (thread)
-               return thread;
-
-       thread = malloc (sizeof (MonoProfilerThread));
-       thread->node.key = thread_id ();
-       thread->call_depth = 0;
-       thread->busy = 0;
-
-       init_buffer_state (thread);
-
-       /*
-        * Some internal profiler threads don't need to be cleaned up
-        * by the main thread on shutdown.
-        */
-       if (add_to_lls) {
-               MonoThreadHazardPointers *hp = mono_hazard_pointer_get ();
-               g_assert (mono_lls_insert (&profiler_thread_list, hp, &thread->node) && "Why can't we insert the thread in the LLS?");
-               clear_hazard_pointers (hp);
-       }
-
-       PROF_TLS_SET (thread);
-
-       return thread;
-}
-
-// Only valid if init_thread () was called with add_to_lls = FALSE.
-static void
-deinit_thread (MonoProfilerThread *thread)
-{
-       free (thread);
-       PROF_TLS_SET (NULL);
-}
-
-static LogBuffer *
-ensure_logbuf_inner (LogBuffer *old, int bytes)
-{
-       if (old && old->cursor + bytes + 100 < old->buf_end)
-               return old;
-
-       LogBuffer *new_ = create_buffer ();
-       new_->next = old;
-
-       return new_;
-}
-
-// Only valid if init_thread () was called with add_to_lls = FALSE.
-static LogBuffer *
-ensure_logbuf_unsafe (int bytes)
-{
-       MonoProfilerThread *thread = PROF_TLS_GET ();
-       LogBuffer *old = thread->buffer;
-       LogBuffer *new_ = ensure_logbuf_inner (old, bytes);
-
-       if (new_ == old)
-               return old; // Still enough space.
-
-       thread->buffer = new_;
-
-       return new_;
-}
-
-/*
- * Any calls to this function should be wrapped in the ENTER_LOG and
- * EXIT_LOG macros to prevent the returned pointer from leaking
- * outside of the critical region created by the calls to buffer_lock ()
- * and buffer_unlock () that those macros insert. If the pointer leaks,
- * it can and will lead to crashes as the GC or helper thread may
- * invalidate the pointer at any time.
- *
- * Note: If you're calling from a thread that called init_thread () with
- * add_to_lls = FALSE, you should use ensure_logbuf_unsafe () and omit
- * the macros.
- */
-static LogBuffer*
-ensure_logbuf (int bytes)
-{
-       g_assert (PROF_TLS_GET ()->busy && "Why are we trying to expand our buffer without the busy flag set?");
-
-       return ensure_logbuf_unsafe (bytes);
-}
-
-static void
-emit_byte (LogBuffer *logbuffer, int value)
-{
-       logbuffer->cursor [0] = value;
-       logbuffer->cursor++;
-       assert (logbuffer->cursor <= logbuffer->buf_end);
-}
-
-static void
-emit_value (LogBuffer *logbuffer, int value)
-{
-       encode_uleb128 (value, logbuffer->cursor, &logbuffer->cursor);
-       assert (logbuffer->cursor <= logbuffer->buf_end);
-}
-
-static void
-emit_time (LogBuffer *logbuffer, uint64_t value)
-{
-       uint64_t tdiff = value - logbuffer->last_time;
-       //if (value < logbuffer->last_time)
-       //      printf ("time went backwards\n");
-       //if (tdiff > 1000000)
-       //      printf ("large time offset: %llu\n", tdiff);
-       encode_uleb128 (tdiff, logbuffer->cursor, &logbuffer->cursor);
-       /*if (tdiff != decode_uleb128 (p, &p))
-               printf ("incorrect encoding: %llu\n", tdiff);*/
-       logbuffer->last_time = value;
-       assert (logbuffer->cursor <= logbuffer->buf_end);
-}
-
-static void
-emit_event_time (LogBuffer *logbuffer, int event, uint64_t time)
-{
-       emit_byte (logbuffer, event);
-       emit_time (logbuffer, time);
-}
-
-static void
-emit_event (LogBuffer *logbuffer, int event)
-{
-       emit_event_time (logbuffer, event, current_time ());
-}
-
-static void
-emit_svalue (LogBuffer *logbuffer, int64_t value)
-{
-       encode_sleb128 (value, logbuffer->cursor, &logbuffer->cursor);
-       assert (logbuffer->cursor <= logbuffer->buf_end);
-}
-
-static void
-emit_uvalue (LogBuffer *logbuffer, uint64_t value)
-{
-       encode_uleb128 (value, logbuffer->cursor, &logbuffer->cursor);
-       assert (logbuffer->cursor <= logbuffer->buf_end);
-}
-
-static void
-emit_ptr (LogBuffer *logbuffer, void *ptr)
-{
-       if (!logbuffer->ptr_base)
-               logbuffer->ptr_base = (uintptr_t)ptr;
-       emit_svalue (logbuffer, (intptr_t)ptr - logbuffer->ptr_base);
-       assert (logbuffer->cursor <= logbuffer->buf_end);
-}
-
-static void
-emit_method_inner (LogBuffer *logbuffer, void *method)
-{
-       if (!logbuffer->method_base) {
-               logbuffer->method_base = (intptr_t)method;
-               logbuffer->last_method = (intptr_t)method;
-       }
-       encode_sleb128 ((intptr_t)((char*)method - (char*)logbuffer->last_method), logbuffer->cursor, &logbuffer->cursor);
-       logbuffer->last_method = (intptr_t)method;
-       assert (logbuffer->cursor <= logbuffer->buf_end);
-}
-
-/*
-typedef struct {
-       MonoMethod *method;
-       MonoJitInfo *found;
-} MethodSearch;
-
-static void
-find_method (MonoDomain *domain, void *user_data)
-{
-       MethodSearch *search = user_data;
-
-       if (search->found)
-               return;
-
-       MonoJitInfo *ji = mono_get_jit_info_from_method (domain, search->method);
-
-       // It could be AOT'd, so we need to get it from the AOT runtime's cache.
-       if (!ji) {
-               void *ip = mono_aot_get_method (domain, search->method);
-
-               // Avoid a slow path in mono_jit_info_table_find ().
-               if (ip)
-                       ji = mono_jit_info_table_find (domain, ip);
-       }
-
-       if (ji)
-               search->found = ji;
-}
-*/
-
-static void
-register_method_local (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji)
-{
-       if (!mono_conc_hashtable_lookup (prof->method_table, method)) {
-               /*
-                * FIXME: In some cases, we crash while looking up JIT info for AOT'd methods.
-                * This usually happens for static constructors. This code is disabled for now
-                * as we don't need this info for anything critical.
-                *
-                * https://bugzilla.xamarin.com/show_bug.cgi?id=35171
-                */
-               /*
-               if (!ji) {
-                       MethodSearch search = { method, NULL };
-
-                       mono_domain_foreach (find_method, &search);
-
-                       ji = search.found;
-               }
-               */
-
-               /*
-                * FIXME: We can't always find JIT info for a generic shared method, especially
-                * if we obtained the MonoMethod during an async stack walk. For now, we deal
-                * with this by giving the generic shared method name and dummy code start/size
-                * information (i.e. zeroes).
-                */
-               //g_assert (ji);
-
-               MethodInfo *info = (MethodInfo *) malloc (sizeof (MethodInfo));
-
-               info->method = method;
-               info->ji = ji;
-               info->time = current_time ();
-
-               MonoProfilerThread *thread = PROF_TLS_GET ();
-               GPtrArray *arr = thread->methods ? thread->methods : (thread->methods = g_ptr_array_new ());
-               g_ptr_array_add (arr, info);
-       }
-}
-
-static void
-emit_method (MonoProfiler *prof, LogBuffer *logbuffer, MonoMethod *method)
-{
-       register_method_local (prof, method, NULL);
-       emit_method_inner (logbuffer, method);
-}
-
-static void
-emit_obj (LogBuffer *logbuffer, void *ptr)
-{
-       if (!logbuffer->obj_base)
-               logbuffer->obj_base = (uintptr_t)ptr >> 3;
-       emit_svalue (logbuffer, ((uintptr_t)ptr >> 3) - logbuffer->obj_base);
-       assert (logbuffer->cursor <= logbuffer->buf_end);
-}
-
-static void
-emit_string (LogBuffer *logbuffer, const char *str, size_t size)
-{
-       size_t i = 0;
-       if (str) {
-               for (; i < size; i++) {
-                       if (str[i] == '\0')
-                               break;
-                       emit_byte (logbuffer, str [i]);
-               }
-       }
-       emit_byte (logbuffer, '\0');
-}
-
-static void
-emit_double (LogBuffer *logbuffer, double value)
-{
-       int i;
-       unsigned char buffer[8];
-       memcpy (buffer, &value, 8);
-#if G_BYTE_ORDER == G_BIG_ENDIAN
-       for (i = 7; i >= 0; i--)
-#else
-       for (i = 0; i < 8; i++)
-#endif
-               emit_byte (logbuffer, buffer[i]);
-}
-
-static char*
-write_int16 (char *buf, int32_t value)
-{
-       int i;
-       for (i = 0; i < 2; ++i) {
-               buf [i] = value;
-               value >>= 8;
-       }
-       return buf + 2;
-}
-
-static char*
-write_int32 (char *buf, int32_t value)
-{
-       int i;
-       for (i = 0; i < 4; ++i) {
-               buf [i] = value;
-               value >>= 8;
-       }
-       return buf + 4;
-}
-
-static char*
-write_int64 (char *buf, int64_t value)
-{
-       int i;
-       for (i = 0; i < 8; ++i) {
-               buf [i] = value;
-               value >>= 8;
-       }
-       return buf + 8;
-}
-
-static char *
-write_header_string (char *p, const char *str)
-{
-       size_t len = strlen (str) + 1;
-
-       p = write_int32 (p, len);
-       strcpy (p, str);
-
-       return p + len;
-}
-
-static void
-dump_header (MonoProfiler *profiler)
-{
-       const char *args = profiler->args;
-       const char *arch = mono_config_get_cpu ();
-       const char *os = mono_config_get_os ();
-
-       char *hbuf = malloc (
-               sizeof (gint32) /* header id */ +
-               sizeof (gint8) /* major version */ +
-               sizeof (gint8) /* minor version */ +
-               sizeof (gint8) /* data version */ +
-               sizeof (gint8) /* word size */ +
-               sizeof (gint64) /* startup time */ +
-               sizeof (gint32) /* timer overhead */ +
-               sizeof (gint32) /* flags */ +
-               sizeof (gint32) /* process id */ +
-               sizeof (gint16) /* command port */ +
-               sizeof (gint32) + strlen (args) + 1 /* arguments */ +
-               sizeof (gint32) + strlen (arch) + 1 /* architecture */ +
-               sizeof (gint32) + strlen (os) + 1 /* operating system */
-       );
-       char *p = hbuf;
-
-       p = write_int32 (p, LOG_HEADER_ID);
-       *p++ = LOG_VERSION_MAJOR;
-       *p++ = LOG_VERSION_MINOR;
-       *p++ = LOG_DATA_VERSION;
-       *p++ = sizeof (void *);
-       p = write_int64 (p, ((uint64_t) time (NULL)) * 1000);
-       p = write_int32 (p, get_timer_overhead ());
-       p = write_int32 (p, 0); /* flags */
-       p = write_int32 (p, process_id ());
-       p = write_int16 (p, profiler->command_port);
-       p = write_header_string (p, args);
-       p = write_header_string (p, arch);
-       p = write_header_string (p, os);
-
-#if defined (HAVE_SYS_ZLIB)
-       if (profiler->gzfile) {
-               gzwrite (profiler->gzfile, hbuf, p - hbuf);
-       } else
-#endif
-       {
-               fwrite (hbuf, p - hbuf, 1, profiler->file);
-               fflush (profiler->file);
-       }
-
-       free (hbuf);
-}
-
-static void
-send_buffer (MonoProfiler *prof, MonoProfilerThread *thread)
-{
-       WriterQueueEntry *entry = mono_lock_free_alloc (&prof->writer_entry_allocator);
-       entry->methods = thread->methods;
-       entry->buffer = thread->buffer;
-
-       mono_lock_free_queue_node_init (&entry->node, FALSE);
-
-       mono_lock_free_queue_enqueue (&prof->writer_queue, &entry->node);
-       mono_os_sem_post (&prof->writer_queue_sem);
-}
-
-static void
-remove_thread (MonoProfiler *prof, MonoProfilerThread *thread, gboolean from_callback)
-{
-       MonoThreadHazardPointers *hp = mono_hazard_pointer_get ();
-
-       if (mono_lls_remove (&profiler_thread_list, hp, &thread->node)) {
-               LogBuffer *buffer = thread->buffer;
-
-               /*
-                * No need to take the buffer lock here as no other threads can
-                * be accessing this buffer anymore.
-                */
-
-               if (!from_callback) {
-                       /*
-                        * The thread is being cleaned up by the main thread during
-                        * shutdown. This typically happens for internal runtime
-                        * threads. We need to synthesize a thread end event.
-                        */
-
-                       buffer = ensure_logbuf_inner (buffer,
-                               EVENT_SIZE /* event */ +
-                               BYTE_SIZE /* type */ +
-                               LEB128_SIZE /* tid */
-                       );
-
-                       emit_event (buffer, TYPE_END_UNLOAD | TYPE_METADATA);
-                       emit_byte (buffer, TYPE_THREAD);
-                       emit_ptr (buffer, (void *) thread->node.key);
-               }
-
-               send_buffer (prof, thread);
-
-               mono_thread_hazardous_try_free (thread, free);
-       }
-
-       clear_hazard_pointers (hp);
-
-       if (from_callback)
-               PROF_TLS_SET (NULL);
-}
-
-static void
-dump_buffer (MonoProfiler *profiler, LogBuffer *buf)
-{
-       char hbuf [128];
-       char *p = hbuf;
-
-       if (buf->next)
-               dump_buffer (profiler, buf->next);
-
-       p = write_int32 (p, BUF_ID);
-       p = write_int32 (p, buf->cursor - buf->buf);
-       p = write_int64 (p, buf->time_base);
-       p = write_int64 (p, buf->ptr_base);
-       p = write_int64 (p, buf->obj_base);
-       p = write_int64 (p, buf->thread_id);
-       p = write_int64 (p, buf->method_base);
-
-#if defined (HAVE_SYS_ZLIB)
-       if (profiler->gzfile) {
-               gzwrite (profiler->gzfile, hbuf, p - hbuf);
-               gzwrite (profiler->gzfile, buf->buf, buf->cursor - buf->buf);
-       } else
-#endif
-       {
-               fwrite (hbuf, p - hbuf, 1, profiler->file);
-               fwrite (buf->buf, buf->cursor - buf->buf, 1, profiler->file);
-               fflush (profiler->file);
-       }
-
-       free_buffer (buf, buf->size);
-}
-
-static void
-dump_buffer_threadless (MonoProfiler *profiler, LogBuffer *buf)
-{
-       for (LogBuffer *iter = buf; iter; iter = iter->next)
-               iter->thread_id = 0;
-
-       dump_buffer (profiler, buf);
-}
-
-static void
-process_requests (MonoProfiler *profiler)
-{
-       if (heapshot_requested)
-               mono_gc_collect (mono_gc_max_generation ());
-}
-
-static void counters_init (MonoProfiler *profiler);
-static void counters_sample (MonoProfiler *profiler, uint64_t timestamp);
-
-static void
-safe_send (MonoProfiler *profiler)
-{
-       /* We need the runtime initialized so that we have threads and hazard
-        * pointers available. Otherwise, the lock free queue will not work and
-        * there won't be a thread to process the data.
-        *
-        * While the runtime isn't initialized, we just accumulate data in the
-        * thread local buffer list.
-        */
-       if (!InterlockedRead (&runtime_inited))
-               return;
-
-       MonoProfilerThread *thread = PROF_TLS_GET ();
-
-       buffer_lock ();
-
-       send_buffer (profiler, thread);
-       init_buffer_state (thread);
-
-       buffer_unlock ();
-}
-
-static void
-send_if_needed (MonoProfiler *prof)
-{
-       if (PROF_TLS_GET ()->buffer->next)
-               safe_send (prof);
-}
-
-static void
-safe_send_threadless (MonoProfiler *prof)
-{
-       LogBuffer *buf = PROF_TLS_GET ()->buffer;
-
-       for (LogBuffer *iter = buf; iter; iter = iter->next)
-               iter->thread_id = 0;
-
-       safe_send (prof);
-}
-
-static void
-send_if_needed_threadless (MonoProfiler *prof)
-{
-       if (PROF_TLS_GET ()->buffer->next)
-               safe_send_threadless (prof);
-}
-
-// Assumes that the exclusive lock is held.
-static void
-sync_point_flush (MonoProfiler *prof)
-{
-       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) == (gpointer) thread_id () && "Why don't we hold the exclusive lock?");
-
-       MONO_LLS_FOREACH_SAFE (&profiler_thread_list, MonoProfilerThread, thread) {
-               send_buffer (prof, thread);
-               init_buffer_state (thread);
-       } MONO_LLS_FOREACH_SAFE_END
-}
-
-// Assumes that the exclusive lock is held.
-static void
-sync_point_mark (MonoProfiler *prof, MonoProfilerSyncPointType type)
-{
-       g_assert (InterlockedReadPointer (&buffer_rwlock_exclusive) == (gpointer) thread_id () && "Why don't we hold the exclusive lock?");
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* type */
-       );
-
-       emit_event (logbuffer, TYPE_META | TYPE_SYNC_POINT);
-       emit_byte (logbuffer, type);
-
-       EXIT_LOG;
-
-       switch (type) {
-       case SYNC_POINT_PERIODIC:
-               safe_send_threadless (prof);
-               break;
-       case SYNC_POINT_WORLD_STOP:
-       case SYNC_POINT_WORLD_START:
-               safe_send (prof);
-               break;
-       default:
-               g_assert_not_reached ();
-               break;
-       }
-}
-
-// Assumes that the exclusive lock is held.
-static void
-sync_point (MonoProfiler *prof, MonoProfilerSyncPointType type)
-{
-       sync_point_flush (prof);
-       sync_point_mark (prof, type);
-}
-
-static int
-gc_reference (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data)
-{
-       /* account for object alignment in the heap */
-       size += 7;
-       size &= ~7;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* obj */ +
-               LEB128_SIZE /* klass */ +
-               LEB128_SIZE /* size */ +
-               LEB128_SIZE /* num */ +
-               num * (
-                       LEB128_SIZE /* offset */ +
-                       LEB128_SIZE /* ref */
-               )
-       );
-
-       emit_event (logbuffer, TYPE_HEAP_OBJECT | TYPE_HEAP);
-       emit_obj (logbuffer, obj);
-       emit_ptr (logbuffer, klass);
-       emit_value (logbuffer, size);
-       emit_value (logbuffer, num);
-
-       uintptr_t last_offset = 0;
-
-       for (int i = 0; i < num; ++i) {
-               emit_value (logbuffer, offsets [i] - last_offset);
-               last_offset = offsets [i];
-               emit_obj (logbuffer, refs [i]);
-       }
-
-       EXIT_LOG;
-
-       return 0;
-}
-
-static unsigned int hs_mode_ms = 0;
-static unsigned int hs_mode_gc = 0;
-static unsigned int hs_mode_ondemand = 0;
-static unsigned int gc_count = 0;
-static uint64_t last_hs_time = 0;
-
-static void
-heap_walk (MonoProfiler *profiler)
-{
-       if (!do_heap_shot)
-               return;
-
-       gboolean do_walk = 0;
-       uint64_t now = current_time ();
-
-       if (hs_mode_ms && (now - last_hs_time) / 1000000 >= hs_mode_ms)
-               do_walk = TRUE;
-       else if (hs_mode_gc && (gc_count % hs_mode_gc) == 0)
-               do_walk = TRUE;
-       else if (hs_mode_ondemand)
-               do_walk = heapshot_requested;
-       else if (!hs_mode_ms && !hs_mode_gc && profiler->last_gc_gen_started == mono_gc_max_generation ())
-               do_walk = TRUE;
-
-       if (!do_walk)
-               return;
-
-       heapshot_requested = 0;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */
-       );
-
-       emit_event (logbuffer, TYPE_HEAP_START | TYPE_HEAP);
-
-       EXIT_LOG;
-
-       mono_gc_walk_heap (0, gc_reference, NULL);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */
-       );
-
-       now = current_time ();
-
-       emit_event (logbuffer, TYPE_HEAP_END | TYPE_HEAP);
-
-       EXIT_LOG;
-
-       last_hs_time = now;
-}
-
-static void
-gc_event (MonoProfiler *profiler, MonoGCEvent ev, int generation)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* gc event */ +
-               BYTE_SIZE /* generation */
-       );
-
-       emit_event (logbuffer, TYPE_GC_EVENT | TYPE_GC);
-       emit_byte (logbuffer, ev);
-       emit_byte (logbuffer, generation);
-
-       EXIT_LOG;
-
-       switch (ev) {
-       case MONO_GC_EVENT_START:
-               /* to deal with nested gen1 after gen0 started */
-               profiler->last_gc_gen_started = generation;
-
-               if (generation == mono_gc_max_generation ())
-                       gc_count++;
-               break;
-       case MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED:
-               /*
-                * Ensure that no thread can be in the middle of writing to
-                * a buffer when the world stops...
-                */
-               buffer_lock_excl ();
-               break;
-       case MONO_GC_EVENT_POST_STOP_WORLD:
-               /*
-                * ... So that we now have a consistent view of all buffers.
-                * This allows us to flush them. We need to do this because
-                * they may contain object allocation events that need to be
-                * committed to the log file before any object move events
-                * that will be produced during this GC.
-                */
-               sync_point (profiler, SYNC_POINT_WORLD_STOP);
-               break;
-       case MONO_GC_EVENT_PRE_START_WORLD:
-               heap_walk (profiler);
-               break;
-       case MONO_GC_EVENT_POST_START_WORLD_UNLOCKED:
-               /*
-                * Similarly, we must now make sure that any object moves
-                * written to the GC thread's buffer are flushed. Otherwise,
-                * object allocation events for certain addresses could come
-                * after the move events that made those addresses available.
-                */
-               sync_point_mark (profiler, SYNC_POINT_WORLD_START);
-
-               /*
-                * Finally, it is safe to allow other threads to write to
-                * their buffers again.
-                */
-               buffer_unlock_excl ();
-               break;
-       default:
-               break;
-       }
-}
-
-static void
-gc_resize (MonoProfiler *profiler, int64_t new_size)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* new size */
-       );
-
-       emit_event (logbuffer, TYPE_GC_RESIZE | TYPE_GC);
-       emit_value (logbuffer, new_size);
-
-       EXIT_LOG;
-}
-
-// If you alter MAX_FRAMES, you may need to alter SAMPLE_BLOCK_SIZE too.
-#define MAX_FRAMES 32
-
-typedef struct {
-       int count;
-       MonoMethod* methods [MAX_FRAMES];
-       int32_t il_offsets [MAX_FRAMES];
-       int32_t native_offsets [MAX_FRAMES];
-} FrameData;
-
-static int num_frames = MAX_FRAMES;
-
-static mono_bool
-walk_stack (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data)
-{
-       FrameData *frame = (FrameData *)data;
-       if (method && frame->count < num_frames) {
-               frame->il_offsets [frame->count] = il_offset;
-               frame->native_offsets [frame->count] = native_offset;
-               frame->methods [frame->count++] = method;
-               //printf ("In %d %s at %d (native: %d)\n", frame->count, mono_method_get_name (method), il_offset, native_offset);
-       }
-       return frame->count == num_frames;
-}
-
-/*
- * a note about stack walks: they can cause more profiler events to fire,
- * so we need to make sure they don't happen after we started emitting an
- * event, hence the collect_bt/emit_bt split.
- */
-static void
-collect_bt (FrameData *data)
-{
-       data->count = 0;
-       mono_stack_walk_no_il (walk_stack, data);
-}
-
-static void
-emit_bt (MonoProfiler *prof, LogBuffer *logbuffer, FrameData *data)
-{
-       /* FIXME: this is actually tons of data and we should
-        * just output it the first time and use an id the next
-        */
-       if (data->count > num_frames)
-               printf ("bad num frames: %d\n", data->count);
-       emit_value (logbuffer, data->count);
-       //if (*p != data.count) {
-       //      printf ("bad num frames enc at %d: %d -> %d\n", count, data.count, *p); printf ("frames end: %p->%p\n", p, logbuffer->cursor); exit(0);}
-       while (data->count) {
-               emit_method (prof, logbuffer, data->methods [--data->count]);
-       }
-}
-
-static void
-gc_alloc (MonoProfiler *prof, MonoObject *obj, MonoClass *klass)
-{
-       init_thread (TRUE);
-
-       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces) ? TYPE_ALLOC_BT : 0;
-       FrameData data;
-       uintptr_t len = mono_object_get_size (obj);
-       /* account for object alignment in the heap */
-       len += 7;
-       len &= ~7;
-
-       if (do_bt)
-               collect_bt (&data);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* klass */ +
-               LEB128_SIZE /* obj */ +
-               LEB128_SIZE /* size */ +
-               (do_bt ? (
-                       LEB128_SIZE /* count */ +
-                       data.count * (
-                               LEB128_SIZE /* method */
-                       )
-               ) : 0)
-       );
-
-       emit_event (logbuffer, do_bt | TYPE_ALLOC);
-       emit_ptr (logbuffer, klass);
-       emit_obj (logbuffer, obj);
-       emit_value (logbuffer, len);
-
-       if (do_bt)
-               emit_bt (prof, logbuffer, &data);
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-}
-
-static void
-gc_moves (MonoProfiler *prof, void **objects, int num)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* num */ +
-               num * (
-                       LEB128_SIZE /* object */
-               )
-       );
-
-       emit_event (logbuffer, TYPE_GC_MOVE | TYPE_GC);
-       emit_value (logbuffer, num);
-
-       for (int i = 0; i < num; ++i)
-               emit_obj (logbuffer, objects [i]);
-
-       EXIT_LOG;
-}
-
-static void
-gc_roots (MonoProfiler *prof, int num, void **objects, int *root_types, uintptr_t *extra_info)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* num */ +
-               LEB128_SIZE /* collections */ +
-               num * (
-                       LEB128_SIZE /* object */ +
-                       LEB128_SIZE /* root type */ +
-                       LEB128_SIZE /* extra info */
-               )
-       );
-
-       emit_event (logbuffer, TYPE_HEAP_ROOT | TYPE_HEAP);
-       emit_value (logbuffer, num);
-       emit_value (logbuffer, mono_gc_collection_count (mono_gc_max_generation ()));
-
-       for (int i = 0; i < num; ++i) {
-               emit_obj (logbuffer, objects [i]);
-               emit_byte (logbuffer, root_types [i]);
-               emit_value (logbuffer, extra_info [i]);
-       }
-
-       EXIT_LOG;
-}
-
-static void
-gc_handle (MonoProfiler *prof, int op, int type, uintptr_t handle, MonoObject *obj)
-{
-       int do_bt = nocalls && InterlockedRead (&runtime_inited) && !notraces;
-       FrameData data;
-
-       if (do_bt)
-               collect_bt (&data);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* type */ +
-               LEB128_SIZE /* handle */ +
-               (op == MONO_PROFILER_GC_HANDLE_CREATED ? (
-                       LEB128_SIZE /* obj */
-               ) : 0) +
-               (do_bt ? (
-                       LEB128_SIZE /* count */ +
-                       data.count * (
-                               LEB128_SIZE /* method */
-                       )
-               ) : 0)
-       );
-
-       if (op == MONO_PROFILER_GC_HANDLE_CREATED)
-               emit_event (logbuffer, (do_bt ? TYPE_GC_HANDLE_CREATED_BT : TYPE_GC_HANDLE_CREATED) | TYPE_GC);
-       else if (op == MONO_PROFILER_GC_HANDLE_DESTROYED)
-               emit_event (logbuffer, (do_bt ? TYPE_GC_HANDLE_DESTROYED_BT : TYPE_GC_HANDLE_DESTROYED) | TYPE_GC);
-       else
-               g_assert_not_reached ();
-
-       emit_value (logbuffer, type);
-       emit_value (logbuffer, handle);
-
-       if (op == MONO_PROFILER_GC_HANDLE_CREATED)
-               emit_obj (logbuffer, obj);
-
-       if (do_bt)
-               emit_bt (prof, logbuffer, &data);
-
-       EXIT_LOG;
-
-       process_requests (prof);
-}
-
-static void
-finalize_begin (MonoProfiler *prof)
-{
-       ENTER_LOG;
-
-       LogBuffer *buf = ensure_logbuf (
-               EVENT_SIZE /* event */
-       );
-
-       emit_event (buf, TYPE_GC_FINALIZE_START | TYPE_GC);
-
-       EXIT_LOG;
-
-       process_requests (prof);
-}
-
-static void
-finalize_end (MonoProfiler *prof)
-{
-       ENTER_LOG;
-
-       LogBuffer *buf = ensure_logbuf (
-               EVENT_SIZE /* event */
-       );
-
-       emit_event (buf, TYPE_GC_FINALIZE_END | TYPE_GC);
-
-       EXIT_LOG;
-
-       process_requests (prof);
-}
-
-static void
-finalize_object_begin (MonoProfiler *prof, MonoObject *obj)
-{
-       ENTER_LOG;
-
-       LogBuffer *buf = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* obj */
-       );
-
-       emit_event (buf, TYPE_GC_FINALIZE_OBJECT_START | TYPE_GC);
-       emit_obj (buf, obj);
-
-       EXIT_LOG;
-
-       process_requests (prof);
-}
-
-static void
-finalize_object_end (MonoProfiler *prof, MonoObject *obj)
-{
-       ENTER_LOG;
-
-       LogBuffer *buf = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* obj */
-       );
-
-       emit_event (buf, TYPE_GC_FINALIZE_OBJECT_END | TYPE_GC);
-       emit_obj (buf, obj);
-
-       EXIT_LOG;
-
-       process_requests (prof);
-}
-
-static char*
-push_nesting (char *p, MonoClass *klass)
-{
-       MonoClass *nesting;
-       const char *name;
-       const char *nspace;
-       nesting = mono_class_get_nesting_type (klass);
-       if (nesting) {
-               p = push_nesting (p, nesting);
-               *p++ = '/';
-               *p = 0;
-       }
-       name = mono_class_get_name (klass);
-       nspace = mono_class_get_namespace (klass);
-       if (*nspace) {
-               strcpy (p, nspace);
-               p += strlen (nspace);
-               *p++ = '.';
-               *p = 0;
-       }
-       strcpy (p, name);
-       p += strlen (name);
-       return p;
-}
-
-static char*
-type_name (MonoClass *klass)
-{
-       char buf [1024];
-       char *p;
-       push_nesting (buf, klass);
-       p = (char *)malloc (strlen (buf) + 1);
-       strcpy (p, buf);
-       return p;
-}
-
-static void
-image_loaded (MonoProfiler *prof, MonoImage *image, int result)
-{
-       if (result != MONO_PROFILE_OK)
-               return;
-
-       const char *name = mono_image_get_filename (image);
-       int nlen = strlen (name) + 1;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* image */ +
-               nlen /* name */
-       );
-
-       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_IMAGE);
-       emit_ptr (logbuffer, image);
-       memcpy (logbuffer->cursor, name, nlen);
-       logbuffer->cursor += nlen;
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&image_loads);
-}
-
-static void
-image_unloaded (MonoProfiler *prof, MonoImage *image)
-{
-       const char *name = mono_image_get_filename (image);
-       int nlen = strlen (name) + 1;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* image */ +
-               nlen /* name */
-       );
-
-       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_IMAGE);
-       emit_ptr (logbuffer, image);
-       memcpy (logbuffer->cursor, name, nlen);
-       logbuffer->cursor += nlen;
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&image_unloads);
-}
-
-static void
-assembly_loaded (MonoProfiler *prof, MonoAssembly *assembly, int result)
-{
-       if (result != MONO_PROFILE_OK)
-               return;
-
-       char *name = mono_stringify_assembly_name (mono_assembly_get_name (assembly));
-       int nlen = strlen (name) + 1;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* assembly */ +
-               nlen /* name */
-       );
-
-       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_ASSEMBLY);
-       emit_ptr (logbuffer, assembly);
-       memcpy (logbuffer->cursor, name, nlen);
-       logbuffer->cursor += nlen;
-
-       EXIT_LOG;
-
-       mono_free (name);
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&assembly_loads);
-}
-
-static void
-assembly_unloaded (MonoProfiler *prof, MonoAssembly *assembly)
-{
-       char *name = mono_stringify_assembly_name (mono_assembly_get_name (assembly));
-       int nlen = strlen (name) + 1;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* assembly */ +
-               nlen /* name */
-       );
-
-       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_ASSEMBLY);
-       emit_ptr (logbuffer, assembly);
-       memcpy (logbuffer->cursor, name, nlen);
-       logbuffer->cursor += nlen;
-
-       EXIT_LOG;
-
-       mono_free (name);
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&assembly_unloads);
-}
-
-static void
-class_loaded (MonoProfiler *prof, MonoClass *klass, int result)
-{
-       if (result != MONO_PROFILE_OK)
-               return;
-
-       char *name;
-
-       if (InterlockedRead (&runtime_inited))
-               name = mono_type_get_name (mono_class_get_type (klass));
-       else
-               name = type_name (klass);
-
-       int nlen = strlen (name) + 1;
-       MonoImage *image = mono_class_get_image (klass);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* klass */ +
-               LEB128_SIZE /* image */ +
-               nlen /* name */
-       );
-
-       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_CLASS);
-       emit_ptr (logbuffer, klass);
-       emit_ptr (logbuffer, image);
-       memcpy (logbuffer->cursor, name, nlen);
-       logbuffer->cursor += nlen;
-
-       EXIT_LOG;
-
-       if (runtime_inited)
-               mono_free (name);
-       else
-               g_free (name);
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&class_loads);
-}
-
-static void
-class_unloaded (MonoProfiler *prof, MonoClass *klass)
-{
-       char *name;
-
-       if (InterlockedRead (&runtime_inited))
-               name = mono_type_get_name (mono_class_get_type (klass));
-       else
-               name = type_name (klass);
-
-       int nlen = strlen (name) + 1;
-       MonoImage *image = mono_class_get_image (klass);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* klass */ +
-               LEB128_SIZE /* image */ +
-               nlen /* name */
-       );
-
-       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_CLASS);
-       emit_ptr (logbuffer, klass);
-       emit_ptr (logbuffer, image);
-       memcpy (logbuffer->cursor, name, nlen);
-       logbuffer->cursor += nlen;
-
-       EXIT_LOG;
-
-       if (runtime_inited)
-               mono_free (name);
-       else
-               g_free (name);
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&class_unloads);
-}
-
-#ifndef DISABLE_HELPER_THREAD
-static void process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method);
-#endif /* DISABLE_HELPER_THREAD */
-
-static void
-method_enter (MonoProfiler *prof, MonoMethod *method)
-{
-#ifndef DISABLE_HELPER_THREAD
-       process_method_enter_coverage (prof, method);
-#endif /* DISABLE_HELPER_THREAD */
-
-       if (PROF_TLS_GET ()->call_depth++ <= max_call_depth) {
-               ENTER_LOG;
-
-               LogBuffer *logbuffer = ensure_logbuf (
-                       EVENT_SIZE /* event */ +
-                       LEB128_SIZE /* method */
-               );
-
-               emit_event (logbuffer, TYPE_ENTER | TYPE_METHOD);
-               emit_method (prof, logbuffer, method);
-
-               EXIT_LOG;
-       }
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-}
-
-static void
-method_leave (MonoProfiler *prof, MonoMethod *method)
-{
-       if (--PROF_TLS_GET ()->call_depth <= max_call_depth) {
-               ENTER_LOG;
-
-               LogBuffer *logbuffer = ensure_logbuf (
-                       EVENT_SIZE /* event */ +
-                       LEB128_SIZE /* method */
-               );
-
-               emit_event (logbuffer, TYPE_LEAVE | TYPE_METHOD);
-               emit_method (prof, logbuffer, method);
-
-               EXIT_LOG;
-       }
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-}
-
-static void
-method_exc_leave (MonoProfiler *prof, MonoMethod *method)
-{
-       if (!nocalls && --PROF_TLS_GET ()->call_depth <= max_call_depth) {
-               ENTER_LOG;
-
-               LogBuffer *logbuffer = ensure_logbuf (
-                       EVENT_SIZE /* event */ +
-                       LEB128_SIZE /* method */
-               );
-
-               emit_event (logbuffer, TYPE_EXC_LEAVE | TYPE_METHOD);
-               emit_method (prof, logbuffer, method);
-
-               EXIT_LOG;
-       }
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-}
-
-static void
-method_jitted (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji, int result)
-{
-       if (result != MONO_PROFILE_OK)
-               return;
-
-       register_method_local (prof, method, ji);
-
-       process_requests (prof);
-}
-
-static void
-code_buffer_new (MonoProfiler *prof, void *buffer, int size, MonoProfilerCodeBufferType type, void *data)
-{
-       char *name;
-       int nlen;
-
-       if (type == MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE) {
-               name = (char *) data;
-               nlen = strlen (name) + 1;
-       } else {
-               name = NULL;
-               nlen = 0;
-       }
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* buffer */ +
-               LEB128_SIZE /* size */ +
-               (name ? (
-                       nlen /* name */
-               ) : 0)
-       );
-
-       emit_event (logbuffer, TYPE_JITHELPER | TYPE_RUNTIME);
-       emit_byte (logbuffer, type);
-       emit_ptr (logbuffer, buffer);
-       emit_value (logbuffer, size);
-
-       if (name) {
-               memcpy (logbuffer->cursor, name, nlen);
-               logbuffer->cursor += nlen;
-       }
-
-       EXIT_LOG;
-
-       process_requests (prof);
-}
-
-static void
-throw_exc (MonoProfiler *prof, MonoObject *object)
-{
-       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces) ? TYPE_THROW_BT : 0;
-       FrameData data;
-
-       if (do_bt)
-               collect_bt (&data);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* object */ +
-               (do_bt ? (
-                       LEB128_SIZE /* count */ +
-                       data.count * (
-                               LEB128_SIZE /* method */
-                       )
-               ) : 0)
-       );
-
-       emit_event (logbuffer, do_bt | TYPE_EXCEPTION);
-       emit_obj (logbuffer, object);
-
-       if (do_bt)
-               emit_bt (prof, logbuffer, &data);
-
-       EXIT_LOG;
-
-       process_requests (prof);
-}
-
-static void
-clause_exc (MonoProfiler *prof, MonoMethod *method, int clause_type, int clause_num)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* clause type */ +
-               LEB128_SIZE /* clause num */ +
-               LEB128_SIZE /* method */
-       );
-
-       emit_event (logbuffer, TYPE_EXCEPTION | TYPE_CLAUSE);
-       emit_byte (logbuffer, clause_type);
-       emit_value (logbuffer, clause_num);
-       emit_method (prof, logbuffer, method);
-
-       EXIT_LOG;
-
-       process_requests (prof);
-}
-
-static void
-monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEvent event)
-{
-       int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces && event == MONO_PROFILER_MONITOR_CONTENTION) ? TYPE_MONITOR_BT : 0;
-       FrameData data;
-
-       if (do_bt)
-               collect_bt (&data);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* object */ +
-               (do_bt ? (
-                       LEB128_SIZE /* count */ +
-                       data.count * (
-                               LEB128_SIZE /* method */
-                       )
-               ) : 0)
-       );
-
-       emit_event (logbuffer, (event << 4) | do_bt | TYPE_MONITOR);
-       emit_obj (logbuffer, object);
-
-       if (do_bt)
-               emit_bt (profiler, logbuffer, &data);
-
-       EXIT_LOG;
-
-       process_requests (profiler);
-}
-
-static void
-thread_start (MonoProfiler *prof, uintptr_t tid)
-{
-       init_thread (TRUE);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* tid */
-       );
-
-       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_THREAD);
-       emit_ptr (logbuffer, (void*) tid);
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&thread_starts);
-}
-
-static void
-thread_end (MonoProfiler *prof, uintptr_t tid)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* tid */
-       );
-
-       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_THREAD);
-       emit_ptr (logbuffer, (void*) tid);
-
-       EXIT_LOG;
-
-       // Don't process requests as the thread is detached from the runtime.
-
-       remove_thread (prof, PROF_TLS_GET (), TRUE);
-
-       InterlockedIncrement (&thread_ends);
-}
-
-static void
-domain_loaded (MonoProfiler *prof, MonoDomain *domain, int result)
-{
-       if (result != MONO_PROFILE_OK)
-               return;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* domain id */
-       );
-
-       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_DOMAIN);
-       emit_ptr (logbuffer, (void*)(uintptr_t) mono_domain_get_id (domain));
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&domain_loads);
-}
-
-static void
-domain_unloaded (MonoProfiler *prof, MonoDomain *domain)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* domain id */
-       );
-
-       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_DOMAIN);
-       emit_ptr (logbuffer, (void*)(uintptr_t) mono_domain_get_id (domain));
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&domain_unloads);
-}
-
-static void
-domain_name (MonoProfiler *prof, MonoDomain *domain, const char *name)
-{
-       int nlen = strlen (name) + 1;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* domain id */ +
-               nlen /* name */
-       );
-
-       emit_event (logbuffer, TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_DOMAIN);
-       emit_ptr (logbuffer, (void*)(uintptr_t) mono_domain_get_id (domain));
-       memcpy (logbuffer->cursor, name, nlen);
-       logbuffer->cursor += nlen;
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-}
-
-static void
-context_loaded (MonoProfiler *prof, MonoAppContext *context)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* context id */ +
-               LEB128_SIZE /* domain id */
-       );
-
-       emit_event (logbuffer, TYPE_END_LOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_CONTEXT);
-       emit_ptr (logbuffer, (void*)(uintptr_t) mono_context_get_id (context));
-       emit_ptr (logbuffer, (void*)(uintptr_t) mono_context_get_domain_id (context));
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&context_loads);
-}
-
-static void
-context_unloaded (MonoProfiler *prof, MonoAppContext *context)
-{
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* context id */ +
-               LEB128_SIZE /* domain id */
-       );
-
-       emit_event (logbuffer, TYPE_END_UNLOAD | TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_CONTEXT);
-       emit_ptr (logbuffer, (void*)(uintptr_t) mono_context_get_id (context));
-       emit_ptr (logbuffer, (void*)(uintptr_t) mono_context_get_domain_id (context));
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-
-       InterlockedIncrement (&context_unloads);
-}
-
-static void
-thread_name (MonoProfiler *prof, uintptr_t tid, const char *name)
-{
-       int len = strlen (name) + 1;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               BYTE_SIZE /* type */ +
-               LEB128_SIZE /* tid */ +
-               len /* name */
-       );
-
-       emit_event (logbuffer, TYPE_METADATA);
-       emit_byte (logbuffer, TYPE_THREAD);
-       emit_ptr (logbuffer, (void*)tid);
-       memcpy (logbuffer->cursor, name, len);
-       logbuffer->cursor += len;
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       process_requests (prof);
-}
-
-typedef struct {
-       MonoMethod *method;
-       MonoDomain *domain;
-       void *base_address;
-       int offset;
-} AsyncFrameInfo;
-
-typedef struct {
-       MonoLockFreeQueueNode node;
-       MonoProfiler *prof;
-       uint64_t time;
-       uintptr_t tid;
-       void *ip;
-       int count;
-       AsyncFrameInfo frames [MONO_ZERO_LEN_ARRAY];
-} SampleHit;
-
-static mono_bool
-async_walk_stack (MonoMethod *method, MonoDomain *domain, void *base_address, int offset, void *data)
-{
-       SampleHit *sample = (SampleHit *) data;
-
-       if (sample->count < num_frames) {
-               int i = sample->count;
-
-               sample->frames [i].method = method;
-               sample->frames [i].domain = domain;
-               sample->frames [i].base_address = base_address;
-               sample->frames [i].offset = offset;
-
-               sample->count++;
-       }
-
-       return sample->count == num_frames;
-}
-
-#define SAMPLE_SLOT_SIZE(FRAMES) (sizeof (SampleHit) + sizeof (AsyncFrameInfo) * (FRAMES - MONO_ZERO_LEN_ARRAY))
-#define SAMPLE_BLOCK_SIZE (mono_pagesize ())
-
-static void
-enqueue_sample_hit (gpointer p)
-{
-       SampleHit *sample = p;
-
-       mono_lock_free_queue_node_unpoison (&sample->node);
-       mono_lock_free_queue_enqueue (&sample->prof->dumper_queue, &sample->node);
-       mono_os_sem_post (&sample->prof->dumper_queue_sem);
-
-       InterlockedIncrement (&sample_flushes);
-}
-
-static void
-mono_sample_hit (MonoProfiler *profiler, unsigned char *ip, void *context)
-{
-       /*
-        * Please note: We rely on the runtime loading the profiler with
-        * MONO_DL_EAGER (RTLD_NOW) so that references to runtime functions within
-        * this function (and its siblings) are resolved when the profiler is
-        * loaded. Otherwise, we would potentially invoke the dynamic linker when
-        * invoking runtime functions, which is not async-signal-safe.
-        */
-
-       if (in_shutdown)
-               return;
-
-       InterlockedIncrement (&sample_hits);
-
-       SampleHit *sample = (SampleHit *) mono_lock_free_queue_dequeue (&profiler->sample_reuse_queue);
-
-       if (!sample) {
-               /*
-                * If we're out of reusable sample events and we're not allowed to
-                * allocate more, we have no choice but to drop the event.
-                */
-               if (InterlockedRead (&sample_allocations) >= max_allocated_sample_hits)
-                       return;
-
-               sample = mono_lock_free_alloc (&profiler->sample_allocator);
-               sample->prof = profiler;
-               mono_lock_free_queue_node_init (&sample->node, TRUE);
-
-               InterlockedIncrement (&sample_allocations);
-       }
-
-       sample->count = 0;
-       mono_stack_walk_async_safe (&async_walk_stack, context, sample);
-
-       sample->time = current_time ();
-       sample->tid = thread_id ();
-       sample->ip = ip;
-
-       if (do_debug) {
-               int len;
-               char buf [256];
-               snprintf (buf, sizeof (buf), "hit at %p in thread %p after %llu ms\n", ip, (void *) sample->tid, (unsigned long long int) ((sample->time - profiler->startup_time) / 10000 / 100));
-               len = strlen (buf);
-               ign_res (write (2, buf, len));
-       }
-
-       mono_thread_hazardous_try_free (sample, enqueue_sample_hit);
-}
-
-static uintptr_t *code_pages = 0;
-static int num_code_pages = 0;
-static int size_code_pages = 0;
-#define CPAGE_SHIFT (9)
-#define CPAGE_SIZE (1 << CPAGE_SHIFT)
-#define CPAGE_MASK (~(CPAGE_SIZE - 1))
-#define CPAGE_ADDR(p) ((p) & CPAGE_MASK)
-
-static uintptr_t
-add_code_page (uintptr_t *hash, uintptr_t hsize, uintptr_t page)
-{
-       uintptr_t i;
-       uintptr_t start_pos;
-       start_pos = (page >> CPAGE_SHIFT) % hsize;
-       i = start_pos;
-       do {
-               if (hash [i] && CPAGE_ADDR (hash [i]) == CPAGE_ADDR (page)) {
-                       return 0;
-               } else if (!hash [i]) {
-                       hash [i] = page;
-                       return 1;
-               }
-               /* wrap around */
-               if (++i == hsize)
-                       i = 0;
-       } while (i != start_pos);
-       /* should not happen */
-       printf ("failed code page store\n");
-       return 0;
-}
-
-static void
-add_code_pointer (uintptr_t ip)
-{
-       uintptr_t i;
-       if (num_code_pages * 2 >= size_code_pages) {
-               uintptr_t *n;
-               uintptr_t old_size = size_code_pages;
-               size_code_pages *= 2;
-               if (size_code_pages == 0)
-                       size_code_pages = 16;
-               n = (uintptr_t *)calloc (sizeof (uintptr_t) * size_code_pages, 1);
-               for (i = 0; i < old_size; ++i) {
-                       if (code_pages [i])
-                               add_code_page (n, size_code_pages, code_pages [i]);
-               }
-               if (code_pages)
-                       g_free (code_pages);
-               code_pages = n;
-       }
-       num_code_pages += add_code_page (code_pages, size_code_pages, ip & CPAGE_MASK);
-}
-
-/* ELF code crashes on some systems. */
-//#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
-#if 0
-static void
-dump_ubin (const char *filename, uintptr_t load_addr, uint64_t offset, uintptr_t size)
-{
-       int len = strlen (filename) + 1;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* load address */ +
-               LEB128_SIZE /* offset */ +
-               LEB128_SIZE /* size */ +
-               nlen /* file name */
-       );
-
-       emit_event (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_UBIN);
-       emit_svalue (logbuffer, load_addr);
-       emit_uvalue (logbuffer, offset);
-       emit_uvalue (logbuffer, size);
-       memcpy (logbuffer->cursor, filename, len);
-       logbuffer->cursor += len;
-
-       EXIT_LOG;
-}
-#endif
-
-static void
-dump_usym (const char *name, uintptr_t value, uintptr_t size)
-{
-       int len = strlen (name) + 1;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* value */ +
-               LEB128_SIZE /* size */ +
-               len /* name */
-       );
-
-       emit_event (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_USYM);
-       emit_ptr (logbuffer, (void*)value);
-       emit_value (logbuffer, size);
-       memcpy (logbuffer->cursor, name, len);
-       logbuffer->cursor += len;
-
-       EXIT_LOG;
-}
-
-/* ELF code crashes on some systems. */
-//#if defined(ELFMAG0)
-#if 0
-
-#if SIZEOF_VOID_P == 4
-#define ELF_WSIZE 32
-#else
-#define ELF_WSIZE 64
-#endif
-#ifndef ElfW
-#define ElfW(type)      _ElfW (Elf, ELF_WSIZE, type)
-#define _ElfW(e,w,t)    _ElfW_1 (e, w, _##t)
-#define _ElfW_1(e,w,t)  e##w##t
-#endif
-
-static void
-dump_elf_symbols (ElfW(Sym) *symbols, int num_symbols, const char *strtab, void *load_addr)
-{
-       int i;
-       for (i = 0; i < num_symbols; ++i) {
-               const char* sym;
-               sym =  strtab + symbols [i].st_name;
-               if (!symbols [i].st_name || !symbols [i].st_size || (symbols [i].st_info & 0xf) != STT_FUNC)
-                       continue;
-               //printf ("symbol %s at %d\n", sym, symbols [i].st_value);
-               dump_usym (sym, (uintptr_t)load_addr + symbols [i].st_value, symbols [i].st_size);
-       }
-}
-
-static int
-read_elf_symbols (MonoProfiler *prof, const char *filename, void *load_addr)
-{
-       int fd, i;
-       void *data;
-       struct stat statb;
-       uint64_t file_size;
-       ElfW(Ehdr) *header;
-       ElfW(Shdr) *sheader;
-       ElfW(Shdr) *shstrtabh;
-       ElfW(Shdr) *symtabh = NULL;
-       ElfW(Shdr) *strtabh = NULL;
-       ElfW(Sym) *symbols = NULL;
-       const char *strtab;
-       int num_symbols;
-
-       fd = open (filename, O_RDONLY);
-       if (fd < 0)
-               return 0;
-       if (fstat (fd, &statb) != 0) {
-               close (fd);
-               return 0;
-       }
-       file_size = statb.st_size;
-       data = mmap (NULL, file_size, PROT_READ, MAP_PRIVATE, fd, 0);
-       close (fd);
-       if (data == MAP_FAILED)
-               return 0;
-       header = data;
-       if (header->e_ident [EI_MAG0] != ELFMAG0 ||
-                       header->e_ident [EI_MAG1] != ELFMAG1 ||
-                       header->e_ident [EI_MAG2] != ELFMAG2 ||
-                       header->e_ident [EI_MAG3] != ELFMAG3 ) {
-               munmap (data, file_size);
-               return 0;
-       }
-       sheader = (void*)((char*)data + header->e_shoff);
-       shstrtabh = (void*)((char*)sheader + (header->e_shentsize * header->e_shstrndx));
-       strtab = (const char*)data + shstrtabh->sh_offset;
-       for (i = 0; i < header->e_shnum; ++i) {
-               //printf ("section header: %d\n", sheader->sh_type);
-               if (sheader->sh_type == SHT_SYMTAB) {
-                       symtabh = sheader;
-                       strtabh = (void*)((char*)data + header->e_shoff + sheader->sh_link * header->e_shentsize);
-                       /*printf ("symtab section header: %d, .strstr: %d\n", i, sheader->sh_link);*/
-                       break;
-               }
-               sheader = (void*)((char*)sheader + header->e_shentsize);
-       }
-       if (!symtabh || !strtabh) {
-               munmap (data, file_size);
-               return 0;
-       }
-       strtab = (const char*)data + strtabh->sh_offset;
-       num_symbols = symtabh->sh_size / symtabh->sh_entsize;
-       symbols = (void*)((char*)data + symtabh->sh_offset);
-       dump_elf_symbols (symbols, num_symbols, strtab, load_addr);
-       munmap (data, file_size);
-       return 1;
-}
-#endif
-
-/* ELF code crashes on some systems. */
-//#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
-#if 0
-static int
-elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
-{
-       MonoProfiler *prof = data;
-       char buf [256];
-       const char *filename;
-       BinaryObject *obj;
-       char *a = (void*)info->dlpi_addr;
-       int i, num_sym;
-       ElfW(Dyn) *dyn = NULL;
-       ElfW(Sym) *symtab = NULL;
-       ElfW(Word) *hash_table = NULL;
-       ElfW(Ehdr) *header = NULL;
-       const char* strtab = NULL;
-       for (obj = prof->binary_objects; obj; obj = obj->next) {
-               if (obj->addr == a)
-                       return 0;
-       }
-       filename = info->dlpi_name;
-       if (!filename)
-               return 0;
-       if (!info->dlpi_addr && !filename [0]) {
-               int l = readlink ("/proc/self/exe", buf, sizeof (buf) - 1);
-               if (l > 0) {
-                       buf [l] = 0;
-                       filename = buf;
-               }
-       }
-       obj = g_calloc (sizeof (BinaryObject), 1);
-       obj->addr = (void*)info->dlpi_addr;
-       obj->name = pstrdup (filename);
-       obj->next = prof->binary_objects;
-       prof->binary_objects = obj;
-       //printf ("loaded file: %s at %p, segments: %d\n", filename, (void*)info->dlpi_addr, info->dlpi_phnum);
-       a = NULL;
-       for (i = 0; i < info->dlpi_phnum; ++i) {
-               //printf ("segment type %d file offset: %d, size: %d\n", info->dlpi_phdr[i].p_type, info->dlpi_phdr[i].p_offset, info->dlpi_phdr[i].p_memsz);
-               if (info->dlpi_phdr[i].p_type == PT_LOAD && !header) {
-                       header = (ElfW(Ehdr)*)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
-                       if (header->e_ident [EI_MAG0] != ELFMAG0 ||
-                                       header->e_ident [EI_MAG1] != ELFMAG1 ||
-                                       header->e_ident [EI_MAG2] != ELFMAG2 ||
-                                       header->e_ident [EI_MAG3] != ELFMAG3 ) {
-                               header = NULL;
-                       }
-                       dump_ubin (filename, info->dlpi_addr + info->dlpi_phdr[i].p_vaddr, info->dlpi_phdr[i].p_offset, info->dlpi_phdr[i].p_memsz);
-               } else if (info->dlpi_phdr[i].p_type == PT_DYNAMIC) {
-                       dyn = (ElfW(Dyn) *)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
-               }
-       }
-       if (read_elf_symbols (prof, filename, (void*)info->dlpi_addr))
-               return 0;
-       if (!info->dlpi_name || !info->dlpi_name[0])
-               return 0;
-       if (!dyn)
-               return 0;
-       for (i = 0; dyn [i].d_tag != DT_NULL; ++i) {
-               if (dyn [i].d_tag == DT_SYMTAB) {
-                       if (symtab && do_debug)
-                               printf ("multiple symtabs: %d\n", i);
-                       symtab = (ElfW(Sym) *)(a + dyn [i].d_un.d_ptr);
-               } else if (dyn [i].d_tag == DT_HASH) {
-                       hash_table = (ElfW(Word) *)(a + dyn [i].d_un.d_ptr);
-               } else if (dyn [i].d_tag == DT_STRTAB) {
-                       strtab = (const char*)(a + dyn [i].d_un.d_ptr);
-               }
-       }
-       if (!hash_table)
-               return 0;
-       num_sym = hash_table [1];
-       dump_elf_symbols (symtab, num_sym, strtab, (void*)info->dlpi_addr);
-       return 0;
-}
-
-static int
-load_binaries (MonoProfiler *prof)
-{
-       dl_iterate_phdr (elf_dl_callback, prof);
-       return 1;
-}
-#else
-static int
-load_binaries (MonoProfiler *prof)
-{
-       return 0;
-}
-#endif
-
-static const char*
-symbol_for (uintptr_t code)
-{
-#ifdef HAVE_DLADDR
-       void *ip = (void*)code;
-       Dl_info di;
-       if (dladdr (ip, &di)) {
-               if (di.dli_sname)
-                       return di.dli_sname;
-       } else {
-       /*      char **names;
-               names = backtrace_symbols (&ip, 1);
-               if (names) {
-                       const char* p = names [0];
-                       g_free (names);
-                       return p;
-               }
-               */
-       }
-#endif
-       return NULL;
-}
-
-static void
-dump_unmanaged_coderefs (MonoProfiler *prof)
-{
-       int i;
-       const char* last_symbol;
-       uintptr_t addr, page_end;
-
-       if (load_binaries (prof))
-               return;
-       for (i = 0; i < size_code_pages; ++i) {
-               const char* sym;
-               if (!code_pages [i] || code_pages [i] & 1)
-                       continue;
-               last_symbol = NULL;
-               addr = CPAGE_ADDR (code_pages [i]);
-               page_end = addr + CPAGE_SIZE;
-               code_pages [i] |= 1;
-               /* we dump the symbols for the whole page */
-               for (; addr < page_end; addr += 16) {
-                       sym = symbol_for (addr);
-                       if (sym && sym == last_symbol)
-                               continue;
-                       last_symbol = sym;
-                       if (!sym)
-                               continue;
-                       dump_usym (sym, addr, 0); /* let's not guess the size */
-                       //printf ("found symbol at %p: %s\n", (void*)addr, sym);
-               }
-       }
-}
-
-static int
-mono_cpu_count (void)
-{
-#ifdef PLATFORM_ANDROID
-       /* Android tries really hard to save power by powering off CPUs on SMP phones which
-        * means the normal way to query cpu count returns a wrong value with userspace API.
-        * Instead we use /sys entries to query the actual hardware CPU count.
-        */
-       int count = 0;
-       char buffer[8] = {'\0'};
-       int present = open ("/sys/devices/system/cpu/present", O_RDONLY);
-       /* Format of the /sys entry is a cpulist of indexes which in the case
-        * of present is always of the form "0-(n-1)" when there is more than
-        * 1 core, n being the number of CPU cores in the system. Otherwise
-        * the value is simply 0
-        */
-       if (present != -1 && read (present, (char*)buffer, sizeof (buffer)) > 3)
-               count = strtol (((char*)buffer) + 2, NULL, 10);
-       if (present != -1)
-               close (present);
-       if (count > 0)
-               return count + 1;
-#endif
-
-#if defined(HOST_ARM) || defined (HOST_ARM64)
-
-       /* ARM platforms tries really hard to save power by powering off CPUs on SMP phones which
-        * means the normal way to query cpu count returns a wrong value with userspace API. */
-
-#ifdef _SC_NPROCESSORS_CONF
-       {
-               int count = sysconf (_SC_NPROCESSORS_CONF);
-               if (count > 0)
-                       return count;
-       }
-#endif
-
-#else
-
-#ifdef HAVE_SCHED_GETAFFINITY
-       {
-               cpu_set_t set;
-               if (sched_getaffinity (getpid (), sizeof (set), &set) == 0)
-                       return CPU_COUNT (&set);
-       }
-#endif
-#ifdef _SC_NPROCESSORS_ONLN
-       {
-               int count = sysconf (_SC_NPROCESSORS_ONLN);
-               if (count > 0)
-                       return count;
-       }
-#endif
-
-#endif /* defined(HOST_ARM) || defined (HOST_ARM64) */
-
-#ifdef USE_SYSCTL
-       {
-               int count;
-               int mib [2];
-               size_t len = sizeof (int);
-               mib [0] = CTL_HW;
-               mib [1] = HW_NCPU;
-               if (sysctl (mib, 2, &count, &len, NULL, 0) == 0)
-                       return count;
-       }
-#endif
-#ifdef HOST_WIN32
-       {
-               SYSTEM_INFO info;
-               GetSystemInfo (&info);
-               return info.dwNumberOfProcessors;
-       }
-#endif
-       /* FIXME: warn */
-       return 1;
-}
-
-#if USE_PERF_EVENTS
-
-typedef struct {
-       int perf_fd;
-       unsigned int prev_pos;
-       void *mmap_base;
-       struct perf_event_mmap_page *page_desc;
-} PerfData ;
-
-static PerfData *perf_data = NULL;
-static int num_perf;
-#define PERF_PAGES_SHIFT 4
-static int num_pages = 1 << PERF_PAGES_SHIFT;
-static unsigned int mmap_mask;
-
-typedef struct {
-       struct perf_event_header h;
-       uint64_t ip;
-       uint32_t pid;
-       uint32_t tid;
-       uint64_t timestamp;
-       uint64_t period;
-       uint64_t nframes;
-} PSample;
-
-static int
-perf_event_syscall (struct perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags)
-{
-       attr->size = PERF_ATTR_SIZE_VER0;
-       //printf ("perf attr size: %d\n", attr->size);
-#if defined(__x86_64__)
-       return syscall(/*__NR_perf_event_open*/ 298, attr, pid, cpu, group_fd, flags);
-#elif defined(__i386__)
-       return syscall(/*__NR_perf_event_open*/ 336, attr, pid, cpu, group_fd, flags);
-#elif defined(__arm__) || defined (__aarch64__)
-       return syscall(/*__NR_perf_event_open*/ 364, attr, pid, cpu, group_fd, flags);
-#else
-       return -1;
-#endif
-}
-
-static int
-setup_perf_map (PerfData *perf)
-{
-       perf->mmap_base = mmap (NULL, (num_pages + 1) * getpagesize (), PROT_READ|PROT_WRITE, MAP_SHARED, perf->perf_fd, 0);
-       if (perf->mmap_base == MAP_FAILED) {
-               if (do_debug)
-                       printf ("failed mmap\n");
-               return 0;
-       }
-       perf->page_desc = perf->mmap_base;
-       if (do_debug)
-               printf ("mmap version: %d\n", perf->page_desc->version);
-       return 1;
-}
-
-static void
-dump_perf_hits (MonoProfiler *prof, void *buf, int size)
-{
-       int count = 1;
-       int mbt_count = 0;
-       void *end = (char*)buf + size;
-       int samples = 0;
-       int pid = getpid ();
-
-       while (buf < end) {
-               PSample *s = buf;
-               if (s->h.size == 0)
-                       break;
-               if (pid != s->pid) {
-                       if (do_debug)
-                               printf ("event for different pid: %d\n", s->pid);
-                       buf = (char*)buf + s->h.size;
-                       continue;
-               }
-               /*ip = (void*)s->ip;
-               printf ("sample: %d, size: %d, ip: %p (%s), timestamp: %llu, nframes: %llu\n",
-                       s->h.type, s->h.size, ip, symbol_for (ip), s->timestamp, s->nframes);*/
-
-               ENTER_LOG;
-
-               LogBuffer *logbuffer = ensure_logbuf (
-                       EVENT_SIZE /* event */ +
-                       BYTE_SIZE /* type */ +
-                       LEB128_SIZE /* tid */ +
-                       LEB128_SIZE /* count */ +
-                       count * (
-                               LEB128_SIZE /* ip */
-                       ) +
-                       LEB128_SIZE /* managed count */ +
-                       mbt_count * (
-                               LEB128_SIZE /* method */
-                       )
-               );
-
-               emit_event (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_HIT);
-               emit_byte (logbuffer, sample_type);
-               /*
-                * No useful thread ID to write here, since throughout the
-                * profiler we use pthread_self () but the ID we get from
-                * perf is the kernel's thread ID.
-                */
-               emit_ptr (logbuffer, 0);
-               emit_value (logbuffer, count);
-               emit_ptr (logbuffer, (void*)(uintptr_t)s->ip);
-               /* no support here yet for the managed backtrace */
-               emit_uvalue (logbuffer, mbt_count);
-
-               EXIT_LOG;
-
-               add_code_pointer (s->ip);
-               buf = (char*)buf + s->h.size;
-               samples++;
-       }
-       if (do_debug)
-               printf ("dumped %d samples\n", samples);
-       dump_unmanaged_coderefs (prof);
-}
-
-/* read events from the ring buffer */
-static int
-read_perf_mmap (MonoProfiler* prof, int cpu)
-{
-       PerfData *perf = perf_data + cpu;
-       unsigned char *buf;
-       unsigned char *data = (unsigned char*)perf->mmap_base + getpagesize ();
-       unsigned int head = perf->page_desc->data_head;
-       int diff, size;
-       unsigned int old;
-
-       mono_memory_read_barrier ();
-
-       old = perf->prev_pos;
-       diff = head - old;
-       if (diff < 0) {
-               if (do_debug)
-                       printf ("lost mmap events: old: %d, head: %d\n", old, head);
-               old = head;
-       }
-       size = head - old;
-       if ((old & mmap_mask) + size != (head & mmap_mask)) {
-               buf = data + (old & mmap_mask);
-               size = mmap_mask + 1 - (old & mmap_mask);
-               old += size;
-               /* size bytes at buf */
-               if (do_debug)
-                       printf ("found1 bytes of events: %d\n", size);
-               dump_perf_hits (prof, buf, size);
-       }
-       buf = data + (old & mmap_mask);
-       size = head - old;
-       /* size bytes at buf */
-       if (do_debug)
-               printf ("found bytes of events: %d\n", size);
-       dump_perf_hits (prof, buf, size);
-       old += size;
-       perf->prev_pos = old;
-       perf->page_desc->data_tail = old;
-       return 0;
-}
-
-static int
-setup_perf_event_for_cpu (PerfData *perf, int cpu)
-{
-       struct perf_event_attr attr;
-       memset (&attr, 0, sizeof (attr));
-       attr.type = PERF_TYPE_HARDWARE;
-       switch (sample_type) {
-       case SAMPLE_CYCLES: attr.config = PERF_COUNT_HW_CPU_CYCLES; break;
-       case SAMPLE_INSTRUCTIONS: attr.config = PERF_COUNT_HW_INSTRUCTIONS; break;
-       case SAMPLE_CACHE_MISSES: attr.config = PERF_COUNT_HW_CACHE_MISSES; break;
-       case SAMPLE_CACHE_REFS: attr.config = PERF_COUNT_HW_CACHE_REFERENCES; break;
-       case SAMPLE_BRANCHES: attr.config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS; break;
-       case SAMPLE_BRANCH_MISSES: attr.config = PERF_COUNT_HW_BRANCH_MISSES; break;
-       default: attr.config = PERF_COUNT_HW_CPU_CYCLES; break;
-       }
-       attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_PERIOD | PERF_SAMPLE_TIME;
-//     attr.sample_type |= PERF_SAMPLE_CALLCHAIN;
-       attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_TOTAL_TIME_RUNNING | PERF_FORMAT_ID;
-       attr.inherit = 1;
-       attr.freq = 1;
-       attr.sample_freq = sample_freq;
-
-       perf->perf_fd = perf_event_syscall (&attr, getpid (), cpu, -1, 0);
-       if (do_debug)
-               printf ("perf fd: %d, freq: %d, event: %llu\n", perf->perf_fd, sample_freq, attr.config);
-       if (perf->perf_fd < 0) {
-               if (perf->perf_fd == -EPERM) {
-                       fprintf (stderr, "Perf syscall denied, do \"echo 1 > /proc/sys/kernel/perf_event_paranoid\" as root to enable.\n");
-               } else {
-                       if (do_debug)
-                               perror ("open perf event");
-               }
-               return 0;
-       }
-       if (!setup_perf_map (perf)) {
-               close (perf->perf_fd);
-               perf->perf_fd = -1;
-               return 0;
-       }
-       return 1;
-}
-
-static int
-setup_perf_event (void)
-{
-       int i, count = 0;
-       mmap_mask = num_pages * getpagesize () - 1;
-       num_perf = mono_cpu_count ();
-       perf_data = g_calloc (num_perf, sizeof (PerfData));
-       for (i = 0; i < num_perf; ++i) {
-               count += setup_perf_event_for_cpu (perf_data + i, i);
-       }
-       if (count)
-               return 1;
-       g_free (perf_data);
-       perf_data = NULL;
-       return 0;
-}
-
-#endif /* USE_PERF_EVENTS */
-
-#ifndef DISABLE_HELPER_THREAD
-
-typedef struct MonoCounterAgent {
-       MonoCounter *counter;
-       // MonoCounterAgent specific data :
-       void *value;
-       size_t value_size;
-       short index;
-       short emitted;
-       struct MonoCounterAgent *next;
-} MonoCounterAgent;
-
-static MonoCounterAgent* counters;
-static gboolean counters_initialized = FALSE;
-static int counters_index = 1;
-static mono_mutex_t counters_mutex;
-
-static void
-counters_add_agent (MonoCounter *counter)
-{
-       MonoCounterAgent *agent, *item;
-
-       if (!counters_initialized)
-               return;
-
-       mono_os_mutex_lock (&counters_mutex);
-
-       for (agent = counters; agent; agent = agent->next) {
-               if (agent->counter == counter) {
-                       agent->value_size = 0;
-                       if (agent->value) {
-                               g_free (agent->value);
-                               agent->value = NULL;
-                       }
-                       mono_os_mutex_unlock (&counters_mutex);
-                       return;
-               }
-       }
-
-       agent = (MonoCounterAgent *)malloc (sizeof (MonoCounterAgent));
-       agent->counter = counter;
-       agent->value = NULL;
-       agent->value_size = 0;
-       agent->index = counters_index++;
-       agent->emitted = 0;
-       agent->next = NULL;
-
-       if (!counters) {
-               counters = agent;
-       } else {
-               item = counters;
-               while (item->next)
-                       item = item->next;
-               item->next = agent;
-       }
-
-       mono_os_mutex_unlock (&counters_mutex);
-}
-
-static mono_bool
-counters_init_foreach_callback (MonoCounter *counter, gpointer data)
-{
-       counters_add_agent (counter);
-       return TRUE;
-}
-
-static void
-counters_init (MonoProfiler *profiler)
-{
-       assert (!counters_initialized);
-
-       mono_os_mutex_init (&counters_mutex);
-
-       counters_initialized = TRUE;
-
-       mono_counters_on_register (&counters_add_agent);
-       mono_counters_foreach (counters_init_foreach_callback, NULL);
-}
-
-static void
-counters_emit (MonoProfiler *profiler)
-{
-       MonoCounterAgent *agent;
-       int len = 0;
-       int size =
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* len */
-       ;
-
-       if (!counters_initialized)
-               return;
-
-       mono_os_mutex_lock (&counters_mutex);
-
-       for (agent = counters; agent; agent = agent->next) {
-               if (agent->emitted)
-                       continue;
-
-               size +=
-                       LEB128_SIZE /* section */ +
-                       strlen (mono_counter_get_name (agent->counter)) + 1 /* name */ +
-                       BYTE_SIZE /* type */ +
-                       BYTE_SIZE /* unit */ +
-                       BYTE_SIZE /* variance */ +
-                       LEB128_SIZE /* index */
-               ;
-
-               len += 1;
-       }
-
-       if (!len) {
-               mono_os_mutex_unlock (&counters_mutex);
-               return;
-       }
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (size);
-
-       emit_event (logbuffer, TYPE_SAMPLE_COUNTERS_DESC | TYPE_SAMPLE);
-       emit_value (logbuffer, len);
-
-       for (agent = counters; agent; agent = agent->next) {
-               const char *name;
-
-               if (agent->emitted)
-                       continue;
-
-               name = mono_counter_get_name (agent->counter);
-               emit_value (logbuffer, mono_counter_get_section (agent->counter));
-               emit_string (logbuffer, name, strlen (name) + 1);
-               emit_byte (logbuffer, mono_counter_get_type (agent->counter));
-               emit_byte (logbuffer, mono_counter_get_unit (agent->counter));
-               emit_byte (logbuffer, mono_counter_get_variance (agent->counter));
-               emit_value (logbuffer, agent->index);
-
-               agent->emitted = 1;
-       }
-
-       EXIT_LOG;
-
-       mono_os_mutex_unlock (&counters_mutex);
-}
-
-static void
-counters_sample (MonoProfiler *profiler, uint64_t timestamp)
-{
-       MonoCounterAgent *agent;
-       MonoCounter *counter;
-       int type;
-       int buffer_size;
-       void *buffer;
-       int size;
-
-       if (!counters_initialized)
-               return;
-
-       counters_emit (profiler);
-
-       buffer_size = 8;
-       buffer = g_calloc (1, buffer_size);
-
-       mono_os_mutex_lock (&counters_mutex);
-
-       size =
-               EVENT_SIZE /* event */
-       ;
-
-       for (agent = counters; agent; agent = agent->next) {
-               size +=
-                       LEB128_SIZE /* index */ +
-                       BYTE_SIZE /* type */ +
-                       mono_counter_get_size (agent->counter) /* value */
-               ;
-       }
-
-       size +=
-               LEB128_SIZE /* stop marker */
-       ;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (size);
-
-       emit_event_time (logbuffer, TYPE_SAMPLE_COUNTERS | TYPE_SAMPLE, timestamp);
-
-       for (agent = counters; agent; agent = agent->next) {
-               size_t size;
-
-               counter = agent->counter;
-
-               size = mono_counter_get_size (counter);
-               if (size < 0) {
-                       continue; // FIXME error
-               } else if (size > buffer_size) {
-                       buffer_size = size;
-                       buffer = g_realloc (buffer, buffer_size);
-               }
-
-               memset (buffer, 0, buffer_size);
-
-               if (mono_counters_sample (counter, buffer, size) < 0)
-                       continue; // FIXME error
-
-               type = mono_counter_get_type (counter);
-
-               if (!agent->value) {
-                       agent->value = g_calloc (1, size);
-                       agent->value_size = size;
-               } else {
-                       if (type == MONO_COUNTER_STRING) {
-                               if (strcmp (agent->value, buffer) == 0)
-                                       continue;
-                       } else {
-                               if (agent->value_size == size && memcmp (agent->value, buffer, size) == 0)
-                                       continue;
-                       }
-               }
-
-               emit_uvalue (logbuffer, agent->index);
-               emit_byte (logbuffer, type);
-               switch (type) {
-               case MONO_COUNTER_INT:
-#if SIZEOF_VOID_P == 4
-               case MONO_COUNTER_WORD:
-#endif
-                       emit_svalue (logbuffer, *(int*)buffer - *(int*)agent->value);
-                       break;
-               case MONO_COUNTER_UINT:
-                       emit_uvalue (logbuffer, *(guint*)buffer - *(guint*)agent->value);
-                       break;
-               case MONO_COUNTER_TIME_INTERVAL:
-               case MONO_COUNTER_LONG:
-#if SIZEOF_VOID_P == 8
-               case MONO_COUNTER_WORD:
-#endif
-                       emit_svalue (logbuffer, *(gint64*)buffer - *(gint64*)agent->value);
-                       break;
-               case MONO_COUNTER_ULONG:
-                       emit_uvalue (logbuffer, *(guint64*)buffer - *(guint64*)agent->value);
-                       break;
-               case MONO_COUNTER_DOUBLE:
-                       emit_double (logbuffer, *(double*)buffer);
-                       break;
-               case MONO_COUNTER_STRING:
-                       if (size == 0) {
-                               emit_byte (logbuffer, 0);
-                       } else {
-                               emit_byte (logbuffer, 1);
-                               emit_string (logbuffer, (char*)buffer, size);
-                       }
-                       break;
-               default:
-                       assert (0);
-               }
-
-               if (type == MONO_COUNTER_STRING && size > agent->value_size) {
-                       agent->value = g_realloc (agent->value, size);
-                       agent->value_size = size;
-               }
-
-               if (size > 0)
-                       memcpy (agent->value, buffer, size);
-       }
-       g_free (buffer);
-
-       emit_value (logbuffer, 0);
-
-       EXIT_LOG;
-
-       mono_os_mutex_unlock (&counters_mutex);
-}
-
-typedef struct _PerfCounterAgent PerfCounterAgent;
-struct _PerfCounterAgent {
-       PerfCounterAgent *next;
-       int index;
-       char *category_name;
-       char *name;
-       int type;
-       gint64 value;
-       guint8 emitted;
-       guint8 updated;
-       guint8 deleted;
-};
-
-static PerfCounterAgent *perfcounters = NULL;
-
-static void
-perfcounters_emit (MonoProfiler *profiler)
-{
-       PerfCounterAgent *pcagent;
-       int len = 0;
-       int size =
-               EVENT_SIZE /* event */ +
-               LEB128_SIZE /* len */
-       ;
-
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
-               if (pcagent->emitted)
-                       continue;
-
-               size +=
-                       LEB128_SIZE /* section */ +
-                       strlen (pcagent->category_name) + 1 /* category name */ +
-                       strlen (pcagent->name) + 1 /* name */ +
-                       BYTE_SIZE /* type */ +
-                       BYTE_SIZE /* unit */ +
-                       BYTE_SIZE /* variance */ +
-                       LEB128_SIZE /* index */
-               ;
-
-               len += 1;
-       }
-
-       if (!len)
-               return;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (size);
-
-       emit_event (logbuffer, TYPE_SAMPLE_COUNTERS_DESC | TYPE_SAMPLE);
-       emit_value (logbuffer, len);
-
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
-               if (pcagent->emitted)
-                       continue;
-
-               emit_value (logbuffer, MONO_COUNTER_PERFCOUNTERS);
-               emit_string (logbuffer, pcagent->category_name, strlen (pcagent->category_name) + 1);
-               emit_string (logbuffer, pcagent->name, strlen (pcagent->name) + 1);
-               emit_byte (logbuffer, MONO_COUNTER_LONG);
-               emit_byte (logbuffer, MONO_COUNTER_RAW);
-               emit_byte (logbuffer, MONO_COUNTER_VARIABLE);
-               emit_value (logbuffer, pcagent->index);
-
-               pcagent->emitted = 1;
-       }
-
-       EXIT_LOG;
-}
-
-static gboolean
-perfcounters_foreach (char *category_name, char *name, unsigned char type, gint64 value, gpointer user_data)
-{
-       PerfCounterAgent *pcagent;
-
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
-               if (strcmp (pcagent->category_name, category_name) != 0 || strcmp (pcagent->name, name) != 0)
-                       continue;
-               if (pcagent->value == value)
-                       return TRUE;
-
-               pcagent->value = value;
-               pcagent->updated = 1;
-               pcagent->deleted = 0;
-               return TRUE;
-       }
-
-       pcagent = g_new0 (PerfCounterAgent, 1);
-       pcagent->next = perfcounters;
-       pcagent->index = counters_index++;
-       pcagent->category_name = g_strdup (category_name);
-       pcagent->name = g_strdup (name);
-       pcagent->type = (int) type;
-       pcagent->value = value;
-       pcagent->emitted = 0;
-       pcagent->updated = 1;
-       pcagent->deleted = 0;
-
-       perfcounters = pcagent;
-
-       return TRUE;
-}
-
-static void
-perfcounters_sample (MonoProfiler *profiler, uint64_t timestamp)
-{
-       PerfCounterAgent *pcagent;
-       int size;
-
-       if (!counters_initialized)
-               return;
-
-       mono_os_mutex_lock (&counters_mutex);
-
-       /* mark all perfcounters as deleted, foreach will unmark them as necessary */
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next)
-               pcagent->deleted = 1;
-
-       mono_perfcounter_foreach (perfcounters_foreach, perfcounters);
-
-       perfcounters_emit (profiler);
-
-       size =
-               EVENT_SIZE /* event */
-       ;
-
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
-               if (pcagent->deleted || !pcagent->updated)
-                       continue;
-
-               size +=
-                       LEB128_SIZE /* index */ +
-                       BYTE_SIZE /* type */ +
-                       LEB128_SIZE /* value */
-               ;
-       }
-
-       size +=
-               LEB128_SIZE /* stop marker */
-       ;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (size);
-
-       emit_event_time (logbuffer, TYPE_SAMPLE_COUNTERS | TYPE_SAMPLE, timestamp);
-
-       for (pcagent = perfcounters; pcagent; pcagent = pcagent->next) {
-               if (pcagent->deleted || !pcagent->updated)
-                       continue;
-               emit_uvalue (logbuffer, pcagent->index);
-               emit_byte (logbuffer, MONO_COUNTER_LONG);
-               emit_svalue (logbuffer, pcagent->value);
-
-               pcagent->updated = 0;
-       }
-
-       emit_value (logbuffer, 0);
-
-       EXIT_LOG;
-
-       mono_os_mutex_unlock (&counters_mutex);
-}
-
-static void
-counters_and_perfcounters_sample (MonoProfiler *prof)
-{
-       uint64_t now = current_time ();
-
-       counters_sample (prof, now);
-       perfcounters_sample (prof, now);
-}
-
-#define COVERAGE_DEBUG(x) if (debug_coverage) {x}
-static mono_mutex_t coverage_mutex;
-static MonoConcurrentHashTable *coverage_methods = NULL;
-static MonoConcurrentHashTable *coverage_assemblies = NULL;
-static MonoConcurrentHashTable *coverage_classes = NULL;
-
-static MonoConcurrentHashTable *filtered_classes = NULL;
-static MonoConcurrentHashTable *entered_methods = NULL;
-static MonoConcurrentHashTable *image_to_methods = NULL;
-static MonoConcurrentHashTable *suppressed_assemblies = NULL;
-static gboolean coverage_initialized = FALSE;
-
-static GPtrArray *coverage_data = NULL;
-static int previous_offset = 0;
-
-typedef struct {
-       MonoLockFreeQueueNode node;
-       MonoMethod *method;
-} MethodNode;
-
-typedef struct {
-       int offset;
-       int counter;
-       char *filename;
-       int line;
-       int column;
-} CoverageEntry;
-
-static void
-free_coverage_entry (gpointer data, gpointer userdata)
-{
-       CoverageEntry *entry = (CoverageEntry *)data;
-       g_free (entry->filename);
-       g_free (entry);
-}
-
-static void
-obtain_coverage_for_method (MonoProfiler *prof, const MonoProfileCoverageEntry *entry)
-{
-       int offset = entry->iloffset - previous_offset;
-       CoverageEntry *e = g_new (CoverageEntry, 1);
-
-       previous_offset = entry->iloffset;
-
-       e->offset = offset;
-       e->counter = entry->counter;
-       e->filename = g_strdup(entry->filename ? entry->filename : "");
-       e->line = entry->line;
-       e->column = entry->col;
-
-       g_ptr_array_add (coverage_data, e);
-}
-
-static char *
-parse_generic_type_names(char *name)
-{
-       char *new_name, *ret;
-       int within_generic_declaration = 0, generic_members = 1;
-
-       if (name == NULL || *name == '\0')
-               return g_strdup ("");
-
-       if (!(ret = new_name = (char *)calloc (strlen (name) * 4 + 1, sizeof (char))))
-               return NULL;
-
-       do {
-               switch (*name) {
-                       case '<':
-                               within_generic_declaration = 1;
-                               break;
-
-                       case '>':
-                               within_generic_declaration = 0;
-
-                               if (*(name - 1) != '<') {
-                                       *new_name++ = '`';
-                                       *new_name++ = '0' + generic_members;
-                               } else {
-                                       memcpy (new_name, "&lt;&gt;", 8);
-                                       new_name += 8;
-                               }
-
-                               generic_members = 0;
-                               break;
-
-                       case ',':
-                               generic_members++;
-                               break;
-
-                       default:
-                               if (!within_generic_declaration)
-                                       *new_name++ = *name;
-
-                               break;
-               }
-       } while (*name++);
-
-       return ret;
-}
-
-static int method_id;
-static void
-build_method_buffer (gpointer key, gpointer value, gpointer userdata)
-{
-       MonoMethod *method = (MonoMethod *)value;
-       MonoProfiler *prof = (MonoProfiler *)userdata;
-       MonoClass *klass;
-       MonoImage *image;
-       char *class_name;
-       const char *image_name, *method_name, *sig, *first_filename;
-       guint i;
-
-       previous_offset = 0;
-       coverage_data = g_ptr_array_new ();
-
-       mono_profiler_coverage_get (prof, method, obtain_coverage_for_method);
-
-       klass = mono_method_get_class (method);
-       image = mono_class_get_image (klass);
-       image_name = mono_image_get_name (image);
-
-       sig = mono_signature_get_desc (mono_method_signature (method), TRUE);
-       class_name = parse_generic_type_names (mono_type_get_name (mono_class_get_type (klass)));
-       method_name = mono_method_get_name (method);
-
-       if (coverage_data->len != 0) {
-               CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[0];
-               first_filename = entry->filename ? entry->filename : "";
-       } else
-               first_filename = "";
-
-       image_name = image_name ? image_name : "";
-       sig = sig ? sig : "";
-       method_name = method_name ? method_name : "";
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               strlen (image_name) + 1 /* image name */ +
-               strlen (class_name) + 1 /* class name */ +
-               strlen (method_name) + 1 /* method name */ +
-               strlen (sig) + 1 /* signature */ +
-               strlen (first_filename) + 1 /* first file name */ +
-               LEB128_SIZE /* token */ +
-               LEB128_SIZE /* method id */ +
-               LEB128_SIZE /* entries */
-       );
-
-       emit_event (logbuffer, TYPE_COVERAGE_METHOD | TYPE_COVERAGE);
-       emit_string (logbuffer, image_name, strlen (image_name) + 1);
-       emit_string (logbuffer, class_name, strlen (class_name) + 1);
-       emit_string (logbuffer, method_name, strlen (method_name) + 1);
-       emit_string (logbuffer, sig, strlen (sig) + 1);
-       emit_string (logbuffer, first_filename, strlen (first_filename) + 1);
-
-       emit_uvalue (logbuffer, mono_method_get_token (method));
-       emit_uvalue (logbuffer, method_id);
-       emit_value (logbuffer, coverage_data->len);
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       for (i = 0; i < coverage_data->len; i++) {
-               CoverageEntry *entry = (CoverageEntry *)coverage_data->pdata[i];
-
-               ENTER_LOG;
-
-               LogBuffer *logbuffer = ensure_logbuf (
-                       EVENT_SIZE /* event */ +
-                       LEB128_SIZE /* method id */ +
-                       LEB128_SIZE /* offset */ +
-                       LEB128_SIZE /* counter */ +
-                       LEB128_SIZE /* line */ +
-                       LEB128_SIZE /* column */
-               );
-
-               emit_event (logbuffer, TYPE_COVERAGE_STATEMENT | TYPE_COVERAGE);
-               emit_uvalue (logbuffer, method_id);
-               emit_uvalue (logbuffer, entry->offset);
-               emit_uvalue (logbuffer, entry->counter);
-               emit_uvalue (logbuffer, entry->line);
-               emit_uvalue (logbuffer, entry->column);
-
-               EXIT_LOG;
-
-               send_if_needed (prof);
-       }
-
-       method_id++;
-
-       g_free (class_name);
-
-       g_ptr_array_foreach (coverage_data, free_coverage_entry, NULL);
-       g_ptr_array_free (coverage_data, TRUE);
-       coverage_data = NULL;
-}
-
-/* This empties the queue */
-static guint
-count_queue (MonoLockFreeQueue *queue)
-{
-       MonoLockFreeQueueNode *node;
-       guint count = 0;
-
-       while ((node = mono_lock_free_queue_dequeue (queue))) {
-               count++;
-               mono_thread_hazardous_try_free (node, free);
-       }
-
-       return count;
-}
-
-static void
-build_class_buffer (gpointer key, gpointer value, gpointer userdata)
-{
-       MonoClass *klass = (MonoClass *)key;
-       MonoLockFreeQueue *class_methods = (MonoLockFreeQueue *)value;
-       MonoProfiler *prof = (MonoProfiler *)userdata;
-       MonoImage *image;
-       char *class_name;
-       const char *assembly_name;
-       int number_of_methods, partially_covered;
-       guint fully_covered;
-
-       image = mono_class_get_image (klass);
-       assembly_name = mono_image_get_name (image);
-       class_name = mono_type_get_name (mono_class_get_type (klass));
-
-       assembly_name = assembly_name ? assembly_name : "";
-       number_of_methods = mono_class_num_methods (klass);
-       fully_covered = count_queue (class_methods);
-       /* We don't handle partial covered yet */
-       partially_covered = 0;
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               strlen (assembly_name) + 1 /* assembly name */ +
-               strlen (class_name) + 1 /* class name */ +
-               LEB128_SIZE /* no. methods */ +
-               LEB128_SIZE /* fully covered */ +
-               LEB128_SIZE /* partially covered */
-       );
-
-       emit_event (logbuffer, TYPE_COVERAGE_CLASS | TYPE_COVERAGE);
-       emit_string (logbuffer, assembly_name, strlen (assembly_name) + 1);
-       emit_string (logbuffer, class_name, strlen (class_name) + 1);
-       emit_uvalue (logbuffer, number_of_methods);
-       emit_uvalue (logbuffer, fully_covered);
-       emit_uvalue (logbuffer, partially_covered);
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-
-       g_free (class_name);
-}
-
-static void
-get_coverage_for_image (MonoImage *image, int *number_of_methods, guint *fully_covered, int *partially_covered)
-{
-       MonoLockFreeQueue *image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (image_to_methods, image);
-
-       *number_of_methods = mono_image_get_table_rows (image, MONO_TABLE_METHOD);
-       if (image_methods)
-               *fully_covered = count_queue (image_methods);
-       else
-               *fully_covered = 0;
-
-       // FIXME: We don't handle partially covered yet.
-       *partially_covered = 0;
-}
-
-static void
-build_assembly_buffer (gpointer key, gpointer value, gpointer userdata)
-{
-       MonoAssembly *assembly = (MonoAssembly *)value;
-       MonoProfiler *prof = (MonoProfiler *)userdata;
-       MonoImage *image = mono_assembly_get_image (assembly);
-       const char *name, *guid, *filename;
-       int number_of_methods = 0, partially_covered = 0;
-       guint fully_covered = 0;
-
-       name = mono_image_get_name (image);
-       guid = mono_image_get_guid (image);
-       filename = mono_image_get_filename (image);
-
-       name = name ? name : "";
-       guid = guid ? guid : "";
-       filename = filename ? filename : "";
-
-       get_coverage_for_image (image, &number_of_methods, &fully_covered, &partially_covered);
-
-       ENTER_LOG;
-
-       LogBuffer *logbuffer = ensure_logbuf (
-               EVENT_SIZE /* event */ +
-               strlen (name) + 1 /* name */ +
-               strlen (guid) + 1 /* guid */ +
-               strlen (filename) + 1 /* file name */ +
-               LEB128_SIZE /* no. methods */ +
-               LEB128_SIZE /* fully covered */ +
-               LEB128_SIZE /* partially covered */
-       );
-
-       emit_event (logbuffer, TYPE_COVERAGE_ASSEMBLY | TYPE_COVERAGE);
-       emit_string (logbuffer, name, strlen (name) + 1);
-       emit_string (logbuffer, guid, strlen (guid) + 1);
-       emit_string (logbuffer, filename, strlen (filename) + 1);
-       emit_uvalue (logbuffer, number_of_methods);
-       emit_uvalue (logbuffer, fully_covered);
-       emit_uvalue (logbuffer, partially_covered);
-
-       EXIT_LOG;
-
-       send_if_needed (prof);
-}
-
-static void
-dump_coverage (MonoProfiler *prof)
-{
-       if (!coverage_initialized)
-               return;
-
-       COVERAGE_DEBUG(fprintf (stderr, "Coverage: Started dump\n");)
-       method_id = 0;
-
-       mono_os_mutex_lock (&coverage_mutex);
-       mono_conc_hashtable_foreach (coverage_assemblies, build_assembly_buffer, prof);
-       mono_conc_hashtable_foreach (coverage_classes, build_class_buffer, prof);
-       mono_conc_hashtable_foreach (coverage_methods, build_method_buffer, prof);
-       mono_os_mutex_unlock (&coverage_mutex);
-
-       COVERAGE_DEBUG(fprintf (stderr, "Coverage: Finished dump\n");)
-}
-
-static void
-process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method)
-{
-       MonoClass *klass;
-       MonoImage *image;
-
-       if (!coverage_initialized)
-               return;
-
-       klass = mono_method_get_class (method);
-       image = mono_class_get_image (klass);
-
-       if (mono_conc_hashtable_lookup (suppressed_assemblies, (gpointer) mono_image_get_name (image)))
-               return;
-
-       mono_os_mutex_lock (&coverage_mutex);
-       mono_conc_hashtable_insert (entered_methods, method, method);
-       mono_os_mutex_unlock (&coverage_mutex);
-}
-
-static MonoLockFreeQueueNode *
-create_method_node (MonoMethod *method)
-{
-       MethodNode *node = (MethodNode *)g_malloc (sizeof (MethodNode));
-       mono_lock_free_queue_node_init ((MonoLockFreeQueueNode *) node, FALSE);
-       node->method = method;
-
-       return (MonoLockFreeQueueNode *) node;
-}
-
-static gboolean
-coverage_filter (MonoProfiler *prof, MonoMethod *method)
-{
-       MonoError error;
-       MonoClass *klass;
-       MonoImage *image;
-       MonoAssembly *assembly;
-       MonoMethodHeader *header;
-       guint32 iflags, flags, code_size;
-       char *fqn, *classname;
-       gboolean has_positive, found;
-       MonoLockFreeQueue *image_methods, *class_methods;
-       MonoLockFreeQueueNode *node;
-
-       if (!coverage_initialized)
-               return FALSE;
-
-       COVERAGE_DEBUG(fprintf (stderr, "Coverage filter for %s\n", mono_method_get_name (method));)
-
-       flags = mono_method_get_flags (method, &iflags);
-       if ((iflags & 0x1000 /*METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL*/) ||
-           (flags & 0x2000 /*METHOD_ATTRIBUTE_PINVOKE_IMPL*/)) {
-               COVERAGE_DEBUG(fprintf (stderr, "   Internal call or pinvoke - ignoring\n");)
-               return FALSE;
-       }
-
-       // Don't need to do anything else if we're already tracking this method
-       if (mono_conc_hashtable_lookup (coverage_methods, method)) {
-               COVERAGE_DEBUG(fprintf (stderr, "   Already tracking\n");)
-               return TRUE;
-       }
-
-       klass = mono_method_get_class (method);
-       image = mono_class_get_image (klass);
-
-       // Don't handle coverage for the core assemblies
-       if (mono_conc_hashtable_lookup (suppressed_assemblies, (gpointer) mono_image_get_name (image)) != NULL)
-               return FALSE;
-
-       if (prof->coverage_filters) {
-               /* Check already filtered classes first */
-               if (mono_conc_hashtable_lookup (filtered_classes, klass)) {
-                       COVERAGE_DEBUG(fprintf (stderr, "   Already filtered\n");)
-                       return FALSE;
-               }
-
-               classname = mono_type_get_name (mono_class_get_type (klass));
-
-               fqn = g_strdup_printf ("[%s]%s", mono_image_get_name (image), classname);
-
-               COVERAGE_DEBUG(fprintf (stderr, "   Looking for %s in filter\n", fqn);)
-               // Check positive filters first
-               has_positive = FALSE;
-               found = FALSE;
-               for (guint i = 0; i < prof->coverage_filters->len; ++i) {
-                       char *filter = (char *)g_ptr_array_index (prof->coverage_filters, i);
-
-                       if (filter [0] == '+') {
-                               filter = &filter [1];
-
-                               COVERAGE_DEBUG(fprintf (stderr, "   Checking against +%s ...", filter);)
-
-                               if (strstr (fqn, filter) != NULL) {
-                                       COVERAGE_DEBUG(fprintf (stderr, "matched\n");)
-                                       found = TRUE;
-                               } else
-                                       COVERAGE_DEBUG(fprintf (stderr, "no match\n");)
-
-                               has_positive = TRUE;
-                       }
-               }
-
-               if (has_positive && !found) {
-                       COVERAGE_DEBUG(fprintf (stderr, "   Positive match was not found\n");)
-
-                       mono_os_mutex_lock (&coverage_mutex);
-                       mono_conc_hashtable_insert (filtered_classes, klass, klass);
-                       mono_os_mutex_unlock (&coverage_mutex);
-                       g_free (fqn);
-                       g_free (classname);
-
-                       return FALSE;
-               }
-
-               for (guint i = 0; i < prof->coverage_filters->len; ++i) {
-                       // FIXME: Is substring search sufficient?
-                       char *filter = (char *)g_ptr_array_index (prof->coverage_filters, i);
-                       if (filter [0] == '+')
-                               continue;
-
-                       // Skip '-'
-                       filter = &filter [1];
-                       COVERAGE_DEBUG(fprintf (stderr, "   Checking against -%s ...", filter);)
-
-                       if (strstr (fqn, filter) != NULL) {
-                               COVERAGE_DEBUG(fprintf (stderr, "matched\n");)
-
-                               mono_os_mutex_lock (&coverage_mutex);
-                               mono_conc_hashtable_insert (filtered_classes, klass, klass);
-                               mono_os_mutex_unlock (&coverage_mutex);
-                               g_free (fqn);
-                               g_free (classname);
-
-                               return FALSE;
-                       } else
-                               COVERAGE_DEBUG(fprintf (stderr, "no match\n");)
-
-               }
-
-               g_free (fqn);
-               g_free (classname);
-       }
-
-       COVERAGE_DEBUG(fprintf (stderr, "   Handling coverage for %s\n", mono_method_get_name (method));)
-       header = mono_method_get_header_checked (method, &error);
-       mono_error_cleanup (&error);
-
-       mono_method_header_get_code (header, &code_size, NULL);
-
-       assembly = mono_image_get_assembly (image);
-
-       // Need to keep the assemblies around for as long as they are kept in the hashtable
-       // Nunit, for example, has a habit of unloading them before the coverage statistics are
-       // generated causing a crash. See https://bugzilla.xamarin.com/show_bug.cgi?id=39325
-       mono_assembly_addref (assembly);
-
-       mono_os_mutex_lock (&coverage_mutex);
-       mono_conc_hashtable_insert (coverage_methods, method, method);
-       mono_conc_hashtable_insert (coverage_assemblies, assembly, assembly);
-       mono_os_mutex_unlock (&coverage_mutex);
-
-       image_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (image_to_methods, image);
-
-       if (image_methods == NULL) {
-               image_methods = (MonoLockFreeQueue *)g_malloc (sizeof (MonoLockFreeQueue));
-               mono_lock_free_queue_init (image_methods);
-               mono_os_mutex_lock (&coverage_mutex);
-               mono_conc_hashtable_insert (image_to_methods, image, image_methods);
-               mono_os_mutex_unlock (&coverage_mutex);
-       }
-
-       node = create_method_node (method);
-       mono_lock_free_queue_enqueue (image_methods, node);
-
-       class_methods = (MonoLockFreeQueue *)mono_conc_hashtable_lookup (coverage_classes, klass);
-
-       if (class_methods == NULL) {
-               class_methods = (MonoLockFreeQueue *)g_malloc (sizeof (MonoLockFreeQueue));
-               mono_lock_free_queue_init (class_methods);
-               mono_os_mutex_lock (&coverage_mutex);
-               mono_conc_hashtable_insert (coverage_classes, klass, class_methods);
-               mono_os_mutex_unlock (&coverage_mutex);
-       }
-
-       node = create_method_node (method);
-       mono_lock_free_queue_enqueue (class_methods, node);
-
-       return TRUE;
-}
-
-#define LINE_BUFFER_SIZE 4096
-/* Max file limit of 128KB */
-#define MAX_FILE_SIZE 128 * 1024
-static char *
-get_file_content (FILE *stream)
-{
-       char *buffer;
-       ssize_t bytes_read;
-       long filesize;
-       int res, offset = 0;
-
-       res = fseek (stream, 0, SEEK_END);
-       if (res < 0)
-         return NULL;
-
-       filesize = ftell (stream);
-       if (filesize < 0)
-         return NULL;
-
-       res = fseek (stream, 0, SEEK_SET);
-       if (res < 0)
-         return NULL;
-
-       if (filesize > MAX_FILE_SIZE)
-         return NULL;
-
-       buffer = (char *)g_malloc ((filesize + 1) * sizeof (char));
-       while ((bytes_read = fread (buffer + offset, 1, LINE_BUFFER_SIZE, stream)) > 0)
-               offset += bytes_read;
-
-       /* NULL terminate our buffer */
-       buffer[filesize] = '\0';
-       return buffer;
-}
-
-static char *
-get_next_line (char *contents, char **next_start)
-{
-       char *p = contents;
-
-       if (p == NULL || *p == '\0') {
-               *next_start = NULL;
-               return NULL;
-       }
-
-       while (*p != '\n' && *p != '\0')
-               p++;
-
-       if (*p == '\n') {
-               *p = '\0';
-               *next_start = p + 1;
-       } else
-               *next_start = NULL;
-
-       return contents;
-}
-
-static void
-init_suppressed_assemblies (void)
-{
-       char *content;
-       char *line;
-       FILE *sa_file;
-
-       suppressed_assemblies = mono_conc_hashtable_new (g_str_hash, g_str_equal);
-       sa_file = fopen (SUPPRESSION_DIR "/mono-profiler-log.suppression", "r");
-       if (sa_file == NULL)
-               return;
-
-       /* Don't need to free @content as it is referred to by the lines stored in @suppressed_assemblies */
-       content = get_file_content (sa_file);
-       if (content == NULL) {
-               g_error ("mono-profiler-log.suppression is greater than 128kb - aborting\n");
-       }
-
-       while ((line = get_next_line (content, &content))) {
-               line = g_strchomp (g_strchug (line));
-               /* No locking needed as we're doing initialization */
-               mono_conc_hashtable_insert (suppressed_assemblies, line, line);
-       }
-
-       fclose (sa_file);
-}
-
-#endif /* DISABLE_HELPER_THREAD */
-
-static void
-coverage_init (MonoProfiler *prof)
-{
-#ifndef DISABLE_HELPER_THREAD
-       assert (!coverage_initialized);
-
-       COVERAGE_DEBUG(fprintf (stderr, "Coverage initialized\n");)
-
-       mono_os_mutex_init (&coverage_mutex);
-       coverage_methods = mono_conc_hashtable_new (NULL, NULL);
-       coverage_assemblies = mono_conc_hashtable_new (NULL, NULL);
-       coverage_classes = mono_conc_hashtable_new (NULL, NULL);
-       filtered_classes = mono_conc_hashtable_new (NULL, NULL);
-       entered_methods = mono_conc_hashtable_new (NULL, NULL);
-       image_to_methods = mono_conc_hashtable_new (NULL, NULL);
-       init_suppressed_assemblies ();
-
-       coverage_initialized = TRUE;
-#endif /* DISABLE_HELPER_THREAD */
-}
-
-static void
-unref_coverage_assemblies (gpointer key, gpointer value, gpointer userdata)
-{
-       MonoAssembly *assembly = (MonoAssembly *)value;
-       mono_assembly_close (assembly);
-}
-
-static void
-free_sample_hit (gpointer p)
-{
-       mono_lock_free_free (p, SAMPLE_BLOCK_SIZE);
-}
-
-static void
-cleanup_reusable_samples (MonoProfiler *prof)
-{
-       SampleHit *sample;
-
-       while ((sample = (SampleHit *) mono_lock_free_queue_dequeue (&prof->sample_reuse_queue)))
-               mono_thread_hazardous_try_free (sample, free_sample_hit);
-}
-
-static void
-log_shutdown (MonoProfiler *prof)
-{
-       void *res;
-
-       in_shutdown = 1;
-#ifndef DISABLE_HELPER_THREAD
-       counters_and_perfcounters_sample (prof);
-
-       dump_coverage (prof);
-
-       if (prof->command_port) {
-               char c = 1;
-               ign_res (write (prof->pipes [1], &c, 1));
-               pthread_join (prof->helper_thread, &res);
-       }
-#endif
-#if USE_PERF_EVENTS
-       if (perf_data) {
-               int i;
-               for (i = 0; i < num_perf; ++i)
-                       read_perf_mmap (prof, i);
-       }
-#endif
-
-       /*
-        * Ensure that we empty the LLS completely, even if some nodes are
-        * not immediately removed upon calling mono_lls_remove (), by
-        * iterating until the head is NULL.
-        */
-       while (profiler_thread_list.head) {
-               MONO_LLS_FOREACH_SAFE (&profiler_thread_list, MonoProfilerThread, thread) {
-                       remove_thread (prof, thread, FALSE);
-               } MONO_LLS_FOREACH_SAFE_END
-       }
-
-       InterlockedWrite (&prof->run_dumper_thread, 0);
-       mono_os_sem_post (&prof->dumper_queue_sem);
-       pthread_join (prof->dumper_thread, &res);
-       mono_os_sem_destroy (&prof->dumper_queue_sem);
-
-       InterlockedWrite (&prof->run_writer_thread, 0);
-       mono_os_sem_post (&prof->writer_queue_sem);
-       pthread_join (prof->writer_thread, &res);
-       mono_os_sem_destroy (&prof->writer_queue_sem);
-
-       cleanup_reusable_samples (prof);
-
-       /*
-        * Pump the entire hazard free queue to make sure that anything we allocated
-        * in the profiler will be freed. If we don't do this, the runtime could get
-        * around to freeing some items after the profiler has been unloaded, which
-        * would mean calling into functions in the profiler library, leading to a
-        * crash.
-        */
-       mono_thread_hazardous_try_free_all ();
-
-       g_assert (!InterlockedRead (&buffer_rwlock_count) && "Why is the reader count still non-zero?");
-       g_assert (!InterlockedReadPointer (&buffer_rwlock_exclusive) && "Why does someone still hold the exclusive lock?");
-
-#if defined (HAVE_SYS_ZLIB)
-       if (prof->gzfile)
-               gzclose (prof->gzfile);
-#endif
-       if (prof->pipe_output)
-               pclose (prof->file);
-       else
-               fclose (prof->file);
-
-       mono_conc_hashtable_destroy (prof->method_table);
-       mono_os_mutex_destroy (&prof->method_table_mutex);
-
-       if (coverage_initialized) {
-               mono_os_mutex_lock (&coverage_mutex);
-               mono_conc_hashtable_foreach (coverage_assemblies, unref_coverage_assemblies, prof);
-               mono_os_mutex_unlock (&coverage_mutex);
-
-               mono_conc_hashtable_destroy (coverage_methods);
-               mono_conc_hashtable_destroy (coverage_assemblies);
-               mono_conc_hashtable_destroy (coverage_classes);
-               mono_conc_hashtable_destroy (filtered_classes);
-
-               mono_conc_hashtable_destroy (entered_methods);
-               mono_conc_hashtable_destroy (image_to_methods);
-               mono_conc_hashtable_destroy (suppressed_assemblies);
-               mono_os_mutex_destroy (&coverage_mutex);
-       }
-
-       PROF_TLS_FREE ();
-
-       g_free (prof->args);
-       g_free (prof);
-}
-
-static char*
-new_filename (const char* filename)
-{
-       time_t t = time (NULL);
-       int pid = process_id ();
-       char pid_buf [16];
-       char time_buf [16];
-       char *res, *d;
-       const char *p;
-       int count_dates = 0;
-       int count_pids = 0;
-       int s_date, s_pid;
-       struct tm *ts;
-       for (p = filename; *p; p++) {
-               if (*p != '%')
-                       continue;
-               p++;
-               if (*p == 't')
-                       count_dates++;
-               else if (*p == 'p')
-                       count_pids++;
-               else if (*p == 0)
-                       break;
-       }
-       if (!count_dates && !count_pids)
-               return pstrdup (filename);
-       snprintf (pid_buf, sizeof (pid_buf), "%d", pid);
-       ts = gmtime (&t);
-       snprintf (time_buf, sizeof (time_buf), "%d%02d%02d%02d%02d%02d",
-               1900 + ts->tm_year, 1 + ts->tm_mon, ts->tm_mday, ts->tm_hour, ts->tm_min, ts->tm_sec);
-       s_date = strlen (time_buf);
-       s_pid = strlen (pid_buf);
-       d = res = (char *)malloc (strlen (filename) + s_date * count_dates + s_pid * count_pids);
-       for (p = filename; *p; p++) {
-               if (*p != '%') {
-                       *d++ = *p;
-                       continue;
-               }
-               p++;
-               if (*p == 't') {
-                       strcpy (d, time_buf);
-                       d += s_date;
-                       continue;
-               } else if (*p == 'p') {
-                       strcpy (d, pid_buf);
-                       d += s_pid;
-                       continue;
-               } else if (*p == '%') {
-                       *d++ = '%';
-                       continue;
-               } else if (*p == 0)
-                       break;
-               *d++ = '%';
-               *d++ = *p;
-       }
-       *d = 0;
-       return res;
-}
-
-//this is exposed by the JIT, but it's not meant to be a supported API for now.
-extern void mono_threads_attach_tools_thread (void);
-
-#ifndef DISABLE_HELPER_THREAD
-
-static void*
-helper_thread (void* arg)
-{
-       MonoProfiler* prof = (MonoProfiler *)arg;
-       int command_socket;
-       int len;
-       char buf [64];
-
-       mono_threads_attach_tools_thread ();
-       mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler helper");
-
-       init_thread (FALSE);
-
-       //fprintf (stderr, "Server listening\n");
-       command_socket = -1;
-       while (1) {
-               fd_set rfds;
-               struct timeval tv;
-               int max_fd = -1;
-               FD_ZERO (&rfds);
-               FD_SET (prof->server_socket, &rfds);
-               max_fd = prof->server_socket;
-               FD_SET (prof->pipes [0], &rfds);
-               if (max_fd < prof->pipes [0])
-                       max_fd = prof->pipes [0];
-               if (command_socket >= 0) {
-                       FD_SET (command_socket, &rfds);
-                       if (max_fd < command_socket)
-                               max_fd = command_socket;
-               }
-#if USE_PERF_EVENTS
-               if (perf_data) {
-                       int i;
-                       for ( i = 0; i < num_perf; ++i) {
-                               if (perf_data [i].perf_fd < 0)
-                                       continue;
-                               FD_SET (perf_data [i].perf_fd, &rfds);
-                               if (max_fd < perf_data [i].perf_fd)
-                                       max_fd = perf_data [i].perf_fd;
-                       }
-               }
-#endif
-
-               counters_and_perfcounters_sample (prof);
-
-               buffer_lock_excl ();
-
-               sync_point (prof, SYNC_POINT_PERIODIC);
-
-               buffer_unlock_excl ();
-
-               tv.tv_sec = 1;
-               tv.tv_usec = 0;
-               len = select (max_fd + 1, &rfds, NULL, NULL, &tv);
-
-               if (len < 0) {
-                       if (errno == EINTR)
-                               continue;
-
-                       g_warning ("Error in proflog server: %s", strerror (errno));
-                       return NULL;
-               }
-
-               if (FD_ISSET (prof->pipes [0], &rfds)) {
-                       char c;
-                       read (prof->pipes [0], &c, 1);
-                       if (do_debug)
-                               fprintf (stderr, "helper shutdown\n");
-#if USE_PERF_EVENTS
-                       if (perf_data) {
-                               int i;
-                               for ( i = 0; i < num_perf; ++i) {
-                                       if (perf_data [i].perf_fd < 0)
-                                               continue;
-                                       if (FD_ISSET (perf_data [i].perf_fd, &rfds))
-                                               read_perf_mmap (prof, i);
-                               }
-                       }
-#endif
-                       safe_send_threadless (prof);
-                       return NULL;
-               }
-#if USE_PERF_EVENTS
-               if (perf_data) {
-                       int i;
-                       for ( i = 0; i < num_perf; ++i) {
-                               if (perf_data [i].perf_fd < 0)
-                                       continue;
-                               if (FD_ISSET (perf_data [i].perf_fd, &rfds)) {
-                                       read_perf_mmap (prof, i);
-                                       send_if_needed_threadless (prof);
-                               }
-                       }
-               }
-#endif
-               if (command_socket >= 0 && FD_ISSET (command_socket, &rfds)) {
-                       len = read (command_socket, buf, sizeof (buf) - 1);
-                       if (len < 0)
-                               continue;
-                       if (len == 0) {
-                               close (command_socket);
-                               command_socket = -1;
-                               continue;
-                       }
-                       buf [len] = 0;
-                       if (strcmp (buf, "heapshot\n") == 0 && hs_mode_ondemand) {
-                               // Rely on the finalization callbacks invoking process_requests ().
-                               heapshot_requested = 1;
-                               mono_gc_finalize_notify ();
-                       }
-                       continue;
-               }
-               if (!FD_ISSET (prof->server_socket, &rfds)) {
-                       continue;
-               }
-               command_socket = accept (prof->server_socket, NULL, NULL);
-               if (command_socket < 0)
-                       continue;
-               //fprintf (stderr, "Accepted connection\n");
-       }
-
-       mono_thread_info_detach ();
-
-       return NULL;
-}
-
-static int
-start_helper_thread (MonoProfiler* prof)
-{
-       struct sockaddr_in server_address;
-       int r;
-       socklen_t slen;
-       if (pipe (prof->pipes) < 0) {
-               fprintf (stderr, "Cannot create pipe\n");
-               return 0;
-       }
-       prof->server_socket = socket (PF_INET, SOCK_STREAM, 0);
-       if (prof->server_socket < 0) {
-               fprintf (stderr, "Cannot create server socket\n");
-               return 0;
-       }
-       memset (&server_address, 0, sizeof (server_address));
-       server_address.sin_family = AF_INET;
-       server_address.sin_addr.s_addr = INADDR_ANY;
-       server_address.sin_port = htons (prof->command_port);
-       if (bind (prof->server_socket, (struct sockaddr *) &server_address, sizeof (server_address)) < 0) {
-               fprintf (stderr, "Cannot bind server socket, port: %d: %s\n", prof->command_port, strerror (errno));
-               close (prof->server_socket);
-               return 0;
-       }
-       if (listen (prof->server_socket, 1) < 0) {
-               fprintf (stderr, "Cannot listen server socket\n");
-               close (prof->server_socket);
-               return 0;
-       }
-       slen = sizeof (server_address);
-       if (getsockname (prof->server_socket, (struct sockaddr *)&server_address, &slen) == 0) {
-               prof->command_port = ntohs (server_address.sin_port);
-               /*fprintf (stderr, "Assigned server port: %d\n", prof->command_port);*/
-       }
-
-       r = pthread_create (&prof->helper_thread, NULL, helper_thread, prof);
-       if (r) {
-               close (prof->server_socket);
-               return 0;
-       }
-       return 1;
-}
-#endif
-
-static void
-free_writer_entry (gpointer p)
-{
-       mono_lock_free_free (p, WRITER_ENTRY_BLOCK_SIZE);
-}
-
-static gboolean
-handle_writer_queue_entry (MonoProfiler *prof)
-{
-       WriterQueueEntry *entry;
-
-       if ((entry = (WriterQueueEntry *) mono_lock_free_queue_dequeue (&prof->writer_queue))) {
-               if (!entry->methods)
-                       goto no_methods;
-
-               LogBuffer *buf = NULL;
-
-               /*
-                * Encode the method events in a temporary log buffer that we
-                * flush to disk before the main buffer, ensuring that all
-                * methods have metadata emitted before they're referenced.
-                *
-                * We use a 'proper' thread-local buffer for this as opposed
-                * to allocating and freeing a buffer by hand because the call
-                * to mono_method_full_name () below may trigger class load
-                * events when it retrieves the signature of the method. So a
-                * thread-local buffer needs to exist when such events occur.
-                */
-               for (guint i = 0; i < entry->methods->len; i++) {
-                       MethodInfo *info = (MethodInfo *) g_ptr_array_index (entry->methods, i);
-
-                       if (mono_conc_hashtable_lookup (prof->method_table, info->method))
-                               goto free_info; // This method already has metadata emitted.
-
-                       /*
-                        * Other threads use this hash table to get a general
-                        * idea of whether a method has already been emitted to
-                        * the stream. Due to the way we add to this table, it
-                        * can easily happen that multiple threads queue up the
-                        * same methods, but that's OK since eventually all
-                        * methods will be in this table and the thread-local
-                        * method lists will just be empty for the rest of the
-                        * app's lifetime.
-                        */
-                       mono_os_mutex_lock (&prof->method_table_mutex);
-                       mono_conc_hashtable_insert (prof->method_table, info->method, info->method);
-                       mono_os_mutex_unlock (&prof->method_table_mutex);
-
-                       char *name = mono_method_full_name (info->method, 1);
-                       int nlen = strlen (name) + 1;
-                       void *cstart = info->ji ? mono_jit_info_get_code_start (info->ji) : NULL;
-                       int csize = info->ji ? mono_jit_info_get_code_size (info->ji) : 0;
-
-                       buf = ensure_logbuf_unsafe (
-                               EVENT_SIZE /* event */ +
-                               LEB128_SIZE /* method */ +
-                               LEB128_SIZE /* start */ +
-                               LEB128_SIZE /* size */ +
-                               nlen /* name */
-                       );
-
-                       emit_event_time (buf, TYPE_JIT | TYPE_METHOD, info->time);
-                       emit_method_inner (buf, info->method);
-                       emit_ptr (buf, cstart);
-                       emit_value (buf, csize);
-
-                       memcpy (buf->cursor, name, nlen);
-                       buf->cursor += nlen;
-
-                       mono_free (name);
-
-               free_info:
-                       g_free (info);
-               }
-
-               g_ptr_array_free (entry->methods, TRUE);
-
-               if (buf) {
-                       dump_buffer_threadless (prof, buf);
-                       init_buffer_state (PROF_TLS_GET ());
-               }
-
-       no_methods:
-               dump_buffer (prof, entry->buffer);
-
-               mono_thread_hazardous_try_free (entry, free_writer_entry);
-
-               return TRUE;
-       }
-
-       return FALSE;
-}
-
-static void *
-writer_thread (void *arg)
-{
-       MonoProfiler *prof = (MonoProfiler *)arg;
-
-       mono_threads_attach_tools_thread ();
-       mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler writer");
-
-       dump_header (prof);
-
-       MonoProfilerThread *thread = init_thread (FALSE);
-
-       while (InterlockedRead (&prof->run_writer_thread)) {
-               mono_os_sem_wait (&prof->writer_queue_sem, MONO_SEM_FLAGS_NONE);
-               handle_writer_queue_entry (prof);
-       }
-
-       /* Drain any remaining entries on shutdown. */
-       while (handle_writer_queue_entry (prof));
-
-       free_buffer (thread->buffer, thread->buffer->size);
-       deinit_thread (thread);
-
-       mono_thread_info_detach ();
-
-       return NULL;
-}
-
-static int
-start_writer_thread (MonoProfiler* prof)
-{
-       InterlockedWrite (&prof->run_writer_thread, 1);
-
-       return !pthread_create (&prof->writer_thread, NULL, writer_thread, prof);
-}
-
-static void
-reuse_sample_hit (gpointer p)
-{
-       SampleHit *sample = p;
-
-       mono_lock_free_queue_node_unpoison (&sample->node);
-       mono_lock_free_queue_enqueue (&sample->prof->sample_reuse_queue, &sample->node);
-}
-
-static gboolean
-handle_dumper_queue_entry (MonoProfiler *prof)
-{
-       SampleHit *sample;
-
-       if ((sample = (SampleHit *) mono_lock_free_queue_dequeue (&prof->dumper_queue))) {
-               for (int i = 0; i < sample->count; ++i) {
-                       MonoMethod *method = sample->frames [i].method;
-                       MonoDomain *domain = sample->frames [i].domain;
-                       void *address = sample->frames [i].base_address;
-
-                       if (!method) {
-                               g_assert (domain && "What happened to the domain pointer?");
-                               g_assert (address && "What happened to the instruction pointer?");
-
-                               MonoJitInfo *ji = mono_jit_info_table_find (domain, (char *) address);
-
-                               if (ji)
-                                       sample->frames [i].method = mono_jit_info_get_method (ji);
-                       }
-               }
-
-               LogBuffer *logbuffer = ensure_logbuf_unsafe (
-                       EVENT_SIZE /* event */ +
-                       BYTE_SIZE /* type */ +
-                       LEB128_SIZE /* tid */ +
-                       LEB128_SIZE /* count */ +
-                       1 * (
-                               LEB128_SIZE /* ip */
-                       ) +
-                       LEB128_SIZE /* managed count */ +
-                       sample->count * (
-                               LEB128_SIZE /* method */
-                       )
-               );
-
-               emit_event_time (logbuffer, TYPE_SAMPLE | TYPE_SAMPLE_HIT, sample->time);
-               emit_byte (logbuffer, sample_type);
-               emit_ptr (logbuffer, (void *) sample->tid);
-               emit_value (logbuffer, 1);
-
-               // TODO: Actual native unwinding.
-               for (int i = 0; i < 1; ++i) {
-                       emit_ptr (logbuffer, sample->ip);
-                       add_code_pointer ((uintptr_t) sample->ip);
-               }
-
-               /* new in data version 6 */
-               emit_uvalue (logbuffer, sample->count);
-
-               for (int i = 0; i < sample->count; ++i)
-                       emit_method (prof, logbuffer, sample->frames [i].method);
-
-               mono_thread_hazardous_try_free (sample, reuse_sample_hit);
-
-               dump_unmanaged_coderefs (prof);
-
-               send_if_needed_threadless (prof);
-       }
-
-       return FALSE;
-}
-
-static void *
-dumper_thread (void *arg)
-{
-       MonoProfiler *prof = (MonoProfiler *)arg;
-
-       mono_threads_attach_tools_thread ();
-       mono_native_thread_set_name (mono_native_thread_id_get (), "Profiler dumper");
-
-       MonoProfilerThread *thread = init_thread (FALSE);
-
-       while (InterlockedRead (&prof->run_dumper_thread)) {
-               mono_os_sem_wait (&prof->dumper_queue_sem, MONO_SEM_FLAGS_NONE);
-               handle_dumper_queue_entry (prof);
-       }
-
-       /* Drain any remaining entries on shutdown. */
-       while (handle_dumper_queue_entry (prof));
-
-       safe_send_threadless (prof);
-       deinit_thread (thread);
-
-       mono_thread_info_detach ();
-
-       return NULL;
-}
-
-static int
-start_dumper_thread (MonoProfiler* prof)
-{
-       InterlockedWrite (&prof->run_dumper_thread, 1);
-
-       return !pthread_create (&prof->dumper_thread, NULL, dumper_thread, prof);
-}
-
-static void
-runtime_initialized (MonoProfiler *profiler)
-{
-       InterlockedWrite (&runtime_inited, 1);
-
-#ifndef DISABLE_HELPER_THREAD
-       if (hs_mode_ondemand || need_helper_thread) {
-               if (!start_helper_thread (profiler))
-                       profiler->command_port = 0;
-       }
-#endif
-
-       start_writer_thread (profiler);
-       start_dumper_thread (profiler);
-
-       mono_counters_register ("Sample hits", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &sample_hits);
-       mono_counters_register ("Sample flushes", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &sample_flushes);
-       mono_counters_register ("Sample events allocated", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &sample_allocations);
-       mono_counters_register ("Log buffers allocated", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &buffer_allocations);
-       mono_counters_register ("Thread start events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &thread_starts);
-       mono_counters_register ("Thread stop events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &thread_ends);
-       mono_counters_register ("Domain load events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &domain_loads);
-       mono_counters_register ("Domain unload events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &domain_unloads);
-       mono_counters_register ("Context load events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &context_loads);
-       mono_counters_register ("Context unload events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &context_unloads);
-       mono_counters_register ("Assembly load events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &assembly_loads);
-       mono_counters_register ("Assembly unload events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &assembly_unloads);
-       mono_counters_register ("Image load events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &image_loads);
-       mono_counters_register ("Image unload events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &image_unloads);
-       mono_counters_register ("Class load events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &class_loads);
-       mono_counters_register ("Class unload events", MONO_COUNTER_UINT | MONO_COUNTER_PROFILER | MONO_COUNTER_MONOTONIC, &class_unloads);
-
-#ifndef DISABLE_HELPER_THREAD
-       counters_init (profiler);
-       counters_sample (profiler, 0);
-#endif
-       /* ensure the main thread data and startup are available soon */
-       safe_send (profiler);
-}
-
-static MonoProfiler*
-create_profiler (const char *args, const char *filename, GPtrArray *filters)
-{
-       MonoProfiler *prof;
-       char *nf;
-       int force_delete = 0;
-       prof = (MonoProfiler *)calloc (1, sizeof (MonoProfiler));
-
-       prof->args = pstrdup (args);
-       prof->command_port = command_port;
-       if (filename && *filename == '-') {
-               force_delete = 1;
-               filename++;
-       }
-       if (!filename) {
-               if (do_report)
-                       filename = "|mprof-report -";
-               else
-                       filename = "output.mlpd";
-               nf = (char*)filename;
-       } else {
-               nf = new_filename (filename);
-               if (do_report) {
-                       int s = strlen (nf) + 32;
-                       char *p = (char *)malloc (s);
-                       snprintf (p, s, "|mprof-report '--out=%s' -", nf);
-                       g_free (nf);
-                       nf = p;
-               }
-       }
-       if (*nf == '|') {
-               prof->file = popen (nf + 1, "w");
-               prof->pipe_output = 1;
-       } else if (*nf == '#') {
-               int fd = strtol (nf + 1, NULL, 10);
-               prof->file = fdopen (fd, "a");
-       } else {
-               if (force_delete)
-                       unlink (nf);
-               prof->file = fopen (nf, "wb");
-       }
-       if (!prof->file) {
-               fprintf (stderr, "Cannot create profiler output: %s\n", nf);
-               exit (1);
-       }
-#if defined (HAVE_SYS_ZLIB)
-       if (use_zip)
-               prof->gzfile = gzdopen (fileno (prof->file), "wb");
-#endif
-#if USE_PERF_EVENTS
-       if (sample_type && sample_freq && !do_mono_sample)
-               need_helper_thread = setup_perf_event ();
-       if (!perf_data) {
-               /* FIXME: warn if different freq or sample type */
-               do_mono_sample = 1;
-       }
-#endif
-       if (do_mono_sample) {
-               need_helper_thread = 1;
-       }
-       if (do_counters && !need_helper_thread) {
-               need_helper_thread = 1;
-       }
-
-       /*
-        * If you hit this assert while increasing MAX_FRAMES, you need to increase
-        * SAMPLE_BLOCK_SIZE as well.
-        */
-       g_assert (SAMPLE_SLOT_SIZE (MAX_FRAMES) * 2 < LOCK_FREE_ALLOC_SB_USABLE_SIZE (SAMPLE_BLOCK_SIZE));
-
-       // FIXME: We should free this stuff too.
-       mono_lock_free_allocator_init_size_class (&prof->sample_size_class, SAMPLE_SLOT_SIZE (num_frames), SAMPLE_BLOCK_SIZE);
-       mono_lock_free_allocator_init_allocator (&prof->sample_allocator, &prof->sample_size_class, MONO_MEM_ACCOUNT_PROFILER);
-
-       mono_lock_free_queue_init (&prof->sample_reuse_queue);
-
-#ifdef DISABLE_HELPER_THREAD
-       if (hs_mode_ondemand)
-               fprintf (stderr, "Ondemand heapshot unavailable on this arch.\n");
-
-       if (do_coverage)
-               fprintf (stderr, "Coverage unavailable on this arch.\n");
-
-#endif
-
-       g_assert (sizeof (WriterQueueEntry) * 2 < LOCK_FREE_ALLOC_SB_USABLE_SIZE (WRITER_ENTRY_BLOCK_SIZE));
-
-       // FIXME: We should free this stuff too.
-       mono_lock_free_allocator_init_size_class (&prof->writer_entry_size_class, sizeof (WriterQueueEntry), WRITER_ENTRY_BLOCK_SIZE);
-       mono_lock_free_allocator_init_allocator (&prof->writer_entry_allocator, &prof->writer_entry_size_class, MONO_MEM_ACCOUNT_PROFILER);
-
-       mono_lock_free_queue_init (&prof->writer_queue);
-       mono_os_sem_init (&prof->writer_queue_sem, 0);
-
-       mono_lock_free_queue_init (&prof->dumper_queue);
-       mono_os_sem_init (&prof->dumper_queue_sem, 0);
-
-       mono_os_mutex_init (&prof->method_table_mutex);
-       prof->method_table = mono_conc_hashtable_new (NULL, NULL);
-
-       if (do_coverage)
-               coverage_init (prof);
-       prof->coverage_filters = filters;
-
-       prof->startup_time = current_time ();
-       return prof;
-}
-
-static void
-usage (int do_exit)
-{
-       printf ("Log profiler version %d.%d (format: %d)\n", LOG_VERSION_MAJOR, LOG_VERSION_MINOR, LOG_DATA_VERSION);
-       printf ("Usage: mono --profile=log[:OPTION1[,OPTION2...]] program.exe\n");
-       printf ("Options:\n");
-       printf ("\thelp                 show this usage info\n");
-       printf ("\t[no]alloc            enable/disable recording allocation info\n");
-       printf ("\t[no]calls            enable/disable recording enter/leave method events\n");
-       printf ("\theapshot[=MODE]      record heap shot info (by default at each major collection)\n");
-       printf ("\t                     MODE: every XXms milliseconds, every YYgc collections, ondemand\n");
-       printf ("\tcounters             sample counters every 1s\n");
-       printf ("\tsample[=TYPE]        use statistical sampling mode (by default cycles/100)\n");
-       printf ("\t                     TYPE: cycles,instr,cacherefs,cachemiss,branches,branchmiss\n");
-       printf ("\t                     TYPE can be followed by /FREQUENCY\n");
-       printf ("\ttime=fast            use a faster (but more inaccurate) timer\n");
-       printf ("\tmaxframes=NUM        collect up to NUM stack frames\n");
-       printf ("\tcalldepth=NUM        ignore method events for call chain depth bigger than NUM\n");
-       printf ("\toutput=FILENAME      write the data to file FILENAME (-FILENAME to overwrite)\n");
-       printf ("\toutput=|PROGRAM      write the data to the stdin of PROGRAM\n");
-       printf ("\t                     %%t is subtituted with date and time, %%p with the pid\n");
-       printf ("\treport               create a report instead of writing the raw data to a file\n");
-       printf ("\tzip                  compress the output data\n");
-       printf ("\tport=PORTNUM         use PORTNUM for the listening command server\n");
-       printf ("\tcoverage             enable collection of code coverage data\n");
-       printf ("\tcovfilter=ASSEMBLY   add an assembly to the code coverage filters\n");
-       printf ("\t                     add a + to include the assembly or a - to exclude it\n");
-       printf ("\t                     filter=-mscorlib\n");
-       printf ("\tcovfilter-file=FILE  use FILE to generate the list of assemblies to be filtered\n");
-       if (do_exit)
-               exit (1);
-}
-
-static const char*
-match_option (const char* p, const char *opt, char **rval)
-{
-       int len = strlen (opt);
-       if (strncmp (p, opt, len) == 0) {
-               if (rval) {
-                       if (p [len] == '=' && p [len + 1]) {
-                               const char *opt = p + len + 1;
-                               const char *end = strchr (opt, ',');
-                               char *val;
-                               int l;
-                               if (end == NULL) {
-                                       l = strlen (opt);
-                               } else {
-                                       l = end - opt;
-                               }
-                               val = (char *)malloc (l + 1);
-                               memcpy (val, opt, l);
-                               val [l] = 0;
-                               *rval = val;
-                               return opt + l;
-                       }
-                       if (p [len] == 0 || p [len] == ',') {
-                               *rval = NULL;
-                               return p + len + (p [len] == ',');
-                       }
-                       usage (1);
-               } else {
-                       if (p [len] == 0)
-                               return p + len;
-                       if (p [len] == ',')
-                               return p + len + 1;
-               }
-       }
-       return p;
-}
-
-typedef struct {
-       const char *name;
-       int sample_mode;
-} SampleMode;
-
-static const SampleMode sample_modes [] = {
-       {"cycles", SAMPLE_CYCLES},
-       {"instr", SAMPLE_INSTRUCTIONS},
-       {"cachemiss", SAMPLE_CACHE_MISSES},
-       {"cacherefs", SAMPLE_CACHE_REFS},
-       {"branches", SAMPLE_BRANCHES},
-       {"branchmiss", SAMPLE_BRANCH_MISSES},
-       {NULL, 0}
-};
-
-static void
-set_sample_mode (char* val, int allow_empty)
-{
-       char *end;
-       char *maybe_freq = NULL;
-       unsigned int count;
-       const SampleMode *smode = sample_modes;
-#ifndef USE_PERF_EVENTS
-       do_mono_sample = 1;
-#endif
-       if (allow_empty && !val) {
-               sample_type = SAMPLE_CYCLES;
-               sample_freq = 100;
-               return;
-       }
-       if (strcmp (val, "mono") == 0) {
-               do_mono_sample = 1;
-               sample_type = SAMPLE_CYCLES;
-               g_free (val);
-               return;
-       }
-       for (smode = sample_modes; smode->name; smode++) {
-               int l = strlen (smode->name);
-               if (strncmp (val, smode->name, l) == 0) {
-                       sample_type = smode->sample_mode;
-                       maybe_freq = val + l;
-                       break;
-               }
-       }
-       if (!smode->name)
-               usage (1);
-       if (*maybe_freq == '/') {
-               count = strtoul (maybe_freq + 1, &end, 10);
-               if (maybe_freq + 1 == end)
-                       usage (1);
-               sample_freq = count;
-       } else if (*maybe_freq != 0) {
-               usage (1);
-       } else {
-               sample_freq = 100;
-       }
-       g_free (val);
-}
-
-static void
-set_hsmode (char* val, int allow_empty)
-{
-       char *end;
-       unsigned int count;
-       if (allow_empty && !val)
-               return;
-       if (strcmp (val, "ondemand") == 0) {
-               hs_mode_ondemand = 1;
-               g_free (val);
-               return;
-       }
-       count = strtoul (val, &end, 10);
-       if (val == end)
-               usage (1);
-       if (strcmp (end, "ms") == 0)
-               hs_mode_ms = count;
-       else if (strcmp (end, "gc") == 0)
-               hs_mode_gc = count;
-       else
-               usage (1);
-       g_free (val);
-}
-
-/*
- * declaration to silence the compiler: this is the entry point that
- * mono will load from the shared library and call.
- */
-extern void
-mono_profiler_startup (const char *desc);
-
-extern void
-mono_profiler_startup_log (const char *desc);
-
-/*
- * this is the entry point that will be used when the profiler
- * is embedded inside the main executable.
- */
-void
-mono_profiler_startup_log (const char *desc)
-{
-       mono_profiler_startup (desc);
-}
-
-void
-mono_profiler_startup (const char *desc)
-{
-       MonoProfiler *prof;
-       GPtrArray *filters = NULL;
-       char *filename = NULL;
-       const char *p;
-       const char *opt;
-       int fast_time = 0;
-       int calls_enabled = 0;
-       int allocs_enabled = 0;
-       int only_counters = 0;
-       int only_coverage = 0;
-       int events = MONO_PROFILE_GC|MONO_PROFILE_ALLOCATIONS|
-               MONO_PROFILE_GC_MOVES|MONO_PROFILE_CLASS_EVENTS|MONO_PROFILE_THREADS|
-               MONO_PROFILE_ENTER_LEAVE|MONO_PROFILE_JIT_COMPILATION|MONO_PROFILE_EXCEPTIONS|
-               MONO_PROFILE_MONITOR_EVENTS|MONO_PROFILE_MODULE_EVENTS|MONO_PROFILE_GC_ROOTS|
-               MONO_PROFILE_INS_COVERAGE|MONO_PROFILE_APPDOMAIN_EVENTS|MONO_PROFILE_CONTEXT_EVENTS|
-               MONO_PROFILE_ASSEMBLY_EVENTS|MONO_PROFILE_GC_FINALIZATION;
-
-       max_allocated_sample_hits = mono_cpu_count () * 1000;
-
-       p = desc;
-       if (strncmp (p, "log", 3))
-               usage (1);
-       p += 3;
-       if (*p == ':')
-               p++;
-       for (; *p; p = opt) {
-               char *val;
-               if (*p == ',') {
-                       opt = p + 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "help", NULL)) != p) {
-                       usage (0);
-                       continue;
-               }
-               if ((opt = match_option (p, "calls", NULL)) != p) {
-                       calls_enabled = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "nocalls", NULL)) != p) {
-                       events &= ~MONO_PROFILE_ENTER_LEAVE;
-                       nocalls = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "alloc", NULL)) != p) {
-                       allocs_enabled = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "noalloc", NULL)) != p) {
-                       events &= ~MONO_PROFILE_ALLOCATIONS;
-                       continue;
-               }
-               if ((opt = match_option (p, "time", &val)) != p) {
-                       if (strcmp (val, "fast") == 0)
-                               fast_time = 1;
-                       else if (strcmp (val, "null") == 0)
-                               fast_time = 2;
-                       else
-                               usage (1);
-                       g_free (val);
-                       continue;
-               }
-               if ((opt = match_option (p, "report", NULL)) != p) {
-                       do_report = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "debug", NULL)) != p) {
-                       do_debug = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "sampling-real", NULL)) != p) {
-                       sampling_mode = MONO_PROFILER_STAT_MODE_REAL;
-                       continue;
-               }
-               if ((opt = match_option (p, "sampling-process", NULL)) != p) {
-                       sampling_mode = MONO_PROFILER_STAT_MODE_PROCESS;
-                       continue;
-               }
-               if ((opt = match_option (p, "heapshot", &val)) != p) {
-                       events &= ~MONO_PROFILE_ALLOCATIONS;
-                       events &= ~MONO_PROFILE_ENTER_LEAVE;
-                       nocalls = 1;
-                       do_heap_shot = 1;
-                       set_hsmode (val, 1);
-                       continue;
-               }
-               if ((opt = match_option (p, "sample", &val)) != p) {
-                       events &= ~MONO_PROFILE_ALLOCATIONS;
-                       events &= ~MONO_PROFILE_ENTER_LEAVE;
-                       nocalls = 1;
-                       set_sample_mode (val, 1);
-                       continue;
-               }
-               if ((opt = match_option (p, "hsmode", &val)) != p) {
-                       fprintf (stderr, "The hsmode profiler option is obsolete, use heapshot=MODE.\n");
-                       set_hsmode (val, 0);
-                       continue;
-               }
-               if ((opt = match_option (p, "zip", NULL)) != p) {
-                       use_zip = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "output", &val)) != p) {
-                       filename = val;
-                       continue;
-               }
-               if ((opt = match_option (p, "port", &val)) != p) {
-                       char *end;
-                       command_port = strtoul (val, &end, 10);
-                       g_free (val);
-                       continue;
-               }
-               if ((opt = match_option (p, "maxframes", &val)) != p) {
-                       char *end;
-                       num_frames = strtoul (val, &end, 10);
-                       if (num_frames > MAX_FRAMES)
-                               num_frames = MAX_FRAMES;
-                       g_free (val);
-                       notraces = num_frames == 0;
-                       continue;
-               }
-               if ((opt = match_option (p, "maxsamples", &val)) != p) {
-                       char *end;
-                       max_allocated_sample_hits = strtoul (val, &end, 10);
-                       if (!max_allocated_sample_hits)
-                               max_allocated_sample_hits = G_MAXINT32;
-                       g_free (val);
-                       continue;
-               }
-               if ((opt = match_option (p, "calldepth", &val)) != p) {
-                       char *end;
-                       max_call_depth = strtoul (val, &end, 10);
-                       g_free (val);
-                       continue;
-               }
-               if ((opt = match_option (p, "counters", NULL)) != p) {
-                       do_counters = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "countersonly", NULL)) != p) {
-                       only_counters = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "coverage", NULL)) != p) {
-                       do_coverage = 1;
-                       events |= MONO_PROFILE_ENTER_LEAVE;
-                       debug_coverage = (g_getenv ("MONO_PROFILER_DEBUG_COVERAGE") != NULL);
-                       continue;
-               }
-               if ((opt = match_option (p, "onlycoverage", NULL)) != p) {
-                       only_coverage = 1;
-                       continue;
-               }
-               if ((opt = match_option (p, "covfilter-file", &val)) != p) {
-                       FILE *filter_file;
-                       char *line, *content;
-
-                       if (filters == NULL)
-                               filters = g_ptr_array_new ();
-
-                       filter_file = fopen (val, "r");
-                       if (filter_file == NULL) {
-                               fprintf (stderr, "Unable to open %s\n", val);
-                               exit (0);
-                       }
-
-                       /* Don't need to free content as it is referred to by the lines stored in @filters */
-                       content = get_file_content (filter_file);
-                       if (content == NULL)
-                               fprintf (stderr, "WARNING: %s is greater than 128kb - ignoring\n", val);
-
-                       while ((line = get_next_line (content, &content)))
-                               g_ptr_array_add (filters, g_strchug (g_strchomp (line)));
-
-                       fclose (filter_file);
-                       continue;
-               }
-               if ((opt = match_option (p, "covfilter", &val)) != p) {
-                       if (filters == NULL)
-                               filters = g_ptr_array_new ();
-
-                       g_ptr_array_add (filters, val);
-                       continue;
-               }
-               if (opt == p) {
-                       usage (0);
-                       exit (0);
-               }
-       }
-       if (calls_enabled) {
-               events |= MONO_PROFILE_ENTER_LEAVE;
-               nocalls = 0;
-       }
-       if (allocs_enabled)
-               events |= MONO_PROFILE_ALLOCATIONS;
-       if (only_counters)
-               events = 0;
-       if (only_coverage)
-               events = MONO_PROFILE_ENTER_LEAVE | MONO_PROFILE_INS_COVERAGE;
-
-       utils_init (fast_time);
-
-       PROF_TLS_INIT ();
-
-       prof = create_profiler (desc, filename, filters);
-       if (!prof) {
-               PROF_TLS_FREE ();
-               return;
-       }
-
-       mono_lls_init (&profiler_thread_list, NULL);
-
-       init_thread (TRUE);
-
-       mono_profiler_install (prof, log_shutdown);
-       mono_profiler_install_gc (gc_event, gc_resize);
-       mono_profiler_install_allocation (gc_alloc);
-       mono_profiler_install_gc_moves (gc_moves);
-       mono_profiler_install_gc_roots (gc_handle, gc_roots);
-       mono_profiler_install_gc_finalize (finalize_begin, finalize_object_begin, finalize_object_end, finalize_end);
-       mono_profiler_install_appdomain (NULL, domain_loaded, domain_unloaded, NULL);
-       mono_profiler_install_appdomain_name (domain_name);
-       mono_profiler_install_context (context_loaded, context_unloaded);
-       mono_profiler_install_class (NULL, class_loaded, class_unloaded, NULL);
-       mono_profiler_install_module (NULL, image_loaded, image_unloaded, NULL);
-       mono_profiler_install_assembly (NULL, assembly_loaded, assembly_unloaded, NULL);
-       mono_profiler_install_thread (thread_start, thread_end);
-       mono_profiler_install_thread_name (thread_name);
-       mono_profiler_install_enter_leave (method_enter, method_leave);
-       mono_profiler_install_jit_end (method_jitted);
-       mono_profiler_install_code_buffer_new (code_buffer_new);
-       mono_profiler_install_exception (throw_exc, method_exc_leave, clause_exc);
-       mono_profiler_install_monitor (monitor_event);
-       mono_profiler_install_runtime_initialized (runtime_initialized);
-       if (do_coverage)
-               mono_profiler_install_coverage_filter (coverage_filter);
-
-       if (do_mono_sample && sample_type == SAMPLE_CYCLES && sample_freq && !only_counters) {
-               events |= MONO_PROFILE_STATISTICAL;
-               mono_profiler_set_statistical_mode (sampling_mode, sample_freq);
-               mono_profiler_install_statistical (mono_sample_hit);
-       }
-
-       mono_profiler_set_events ((MonoProfileFlags)events);
-}
diff --git a/mono/profiler/proflog.h b/mono/profiler/proflog.h
deleted file mode 100644 (file)
index 5649d8b..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#ifndef __MONO_PROFLOG_H__
-#define __MONO_PROFLOG_H__
-
-#define BUF_ID 0x4D504C01
-#define LOG_HEADER_ID 0x4D505A01
-#define LOG_VERSION_MAJOR 1
-#define LOG_VERSION_MINOR 0
-#define LOG_DATA_VERSION 13
-/*
- * Changes in major/minor versions:
- * version 1.0: removed sysid field from header
- *              added args, arch, os fields to header
- *
- * Changes in data versions:
- * version 2: added offsets in heap walk
- * version 3: added GC roots
- * version 4: added sample/statistical profiling
- * version 5: added counters sampling
- * version 6: added optional backtrace in sampling info
- * version 8: added TYPE_RUNTIME and JIT helpers/trampolines
- * version 9: added MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING
- * version 10: added TYPE_COVERAGE
- * version 11: added thread ID to TYPE_SAMPLE_HIT
-               added more load/unload events
-                   unload for class
-                   unload for image
-                   load/unload for appdomain
-                   load/unload for contexts
-                   load/unload/name for assemblies
-               removed TYPE_LOAD_ERR flag (profiler never generated it, now removed from the format itself)
-               added TYPE_GC_HANDLE_{CREATED,DESTROYED}_BT
-               TYPE_JIT events are no longer guaranteed to have code start/size info (can be zero)
- * version 12: added MONO_COUNTER_PROFILER
- * version 13: added MONO_GC_EVENT_{PRE_STOP_WORLD_LOCKED,POST_START_WORLD_UNLOCKED}
-               added TYPE_META + TYPE_SYNC_POINT
-               removed il and native offset in TYPE_SAMPLE_HIT
-               methods in backtraces are now encoded as proper method pointers
-               removed flags in backtrace format
-               removed flags in metadata events
-               changed the following fields to a single byte rather than leb128
-                   TYPE_GC_EVENT: event_type, generation
-                   TYPE_HEAP_ROOT: root_type
-                   TYPE_JITHELPER: type
-                   TYPE_SAMPLE_HIT: sample_type
-                   TYPE_CLAUSE: clause_type
-                   TYPE_SAMPLE_COUNTERS_DESC: type, unit, variance
-                   TYPE_SAMPLE_COUNTERS: type
-               added time fields to all events that were missing one
-                   TYPE_HEAP_OBJECT
-                   TYPE_HEAP_ROOT
-                   TYPE_SAMPLE_USYM
-                   TYPE_SAMPLE_COUNTERS_DESC
-                   TYPE_COVERAGE_METHOD
-                   TYPE_COVERAGE_STATEMENT
-                   TYPE_COVERAGE_CLASS
-                   TYPE_COVERAGE_ASSEMBLY
-               moved the time field in TYPE_SAMPLE_HIT to right after the event byte, now encoded as a regular time field
-               changed the time field in TYPE_SAMPLE_COUNTERS to be encoded as a regular time field (in nanoseconds)
-               added TYPE_GC_FINALIZE_{START,END,OBJECT_START,OBJECT_END}
- */
-
-enum {
-       TYPE_ALLOC,
-       TYPE_GC,
-       TYPE_METADATA,
-       TYPE_METHOD,
-       TYPE_EXCEPTION,
-       TYPE_MONITOR,
-       TYPE_HEAP,
-       TYPE_SAMPLE,
-       TYPE_RUNTIME,
-       TYPE_COVERAGE,
-       TYPE_META,
-       /* extended type for TYPE_HEAP */
-       TYPE_HEAP_START  = 0 << 4,
-       TYPE_HEAP_END    = 1 << 4,
-       TYPE_HEAP_OBJECT = 2 << 4,
-       TYPE_HEAP_ROOT   = 3 << 4,
-       /* extended type for TYPE_METADATA */
-       TYPE_END_LOAD     = 2 << 4,
-       TYPE_END_UNLOAD   = 4 << 4,
-       /* extended type for TYPE_GC */
-       TYPE_GC_EVENT  = 1 << 4,
-       TYPE_GC_RESIZE = 2 << 4,
-       TYPE_GC_MOVE   = 3 << 4,
-       TYPE_GC_HANDLE_CREATED      = 4 << 4,
-       TYPE_GC_HANDLE_DESTROYED    = 5 << 4,
-       TYPE_GC_HANDLE_CREATED_BT   = 6 << 4,
-       TYPE_GC_HANDLE_DESTROYED_BT = 7 << 4,
-       TYPE_GC_FINALIZE_START = 8 << 4,
-       TYPE_GC_FINALIZE_END = 9 << 4,
-       TYPE_GC_FINALIZE_OBJECT_START = 10 << 4,
-       TYPE_GC_FINALIZE_OBJECT_END = 11 << 4,
-       /* extended type for TYPE_METHOD */
-       TYPE_LEAVE     = 1 << 4,
-       TYPE_ENTER     = 2 << 4,
-       TYPE_EXC_LEAVE = 3 << 4,
-       TYPE_JIT       = 4 << 4,
-       /* extended type for TYPE_EXCEPTION */
-       TYPE_THROW_NO_BT = 0 << 7,
-       TYPE_THROW_BT    = 1 << 7,
-       TYPE_CLAUSE      = 1 << 4,
-       /* extended type for TYPE_ALLOC */
-       TYPE_ALLOC_NO_BT  = 0 << 4,
-       TYPE_ALLOC_BT     = 1 << 4,
-       /* extended type for TYPE_MONITOR */
-       TYPE_MONITOR_NO_BT  = 0 << 7,
-       TYPE_MONITOR_BT     = 1 << 7,
-       /* extended type for TYPE_SAMPLE */
-       TYPE_SAMPLE_HIT           = 0 << 4,
-       TYPE_SAMPLE_USYM          = 1 << 4,
-       TYPE_SAMPLE_UBIN          = 2 << 4,
-       TYPE_SAMPLE_COUNTERS_DESC = 3 << 4,
-       TYPE_SAMPLE_COUNTERS      = 4 << 4,
-       /* extended type for TYPE_RUNTIME */
-       TYPE_JITHELPER = 1 << 4,
-       /* extended type for TYPE_COVERAGE */
-       TYPE_COVERAGE_ASSEMBLY = 0 << 4,
-       TYPE_COVERAGE_METHOD   = 1 << 4,
-       TYPE_COVERAGE_STATEMENT = 2 << 4,
-       TYPE_COVERAGE_CLASS = 3 << 4,
-       /* extended type for TYPE_META */
-       TYPE_SYNC_POINT = 0 << 4,
-       TYPE_END
-};
-
-enum {
-       /* metadata type byte for TYPE_METADATA */
-       TYPE_CLASS    = 1,
-       TYPE_IMAGE    = 2,
-       TYPE_ASSEMBLY = 3,
-       TYPE_DOMAIN   = 4,
-       TYPE_THREAD   = 5,
-       TYPE_CONTEXT  = 6,
-};
-
-typedef enum {
-       SYNC_POINT_PERIODIC,
-       SYNC_POINT_WORLD_STOP,
-       SYNC_POINT_WORLD_START
-} MonoProfilerSyncPointType;
-
-// Sampling sources
-// Unless you have compiled with --enable-perf-events, only SAMPLE_CYCLES is available
-enum {
-       SAMPLE_CYCLES = 1,
-       SAMPLE_INSTRUCTIONS,
-       SAMPLE_CACHE_MISSES,
-       SAMPLE_CACHE_REFS,
-       SAMPLE_BRANCHES,
-       SAMPLE_BRANCH_MISSES,
-       SAMPLE_LAST
-};
-
-#endif /* __MONO_PROFLOG_H__ */
diff --git a/mono/profiler/utils.c b/mono/profiler/utils.c
deleted file mode 100644 (file)
index cfa7589..0000000
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * utils.c: log profiler and reporter utils
- *
- * We have here the minimal needed portability functions: we can't depend
- * on the ones provided by the runtime, since they are internal and,
- * especially mprof-report is an external program.
- * Note also that we don't take a glib/eglib dependency here for mostly
- * the same reason (but also because we need tight control in the profiler
- * over memory allocation, which needs to work with the world stopped).
- *
- * Author:
- *   Paolo Molaro (lupus@ximian.com)
- *
- * Copyright 2010 Novell, Inc (http://www.novell.com)
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-#include "utils.h"
-#include <stdlib.h>
-#include <time.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#ifdef HOST_WIN32
-#include <windows.h>
-#else
-#include <pthread.h>
-#include <sched.h>
-#endif
-#include <glib.h>
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-#if defined(__APPLE__)
-#include <mach/mach_time.h>  
-#include <stdio.h> 
-
-static mach_timebase_info_data_t timebase_info;
-#endif
-
-#ifndef MAP_ANONYMOUS
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-
-#define TICKS_PER_SEC 1000000000LL
-
-#if (defined(TARGET_X86) || defined(TARGET_AMD64)) && defined(__linux__) && defined(HAVE_SCHED_GETCPU)
-#define HAVE_RDTSC 1
-#endif
-
-typedef struct {
-       unsigned int timer_count;
-       int last_cpu;
-       uint64_t last_rdtsc;
-       uint64_t last_time;
-} TlsData;
-
-#ifdef HOST_WIN32
-static int tls_data;
-#define DECL_TLS_DATA TlsData *tls; tls = (TlsData *) TlsGetValue (tls_data); if (tls == NULL) { tls = (TlsData *) g_calloc (sizeof (TlsData), 1); TlsSetValue (tls_data, tls); }
-#define TLS_INIT(x) x = TlsAlloc()
-#elif HAVE_KW_THREAD
-static __thread TlsData tls_data;
-#define DECL_TLS_DATA TlsData *tls = &tls_data
-#define TLS_INIT(x)
-#else
-static pthread_key_t tls_data;
-#define DECL_TLS_DATA TlsData *tls; tls = (TlsData *) pthread_getspecific (tls_data); if (tls == NULL) { tls = (TlsData *) g_calloc (sizeof (TlsData), 1); pthread_setspecific (tls_data, tls); }
-#define TLS_INIT(x) pthread_key_create(&x, NULL)
-#endif
-
-#ifdef HOST_WIN32
-static CRITICAL_SECTION log_lock;
-static LARGE_INTEGER pcounter_freq;
-#else
-static pthread_mutex_t log_lock = PTHREAD_MUTEX_INITIALIZER;
-#endif
-
-static int timer_overhead = 0;
-static uint64_t time_inc = 0;
-typedef uint64_t (*TimeFunc)(void);
-
-static TimeFunc time_func;
-
-static uint64_t
-clock_time (void)
-{
-#if defined(__APPLE__)
-       uint64_t time = mach_absolute_time ();
-       
-       time *= timebase_info.numer;
-       time /= timebase_info.denom;
-
-       return time;
-#elif defined(HOST_WIN32)
-       LARGE_INTEGER value;
-       QueryPerformanceCounter (&value);
-       return value.QuadPart * TICKS_PER_SEC / pcounter_freq.QuadPart;
-#elif defined(CLOCK_MONOTONIC)
-       struct timespec tspec;
-       clock_gettime (CLOCK_MONOTONIC, &tspec);
-       return ((uint64_t)tspec.tv_sec * TICKS_PER_SEC + tspec.tv_nsec);
-#else
-       struct timeval tv;
-       gettimeofday (&tv, NULL);
-       return ((uint64_t)tv.tv_sec * TICKS_PER_SEC + tv.tv_usec * 1000);
-#endif
-}
-
-/* must be power of two */
-#define TIME_ADJ 8
-
-static uint64_t
-fast_current_time (void)
-{
-       DECL_TLS_DATA;
-       if (tls->timer_count++ & (TIME_ADJ - 1)) {
-               tls->last_time += time_inc;
-               return tls->last_time;
-       }
-       tls->last_time = clock_time ();
-       return tls->last_time;
-}
-
-#if HAVE_RDTSC
-
-#define rdtsc(low,high) \
-       __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
-
-static uint64_t
-safe_rdtsc (int *cpu)
-{
-       unsigned int low, high;
-       int c1 = sched_getcpu ();
-       int c2;
-       rdtsc (low, high);
-       c2 = sched_getcpu ();
-       if (c1 != c2) {
-               *cpu = -1;
-               return 0;
-       }
-       *cpu = c1;
-       return (((uint64_t) high) << 32) + (uint64_t)low;
-}
-
-static double cpu_freq;
-
-static int 
-have_rdtsc (void) {
-       char buf[256];
-       int have_freq = 0;
-       int have_flag = 0;
-       float val;
-       FILE *cpuinfo;
-       int cpu = sched_getcpu ();
-
-       if (cpu < 0)
-               return 0;
-
-       if (!(cpuinfo = fopen ("/proc/cpuinfo", "r")))
-               return 0;
-       while (fgets (buf, sizeof(buf), cpuinfo)) {
-               if (sscanf (buf, "cpu MHz : %f", &val) == 1) {
-                       /*printf ("got mh: %f\n", val);*/
-                       have_freq = 1;
-                       cpu_freq = val * 1000000;
-               }
-               if (strncmp (buf, "flags :", 5) == 0) {
-                       if (strstr (buf, "constant_tsc")) {
-                               have_flag = 1;
-                               /*printf ("have tsc\n");*/
-                       }
-               }
-       }
-       fclose (cpuinfo);
-       return have_flag? have_freq: 0;
-}
-
-static uint64_t
-rdtsc_current_time (void)
-{
-       DECL_TLS_DATA;
-       if (tls->timer_count++ & (TIME_ADJ*8 - 1)) {
-               int cpu;
-               uint64_t tsc = safe_rdtsc (&cpu);
-               if (cpu != -1 && cpu == tls->last_cpu) {
-                       int64_t diff = tsc - tls->last_rdtsc;
-                       uint64_t nsecs;
-                       if (diff > 0) {
-                               nsecs = (double)diff/cpu_freq;
-                               //printf ("%llu cycles: %llu nsecs\n", diff, nsecs);
-                               return tls->last_time + nsecs;
-                       } else {
-                               printf ("tsc went backwards\n");
-                       }
-               } else {
-                       //printf ("wrong cpu: %d\n", cpu);
-               }
-       }
-       tls->last_time = clock_time ();
-       tls->last_rdtsc = safe_rdtsc (&tls->last_cpu);
-       return tls->last_time;
-}
-#else
-#define have_rdtsc() 0
-#define rdtsc_current_time fast_current_time
-#endif
-
-static uint64_t
-null_time (void)
-{
-       static uint64_t timer = 0;
-       return timer++;
-}
-
-void
-utils_init (int fast_time)
-{
-       int i;
-       uint64_t time_start, time_end;
-       TLS_INIT (tls_data);
-#ifdef HOST_WIN32
-       InitializeCriticalSection (&log_lock);
-       QueryPerformanceFrequency (&pcounter_freq);
-#endif
-#if defined (__APPLE__)
-       mach_timebase_info (&timebase_info);
-#endif
-
-       if (fast_time > 1) {
-               time_func = null_time;
-       } else if (fast_time) {
-               uint64_t timea;
-               uint64_t timeb;
-               clock_time ();
-               timea = clock_time ();
-               timeb = clock_time ();
-               time_inc = (timeb - timea) / TIME_ADJ;
-               /*printf ("time inc: %llu, timea: %llu, timeb: %llu, diff: %llu\n", time_inc, timea, timeb, timec-timeb);*/
-               if (have_rdtsc ())
-                       time_func = rdtsc_current_time;
-               else
-                       time_func = fast_current_time;
-       } else {
-               time_func = clock_time;
-       }
-       time_start = time_func ();
-       for (i = 0; i < 256; ++i)
-               time_func ();
-       time_end = time_func ();
-       timer_overhead = (time_end - time_start) / 256;
-}
-
-int
-get_timer_overhead (void)
-{
-       return timer_overhead;
-}
-
-uint64_t
-current_time (void)
-{
-       return time_func ();
-}
-
-void*
-alloc_buffer (int size)
-{
-       void *ptr;
-#ifdef HOST_WIN32
-       ptr = VirtualAlloc (NULL, size, MEM_COMMIT, PAGE_READWRITE);
-       return ptr;
-#else
-       ptr = mmap (NULL, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
-       if (ptr == MAP_FAILED)
-               return NULL;
-       return ptr;
-#endif
-}
-
-void
-free_buffer (void *buf, int size)
-{
-#ifdef HOST_WIN32
-       VirtualFree (buf, 0, MEM_RELEASE);
-#else
-       munmap (buf, size);
-#endif
-}
-
-void
-take_lock (void)
-{
-#ifdef HOST_WIN32
-       EnterCriticalSection (&log_lock);
-#else
-       pthread_mutex_lock (&log_lock);
-#endif
-}
-
-void
-release_lock (void)
-{
-#ifdef HOST_WIN32
-       LeaveCriticalSection (&log_lock);
-#else
-       pthread_mutex_unlock (&log_lock);
-#endif
-}
-
-void
-encode_uleb128 (uint64_t value, uint8_t *buf, uint8_t **endbuf)
-{
-       uint8_t *p = buf;
-
-       do {
-               uint8_t b = value & 0x7f;
-               value >>= 7;
-               if (value != 0) /* more bytes to come */
-                       b |= 0x80;
-               *p ++ = b;
-       } while (value);
-
-       *endbuf = p;
-}
-
-void
-encode_sleb128 (intptr_t value, uint8_t *buf, uint8_t **endbuf)
-{
-       int more = 1;
-       int negative = (value < 0);
-       unsigned int size = sizeof (intptr_t) * 8;
-       uint8_t byte;
-       uint8_t *p = buf;
-
-       while (more) {
-               byte = value & 0x7f;
-               value >>= 7;
-               /* the following is unnecessary if the
-                * implementation of >>= uses an arithmetic rather
-                * than logical shift for a signed left operand
-                */
-               if (negative)
-                       /* sign extend */
-                       value |= - ((intptr_t)1 <<(size - 7));
-               /* sign bit of byte is second high order bit (0x40) */
-               if ((value == 0 && !(byte & 0x40)) ||
-                       (value == -1 && (byte & 0x40)))
-                       more = 0;
-               else
-                       byte |= 0x80;
-               *p ++= byte;
-       }
-
-       *endbuf = p;
-}
-
-uint64_t
-decode_uleb128 (uint8_t *buf, uint8_t **endbuf)
-{
-       uint64_t res = 0;
-       int shift = 0;
-
-       while (1) {
-               uint8_t b = *buf++;
-
-               res |= (((uint64_t)(b & 0x7f)) << shift);
-               if (!(b & 0x80))
-                       break;
-               shift += 7;
-       }
-
-       *endbuf = buf;
-
-       return res;
-}
-
-intptr_t
-decode_sleb128 (uint8_t *buf, uint8_t **endbuf)
-{
-       uint8_t *p = buf;
-       intptr_t res = 0;
-       int shift = 0;
-
-       while (1) {
-               uint8_t b = *p;
-               p ++;
-
-               res = res | (((intptr_t)(b & 0x7f)) << shift);
-               shift += 7;
-               if (!(b & 0x80)) {
-                       if (shift < sizeof (intptr_t) * 8 && (b & 0x40))
-                               res |= - ((intptr_t)1 << shift);
-                       break;
-               }
-       }
-
-       *endbuf = p;
-
-       return res;
-}
-
-uintptr_t
-thread_id (void)
-{
-#ifdef HOST_WIN32
-       return (uintptr_t)GetCurrentThreadId ();
-#else
-       return (uintptr_t)pthread_self ();
-#endif
-}
-
-uintptr_t
-process_id (void)
-{
-#ifdef HOST_WIN32
-       return GetCurrentProcessId ();
-#else
-       return (uintptr_t)getpid ();
-#endif
-}
-
diff --git a/mono/profiler/utils.h b/mono/profiler/utils.h
deleted file mode 100644 (file)
index 3af56d2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __MONO_MPLOG_UTILS_H__
-#define __MONO_MPLOG_UTILS_H__
-
-#include "config.h"
-#include "mono/utils/mono-publib.h"
-
-void utils_init (int fast_time);
-int get_timer_overhead (void);
-uint64_t current_time (void);
-void* alloc_buffer (int size);
-void free_buffer (void *buf, int size);
-void take_lock (void);
-void release_lock (void);
-uintptr_t thread_id (void);
-uintptr_t process_id (void);
-
-void encode_uleb128 (uint64_t value, uint8_t *buf, uint8_t **endbuf);
-void encode_sleb128 (intptr_t value, uint8_t *buf, uint8_t **endbuf);
-uint64_t decode_uleb128 (uint8_t *buf, uint8_t **endbuf);
-intptr_t decode_sleb128 (uint8_t *buf, uint8_t **endbuf);
-
-
-#endif /* __MONO_MPLOG_UTILS_H__ */
-
index 9fe2f3ceeb4a62b9fc16be861e6d28179fcaac1c..62039f7267901a805e94c8e1fb79c4c7c72a9dca 100644 (file)
@@ -110,4 +110,9 @@ void mono_gc_memmove_aligned (void *dest, const void *src, size_t size);
 
 FILE *mono_gc_get_logfile (void);
 
+/* equivalent to options set via MONO_GC_PARAMS */
+void mono_gc_params_set (const char* options);
+/* equivalent to options set via MONO_GC_DEBUG */
+void mono_gc_debug_set (const char* options);
+
 #endif
index d18fc7cfc73462dcbc69a84a794258fcf196a106..fa6046f519a7eca2a9bb6b91854e07ac7058da5c 100644 (file)
@@ -402,8 +402,11 @@ sgen_alloc_obj (GCVTable vtable, size_t size)
                int current_alloc = InterlockedIncrement (&alloc_count);
 
                if (verify_before_allocs) {
-                       if ((current_alloc % verify_before_allocs) == 0)
+                       if ((current_alloc % verify_before_allocs) == 0) {
+                               LOCK_GC;
                                sgen_check_whole_heap_stw ();
+                               UNLOCK_GC;
+                       }
                }
                if (collect_before_allocs) {
                        if (((current_alloc % collect_before_allocs) == 0) && nursery_section) {
index 04de0ac5876ea17087fb04e4cdf546437044444a..195894f8cbf1eecfa6997df325edc00fd9caf643 100644 (file)
@@ -983,7 +983,8 @@ check_reference_for_xdomain (GCObject **ptr, GCObject *obj, MonoDomain *domain)
        for (klass = obj->vtable->klass; klass; klass = klass->parent) {
                int i;
 
-               for (i = 0; i < klass->field.count; ++i) {
+               int fcount = mono_class_get_field_count (klass);
+               for (i = 0; i < fcount; ++i) {
                        if (klass->fields[i].offset == offset) {
                                field = &klass->fields[i];
                                break;
index f83cffc919e0364ae1aae42c0513fba6699f66c7..2fdd86c2bf0613f7e75129c417d5a3341f82c1a4 100644 (file)
@@ -290,6 +290,8 @@ static SGEN_TV_DECLARE (time_major_conc_collection_end);
 
 int gc_debug_level = 0;
 FILE* gc_debug_file;
+static char* gc_params_options;
+static char* gc_debug_options;
 
 /*
 void
@@ -990,6 +992,24 @@ mono_gc_get_logfile (void)
        return gc_debug_file;
 }
 
+void
+mono_gc_params_set (const char* options)
+{
+       if (gc_params_options)
+               g_free (gc_params_options);
+
+       gc_params_options = g_strdup (options);
+}
+
+void
+mono_gc_debug_set (const char* options)
+{
+       if (gc_debug_options)
+               g_free (gc_debug_options);
+
+       gc_debug_options = g_strdup (options);
+}
+
 static void
 scan_finalizer_entries (SgenPointerQueue *fin_queue, ScanCopyContext ctx)
 {
@@ -2735,6 +2755,8 @@ sgen_gc_init (void)
        char **opts, **ptr;
        char *major_collector_opt = NULL;
        char *minor_collector_opt = NULL;
+       char *params_opts = NULL;
+       char *debug_opts = NULL;
        size_t max_heap = 0;
        size_t soft_limit = 0;
        int result;
@@ -2772,8 +2794,12 @@ sgen_gc_init (void)
 
        mono_coop_mutex_init (&sgen_interruption_mutex);
 
-       if ((env = g_getenv (MONO_GC_PARAMS_NAME))) {
-               opts = g_strsplit (env, ",", -1);
+       if ((env = g_getenv (MONO_GC_PARAMS_NAME)) || gc_params_options) {
+               params_opts = g_strdup_printf ("%s,%s", gc_params_options ? gc_params_options : "", env ? env : "");
+       }
+
+       if (params_opts) {
+               opts = g_strsplit (params_opts, ",", -1);
                for (ptr = opts; *ptr; ++ptr) {
                        char *opt = *ptr;
                        if (g_str_has_prefix (opt, "major=")) {
@@ -2975,15 +3001,22 @@ sgen_gc_init (void)
        if (minor_collector_opt)
                g_free (minor_collector_opt);
 
+       if (params_opts)
+               g_free (params_opts);
+
        alloc_nursery ();
 
        sgen_pinning_init ();
        sgen_cement_init (cement_enabled);
 
-       if ((env = g_getenv (MONO_GC_DEBUG_NAME))) {
+       if ((env = g_getenv (MONO_GC_DEBUG_NAME)) || gc_debug_options) {
+               debug_opts = g_strdup_printf ("%s,%s", gc_debug_options ? gc_debug_options  : "", env ? env : "");
+       }
+
+       if (debug_opts) {
                gboolean usage_printed = FALSE;
 
-               opts = g_strsplit (env, ",", -1);
+               opts = g_strsplit (debug_opts, ",", -1);
                for (ptr = opts; ptr && *ptr; ptr ++) {
                        char *opt = *ptr;
                        if (!strcmp (opt, ""))
@@ -3114,6 +3147,9 @@ sgen_gc_init (void)
                g_strfreev (opts);
        }
 
+       if (debug_opts)
+               g_free (debug_opts);
+
        if (check_mark_bits_after_major_collection)
                nursery_clear_policy = CLEAR_AT_GC;
 
index aefb07f23c5b6a99b9f3510a43d90c353f7a829d..e99244aecf1b2cbeb9a1e2a0d20e0c33046c2f03 100644 (file)
@@ -182,7 +182,7 @@ sgen_aligned_addr_hash (gconstpointer ptr)
        return GPOINTER_TO_UINT (ptr) >> 3;
 }
 
-#define SGEN_PTR_IN_NURSERY(p,bits,start,end)  (((mword)(p) & ~((1 << (bits)) - 1)) == (mword)(start))
+#define SGEN_PTR_IN_NURSERY(p,bits,start,end)  (((mword)(p) & ~(((mword)1 << (bits)) - 1)) == (mword)(start))
 
 #ifdef USER_CONFIG
 
index 84ea7d4549a9b72c2179c676fc5d1dccf9a63feb..e8c0d7ab595a74fa63e86d3a8e03e087df4fd542 100644 (file)
@@ -65,12 +65,13 @@ block_size (size_t slot_size)
        static int pagesize = -1;
 
        int size;
+       size_t aligned_slot_size = SGEN_ALIGN_UP_TO (slot_size, SIZEOF_VOID_P);
 
        if (pagesize == -1)
                pagesize = mono_pagesize ();
 
        for (size = pagesize; size < LOCK_FREE_ALLOC_SB_MAX_SIZE; size <<= 1) {
-               if (slot_size * 2 <= LOCK_FREE_ALLOC_SB_USABLE_SIZE (size))
+               if (aligned_slot_size * 2 <= LOCK_FREE_ALLOC_SB_USABLE_SIZE (size))
                        return size;
        }
        return LOCK_FREE_ALLOC_SB_MAX_SIZE;
@@ -292,6 +293,9 @@ sgen_init_internal_allocator (void)
                 * so that we do not get different block sizes for sizes that should go to the same one
                 */
                g_assert (allocator_sizes [index_for_size (max_size)] == max_size);
+               g_assert (block_size (max_size) == size);
+               if (size < LOCK_FREE_ALLOC_SB_MAX_SIZE)
+                       g_assert (block_size (max_size + 1) == size << 1);
        }
 }
 
index 74c5c02a0278355074ab21273d63831791da11af..04b1f241e1abaff2b96990b572e1bdf5e5bf8907 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "sgen/sgen-gc.h"
 #include "sgen/sgen-layout-stats.h"
+#include <mono/utils/mono-compiler.h>
 
 #ifdef SGEN_OBJECT_LAYOUT_STATISTICS
 
@@ -58,6 +59,8 @@ sgen_object_layout_dump (FILE *out)
        fprintf (out, "ref-array %lu\n", count_ref_array);
        fprintf (out, "vtype-array %lu\n", count_vtype_array);
 }
+#else
 
-#endif
+MONO_EMPTY_SOURCE_FILE (sgen_layout_stats);
+#endif /* SGEN_OBJECT_LAYOUT_STATISTICS */
 #endif
index dc69381547f60bfb192de3cbec934092f20022c3..d6c7f130f3cae7571d5524cd7cdf67c65119ce28 100644 (file)
@@ -295,7 +295,7 @@ sgen_output_log_entry (SgenLogEntry *entry, gint64 stw_time, int generation)
 
        switch (entry->type) {
                case SGEN_LOG_NURSERY:
-                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MINOR%s: (%s) time %.2fms, %s promoted %dK major size: %dK in use: %dK los size: %dK in use: %dK",
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MINOR%s: (%s) time %.2fms, %s promoted %zdK major size: %zdK in use: %zdK los size: %zdK in use: %zdK",
                                entry->is_overflow ? "_OVERFLOW" : "",
                                entry->reason ? entry->reason : "",
                                entry->time / 10000.0f,
@@ -307,7 +307,7 @@ sgen_output_log_entry (SgenLogEntry *entry, gint64 stw_time, int generation)
                                entry->los_size_in_use / 1024);
                        break;
                case SGEN_LOG_MAJOR_SERIAL:
-                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR%s: (%s) time %.2fms, %s los size: %dK in use: %dK",
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR%s: (%s) time %.2fms, %s los size: %zdK in use: %zdK",
                                entry->is_overflow ? "_OVERFLOW" : "",
                                entry->reason ? entry->reason : "",
                                (int)entry->time / 10000.0f,
@@ -319,7 +319,7 @@ sgen_output_log_entry (SgenLogEntry *entry, gint64 stw_time, int generation)
                        mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_CONCURRENT_START: (%s)", entry->reason ? entry->reason : "");
                        break;
                case SGEN_LOG_MAJOR_CONC_FINISH:
-                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_CONCURRENT_FINISH: (%s) time %.2fms, %s los size: %dK in use: %dK",
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_CONCURRENT_FINISH: (%s) time %.2fms, %s los size: %zdK in use: %zdK",
                                entry->reason ? entry->reason : "",
                                entry->time / 10000.0f,
                                full_timing_buff,
@@ -327,7 +327,7 @@ sgen_output_log_entry (SgenLogEntry *entry, gint64 stw_time, int generation)
                                entry->los_size_in_use / 1024);
                        break;
                case SGEN_LOG_MAJOR_SWEEP_FINISH:
-                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_SWEEP: major size: %dK in use: %dK",
+                       mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_GC, "GC_MAJOR_SWEEP: major size: %zdK in use: %zdK",
                                entry->major_size / 1024,
                                entry->major_size_in_use / 1024);
                        break;
index de70fe0b446e5c46d283e401eb4d1f264fd844bf..d33cbe63f8db13f7939b136c3aa10ceb9e3580cc 100644 (file)
@@ -85,62 +85,64 @@ STRESS_TESTS_SRC=   \
        assembly-load-stress.cs
 
 BASE_TEST_MOBILE_STATIC_NOT_SUPPORTED= \
-       remoting4.cs            # Needs remoting support \
-       remoting1.cs            # Needs remoting support \
-       remoting2.cs            # Needs remoting support \
-       remoting3.cs            # Needs remoting support \
-       remoting5.cs            # Needs remoting support \
-       appdomain.cs        # Needs appdomain support \
-       appdomain-client.cs     # Needs appdomain support \
-       appdomain-unload.cs # Needs appdomain support \
-       appdomain-async-invoke.cs       # Needs appdomain support \
-       appdomain-thread-abort.cs       # Needs appdomain support \
-       appdomain1.cs           # Needs appdomain support \
-       appdomain2.cs           # Needs appdomain support \
-       appdomain-exit.cs       # Needs appdomain support \
-       assemblyresolve_event2.2.cs     # Needs appdomain support \
-       appdomain-unload-callback.cs    # Needs appdomain support \
-       appdomain-unload-doesnot-raise-pending-events.cs        # Needs appdomain support \
-       unload-appdomain-on-shutdown.cs # Needs appdomain support \
-       bug-47295.cs # Needs SRE \
-       loader.cs # Needs SRE \
-       pinvoke2.cs # Needs SRE \
-       generic-type-builder.2.cs       # Needs SRE \
-       dynamic-generic-size.cs # Needs SRE \
-       cominterop.cs   # Needs COM \
-       dynamic-method-access.2.cs      # Need SRE \
-       dynamic-method-finalize.2.cs    # Need SRE \
-       dynamic-method-stack-traces.cs # Need SRE\
-       generic_type_definition.2.cs    # Need SRE \
-       bug-333798-tb.2.cs      # Need SRE \
-       bug-335131.2.cs # Need SRE \
-       bug-322722_patch_bx.2.cs        # Need SRE\
-       bug-322722_dyn_method_throw.2.cs        # Need SRE \
-       bug-389886-2.cs # Need SRE \
-       bug-349190.2.cs # Need SRE \
-       bug-389886-sre-generic-interface-instances.cs   # Need SRE \
-       bug-462592.cs   # Need SRE \
-       bug-575941.cs   # Need SRE \
-       bug-389886-3.cs # Need SRE \
-       constant-division.cs    # Need SRE \
-       dynamic-method-resurrection.cs  # Need SRE \
-       bug-80307.cs    # Need System.Web \
-       assembly_append_ordering.cs # Need SRE \
-       bug-544446.cs   # Needs AppDomains / TranparentProxy \
-       bug-36848.cs   # Needs AppDomains / TranparentProxy \
-       generic-marshalbyref.2.cs # Needs AppDomains \
-       stackframes-async.2.cs # Needs AppDomains \
-       transparentproxy.cs # Needs AppDomains / TranparentProxy \
-       bug-48015.cs # Needs AppDomains / TranparentProxy \
-       delegate9.cs # Needs AppDomains \
-       marshal-valuetypes.cs   # Needs AppDomains \
-       xdomain-threads.cs      # Needs AppDomains \
-       monitor.cs # Needs AppDomains \
-       generic-xdomain.2.cs # Needs AppDomains \
-       threadpool-exceptions7.cs # Needs AppDomains \
-       cross-domain.cs # Needs AppDomains \
-       generic-unloading.2.cs # Needs AppDomains \
-       thread6.cs # On MOBILE, ThreadAbortException doesn't have necessary field for this test
+       remoting4.cs    \
+       remoting1.cs    \
+       remoting2.cs    \
+       remoting3.cs    \
+       remoting5.cs    \
+       appdomain.cs    \
+       appdomain-client.cs     \
+       appdomain-unload.cs     \
+       appdomain-async-invoke.cs       \
+       appdomain-thread-abort.cs       \
+       appdomain1.cs   \
+       appdomain2.cs   \
+       appdomain-exit.cs       \
+       assemblyresolve_event2.2.cs     \
+       appdomain-unload-callback.cs    \
+       appdomain-unload-doesnot-raise-pending-events.cs        \
+       unload-appdomain-on-shutdown.cs \
+       bug-47295.cs    \
+       loader.cs       \
+       pinvoke2.cs     \
+       generic-type-builder.2.cs       \
+       dynamic-generic-size.cs \
+       cominterop.cs   \
+       dynamic-method-access.2.cs      \
+       dynamic-method-finalize.2.cs    \
+       dynamic-method-stack-traces.cs  \
+       generic_type_definition.2.cs    \
+       bug-333798-tb.2.cs      \
+       bug-335131.2.cs \
+       bug-322722_patch_bx.2.cs        \
+       bug-322722_dyn_method_throw.2.cs        \
+       bug-389886-2.cs \
+       bug-349190.2.cs \
+       bug-389886-sre-generic-interface-instances.cs   \
+       bug-462592.cs   \
+       bug-575941.cs   \
+       bug-389886-3.cs \
+       constant-division.cs    \
+       dynamic-method-resurrection.cs  \
+       bug-80307.cs    \
+       assembly_append_ordering.cs     \
+       bug-544446.cs   \
+       bug-36848.cs    \
+       generic-marshalbyref.2.cs       \
+       stackframes-async.2.cs  \
+       transparentproxy.cs     \
+       bug-48015.cs    \
+       delegate9.cs    \
+       marshal-valuetypes.cs   \
+       xdomain-threads.cs      \
+       monitor.cs      \
+       generic-xdomain.2.cs    \
+       threadpool-exceptions7.cs       \
+       cross-domain.cs \
+       generic-unloading.2.cs  \
+       namedmutex-destroy-race.cs      \
+       thread6.cs      \
+       appdomain-threadpool-unload.cs
 
 # Disabled until ?mcs is fixed
 #      bug-331958.cs
@@ -193,6 +195,7 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        typeof-ptr.cs           \
        static-constructor.cs   \
        pinvoke.cs              \
+       pinvoke-utf8.cs         \
        pinvoke3.cs             \
        pinvoke11.cs            \
        pinvoke13.cs            \
@@ -468,8 +471,10 @@ BASE_TEST_CS_SRC_UNIVERSAL=                \
        bug-29585.cs    \
        priority.cs     \
        abort-cctor.cs  \
-       namedmutex-destroy-race.cs      \
-       thread-native-exit.cs
+       thread-native-exit.cs \
+       reference-loader.cs \
+       thread-suspend-suspended.cs \
+       thread-suspend-selfsuspended.cs
 
 if INSTALL_MOBILE_STATIC
 BASE_TEST_CS_SRC= \
@@ -514,7 +519,7 @@ if X86
 
 if HOST_WIN32
 PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe finally_block_ending_in_dead_bb.exe \
-       bug-18026.exe monitor.exe threadpool-exceptions5.exe
+       bug-18026.exe monitor.exe threadpool-exceptions5.exe pinvoke-utf8.exe
 endif
 
 endif
@@ -685,20 +690,30 @@ endif
 # delegate-invoke.exe depends on 929c6bc9b6d76a273f251e6f5dfacac36e9c38bd which was
 # reverted.
 # bug-Xamarin-5278.exe got broken by 5d26590e79da139a284459299aee95c25f4cd835
+# bug-45841-fpstack-exceptions.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47053
+# appdomain-thread-abort.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47054
 DISABLED_TESTS=                        \
        delegate-async-exception.exe    \
        bug-348522.2.exe        \
        bug-459094.exe \
        delegate-invoke.exe \
        bug-Xamarin-5278.exe \
+       bug-45841-fpstack-exceptions.exe \
+       appdomain-thread-abort.exe \
        $(PLATFORM_DISABLED_TESTS) \
        $(EXTRA_DISABLED_TESTS) \
        $(COOP_DISABLED_TESTS) \
        $(PROFILE_DISABLED_TESTS)
 
-DISABLED_TESTS_WRENCH= \
+# failing tests which we temporarily disable for PRs
+# so they don't interfere with other people's work
+DISABLED_TESTS_CI_PR = \
+       appdomain-threadpool-unload.exe \
+       appdomain-thread-abort.exe
+
+DISABLED_TESTS_CI=     \
        $(DISABLED_TESTS)       \
-       $(PLATFORM_DISABLED_TESTS_WRENCH)       \
+       $(shell if [ "x$(CI_PR)" != "x" ]; then echo $(DISABLED_TESTS_CI_PR); fi)       \
        main-returns-background-resetabort.exe \
        main-returns-background-abort-resetabort.exe    \
        thread6.exe     \
@@ -787,7 +802,8 @@ TEST_IL_SRC_UNIVERSAL=                      \
        delegate-with-null-target.il    \
        bug-318677.il   \
        gsharing-valuetype-layout.il    \
-       invalid_generic_instantiation.il
+       invalid_generic_instantiation.il \
+       bug-45841-fpstack-exceptions.il
 
 if INSTALL_MOBILE_STATIC
 TEST_IL_SRC= \
@@ -802,18 +818,22 @@ endif
 # but that need to be compiled
 PREREQ_IL_SRC=event-il.il module-cctor.il
 PREREQ_CS_SRC=
-PREREQ_IL_DLL_SRC=event-il.il module-cctor.il
-PREREQ_CS_DLL_SRC=
+PREREQ_IL_DLL_SRC=
+PREREQ_CS_DLL_SRC=TestingReferenceAssembly.cs TestingReferenceReferenceAssembly.cs
 
-PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe)
-PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe)
+PREREQSI_IL=$(PREREQ_IL_SRC:.il=.exe) \
+       $(PREREQ_IL_DLL_SRC:.il=.dll)
+PREREQSI_CS=$(PREREQ_CS_SRC:.cs=.exe) \
+       $(PREREQ_CS_DLL_SRC:.cs=.dll)
 TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
 TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
 TESTBS=$(BENCHSRC:.cs=.exe)
 STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
 
-PREREQSI_IL_AOT=$(PREREQ_IL_SRC:.il=.exe$(PLATFORM_AOT_SUFFIX))
-PREREQSI_CS_AOT=$(PREREQ_CS_SRC:.cs=.exe$(PLATFORM_AOT_SUFFIX))
+PREREQSI_IL_AOT=$(PREREQ_IL_SRC:.il=.exe$(PLATFORM_AOT_SUFFIX)) \
+               $(PREREQ_IL_DLL_SRC:.il=.dll$(PLATFORM_AOT_SUFFIX))
+PREREQSI_CS_AOT=$(PREREQ_CS_SRC:.cs=.exe$(PLATFORM_AOT_SUFFIX)) \
+               $(PREREQ_CS_DLL_SRC:.cs=.dll$(PLATFORM_AOT_SUFFIX))
 
 EXTRA_DIST=test-driver test-runner.cs $(TEST_CS_SRC_DIST) $(TEST_IL_SRC) \
        $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl $(PREREQ_IL_SRC) $(PREREQ_CS_SRC)
@@ -834,6 +854,12 @@ endif
 %.exe: %.cs $(TEST_DRIVER_DEPEND)
        $(MCS) -r:System.dll -r:System.Xml.dll -r:System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
 
+%.dll: %.cs
+       $(MCS) -r:System.dll -target:library -out:$@ $<
+
+TestingReferenceReferenceAssembly.dll: TestingReferenceReferenceAssembly.cs TestingReferenceAssembly.dll
+       $(MCS) -r:TestingReferenceAssembly.dll -target:library -out:$@ $<
+
 %.exe$(PLATFORM_AOT_SUFFIX): %.exe 
        $(RUNTIME) $(AOT_BUILD_FLAGS) $<
 
@@ -868,7 +894,9 @@ bug-324535-il.dll$(PLATFORM_AOT_SUFFIX)     \
 bug-36848-a.dll$(PLATFORM_AOT_SUFFIX)  \
 bug-81691-b.dll$(PLATFORM_AOT_SUFFIX)  \
 bug-327438.2.exe$(PLATFORM_AOT_SUFFIX) \
-bug-81466-lib.dll$(PLATFORM_AOT_SUFFIX)
+bug-81466-lib.dll$(PLATFORM_AOT_SUFFIX)        \
+TestingReferenceAssembly.dll$(PLATFORM_AOT_SUFFIX)     \
+TestingReferenceReferenceAssembly.dll$(PLATFORM_AOT_SUFFIX)
 
 if INSTALL_MOBILE_STATIC
 prereqs: $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
@@ -934,7 +962,7 @@ test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
        @failed=0; \
        passed=0; \
        if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
-       if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
+       if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_CI)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
        for i in $(TESTSI_CS); do       \
                if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$${disabled_tests}" "$${dump_action}" $(RUNTIME_ARGS); \
                then \
@@ -950,7 +978,7 @@ test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
        @failed=0; \
        passed=0; \
        if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
-       if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
+       if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_CI)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
        for i in $(TESTSI_IL); do       \
                if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$${disabled_tests}" "$${dump_action}" $(RUNTIME_ARGS); \
                then \
@@ -964,7 +992,7 @@ test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
 
 testb: $(TEST_PROG) $(TESTBS)
        if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
-       if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
+       if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_CI)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
        for i in $(TESTBS); do  \
                $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$${disabled_tests}" "$${dump_action}" $(RUNTIME_ARGS);  \
        done
@@ -974,7 +1002,7 @@ runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQS
        passed=0; \
        failed_tests="";\
        if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
-       if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
+       if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_CI)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
        rm -f testlist testlist.sorted; \
        for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do echo $${i} >> testlist; sort testlist > testlist.sorted; done; \
        for i in `cat testlist.sorted`; do \
@@ -1004,11 +1032,11 @@ runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQS
        fi
 
 runtest-managed: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
-       @if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
+       @if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_CI)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
        $(RUNTIME) --debug $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --testsuite-name "runtime" --timeout 300 --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
 
 runtest-managed-serial: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
-       @if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_WRENCH)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
+       @if [ "x$$CI" = "x1" ]; then disabled_tests="$(DISABLED_TESTS_CI)"; else disabled_tests="$(DISABLED_TESTS)"; fi; \
        $(RUNTIME) --debug $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j 1 --testsuite-name "runtime" --disabled "$${disabled_tests}" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
 
 testjit:
@@ -1099,7 +1127,7 @@ debug-casts:
        @$(MCS) -r:TestDriver.dll $(srcdir)/debug-casts.cs
        @$(RUNTIME) --debug=casts debug-casts.exe
 
-EXTRA_DIST += sgen-bridge.cs sgen-descriptors.cs sgen-gshared-vtype.cs sgen-bridge-major-fragmentation.cs sgen-domain-unload.cs sgen-weakref-stress.cs sgen-cementing-stress.cs sgen-case-23400.cs     finalizer-wait.cs critical-finalizers.cs sgen-domain-unload-2.cs sgen-suspend.cs sgen-new-threads-dont-join-stw.cs sgen-new-threads-dont-join-stw-2.cs sgen-bridge-xref.cs bug-17590.cs sgen-toggleref.cs sgen-bridge-gchandle.cs
+EXTRA_DIST += sgen-bridge.cs sgen-descriptors.cs sgen-gshared-vtype.cs sgen-bridge-major-fragmentation.cs sgen-domain-unload.cs sgen-weakref-stress.cs sgen-cementing-stress.cs sgen-case-23400.cs     finalizer-wait.cs critical-finalizers.cs sgen-domain-unload-2.cs sgen-suspend.cs sgen-new-threads-dont-join-stw.cs sgen-new-threads-dont-join-stw-2.cs sgen-new-threads-collect.cs sgen-bridge-xref.cs bug-17590.cs sgen-toggleref.cs sgen-bridge-gchandle.cs
 
 
 sgen-tests:
@@ -1124,6 +1152,7 @@ SGEN_REGULAR_TESTS_UNIVERSAL =    \
        sgen-case-23400.exe     \
        sgen-new-threads-dont-join-stw.exe      \
        sgen-new-threads-dont-join-stw-2.exe    \
+       sgen-new-threads-collect.exe    \
        gc-graystack-stress.exe \
        bug-17590.exe
 
@@ -1137,31 +1166,31 @@ SGEN_REGULAR_TESTS= \
 endif
 
 sgen-regular-tests: $(SGEN_REGULAR_TESTS)
-       $(MAKE) sgen-regular-tests-plain
+       $(MAKE) sgen-regular-tests-ms
        $(MAKE) sgen-regular-tests-ms-conc
        $(MAKE) sgen-regular-tests-ms-conc-split
        $(MAKE) sgen-regular-tests-ms-split
-       $(MAKE) sgen-regular-tests-ms-split-95
-       $(MAKE) sgen-regular-tests-plain-clear-at-gc
+       $(MAKE) sgen-regular-tests-ms-conc-split-95
+       $(MAKE) sgen-regular-tests-ms-clear-at-gc
        $(MAKE) sgen-regular-tests-ms-conc-clear-at-gc
-       $(MAKE) sgen-regular-tests-ms-split-clear-at-gc
+       $(MAKE) sgen-regular-tests-ms-conc-split-clear-at-gc
 
-sgen-regular-tests-plain: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+sgen-regular-tests-ms: $(SGEN_REGULAR_TESTS) test-runner.exe
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc: $(SGEN_REGULAR_TESTS) test-runner.exe
        MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc-split: $(SGEN_REGULAR_TESTS) test-runner.exe
        MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-split: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
-sgen-regular-tests-ms-split-95: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
-sgen-regular-tests-plain-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+sgen-regular-tests-ms-conc-split-95: $(SGEN_REGULAR_TESTS) test-runner.exe
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="" MONO_GC_PARAMS="major=marksweep-conc,minor=split,alloc-ratio=95" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+sgen-regular-tests-ms-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 sgen-regular-tests-ms-conc-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
        MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
-sgen-regular-tests-ms-split-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
-       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
+sgen-regular-tests-ms-conc-split-clear-at-gc: $(SGEN_REGULAR_TESTS) test-runner.exe
+       MONO_ENV_OPTIONS="--gc=sgen" MONO_GC_DEBUG="clear-at-gc" MONO_GC_PARAMS="major=marksweep-conc,minor=split" $(RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name $@ --timeout 900 $(SGEN_REGULAR_TESTS)
 
 SGEN_TOGGLEREF_TESTS=  \
        sgen-toggleref.exe
diff --git a/mono/tests/TestingReferenceAssembly.cs b/mono/tests/TestingReferenceAssembly.cs
new file mode 100644 (file)
index 0000000..e68a2c8
--- /dev/null
@@ -0,0 +1,7 @@
+using System.Runtime.CompilerServices;
+
+[assembly: ReferenceAssemblyAttribute]
+
+public class X {
+       public int Y;
+}
diff --git a/mono/tests/TestingReferenceReferenceAssembly.cs b/mono/tests/TestingReferenceReferenceAssembly.cs
new file mode 100644 (file)
index 0000000..0acb6f1
--- /dev/null
@@ -0,0 +1,7 @@
+// An assembly that refereces the TestingReferenceAssembly
+
+class Z : X {
+       public Z () {
+               Y = 1;
+       }
+}
diff --git a/mono/tests/appdomain-threadpool-unload.cs b/mono/tests/appdomain-threadpool-unload.cs
new file mode 100644 (file)
index 0000000..d8a7049
--- /dev/null
@@ -0,0 +1,52 @@
+
+using System;
+using System.Linq;
+using System.Threading;
+
+class Driver
+{
+       class ThreadPoolLauncherObject
+       {
+               public volatile int i = 0;
+
+               public ThreadPoolLauncherObject ()
+               {
+                       ThreadPool.QueueUserWorkItem (_ => { for (int i = 0; i < 10 * 1000 * 1000; ++i); }, null);
+               }
+       }
+
+       public static void Main ()
+       {
+               int count = 0;
+               object o = new object ();
+
+               foreach (var i in
+                       Enumerable.Range (0, 100)
+                               .AsParallel ().WithDegreeOfParallelism (Environment.ProcessorCount)
+                               .Select (i => {
+                                       AppDomain ad;
+
+                                       ad = AppDomain.CreateDomain ("testdomain" + i);
+                                       ad.CreateInstance (typeof (ThreadPoolLauncherObject).Assembly.FullName, typeof (ThreadPoolLauncherObject).FullName);
+
+                                       Thread.Sleep (10);
+
+                                       AppDomain.Unload (ad);
+
+                                       return i;
+                               })
+                               .Select (i => {
+                                       lock (o) {
+                                               count += 1;
+
+                                               Console.Write (".");
+                                               if (count % 25 == 0)
+                                                       Console.WriteLine ();
+                                       }
+
+                                       return i;
+                               })
+               ) {
+               }
+       }
+}
diff --git a/mono/tests/bug-45841-fpstack-exceptions.il b/mono/tests/bug-45841-fpstack-exceptions.il
new file mode 100644 (file)
index 0000000..d657476
--- /dev/null
@@ -0,0 +1,165 @@
+
+// Metadata version: v4.0.30319
+.assembly extern mscorlib
+{
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
+  .ver 4:0:0:0
+}
+.assembly extern System.Data
+{
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
+  .ver 4:0:0:0
+}
+.assembly x
+{
+  .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) 
+  .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
+                                                                                                             63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 )       // ceptionThrows.
+  .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 02 00 00 00 00 00 ) 
+  .hash algorithm 0x00008004
+  .ver 0:0:0:0
+}
+.module x.exe
+// MVID: {0EDDDD7B-2C90-4D6D-9C28-383B7DA8A1EB}
+.imagebase 0x00400000
+.file alignment 0x00000200
+.stackreserve 0x00100000
+.subsystem 0x0003       // WINDOWS_CUI
+.corflags 0x00000001    //  ILONLY
+
+
+// =============== CLASS MEMBERS DECLARATION ===================
+
+.class public auto ansi beforefieldinit SqlSingleTest
+       extends [mscorlib]System.Object
+{
+  .method public hidebysig static int32 Main() cil managed
+  {
+    .entrypoint
+    // Code size       164 (0xa4)
+    .maxstack  2
+    .locals init (valuetype [System.Data]System.Data.SqlTypes.SqlDecimal V_0)
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+                         pop
+      IL_001c:  leave.s    IL_0021
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_001e:  pop
+      IL_001f:  leave.s    IL_0021
+
+    }  // end handler
+    IL_0021:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+                         pop
+      IL_002e:  leave.s    IL_0033
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_0030:  pop
+      IL_0031:  leave.s    IL_0033
+
+    }  // end handler
+    IL_0033:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+      IL_0044:  leave.s    IL_0049
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_0046:  pop
+      IL_0047:  leave.s    IL_0049
+
+    }  // end handler
+    IL_0049:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+               pop
+      IL_005a:  leave.s    IL_005f
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_005c:  pop
+      IL_005d:  leave.s    IL_005f
+
+    }  // end handler
+    IL_005f:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+               pop
+      IL_006c:  leave.s    IL_0071
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_006e:  pop
+      IL_006f:  leave.s    IL_0071
+
+    }  // end handler
+    IL_0071:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+               pop
+      IL_0082:  leave.s    IL_0087
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_0084:  pop
+      IL_0085:  leave.s    IL_0087
+
+    }  // end handler
+       IL_0087:        
+    ldloca.s   V_0
+    IL_0089:  ldc.r8     5
+    IL_0092:  call       instance void [System.Data]System.Data.SqlTypes.SqlDecimal::.ctor(float64)
+    IL_0097:  ldloca.s   V_0
+    IL_0099:  call       instance valuetype [mscorlib]System.Decimal [System.Data]System.Data.SqlTypes.SqlDecimal::get_Value()
+    call       float64 [mscorlib]System.Decimal::ToDouble([mscorlib]System.Decimal)
+       ldc.r8 5
+       ceq
+       ldc.i4 0
+       ceq
+    ret
+  } // end of method SqlSingleTest::Main
+
+  .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 SqlSingleTest::.ctor
+
+} // end of class SqlSingleTest
+
+
+// =============================================================
+
+// *********** DISASSEMBLY COMPLETE ***********************
index 83f3ff71c297047f73fa0fa50fc1ee9d8e9bced4..7d0c812357d15c0c999445db9baeca94b97cb31f 100644 (file)
@@ -1,6 +1,9 @@
 using System;
 using System.Reflection;
 
+// this for test_0_missing_attr_on_assembly
+[assembly: MissingAttribute]
+
 public sealed class MyAttribute : Attribute
 {
        public Type Type { get; set; }
@@ -45,6 +48,15 @@ public class Bar {}
 
 class Tests {
 
+       public static int test_0_missing_attr_on_assembly () {
+               try {
+                       Assembly.GetExecutingAssembly().GetCustomAttributes (false);
+                       return 1;
+               } catch (TypeLoadException exn) {
+                       return 0;
+               }
+       }
+
        [My3 (new object[] { DisappearingEnum.V0 })]
        public static int test_0_missing_enum_arg_alt3 () {
                try {
index 340b28f2678511b1bba7f8a9aadc9fac4502e3c5..499cf9e8d0075fb7e82282a5fd2fa29de18eb3d3 100644 (file)
@@ -38,6 +38,8 @@ public class main {
        for (int i = 0; i < st.FrameCount; ++i) {
            StackFrame sf = st.GetFrame (i);
            MethodBase m = sf.GetMethod ();
+               if (m == null)
+                       continue;
            Type t = m.DeclaringType;
            if (m.IsGenericMethod) {
                Type[] margs = m.GetGenericArguments ();
index 62529ecc557579f80dd442a8da3fcac7ca42ca1e..f65b779e2838eeb9176ce9847f90802e268cbdf1 100644 (file)
@@ -7229,3 +7229,193 @@ mono_test_marshal_fixed_array (FixedArrayStruct s)
 {
        return s.array [0] + s.array [1] + s.array [2];
 }
+
+const int NSTRINGS = 6;
+//test strings
+const char  *utf8Strings[] = {  
+                                "Managed",
+                                 "Sîne klâwen durh die wolken sint geslagen" ,
+                                 "काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम्",
+                                 "我能吞下玻璃而不伤身体",
+                                 "ღმერთსი შემვედრე,შემვედრე, ნუთუ კვლა დამხსნას შემვედრე,სოფლისა შემვედრე, შემვედრე,შემვედრე,შემვედრე,შრომასა, ცეცხლს, წყალსა და მიწასა, ჰაერთა თანა მრომასა; მომცნეს ფრთენი და აღვფრინდე, მივჰხვდე მას ჩემსა ნდომასა, დღისით და ღამით ვჰხედვიდე მზისა ელვათა კრთომაასაშემვედრე,შემვედრე,",
+                                 "Τη γλώσσα μου έδωσαν ελληνική",
+"\0"
+};
+
+LIBTEST_API char *
+build_return_string(const char* pReturn)
+{
+       char *ret = 0;
+       if (pReturn == 0 || *pReturn == 0)
+               return ret;
+
+       size_t strLength = strlen(pReturn);
+       ret = (char *)(malloc(sizeof(char)* (strLength + 1)));
+       memset(ret, '\0', strLength + 1);
+       strncpy(ret, pReturn, strLength);
+       return ret;
+}
+
+LIBTEST_API char *
+StringParameterInOut(/*[In,Out]*/ char *s, int index)
+{
+       // return a copy
+       return build_return_string(s);
+}
+
+LIBTEST_API void
+StringParameterRefOut(/*out*/ char **s, int index)
+{
+       char *pszTextutf8 = (char*)utf8Strings[index];
+       size_t strLength = strlen(pszTextutf8);
+       *s = (char *)(malloc(sizeof(char)* (strLength + 1)));
+       memcpy(*s, pszTextutf8, strLength);
+       (*s)[strLength] = '\0';
+}
+
+LIBTEST_API void
+StringParameterRef(/*ref*/ char **s, int index)
+{
+    char *pszTextutf8 = (char*)utf8Strings[index];
+    size_t strLength = strlen(pszTextutf8);
+    // do byte by byte validation of in string
+    size_t szLen = strlen(*s);
+    for (size_t i = 0; i < szLen; i++)
+    {
+        if ((*s)[i] != pszTextutf8[i])
+        {
+            printf("[in] managed string do not match native string\n");
+           abort ();
+        }
+    }
+
+    if (*s)
+    {
+       free(*s);
+    }
+    // overwrite the orginal 
+    *s = (char *)(malloc(sizeof(char)* (strLength + 1)));
+    memcpy(*s, pszTextutf8, strLength);
+    (*s)[strLength] = '\0';
+}
+
+LIBTEST_API void
+StringBuilderParameterInOut(/*[In,Out] StringBuilder*/ char *s, int index)
+{
+    // if string.empty 
+    if (s == 0 || *s == 0)
+        return;
+
+    char *pszTextutf8 = (char*)utf8Strings[index];
+
+    // do byte by byte validation of in string
+    size_t szLen = strlen(s);
+    for (size_t i = 0; i < szLen; i++) 
+    {
+        if (s[i] != pszTextutf8[i])
+        {
+            printf("[in] managed string do not match native string\n");
+           abort ();
+        }
+    }  
+
+    // modify the string inplace 
+    size_t outLen = strlen(pszTextutf8);
+    for (size_t i = 0; i < outLen; i++) {
+        s[i] = pszTextutf8[i];
+    }
+    s[outLen] = '\0';
+}
+
+//out string builder
+LIBTEST_API void
+StringBuilderParameterOut(/*[Out] StringBuilder*/ char *s, int index)
+{
+    char *pszTextutf8 = (char*)utf8Strings[index];
+
+    printf ("SBPO: Receiving %s\n", s);
+    // modify the string inplace 
+    size_t outLen = strlen(pszTextutf8);
+    for (size_t i = 0; i < outLen; i++) {
+        s[i] = pszTextutf8[i];
+    }
+    s[outLen] = '\0';
+}
+
+LIBTEST_API char *
+StringParameterOut(/*[Out]*/ char *s, int index)
+{
+    // return a copy
+    return build_return_string(s);
+}
+
+// Utf8 field
+typedef struct FieldWithUtf8
+{
+    char *pFirst;
+    int index;
+}FieldWithUtf8;
+
+//utf8 struct field
+LIBTEST_API void
+TestStructWithUtf8Field(struct FieldWithUtf8 fieldStruct)
+{
+    char *pszManagedutf8 = fieldStruct.pFirst;
+    int stringIndex = fieldStruct.index;
+    char *pszNative = 0;
+    size_t outLen = 0;
+
+    if (pszManagedutf8 == 0 || *pszManagedutf8 == 0)
+        return;
+
+    pszNative = (char*)utf8Strings[stringIndex];
+
+    outLen = strlen(pszNative);
+    // do byte by byte comparision
+    for (size_t i = 0; i < outLen; i++) 
+    {
+        if (pszNative[i] != pszManagedutf8[i]) 
+        {
+            printf("Native and managed string do not match.\n");
+           abort ();
+        }
+    }
+}
+
+typedef void (* Callback2)(char *text, int index);
+
+LIBTEST_API void
+Utf8DelegateAsParameter(Callback2 managedCallback)
+{
+    for (int i = 0; i < NSTRINGS; ++i) 
+    {
+        char *pszNative = 0;
+        pszNative = (char*)utf8Strings[i];
+        managedCallback(pszNative, i);
+    }
+}
+
+
+LIBTEST_API char*
+StringBuilderParameterReturn(int index)
+{
+    char *pszTextutf8 = (char*)utf8Strings[index];
+    size_t strLength = strlen(pszTextutf8);
+    char * ret = (char *)(malloc(sizeof(char)* (strLength + 1)));
+    memcpy(ret, pszTextutf8, strLength);
+    ret[strLength] = '\0';
+
+    return  ret;
+}
+
+LIBTEST_API int STDCALL
+mono_test_marshal_pointer_array (int *arr[])
+{
+       int i;
+
+       for (i = 0; i < 10; ++i) {
+               if (*arr [i] != -1)
+                       return 1;
+       }
+       return 0;
+}
diff --git a/mono/tests/pinvoke-utf8.cs b/mono/tests/pinvoke-utf8.cs
new file mode 100644 (file)
index 0000000..fd58ad4
--- /dev/null
@@ -0,0 +1,263 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Collections.Generic;
+
+
+// UTF8 
+class UTF8StringTests
+{
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       [return: MarshalAs(UnmanagedType.LPUTF8Str)]
+       public static extern string StringParameterInOut([In, Out][MarshalAs(UnmanagedType.LPUTF8Str)]string s, int index);
+       public static bool TestInOutStringParameter(string orgString, int index)
+       {
+               string passedString = orgString;
+               string expectedNativeString = passedString;
+               
+               string nativeString = StringParameterInOut(passedString, index);
+               if (!(nativeString == expectedNativeString))
+               {
+                       Console.WriteLine("StringParameterInOut: nativeString != expecedNativeString ");
+                       return false;
+               }
+               return true;
+       }
+
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       [return: MarshalAs(UnmanagedType.LPUTF8Str)]
+       public static extern string StringParameterOut([Out][MarshalAs(UnmanagedType.LPUTF8Str)]string s, int index);
+       public static bool TestOutStringParameter(string orgString, int index)
+       {
+               string passedString = orgString;
+               string expecedNativeString = passedString;
+               string nativeString = StringParameterInOut(passedString, index);
+               if (!(nativeString == expecedNativeString))
+               {
+                       Console.WriteLine("StringParameterInOut: nativeString != expecedNativeString ");
+                       return false;
+               }
+               return true;
+       }
+
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       public static extern void StringParameterRefOut([MarshalAs(UnmanagedType.LPUTF8Str)]out string s, int index);
+       public static bool TestStringPassByOut(string orgString, int index)
+       {
+               // out string 
+               string expectedNative = string.Empty;
+               StringParameterRefOut(out expectedNative, index);
+               if (orgString != expectedNative)
+               {
+                       Console.WriteLine ("TestStringPassByOut : expectedNative != outString");
+                       return false;
+               }
+               return true;
+       }
+
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       public static extern void StringParameterRef([MarshalAs(UnmanagedType.LPUTF8Str)]ref string s, int index);
+       public static bool TestStringPassByRef(string orgString, int index)
+       {
+               string orgCopy = new string(orgString.ToCharArray());
+               StringParameterRef(ref orgString, index);
+               if (orgString != orgCopy)
+               {
+                       Console.WriteLine("TestStringPassByOut : string mismatch");
+                       return false;
+               }
+               return true;
+       }
+
+       public static bool EmptyStringTest()
+       {
+               StringParameterInOut(string.Empty, 0);
+               StringParameterOut(string.Empty, 0);
+               return true;
+       }
+}
+
+// UTF8 stringbuilder
+class UTF8StringBuilderTests
+{
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       public static extern void StringBuilderParameterInOut([In,Out][MarshalAs(UnmanagedType.LPUTF8Str)]StringBuilder s, int index);
+       public static bool TestInOutStringBuilderParameter(string expectedString, int index)
+       {
+               StringBuilder nativeStrBuilder = new StringBuilder(expectedString);
+               
+               StringBuilderParameterInOut(nativeStrBuilder, index);
+               
+               if (!nativeStrBuilder.ToString().Equals(expectedString))
+               {
+                       Console.WriteLine($"TestInOutStringBuilderParameter: nativeString != expecedNativeString index={index} got={nativeStrBuilder} and expected={expectedString} ");
+                       return false;
+               }
+               return true;
+       }
+       
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       public static extern void StringBuilderParameterOut([Out][MarshalAs(UnmanagedType.LPUTF8Str)]StringBuilder s, int index);
+       public static bool TestOutStringBuilderParameter(string expectedString, int index)
+       {
+               // string builder capacity
+               StringBuilder nativeStringBuilder = new StringBuilder(expectedString.Length);
+               
+               StringBuilderParameterOut(nativeStringBuilder, index);
+               
+               if (!nativeStringBuilder.ToString().Equals(expectedString))
+               {
+                       Console.WriteLine("TestOutStringBuilderParameter: string != expecedString ");
+                       return false;
+               }
+               return true;
+       }
+       
+
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       [return: MarshalAs(UnmanagedType.LPUTF8Str,SizeConst = 512)]
+       public static extern StringBuilder StringBuilderParameterReturn(int index);
+       public static bool TestReturnStringBuilder(string expectedReturn, int index)
+       {
+               StringBuilder nativeString = StringBuilderParameterReturn(index);
+               if (!expectedReturn.Equals(nativeString.ToString()))
+               {
+                       Console.WriteLine(string.Format( "TestReturnStringBuilder: nativeString {0} != expecedNativeString {1}",nativeString.ToString(),expectedReturn) );
+                       return false;
+               }
+               return true;
+       }
+}
+
+// UTF8 string as struct field
+class UTF8StructMarshalling
+{
+       public struct Utf8Struct
+       {
+               [MarshalAs(UnmanagedType.LPUTF8Str)]
+               public string FirstName;
+               public int index;
+       }
+
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       public static extern void TestStructWithUtf8Field(Utf8Struct utfStruct);
+       public static bool  TestUTF8StructMarshalling(string[] utf8Strings)
+       {
+               Utf8Struct utf8Struct = new Utf8Struct();
+               for (int i = 0; i < utf8Strings.Length; i++)
+               {
+                       utf8Struct.FirstName = utf8Strings[i];
+                       utf8Struct.index = i;
+                       TestStructWithUtf8Field(utf8Struct);
+               }
+               return true;
+       }
+}
+
+// UTF8 string as delegate parameter
+class UTF8DelegateMarshalling
+{
+       [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+       public delegate void DelegateUTF8Parameter([MarshalAs(UnmanagedType.LPUTF8Str)]string utf8String, int index);
+
+       [DllImport("libtest", CallingConvention = CallingConvention.Cdecl)]
+       public static extern void Utf8DelegateAsParameter(DelegateUTF8Parameter param);
+       
+       static bool failed;
+       public static bool TestUTF8DelegateMarshalling()
+       {
+               failed = false;
+               Utf8DelegateAsParameter(new DelegateUTF8Parameter(Utf8StringCallback));
+               
+               return !failed;
+       }
+       
+       public static void Utf8StringCallback(string nativeString, int index)
+       {
+               if (string.CompareOrdinal(nativeString, Test.utf8Strings[index]) != 0)
+               {
+                       Console.WriteLine("Utf8StringCallback string do not match");
+                       failed = true;
+               }
+       }
+}
+
+class Test
+{
+       //test strings
+       public static string[] utf8Strings = {
+               "Managed",
+               "Sîne klâwen durh die wolken sint geslagen" ,
+               "काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम्",
+               "我能吞下玻璃而不伤身体",
+               "ღმერთსი შემვედრე,შემვედრე, ნუთუ კვლა დამხსნას შემვედრე,სოფლისა შემვედრე, შემვედრე,შემვედრე,შემვედრე,შრომასა, ცეცხლს, წყალსა და მიწასა, ჰაერთა თანა მრომასა; მომცნეს ფრთენი და აღვფრინდე, მივჰხვდე მას ჩემსა ნდომასა, დღისით და ღამით ვჰხედვიდე მზისა ელვათა კრთომაასაშემვედრე,შემვედრე,",
+               "Τη γλώσσα μου έδωσαν ελληνική",
+               null,
+       };
+       
+       public static int Main(string[] args)
+       {
+               // Test string as [In,Out] parameter
+               for (int i = 0; i < utf8Strings.Length; i++)
+                       if (!UTF8StringTests.TestInOutStringParameter(utf8Strings[i], i))
+                               return i+1;
+               
+               // Test string as [Out] parameter
+               for (int i = 0; i < utf8Strings.Length; i++)
+                       if (!UTF8StringTests.TestOutStringParameter(utf8Strings[i], i))
+                               return i+100;
+               
+               for (int i = 0; i < utf8Strings.Length - 1; i++)
+                       if (!UTF8StringTests.TestStringPassByOut(utf8Strings[i], i))
+                               return i+200;
+               
+               for (int i = 0; i < utf8Strings.Length - 1; i++)
+                       if (!UTF8StringTests.TestStringPassByRef(utf8Strings[i], i))
+                               return i+300;
+               
+               
+               // Test StringBuilder as [In,Out] parameter
+               for (int i = 0; i < utf8Strings.Length - 1; i++)
+                       if (!UTF8StringBuilderTests.TestInOutStringBuilderParameter(utf8Strings[i], i))
+                               return i+400;
+               
+#if NOT_YET
+               // This requires support for [Out] in StringBuilder
+               
+               // Test StringBuilder as [Out] parameter
+               for (int i = 0; i < utf8Strings.Length - 1; i++){
+                       if (!UTF8StringBuilderTests.TestOutStringBuilderParameter(utf8Strings[i], i))
+                               return i+500;
+               }
+
+#endif
+       
+               // utf8 string as struct fields
+               if (!UTF8StructMarshalling.TestUTF8StructMarshalling(utf8Strings))
+                       return 600;
+
+               // delegate
+               try {
+                       UTF8DelegateMarshalling.TestUTF8DelegateMarshalling();
+               } catch (ExecutionEngineException){
+                       // Known issue on AOT - we do not AOT this yet.
+               }
+
+#if NOT_YET
+               // This requires special support for StringBuilder return values
+               // Test StringBuilder as return value
+               for (int i = 0; i < utf8Strings.Length - 1; i++)
+                       if (!UTF8StringBuilderTests.TestReturnStringBuilder(utf8Strings[i], i))
+                               return 700+i;
+#endif
+               // String.Empty tests
+               if (!UTF8StringTests.EmptyStringTest())
+                       return 800;
+
+               return 0;
+       }
+}
index e170ba441ab44b5f9b32da5c914faac2a80d437d..f9ecf68a4027a95b9da5b0681024afd47b435f97 100644 (file)
@@ -1922,5 +1922,22 @@ public unsafe class Tests {
 
                return mono_test_marshal_fixed_array (s);
        }
+
+       [DllImport ("libtest", EntryPoint="mono_test_marshal_pointer_array")]
+       public static extern int mono_test_marshal_pointer_array (int*[] arr);
+
+       public static unsafe int test_0_pointer_array () {
+               var arr = new int [10];
+               for (int i = 0; i < arr.Length; i++)
+                       arr [i] = -1;
+               var arr2 = new int*[10];
+               for (int i = 0; i < arr2.Length; i++) {
+                       GCHandle handle = GCHandle.Alloc(arr[i], GCHandleType.Pinned);
+                       fixed (int *ptr = &arr[i]) {
+                               arr2[i] = ptr;
+                       }
+               }
+               return mono_test_marshal_pointer_array (arr2);
+       }
 }
 
index 8d5cfb619f0657d5ab751afc0f509ba163b296f9..075ef08bc48c809174db8e1e6d87f594713fa550 100644 (file)
@@ -746,6 +746,21 @@ public class Tests {
                return mono_test_marshal_array_delegate1 (null, 0, new ArrayDelegate1 (array_delegate2));
        }
 
+       public delegate int ArrayDelegateBlittable (int i, string j,
+                                                                               [In, MarshalAs(UnmanagedType.LPArray,
+                                                                                                          ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] int[] arr);
+
+       [DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
+       public static extern int mono_test_marshal_array_delegate1 (string[] arr, int len, ArrayDelegateBlittable d);
+
+       public static int array_delegate_null_blittable (int i, string j, int[] arr) {
+               return (arr == null) ? 0 : 1;
+       }
+
+       public static int test_0_marshal_array_delegate_null_blittable () {
+               return mono_test_marshal_array_delegate1 (null, 0, new ArrayDelegateBlittable (array_delegate_null_blittable));
+       }
+
        public delegate int ArrayDelegate3 (int i, 
                                                                                string j, 
                                                                                [In, MarshalAs(UnmanagedType.LPArray, 
diff --git a/mono/tests/reference-loader.cs b/mono/tests/reference-loader.cs
new file mode 100644 (file)
index 0000000..a66d3c5
--- /dev/null
@@ -0,0 +1,110 @@
+//
+// reference-loader.cs:
+//
+//  Test for reference assembly loading
+
+using System;
+using System.IO;
+using System.Reflection;
+
+public class Tests {
+       public static int Main (string[] args)
+       {
+               return TestDriver.RunTests (typeof (Tests), args);
+       }
+
+       public static int test_0_loadFrom_reference ()
+       {
+               // Check that loading a reference assembly by filename for execution is an error
+               try {
+                       var a = Assembly.LoadFrom ("./TestingReferenceAssembly.dll");
+               } catch (BadImageFormatException exn) {
+                       // .NET Framework 4.6.2 throws BIFE here.
+                       return 0;
+               }
+               return 1;
+       }
+
+       public static int test_0_load_reference ()
+       {
+               // Check that loading a reference assembly for execution is an error
+               try {
+                       var an = new AssemblyName ("TestingReferenceAssembly");
+                       var a = Assembly.Load (an);
+               } catch (FileNotFoundException exn) {
+                       return 0;
+               } catch (BadImageFormatException exn) {
+                       // .NET Framework 4.6.2 throws BIFE here.
+                       return 0;
+               }
+               return 1;
+       }
+
+       public static int test_0_reflection_load_reference ()
+       {
+               // Check that reflection-only loading a reference assembly is okay
+               var an = new AssemblyName ("TestingReferenceAssembly");
+               var a = Assembly.ReflectionOnlyLoad (an.FullName);
+               var t = a.GetType ("X");
+               var f = t.GetField ("Y");
+               if (f.FieldType.Equals (typeof (Int32)))
+                       return 0;
+               return 1;
+       }
+
+       public static int test_0_load_reference_asm_via_reference ()
+       {
+               // Check that loading an assembly that references a reference assembly doesn't succeed.
+               var an = new AssemblyName ("TestingReferenceReferenceAssembly");
+               try {
+                       var a = Assembly.Load (an);
+                       var t = a.GetType ("Z");
+               } catch (FileNotFoundException){
+                       return 0;
+               }
+               return 1;
+       }
+
+       public static int test_0_reflection_load_reference_asm_via_reference ()
+       {
+               // Check that reflection-only loading an assembly that
+               // references a reference assembly is okay.
+               var an = new AssemblyName ("TestingReferenceReferenceAssembly");
+               var a = Assembly.ReflectionOnlyLoad (an.FullName);
+               var t = a.GetType ("Z");
+               var f = t.GetField ("Y");
+               if (f.FieldType.Equals (typeof (Int32)))
+                       return 0;
+               return 1;
+       }
+
+
+       public static int test_0_load_reference_bytes ()
+       {
+               // Check that loading a reference assembly from a byte array for execution is an error
+               byte[] bs = File.ReadAllBytes ("./TestingReferenceAssembly.dll");
+               try {
+                       var a = Assembly.Load (bs);
+               } catch (BadImageFormatException) {
+                       return 0;
+               } catch (FileNotFoundException exn) {
+                       Console.Error.WriteLine ("incorrect exn was {0}", exn);
+                       return 2;
+               }
+               return 1;
+       }
+
+       public static int test_0_reflection_load_reference_bytes ()
+       {
+               // Check that loading a reference assembly from a byte
+               // array for reflection only is okay.
+               byte[] bs = File.ReadAllBytes ("./TestingReferenceAssembly.dll");
+               var a = Assembly.ReflectionOnlyLoad (bs);
+               var t = a.GetType ("X");
+               var f = t.GetField ("Y");
+               if (f.FieldType.Equals (typeof (Int32)))
+                       return 0;
+               return 1;
+       }
+
+}
diff --git a/mono/tests/sgen-new-threads-collect.cs b/mono/tests/sgen-new-threads-collect.cs
new file mode 100644 (file)
index 0000000..5deee6b
--- /dev/null
@@ -0,0 +1,51 @@
+
+using System;
+using System.Collections.Concurrent;
+using System.Threading;
+
+class Driver
+{
+       public static void Main ()
+       {
+               BlockingCollection<Thread> threads = new BlockingCollection<Thread> (new ConcurrentQueue<Thread> (), 128);
+
+               bool finished = false;
+
+               Thread gcThread = new Thread (() => {
+                       while (!finished) {
+                               GC.Collect ();
+                               Thread.Yield ();
+                       }
+               });
+
+               Thread joinThread = new Thread (() => {
+                       for (int i = 0; ; ++i) {
+                               Thread t = threads.Take ();
+                               if (t == null)
+                                       break;
+                               t.Join ();
+                               if ((i + 1) % (50) == 0)
+                                       Console.Write (".");
+                               if ((i + 1) % (50 * 50) == 0)
+                                       Console.WriteLine ();
+                       }
+               });
+
+               gcThread.Start ();
+               joinThread.Start ();
+
+               for (int i = 0; i < 10 * 1000; ++i) {
+                       Thread t = new Thread (() => { Thread.Yield (); });
+                       t.Start ();
+
+                       threads.Add (t);
+               }
+
+               threads.Add (null);
+
+               joinThread.Join ();
+
+               finished = true;
+               gcThread.Join ();
+       }
+}
\ No newline at end of file
index 16af9f66a7a56143f92ae0e5edaef17a50b4a803..e112be0fa16e46960bfafae3f5572c7bbd08bfb0 100644 (file)
@@ -15,15 +15,10 @@ class Driver
        {
                return new Thread (() => {
                        /* Exit bypassing completely the runtime */
-                       try {
-                               pthread_exit (IntPtr.Zero);
-                       } catch (EntryPointNotFoundException) {
-                       }
-
-                       try {
-                               ExitThread (IntPtr.Zero);
-                       } catch (EntryPointNotFoundException) {
-                       }
+                       if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
+                           pthread_exit (IntPtr.Zero);
+                       else
+                           ExitThread (IntPtr.Zero);
                });
        }
 
diff --git a/mono/tests/thread-suspend-selfsuspended.cs b/mono/tests/thread-suspend-selfsuspended.cs
new file mode 100644 (file)
index 0000000..c9681df
--- /dev/null
@@ -0,0 +1,42 @@
+
+using System;
+using System.Threading;
+
+class Driver
+{
+       public static void Main ()
+       {
+               bool finished = false;
+
+               Thread t1 = Thread.CurrentThread;
+
+               Thread t2 = new Thread (() => {
+                       while (!finished) {
+                               GC.Collect ();
+
+                               try {
+                                       t1.Resume ();
+                               } catch (ThreadStateException) {
+                               }
+
+                               Thread.Yield ();
+                       }
+               });
+
+               t2.Start ();
+
+               Thread.Sleep (10);
+
+               for (int i = 0; i < 50 * 40 * 20; ++i) {
+                       Thread.CurrentThread.Suspend ();
+                       if ((i + 1) % (50) == 0)
+                               Console.Write (".");
+                       if ((i + 1) % (50 * 40) == 0)
+                               Console.WriteLine ();
+               }
+
+               finished = true;
+
+               t2.Join ();
+       }
+}
diff --git a/mono/tests/thread-suspend-suspended.cs b/mono/tests/thread-suspend-suspended.cs
new file mode 100644 (file)
index 0000000..994042b
--- /dev/null
@@ -0,0 +1,43 @@
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Threading;
+
+class Driver
+{
+       public static void Main ()
+       {
+               bool finished = false;
+
+               Thread t1 = new Thread (() => {
+                       while (!finished) {}
+               });
+
+               Thread t2 = new Thread (() => {
+                       while (!finished) {
+                               GC.Collect ();
+                               Thread.Yield ();
+                       }
+               });
+
+               t1.Start ();
+               t2.Start ();
+
+               Thread.Sleep (10);
+
+               for (int i = 0; i < 50 * 40 * 20; ++i) {
+                       t1.Suspend ();
+                       Thread.Yield ();
+                       t1.Resume ();
+                       if ((i + 1) % (50) == 0)
+                               Console.Write (".");
+                       if ((i + 1) % (50 * 40) == 0)
+                               Console.WriteLine ();
+               }
+
+               finished = true;
+
+               t1.Join ();
+               t2.Join ();
+       }
+}
index abb24d9825f3ff143e20fa0cf73009455c72f1d8..712e2efa3816674170acfe4a2ca771dcb33d502e 100644 (file)
@@ -11,7 +11,7 @@
 #include "utils/mono-threads.h"
 #include "utils/mono-conc-hashtable.h"
 #include "utils/checked-build.h"
-#include "utils/w32handle.h"
+#include "metadata/w32handle.h"
 
 #include <stdlib.h>
 #include <string.h>
index 3e29ab15df46efe42c1bb846bc2a57b0ef1345f8..35f218a8d0ac5cd4d0bd0ff650f69d1468ee6f14 100644 (file)
@@ -11,7 +11,20 @@ mono-dtrace.h: $(top_srcdir)/data/mono.d
 
 endif
 
+if HOST_WIN32
+win32_sources = \
+       os-event-win32.c
+
+platform_sources = $(win32_sources)
+else
+unix_sources = \
+       os-event-unix.c
+
+platform_sources = $(unix_sources)
+endif
+
 monoutils_sources = \
+       $(platform_sources)     \
        mono-md5.c              \
        mono-sha1.c             \
        mono-logger.c           \
@@ -27,6 +40,7 @@ monoutils_sources = \
        mono-dl-darwin.c        \
        mono-dl-posix.c         \
        mono-dl.h               \
+       mono-dl-windows-internals.h     \
        mono-log-windows.c      \
        mono-log-common.c       \
        mono-log-posix.c        \
@@ -40,8 +54,10 @@ monoutils_sources = \
        mono-filemap.c          \
        mono-math.c             \
        mono-mmap.c             \
+       mono-mmap-windows.c             \
        mono-mmap.h             \
        mono-mmap-internals.h   \
+       mono-mmap-windows-internals.h   \
        mono-os-mutex.h         \
        mono-coop-mutex.h               \
        mono-once.h             \
@@ -49,7 +65,9 @@ monoutils_sources = \
        mono-networkinterfaces.c                \
        mono-networkinterfaces.h                \
        mono-proclib.c          \
+       mono-proclib-windows.c          \
        mono-proclib.h          \
+       mono-proclib-windows-internals.h                \
        mono-publib.c           \
        mono-string.h           \
        mono-time.c             \
@@ -108,7 +126,6 @@ monoutils_sources = \
        mono-threads-state-machine.c    \
        mono-threads-posix.c    \
        mono-threads-posix-signals.c    \
-       mono-threads-posix-signals.h    \
        mono-threads-mach.c     \
        mono-threads-mach-helper.c      \
        mono-threads-windows.c  \
@@ -118,12 +135,10 @@ monoutils_sources = \
        mono-threads-openbsd.c  \
        mono-threads-android.c  \
        mono-threads.h  \
+       mono-threads-debug.h    \
        mono-threads-api.h      \
        mono-threads-coop.c     \
        mono-threads-coop.h     \
-       mono-threads-mach-abort-syscall.c       \
-       mono-threads-posix-abort-syscall.c      \
-       mono-threads-windows-abort-syscall.c    \
        mono-tls.h      \
        mono-tls.c      \
        linux_magic.h   \
@@ -149,15 +164,16 @@ monoutils_sources = \
        networking-windows.c    \
        networking.h    \
        mono-rand.c     \
+       mono-rand-windows.c     \
        mono-rand.h \
+       mono-rand-windows-internals.h \
        memfuncs.c \
        memfuncs.h \
        parse.c \
        parse.h \
        checked-build.c \
        checked-build.h \
-       w32handle.c \
-       w32handle.h
+       os-event.h
 
 arch_sources = 
 
index 86afad502ffe27947c4bf7718bc49abbd4ded33c..543e8ce9b0cb2c7171035f965964887b9835bd42 100644 (file)
@@ -12,6 +12,7 @@
 #include <glib.h>
 
 #include <mono/utils/atomic.h>
+#include <mono/utils/mono-compiler.h>
 
 #if defined (WAPI_NO_ATOMIC_ASM) || defined (BROKEN_64BIT_ATOMICS_INTRINSIC)
 
@@ -581,6 +582,9 @@ InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)
        return(old);
 }
 
+#endif
 #endif
 
+#if !defined (WAPI_NO_ATOMIC_ASM) && !defined (BROKEN_64BIT_ATOMICS_INTRINSIC) && !defined (NEED_64BIT_CMPXCHG_FALLBACK)
+MONO_EMPTY_SOURCE_FILE (atomic);
 #endif
index 869d55c69e2d05640a5fd2b23be2fc3fc374ee7b..3dcbe286cca7ee4da0924ddf14f8e010e40607b7 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <config.h>
 #include <mono/utils/atomic.h>
+#include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-publib.h>
 
 typedef enum {
@@ -207,7 +208,7 @@ void check_metadata_store_local(void *from, void *to);
 
 void checked_build_thread_transition(const char *transition, void *info, int from_state, int suspend_count, int next_state, int suspend_count_delta);
 
-G_GNUC_NORETURN void mono_fatal_with_history(const char *msg, ...);
+G_GNUC_NORETURN MONO_ATTR_FORMAT_PRINTF(1,2) void mono_fatal_with_history(const char *msg, ...);
 
 #else
 
index 70d550d95c239b6b6d5ce5d868f31633a590c7d1..9501307fc1dd29f5c8c3c26baa9073c3b5856bf5 100644 (file)
@@ -27,8 +27,8 @@
 #define __MONO_LOCKFREEALLOC_H__
 
 #include <glib.h>
-
-#include "lock-free-queue.h"
+#include <mono/utils/lock-free-queue.h>
+#include <mono/utils/mono-mmap.h>
 
 typedef struct {
        MonoLockFreeQueue partial;
index 1802ff79f5364d8301566717bc2da54b5bcad12d..179a4f7ed748199ed0f6ccc018a63957e7fde44a 100644 (file)
@@ -59,27 +59,30 @@ mono_mach_arch_get_mcontext_size ()
 }
 
 void
-mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context)
+mono_mach_arch_thread_states_to_mcontext (thread_state_t state, thread_state_t fpstate, void *context)
 {
        x86_thread_state64_t *arch_state = (x86_thread_state64_t *) state;
+       x86_float_state64_t *arch_fpstate = (x86_float_state64_t *) fpstate;
        struct __darwin_mcontext64 *ctx = (struct __darwin_mcontext64 *) context;
-
        ctx->__ss = *arch_state;
+       ctx->__fs = *arch_fpstate;
 }
 
 void
-mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state)
+mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate)
 {
        x86_thread_state64_t *arch_state = (x86_thread_state64_t *) state;
+       x86_float_state64_t *arch_fpstate = (x86_float_state64_t *) fpstate;
        struct __darwin_mcontext64 *ctx = (struct __darwin_mcontext64 *) context;
-
        *arch_state = ctx->__ss;
+       *arch_fpstate = ctx->__fs;
 }
 
 void
-mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context)
+mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context)
 {
        x86_thread_state64_t *arch_state = (x86_thread_state64_t *) state;
+       x86_float_state64_t *arch_fpstate = (x86_float_state64_t *) fpstate;
        context->gregs [AMD64_RAX] = arch_state->__rax;
        context->gregs [AMD64_RBX] = arch_state->__rbx;
        context->gregs [AMD64_RCX] = arch_state->__rcx;
@@ -96,6 +99,22 @@ mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *
        context->gregs [AMD64_R14] = arch_state->__r14;
        context->gregs [AMD64_R15] = arch_state->__r15;
        context->gregs [AMD64_RIP] = arch_state->__rip;
+       context->fregs [AMD64_XMM0] = arch_fpstate->__fpu_xmm0;
+       context->fregs [AMD64_XMM1] = arch_fpstate->__fpu_xmm1;
+       context->fregs [AMD64_XMM2] = arch_fpstate->__fpu_xmm2;
+       context->fregs [AMD64_XMM3] = arch_fpstate->__fpu_xmm3;
+       context->fregs [AMD64_XMM4] = arch_fpstate->__fpu_xmm4;
+       context->fregs [AMD64_XMM5] = arch_fpstate->__fpu_xmm5;
+       context->fregs [AMD64_XMM6] = arch_fpstate->__fpu_xmm6;
+       context->fregs [AMD64_XMM7] = arch_fpstate->__fpu_xmm7;
+       context->fregs [AMD64_XMM8] = arch_fpstate->__fpu_xmm8;
+       context->fregs [AMD64_XMM9] = arch_fpstate->__fpu_xmm9;
+       context->fregs [AMD64_XMM10] = arch_fpstate->__fpu_xmm10;
+       context->fregs [AMD64_XMM11] = arch_fpstate->__fpu_xmm11;
+       context->fregs [AMD64_XMM12] = arch_fpstate->__fpu_xmm12;
+       context->fregs [AMD64_XMM13] = arch_fpstate->__fpu_xmm13;
+       context->fregs [AMD64_XMM14] = arch_fpstate->__fpu_xmm14;
+       context->fregs [AMD64_XMM15] = arch_fpstate->__fpu_xmm15;
 }
 
 int
@@ -104,23 +123,39 @@ mono_mach_arch_get_thread_state_size ()
        return sizeof (x86_thread_state64_t);
 }
 
+int
+mono_mach_arch_get_thread_fpstate_size ()
+{
+       return sizeof (x86_float_state64_t);
+}
+
 kern_return_t
-mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count)
+mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count, thread_state_t fpstate, mach_msg_type_number_t *fpcount)
 {
-       x86_thread_state64_t *arch_state = (x86_thread_state64_t *) state;
+       x86_thread_state64_t *arch_state = (x86_thread_state64_t *)state;
+       x86_float_state64_t *arch_fpstate = (x86_float_state64_t *)fpstate;
        kern_return_t ret;
 
        *count = x86_THREAD_STATE64_COUNT;
+       *fpcount = x86_FLOAT_STATE64_COUNT;
 
-       ret = thread_get_state (thread, x86_THREAD_STATE64, (thread_state_t) arch_state, count);
+       ret = thread_get_state (thread, x86_THREAD_STATE64, (thread_state_t)arch_state, count);
+       if (ret != KERN_SUCCESS)
+               return ret;
 
+       ret = thread_get_state (thread, x86_FLOAT_STATE64, (thread_state_t)arch_fpstate, fpcount);
        return ret;
 }
 
 kern_return_t
-mono_mach_arch_set_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count)
+mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count, thread_state_t fpstate, mach_msg_type_number_t fpcount)
 {
-       return thread_set_state (thread, x86_THREAD_STATE64, state, count);
+       kern_return_t ret;
+       ret = thread_set_state (thread, x86_THREAD_STATE64, state, count);
+       if (ret != KERN_SUCCESS)
+               return ret;
+       ret = thread_set_state (thread, x86_FLOAT_STATE64, fpstate, fpcount);
+       return ret;
 }
 
 void *
index d535fbc18ddce3689a7701acc1da0cd4eeca0492..a7fd9836d18326238294ffc4c48f2a4a3cf96032 100644 (file)
@@ -66,7 +66,7 @@ mono_mach_arch_get_mcontext_size ()
 }
 
 void
-mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context)
+mono_mach_arch_thread_states_to_mcontext (thread_state_t state, thread_state_t fpstate, void *context)
 {
        arm_thread_state_t *arch_state = (arm_thread_state_t *) state;
        struct __darwin_mcontext *ctx = (struct __darwin_mcontext *) context;
@@ -75,7 +75,7 @@ mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context)
 }
 
 void
-mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state)
+mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate)
 {
        arm_thread_state_t *arch_state = (arm_thread_state_t *) state;
        struct __darwin_mcontext *ctx = (struct __darwin_mcontext *) context;
@@ -84,7 +84,7 @@ mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state)
 }
 
 void
-mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context)
+mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context)
 {
        int i;
        arm_thread_state_t *arch_state = (arm_thread_state_t *) state;
@@ -103,8 +103,14 @@ mono_mach_arch_get_thread_state_size ()
        return sizeof (arm_thread_state_t);
 }
 
+int
+mono_mach_arch_get_thread_fpstate_size ()
+{
+       g_assert_not_reached ();
+}
+
 kern_return_t
-mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count)
+mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count, thread_state_t fpstate, mach_msg_type_number_t *fpcount)
 {
 #if defined(HOST_WATCHOS)
        g_error ("thread_get_state() is not supported by this platform");
@@ -120,7 +126,7 @@ mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mac
 }
 
 kern_return_t
-mono_mach_arch_set_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count)
+mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count, thread_state_t fpstate, mach_msg_type_number_t fpcount)
 {
 #if defined(HOST_WATCHOS)
        g_error ("thread_set_state() is not supported by this platform");
index 6483238d4565568b2695e254d7428c2c1426a70f..2035f485b14c22281602214440bc47fbaa8a30f6 100644 (file)
@@ -66,7 +66,7 @@ mono_mach_arch_get_mcontext_size ()
 }
 
 void
-mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context)
+mono_mach_arch_thread_states_to_mcontext (thread_state_t state, thread_state_t fpstate, void *context)
 {
        arm_unified_thread_state_t *arch_state = (arm_unified_thread_state_t *) state;
        struct __darwin_mcontext64 *ctx = (struct __darwin_mcontext64 *) context;
@@ -75,7 +75,7 @@ mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context)
 }
 
 void
-mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state)
+mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate)
 {
        arm_unified_thread_state_t *arch_state = (arm_unified_thread_state_t *) state;
        struct __darwin_mcontext64 *ctx = (struct __darwin_mcontext64 *) context;
@@ -84,7 +84,7 @@ mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state)
 }
 
 void
-mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context)
+mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context)
 {
        int i;
        arm_unified_thread_state_t *arch_state = (arm_unified_thread_state_t *) state;
@@ -103,8 +103,14 @@ mono_mach_arch_get_thread_state_size ()
        return sizeof (arm_unified_thread_state_t);
 }
 
+int
+mono_mach_arch_get_thread_fpstate_size ()
+{
+       g_assert_not_reached ();
+}
+
 kern_return_t
-mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count)
+mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count, thread_state_t fpstate, mach_msg_type_number_t *fpcount)
 {
        arm_unified_thread_state_t *arch_state = (arm_unified_thread_state_t *) state;
        kern_return_t ret;
@@ -116,7 +122,7 @@ mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mac
 }
 
 kern_return_t
-mono_mach_arch_set_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count)
+mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count, thread_state_t fpstate, mach_msg_type_number_t fpcount)
 {
        return thread_set_state (thread, ARM_UNIFIED_THREAD_STATE, state, count);
 }
index 20012550114610c911623f8a0cbdf9af0197c277..88eb187da4476b24dbb4980a851ab217ba1c1d5e 100644 (file)
@@ -35,19 +35,19 @@ mono_mach_arch_get_mcontext_size ()
 }
 
 void
-mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context)
+mono_mach_arch_thread_states_to_mcontext (thread_state_t state, thread_state_t fpstate, void *context)
 {
        g_assert_not_reached ();
 }
 
 void
-mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state)
+mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate)
 {
        g_assert_not_reached ();
 }
 
 void
-mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context)
+mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context)
 {
        g_assert_not_reached ();
 }
@@ -58,14 +58,20 @@ mono_mach_arch_get_thread_state_size ()
        g_assert_not_reached ();
 }
 
+int
+mono_mach_arch_get_thread_fpstate_size ()
+{
+       g_assert_not_reached ();
+}
+
 kern_return_t
-mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count)
+mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count, thread_state_t fpstate, mach_msg_type_number_t *fpcount)
 {
        g_assert_not_reached ();
 }
 
 kern_return_t
-mono_mach_arch_set_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count)
+mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count, thread_state_t fpstate, mach_msg_type_number_t fpcount)
 {
        g_assert_not_reached ();        
 }
index 3e8b166eaf2b51a7dc69f49d889c896762d75732..a296254cd2cffb17f92947fdbc9dce54f7aa1c4e 100644 (file)
@@ -16,6 +16,9 @@
 #include "utils/mono-sigcontext.h"
 #include "mach-support.h"
 
+// For reg numbers
+#include <mono/arch/amd64/amd64-codegen.h>
+
 /* Known offsets used for TLS storage*/
 
 /* All OSX versions up to 10.8 */
@@ -55,27 +58,30 @@ mono_mach_arch_get_mcontext_size ()
 }
 
 void
-mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context)
+mono_mach_arch_thread_states_to_mcontext (thread_state_t state, thread_state_t fpstate, void *context)
 {
        x86_thread_state32_t *arch_state = (x86_thread_state32_t *) state;
+       x86_float_state32_t *arch_fpstate = (x86_float_state32_t *) fpstate;
        struct __darwin_mcontext32 *ctx = (struct __darwin_mcontext32 *) context;
-
        ctx->__ss = *arch_state;
+       ctx->__fs = *arch_fpstate;
 }
 
 void
-mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state)
+mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate)
 {
        x86_thread_state32_t *arch_state = (x86_thread_state32_t *) state;
+       x86_float_state32_t *arch_fpstate = (x86_float_state32_t *) fpstate;
        struct __darwin_mcontext32 *ctx = (struct __darwin_mcontext32 *) context;
-
        *arch_state = ctx->__ss;
+       *arch_fpstate = ctx->__fs;
 }
 
 void
-mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context)
+mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context)
 {
        x86_thread_state32_t *arch_state = (x86_thread_state32_t *) state;
+       x86_float_state32_t *arch_fpstate = (x86_float_state32_t *) state;
        context->eax = arch_state->__eax;
        context->ebx = arch_state->__ebx;
        context->ecx = arch_state->__ecx;
@@ -85,38 +91,62 @@ mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *
        context->esi = arch_state->__edi;
        context->edi = arch_state->__esi;
        context->eip = arch_state->__eip;
+       context->fregs [X86_XMM0] = arch_fpstate->__fpu_xmm0;
+       context->fregs [X86_XMM1] = arch_fpstate->__fpu_xmm1;
+       context->fregs [X86_XMM2] = arch_fpstate->__fpu_xmm2;
+       context->fregs [X86_XMM3] = arch_fpstate->__fpu_xmm3;
+       context->fregs [X86_XMM4] = arch_fpstate->__fpu_xmm4;
+       context->fregs [X86_XMM5] = arch_fpstate->__fpu_xmm5;
+       context->fregs [X86_XMM6] = arch_fpstate->__fpu_xmm6;
+       context->fregs [X86_XMM7] = arch_fpstate->__fpu_xmm7;
 }
 
-
 int
 mono_mach_arch_get_thread_state_size ()
 {
        return sizeof (x86_thread_state32_t);
 }
 
+int
+mono_mach_arch_get_thread_fpstate_size ()
+{
+       return sizeof (x86_float_state32_t);
+}
+
 kern_return_t
-mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count)
+mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count, thread_state_t fpstate, mach_msg_type_number_t *fpcount)
 {
 #if defined(HOST_WATCHOS)
        g_error ("thread_get_state() is not supported by this platform");
 #else
        x86_thread_state32_t *arch_state = (x86_thread_state32_t *) state;
+       x86_float_state32_t *arch_fpstate = (x86_float_state32_t *) fpstate;
        kern_return_t ret;
 
        *count = x86_THREAD_STATE32_COUNT;
-       ret = thread_get_state (thread, x86_THREAD_STATE32, (thread_state_t) arch_state, count);
+       *fpcount = x86_FLOAT_STATE32_COUNT;
+
+       ret = thread_get_state (thread, x86_THREAD_STATE32, (thread_state_t)arch_state, count);
+       if (ret != KERN_SUCCESS)
+               return ret;
 
+       ret = thread_get_state (thread, x86_FLOAT_STATE32, (thread_state_t)arch_fpstate, fpcount);
        return ret;
 #endif
 }
 
 kern_return_t
-mono_mach_arch_set_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count)
+mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count, thread_state_t fpstate, mach_msg_type_number_t fpcount)
 {
 #if defined(HOST_WATCHOS)
        g_error ("thread_set_state() is not supported by this platform");
 #else
-       return thread_set_state (thread, x86_THREAD_STATE32, state, count);
+       kern_return_t ret;
+       ret = thread_set_state (thread, x86_THREAD_STATE32, state, count);
+       if (ret != KERN_SUCCESS)
+               return ret;
+       ret = thread_set_state (thread, x86_FLOAT_STATE32, fpstate, fpcount);
+       return ret;
 #endif 
 }
 
index abc135bd4eb8eb9987db2bb56f5bbf6aadf59093..9ac334c7171a729dbbf5bfbca16b6da1e4291087 100644 (file)
@@ -29,15 +29,17 @@ void *mono_mach_arch_get_sp (thread_state_t state);
 void mono_mach_init (pthread_key_t key);
 
 int mono_mach_arch_get_mcontext_size (void);
-void mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context);
-void mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state);
-void mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context);
+void mono_mach_arch_thread_states_to_mcontext (thread_state_t state, thread_state_t fpstate, void *context);
+void mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate);
+void mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context);
 
+/* FIXME: Should return size_t, not int. */
 int mono_mach_arch_get_thread_state_size (void);
+int mono_mach_arch_get_thread_fpstate_size (void);
 kern_return_t mono_mach_get_threads (thread_act_array_t *threads, guint32 *count);
 kern_return_t mono_mach_free_threads (thread_act_array_t threads, guint32 count);
-kern_return_t mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count);
-kern_return_t mono_mach_arch_set_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count);
+kern_return_t mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count, thread_state_t fpstate, mach_msg_type_number_t *fpcount);
+kern_return_t mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count, thread_state_t fpstate, mach_msg_type_number_t fpcount);
 void *mono_mach_arch_get_tls_value_from_thread (pthread_t thread, guint32 key);
 void *mono_mach_get_tls_address_from_thread (pthread_t thread, pthread_key_t key);
 
index 56948bdd901da23ae66edd34b6e7d19cf218c902..f29a67ca096690a978db2922ef8717ce7afa1920 100644 (file)
@@ -329,7 +329,7 @@ new_codechunk (CodeChunk *last, int dynamic, int size)
 {
        int minsize, flags = CODE_FLAG_MMAP;
        int chunk_size, bsize = 0;
-       int pagesize;
+       int pagesize, valloc_granule;
        CodeChunk *chunk;
        void *ptr;
 
@@ -338,12 +338,13 @@ new_codechunk (CodeChunk *last, int dynamic, int size)
 #endif
 
        pagesize = mono_pagesize ();
+       valloc_granule = mono_valloc_granule ();
 
        if (dynamic) {
                chunk_size = size;
                flags = CODE_FLAG_MALLOC;
        } else {
-               minsize = pagesize * MIN_PAGES;
+               minsize = MAX (pagesize * MIN_PAGES, valloc_granule);
                if (size < minsize)
                        chunk_size = minsize;
                else {
@@ -353,8 +354,8 @@ new_codechunk (CodeChunk *last, int dynamic, int size)
                        size += MIN_ALIGN - 1;
                        size &= ~(MIN_ALIGN - 1);
                        chunk_size = size;
-                       chunk_size += pagesize - 1;
-                       chunk_size &= ~ (pagesize - 1);
+                       chunk_size += valloc_granule - 1;
+                       chunk_size &= ~ (valloc_granule - 1);
                }
        }
 #ifdef BIND_ROOM
@@ -370,8 +371,8 @@ new_codechunk (CodeChunk *last, int dynamic, int size)
        if (chunk_size - size < bsize) {
                chunk_size = size + bsize;
                if (!dynamic) {
-                       chunk_size += pagesize - 1;
-                       chunk_size &= ~ (pagesize - 1);
+                       chunk_size += valloc_granule - 1;
+                       chunk_size &= ~ (valloc_granule - 1);
                }
        }
 #endif
index d03ba8051aa565a53319b35aad89cecae2b9f450..680c5a4cdded0ff203f10adf121c6dff8d416fa5 100644 (file)
 #define MONO_ATTR_USED
 #endif
 
+#ifdef __GNUC__
+#define MONO_ATTR_FORMAT_PRINTF(fmt_pos,arg_pos) __attribute__((format(printf,fmt_pos,arg_pos)))
+#else
+#define MONO_ATTR_FORMAT_PRINTF(fmt_pos,arg_pos)
+#endif
+
 #ifdef HAVE_KW_THREAD
 
 #define MONO_HAVE_FAST_TLS
 #include <direct.h>
 #define mkdir(x)       _mkdir(x)
 
-/* GCC specific functions aren't available */
-#define __builtin_return_address(x)    NULL
-
 #define __func__ __FUNCTION__
 
 #include <BaseTsd.h>
@@ -265,6 +268,13 @@ typedef SSIZE_T ssize_t;
 
 #endif /* _MSC_VER */
 
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+#define MONO_EMPTY_SOURCE_FILE(x) void __mono_win32_ ## x ## _quiet_lnk4221 (void) {}
+#else
+#define MONO_EMPTY_SOURCE_FILE(x)
+#endif
+
 #if !defined(_MSC_VER) && !defined(PLATFORM_SOLARIS) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MONOTOUCH) && HAVE_VISIBILITY_HIDDEN
 #if MONO_LLVM_LOADED
 #define MONO_LLVM_INTERNAL MONO_API
@@ -275,12 +285,6 @@ typedef SSIZE_T ssize_t;
 #define MONO_LLVM_INTERNAL 
 #endif
 
-#if HAVE_DEPRECATED
-#define MONO_DEPRECATED __attribute__ ((deprecated))
-#else
-#define MONO_DEPRECATED 
-#endif
-
 #ifdef __GNUC__
 #define MONO_ALWAYS_INLINE __attribute__((always_inline))
 #elif defined(_MSC_VER)
index 632513d874f7c8069bd6a1ee0d57c23b1c06bdd3..3056c3afd3a63e31ed39b746dabc589cc0ccc6a1 100644 (file)
@@ -170,6 +170,26 @@ mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
        mctx->gregs [AMD64_R14] = UCONTEXT_REG_R14 (ctx);
        mctx->gregs [AMD64_R15] = UCONTEXT_REG_R15 (ctx);
        mctx->gregs [AMD64_RIP] = UCONTEXT_REG_RIP (ctx);
+
+#ifdef UCONTEXT_REG_XMM
+       mctx->fregs [0] = UCONTEXT_REG_XMM0 (ctx);
+       mctx->fregs [1] = UCONTEXT_REG_XMM1 (ctx);
+       mctx->fregs [2] = UCONTEXT_REG_XMM2 (ctx);
+       mctx->fregs [3] = UCONTEXT_REG_XMM3 (ctx);
+       mctx->fregs [4] = UCONTEXT_REG_XMM4 (ctx);
+       mctx->fregs [5] = UCONTEXT_REG_XMM5 (ctx);
+       mctx->fregs [6] = UCONTEXT_REG_XMM6 (ctx);
+       mctx->fregs [7] = UCONTEXT_REG_XMM7 (ctx);
+       mctx->fregs [8] = UCONTEXT_REG_XMM8 (ctx);
+       mctx->fregs [9] = UCONTEXT_REG_XMM9 (ctx);
+       mctx->fregs [10] = UCONTEXT_REG_XMM10 (ctx);
+       mctx->fregs [11] = UCONTEXT_REG_XMM11 (ctx);
+       mctx->fregs [12] = UCONTEXT_REG_XMM12 (ctx);
+       mctx->fregs [13] = UCONTEXT_REG_XMM13 (ctx);
+       mctx->fregs [14] = UCONTEXT_REG_XMM14 (ctx);
+       mctx->fregs [15] = UCONTEXT_REG_XMM15 (ctx);
+#endif
+
 #elif defined(HOST_WIN32)
        CONTEXT *context = (CONTEXT*)sigctx;
 
@@ -224,6 +244,26 @@ mono_monoctx_to_sigctx (MonoContext *mctx, void *sigctx)
        UCONTEXT_REG_R14 (ctx) = mctx->gregs [AMD64_R14];
        UCONTEXT_REG_R15 (ctx) = mctx->gregs [AMD64_R15];
        UCONTEXT_REG_RIP (ctx) = mctx->gregs [AMD64_RIP];
+
+#ifdef UCONTEXT_REG_XMM
+       UCONTEXT_REG_XMM0 (ctx) = mctx->fregs [0];
+       UCONTEXT_REG_XMM1 (ctx) = mctx->fregs [1];
+       UCONTEXT_REG_XMM2 (ctx) = mctx->fregs [2];
+       UCONTEXT_REG_XMM3 (ctx) = mctx->fregs [3];
+       UCONTEXT_REG_XMM4 (ctx) = mctx->fregs [4];
+       UCONTEXT_REG_XMM5 (ctx) = mctx->fregs [5];
+       UCONTEXT_REG_XMM6 (ctx) = mctx->fregs [6];
+       UCONTEXT_REG_XMM7 (ctx) = mctx->fregs [7];
+       UCONTEXT_REG_XMM8 (ctx) = mctx->fregs [8];
+       UCONTEXT_REG_XMM9 (ctx) = mctx->fregs [9];
+       UCONTEXT_REG_XMM10 (ctx) = mctx->fregs [10];
+       UCONTEXT_REG_XMM11 (ctx) = mctx->fregs [11];
+       UCONTEXT_REG_XMM12 (ctx) = mctx->fregs [12];
+       UCONTEXT_REG_XMM13 (ctx) = mctx->fregs [13];
+       UCONTEXT_REG_XMM14 (ctx) = mctx->fregs [14];
+       UCONTEXT_REG_XMM15 (ctx) = mctx->fregs [15];
+#endif
+
 #elif defined(HOST_WIN32)
        CONTEXT *context = (CONTEXT*)sigctx;
 
index 2704c8662a8d1e2919a99fb3afb91361a551bb1d..499c37846b714eea7f0e525f1b1dd04aed3e09e7 100644 (file)
 #include <signal.h>
 #endif
 
+#define MONO_CONTEXT_OFFSET(field, index, field_type) \
+    "i" (offsetof (MonoContext, field) + (index) * sizeof (field_type))
+
+#if defined(__APPLE__)
+typedef struct __darwin_xmm_reg MonoContextSimdReg;
+#endif
+
 /*
  * General notes about mono-context.
  * Each arch defines a MonoContext struct with all GPR regs + IP/PC.
@@ -87,6 +94,8 @@ struct sigcontext {
 # define SC_ESI esi
 #endif
 
+#include <mono/arch/x86/x86-codegen.h>
+
 typedef struct {
        mgreg_t eax;
        mgreg_t ebx;
@@ -97,6 +106,9 @@ typedef struct {
        mgreg_t esi;
        mgreg_t edi;
        mgreg_t eip;
+#ifdef __APPLE__
+    MonoContextSimdReg fregs [X86_XMM_NREG];
+#endif
 } MonoContext;
 
 #define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->eip = (mgreg_t)(ip); } while (0); 
@@ -129,18 +141,26 @@ typedef struct {
 #else
 #define MONO_CONTEXT_GET_CURRENT(ctx) \
        __asm__ __volatile__(   \
-       "movl $0x0, 0x00(%0)\n" \
-       "mov %%ebx, 0x04(%0)\n" \
-       "mov %%ecx, 0x08(%0)\n" \
-       "mov %%edx, 0x0c(%0)\n" \
-       "mov %%ebp, 0x10(%0)\n" \
-       "mov %%esp, 0x14(%0)\n" \
-       "mov %%esi, 0x18(%0)\n" \
-       "mov %%edi, 0x1c(%0)\n" \
+       "movl $0x0, %c[eax](%0)\n" \
+       "mov %%ebx, %c[ebx](%0)\n" \
+       "mov %%ecx, %c[ecx](%0)\n" \
+       "mov %%edx, %c[edx](%0)\n" \
+       "mov %%ebp, %c[ebp](%0)\n" \
+       "mov %%esp, %c[esp](%0)\n" \
+       "mov %%esi, %c[esi](%0)\n" \
+       "mov %%edi, %c[edi](%0)\n" \
        "call 1f\n"     \
        "1: pop 0x20(%0)\n"     \
        :       \
-       : "a" (&(ctx))  \
+       : "a" (&(ctx)), \
+               [eax] MONO_CONTEXT_OFFSET (eax, 0, mgreg_t), \
+               [ebx] MONO_CONTEXT_OFFSET (ebx, 0, mgreg_t), \
+               [ecx] MONO_CONTEXT_OFFSET (ecx, 0, mgreg_t), \
+               [edx] MONO_CONTEXT_OFFSET (edx, 0, mgreg_t), \
+               [ebp] MONO_CONTEXT_OFFSET (ebp, 0, mgreg_t), \
+               [esp] MONO_CONTEXT_OFFSET (esp, 0, mgreg_t), \
+               [esi] MONO_CONTEXT_OFFSET (esi, 0, mgreg_t), \
+               [edi] MONO_CONTEXT_OFFSET (edi, 0, mgreg_t) \
        : "memory")
 #endif
 
@@ -160,7 +180,11 @@ typedef struct {
 
 typedef struct {
        mgreg_t gregs [AMD64_NREG];
+#ifdef __APPLE__
+       MonoContextSimdReg fregs [AMD64_XMM_NREG];
+#else
        double fregs [AMD64_XMM_NREG];
+#endif
 } MonoContext;
 
 #define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->gregs [AMD64_RIP] = (mgreg_t)(ip); } while (0);
@@ -202,30 +226,98 @@ extern void mono_context_get_current (void *);
                : "rdx", "memory")
 #else
 
-#define MONO_CONTEXT_GET_CURRENT(ctx)  \
-       __asm__ __volatile__(   \
-               "movq $0x0,  0x00(%0)\n"        \
-               "movq %%rcx, 0x08(%0)\n"        \
-               "movq %%rdx, 0x10(%0)\n"        \
-               "movq %%rbx, 0x18(%0)\n"        \
-               "movq %%rsp, 0x20(%0)\n"        \
-               "movq %%rbp, 0x28(%0)\n"        \
-               "movq %%rsi, 0x30(%0)\n"        \
-               "movq %%rdi, 0x38(%0)\n"        \
-               "movq %%r8,  0x40(%0)\n"        \
-               "movq %%r9,  0x48(%0)\n"        \
-               "movq %%r10, 0x50(%0)\n"        \
-               "movq %%r11, 0x58(%0)\n"        \
-               "movq %%r12, 0x60(%0)\n"        \
-               "movq %%r13, 0x68(%0)\n"        \
-               "movq %%r14, 0x70(%0)\n"        \
-               "movq %%r15, 0x78(%0)\n"        \
-               /* "leaq (%%rip), %%rdx\n" is not understood by icc */  \
-               ".byte 0x48, 0x8d, 0x15, 0x00, 0x00, 0x00, 0x00\n" \
-               "movq %%rdx, 0x80(%0)\n"        \
-               :       \
-               : "a" (&(ctx))  \
-               : "rdx", "memory")
+#define MONO_CONTEXT_GET_CURRENT_GREGS(ctx) \
+       do { \
+               __asm__ __volatile__(   \
+                       "movq $0x0,  %c[rax](%0)\n"     \
+                       "movq %%rcx, %c[rcx](%0)\n"     \
+                       "movq %%rdx, %c[rdx](%0)\n"     \
+                       "movq %%rbx, %c[rbx](%0)\n"     \
+                       "movq %%rsp, %c[rsp](%0)\n"     \
+                       "movq %%rbp, %c[rbp](%0)\n"     \
+                       "movq %%rsi, %c[rsi](%0)\n"     \
+                       "movq %%rdi, %c[rdi](%0)\n"     \
+                       "movq %%r8,  %c[r8](%0)\n"      \
+                       "movq %%r9,  %c[r9](%0)\n"      \
+                       "movq %%r10, %c[r10](%0)\n"     \
+                       "movq %%r11, %c[r11](%0)\n"     \
+                       "movq %%r12, %c[r12](%0)\n"     \
+                       "movq %%r13, %c[r13](%0)\n"     \
+                       "movq %%r14, %c[r14](%0)\n"     \
+                       "movq %%r15, %c[r15](%0)\n"     \
+                       /* "leaq (%%rip), %%rdx\n" is not understood by icc */  \
+                       ".byte 0x48, 0x8d, 0x15, 0x00, 0x00, 0x00, 0x00\n" \
+                       "movq %%rdx, %c[rip](%0)\n"     \
+                       :       \
+                       : "a" (&(ctx)), \
+                               [rax] MONO_CONTEXT_OFFSET (gregs, AMD64_RAX, mgreg_t),  \
+                               [rcx] MONO_CONTEXT_OFFSET (gregs, AMD64_RCX, mgreg_t),  \
+                               [rdx] MONO_CONTEXT_OFFSET (gregs, AMD64_RDX, mgreg_t),  \
+                               [rbx] MONO_CONTEXT_OFFSET (gregs, AMD64_RBX, mgreg_t),  \
+                               [rsp] MONO_CONTEXT_OFFSET (gregs, AMD64_RSP, mgreg_t),  \
+                               [rbp] MONO_CONTEXT_OFFSET (gregs, AMD64_RBP, mgreg_t),  \
+                               [rsi] MONO_CONTEXT_OFFSET (gregs, AMD64_RSI, mgreg_t),  \
+                               [rdi] MONO_CONTEXT_OFFSET (gregs, AMD64_RDI, mgreg_t),  \
+                               [r8] MONO_CONTEXT_OFFSET (gregs, AMD64_R8, mgreg_t), \
+                               [r9] MONO_CONTEXT_OFFSET (gregs, AMD64_R9, mgreg_t), \
+                               [r10] MONO_CONTEXT_OFFSET (gregs, AMD64_R10, mgreg_t),  \
+                               [r11] MONO_CONTEXT_OFFSET (gregs, AMD64_R11, mgreg_t),  \
+                               [r12] MONO_CONTEXT_OFFSET (gregs, AMD64_R12, mgreg_t),  \
+                               [r13] MONO_CONTEXT_OFFSET (gregs, AMD64_R13, mgreg_t),  \
+                               [r14] MONO_CONTEXT_OFFSET (gregs, AMD64_R14, mgreg_t),  \
+                               [r15] MONO_CONTEXT_OFFSET (gregs, AMD64_R15, mgreg_t),  \
+                               [rip] MONO_CONTEXT_OFFSET (gregs, AMD64_RIP, mgreg_t)   \
+                       : "rdx", "memory");     \
+       } while (0)
+
+#ifdef UCONTEXT_REG_XMM
+#define MONO_CONTEXT_GET_CURRENT_FREGS(ctx) \
+       do { \
+               __asm__ __volatile__ ( \
+                       "movups %%xmm0, %c[xmm0](%0)\n" \
+                       "movups %%xmm1, %c[xmm1](%0)\n" \
+                       "movups %%xmm2, %c[xmm2](%0)\n" \
+                       "movups %%xmm3, %c[xmm3](%0)\n" \
+                       "movups %%xmm4, %c[xmm4](%0)\n" \
+                       "movups %%xmm5, %c[xmm5](%0)\n" \
+                       "movups %%xmm6, %c[xmm6](%0)\n" \
+                       "movups %%xmm7, %c[xmm7](%0)\n" \
+                       "movups %%xmm8, %c[xmm8](%0)\n" \
+                       "movups %%xmm9, %c[xmm9](%0)\n" \
+                       "movups %%xmm10, %c[xmm10](%0)\n"       \
+                       "movups %%xmm11, %c[xmm11](%0)\n"       \
+                       "movups %%xmm12, %c[xmm12](%0)\n"       \
+                       "movups %%xmm12, %c[xmm12](%0)\n"       \
+                       "movups %%xmm14, %c[xmm14](%0)\n"       \
+                       "movups %%xmm15, %c[xmm15](%0)\n"       \
+                       : \
+                       : "a" (&(ctx)), \
+                               [xmm0] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM0, MonoContextSimdReg), \
+                               [xmm1] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM1, MonoContextSimdReg), \
+                               [xmm2] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM2, MonoContextSimdReg), \
+                               [xmm3] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM3, MonoContextSimdReg), \
+                               [xmm4] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM4, MonoContextSimdReg), \
+                               [xmm5] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM5, MonoContextSimdReg), \
+                               [xmm6] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM6, MonoContextSimdReg), \
+                               [xmm7] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM7, MonoContextSimdReg), \
+                               [xmm8] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM8, MonoContextSimdReg), \
+                               [xmm9] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM9, MonoContextSimdReg), \
+                               [xmm10] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM10, MonoContextSimdReg), \
+                               [xmm11] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM11, MonoContextSimdReg), \
+                               [xmm12] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM12, MonoContextSimdReg), \
+                               [xmm13] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM13, MonoContextSimdReg), \
+                               [xmm14] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM14, MonoContextSimdReg), \
+                               [xmm15] MONO_CONTEXT_OFFSET (fregs, AMD64_XMM15, MonoContextSimdReg));  \
+       } while (0)
+#else
+#define MONO_CONTEXT_GET_CURRENT_FREGS(ctx)
+#endif
+
+#define MONO_CONTEXT_GET_CURRENT(ctx) \
+    do {       \
+               MONO_CONTEXT_GET_CURRENT_GREGS(ctx);    \
+               MONO_CONTEXT_GET_CURRENT_FREGS(ctx);    \
+       } while (0)
 #endif
 
 #define MONO_ARCH_HAS_MONO_CONTEXT 1
@@ -264,15 +356,15 @@ typedef struct {
                "push {r0}\n"                           \
                "push {r1}\n"                           \
                "mov r0, %0\n"                          \
-               "ldr r1, [sp, #4]\n"                    \
-               "str r1, [r0]!\n"                       \
-               "ldr r1, [sp, #0]\n"                    \
-               "str r1, [r0]!\n"                       \
+               "ldr r1, [sp, #4]\n"            \
+               "str r1, [r0], #4\n"            \
+               "ldr r1, [sp, #0]\n"            \
+               "str r1, [r0], #4\n"            \
                "stmia r0!, {r2-r12}\n"         \
-               "str sp, [r0]!\n"                       \
-               "str lr, [r0]!\n"                       \
+               "str sp, [r0], #4\n"            \
+               "str lr, [r0], #4\n"            \
                "mov r1, pc\n"                          \
-               "str r1, [r0]!\n"                       \
+               "str r1, [r0], #4\n"            \
                "pop {r1}\n"                            \
                "pop {r0}\n"                            \
                :                                                       \
@@ -294,6 +386,11 @@ typedef struct {
        mgreg_t regs [32];
        double fregs [32];
        mgreg_t pc;
+       /*
+        * fregs might not be initialized if this context was created from a
+        * ucontext.
+        */
+       mgreg_t has_fregs;
 } MonoContext;
 
 #define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->pc = (mgreg_t)ip; } while (0)
@@ -313,7 +410,7 @@ typedef struct {
        thread_port_t self = mach_thread_self ();       \
        kern_return_t ret = thread_get_state (self, state_flavor, (thread_state_t) &thread_state, &state_count);        \
        g_assert (ret == 0);    \
-       mono_mach_arch_thread_state_to_mono_context ((thread_state_t)&thread_state, &ctx); \
+       mono_mach_arch_thread_states_to_mono_context ((thread_state_t)&thread_state, (thread_state_t)NULL, &ctx); \
        mach_port_deallocate (current_task (), self);   \
 } while (0);
 
@@ -476,40 +573,40 @@ typedef struct {
 
 #define MONO_CONTEXT_GET_CURRENT(ctx)  \
        __asm__ __volatile__(   \
-               "std 0, 0(%0)\n"        \
-               "std 1, 4(%0)\n"        \
-               "std 0, 4*0+8(%0)\n"    \
-               "std 1, 4*1+8(%0)\n"    \
-               "std 2, 4*2+8(%0)\n"    \
-               "std 3, 4*3+8(%0)\n"    \
-               "std 4, 4*4+8(%0)\n"    \
-               "std 5, 4*5+8(%0)\n"    \
-               "std 6, 4*6+8(%0)\n"    \
-               "std 7, 4*7+8(%0)\n"    \
-               "std 8, 4*8+8(%0)\n"    \
-               "std 9, 4*9+8(%0)\n"    \
-               "std 10, 4*10+8(%0)\n"  \
-               "std 11, 4*11+8(%0)\n"  \
-               "std 12, 4*12+8(%0)\n"  \
-               "std 13, 4*13+8(%0)\n"  \
-               "std 14, 4*14+8(%0)\n"  \
-               "std 15, 4*15+8(%0)\n"  \
-               "std 16, 4*16+8(%0)\n"  \
-               "std 17, 4*17+8(%0)\n"  \
-               "std 18, 4*18+8(%0)\n"  \
-               "std 19, 4*19+8(%0)\n"  \
-               "std 20, 4*20+8(%0)\n"  \
-               "std 21, 4*21+8(%0)\n"  \
-               "std 22, 4*22+8(%0)\n"  \
-               "std 23, 4*23+8(%0)\n"  \
-               "std 24, 4*24+8(%0)\n"  \
-               "std 25, 4*25+8(%0)\n"  \
-               "std 26, 4*26+8(%0)\n"  \
-               "std 27, 4*27+8(%0)\n"  \
-               "std 28, 4*28+8(%0)\n"  \
-               "std 29, 4*29+8(%0)\n"  \
-               "std 30, 4*30+8(%0)\n"  \
-               "std 31, 4*31+8(%0)\n"  \
+               "stw 0, 0(%0)\n"        \
+               "stw 1, 4(%0)\n"        \
+               "stw 0, 4*0+8(%0)\n"    \
+               "stw 1, 4*1+8(%0)\n"    \
+               "stw 2, 4*2+8(%0)\n"    \
+               "stw 3, 4*3+8(%0)\n"    \
+               "stw 4, 4*4+8(%0)\n"    \
+               "stw 5, 4*5+8(%0)\n"    \
+               "stw 6, 4*6+8(%0)\n"    \
+               "stw 7, 4*7+8(%0)\n"    \
+               "stw 8, 4*8+8(%0)\n"    \
+               "stw 9, 4*9+8(%0)\n"    \
+               "stw 10, 4*10+8(%0)\n"  \
+               "stw 11, 4*11+8(%0)\n"  \
+               "stw 12, 4*12+8(%0)\n"  \
+               "stw 13, 4*13+8(%0)\n"  \
+               "stw 14, 4*14+8(%0)\n"  \
+               "stw 15, 4*15+8(%0)\n"  \
+               "stw 16, 4*16+8(%0)\n"  \
+               "stw 17, 4*17+8(%0)\n"  \
+               "stw 18, 4*18+8(%0)\n"  \
+               "stw 19, 4*19+8(%0)\n"  \
+               "stw 20, 4*20+8(%0)\n"  \
+               "stw 21, 4*21+8(%0)\n"  \
+               "stw 22, 4*22+8(%0)\n"  \
+               "stw 23, 4*23+8(%0)\n"  \
+               "stw 24, 4*24+8(%0)\n"  \
+               "stw 25, 4*25+8(%0)\n"  \
+               "stw 26, 4*26+8(%0)\n"  \
+               "stw 27, 4*27+8(%0)\n"  \
+               "stw 28, 4*28+8(%0)\n"  \
+               "stw 29, 4*29+8(%0)\n"  \
+               "stw 30, 4*30+8(%0)\n"  \
+               "stw 31, 4*31+8(%0)\n"  \
                "stfd 0, 8*0+4*32+8(%0)\n"      \
                "stfd 1, 8*1+4*32+8(%0)\n"      \
                "stfd 2, 8*2+4*32+8(%0)\n"      \
@@ -543,7 +640,7 @@ typedef struct {
                "stfd 30, 8*30+4*32+8(%0)\n"    \
                "stfd 31, 8*31+4*32+8(%0)\n"    \
                : : "r" (&(ctx))        \
-               : "memory"                      \
+               : "memory", "r0"        \
        )
 
 #endif
@@ -699,6 +796,8 @@ mono_ia64_context_get_fp (MonoContext *ctx)
 
 #elif ((defined(__mips__) && !defined(MONO_CROSS_COMPILE)) || (defined(TARGET_MIPS))) && SIZEOF_REGISTER == 4 /* defined(__ia64__) */
 
+#define MONO_ARCH_HAS_MONO_CONTEXT 1
+
 #include <mono/arch/mips/mips-codegen.h>
 
 typedef struct {
diff --git a/mono/utils/mono-dl-windows-internals.h b/mono/utils/mono-dl-windows-internals.h
new file mode 100644 (file)
index 0000000..5215418
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __MONO_UTILS_DL_WINDOWS_H__
+#define __MONO_UTILS_DL_WINDOWS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include "mono/utils/mono-dl.h"
+
+void*
+mono_dl_lookup_symbol_in_process (const char *symbol_name);
+#endif /* HOST_WIN32 */
+#endif /* __MONO_UTILS_DL_WINDOWS_H__ */
+
diff --git a/mono/utils/mono-dl-windows-uwp.c b/mono/utils/mono-dl-windows-uwp.c
new file mode 100644 (file)
index 0000000..36ade1f
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * mono-dl-windows-uwp.c: UWP dl support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include "mono/utils/mono-dl-windows-internals.h"
+
+void*
+mono_dl_lookup_symbol_in_process (const char *symbol_name)
+{
+       g_unsupported_api ("EnumProcessModules");
+       SetLastError (ERROR_NOT_SUPPORTED);
+
+       return NULL;
+}
+
+char*
+mono_dl_current_error_string (void)
+{
+       char *ret = NULL;
+       TCHAR buf [1024];
+       DWORD code = GetLastError ();
+
+       if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
+               code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, G_N_ELEMENTS(buf) - 1, NULL))
+               buf[0] = TEXT('\0');
+
+       ret = u16to8 (buf);
+       return ret;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (mono_dl_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
index 9e3efa796f7aa93503ab2fa1712d2be476519c73..32eaac799b6cae03ebef2cc16efd1584cb29cc09 100644 (file)
@@ -13,6 +13,7 @@
 #if defined(HOST_WIN32)
 
 #include "mono/utils/mono-dl.h"
+#include "mono/utils/mono-dl-windows-internals.h"
 #include "mono/utils/mono-embed.h"
 #include "mono/utils/mono-path.h"
 
@@ -25,7 +26,6 @@
 #include <windows.h>
 #include <psapi.h>
 
-
 const char*
 mono_dl_get_so_prefix (void)
 {
@@ -48,14 +48,20 @@ mono_dl_open_file (const char *file, int flags)
        gpointer hModule = NULL;
        if (file) {
                gunichar2* file_utf16 = g_utf8_to_utf16 (file, strlen (file), NULL, NULL, NULL);
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
                guint last_sem = SetErrorMode (SEM_FAILCRITICALERRORS);
+#endif
                guint32 last_error = 0;
 
                hModule = LoadLibrary (file_utf16);
                if (!hModule)
                        last_error = GetLastError ();
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
                SetErrorMode (last_sem);
+#endif
+
                g_free (file_utf16);
 
                if (!hModule)
@@ -73,23 +79,15 @@ mono_dl_close_handle (MonoDl *module)
                FreeLibrary (module->handle);
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 void*
-mono_dl_lookup_symbol (MonoDl *module, const char *symbol_name)
+mono_dl_lookup_symbol_in_process (const char *symbol_name)
 {
        HMODULE *modules;
        DWORD buffer_size = sizeof (HMODULE) * 1024;
        DWORD needed, i;
        gpointer proc = NULL;
 
-       /* get the symbol directly from the specified module */
-       if (!module->main_module)
-               return GetProcAddress (module->handle, symbol_name);
-
-       /* get the symbol from the main module */
-       proc = GetProcAddress (module->handle, symbol_name);
-       if (proc != NULL)
-               return proc;
-
        /* get the symbol from the loaded DLLs */
        modules = (HMODULE *) g_malloc (buffer_size);
        if (modules == NULL)
@@ -129,6 +127,25 @@ mono_dl_lookup_symbol (MonoDl *module, const char *symbol_name)
        g_free (modules);
        return NULL;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+void*
+mono_dl_lookup_symbol (MonoDl *module, const char *symbol_name)
+{
+       gpointer proc = NULL;
+
+       /* get the symbol directly from the specified module */
+       if (!module->main_module)
+               return GetProcAddress (module->handle, symbol_name);
+
+       /* get the symbol from the main module */
+       proc = GetProcAddress (module->handle, symbol_name);
+       if (proc != NULL)
+               return proc;
+
+       /* get the symbol from the loaded DLLs */
+       return mono_dl_lookup_symbol_in_process (symbol_name);
+}
 
 int
 mono_dl_convert_flags (int flags)
@@ -136,6 +153,7 @@ mono_dl_convert_flags (int flags)
        return 0;
 }
 
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
 char*
 mono_dl_current_error_string (void)
 {
@@ -153,6 +171,7 @@ mono_dl_current_error_string (void)
        }
        return ret;
 }
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
 
 int
 mono_dl_get_executable_path (char *buf, int buflen)
@@ -165,5 +184,4 @@ mono_dl_get_system_dir (void)
 {
        return NULL;
 }
-
 #endif
index e143901748d710d2e2f8bce87d31b0bf32dbe102..c74923c00944b34d83aa5c2da0cc4a2fa19931d4 100644 (file)
@@ -32,6 +32,12 @@ typedef struct {
        void *padding [3];
 } MonoErrorInternal;
 
+/* Invariant: the error strings are allocated in the mempool of the given image */
+struct _MonoErrorBoxed {
+       MonoError error;
+       MonoImage *image;
+};
+
 #define error_init(error) do { \
        ((MonoErrorInternal*)(error))->error_code = MONO_ERROR_NONE;    \
        ((MonoErrorInternal*)(error))->flags = 0;       \
@@ -57,64 +63,67 @@ mono_error_dup_strings (MonoError *error, gboolean dup_strings);
 
 /* This function is not very useful as you can't provide any details beyond the message.*/
 void
-mono_error_set_error (MonoError *error, int error_code, const char *msg_format, ...);
+mono_error_set_error (MonoError *error, int error_code, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4);
 
 void
-mono_error_set_assembly_load (MonoError *error, const char *assembly_name, const char *msg_format, ...);
+mono_error_set_assembly_load (MonoError *error, const char *assembly_name, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4);
 
 void
 mono_error_set_assembly_load_simple (MonoError *error, const char *assembly_name, gboolean refection_only);
 
 void
-mono_error_set_type_load_class (MonoError *error, MonoClass *klass, const char *msg_format, ...);
+mono_error_set_type_load_class (MonoError *error, MonoClass *klass, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4);
+
+void
+mono_error_vset_type_load_class (MonoError *error, MonoClass *klass, const char *msg_format, va_list args);
 
 void
-mono_error_set_type_load_name (MonoError *error, const char *type_name, const char *assembly_name, const char *msg_format, ...);
+mono_error_set_type_load_name (MonoError *error, const char *type_name, const char *assembly_name, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(4,5);
 
 void
-mono_error_set_method_load (MonoError *error, MonoClass *klass, const char *method_name, const char *msg_format, ...);
+mono_error_set_method_load (MonoError *error, MonoClass *klass, const char *method_name, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(4,5);
 
 void
-mono_error_set_field_load (MonoError *error, MonoClass *klass, const char *field_name, const char *msg_format, ...);
+mono_error_set_field_load (MonoError *error, MonoClass *klass, const char *field_name, const char *msg_format, ...)  MONO_ATTR_FORMAT_PRINTF(4,5);
 
 void
-mono_error_set_bad_image (MonoError *error, MonoImage *image, const char *msg_format, ...);
+mono_error_set_bad_image (MonoError *error, MonoImage *image, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4);
 
 void
-mono_error_set_bad_image_name (MonoError *error, const char *file_name, const char *msg_format, ...);
+mono_error_set_bad_image_name (MonoError *error, const char *file_name, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4);
 
 void
-mono_error_set_out_of_memory (MonoError *error, const char *msg_format, ...);
+mono_error_set_out_of_memory (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
 
 void
-mono_error_set_argument (MonoError *error, const char *argument, const char *msg_format, ...);
+mono_error_set_argument (MonoError *error, const char *argument, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4);
 
 void
-mono_error_set_argument_null (MonoError *oerror, const char *argument, const char *msg_format, ...);
+mono_error_set_argument_null (MonoError *oerror, const char *argument, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4);
 
 void
-mono_error_set_not_verifiable (MonoError *oerror, MonoMethod *method, const char *msg_format, ...);
+mono_error_set_not_verifiable (MonoError *oerror, MonoMethod *method, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4);
 
 void
-mono_error_set_generic_error (MonoError *error, const char * name_space, const char *name, const char *msg_format, ...);
+mono_error_set_generic_error (MonoError *error, const char * name_space, const char *name, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(4,5);
 
 void
-mono_error_set_execution_engine (MonoError *error, const char *msg_format, ...);
+mono_error_set_execution_engine (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
 
 void
-mono_error_set_not_implemented (MonoError *error, const char *msg_format, ...);
+mono_error_set_not_implemented (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
 
 void
-mono_error_set_not_supported (MonoError *error, const char *msg_format, ...);
+mono_error_set_not_supported (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
 
 void
-mono_error_set_invalid_operation (MonoError *error, const char *msg_format, ...);
+mono_error_set_invalid_operation (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
 
 void
 mono_error_set_exception_instance (MonoError *error, MonoException *exc);
 
 void
-mono_error_set_invalid_program (MonoError *oerror, const char *msg_format, ...);
+mono_error_set_invalid_program (MonoError *oerror, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3);
 
 MonoException*
 mono_error_prepare_exception (MonoError *error, MonoError *error_out);
@@ -128,4 +137,11 @@ mono_error_raise_exception (MonoError *error);
 void
 mono_error_move (MonoError *dest, MonoError *src);
 
+MonoErrorBoxed*
+mono_error_box (const MonoError *error, MonoImage *image);
+
+gboolean
+mono_error_set_from_boxed (MonoError *error, const MonoErrorBoxed *from);
+
+
 #endif
index 7e186b6b717ce06b2f4103bb2ab3abe22e5ce2df..66a3e169ab77d80ec5cb8d25832debc848c2afe1 100644 (file)
@@ -38,6 +38,12 @@ is_managed_exception (MonoErrorInternal *error)
        return (error->error_code == MONO_ERROR_EXCEPTION_INSTANCE);
 }
 
+static gboolean
+is_boxed (MonoErrorInternal *error)
+{
+       return ((error->flags & MONO_ERROR_MEMPOOL_BOXED) != 0);
+}
+
 static void
 mono_error_prepare (MonoErrorInternal *error)
 {
@@ -116,6 +122,8 @@ mono_error_cleanup (MonoError *oerror)
 
        /* Two cleanups in a row without an intervening init. */
        g_assert (orig_error_code != MONO_ERROR_CLEANUP_CALLED_SENTINEL);
+       /* Mempool stored error shouldn't be cleaned up */
+       g_assert (!is_boxed (error));
 
        /* Mark it as cleaned up. */
        error->error_code = MONO_ERROR_CLEANUP_CALLED_SENTINEL;
@@ -289,18 +297,27 @@ mono_error_set_assembly_load_simple (MonoError *oerror, const char *assembly_nam
        if (refection_only)
                mono_error_set_assembly_load (oerror, assembly_name, "Cannot resolve dependency to assembly because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.");
        else
-               mono_error_set_assembly_load (oerror, assembly_name, "Could not load file or assembly or one of its dependencies.");
+               mono_error_set_assembly_load (oerror, assembly_name, "Could not load file or assembly '%s' or one of its dependencies.", assembly_name);
 }
 
 void
 mono_error_set_type_load_class (MonoError *oerror, MonoClass *klass, const char *msg_format, ...)
+{
+       va_list args;
+       va_start (args, msg_format);
+       mono_error_vset_type_load_class (oerror, klass, msg_format, args);
+       va_end (args);
+}
+
+void
+mono_error_vset_type_load_class (MonoError *oerror, MonoClass *klass, const char *msg_format, va_list args)
 {
        MonoErrorInternal *error = (MonoErrorInternal*)oerror;
        mono_error_prepare (error);
 
        error->error_code = MONO_ERROR_TYPE_LOAD;
        mono_error_set_class (oerror, klass);
-       set_error_message ();
+       set_error_messagev ();
 }
 
 /*
@@ -618,7 +635,7 @@ mono_error_prepare_exception (MonoError *oerror, MonoError *error_out)
                        }
 
                        exception = mono_exception_from_name_two_strings_checked (mono_get_corlib (), "System", "TypeLoadException", type_name, assembly_name, error_out);
-                       if (exception)
+                       if (exception && error->full_message != NULL && strcmp (error->full_message, ""))
                                set_message_on_exception (exception, error, error_out);
                } else {
                        exception = mono_exception_from_name_msg (mono_defaults.corlib, "System", "TypeLoadException", error->full_message);
@@ -730,6 +747,9 @@ mono_error_convert_to_exception (MonoError *target_error)
        MonoError error;
        MonoException *ex;
 
+       /* Mempool stored error shouldn't be cleaned up */
+       g_assert (!is_boxed ((MonoErrorInternal*)target_error));
+
        if (mono_error_ok (target_error))
                return NULL;
 
@@ -752,3 +772,97 @@ mono_error_move (MonoError *dest, MonoError *src)
        memcpy (dest, src, sizeof (MonoErrorInternal));
        mono_error_init (src);
 }
+
+/**
+ * mono_error_box:
+ * @ierror: The input error that will be boxed.
+ * @image: The mempool of this image will hold the boxed error.
+ *
+ * Creates a new boxed error in the given mempool from MonoError.
+ * It does not alter ierror, so you still have to clean it up with
+ * mono_error_cleanup or mono_error_convert_to_exception or another such function.
+ *
+ * Returns the boxed error, or NULL if the mempool could not allocate.
+ */
+MonoErrorBoxed*
+mono_error_box (const MonoError *ierror, MonoImage *image)
+{
+       MonoErrorInternal *from = (MonoErrorInternal*)ierror;
+       /* Don't know how to box a gchandle */
+       g_assert (!is_managed_exception (from));
+       MonoErrorBoxed* box = mono_image_alloc (image, sizeof (MonoErrorBoxed));
+       box->image = image;
+       mono_error_init_flags (&box->error, MONO_ERROR_MEMPOOL_BOXED);
+       MonoErrorInternal *to = (MonoErrorInternal*)&box->error;
+
+#define DUP_STR(field) do {                                            \
+               if (from->field) {                                      \
+                       if (!(to->field = mono_image_strdup (image, from->field))) \
+                               to->flags |= MONO_ERROR_INCOMPLETE;     \
+               } else {                                                \
+                       to->field = NULL;                               \
+               }                                                       \
+       } while (0)
+
+       to->error_code = from->error_code;
+       DUP_STR (type_name);
+       DUP_STR (assembly_name);
+       DUP_STR (member_name);
+       DUP_STR (exception_name_space);
+       DUP_STR (exception_name);
+       DUP_STR (full_message);
+       DUP_STR (full_message_with_fields);
+       DUP_STR (first_argument);
+       to->exn.klass = from->exn.klass;
+
+#undef DUP_STR
+       
+       return box;
+}
+
+
+/**
+ * mono_error_set_from_boxed:
+ * @oerror: The error that will be set to the contents of the box.
+ * @box: A mempool-allocated error.
+ *
+ * Sets the error condition in the oerror from the contents of the
+ * given boxed error.  Does not alter the boxed error, so it can be
+ * used in a future call to mono_error_set_from_boxed as needed.  The
+ * oerror should've been previously initialized with mono_error_init,
+ * as usual.
+ *
+ * Returns TRUE on success or FALSE on failure.
+ */
+gboolean
+mono_error_set_from_boxed (MonoError *oerror, const MonoErrorBoxed *box)
+{
+       MonoErrorInternal* to = (MonoErrorInternal*)oerror;
+       MonoErrorInternal* from = (MonoErrorInternal*)&box->error;
+       g_assert (!is_managed_exception (from));
+
+       mono_error_prepare (to);
+       to->flags |= MONO_ERROR_FREE_STRINGS;
+#define DUP_STR(field) do {                                            \
+               if (from->field) {                                      \
+                       if (!(to->field = g_strdup (from->field)))      \
+                               to->flags |= MONO_ERROR_INCOMPLETE;     \
+               } else {                                                \
+                       to->field = NULL;                               \
+               }                                                       \
+       } while (0)
+
+       to->error_code = from->error_code;
+       DUP_STR (type_name);
+       DUP_STR (assembly_name);
+       DUP_STR (member_name);
+       DUP_STR (exception_name_space);
+       DUP_STR (exception_name);
+       DUP_STR (full_message);
+       DUP_STR (full_message_with_fields);
+       DUP_STR (first_argument);
+       to->exn.klass = from->exn.klass;
+                 
+#undef DUP_STR
+       return (to->flags & MONO_ERROR_INCOMPLETE) == 0 ;
+}
index 0aba0e1d61abb4219d6cfc15a9a8ead976c1ceaa..fa9caa6759e36bb2cecb619b19822f56e08520e2 100644 (file)
@@ -12,7 +12,11 @@ enum {
        /*
        Something happened while processing the error and the resulting message is incomplete.
        */
-       MONO_ERROR_INCOMPLETE = 0x0002
+       MONO_ERROR_INCOMPLETE = 0x0002,
+       /*
+       This MonoError is heap allocated in a mempool
+        */
+       MONO_ERROR_MEMPOOL_BOXED = 0x0004
 };
 
 enum {
@@ -48,6 +52,9 @@ typedef struct _MonoError {
        void *hidden_1 [12]; /*DON'T TOUCH */
 } MonoError;
 
+/* Mempool-allocated MonoError.*/
+typedef struct _MonoErrorBoxed MonoErrorBoxed;
+
 MONO_BEGIN_DECLS
 
 MONO_API void
index 54c6320d2b6f6a08bc8fc2fe249f315bbde8cac8..7e22eafa8cc9cf25b2c9870a6ad44c42e5e3df0b 100644 (file)
@@ -7,6 +7,7 @@
 #include <errno.h>
 #include <mono/utils/mono-io-portability.h>
 #include <mono/metadata/profiler-private.h>
+#include <mono/utils/mono-compiler.h>
 
 #ifndef DISABLE_PORTABILITY
 
@@ -387,4 +388,9 @@ static inline gchar *mono_portability_find_file_internal (GString **report, cons
        g_free (new_pathname);
        return(NULL);
 }
-#endif
+
+#else /* DISABLE_PORTABILITY */
+
+MONO_EMPTY_SOURCE_FILE (mono_io_portability);
+
+#endif /* DISABLE_PORTABILITY */
index 4948b91b80fbd84435428d56098e47d751d3b2a0..bdb6dffb50e27f1838959452b585907afa062bbf 100644 (file)
@@ -26,6 +26,7 @@
 #include <process.h>
 #endif
 #include "mono-logger-internals.h"
+#include "mono-proclib.h"
 
 static FILE *logFile = NULL;
 static void *logUserData = NULL;
@@ -119,7 +120,7 @@ mono_log_write_logfile (const char *log_domain, GLogLevelFlags level, mono_bool
                struct tm *tod;
                time(&t);
                tod = localtime(&t);
-               pid = _getpid();
+               pid = mono_process_current_pid ();
                strftime(logTime, sizeof(logTime), "%F %T", tod);
 #endif
                fprintf (logFile, "%s level[%c] mono[%d]: %s\n", logTime, mapLogFileLevel (level), pid, message);
index f6cd987fbba85c31ebda11b966b220ef3067f7ac..ab5db470e1941f75bd2e712d119f979ffa6ff602 100644 (file)
@@ -24,6 +24,7 @@
 #include <time.h>
 #include <process.h>
 #include "mono-logger-internals.h"
+#include "mono-proclib.h"
 
 static FILE *logFile = NULL;
 static void *logUserData = NULL;
@@ -88,7 +89,7 @@ void
 mono_log_write_syslog(const char *domain, GLogLevelFlags level, mono_bool hdr, const char *message)
 {
        time_t t;
-       pid_t pid;
+       int pid;
        char logTime [80];
 
        if (logFile == NULL)
@@ -97,7 +98,7 @@ mono_log_write_syslog(const char *domain, GLogLevelFlags level, mono_bool hdr, c
        struct tm *tod;
        time(&t);
        tod = localtime(&t);
-       pid = _getpid();
+       pid = mono_process_current_pid ();
        strftime(logTime, sizeof(logTime), "%F %T", tod);
 
        fprintf (logFile, "%s level[%c] mono[%d]: %s\n", logTime, mapLogFileLevel (level), pid, message);
index b10ad2236ae86988690847952b78e67a7091fae0..d1e2599c30dd1e489a3cf8ff2884e09241d2b62f 100644 (file)
@@ -2,6 +2,7 @@
 #define __MONO_LOGGER_INTERNAL_H__
 
 #include <glib.h>
+#include <mono/utils/mono-compiler.h>
 #include "mono-logger.h"
 
 G_BEGIN_DECLS
@@ -74,8 +75,8 @@ mono_tracev (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_li
  * Traces a new message, depending on the current logging level
  * and trace mask.
  */
-G_GNUC_UNUSED static void
-mono_trace (GLogLevelFlags level, MonoTraceMask mask, const char *format, ...) 
+G_GNUC_UNUSED MONO_ATTR_FORMAT_PRINTF(3,4) static void
+mono_trace (GLogLevelFlags level, MonoTraceMask mask, const char *format, ...)
 {
        if(G_UNLIKELY (level <= mono_internal_current_level && mask & mono_internal_current_mask)) {
                va_list args;
index b4367a73367dc03ff57c2a4d76cbc6fab9d9b553..5cc59c77fbe6dd87bf56d097df56dc7380e9baf9 100644 (file)
@@ -291,7 +291,7 @@ mono_trace_set_mask_string (const char *value)
                        continue;
                }
                for (i = 0; valid_flags[i]; i++) {
-                       int len = strlen (valid_flags[i]);
+                       size_t len = strlen (valid_flags[i]);
                        if (strncmp (tok, valid_flags[i], len) == 0 && (tok[len] == 0 || tok[len] == ',')) {
                                flags |= valid_masks[i];
                                tok += len;
index faca70b8ca95e655d759182f8538356a5291a8e5..90695609f0875b608f7c6ad3069b970459e4e86c 100644 (file)
 
 #include "mono-compiler.h"
 
-int mono_pages_not_faulted (void *addr, size_t length);
+void *
+malloc_shared_area (int pid);
+
+char*
+aligned_address (char *mem, size_t size, size_t alignment);
+
+void
+account_mem (MonoMemAccountType type, ssize_t size);
+
+int
+mono_pages_not_faulted (void *addr, size_t length);
 
 #endif /* __MONO_UTILS_MMAP_INTERNAL_H__ */
 
diff --git a/mono/utils/mono-mmap-windows-internals.h b/mono/utils/mono-mmap-windows-internals.h
new file mode 100644 (file)
index 0000000..44da254
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef __MONO_UTILS_MMAP_WINDOWS_H__
+#define __MONO_UTILS_MMAP_WINDOWS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include "mono/utils/mono-mmap.h"
+#include "mono/utils/mono-mmap-internals.h"
+
+int
+mono_mmap_win_prot_from_flags (int flags);
+#endif /* HOST_WIN32 */
+#endif /* __MONO_UTILS_MMAP_WINDOWS_H__ */
+
diff --git a/mono/utils/mono-mmap-windows-uwp.c b/mono/utils/mono-mmap-windows-uwp.c
new file mode 100644 (file)
index 0000000..347fb70
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * mono-dl-windows-uwp.c: UWP dl support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include <mono/utils/mono-mmap-windows-internals.h>
+
+void*
+mono_file_map (size_t length, int flags, int fd, guint64 offset, void **ret_handle)
+{
+       void *ptr;
+       int mflags = 0;
+       HANDLE file, mapping;
+       int prot = mono_mmap_win_prot_from_flags (flags);
+
+       mflags = FILE_MAP_READ;
+       if (flags & MONO_MMAP_WRITE)
+               mflags = FILE_MAP_COPY;
+
+       file = (HANDLE) _get_osfhandle (fd);
+       mapping = CreateFileMappingFromApp (file, NULL, prot, length, NULL);
+
+       if (mapping == NULL)
+               return NULL;
+
+       ptr = MapViewOfFileFromApp (mapping, mflags, offset, length);
+
+       if (ptr == NULL) {
+               CloseHandle (mapping);
+               return NULL;
+       }
+
+       *ret_handle = (void*)mapping;
+       return ptr;
+}
+
+int
+mono_file_unmap (void *addr, void *handle)
+{
+       UnmapViewOfFile (addr);
+       CloseHandle ((HANDLE)handle);
+       return 0;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (mono_mmap_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/utils/mono-mmap-windows.c b/mono/utils/mono-mmap-windows.c
new file mode 100644 (file)
index 0000000..69619f8
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * mono-mmap-windows.c: Windows support for mapping code into the process address space
+ *
+ * Author:
+ *   Mono Team (mono-list@lists.ximian.com)
+ *
+ * Copyright 2001-2008 Novell, Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#if defined(HOST_WIN32)
+#include <windows.h>
+#include "mono/utils/mono-mmap-windows-internals.h"
+#include <mono/utils/mono-counters.h>
+#include <io.h>
+
+static void *malloced_shared_area = NULL;
+
+int
+mono_pagesize (void)
+{
+       SYSTEM_INFO info;
+       static int saved_pagesize = 0;
+       if (saved_pagesize)
+               return saved_pagesize;
+       GetSystemInfo (&info);
+       saved_pagesize = info.dwPageSize;
+       return saved_pagesize;
+}
+
+int
+mono_valloc_granule (void)
+{
+       SYSTEM_INFO info;
+       static int saved_valloc_granule = 0;
+       if (saved_valloc_granule)
+               return saved_valloc_granule;
+       GetSystemInfo (&info);
+       saved_valloc_granule = info.dwAllocationGranularity;
+       return saved_valloc_granule;
+}
+
+int
+mono_mmap_win_prot_from_flags (int flags)
+{
+       int prot = flags & (MONO_MMAP_READ|MONO_MMAP_WRITE|MONO_MMAP_EXEC);
+       switch (prot) {
+       case 0: prot = PAGE_NOACCESS; break;
+       case MONO_MMAP_READ: prot = PAGE_READONLY; break;
+       case MONO_MMAP_READ|MONO_MMAP_EXEC: prot = PAGE_EXECUTE_READ; break;
+       case MONO_MMAP_READ|MONO_MMAP_WRITE: prot = PAGE_READWRITE; break;
+       case MONO_MMAP_READ|MONO_MMAP_WRITE|MONO_MMAP_EXEC: prot = PAGE_EXECUTE_READWRITE; break;
+       case MONO_MMAP_WRITE: prot = PAGE_READWRITE; break;
+       case MONO_MMAP_WRITE|MONO_MMAP_EXEC: prot = PAGE_EXECUTE_READWRITE; break;
+       case MONO_MMAP_EXEC: prot = PAGE_EXECUTE; break;
+       default:
+               g_assert_not_reached ();
+       }
+       return prot;
+}
+
+void*
+mono_valloc (void *addr, size_t length, int flags, MonoMemAccountType type)
+{
+       void *ptr;
+       int mflags = MEM_RESERVE|MEM_COMMIT;
+       int prot = mono_mmap_win_prot_from_flags (flags);
+       /* translate the flags */
+
+       ptr = VirtualAlloc (addr, length, mflags, prot);
+
+       account_mem (type, (ssize_t)length);
+
+       return ptr;
+}
+
+void*
+mono_valloc_aligned (size_t length, size_t alignment, int flags, MonoMemAccountType type)
+{
+       int prot = mono_mmap_win_prot_from_flags (flags);
+       char *mem = VirtualAlloc (NULL, length + alignment, MEM_RESERVE, prot);
+       char *aligned;
+
+       if (!mem)
+               return NULL;
+
+       aligned = aligned_address (mem, length, alignment);
+
+       aligned = VirtualAlloc (aligned, length, MEM_COMMIT, prot);
+       g_assert (aligned);
+
+       account_mem (type, (ssize_t)length);
+
+       return aligned;
+}
+
+int
+mono_vfree (void *addr, size_t length, MonoMemAccountType type)
+{
+       MEMORY_BASIC_INFORMATION mbi;
+       SIZE_T query_result = VirtualQuery (addr, &mbi, sizeof (mbi));
+       BOOL res;
+
+       g_assert (query_result);
+
+       res = VirtualFree (mbi.AllocationBase, 0, MEM_RELEASE);
+
+       g_assert (res);
+
+       account_mem (type, -(ssize_t)length);
+
+       return 0;
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+void*
+mono_file_map (size_t length, int flags, int fd, guint64 offset, void **ret_handle)
+{
+       void *ptr;
+       int mflags = 0;
+       HANDLE file, mapping;
+       int prot = mono_mmap_win_prot_from_flags (flags);
+       /* translate the flags */
+       /*if (flags & MONO_MMAP_PRIVATE)
+               mflags |= MAP_PRIVATE;
+       if (flags & MONO_MMAP_SHARED)
+               mflags |= MAP_SHARED;
+       if (flags & MONO_MMAP_ANON)
+               mflags |= MAP_ANONYMOUS;
+       if (flags & MONO_MMAP_FIXED)
+               mflags |= MAP_FIXED;
+       if (flags & MONO_MMAP_32BIT)
+               mflags |= MAP_32BIT;*/
+
+       mflags = FILE_MAP_READ;
+       if (flags & MONO_MMAP_WRITE)
+               mflags = FILE_MAP_COPY;
+
+       file = (HANDLE) _get_osfhandle (fd);
+
+       mapping = CreateFileMapping (file, NULL, prot, 0, 0, NULL);
+
+       if (mapping == NULL)
+               return NULL;
+
+       ptr = MapViewOfFile (mapping, mflags, 0, offset, length);
+
+       if (ptr == NULL) {
+               CloseHandle (mapping);
+               return NULL;
+       }
+       *ret_handle = (void*)mapping;
+       return ptr;
+}
+
+int
+mono_file_unmap (void *addr, void *handle)
+{
+       UnmapViewOfFile (addr);
+       CloseHandle ((HANDLE)handle);
+       return 0;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+int
+mono_mprotect (void *addr, size_t length, int flags)
+{
+       DWORD oldprot;
+       int prot = mono_mmap_win_prot_from_flags (flags);
+
+       if (flags & MONO_MMAP_DISCARD) {
+               VirtualFree (addr, length, MEM_DECOMMIT);
+               VirtualAlloc (addr, length, MEM_COMMIT, prot);
+               return 0;
+       }
+       return VirtualProtect (addr, length, prot, &oldprot) == 0;
+}
+
+void*
+mono_shared_area (void)
+{
+       if (!malloced_shared_area)
+               malloced_shared_area = malloc_shared_area (0);
+       /* get the pid here */
+       return malloced_shared_area;
+}
+
+void
+mono_shared_area_remove (void)
+{
+       if (malloced_shared_area)
+               g_free (malloced_shared_area);
+       malloced_shared_area = NULL;
+}
+
+void*
+mono_shared_area_for_pid (void *pid)
+{
+       return NULL;
+}
+
+void
+mono_shared_area_unload (void *area)
+{
+}
+
+int
+mono_shared_area_instances (void **array, int count)
+{
+       return 0;
+}
+
+#endif
index 491318465faf804a0767d46b45b838d8020814b5..10a190ff9b059383a5705e6e0e5d765a79a7122d 100644 (file)
@@ -8,12 +8,9 @@
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
-#include "config.h"
+#include <config.h>
 
-#ifdef HOST_WIN32
-#include <windows.h>
-#include <io.h>
-#else
+#ifndef HOST_WIN32
 #include <sys/types.h>
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
@@ -29,7 +26,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
-#endif
+#endif /* !HOST_WIN32 */
 
 #include "mono-mmap.h"
 #include "mono-mmap-internals.h"
@@ -38,7 +35,6 @@
 #include <mono/utils/atomic.h>
 #include <mono/utils/mono-counters.h>
 
-
 #define BEGIN_CRITICAL_SECTION do { \
        MonoThreadInfo *__info = mono_thread_info_current_unchecked (); \
        if (__info) __info->inside_critical_region = TRUE;      \
@@ -63,9 +59,7 @@ typedef struct {
        short stats_end;
 } SAreaHeader;
 
-static void* malloced_shared_area = NULL;
-
-static void*
+void*
 malloc_shared_area (int pid)
 {
        int size = mono_pagesize ();
@@ -78,7 +72,7 @@ malloc_shared_area (int pid)
        return sarea;
 }
 
-static char*
+char*
 aligned_address (char *mem, size_t size, size_t alignment)
 {
        char *aligned = (char*)((size_t)(mem + (alignment - 1)) & ~(alignment - 1));
@@ -88,7 +82,7 @@ aligned_address (char *mem, size_t size, size_t alignment)
 
 static volatile size_t allocation_count [MONO_MEM_ACCOUNT_MAX];
 
-static void
+void
 account_mem (MonoMemAccountType type, ssize_t size)
 {
 #if SIZEOF_VOID_P == 4
@@ -135,186 +129,12 @@ mono_mem_account_register_counters (void)
 }
 
 #ifdef HOST_WIN32
-
-int
-mono_pagesize (void)
-{
-       SYSTEM_INFO info;
-       static int saved_pagesize = 0;
-       if (saved_pagesize)
-               return saved_pagesize;
-       GetSystemInfo (&info);
-       saved_pagesize = info.dwAllocationGranularity;
-       return saved_pagesize;
-}
-
-static int
-prot_from_flags (int flags)
-{
-       int prot = flags & (MONO_MMAP_READ|MONO_MMAP_WRITE|MONO_MMAP_EXEC);
-       switch (prot) {
-       case 0: prot = PAGE_NOACCESS; break;
-       case MONO_MMAP_READ: prot = PAGE_READONLY; break;
-       case MONO_MMAP_READ|MONO_MMAP_EXEC: prot = PAGE_EXECUTE_READ; break;
-       case MONO_MMAP_READ|MONO_MMAP_WRITE: prot = PAGE_READWRITE; break;
-       case MONO_MMAP_READ|MONO_MMAP_WRITE|MONO_MMAP_EXEC: prot = PAGE_EXECUTE_READWRITE; break;
-       case MONO_MMAP_WRITE: prot = PAGE_READWRITE; break;
-       case MONO_MMAP_WRITE|MONO_MMAP_EXEC: prot = PAGE_EXECUTE_READWRITE; break;
-       case MONO_MMAP_EXEC: prot = PAGE_EXECUTE; break;
-       default:
-               g_assert_not_reached ();
-       }
-       return prot;
-}
-
-void*
-mono_valloc (void *addr, size_t length, int flags, MonoMemAccountType type)
-{
-       void *ptr;
-       int mflags = MEM_RESERVE|MEM_COMMIT;
-       int prot = prot_from_flags (flags);
-       /* translate the flags */
-
-       ptr = VirtualAlloc (addr, length, mflags, prot);
-
-       account_mem (type, (ssize_t)length);
-
-       return ptr;
-}
-
-void*
-mono_valloc_aligned (size_t length, size_t alignment, int flags, MonoMemAccountType type)
-{
-       int prot = prot_from_flags (flags);
-       char *mem = VirtualAlloc (NULL, length + alignment, MEM_RESERVE, prot);
-       char *aligned;
-
-       if (!mem)
-               return NULL;
-
-       aligned = aligned_address (mem, length, alignment);
-
-       aligned = VirtualAlloc (aligned, length, MEM_COMMIT, prot);
-       g_assert (aligned);
-
-       account_mem (type, (ssize_t)length);
-
-       return aligned;
-}
-
+// Windows specific implementation in mono-mmap-windows.c
 #define HAVE_VALLOC_ALIGNED
 
-int
-mono_vfree (void *addr, size_t length, MonoMemAccountType type)
-{
-       MEMORY_BASIC_INFORMATION mbi;
-       SIZE_T query_result = VirtualQuery (addr, &mbi, sizeof (mbi));
-       BOOL res;
-
-       g_assert (query_result);
-
-       res = VirtualFree (mbi.AllocationBase, 0, MEM_RELEASE);
-
-       g_assert (res);
-
-       account_mem (type, -(ssize_t)length);
-
-       return 0;
-}
-
-void*
-mono_file_map (size_t length, int flags, int fd, guint64 offset, void **ret_handle)
-{
-       void *ptr;
-       int mflags = 0;
-       HANDLE file, mapping;
-       int prot = prot_from_flags (flags);
-       /* translate the flags */
-       /*if (flags & MONO_MMAP_PRIVATE)
-               mflags |= MAP_PRIVATE;
-       if (flags & MONO_MMAP_SHARED)
-               mflags |= MAP_SHARED;
-       if (flags & MONO_MMAP_ANON)
-               mflags |= MAP_ANONYMOUS;
-       if (flags & MONO_MMAP_FIXED)
-               mflags |= MAP_FIXED;
-       if (flags & MONO_MMAP_32BIT)
-               mflags |= MAP_32BIT;*/
-
-       mflags = FILE_MAP_READ;
-       if (flags & MONO_MMAP_WRITE)
-               mflags = FILE_MAP_COPY;
-
-       file = (HANDLE) _get_osfhandle (fd);
-       mapping = CreateFileMapping (file, NULL, prot, 0, 0, NULL);
-       if (mapping == NULL)
-               return NULL;
-       ptr = MapViewOfFile (mapping, mflags, 0, offset, length);
-       if (ptr == NULL) {
-               CloseHandle (mapping);
-               return NULL;
-       }
-       *ret_handle = (void*)mapping;
-       return ptr;
-}
-
-int
-mono_file_unmap (void *addr, void *handle)
-{
-       UnmapViewOfFile (addr);
-       CloseHandle ((HANDLE)handle);
-       return 0;
-}
-
-int
-mono_mprotect (void *addr, size_t length, int flags)
-{
-       DWORD oldprot;
-       int prot = prot_from_flags (flags);
-
-       if (flags & MONO_MMAP_DISCARD) {
-               VirtualFree (addr, length, MEM_DECOMMIT);
-               VirtualAlloc (addr, length, MEM_COMMIT, prot);
-               return 0;
-       }
-       return VirtualProtect (addr, length, prot, &oldprot) == 0;
-}
-
-void*
-mono_shared_area (void)
-{
-       if (!malloced_shared_area)
-               malloced_shared_area = malloc_shared_area (0);
-       /* get the pid here */
-       return malloced_shared_area;
-}
-
-void
-mono_shared_area_remove (void)
-{
-       if (malloced_shared_area)
-               g_free (malloced_shared_area);
-       malloced_shared_area = NULL;
-}
-
-void*
-mono_shared_area_for_pid (void *pid)
-{
-       return NULL;
-}
-
-void
-mono_shared_area_unload (void *area)
-{
-}
-
-int
-mono_shared_area_instances (void **array, int count)
-{
-       return 0;
-}
-
 #else
+
+static void* malloced_shared_area = NULL;
 #if defined(HAVE_MMAP)
 
 /**
@@ -335,6 +155,12 @@ mono_pagesize (void)
        return saved_pagesize;
 }
 
+int
+mono_valloc_granule (void)
+{
+       return mono_pagesize ();
+}
+
 static int
 prot_from_flags (int flags)
 {
@@ -544,6 +370,12 @@ mono_pagesize (void)
        return 4096;
 }
 
+int
+mono_valloc_granule (void)
+{
+       return mono_pagesize ();
+}
+
 void*
 mono_valloc (void *addr, size_t length, int flags, MonoMemAccountType type)
 {
index d441751c802da5bb60f36c29d638377b7f426c26..1b3b1d63af9fae39922ffe6aaceb51b3266bf3e6 100644 (file)
@@ -49,6 +49,7 @@ MONO_API int          mono_file_map_fd    (MonoFileMap *fmap);
 MONO_API int          mono_file_map_close (MonoFileMap *fmap);
 
 MONO_API int   mono_pagesize   (void);
+MONO_API int   mono_valloc_granule (void);
 MONO_API void* mono_valloc     (void *addr, size_t length, int flags, MonoMemAccountType type);
 MONO_API void* mono_valloc_aligned (size_t length, size_t alignment, int flags, MonoMemAccountType type);
 MONO_API int   mono_vfree      (void *addr, size_t length, MonoMemAccountType type);
index 9f59ce1ea821df2fa3dd849edd89d8e3a8b8aee7..c4bfe620f98edd116b07884e10c0f9b5ecae0922 100644 (file)
@@ -291,7 +291,12 @@ typedef HANDLE MonoSemType;
 static inline void
 mono_os_sem_init (MonoSemType *sem, int value)
 {
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
        *sem = CreateSemaphore (NULL, value, 0x7FFFFFFF, NULL);
+#else
+       *sem = CreateSemaphoreEx (NULL, value, 0x7FFFFFFF, NULL, 0, SEMAPHORE_ALL_ACCESS);
+#endif
+
        if (G_UNLIKELY (*sem == NULL))
                g_error ("%s: CreateSemaphore failed with error %d", __func__, GetLastError ());
 }
diff --git a/mono/utils/mono-proclib-windows-internals.h b/mono/utils/mono-proclib-windows-internals.h
new file mode 100644 (file)
index 0000000..f14c7a4
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __MONO_UTILS_PROCLIB_WINDOWS_H__
+#define __MONO_UTILS_PROCLIB_WINDOWS_H__
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include <process.h>
+#include "mono/utils/mono-proclib.h"
+
+#endif /* HOST_WIN32 */
+#endif /* __MONO_UTILS_PROCLIB_WINDOWS_H__ */
+
diff --git a/mono/utils/mono-proclib-windows-uwp.c b/mono/utils/mono-proclib-windows-uwp.c
new file mode 100644 (file)
index 0000000..4a2f37d
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * mono-proclib-windows-uwp.c: UWP proclib support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include <mono/utils/mono-proclib.h>
+
+gint32
+mono_cpu_usage (MonoCpuUsageState *prev)
+{
+       gint32 cpu_usage = 0;
+       gint64 cpu_total_time;
+       gint64 cpu_busy_time;
+       guint64 idle_time;
+       guint64 kernel_time;
+       guint64 user_time;
+       guint64 current_time;
+       guint64 creation_time;
+       guint64 exit_time;
+
+       GetSystemTimeAsFileTime ((FILETIME*)&current_time);
+       if (!GetProcessTimes (GetCurrentProcess (), (FILETIME*)&creation_time, (FILETIME*)&exit_time, (FILETIME*)&kernel_time, (FILETIME*)&user_time)) {
+               g_error ("GetProcessTimes() failed, error code is %d\n", GetLastError ());
+               return -1;
+       }
+
+       // GetProcessTimes user_time is a sum of user time spend by all threads in the process.
+       // This means that the total user time can be more than real time. In order to adjust for this
+       // the total available time that we can be scheduled depends on the number of available cores.
+       // For example, having 2 threads running 100% on a 2 core system for 100 ms will return a user_time of 200ms
+       // but the current_time - creation_time will only be 100ms but by adjusting the available time based on number of
+       // of availalbe cores will gives use the total load of the process.
+       guint64 total_available_time = (current_time - creation_time) * mono_cpu_count ();
+
+       idle_time = total_available_time - (kernel_time + user_time);
+
+       cpu_total_time = (gint64)((idle_time - (prev ? prev->idle_time : 0)) + (user_time - (prev ? prev->user_time : 0)) + (kernel_time - (prev ? prev->kernel_time : 0)));
+       cpu_busy_time = (gint64)(cpu_total_time - (idle_time - (prev ? prev->idle_time : 0)));
+
+       if (prev) {
+               prev->idle_time = idle_time;
+               prev->kernel_time = kernel_time;
+               prev->user_time = user_time;
+       }
+
+       if (cpu_total_time > 0 && cpu_busy_time > 0)
+               cpu_usage = (gint32)(cpu_busy_time * 100 / cpu_total_time);
+
+       return cpu_usage;
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (mono_proclib_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/utils/mono-proclib-windows.c b/mono/utils/mono-proclib-windows.c
new file mode 100644 (file)
index 0000000..6386a51
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * mono-proclib-windows.c: Windows proclib support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+#include <windows.h>
+#include "mono/utils/mono-proclib.h"
+
+int
+mono_process_current_pid ()
+{
+       return (int) GetCurrentProcessId ();
+}
+
+/**
+ * mono_cpu_count:
+ *
+ * Return the number of processors on the system.
+ */
+int
+mono_cpu_count (void)
+{
+       SYSTEM_INFO info;
+       GetSystemInfo (&info);
+       return info.dwNumberOfProcessors;
+}
+
+/*
+ * This function returns the cpu usage in percentage,
+ * normalized on the number of cores.
+ *
+ * Warning : the percentage returned can be > 100%. This
+ * might happens on systems like Android which, for
+ * battery and performance reasons, shut down cores and
+ * lie about the number of active cores.
+ */
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gint32
+mono_cpu_usage (MonoCpuUsageState *prev)
+{
+       gint32 cpu_usage = 0;
+       gint64 cpu_total_time;
+       gint64 cpu_busy_time;
+       guint64 idle_time;
+       guint64 kernel_time;
+       guint64 user_time;
+
+       if (!GetSystemTimes ((FILETIME*) &idle_time, (FILETIME*) &kernel_time, (FILETIME*) &user_time)) {
+               g_error ("GetSystemTimes() failed, error code is %d\n", GetLastError ());
+               return -1;
+       }
+
+       cpu_total_time = (gint64)((user_time - (prev ? prev->user_time : 0)) + (kernel_time - (prev ? prev->kernel_time : 0)));
+       cpu_busy_time = (gint64)(cpu_total_time - (idle_time - (prev ? prev->idle_time : 0)));
+
+       if (prev) {
+               prev->idle_time = idle_time;
+               prev->kernel_time = kernel_time;
+               prev->user_time = user_time;
+       }
+
+       if (cpu_total_time > 0 && cpu_busy_time > 0)
+               cpu_usage = (gint32)(cpu_busy_time * 100 / cpu_total_time);
+
+       return cpu_usage;
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+#endif /* HOST_WIN32*/
index 79da32b45118f4e6f992207c723ce14f880477c0..9c37ccf2ec11874e121c4a394e980461c8a3c9f3 100644 (file)
 #include <sched.h>
 #endif
 
-#ifdef HOST_WIN32
-#include <windows.h>
-#include <process.h>
-#endif
-
 #if defined(_POSIX_VERSION)
 #include <sys/errno.h>
 #include <sys/param.h>
@@ -187,7 +182,7 @@ get_pid_status_item_buf (int pid, const char *item, char *rbuf, int blen, MonoPr
        char buf [256];
        char *s;
        FILE *f;
-       int len = strlen (item);
+       size_t len = strlen (item);
 
        g_snprintf (buf, sizeof (buf), "/proc/%d/status", pid);
        f = fopen (buf, "r");
@@ -286,7 +281,7 @@ mono_process_get_name (gpointer pid, char *buf, int len)
        char fname [128];
        FILE *file;
        char *p;
-       int r;
+       size_t r;
        sprintf (fname, "/proc/%d/cmdline", GPOINTER_TO_INT (pid));
        buf [0] = 0;
        file = fopen (fname, "r");
@@ -443,7 +438,8 @@ get_process_stat_item (int pid, int pos, int sum, MonoProcessError *error)
        char buf [512];
        char *s, *end;
        FILE *f;
-       int len, i;
+       size_t len;
+       int i;
        gint64 value;
 
        g_snprintf (buf, sizeof (buf), "/proc/%d/stat", pid);
@@ -637,31 +633,27 @@ mono_process_get_data (gpointer pid, MonoProcessData data)
        return mono_process_get_data_with_error (pid, data, &error);
 }
 
+#ifndef HOST_WIN32
 int
 mono_process_current_pid ()
 {
 #if defined(HAVE_UNISTD_H)
        return (int) getpid ();
-#elif defined(HOST_WIN32)
-       return (int) GetCurrentProcessId ();
 #else
 #error getpid
 #endif
 }
+#endif /* !HOST_WIN32 */
 
 /**
  * mono_cpu_count:
  *
  * Return the number of processors on the system.
  */
+#ifndef HOST_WIN32
 int
 mono_cpu_count (void)
 {
-#ifdef HOST_WIN32
-       SYSTEM_INFO info;
-       GetSystemInfo (&info);
-       return info.dwNumberOfProcessors;
-#else
 #ifdef PLATFORM_ANDROID
        /* Android tries really hard to save power by powering off CPUs on SMP phones which
         * means the normal way to query cpu count returns a wrong value with userspace API.
@@ -779,10 +771,10 @@ mono_cpu_count (void)
                        return count;
        }
 #endif
-#endif /* HOST_WIN32 */
        /* FIXME: warn */
        return 1;
 }
+#endif /* !HOST_WIN32 */
 
 static void
 get_cpu_times (int cpu_id, gint64 *user, gint64 *systemt, gint64 *irq, gint64 *sirq, gint64 *idle)
@@ -889,14 +881,13 @@ mono_atexit (void (*func)(void))
  * battery and performance reasons, shut down cores and
  * lie about the number of active cores.
  */
+#ifndef HOST_WIN32
 gint32
 mono_cpu_usage (MonoCpuUsageState *prev)
 {
        gint32 cpu_usage = 0;
        gint64 cpu_total_time;
        gint64 cpu_busy_time;
-
-#ifndef HOST_WIN32
        struct rusage resource_usage;
        gint64 current_time;
        gint64 kernel_time;
@@ -919,28 +910,10 @@ mono_cpu_usage (MonoCpuUsageState *prev)
                prev->user_time = user_time;
                prev->current_time = current_time;
        }
-#else
-       guint64 idle_time;
-       guint64 kernel_time;
-       guint64 user_time;
-
-       if (!GetSystemTimes ((FILETIME*) &idle_time, (FILETIME*) &kernel_time, (FILETIME*) &user_time)) {
-               g_error ("GetSystemTimes() failed, error code is %d\n", GetLastError ());
-               return -1;
-       }
-
-       cpu_total_time = (gint64)((user_time - (prev ? prev->user_time : 0)) + (kernel_time - (prev ? prev->kernel_time : 0)));
-       cpu_busy_time = (gint64)(cpu_total_time - (idle_time - (prev ? prev->idle_time : 0)));
-
-       if (prev) {
-               prev->idle_time = idle_time;
-               prev->kernel_time = kernel_time;
-               prev->user_time = user_time;
-       }
-#endif
 
        if (cpu_total_time > 0 && cpu_busy_time > 0)
                cpu_usage = (gint32)(cpu_busy_time * 100 / cpu_total_time);
 
        return cpu_usage;
 }
+#endif /* !HOST_WIN32 */
index 89d4fb68b7590a565057dd42d4ca1844ac571340..e2614388ce96038ff74ab94e56bea381c128ee23 100644 (file)
@@ -116,6 +116,15 @@ mono_set_allocator_vtable (MonoAllocatorVTable* vtable);
 #define MONO_RT_EXTERNAL_ONLY
 #endif /* MONO_INSIDE_RUNTIME */
 
+#ifdef __GNUC__
+#define _MONO_DEPRECATED __attribute__ ((deprecated))
+#elif defined (_MSC_VER)
+#define _MONO_DEPRECATED __declspec (deprecated)
+#else
+#define _MONO_DEPRECATED
+#endif
+
+#define MONO_DEPRECATED MONO_API MONO_RT_EXTERNAL_ONLY _MONO_DEPRECATED
 
 MONO_END_DECLS
 
diff --git a/mono/utils/mono-rand-windows-internals.h b/mono/utils/mono-rand-windows-internals.h
new file mode 100644 (file)
index 0000000..f60c121
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef _MONO_UTILS_RAND_WINDOWS_H_
+#define _MONO_UTILS_RAND_WINDOWS_H_
+
+#include <config.h>
+#include <glib.h>
+
+#ifdef HOST_WIN32
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+#include <wincrypt.h>
+#define MONO_WIN32_CRYPT_PROVIDER_HANDLE HCRYPTPROV
+
+#else
+
+#include <bcrypt.h>
+#define MONO_WIN32_CRYPT_PROVIDER_HANDLE BCRYPT_ALG_HANDLE
+#endif
+
+MONO_WIN32_CRYPT_PROVIDER_HANDLE
+mono_rand_win_open_provider (void);
+
+gboolean
+mono_rand_win_gen (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider, guchar *buffer, size_t buffer_size);
+
+gboolean
+mono_rand_win_seed (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider, guchar *seed, size_t seed_size);
+
+void
+mono_rand_win_close_provider (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider);
+
+#endif /* HOST_WIN32 */
+#endif /* _MONO_UTILS_RAND_WINDOWS_H_ */
+
diff --git a/mono/utils/mono-rand-windows-uwp.c b/mono/utils/mono-rand-windows-uwp.c
new file mode 100644 (file)
index 0000000..7d92434
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * mono-rand-windows-uwp.c: UWP rand support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono/utils/mono-compiler.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
+#include <windows.h>
+#include "mono/utils/mono-rand-windows-internals.h"
+
+MONO_WIN32_CRYPT_PROVIDER_HANDLE
+mono_rand_win_open_provider (void)
+{
+       MONO_WIN32_CRYPT_PROVIDER_HANDLE provider = 0;
+
+       if (!BCRYPT_SUCCESS (BCryptOpenAlgorithmProvider (&provider, BCRYPT_RNG_ALGORITHM, NULL, 0)))
+               provider = 0;
+
+       return provider;
+}
+
+gboolean
+mono_rand_win_gen (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider, guchar *buffer, size_t buffer_size)
+{
+       g_assert (provider != 0 && buffer != 0);
+       return (BCRYPT_SUCCESS (BCryptGenRandom (provider, buffer, (ULONG) buffer_size, 0))) ? TRUE : FALSE;
+}
+
+gboolean
+mono_rand_win_seed (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider, guchar *seed, size_t seed_size)
+{
+       g_assert (provider != 0 && seed != 0);
+       return (BCRYPT_SUCCESS (BCryptGenRandom (provider, seed, (ULONG) seed_size, BCRYPT_RNG_USE_ENTROPY_IN_BUFFER))) ? TRUE : FALSE;
+}
+
+void
+mono_rand_win_close_provider (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider)
+{
+       g_assert (provider != 0);
+       BCryptCloseAlgorithmProvider (provider, 0);
+}
+
+#else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
+
+MONO_EMPTY_SOURCE_FILE (mono_rand_windows_uwp);
+#endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
diff --git a/mono/utils/mono-rand-windows.c b/mono/utils/mono-rand-windows.c
new file mode 100644 (file)
index 0000000..97f57ce
--- /dev/null
@@ -0,0 +1,172 @@
+/*
+ * mono-rand-windows.c: Windows rand support for Mono.
+ *
+ * Copyright 2016 Microsoft
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+*/
+#include <config.h>
+#include <glib.h>
+#include "mono-error.h"
+#include "mono-error-internals.h"
+#include "mono-rand.h"
+
+#if defined(HOST_WIN32)
+#include <windows.h>
+#include "mono/utils/mono-rand-windows-internals.h"
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+#ifndef PROV_INTEL_SEC
+#define PROV_INTEL_SEC         22
+#endif
+#ifndef CRYPT_VERIFY_CONTEXT
+#define CRYPT_VERIFY_CONTEXT   0xF0000000
+#endif
+
+MONO_WIN32_CRYPT_PROVIDER_HANDLE
+mono_rand_win_open_provider (void)
+{
+       MONO_WIN32_CRYPT_PROVIDER_HANDLE provider = 0;
+
+       /* There is no need to create a container for just random data,
+        * so we can use CRYPT_VERIFY_CONTEXT (one call) see:
+        * http://blogs.msdn.com/dangriff/archive/2003/11/19/51709.aspx */
+
+       /* We first try to use the Intel PIII RNG if drivers are present */
+       if (!CryptAcquireContext (&provider, NULL, NULL, PROV_INTEL_SEC, CRYPT_VERIFY_CONTEXT)) {
+               /* not a PIII or no drivers available, use default RSA CSP */
+               if (!CryptAcquireContext (&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFY_CONTEXT)) {
+                       /* exception will be thrown in managed code */
+                       provider = 0;
+               }
+       }
+
+       return provider;
+}
+
+void
+mono_rand_win_close_provider (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider)
+{
+       CryptReleaseContext (provider, 0);
+}
+
+gboolean
+mono_rand_win_gen (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider, guchar *buffer, size_t buffer_size)
+{
+       return CryptGenRandom (provider, (DWORD) buffer_size, buffer);
+}
+
+gboolean
+mono_rand_win_seed (MONO_WIN32_CRYPT_PROVIDER_HANDLE provider, guchar *seed, size_t seed_size)
+{
+       /* add seeding material to the RNG */
+       return CryptGenRandom (provider, (DWORD) seed_size, seed);
+}
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+/**
+ * mono_rand_open:
+ *
+ * Returns: True if random source is global, false if mono_rand_init can be called repeatedly to get randomness instances.
+ *
+ * Initializes entire RNG system. Must be called once per process before calling mono_rand_init.
+ */
+gboolean
+mono_rand_open (void)
+{
+       return FALSE;
+}
+
+/**
+ * mono_rand_init:
+ * @seed: A string containing seed data
+ * @seed_size: Length of seed string
+ *
+ * Returns: On success, a non-NULL handle which can be used to fetch random data from mono_rand_try_get_bytes. On failure, NULL.
+ *
+ * Initializes an RNG client.
+ */
+gpointer
+mono_rand_init (guchar *seed, gint seed_size)
+{
+       MONO_WIN32_CRYPT_PROVIDER_HANDLE provider = 0;
+
+       /* try to open crypto provider. */
+       provider = mono_rand_win_open_provider ();
+
+       /* seed the CSP with the supplied buffer (if present) */
+       if (provider != 0 && seed != NULL) {
+               /* the call we replace the seed with random - this isn't what is
+                * expected from the class library user */
+               guchar *data = g_malloc (seed_size);
+               if (data != NULL) {
+                       memcpy (data, seed, seed_size);
+                       /* add seeding material to the RNG */
+                       mono_rand_win_seed (provider, data, seed_size);
+                       /* zeroize and free */
+                       memset (data, 0, seed_size);
+                       g_free (data);
+               }
+       }
+
+       return (gpointer) provider;
+}
+
+/**
+ * mono_rand_try_get_bytes:
+ * @handle: A pointer to an RNG handle. Handle is set to NULL on failure.
+ * @buffer: A buffer into which to write random data.
+ * @buffer_size: Number of bytes to write into buffer.
+ * @error: Set on error.
+ *
+ * Returns: FALSE on failure and sets @error, TRUE on success.
+ *
+ * Extracts bytes from an RNG handle.
+ */
+gboolean
+mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gint buffer_size, MonoError *error)
+{
+       MONO_WIN32_CRYPT_PROVIDER_HANDLE provider;
+
+       mono_error_init (error);
+
+       g_assert (handle);
+       provider = (MONO_WIN32_CRYPT_PROVIDER_HANDLE) *handle;
+
+       /* generate random bytes */
+       if (!mono_rand_win_gen (provider, buffer, buffer_size)) {
+               mono_rand_win_close_provider (provider);
+               /* we may have lost our context with CryptoAPI, but all hope isn't lost yet! */
+               provider = mono_rand_win_open_provider ();
+               if (provider != 0) {
+
+                       /* retry generate of random bytes */
+                       if (!mono_rand_win_gen (provider, buffer, buffer_size)) {
+                               /* failure, close provider */
+                               mono_rand_win_close_provider (provider);
+                               provider = 0;
+                       }
+               }
+
+               /* make sure client gets new opened provider handle or NULL on failure */
+               *handle = (gpointer) provider;
+               if (*handle == 0) {
+                       /* exception will be thrown in managed code */
+                       mono_error_set_execution_engine (error, "Failed to gen random bytes (%d)", GetLastError ());
+                       return FALSE;
+               }
+       }
+       return TRUE;
+}
+
+/**
+ * mono_rand_close:
+ * @handle: An RNG handle.
+ *
+ * Releases an RNG handle.
+ */
+void
+mono_rand_close (gpointer handle)
+{
+       mono_rand_win_close_provider ((MONO_WIN32_CRYPT_PROVIDER_HANDLE) handle);
+}
+#endif /* HOST_WIN32 */
index 0e5a85384705341e3c5233e0db110fae07201803..1ac91179382d2ffb4ee7f5e826bca141e7cc4bb5 100644 (file)
@@ -13,7 +13,6 @@
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
-
 #include <glib.h>
 #include <config.h>
 
 #include "metadata/object.h"
 
 #ifdef HOST_WIN32
-
-#include <windows.h>
-#include <wincrypt.h>
-
-#ifndef PROV_INTEL_SEC
-#define PROV_INTEL_SEC         22
-#endif
-#ifndef CRYPT_VERIFY_CONTEXT
-#define CRYPT_VERIFY_CONTEXT   0xF0000000
-#endif
-
-/**
- * mono_rand_open:
- *
- * Returns: True if random source is global, false if mono_rand_init can be called repeatedly to get randomness instances.
- *
- * Initializes entire RNG system. Must be called once per process before calling mono_rand_init.
- */
-gboolean
-mono_rand_open (void)
-{
-       return FALSE;
-}
-
-/**
- * mono_rand_init:
- * @seed: A string containing seed data
- * @seed_size: Length of seed string
- *
- * Returns: On success, a non-NULL handle which can be used to fetch random data from mono_rand_try_get_bytes. On failure, NULL.
- *
- * Initializes an RNG client.
- */
-gpointer
-mono_rand_init (guchar *seed, gint seed_size)
-{
-       HCRYPTPROV provider = 0;
-
-       /* There is no need to create a container for just random data,
-        * so we can use CRYPT_VERIFY_CONTEXT (one call) see: 
-        * http://blogs.msdn.com/dangriff/archive/2003/11/19/51709.aspx */
-
-       /* We first try to use the Intel PIII RNG if drivers are present */
-       if (!CryptAcquireContext (&provider, NULL, NULL, PROV_INTEL_SEC, CRYPT_VERIFY_CONTEXT)) {
-               /* not a PIII or no drivers available, use default RSA CSP */
-               if (!CryptAcquireContext (&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFY_CONTEXT)) {
-                       /* exception will be thrown in managed code */
-                       provider = 0;
-               }
-       }
-
-       /* seed the CSP with the supplied buffer (if present) */
-       if (provider != 0 && seed) {
-               /* the call we replace the seed with random - this isn't what is
-                * expected from the class library user */
-               guchar *data = g_malloc (seed_size);
-               if (data) {
-                       memcpy (data, seed, seed_size);
-                       /* add seeding material to the RNG */
-                       CryptGenRandom (provider, seed_size, data);
-                       /* zeroize and free */
-                       memset (data, 0, seed_size);
-                       g_free (data);
-               }
-       }
-
-       return (gpointer) provider;
-}
-
-/**
- * mono_rand_try_get_bytes:
- * @handle: A pointer to an RNG handle. Handle is set to NULL on failure.
- * @buffer: A buffer into which to write random data.
- * @buffer_size: Number of bytes to write into buffer.
- * @error: Set on error.
- *
- * Returns: FALSE on failure and sets @error, TRUE on success.
- *
- * Extracts bytes from an RNG handle.
- */
-gboolean
-mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gint buffer_size, MonoError *error)
-{
-       HCRYPTPROV provider;
-
-       mono_error_init (error);
-
-       g_assert (handle);
-       provider = (HCRYPTPROV) *handle;
-
-       if (!CryptGenRandom (provider, buffer_size, buffer)) {
-               CryptReleaseContext (provider, 0);
-               /* we may have lost our context with CryptoAPI, but all hope isn't lost yet! */
-               provider = (HCRYPTPROV) mono_rand_init (NULL, 0);
-               if (!CryptGenRandom (provider, buffer_size, buffer)) {
-                       /* exception will be thrown in managed code */
-                       CryptReleaseContext (provider, 0);
-                       *handle = 0;
-                       mono_error_set_execution_engine (error, "Failed to gen random bytes (%d)", GetLastError ());
-                       return FALSE;
-               }
-       }
-       return TRUE;
-}
-
-/**
- * mono_rand_close:
- * @handle: An RNG handle.
- * @buffer: A buffer into which to write random data.
- * @buffer_size: Number of bytes to write into buffer.
- *
- * Releases an RNG handle.
- */
-void
-mono_rand_close (gpointer handle)
-{
-       CryptReleaseContext ((HCRYPTPROV) handle, 0);
-}
-
+// Windows specific implementation in mono-rand-windows.c
 #elif defined (HAVE_SYS_UN_H) && !defined(__native_client__)
 
 #include <errno.h>
index 3c2f79b58c37e99ac92e90325b6f603118182aaa..643bb4d7709a9f7299bd8b039e7665d6e058921c 100644 (file)
@@ -173,6 +173,23 @@ typedef struct ucontext {
        #define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r13)
        #define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r14)
        #define UCONTEXT_REG_R15(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r15)
+       #define UCONTEXT_REG_XMM
+       #define UCONTEXT_REG_XMM0(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm0)
+       #define UCONTEXT_REG_XMM1(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm1)
+       #define UCONTEXT_REG_XMM2(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm2)
+       #define UCONTEXT_REG_XMM3(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm3)
+       #define UCONTEXT_REG_XMM4(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm4)
+       #define UCONTEXT_REG_XMM5(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm5)
+       #define UCONTEXT_REG_XMM6(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm6)
+       #define UCONTEXT_REG_XMM7(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm7)
+       #define UCONTEXT_REG_XMM8(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm8)
+       #define UCONTEXT_REG_XMM9(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm9)
+       #define UCONTEXT_REG_XMM10(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm10)
+       #define UCONTEXT_REG_XMM11(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm11)
+       #define UCONTEXT_REG_XMM12(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm12)
+       #define UCONTEXT_REG_XMM13(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm13)
+       #define UCONTEXT_REG_XMM14(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm14)
+       #define UCONTEXT_REG_XMM15(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm15)
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
        #define UCONTEXT_REG_RAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rax)
        #define UCONTEXT_REG_RBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rbx)
@@ -229,7 +246,7 @@ typedef struct ucontext {
        #define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->sc_r14)
        #define UCONTEXT_REG_R15(ctx) (((ucontext_t*)(ctx))->sc_r15)
 #elif !defined(HOST_WIN32)
-#define UCONTEXT_GREGS(ctx)    ((guint64*)&(((ucontext_t*)(ctx))->uc_mcontext.gregs))
+       #define UCONTEXT_GREGS(ctx)     ((guint64*)&(((ucontext_t*)(ctx))->uc_mcontext.gregs))
 #endif
 
 #ifdef UCONTEXT_GREGS
index 9bfbdc51682b2db4fa1b2f94e30a6028ae7e2764..7f2748536830157d0179423a510f6c7e21e9b6da 100644 (file)
@@ -27,6 +27,7 @@
 #include <mono/utils/mono-threads-coop.h>
 #include <mono/utils/mono-threads-api.h>
 #include <mono/utils/checked-build.h>
+#include <mono/utils/mono-threads-debug.h>
 
 #ifdef TARGET_OSX
 #include <mono/utils/mach-support.h>
@@ -70,7 +71,7 @@ coop_tls_pop (gpointer received_cookie)
 
        stack = mono_native_tls_get_value (coop_reset_count_stack_key);
        if (!stack || 0 == stack->len)
-               mono_fatal_with_history ("Received cookie %p but found no stack at all, %x\n", received_cookie);
+               mono_fatal_with_history ("Received cookie %p but found no stack at all\n", received_cookie);
 
        expected_cookie = g_array_index (stack, gpointer, stack->len - 1);
        stack->len --;
@@ -134,7 +135,7 @@ mono_threads_state_poll_with_info (MonoThreadInfo *info)
        /* commit the saved state and notify others if needed */
        switch (mono_threads_transition_state_poll (info)) {
        case SelfSuspendResumed:
-               return;
+               break;
        case SelfSuspendWait:
                mono_thread_info_wait_for_resume (info);
                break;
@@ -143,6 +144,12 @@ mono_threads_state_poll_with_info (MonoThreadInfo *info)
                mono_thread_info_wait_for_resume (info);
                break;
        }
+
+       if (info->async_target) {
+               info->async_target (info->user_data);
+               info->async_target = NULL;
+               info->user_data = NULL;
+       }
 }
 
 static volatile gpointer* dummy_global;
diff --git a/mono/utils/mono-threads-debug.h b/mono/utils/mono-threads-debug.h
new file mode 100644 (file)
index 0000000..750d53d
--- /dev/null
@@ -0,0 +1,42 @@
+
+#ifndef __MONO_UTILS_MONO_THREADS_DEBUG_H__
+#define __MONO_UTILS_MONO_THREADS_DEBUG_H__
+
+/* Logging - enable them below if you need specific logging for the category you need */
+#define MOSTLY_ASYNC_SAFE_PRINTF(...) do { \
+       char __buff[1024];      __buff [0] = '\0'; \
+       g_snprintf (__buff, sizeof (__buff), __VA_ARGS__);      \
+       write (1, __buff, strlen (__buff));     \
+} while (0)
+
+#if 1
+#define THREADS_DEBUG(...)
+#else
+#define THREADS_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#if 1
+#define THREADS_STW_DEBUG(...)
+#else
+#define THREADS_STW_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#if 1
+#define THREADS_SUSPEND_DEBUG(...)
+#else
+#define THREADS_SUSPEND_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#if 1
+#define THREADS_STATE_MACHINE_DEBUG(...)
+#else
+#define THREADS_STATE_MACHINE_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#if 1
+#define THREADS_INTERRUPT_DEBUG(...)
+#else
+#define THREADS_INTERRUPT_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#endif /* __MONO_UTILS_MONO_THREADS_DEBUG_H__ */
diff --git a/mono/utils/mono-threads-mach-abort-syscall.c b/mono/utils/mono-threads-mach-abort-syscall.c
deleted file mode 100644 (file)
index eb43625..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * mono-threads-mach-abort-syscall.c: Low-level syscall aborting
- *
- * Author:
- *     Ludovic Henry (ludovic@xamarin.com)
- *
- * (C) 2015 Xamarin, Inc
- */
-
-#include "config.h"
-#include <glib.h>
-
-#if defined (__MACH__)
-#define _DARWIN_C_SOURCE 1
-#endif
-
-#include <mono/utils/mono-threads.h>
-
-#if defined(USE_MACH_BACKEND)
-
-#if defined(HOST_WATCHOS) || defined(HOST_TVOS)
-
-void
-mono_threads_abort_syscall_init (void)
-{
-}
-
-void
-mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
-{
-
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return FALSE;
-}
-
-#else
-
-void
-mono_threads_abort_syscall_init (void)
-{
-}
-
-void
-mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
-{
-       kern_return_t ret;
-
-       do {
-               ret = thread_suspend (info->native_handle);
-       } while (ret == KERN_ABORTED);
-
-       if (ret != KERN_SUCCESS)
-               return;
-
-       do {
-               ret = thread_abort_safely (info->native_handle);
-       } while (ret == KERN_ABORTED);
-
-       /*
-        * We are doing thread_abort when thread_abort_safely returns KERN_SUCCESS because
-        * for some reason accept is not interrupted by thread_abort_safely.
-        * The risk of aborting non-atomic operations while calling thread_abort should not
-        * exist because by the time thread_abort_safely returns KERN_SUCCESS the target
-        * thread should have return from the kernel and should be waiting for thread_resume
-        * to resume the user code.
-        */
-       if (ret == KERN_SUCCESS)
-               ret = thread_abort (info->native_handle);
-
-       do {
-               ret = thread_resume (info->native_handle);
-       } while (ret == KERN_ABORTED);
-
-       g_assert (ret == KERN_SUCCESS);
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return TRUE;
-}
-
-#endif
-
-#endif
index 948804243ccc61d2f9a43420d7c4e806e300056f..fdf18bb1891eeb47c08ec7e6176341912fe57b03 100644 (file)
@@ -23,6 +23,7 @@
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/hazard-pointer.h>
+#include <mono/utils/mono-threads-debug.h>
 
 void
 mono_threads_suspend_init (void)
@@ -50,6 +51,18 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
        g_assert_not_reached ();
 }
 
+void
+mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
+{
+       g_assert_not_reached ();
+}
+
+gboolean
+mono_threads_suspend_needs_abort_syscall (void)
+{
+       return FALSE;
+}
+
 #else /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
 
 gboolean
@@ -81,14 +94,14 @@ mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interru
        }
        info->suspend_can_continue = mono_threads_get_runtime_callbacks ()->
                thread_state_init_from_handle (&info->thread_saved_state [ASYNC_SUSPEND_STATE_INDEX], info);
-       THREADS_SUSPEND_DEBUG ("thread state %p -> %d\n", (gpointer)(gsize)info->native_handle, res);
+       THREADS_SUSPEND_DEBUG ("thread state %p -> %d\n", (gpointer)(gsize)info->native_handle, ret);
        if (info->suspend_can_continue) {
                if (interrupt_kernel)
                        thread_abort (info->native_handle);
        } else {
                THREADS_SUSPEND_DEBUG ("FAILSAFE RESUME/2 %p -> %d\n", (gpointer)(gsize)info->native_handle, 0);
        }
-       return info->suspend_can_continue;
+       return TRUE;
 }
 
 gboolean
@@ -104,8 +117,8 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
 
        if (info->async_target) {
                MonoContext tmp = info->thread_saved_state [ASYNC_SUSPEND_STATE_INDEX].ctx;
-               mach_msg_type_number_t num_state;
-               thread_state_t state;
+               mach_msg_type_number_t num_state, num_fpstate;
+               thread_state_t state, fpstate;
                ucontext_t uctx;
                mcontext_t mctx;
 
@@ -114,23 +127,24 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
                info->async_target = (void (*)(void *)) info->user_data;
 
                state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
+               fpstate = (thread_state_t) alloca (mono_mach_arch_get_thread_fpstate_size ());
                mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
 
                do {
-                       ret = mono_mach_arch_get_thread_state (info->native_handle, state, &num_state);
+                       ret = mono_mach_arch_get_thread_states (info->native_handle, state, &num_state, fpstate, &num_fpstate);
                } while (ret == KERN_ABORTED);
 
                if (ret != KERN_SUCCESS)
                        return FALSE;
 
-               mono_mach_arch_thread_state_to_mcontext (state, mctx);
+               mono_mach_arch_thread_states_to_mcontext (state, fpstate, mctx);
                uctx.uc_mcontext = mctx;
                mono_monoctx_to_sigctx (&tmp, &uctx);
 
-               mono_mach_arch_mcontext_to_thread_state (mctx, state);
+               mono_mach_arch_mcontext_to_thread_states (mctx, state, fpstate);
 
                do {
-                       ret = mono_mach_arch_set_thread_state (info->native_handle, state, num_state);
+                       ret = mono_mach_arch_set_thread_states (info->native_handle, state, num_state, fpstate, num_fpstate);
                } while (ret == KERN_ABORTED);
 
                if (ret != KERN_SUCCESS)
@@ -145,6 +159,46 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
        return ret == KERN_SUCCESS;
 }
 
+void
+mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
+{
+       kern_return_t ret;
+
+       do {
+               ret = thread_suspend (info->native_handle);
+       } while (ret == KERN_ABORTED);
+
+       if (ret != KERN_SUCCESS)
+               return;
+
+       do {
+               ret = thread_abort_safely (info->native_handle);
+       } while (ret == KERN_ABORTED);
+
+       /*
+        * We are doing thread_abort when thread_abort_safely returns KERN_SUCCESS because
+        * for some reason accept is not interrupted by thread_abort_safely.
+        * The risk of aborting non-atomic operations while calling thread_abort should not
+        * exist because by the time thread_abort_safely returns KERN_SUCCESS the target
+        * thread should have return from the kernel and should be waiting for thread_resume
+        * to resume the user code.
+        */
+       if (ret == KERN_SUCCESS)
+               ret = thread_abort (info->native_handle);
+
+       do {
+               ret = thread_resume (info->native_handle);
+       } while (ret == KERN_ABORTED);
+
+       g_assert (ret == KERN_SUCCESS);
+}
+
+gboolean
+mono_threads_suspend_needs_abort_syscall (void)
+{
+       return TRUE;
+}
+
 #endif /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
 
 void
@@ -166,6 +220,35 @@ mono_threads_suspend_free (MonoThreadInfo *info)
        mach_port_deallocate (current_task (), info->native_handle);
 }
 
+void
+mono_threads_suspend_init_signals (void)
+{
+}
+
+gint
+mono_threads_suspend_search_alternative_signal (void)
+{
+       g_assert_not_reached ();
+}
+
+gint
+mono_threads_suspend_get_suspend_signal (void)
+{
+       return -1;
+}
+
+gint
+mono_threads_suspend_get_restart_signal (void)
+{
+       return -1;
+}
+
+gint
+mono_threads_suspend_get_abort_signal (void)
+{
+       return -1;
+}
+
 #endif /* USE_MACH_BACKEND */
 
 #ifdef __MACH__
diff --git a/mono/utils/mono-threads-posix-abort-syscall.c b/mono/utils/mono-threads-posix-abort-syscall.c
deleted file mode 100644 (file)
index 232161c..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * mono-threads-posix-abort-syscall.c: Low-level syscall aborting
- *
- * Author:
- *     Ludovic Henry (ludovic@xamarin.com)
- *
- * (C) 2015 Xamarin, Inc
- */
-
-#include "config.h"
-#include <glib.h>
-
-#if defined (__MACH__)
-#define _DARWIN_C_SOURCE 1
-#endif
-
-#include "mono-threads.h"
-#include "mono-threads-posix-signals.h"
-
-#if defined(USE_POSIX_BACKEND)
-
-void
-mono_threads_abort_syscall_init (void)
-{
-       mono_threads_posix_init_signals (MONO_THREADS_POSIX_INIT_SIGNALS_ABORT);
-}
-
-void
-mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
-{
-       /* We signal a thread to break it from the current syscall.
-        * This signal should not be interpreted as a suspend request. */
-       info->syscall_break_signal = TRUE;
-       if (!mono_threads_pthread_kill (info, mono_threads_posix_get_abort_signal ()))
-               mono_threads_add_to_pending_operation_set (info);
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return TRUE;
-}
-
-#endif
index c1b67330fb566d54589fc7bf849770295007bff0..0c8e6b462b187f14f9a02dba0918722e0e2c54a5 100644 (file)
@@ -17,7 +17,7 @@
 #include <errno.h>
 #include <signal.h>
 
-#include "mono-threads-posix-signals.h"
+#include "mono-threads-debug.h"
 
 #if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define DEFAULT_SUSPEND_SIGNAL SIGXFSZ
 #endif
 #define DEFAULT_RESTART_SIGNAL SIGXCPU
 
-static int suspend_signal_num;
-static int restart_signal_num;
 static int abort_signal_num;
 
 static sigset_t suspend_signal_mask;
 static sigset_t suspend_ack_signal_mask;
 
-//Can't avoid the circular dep on this. Will be gone pretty soon
-extern int mono_gc_get_suspend_signal (void);
-
-int
-mono_threads_posix_signal_search_alternative (int min_signal)
+gint
+mono_threads_suspend_search_alternative_signal (void)
 {
 #if !defined (SIGRTMIN)
        g_error ("signal search only works with RTMIN");
 #else
        int i;
        /* we try to avoid SIGRTMIN and any one that might have been set already, see bug #75387 */
-       for (i = MAX (min_signal, SIGRTMIN) + 1; i < SIGRTMAX; ++i) {
+       for (i = SIGRTMIN + 1; i < SIGRTMAX; ++i) {
                struct sigaction sinfo;
                sigaction (i, NULL, &sinfo);
                if (sinfo.sa_handler == SIG_DFL && (void*)sinfo.sa_sigaction == (void*)SIG_DFL) {
@@ -58,7 +53,9 @@ mono_threads_posix_signal_search_alternative (int min_signal)
 static void
 signal_add_handler (int signo, gpointer handler, int flags)
 {
-#if !defined(__native_client__)
+#if defined(__native_client__)
+       g_assert_not_reached ();
+#else
        /*FIXME, move the code from mini to utils and do the right thing!*/
        struct sigaction sa;
        struct sigaction previous_sa;
@@ -74,62 +71,21 @@ signal_add_handler (int signo, gpointer handler, int flags)
 #endif
 }
 
-static int
-suspend_signal_get (void)
-{
-#if defined(PLATFORM_ANDROID)
-       return SIGUNUSED;
-#elif !defined (SIGRTMIN)
-#ifdef SIGUSR1
-       return SIGUSR1;
-#else
-       return -1;
-#endif /* SIGUSR1 */
-#else
-       static int suspend_signum = -1;
-       if (suspend_signum == -1)
-               suspend_signum = mono_threads_posix_signal_search_alternative (-1);
-       return suspend_signum;
-#endif /* SIGRTMIN */
-}
-
-static int
-restart_signal_get (void)
-{
-#if defined(PLATFORM_ANDROID)
-       return SIGTTOU;
-#elif !defined (SIGRTMIN)
-#ifdef SIGUSR2
-       return SIGUSR2;
-#else
-       return -1;
-#endif /* SIGUSR1 */
-#else
-       static int resume_signum = -1;
-       if (resume_signum == -1)
-               resume_signum = mono_threads_posix_signal_search_alternative (suspend_signal_get () + 1);
-       return resume_signum;
-#endif /* SIGRTMIN */
-}
-
-
 static int
 abort_signal_get (void)
 {
 #if defined(PLATFORM_ANDROID)
        return SIGTTIN;
-#elif !defined (SIGRTMIN)
-#ifdef SIGTTIN
-       return SIGTTIN;
-#else
-       return -1;
-#endif /* SIGRTMIN */
-#else
+#elif defined (SIGRTMIN)
        static int abort_signum = -1;
        if (abort_signum == -1)
-               abort_signum = mono_threads_posix_signal_search_alternative (restart_signal_get () + 1);
+               abort_signum = mono_threads_suspend_search_alternative_signal ();
        return abort_signum;
-#endif /* SIGRTMIN */
+#elif defined (SIGTTIN)
+       return SIGTTIN;
+#else
+       return -1;
+#endif
 }
 
 static void
@@ -142,7 +98,7 @@ restart_signal_handler (int _dummy, siginfo_t *_info, void *context)
        int old_errno = errno;
 
        info = mono_thread_info_current ();
-       info->signal = restart_signal_num;
+       info->signal = DEFAULT_RESTART_SIGNAL;
        errno = old_errno;
 #endif
 }
@@ -206,7 +162,7 @@ suspend_signal_handler (int _dummy, siginfo_t *info, void *context)
        do {
                current->signal = 0;
                sigsuspend (&suspend_signal_mask);
-       } while (current->signal != restart_signal_num);
+       } while (current->signal != DEFAULT_RESTART_SIGNAL);
 
        /* Unblock the restart signal. */
        pthread_sigmask (SIG_UNBLOCK, &suspend_ack_signal_mask, NULL);
@@ -232,81 +188,52 @@ done:
 #endif
 }
 
-static void
-abort_signal_handler (int _dummy, siginfo_t *info, void *context)
-{
-#if defined(__native_client__)
-       g_assert_not_reached ();
-#else
-       suspend_signal_handler (_dummy, info, context);
-#endif
-}
-
 void
-mono_threads_posix_init_signals (MonoThreadPosixInitSignals signals)
+mono_threads_suspend_init_signals (void)
 {
        sigset_t signal_set;
 
-       g_assert ((signals == MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART) ^ (signals == MONO_THREADS_POSIX_INIT_SIGNALS_ABORT));
-
        sigemptyset (&signal_set);
 
-       switch (signals) {
-       case MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART: {
-               if (mono_thread_info_unified_management_enabled ()) {
-                       suspend_signal_num = DEFAULT_SUSPEND_SIGNAL;
-                       restart_signal_num = DEFAULT_RESTART_SIGNAL;
-               } else {
-                       suspend_signal_num = suspend_signal_get ();
-                       restart_signal_num = restart_signal_get ();
-               }
+       sigfillset (&suspend_signal_mask);
+       sigdelset (&suspend_signal_mask, DEFAULT_RESTART_SIGNAL);
 
-               sigfillset (&suspend_signal_mask);
-               sigdelset (&suspend_signal_mask, restart_signal_num);
-               if (!mono_thread_info_unified_management_enabled ())
-                       sigdelset (&suspend_signal_mask, mono_gc_get_suspend_signal ());
+       sigemptyset (&suspend_ack_signal_mask);
+       sigaddset (&suspend_ack_signal_mask, DEFAULT_RESTART_SIGNAL);
 
-               sigemptyset (&suspend_ack_signal_mask);
-               sigaddset (&suspend_ack_signal_mask, restart_signal_num);
+       signal_add_handler (DEFAULT_SUSPEND_SIGNAL, suspend_signal_handler, SA_RESTART);
+       signal_add_handler (DEFAULT_RESTART_SIGNAL, restart_signal_handler, SA_RESTART);
 
-               signal_add_handler (suspend_signal_num, suspend_signal_handler, SA_RESTART);
-               signal_add_handler (restart_signal_num, restart_signal_handler, SA_RESTART);
+       sigaddset (&signal_set, DEFAULT_SUSPEND_SIGNAL);
+       sigaddset (&signal_set, DEFAULT_RESTART_SIGNAL);
 
-               sigaddset (&signal_set, suspend_signal_num);
-               sigaddset (&signal_set, restart_signal_num);
+       abort_signal_num = abort_signal_get ();
 
-               break;
-       }
-       case MONO_THREADS_POSIX_INIT_SIGNALS_ABORT: {
-               abort_signal_num = abort_signal_get ();
-
-               signal_add_handler (abort_signal_num, abort_signal_handler, 0);
-
-               sigaddset (&signal_set, abort_signal_num);
+       /* the difference between abort and suspend here is made by not
+        * passing SA_RESTART, meaning we won't restart the syscall when
+        * receiving a signal */
+       signal_add_handler (abort_signal_num, suspend_signal_handler, 0);
 
-               break;
-       }
-       default: g_assert_not_reached ();
-       }
+       sigaddset (&signal_set, abort_signal_num);
 
        /* ensure all the new signals are unblocked */
        sigprocmask (SIG_UNBLOCK, &signal_set, NULL);
 }
 
 gint
-mono_threads_posix_get_suspend_signal (void)
+mono_threads_suspend_get_suspend_signal (void)
 {
-       return suspend_signal_num;
+       return DEFAULT_SUSPEND_SIGNAL;
 }
 
 gint
-mono_threads_posix_get_restart_signal (void)
+mono_threads_suspend_get_restart_signal (void)
 {
-       return restart_signal_num;
+       return DEFAULT_RESTART_SIGNAL;
 }
 
 gint
-mono_threads_posix_get_abort_signal (void)
+mono_threads_suspend_get_abort_signal (void)
 {
        return abort_signal_num;
 }
diff --git a/mono/utils/mono-threads-posix-signals.h b/mono/utils/mono-threads-posix-signals.h
deleted file mode 100644 (file)
index 59a38c1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#ifndef __MONO_THREADS_POSIX_SIGNALS_H__
-#define __MONO_THREADS_POSIX_SIGNALS_H__
-
-#include <config.h>
-#include <glib.h>
-
-#include "mono-threads.h"
-
-#if defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT)
-
-typedef enum {
-       MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART,
-       MONO_THREADS_POSIX_INIT_SIGNALS_ABORT,
-} MonoThreadPosixInitSignals;
-
-int
-mono_threads_posix_signal_search_alternative (int min_signal);
-
-void
-mono_threads_posix_init_signals (MonoThreadPosixInitSignals signals);
-
-gint
-mono_threads_posix_get_suspend_signal (void);
-
-gint
-mono_threads_posix_get_restart_signal (void);
-
-gint
-mono_threads_posix_get_abort_signal (void);
-
-#endif /* defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT) */
-
-#endif /* __MONO_THREADS_POSIX_SIGNALS_H__ */
index 9e6ebe712c2c446ba607190f6d4fb8d14c477c62..5447a8fe93f412b9eef902ff644c9246197a7830 100644 (file)
 #endif
 
 #include <mono/utils/mono-threads.h>
-#include <mono/utils/mono-threads-posix-signals.h>
 #include <mono/utils/mono-coop-semaphore.h>
 #include <mono/metadata/gc-internals.h>
-#include <mono/utils/w32handle.h>
+#include <mono/utils/mono-threads-debug.h>
 
 #include <errno.h>
 
@@ -36,53 +35,43 @@ extern int tkill (pid_t tid, int signal);
 
 #include <sys/resource.h>
 
-#if defined(__native_client__)
-void nacl_shutdown_gc_thread(void);
-#endif
-
-void
-mono_threads_platform_register (MonoThreadInfo *info)
-{
-       gpointer thread_handle;
-
-       thread_handle = mono_w32handle_new (MONO_W32HANDLE_THREAD, NULL);
-       if (thread_handle == INVALID_HANDLE_VALUE)
-               g_error ("%s: failed to create handle", __func__);
-
-       g_assert (!info->handle);
-       info->handle = thread_handle;
-}
-
 int
-mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_data, gsize stack_size, MonoNativeThreadId *out_tid)
+mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_data, gsize* const stack_size, MonoNativeThreadId *out_tid)
 {
        pthread_attr_t attr;
        pthread_t thread;
        int policy;
        struct sched_param param;
        gint res;
+       gsize set_stack_size;
+       size_t min_size;
 
        res = pthread_attr_init (&attr);
        g_assert (!res);
 
+       if (stack_size)
+               set_stack_size = *stack_size;
+       else
+               set_stack_size = 0;
+
 #ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
-       if (stack_size == 0) {
+       if (set_stack_size == 0) {
 #if HAVE_VALGRIND_MEMCHECK_H
                if (RUNNING_ON_VALGRIND)
-                       stack_size = 1 << 20;
+                       set_stack_size = 1 << 20;
                else
-                       stack_size = (SIZEOF_VOID_P / 4) * 1024 * 1024;
+                       set_stack_size = (SIZEOF_VOID_P / 4) * 1024 * 1024;
 #else
-               stack_size = (SIZEOF_VOID_P / 4) * 1024 * 1024;
+               set_stack_size = (SIZEOF_VOID_P / 4) * 1024 * 1024;
 #endif
        }
 
 #ifdef PTHREAD_STACK_MIN
-       if (stack_size < PTHREAD_STACK_MIN)
-               stack_size = PTHREAD_STACK_MIN;
+       if (set_stack_size < PTHREAD_STACK_MIN)
+               set_stack_size = PTHREAD_STACK_MIN;
 #endif
 
-       res = pthread_attr_setstacksize (&attr, stack_size);
+       res = pthread_attr_setstacksize (&attr, set_stack_size);
        g_assert (!res);
 #endif /* HAVE_PTHREAD_ATTR_SETSTACKSIZE */
 
@@ -125,6 +114,14 @@ mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_
        if (res != 0)
                g_error ("%s: pthread_attr_setschedparam failed, error: \"%s\" (%d)", g_strerror (res), res);
 
+       if (stack_size) {
+               res = pthread_attr_getstacksize (&attr, &min_size);
+               if (res != 0)
+                       g_error ("%s: pthread_attr_getstacksize failed, error: \"%s\" (%d)", g_strerror (res), res);
+               else
+                       *stack_size = min_size;
+       }
+
        /* Actually start the thread */
        res = mono_gc_pthread_create (&thread, &attr, (gpointer (*)(gpointer)) thread_fn, thread_data);
        if (res)
@@ -143,25 +140,9 @@ mono_threads_platform_yield (void)
 }
 
 void
-mono_threads_platform_exit (int exit_code)
+mono_threads_platform_exit (gsize exit_code)
 {
-#if defined(__native_client__)
-       nacl_shutdown_gc_thread();
-#endif
-
-       mono_thread_info_detach ();
-
-       pthread_exit (NULL);
-}
-
-void
-mono_threads_platform_unregister (MonoThreadInfo *info)
-{
-       g_assert (info->handle);
-
-       /* The thread is no longer active, so unref it */
-       mono_w32handle_unref (info->handle);
-       info->handle = NULL;
+       pthread_exit ((gpointer) exit_code);
 }
 
 int
@@ -178,28 +159,6 @@ mono_threads_get_max_stack_size (void)
        return (int)lim.rlim_max;
 }
 
-gpointer
-mono_threads_platform_duplicate_handle (MonoThreadInfo *info)
-{
-       g_assert (info->handle);
-       mono_w32handle_ref (info->handle);
-       return info->handle;
-}
-
-HANDLE
-mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid)
-{
-       mono_w32handle_ref (handle);
-
-       return handle;
-}
-
-void
-mono_threads_platform_close_thread_handle (HANDLE handle)
-{
-       mono_w32handle_unref (handle);
-}
-
 int
 mono_threads_pthread_kill (MonoThreadInfo *info, int signum)
 {
@@ -288,54 +247,12 @@ mono_native_thread_set_name (MonoNativeThreadId tid, const char *name)
 #endif
 }
 
-void
-mono_threads_platform_set_exited (gpointer handle)
-{
-       int thr_ret;
-
-       g_assert (handle);
-       if (mono_w32handle_issignalled (handle))
-               g_error ("%s: handle %p thread %p has already exited, it's handle is signalled", __func__, handle, mono_native_thread_id_get ());
-       if (mono_w32handle_get_type (handle) == MONO_W32HANDLE_UNUSED)
-               g_error ("%s: handle %p thread %p has already exited, it's handle type is 'unused'", __func__, handle, mono_native_thread_id_get ());
-
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
-
-       mono_w32handle_set_signal_state (handle, TRUE, TRUE);
-
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
-}
-
-static const gchar* thread_typename (void)
-{
-       return "Thread";
-}
-
-static gsize thread_typesize (void)
-{
-       return 0;
-}
-
-static MonoW32HandleOps thread_ops = {
-       NULL,                           /* close */
-       NULL,                           /* signal */
-       NULL,                           /* own */
-       NULL,                           /* is_owned */
-       NULL,                           /* special_wait */
-       NULL,                           /* prewait */
-       NULL,                           /* details */
-       thread_typename,        /* typename */
-       thread_typesize,        /* typesize */
-};
-
-void
-mono_threads_platform_init (void)
+gboolean
+mono_native_thread_join (MonoNativeThreadId tid)
 {
-       mono_w32handle_register_ops (MONO_W32HANDLE_THREAD, &thread_ops);
+       void *res;
 
-       mono_w32handle_register_capabilities (MONO_W32HANDLE_THREAD, MONO_W32HANDLE_CAP_WAIT);
+       return !pthread_join (tid, &res);
 }
 
 #endif /* defined(_POSIX_VERSION) || defined(__native_client__) */
@@ -345,7 +262,7 @@ mono_threads_platform_init (void)
 gboolean
 mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
 {
-       int sig = interrupt_kernel ? mono_threads_posix_get_abort_signal () :  mono_threads_posix_get_suspend_signal ();
+       int sig = interrupt_kernel ? mono_threads_suspend_get_abort_signal () :  mono_threads_suspend_get_suspend_signal ();
 
        if (!mono_threads_pthread_kill (info, sig)) {
                mono_threads_add_to_pending_operation_set (info);
@@ -369,8 +286,30 @@ This begins async resume. This function must do the following:
 gboolean
 mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
 {
-       mono_threads_add_to_pending_operation_set (info);
-       return mono_threads_pthread_kill (info, mono_threads_posix_get_restart_signal ()) == 0;
+       int sig = mono_threads_suspend_get_restart_signal ();
+
+       if (!mono_threads_pthread_kill (info, sig)) {
+               mono_threads_add_to_pending_operation_set (info);
+               return TRUE;
+       }
+       return FALSE;
+}
+
+void
+mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
+{
+       /* We signal a thread to break it from the current syscall.
+        * This signal should not be interpreted as a suspend request. */
+       info->syscall_break_signal = TRUE;
+       if (mono_threads_pthread_kill (info, mono_threads_suspend_get_abort_signal ()) == 0) {
+               mono_threads_add_to_pending_operation_set (info);
+       }
+}
+
+gboolean
+mono_threads_suspend_needs_abort_syscall (void)
+{
+       return TRUE;
 }
 
 void
@@ -389,7 +328,6 @@ mono_threads_suspend_free (MonoThreadInfo *info)
 void
 mono_threads_suspend_init (void)
 {
-       mono_threads_posix_init_signals (MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART);
 }
 
 #endif /* defined(USE_POSIX_BACKEND) */
index 9792d5dbe217f09528628012ed96ed83b8e6ee7b..27acdda1f7117680e9c6bb27467e8f8b7b4d3c59 100644 (file)
@@ -6,6 +6,7 @@
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/atomic.h>
 #include <mono/utils/checked-build.h>
+#include <mono/utils/mono-threads-debug.h>
 
 #include <errno.h>
 
@@ -155,50 +156,6 @@ STATE_BLOCKING_AND_SUSPENDED: This is a bug in coop x suspend that resulted the
        }
 }
 
-/*
-This transition initiates the suspension of the current thread.
-*/
-void
-mono_threads_transition_request_self_suspension (MonoThreadInfo *info)
-{
-       int raw_state, cur_state, suspend_count;
-       g_assert (info ==  mono_thread_info_current ());
-
-retry_state_change:
-       UNWRAP_THREAD_STATE (raw_state, cur_state, suspend_count, info);
-
-       switch (cur_state) {
-       case STATE_RUNNING: //Post a self suspend request
-               if (!(suspend_count == 0))
-                       mono_fatal_with_history ("suspend_count = %d, but should be == 0", suspend_count);
-               if (InterlockedCompareExchange (&info->thread_state, build_thread_state (STATE_SELF_SUSPEND_REQUESTED, 1), raw_state) != raw_state)
-                       goto retry_state_change;
-               trace_state_change ("SELF_SUSPEND_REQUEST", info, raw_state, STATE_SELF_SUSPEND_REQUESTED, 1);
-               break;
-
-       case STATE_ASYNC_SUSPEND_REQUESTED: //Bump the suspend count but don't change the request type as async takes preference
-               if (!(suspend_count > 0 && suspend_count < THREAD_SUSPEND_COUNT_MAX))
-                       mono_fatal_with_history ("suspend_count = %d, but should be > 0 and < THREAD_SUSPEND_COUNT_MAX", suspend_count);
-               if (InterlockedCompareExchange (&info->thread_state, build_thread_state (cur_state, suspend_count + 1), raw_state) != raw_state)
-                       goto retry_state_change;
-               trace_state_change ("SUSPEND_REQUEST", info, raw_state, cur_state, 1);
-               break;
-/*
-Other states:
-STATE_ASYNC_SUSPENDED: Code should not be running while suspended.
-STATE_SELF_SUSPENDED: Code should not be running while suspended.
-STATE_SELF_SUSPEND_REQUESTED: Self suspends should not nest as begin/end should be paired. [1]
-STATE_BLOCKING:
-STATE_BLOCKING_AND_SUSPENDED: Self suspension cannot be started when the thread is in blocking state as it must finish first
-
-[1] This won't trap this sequence of requests: self suspend, async suspend and self suspend. 
-If this turns to be an issue we can introduce a new suspend request state for when both have been requested.
-*/
-       default:
-               mono_fatal_with_history ("Cannot transition thread %p from %s with SUSPEND_REQUEST", mono_thread_info_get_tid (info), state_name (cur_state));
-       }
-}
-
 /*
 This transition initiates the suspension of another thread.
 
diff --git a/mono/utils/mono-threads-windows-abort-syscall.c b/mono/utils/mono-threads-windows-abort-syscall.c
deleted file mode 100644 (file)
index 19afe3e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * mono-threads-windows-abort-syscall.c: Low-level syscall aborting
- *
- * Author:
- *     Ludovic Henry (ludovic@xamarin.com)
- *
- * (C) 2015 Xamarin, Inc
- */
-
-#include "config.h"
-#include <glib.h>
-
-#include <mono/utils/mono-threads.h>
-
-#if defined(USE_WINDOWS_BACKEND)
-
-#include <limits.h>
-
-void
-mono_threads_abort_syscall_init (void)
-{
-}
-
-static void CALLBACK
-abort_apc (ULONG_PTR param)
-{
-}
-
-void
-mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
-{
-       DWORD id = mono_thread_info_get_tid (info);
-       HANDLE handle;
-
-       handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
-       g_assert (handle);
-
-       QueueUserAPC ((PAPCFUNC)abort_apc, handle, (ULONG_PTR)NULL);
-
-       CloseHandle (handle);
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return TRUE;
-}
-
-#endif
index 7beb557fc70ef3661f0c5b7e0ed7705dd97708b1..f3f160b30c93e2a0146638caff40639a338b45f7 100644 (file)
@@ -12,6 +12,7 @@
 #if defined(USE_WINDOWS_BACKEND)
 
 #include <mono/utils/mono-compiler.h>
+#include <mono/utils/mono-threads-debug.h>
 #include <limits.h>
 
 
@@ -63,7 +64,7 @@ mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interru
        }
 
        CloseHandle (handle);
-       return info->suspend_can_continue;
+       return TRUE;
 }
 
 gboolean
@@ -72,6 +73,33 @@ mono_threads_suspend_check_suspend_result (MonoThreadInfo *info)
        return info->suspend_can_continue;
 }
 
+static void CALLBACK
+abort_apc (ULONG_PTR param)
+{
+       THREADS_INTERRUPT_DEBUG ("%06d - abort_apc () called", GetCurrentThreadId ());
+}
+
+void
+mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
+{
+       DWORD id = mono_thread_info_get_tid (info);
+       HANDLE handle;
+
+       handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
+       g_assert (handle);
+
+       THREADS_INTERRUPT_DEBUG ("%06d - Aborting syscall in thread %06d", GetCurrentThreadId (), id);
+       QueueUserAPC ((PAPCFUNC)abort_apc, handle, (ULONG_PTR)NULL);
+
+       CloseHandle (handle);
+}
+
+gboolean
+mono_threads_suspend_needs_abort_syscall (void)
+{
+       return TRUE;
+}
+
 gboolean
 mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
 {
@@ -128,33 +156,46 @@ mono_threads_suspend_free (MonoThreadInfo *info)
 {
 }
 
-#endif
-
-#if defined (HOST_WIN32)
-
 void
-mono_threads_platform_register (MonoThreadInfo *info)
+mono_threads_suspend_init_signals (void)
 {
-       HANDLE thread_handle;
+}
 
-       thread_handle = GetCurrentThread ();
-       g_assert (thread_handle);
+gint
+mono_threads_suspend_search_alternative_signal (void)
+{
+       g_assert_not_reached ();
+}
 
-       /* The handle returned by GetCurrentThread () is a pseudo handle, so it can't
-        * be used to refer to the thread from other threads for things like aborting. */
-       DuplicateHandle (GetCurrentProcess (), thread_handle, GetCurrentProcess (), &thread_handle, THREAD_ALL_ACCESS, TRUE, 0);
+gint
+mono_threads_suspend_get_suspend_signal (void)
+{
+       return -1;
+}
 
-       g_assert (!info->handle);
-       info->handle = thread_handle;
+gint
+mono_threads_suspend_get_restart_signal (void)
+{
+       return -1;
 }
 
+gint
+mono_threads_suspend_get_abort_signal (void)
+{
+       return -1;
+}
+
+#endif
+
+#if defined (HOST_WIN32)
+
 int
-mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_data, gsize stack_size, MonoNativeThreadId *out_tid)
+mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_data, gsize* const stack_size, MonoNativeThreadId *out_tid)
 {
        HANDLE result;
        DWORD thread_id;
 
-       result = CreateThread (NULL, stack_size, (LPTHREAD_START_ROUTINE) thread_fn, thread_data, 0, &thread_id);
+       result = CreateThread (NULL, stack_size ? *stack_size : 0, (LPTHREAD_START_ROUTINE) thread_fn, thread_data, 0, &thread_id);
        if (!result)
                return -1;
 
@@ -165,6 +206,12 @@ mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_
        if (out_tid)
                *out_tid = thread_id;
 
+       if (stack_size) {
+               // TOOD: Use VirtualQuery to get correct value 
+               // http://stackoverflow.com/questions/2480095/thread-stack-size-on-windows-visual-c
+               *stack_size = 2 * 1024 * 1024;
+       }
+
        return 0;
 }
 
@@ -187,6 +234,21 @@ mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg)
        return CreateThread (NULL, 0, (func), (arg), 0, (tid)) != NULL;
 }
 
+gboolean
+mono_native_thread_join (MonoNativeThreadId tid)
+{
+       HANDLE handle;
+
+       if (!(handle = OpenThread (THREAD_ALL_ACCESS, TRUE, tid)))
+               return FALSE;
+
+       DWORD res = WaitForSingleObject (handle, INFINITE);
+
+       CloseHandle (handle);
+
+       return res != WAIT_FAILED;
+}
+
 #if HAVE_DECL___READFSDWORD==0
 static MONO_ALWAYS_INLINE unsigned long long
 __readfsdword (unsigned long offset)
@@ -234,21 +296,11 @@ mono_threads_platform_yield (void)
 }
 
 void
-mono_threads_platform_exit (int exit_code)
+mono_threads_platform_exit (gsize exit_code)
 {
-       mono_thread_info_detach ();
        ExitThread (exit_code);
 }
 
-void
-mono_threads_platform_unregister (MonoThreadInfo *info)
-{
-       g_assert (info->handle);
-
-       CloseHandle (info->handle);
-       info->handle = NULL;
-}
-
 int
 mono_threads_get_max_stack_size (void)
 {
@@ -256,29 +308,6 @@ mono_threads_get_max_stack_size (void)
        return INT_MAX;
 }
 
-gpointer
-mono_threads_platform_duplicate_handle (MonoThreadInfo *info)
-{
-       HANDLE thread_handle;
-
-       g_assert (info->handle);
-       DuplicateHandle (GetCurrentProcess (), info->handle, GetCurrentProcess (), &thread_handle, THREAD_ALL_ACCESS, TRUE, 0);
-
-       return thread_handle;
-}
-
-HANDLE
-mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid)
-{
-       return OpenThread (THREAD_ALL_ACCESS, TRUE, tid);
-}
-
-void
-mono_threads_platform_close_thread_handle (HANDLE handle)
-{
-       CloseHandle (handle);
-}
-
 #if defined(_MSC_VER)
 const DWORD MS_VC_EXCEPTION=0x406D1388;
 #pragma pack(push,8)
@@ -311,14 +340,4 @@ mono_native_thread_set_name (MonoNativeThreadId tid, const char *name)
 #endif
 }
 
-void
-mono_threads_platform_set_exited (gpointer handle)
-{
-}
-
-void
-mono_threads_platform_init (void)
-{
-}
-
 #endif
index f8c716b5038d941b9a74edbf0f0ab84e52be9450..0b3f71b85d3587bb7650dcb4852100b6737951a4 100644 (file)
@@ -29,6 +29,8 @@
 #include <mono/utils/mono-coop-mutex.h>
 #include <mono/utils/mono-coop-semaphore.h>
 #include <mono/utils/mono-threads-coop.h>
+#include <mono/utils/mono-threads-debug.h>
+#include <mono/utils/os-event.h>
 
 #include <errno.h>
 
@@ -71,7 +73,6 @@ static gboolean mono_threads_inited = FALSE;
 
 static MonoSemType suspend_semaphore;
 static size_t pending_suspends;
-static gboolean unified_suspend_enabled;
 
 #define mono_thread_info_run_state(info) (((MonoThreadInfo*)info)->thread_state & THREAD_STATE_MASK)
 
@@ -347,6 +348,10 @@ register_thread (MonoThreadInfo *info, gpointer baseptr)
        mono_thread_info_set_tid (info, mono_native_thread_id_get ());
        info->small_id = small_id;
 
+       info->handle = g_new0 (MonoThreadHandle, 1);
+       info->handle->ref = 1;
+       mono_os_event_init (&info->handle->event, FALSE);
+
        mono_os_sem_init (&info->resume_semaphore, 0);
 
        /*set TLS early so SMR works */
@@ -371,7 +376,6 @@ register_thread (MonoThreadInfo *info, gpointer baseptr)
 
        info->stackdata = g_byte_array_new ();
 
-       mono_threads_platform_register (info);
        mono_threads_suspend_register (info);
 
        /*
@@ -392,6 +396,9 @@ register_thread (MonoThreadInfo *info, gpointer baseptr)
 static void
 mono_thread_info_suspend_lock_with_info (MonoThreadInfo *info);
 
+static void
+mono_threads_signal_thread_handle (MonoThreadHandle* thread_handle);
+
 static void
 unregister_thread (void *arg)
 {
@@ -426,7 +433,7 @@ unregister_thread (void *arg)
 
        /* we need to duplicate it, as the info->handle is going
         * to be closed when unregistering from the platform */
-       handle = mono_threads_platform_duplicate_handle (info);
+       handle = mono_threads_open_thread_handle (info->handle);
 
        /*
        First perform the callback that requires no locks.
@@ -447,7 +454,10 @@ unregister_thread (void *arg)
        if (threads_callbacks.thread_unregister)
                threads_callbacks.thread_unregister (info);
 
-       mono_threads_platform_unregister (info);
+       /* The thread is no longer active, so unref its handle */
+       mono_threads_close_thread_handle (info->handle);
+       info->handle = NULL;
+
        result = mono_thread_info_remove (info);
        g_assert (result);
        mono_threads_transition_detach (info);
@@ -463,12 +473,9 @@ unregister_thread (void *arg)
 
        mono_thread_small_id_free (small_id);
 
-       /* Signal the w32handle. It can be done as late as here
-        * because w32handle does not access the current MonoThreadInfo,
-        * neither does it switch state to BLOCKING. */
-       mono_threads_platform_set_exited (handle);
+       mono_threads_signal_thread_handle (handle);
 
-       mono_threads_platform_close_thread_handle (handle);
+       mono_threads_close_thread_handle (handle);
 }
 
 static void
@@ -674,8 +681,6 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
 #endif
        g_assert (res);
 
-       unified_suspend_enabled = g_getenv ("MONO_ENABLE_UNIFIED_SUSPEND") != NULL || mono_threads_is_coop_enabled ();
-       
        if ((sleepLimit = g_getenv ("MONO_SLEEP_ABORT_LIMIT")) != NULL) {
                errno = 0;
                long threshold = strtol(sleepLimit, NULL, 10);
@@ -691,10 +696,9 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
 
        mono_lls_init (&thread_list, NULL);
        mono_thread_smr_init ();
-       mono_threads_platform_init ();
        mono_threads_suspend_init ();
+       mono_threads_suspend_init_signals ();
        mono_threads_coop_init ();
-       mono_threads_abort_syscall_init ();
 
 #if defined(__MACH__)
        mono_mach_init (thread_info_key);
@@ -717,49 +721,6 @@ mono_threads_get_runtime_callbacks (void)
        return &runtime_callbacks;
 }
 
-/*
-Signal that the current thread wants to be suspended.
-This function can be called without holding the suspend lock held.
-To finish suspending, call mono_suspend_check.
-*/
-void
-mono_thread_info_begin_self_suspend (void)
-{
-       MonoThreadInfo *info = mono_thread_info_current_unchecked ();
-       if (!info)
-               return;
-
-       THREADS_SUSPEND_DEBUG ("BEGIN SELF SUSPEND OF %p\n", info);
-       mono_threads_transition_request_self_suspension (info);
-}
-
-void
-mono_thread_info_end_self_suspend (void)
-{
-       MonoThreadInfo *info;
-
-       info = mono_thread_info_current ();
-       if (!info)
-               return;
-       THREADS_SUSPEND_DEBUG ("FINISH SELF SUSPEND OF %p\n", info);
-
-       mono_threads_get_runtime_callbacks ()->thread_state_init (&info->thread_saved_state [SELF_SUSPEND_STATE_INDEX]);
-
-       /* commit the saved state and notify others if needed */
-       switch (mono_threads_transition_state_poll (info)) {
-       case SelfSuspendResumed:
-               return;
-       case SelfSuspendWait:
-               mono_thread_info_wait_for_resume (info);
-               break;
-       case SelfSuspendNotifyAndWait:
-               mono_threads_notify_initiator_of_suspend (info);
-               mono_thread_info_wait_for_resume (info);
-               mono_threads_notify_initiator_of_resume (info);
-               break;
-       }
-}
-
 static gboolean
 mono_thread_info_core_resume (MonoThreadInfo *info)
 {
@@ -871,6 +832,9 @@ is_thread_in_critical_region (MonoThreadInfo *info)
        if (stack_start < info->stack_start_limit || stack_start >= info->stack_end)
                return TRUE;
 
+       if (threads_callbacks.ip_in_critical_region)
+               return threads_callbacks.ip_in_critical_region ((MonoDomain *) state->unwind_data [MONO_UNWIND_DATA_DOMAIN], (char *) MONO_CONTEXT_GET_IP (&state->ctx));
+
        ji = mono_jit_info_table_find (
                (MonoDomain *) state->unwind_data [MONO_UNWIND_DATA_DOMAIN],
                (char *) MONO_CONTEXT_GET_IP (&state->ctx));
@@ -914,7 +878,7 @@ suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel)
                }
                break;
        case AsyncSuspendBlocking:
-               if (interrupt_kernel)
+               if (interrupt_kernel && mono_threads_suspend_needs_abort_syscall ())
                        mono_threads_suspend_abort_syscall (info);
 
                break;
@@ -994,6 +958,7 @@ mono_thread_info_safe_suspend_and_run (MonoNativeThreadId id, gboolean interrupt
                mono_threads_wait_pending_operations ();
                break;
        case KeepSuspended:
+               g_assert (!mono_threads_is_coop_enabled ());
                break;
        default:
                g_error ("Invalid suspend_and_run callback return value %d", result);
@@ -1098,12 +1063,6 @@ mono_thread_info_abort_socket_syscall_for_close (MonoNativeThreadId tid)
        mono_thread_info_suspend_unlock ();
 }
 
-gboolean
-mono_thread_info_unified_management_enabled (void)
-{
-       return unified_suspend_enabled;
-}
-
 /*
  * mono_thread_info_set_is_async_context:
  *
@@ -1136,7 +1095,7 @@ typedef struct {
        gpointer start_routine_arg;
        gint32 priority;
        MonoCoopSem registered;
-       gpointer handle;
+       MonoThreadHandle *handle;
 } CreateThreadData;
 
 static gsize WINAPI
@@ -1146,7 +1105,7 @@ inner_start_thread (gpointer data)
        MonoThreadInfo *info;
        MonoThreadStart start_routine;
        gpointer start_routine_arg;
-       guint32 start_routine_res;
+       gsize start_routine_res;
        gsize dummy;
 
        thread_data = (CreateThreadData*) data;
@@ -1158,7 +1117,7 @@ inner_start_thread (gpointer data)
        info = mono_thread_info_attach (&dummy);
        info->runtime_thread = TRUE;
 
-       thread_data->handle = mono_thread_info_duplicate_handle (info);
+       thread_data->handle = mono_threads_open_thread_handle (info->handle);
 
        mono_coop_sem_post (&thread_data->registered);
 
@@ -1173,7 +1132,7 @@ inner_start_thread (gpointer data)
        /* Run the actual main function of the thread */
        start_routine_res = start_routine (start_routine_arg);
 
-       mono_threads_platform_exit (start_routine_res);
+       mono_thread_info_exit (start_routine_res);
 
        g_assert_not_reached ();
 }
@@ -1184,12 +1143,12 @@ inner_start_thread (gpointer data)
  *   Create a new thread executing START with argument ARG. Store its id into OUT_TID.
  * Returns: a windows or io-layer handle for the thread.
  */
-HANDLE
-mono_threads_create_thread (MonoThreadStart start, gpointer arg, gsize stack_size, MonoNativeThreadId *out_tid)
+MonoThreadHandle*
+mono_threads_create_thread (MonoThreadStart start, gpointer arg, gsize * const stack_size, MonoNativeThreadId *out_tid)
 {
        CreateThreadData *thread_data;
        gint res;
-       gpointer ret;
+       MonoThreadHandle *ret;
 
        thread_data = g_new0 (CreateThreadData, 1);
        thread_data->ref = 2;
@@ -1409,6 +1368,10 @@ mono_thread_info_tls_set (THREAD_INFO_TYPE *info, MonoTlsKey key, gpointer value
        ((MonoThreadInfo*)info)->tls [key] = value;
 }
 
+#if defined(__native_client__)
+void nacl_shutdown_gc_thread(void);
+#endif
+
 /*
  * mono_thread_info_exit:
  *
@@ -1416,28 +1379,66 @@ mono_thread_info_tls_set (THREAD_INFO_TYPE *info, MonoTlsKey key, gpointer value
  * This function doesn't return.
  */
 void
-mono_thread_info_exit (void)
+mono_thread_info_exit (gsize exit_code)
 {
+#if defined(__native_client__)
+       nacl_shutdown_gc_thread();
+#endif
+
+       mono_thread_info_detach ();
+
        mono_threads_platform_exit (0);
 }
 
 /*
  * mono_threads_open_thread_handle:
  *
- *   Return a io-layer/win32 handle for the thread identified by HANDLE/TID.
- * The handle need to be closed by calling CloseHandle () when it is no
- * longer needed.
+ *  Duplicate the handle. The handle needs to be closed by calling
+ *  mono_threads_close_thread_handle () when it is no longer needed.
  */
-HANDLE
-mono_threads_open_thread_handle (HANDLE handle, MonoNativeThreadId tid)
+MonoThreadHandle*
+mono_threads_open_thread_handle (MonoThreadHandle *thread_handle)
 {
-       return mono_threads_platform_open_thread_handle (handle, tid);
+       guint32 oldref, newref;
+
+       g_assert (thread_handle);
+
+       do {
+               oldref = thread_handle->ref;
+               if (!(oldref >= 1))
+                       g_error ("%s: thread_handle %p has ref %u, it should be >= 1", __func__, thread_handle, oldref);
+
+               newref = oldref + 1;
+       } while (InterlockedCompareExchange ((gint32*) &thread_handle->ref, newref, oldref) != oldref);
+
+       return thread_handle;
 }
 
 void
-mono_threads_close_thread_handle (HANDLE handle)
+mono_threads_close_thread_handle (MonoThreadHandle *thread_handle)
+{
+       guint32 oldref, newref;
+
+       g_assert (thread_handle);
+
+       do {
+               oldref = thread_handle->ref;
+               if (!(oldref >= 1))
+                       g_error ("%s: thread_handle %p has ref %u, it should be >= 1", __func__, thread_handle, oldref);
+
+               newref = oldref - 1;
+       } while (InterlockedCompareExchange ((gint32*) &thread_handle->ref, newref, oldref) != oldref);
+
+       if (newref == 0) {
+               mono_os_event_destroy (&thread_handle->event);
+               g_free (thread_handle);
+       }
+}
+
+static void
+mono_threads_signal_thread_handle (MonoThreadHandle* thread_handle)
 {
-       return mono_threads_platform_close_thread_handle (handle);
+       mono_os_event_set (&thread_handle->event);
 }
 
 #define INTERRUPT_STATE ((MonoThreadInfoInterruptToken*) (size_t) -1)
@@ -1646,18 +1647,46 @@ mono_thread_info_is_current (MonoThreadInfo *info)
        return mono_thread_info_get_tid (info) == mono_native_thread_id_get ();
 }
 
-void
-mono_thread_info_set_exited (THREAD_INFO_TYPE *info)
+MonoThreadInfoWaitRet
+mono_thread_info_wait_one_handle (MonoThreadHandle *thread_handle, guint32 timeout, gboolean alertable)
 {
-       g_assert (mono_thread_info_is_current (info));
+       MonoOSEventWaitRet res;
 
-       g_assert (info->handle);
-       mono_threads_platform_set_exited (info->handle);
+       res = mono_os_event_wait_one (&thread_handle->event, timeout);
+       if (res == MONO_OS_EVENT_WAIT_RET_SUCCESS_0)
+               return MONO_THREAD_INFO_WAIT_RET_SUCCESS_0;
+       else if (res == MONO_OS_EVENT_WAIT_RET_ALERTED)
+               return MONO_THREAD_INFO_WAIT_RET_ALERTED;
+       else if (res == MONO_OS_EVENT_WAIT_RET_TIMEOUT)
+               return MONO_THREAD_INFO_WAIT_RET_TIMEOUT;
+       else
+               g_error ("%s: unknown res value %d", __func__, res);
 }
 
-gpointer
-mono_thread_info_duplicate_handle (MonoThreadInfo *info)
+MonoThreadInfoWaitRet
+mono_thread_info_wait_multiple_handle (MonoThreadHandle **thread_handles, gsize nhandles, MonoOSEvent *background_change_event, gboolean waitall, guint32 timeout, gboolean alertable)
 {
-       g_assert (mono_thread_info_is_current (info));
-       return mono_threads_platform_duplicate_handle (info);
+       MonoOSEventWaitRet res;
+       MonoOSEvent *thread_events [MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS];
+       gint i;
+
+       g_assert (nhandles <= MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS);
+       if (background_change_event)
+               g_assert (nhandles <= MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS - 1);
+
+       for (i = 0; i < nhandles; ++i)
+               thread_events [i] = &thread_handles [i]->event;
+
+       if (background_change_event)
+               thread_events [nhandles ++] = background_change_event;
+
+       res = mono_os_event_wait_multiple (thread_events, nhandles, waitall, timeout);
+       if (res >= MONO_OS_EVENT_WAIT_RET_SUCCESS_0 && res <= MONO_OS_EVENT_WAIT_RET_SUCCESS_0 + nhandles - 1)
+               return MONO_THREAD_INFO_WAIT_RET_SUCCESS_0 + (res - MONO_OS_EVENT_WAIT_RET_SUCCESS_0);
+       else if (res == MONO_OS_EVENT_WAIT_RET_ALERTED)
+               return MONO_THREAD_INFO_WAIT_RET_ALERTED;
+       else if (res == MONO_OS_EVENT_WAIT_RET_TIMEOUT)
+               return MONO_THREAD_INFO_WAIT_RET_TIMEOUT;
+       else
+               g_error ("%s: unknown res value %d", __func__, res);
 }
index 5e31607c176eb466536b4a38db672d4efcd54e0d..b076433999ba43c501b23a0d934abe798cd0f64a 100644 (file)
@@ -15,6 +15,7 @@
 #include <mono/utils/mono-linked-list-set.h>
 #include <mono/utils/mono-tls.h>
 #include <mono/utils/mono-coop-semaphore.h>
+#include <mono/utils/os-event.h>
 
 #include <mono/io-layer/io-layer.h>
 
@@ -28,6 +29,7 @@ typedef DWORD MonoNativeThreadId;
 typedef HANDLE MonoNativeThreadHandle; /* unused */
 
 typedef DWORD mono_native_thread_return_t;
+typedef DWORD mono_thread_start_return_t;
 
 #define MONO_NATIVE_THREAD_ID_TO_UINT(tid) (tid)
 #define MONO_UINT_TO_NATIVE_THREAD_ID(tid) ((MonoNativeThreadId)(tid))
@@ -54,6 +56,7 @@ typedef pid_t MonoNativeThreadHandle;
 typedef pthread_t MonoNativeThreadId;
 
 typedef void* mono_native_thread_return_t;
+typedef gsize mono_thread_start_return_t;
 
 #define MONO_NATIVE_THREAD_ID_TO_UINT(tid) (gsize)(tid)
 #define MONO_UINT_TO_NATIVE_THREAD_ID(tid) (MonoNativeThreadId)(gsize)(tid)
@@ -62,6 +65,11 @@ typedef gsize (*MonoThreadStart)(gpointer);
 
 #endif /* #ifdef HOST_WIN32 */
 
+typedef struct {
+       guint32 ref;
+       MonoOSEvent event;
+} MonoThreadHandle;
+
 /*
 THREAD_INFO_TYPE is a way to make the mono-threads module parametric - or sort of.
 The GC using mono-threads might extend the MonoThreadInfo struct to add its own
@@ -90,44 +98,6 @@ and reduce the number of casts drastically.
 
 /* Mono Threads internal configuration knows*/
 
-/* Logging - enable them below if you need specific logging for the category you need */
-#define MOSTLY_ASYNC_SAFE_PRINTF(...) do { \
-       char __buff[1024];      __buff [0] = '\0'; \
-       g_snprintf (__buff, sizeof (__buff), __VA_ARGS__);      \
-       write (1, __buff, strlen (__buff));     \
-} while (0)
-
-
-#if 1
-#define THREADS_DEBUG(...)
-#else
-#define THREADS_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
-#if 1
-#define THREADS_STW_DEBUG(...)
-#else
-#define THREADS_STW_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
-#if 1
-#define THREADS_SUSPEND_DEBUG(...)
-#else
-#define THREADS_SUSPEND_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
-#if 1
-#define THREADS_STATE_MACHINE_DEBUG(...)
-#else
-#define THREADS_STATE_MACHINE_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
-#if 1
-#define THREADS_INTERRUPT_DEBUG(...)
-#else
-#define THREADS_INTERRUPT_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
 /* If this is defined, use the signals backed on Mach. Debug only as signals can't be made usable on OSX. */
 // #define USE_SIGNALS_ON_MACH
 
@@ -230,7 +200,7 @@ typedef struct {
 
        /* IO layer handle for this thread */
        /* Set when the thread is started, or in _wapi_thread_duplicate () */
-       HANDLE handle;
+       MonoThreadHandle *handle;
 
        void *jit_data;
 
@@ -261,6 +231,7 @@ typedef struct {
        void (*thread_detach)(THREAD_INFO_TYPE *info);
        void (*thread_attach)(THREAD_INFO_TYPE *info);
        gboolean (*mono_method_is_critical) (void *method);
+       gboolean (*ip_in_critical_region) (MonoDomain *domain, gpointer ip);
        gboolean (*mono_thread_in_critical_region) (THREAD_INFO_TYPE *info);
 } MonoThreadInfoCallbacks;
 
@@ -361,18 +332,6 @@ mono_thread_info_resume (MonoNativeThreadId tid);
 void
 mono_thread_info_safe_suspend_and_run (MonoNativeThreadId id, gboolean interrupt_kernel, MonoSuspendThreadCallback callback, gpointer user_data);
 
-//XXX new API, fix the world
-void
-mono_thread_info_begin_self_suspend (void);
-
-void
-mono_thread_info_end_self_suspend (void);
-
-//END of new API
-
-gboolean
-mono_thread_info_unified_management_enabled (void);
-
 void
 mono_thread_info_setup_async_call (THREAD_INFO_TYPE *info, void (*target_func)(void*), void *user_data);
 
@@ -410,10 +369,7 @@ void
 mono_thread_info_tls_set (THREAD_INFO_TYPE *info, MonoTlsKey key, gpointer value);
 
 void
-mono_thread_info_exit (void);
-
-void
-mono_thread_info_set_exited (THREAD_INFO_TYPE *info);
+mono_thread_info_exit (gsize exit_code);
 
 void
 mono_thread_info_install_interrupt (void (*callback) (gpointer data), gpointer data, gboolean *interrupted);
@@ -442,17 +398,17 @@ mono_thread_info_describe_interrupt_token (THREAD_INFO_TYPE *info, GString *text
 gboolean
 mono_thread_info_is_live (THREAD_INFO_TYPE *info);
 
-HANDLE
-mono_threads_create_thread (MonoThreadStart start, gpointer arg, gsize stack_size, MonoNativeThreadId *out_tid);
+MonoThreadHandle*
+mono_threads_create_thread (MonoThreadStart start, gpointer arg, gsize * const stack_size, MonoNativeThreadId *out_tid);
 
 int
 mono_threads_get_max_stack_size (void);
 
-HANDLE
-mono_threads_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
+MonoThreadHandle*
+mono_threads_open_thread_handle (MonoThreadHandle *handle);
 
 void
-mono_threads_close_thread_handle (HANDLE handle);
+mono_threads_close_thread_handle (MonoThreadHandle *handle);
 
 MONO_API void
 mono_threads_attach_tools_thread (void);
@@ -475,12 +431,10 @@ This is called very early in the runtime, it cannot access any runtime facilitie
 */
 void mono_threads_suspend_init (void); //ok
 
-void mono_threads_platform_init (void);
+void mono_threads_suspend_init_signals (void);
 
 void mono_threads_coop_init (void);
 
-void mono_threads_abort_syscall_init (void);
-
 /*
 This begins async suspend. This function must do the following:
 
@@ -513,17 +467,15 @@ void mono_threads_suspend_register (THREAD_INFO_TYPE *info); //ok
 void mono_threads_suspend_free (THREAD_INFO_TYPE *info);
 void mono_threads_suspend_abort_syscall (THREAD_INFO_TYPE *info);
 gboolean mono_threads_suspend_needs_abort_syscall (void);
+gint mono_threads_suspend_search_alternative_signal (void);
+gint mono_threads_suspend_get_suspend_signal (void);
+gint mono_threads_suspend_get_restart_signal (void);
+gint mono_threads_suspend_get_abort_signal (void);
 
-void mono_threads_platform_register (THREAD_INFO_TYPE *info);
-void mono_threads_platform_unregister (THREAD_INFO_TYPE *info);
-int mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_data, gsize stack_size, MonoNativeThreadId *out_tid);
+int mono_threads_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_data, gsize* const stack_size, MonoNativeThreadId *out_tid);
 void mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize);
 gboolean mono_threads_platform_yield (void);
-void mono_threads_platform_exit (int exit_code);
-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 (gpointer handle);
-gpointer mono_threads_platform_duplicate_handle (THREAD_INFO_TYPE *info);
+void mono_threads_platform_exit (gsize exit_code);
 
 void mono_threads_coop_begin_global_suspend (void);
 void mono_threads_coop_end_global_suspend (void);
@@ -531,15 +483,18 @@ void mono_threads_coop_end_global_suspend (void);
 MONO_API MonoNativeThreadId
 mono_native_thread_id_get (void);
 
-gboolean
+MONO_API gboolean
 mono_native_thread_id_equals (MonoNativeThreadId id1, MonoNativeThreadId id2);
 
-gboolean
+MONO_API gboolean
 mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg);
 
 MONO_API void
 mono_native_thread_set_name (MonoNativeThreadId tid, const char *name);
 
+MONO_API gboolean
+mono_native_thread_join (MonoNativeThreadId tid);
+
 /*Mach specific internals */
 void mono_threads_init_dead_letter (void);
 void mono_threads_install_dead_letter (void);
@@ -603,7 +558,6 @@ typedef enum {
 
 void mono_threads_transition_attach (THREAD_INFO_TYPE* info);
 gboolean mono_threads_transition_detach (THREAD_INFO_TYPE *info);
-void mono_threads_transition_request_self_suspension (THREAD_INFO_TYPE *info);
 MonoRequestAsyncSuspendResult mono_threads_transition_request_async_suspension (THREAD_INFO_TYPE *info);
 MonoSelfSupendResult mono_threads_transition_state_poll (THREAD_INFO_TYPE *info);
 MonoResumeResult mono_threads_transition_request_resume (THREAD_INFO_TYPE* info);
@@ -638,7 +592,17 @@ void mono_threads_end_global_suspend (void);
 gboolean
 mono_thread_info_is_current (THREAD_INFO_TYPE *info);
 
-gpointer
-mono_thread_info_duplicate_handle (THREAD_INFO_TYPE *info);
+typedef enum {
+       MONO_THREAD_INFO_WAIT_RET_SUCCESS_0   =  0,
+       MONO_THREAD_INFO_WAIT_RET_ALERTED     = -1,
+       MONO_THREAD_INFO_WAIT_RET_TIMEOUT     = -2,
+       MONO_THREAD_INFO_WAIT_RET_FAILED      = -3,
+} MonoThreadInfoWaitRet;
+
+MonoThreadInfoWaitRet
+mono_thread_info_wait_one_handle (MonoThreadHandle *handle, guint32 timeout, gboolean alertable);
+
+MonoThreadInfoWaitRet
+mono_thread_info_wait_multiple_handle (MonoThreadHandle **thread_handles, gsize nhandles, MonoOSEvent *background_change_event, gboolean waitall, guint32 timeout, gboolean alertable);
 
 #endif /* __MONO_THREADS_H__ */
index c3501f25268fdc6b74b4bea84595698f1139a935..8c8c75b5a1012ffdaab66fdac3d976abb6c76cea 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <mono/utils/networking.h>
+#include <mono/utils/mono-compiler.h>
 #include <glib.h>
 
 #ifdef HAVE_NETDB_H
@@ -53,4 +54,7 @@ inet_pton (int family, const char *address, void *inaddrp)
        return -1;
 }
 
+#else /* !HAVE_INET_PTON */
+
+MONO_EMPTY_SOURCE_FILE (networking_missing);
 #endif /* !HAVE_INET_PTON */
diff --git a/mono/utils/os-event-unix.c b/mono/utils/os-event-unix.c
new file mode 100644 (file)
index 0000000..611cb76
--- /dev/null
@@ -0,0 +1,228 @@
+/*
+ * os-event-unix.c: MonoOSEvent on Unix
+ *
+ * Author:
+ *     Ludovic Henry (luhenry@microsoft.com)
+ *
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include "os-event.h"
+
+#include "atomic.h"
+#include "mono-lazy-init.h"
+#include "mono-threads.h"
+#include "mono-time.h"
+
+static mono_lazy_init_t status = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
+
+static mono_mutex_t signal_mutex;
+
+static void
+initialize (void)
+{
+       mono_os_mutex_init (&signal_mutex);
+}
+
+void
+mono_os_event_init (MonoOSEvent *event, gboolean initial)
+{
+       g_assert (event);
+
+       mono_lazy_initialize (&status, initialize);
+
+       event->conds = g_ptr_array_new ();
+       event->signalled = initial;
+}
+
+void
+mono_os_event_destroy (MonoOSEvent *event)
+{
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (event);
+
+       if (event->conds->len > 0)
+               g_error ("%s: cannot destroy osevent, there are still %d threads waiting on it", __func__, event->conds->len);
+
+       g_ptr_array_free (event->conds, TRUE);
+}
+
+static gboolean
+mono_os_event_is_signalled (MonoOSEvent *event)
+{
+       return event->signalled;
+}
+
+void
+mono_os_event_set (MonoOSEvent *event)
+{
+       gsize i;
+
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (event);
+
+       mono_os_mutex_lock (&signal_mutex);
+
+       event->signalled = TRUE;
+
+       for (i = 0; i < event->conds->len; ++i)
+               mono_os_cond_signal ((mono_cond_t*) event->conds->pdata [i]);
+
+       mono_os_mutex_unlock (&signal_mutex);
+}
+
+void
+mono_os_event_reset (MonoOSEvent *event)
+{
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (event);
+
+       mono_os_mutex_lock (&signal_mutex);
+
+       event->signalled = FALSE;
+
+       mono_os_mutex_unlock (&signal_mutex);
+}
+
+MonoOSEventWaitRet
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout)
+{
+       return mono_os_event_wait_multiple (&event, 1, TRUE, timeout);
+}
+
+typedef struct {
+       guint32 ref;
+       MonoOSEvent event;
+} OSEventWaitData;
+
+static void
+signal_and_unref (gpointer user_data)
+{
+       OSEventWaitData *data;
+
+       data = (OSEventWaitData*) user_data;
+
+       mono_os_event_set (&data->event);
+       if (InterlockedDecrement ((gint32*) &data->ref) == 0) {
+               mono_os_event_destroy (&data->event);
+               g_free (data);
+       }
+}
+
+MonoOSEventWaitRet
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout)
+{
+       MonoOSEventWaitRet ret;
+       mono_cond_t signal_cond;
+       OSEventWaitData *data;
+       gboolean alerted;
+       gint64 start;
+       gint i;
+
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (events);
+       g_assert (nevents > 0);
+       g_assert (nevents <= MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS);
+
+       for (i = 0; i < nevents; ++i)
+               g_assert (events [i]);
+
+       data = g_new0 (OSEventWaitData, 1);
+       data->ref = 2;
+       mono_os_event_init (&data->event, FALSE);
+
+       alerted = FALSE;
+       mono_thread_info_install_interrupt (signal_and_unref, data, &alerted);
+       if (alerted) {
+               mono_os_event_destroy (&data->event);
+               g_free (data);
+               return MONO_OS_EVENT_WAIT_RET_ALERTED;
+       }
+
+       if (timeout != MONO_INFINITE_WAIT)
+               start = mono_msec_ticks ();
+
+       mono_os_cond_init (&signal_cond);
+
+       mono_os_mutex_lock (&signal_mutex);
+
+       for (i = 0; i < nevents; ++i)
+               g_ptr_array_add (events [i]->conds, &signal_cond);
+
+       g_ptr_array_add (data->event.conds, &signal_cond);
+
+       for (;;) {
+               gint count, lowest;
+               gboolean signalled;
+
+               count = 0;
+               lowest = -1;
+
+               for (i = 0; i < nevents; ++i) {
+                       if (mono_os_event_is_signalled (events [i])) {
+                               count += 1;
+                               if (lowest == -1)
+                                       lowest = i;
+                       }
+               }
+
+               if (mono_os_event_is_signalled (&data->event))
+                       signalled = TRUE;
+               else if (waitall)
+                       signalled = (count == nevents);
+               else /* waitany */
+                       signalled = (count > 0);
+
+               if (signalled) {
+                       ret = MONO_OS_EVENT_WAIT_RET_SUCCESS_0 + lowest;
+                       goto done;
+               }
+
+               if (timeout == MONO_INFINITE_WAIT) {
+                       mono_os_cond_wait (&signal_cond, &signal_mutex);
+               } else {
+                       gint64 elapsed;
+                       gint res;
+
+                       elapsed = mono_msec_ticks () - start;
+                       if (elapsed >= timeout) {
+                               ret = MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+                               goto done;
+                       }
+
+                       res = mono_os_cond_timedwait (&signal_cond, &signal_mutex, timeout - elapsed);
+                       if (res != 0) {
+                               ret = MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+                               goto done;
+                       }
+               }
+       }
+
+done:
+       for (i = 0; i < nevents; ++i)
+               g_ptr_array_remove (events [i]->conds, &signal_cond);
+
+       g_ptr_array_remove (data->event.conds, &signal_cond);
+
+       mono_os_mutex_unlock (&signal_mutex);
+
+       mono_os_cond_destroy (&signal_cond);
+
+       mono_thread_info_uninstall_interrupt (&alerted);
+       if (alerted) {
+               if (InterlockedDecrement ((gint32*) &data->ref) == 0) {
+                       mono_os_event_destroy (&data->event);
+                       g_free (data);
+               }
+               return MONO_OS_EVENT_WAIT_RET_ALERTED;
+       }
+
+       mono_os_event_destroy (&data->event);
+       g_free (data);
+
+       return ret;
+}
diff --git a/mono/utils/os-event-win32.c b/mono/utils/os-event-win32.c
new file mode 100644 (file)
index 0000000..e28833c
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * os-event-win32.c: MonoOSEvent on Win32
+ *
+ * Author:
+ *     Ludovic Henry (luhenry@microsoft.com)
+ *
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include "os-event.h"
+
+#include <windows.h>
+#include <winbase.h>
+
+#include "atomic.h"
+
+void
+mono_os_event_init (MonoOSEvent *event, gboolean initial)
+{
+       g_assert (event);
+
+       event->handle = CreateEvent (NULL, TRUE, initial, NULL);
+       if (G_UNLIKELY (!event->handle))
+               g_error ("%s: CreateEvent failed with error %d", __func__, GetLastError ());
+}
+
+void
+mono_os_event_destroy (MonoOSEvent *event)
+{
+       BOOL res;
+
+       g_assert (event);
+       g_assert (event->handle);
+
+       res = CloseHandle (event->handle);
+       if (G_UNLIKELY (res == 0))
+               g_error ("%s: CloseHandle failed with error %d", __func__, GetLastError ());
+}
+
+void
+mono_os_event_set (MonoOSEvent *event)
+{
+       BOOL res;
+
+       g_assert (event);
+       g_assert (event->handle);
+
+       res = SetEvent (event->handle);
+       if (G_UNLIKELY (res == 0))
+               g_error ("%s: SetEvent failed with error %d", __func__, GetLastError ());
+}
+
+void
+mono_os_event_reset (MonoOSEvent *event)
+{
+       BOOL res;
+
+       g_assert (event);
+       g_assert (event->handle);
+
+       res = ResetEvent (event->handle);
+       if (G_UNLIKELY (res == 0))
+               g_error ("%s: ResetEvent failed with error %d", __func__, GetLastError ());
+}
+
+MonoOSEventWaitRet
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout)
+{
+       DWORD res;
+
+       g_assert (event);
+       g_assert (event->handle);
+
+       res = WaitForSingleObjectEx (event->handle, timeout, TRUE);
+       if (res == WAIT_OBJECT_0)
+               return MONO_OS_EVENT_WAIT_RET_SUCCESS_0;
+       else if (res == WAIT_IO_COMPLETION)
+               return MONO_OS_EVENT_WAIT_RET_ALERTED;
+       else if (res == WAIT_TIMEOUT)
+               return MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+       else if (res == WAIT_FAILED)
+               g_error ("%s: WaitForSingleObjectEx failed with error %d", __func__, GetLastError ());
+       else
+               g_error ("%s: unknown res value %d", __func__, res);
+}
+
+MonoOSEventWaitRet
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout)
+{
+       DWORD res;
+       gpointer handles [MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS];
+       gint i;
+
+       g_assert (events);
+       g_assert (nevents > 0);
+       g_assert (nevents <= MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS);
+
+       if (nevents == 1)
+               return mono_os_event_wait_one (events [0], timeout);
+
+       for (i = 0; i < nevents; ++i) {
+               g_assert (events [i]);
+               g_assert (events [i]->handle);
+               handles [i] = events [i]->handle;
+       }
+
+       res = WaitForMultipleObjectsEx (nevents, handles, waitall, timeout, TRUE);
+       if (res >= WAIT_OBJECT_0 && res < WAIT_OBJECT_0 + MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS)
+               return MONO_OS_EVENT_WAIT_RET_SUCCESS_0 + (res - WAIT_OBJECT_0);
+       else if (res == WAIT_IO_COMPLETION)
+               return MONO_OS_EVENT_WAIT_RET_ALERTED;
+       else if (res == WAIT_TIMEOUT)
+               return MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+       else if (res == WAIT_FAILED)
+               g_error ("%s: WaitForSingleObjectEx failed with error %d", __func__, GetLastError ());
+       else
+               g_error ("%s: unknown res value %d", __func__, res);
+}
diff --git a/mono/utils/os-event.h b/mono/utils/os-event.h
new file mode 100644 (file)
index 0000000..c3ca11b
--- /dev/null
@@ -0,0 +1,53 @@
+
+#ifndef _MONO_UTILS_OS_EVENT_H_
+#define _MONO_UTILS_OS_EVENT_H_
+
+#include <config.h>
+#include <glib.h>
+
+#include "mono-os-mutex.h"
+
+#ifndef MONO_INFINITE_WAIT
+#define MONO_INFINITE_WAIT ((guint32) 0xFFFFFFFF)
+#endif
+
+#define MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS 64
+
+typedef enum {
+       MONO_OS_EVENT_WAIT_RET_SUCCESS_0 =  0,
+       MONO_OS_EVENT_WAIT_RET_ALERTED   = -1,
+       MONO_OS_EVENT_WAIT_RET_TIMEOUT   = -2,
+} MonoOSEventWaitRet;
+
+typedef struct _MonoOSEvent MonoOSEvent;
+
+typedef void (*MonoOSEventFreeCb) (MonoOSEvent*);
+
+struct _MonoOSEvent {
+#ifdef HOST_WIN32
+       gpointer handle;
+#else
+       GPtrArray *conds;
+       gboolean signalled;
+#endif
+};
+
+void
+mono_os_event_init (MonoOSEvent *event, gboolean initial);
+
+void
+mono_os_event_destroy (MonoOSEvent *event);
+
+void
+mono_os_event_set (MonoOSEvent *event);
+
+void
+mono_os_event_reset (MonoOSEvent *event);
+
+MonoOSEventWaitRet
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout);
+
+MonoOSEventWaitRet
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout);
+
+#endif /* _MONO_UTILS_OS_EVENT_H_ */
diff --git a/mono/utils/w32handle.c b/mono/utils/w32handle.c
deleted file mode 100644 (file)
index d9957ce..0000000
+++ /dev/null
@@ -1,1546 +0,0 @@
-/*
- * w32handle.c:  Generic and internal operations on handles
- *
- * Author:
- *     Dick Porter (dick@ximian.com)
- *     Ludovic Henry (luhenry@microsoft.com)
- *
- * (C) 2002-2011 Novell, Inc.
- * Copyright 2011 Xamarin Inc
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include <config.h>
-
-#if !defined(HOST_WIN32)
-
-#include <glib.h>
-#include <pthread.h>
-#include <errno.h>
-#include <unistd.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <string.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#  include <sys/socket.h>
-#endif
-#ifdef HAVE_SYS_UN_H
-#  include <sys/un.h>
-#endif
-#ifdef HAVE_SYS_MMAN_H
-#  include <sys/mman.h>
-#endif
-#ifdef HAVE_DIRENT_H
-#  include <dirent.h>
-#endif
-#include <sys/stat.h>
-#ifdef HAVE_SYS_RESOURCE_H
-#  include <sys/resource.h>
-#endif
-
-#include "w32handle.h"
-
-#include "atomic.h"
-#include "mono-logger-internals.h"
-#include "mono-os-mutex.h"
-#include "mono-proclib.h"
-#include "mono-threads.h"
-#include "mono-time.h"
-
-#undef DEBUG_REFS
-
-#define SLOT_MAX               (1024 * 16)
-
-/* must be a power of 2 */
-#define HANDLE_PER_SLOT        (256)
-
-#define INFINITE 0xFFFFFFFF
-
-typedef struct {
-       MonoW32HandleType type;
-       guint ref;
-       gboolean signalled;
-       mono_mutex_t signal_mutex;
-       mono_cond_t signal_cond;
-       gpointer specific;
-} MonoW32HandleBase;
-
-static MonoW32HandleCapability handle_caps [MONO_W32HANDLE_COUNT];
-static MonoW32HandleOps *handle_ops [MONO_W32HANDLE_COUNT];
-
-/*
- * We can hold SLOT_MAX * HANDLE_PER_SLOT handles.
- * If 4M handles are not enough... Oh, well... we will crash.
- */
-#define SLOT_INDEX(x)  (x / HANDLE_PER_SLOT)
-#define SLOT_OFFSET(x) (x % HANDLE_PER_SLOT)
-
-static MonoW32HandleBase *private_handles [SLOT_MAX];
-static guint32 private_handles_count = 0;
-static guint32 private_handles_slots_count = 0;
-
-guint32 mono_w32handle_fd_reserve;
-
-/*
- * This is an internal handle which is used for handling waiting for multiple handles.
- * Threads which wait for multiple handles wait on this one handle, and when a handle
- * is signalled, this handle is signalled too.
- */
-static mono_mutex_t global_signal_mutex;
-static mono_cond_t global_signal_cond;
-
-static mono_mutex_t scan_mutex;
-
-static gboolean shutting_down = FALSE;
-
-static gboolean
-type_is_fd (MonoW32HandleType type)
-{
-       switch (type) {
-       case MONO_W32HANDLE_FILE:
-       case MONO_W32HANDLE_CONSOLE:
-       case MONO_W32HANDLE_SOCKET:
-       case MONO_W32HANDLE_PIPE:
-               return TRUE;
-       default:
-               return FALSE;
-       }
-}
-
-static gboolean
-mono_w32handle_lookup_data (gpointer handle, MonoW32HandleBase **handle_data)
-{
-       gsize index, offset;
-
-       g_assert (handle_data);
-
-       index = SLOT_INDEX ((gsize) handle);
-       if (index >= SLOT_MAX)
-               return FALSE;
-       if (!private_handles [index])
-               return FALSE;
-
-       offset = SLOT_OFFSET ((gsize) handle);
-       if (private_handles [index][offset].type == MONO_W32HANDLE_UNUSED)
-               return FALSE;
-
-       *handle_data = &private_handles [index][offset];
-       return TRUE;
-}
-
-MonoW32HandleType
-mono_w32handle_get_type (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data))
-               return MONO_W32HANDLE_UNUSED;   /* An impossible type */
-
-       return handle_data->type;
-}
-
-void
-mono_w32handle_set_signal_state (gpointer handle, gboolean state, gboolean broadcast)
-{
-       MonoW32HandleBase *handle_data;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return;
-       }
-
-#ifdef DEBUG
-       g_message ("%s: setting state of %p to %s (broadcast %s)", __func__,
-                  handle, state?"TRUE":"FALSE", broadcast?"TRUE":"FALSE");
-#endif
-
-       if (state == TRUE) {
-               /* Tell everyone blocking on a single handle */
-
-               /* The condition the global signal cond is waiting on is the signalling of
-                * _any_ handle. So lock it before setting the signalled state.
-                */
-               mono_os_mutex_lock (&global_signal_mutex);
-
-               /* This function _must_ be called with
-                * handle->signal_mutex locked
-                */
-               handle_data->signalled=state;
-
-               if (broadcast == TRUE) {
-                       mono_os_cond_broadcast (&handle_data->signal_cond);
-               } else {
-                       mono_os_cond_signal (&handle_data->signal_cond);
-               }
-
-               /* Tell everyone blocking on multiple handles that something
-                * was signalled
-                */
-               mono_os_cond_broadcast (&global_signal_cond);
-
-               mono_os_mutex_unlock (&global_signal_mutex);
-       } else {
-               handle_data->signalled=state;
-       }
-}
-
-gboolean
-mono_w32handle_issignalled (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(FALSE);
-       }
-
-       return handle_data->signalled;
-}
-
-static int
-mono_w32handle_lock_signal_mutex (void)
-{
-#ifdef DEBUG
-       g_message ("%s: lock global signal mutex", __func__);
-#endif
-
-       mono_os_mutex_lock (&global_signal_mutex);
-
-       return 0;
-}
-
-static int
-mono_w32handle_unlock_signal_mutex (void)
-{
-#ifdef DEBUG
-       g_message ("%s: unlock global signal mutex", __func__);
-#endif
-
-       mono_os_mutex_unlock (&global_signal_mutex);
-
-       return 0;
-}
-
-int
-mono_w32handle_lock_handle (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-
-#ifdef DEBUG
-       g_message ("%s: locking handle %p", __func__, handle);
-#endif
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(0);
-       }
-
-       mono_w32handle_ref (handle);
-
-       mono_os_mutex_lock (&handle_data->signal_mutex);
-
-       return 0;
-}
-
-int
-mono_w32handle_trylock_handle (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-       int ret;
-
-#ifdef DEBUG
-       g_message ("%s: locking handle %p", __func__, handle);
-#endif
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(0);
-       }
-
-       mono_w32handle_ref (handle);
-
-       ret = mono_os_mutex_trylock (&handle_data->signal_mutex);
-       if (ret != 0) {
-               mono_w32handle_unref (handle);
-       }
-
-       return(ret);
-}
-
-int
-mono_w32handle_unlock_handle (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-
-#ifdef DEBUG
-       g_message ("%s: unlocking handle %p", __func__, handle);
-#endif
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(0);
-       }
-
-       mono_os_mutex_unlock (&handle_data->signal_mutex);
-
-       mono_w32handle_unref (handle);
-
-       return 0;
-}
-
-/*
- * wapi_init:
- *
- *   Initialize the io-layer.
- */
-void
-mono_w32handle_init (void)
-{
-       static gboolean initialized = FALSE;
-
-       if (initialized)
-               return;
-
-       g_assert ((sizeof (handle_ops) / sizeof (handle_ops[0]))
-                 == MONO_W32HANDLE_COUNT);
-
-       /* This is needed by the code in mono_w32handle_new_internal */
-       mono_w32handle_fd_reserve = (eg_getdtablesize () + (HANDLE_PER_SLOT - 1)) & ~(HANDLE_PER_SLOT - 1);
-
-       do {
-               /*
-                * The entries in private_handles reserved for fds are allocated lazily to
-                * save memory.
-                */
-
-               private_handles_count += HANDLE_PER_SLOT;
-               private_handles_slots_count ++;
-       } while(mono_w32handle_fd_reserve > private_handles_count);
-
-       mono_os_mutex_init (&scan_mutex);
-
-       mono_os_cond_init (&global_signal_cond);
-       mono_os_mutex_init (&global_signal_mutex);
-
-       initialized = TRUE;
-}
-
-void
-mono_w32handle_cleanup (void)
-{
-       int i, j, k;
-
-       g_assert (!shutting_down);
-       shutting_down = TRUE;
-
-       /* Every shared handle we were using ought really to be closed
-        * by now, but to make sure just blow them all away.  The
-        * exiting finalizer thread in particular races us to the
-        * program exit and doesn't always win, so it can be left
-        * cluttering up the shared file.  Anything else left over is
-        * really a bug.
-        */
-       for(i = SLOT_INDEX (0); private_handles[i] != NULL; i++) {
-               for(j = SLOT_OFFSET (0); j < HANDLE_PER_SLOT; j++) {
-                       MonoW32HandleBase *handle_data = &private_handles[i][j];
-                       gpointer handle = GINT_TO_POINTER (i*HANDLE_PER_SLOT+j);
-
-                       for(k = handle_data->ref; k > 0; k--) {
-                               mono_w32handle_unref (handle);
-                       }
-               }
-       }
-
-       for (i = 0; i < SLOT_MAX; ++i)
-               g_free (private_handles [i]);
-}
-
-static void mono_w32handle_init_handle (MonoW32HandleBase *handle,
-                              MonoW32HandleType type, gpointer handle_specific)
-{
-       g_assert (handle->ref == 0);
-
-       handle->type = type;
-       handle->signalled = FALSE;
-       handle->ref = 1;
-
-       mono_os_cond_init (&handle->signal_cond);
-       mono_os_mutex_init (&handle->signal_mutex);
-
-       if (handle_specific)
-               handle->specific = g_memdup (handle_specific, mono_w32handle_ops_typesize (type));
-}
-
-/*
- * mono_w32handle_new_internal:
- * @type: Init handle to this type
- *
- * Search for a free handle and initialize it. Return the handle on
- * success and 0 on failure.  This is only called from
- * mono_w32handle_new, and scan_mutex must be held.
- */
-static guint32 mono_w32handle_new_internal (MonoW32HandleType type,
-                                         gpointer handle_specific)
-{
-       guint32 i, k, count;
-       static guint32 last = 0;
-       gboolean retry = FALSE;
-       
-       /* A linear scan should be fast enough.  Start from the last
-        * allocation, assuming that handles are allocated more often
-        * than they're freed. Leave the space reserved for file
-        * descriptors
-        */
-
-       if (last < mono_w32handle_fd_reserve) {
-               last = mono_w32handle_fd_reserve;
-       } else {
-               retry = TRUE;
-       }
-
-again:
-       count = last;
-       for(i = SLOT_INDEX (count); i < private_handles_slots_count; i++) {
-               if (private_handles [i]) {
-                       for (k = SLOT_OFFSET (count); k < HANDLE_PER_SLOT; k++) {
-                               MonoW32HandleBase *handle = &private_handles [i][k];
-
-                               if(handle->type == MONO_W32HANDLE_UNUSED) {
-                                       last = count + 1;
-
-                                       mono_w32handle_init_handle (handle, type, handle_specific);
-                                       return (count);
-                               }
-                               count++;
-                       }
-               }
-       }
-
-       if(retry && last > mono_w32handle_fd_reserve) {
-               /* Try again from the beginning */
-               last = mono_w32handle_fd_reserve;
-               goto again;
-       }
-
-       /* Will need to expand the array.  The caller will sort it out */
-
-       return(0);
-}
-
-gpointer
-mono_w32handle_new (MonoW32HandleType type, gpointer handle_specific)
-{
-       guint32 handle_idx = 0;
-       gpointer handle;
-
-       g_assert (!shutting_down);
-
-       g_assert(!type_is_fd(type));
-
-       mono_os_mutex_lock (&scan_mutex);
-
-       while ((handle_idx = mono_w32handle_new_internal (type, handle_specific)) == 0) {
-               /* Try and expand the array, and have another go */
-               int idx = SLOT_INDEX (private_handles_count);
-               if (idx >= SLOT_MAX) {
-                       break;
-               }
-
-               private_handles [idx] = g_new0 (MonoW32HandleBase, HANDLE_PER_SLOT);
-
-               private_handles_count += HANDLE_PER_SLOT;
-               private_handles_slots_count ++;
-       }
-
-       mono_os_mutex_unlock (&scan_mutex);
-
-       if (handle_idx == 0) {
-               /* We ran out of slots */
-               handle = INVALID_HANDLE_VALUE;
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle", __func__, mono_w32handle_ops_typename (type));
-               goto done;
-       }
-
-       /* Make sure we left the space for fd mappings */
-       g_assert (handle_idx >= mono_w32handle_fd_reserve);
-
-       handle = GUINT_TO_POINTER (handle_idx);
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: create %s handle %p", __func__, mono_w32handle_ops_typename (type), handle);
-
-done:
-       return(handle);
-}
-
-gpointer mono_w32handle_new_fd (MonoW32HandleType type, int fd,
-                             gpointer handle_specific)
-{
-       MonoW32HandleBase *handle_data;
-       int fd_index, fd_offset;
-
-       g_assert (!shutting_down);
-
-       g_assert(type_is_fd(type));
-
-       if (fd >= mono_w32handle_fd_reserve) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle, fd is too big", __func__, mono_w32handle_ops_typename (type));
-
-               return(GUINT_TO_POINTER (INVALID_HANDLE_VALUE));
-       }
-
-       fd_index = SLOT_INDEX (fd);
-       fd_offset = SLOT_OFFSET (fd);
-
-       /* Initialize the array entries on demand */
-       if (!private_handles [fd_index]) {
-               mono_os_mutex_lock (&scan_mutex);
-
-               if (!private_handles [fd_index])
-                       private_handles [fd_index] = g_new0 (MonoW32HandleBase, HANDLE_PER_SLOT);
-
-               mono_os_mutex_unlock (&scan_mutex);
-       }
-
-       handle_data = &private_handles [fd_index][fd_offset];
-
-       if (handle_data->type != MONO_W32HANDLE_UNUSED) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to create %s handle, fd is already in use", __func__, mono_w32handle_ops_typename (type));
-               /* FIXME: clean up this handle?  We can't do anything
-                * with the fd, cos thats the new one
-                */
-               return(GUINT_TO_POINTER (INVALID_HANDLE_VALUE));
-       }
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: create %s handle %p", __func__, mono_w32handle_ops_typename (type), GUINT_TO_POINTER(fd));
-
-       mono_w32handle_init_handle (handle_data, type, handle_specific);
-
-       return(GUINT_TO_POINTER(fd));
-}
-
-gboolean
-mono_w32handle_lookup (gpointer handle, MonoW32HandleType type,
-                             gpointer *handle_specific)
-{
-       MonoW32HandleBase *handle_data;
-
-       g_assert (handle_specific);
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(FALSE);
-       }
-
-       if (handle_data->type != type) {
-               return(FALSE);
-       }
-
-       *handle_specific = handle_data->specific;
-
-       return(TRUE);
-}
-
-static gboolean
-mono_w32handle_ref_core (gpointer handle, MonoW32HandleBase *handle_data);
-
-static gboolean
-mono_w32handle_unref_core (gpointer handle, MonoW32HandleBase *handle_data, guint minimum);
-
-void
-mono_w32handle_foreach (gboolean (*on_each)(gpointer handle, gpointer data, gpointer user_data), gpointer user_data)
-{
-       guint32 i, k;
-
-       mono_os_mutex_lock (&scan_mutex);
-
-       for (i = SLOT_INDEX (0); i < private_handles_slots_count; i++) {
-               if (!private_handles [i])
-                       continue;
-               for (k = SLOT_OFFSET (0); k < HANDLE_PER_SLOT; k++) {
-                       MonoW32HandleBase *handle_data = NULL;
-                       gpointer handle;
-                       gboolean destroy, finished;
-
-                       handle_data = &private_handles [i][k];
-                       if (handle_data->type == MONO_W32HANDLE_UNUSED)
-                               continue;
-
-                       handle = GUINT_TO_POINTER (i * HANDLE_PER_SLOT + k);
-
-                       if (!mono_w32handle_ref_core (handle, handle_data)) {
-                               /* we are racing with mono_w32handle_unref:
-                                *  the handle ref has been decremented, but it
-                                *  hasn't yet been destroyed. */
-                               continue;
-                       }
-
-                       finished = on_each (handle, handle_data->specific, user_data);
-
-                       /* we do not want to have to destroy the handle here,
-                        * as it would means the ref/unref are unbalanced */
-                       destroy = mono_w32handle_unref_core (handle, handle_data, 2);
-                       g_assert (!destroy);
-
-                       if (finished)
-                               goto done;
-               }
-       }
-
-done:
-       mono_os_mutex_unlock (&scan_mutex);
-}
-
-typedef struct {
-       MonoW32HandleType type;
-       gboolean (*search_user_callback)(gpointer handle, gpointer data);
-       gpointer search_user_data;
-       gpointer handle;
-       gpointer handle_specific;
-} SearchData;
-
-static gboolean
-search_callback (gpointer handle, gpointer handle_specific, gpointer user_data)
-{
-       SearchData *search_data = (SearchData*) user_data;
-
-       if (search_data->type != mono_w32handle_get_type (handle))
-               return FALSE;
-
-       if (!search_data->search_user_callback (handle, search_data->search_user_data))
-               return FALSE;
-
-       mono_w32handle_ref (handle);
-       search_data->handle = handle;
-       search_data->handle_specific = handle_specific;
-       return TRUE;
-}
-
-/* This might list some shared handles twice if they are already
- * opened by this process, and the check function returns FALSE the
- * first time.  Shared handles that are created during the search are
- * unreffed if the check function returns FALSE, so callers must not
- * rely on the handle persisting (unless the check function returns
- * TRUE)
- * The caller owns the returned handle.
- */
-gpointer mono_w32handle_search (MonoW32HandleType type,
-                             gboolean (*check)(gpointer test, gpointer user),
-                             gpointer user_data,
-                             gpointer *handle_specific,
-                             gboolean search_shared)
-{
-       SearchData search_data;
-
-       memset (&search_data, 0, sizeof (search_data));
-       search_data.type = type;
-       search_data.search_user_callback = check;
-       search_data.search_user_data = user_data;
-       mono_w32handle_foreach (search_callback, &search_data);
-       if (handle_specific)
-               *handle_specific = search_data.handle_specific;
-       return search_data.handle;
-}
-
-static gboolean
-mono_w32handle_ref_core (gpointer handle, MonoW32HandleBase *handle_data)
-{
-       guint old, new;
-
-       do {
-               old = handle_data->ref;
-               if (old == 0)
-                       return FALSE;
-
-               new = old + 1;
-       } while (InterlockedCompareExchange ((gint32*) &handle_data->ref, new, old) != old);
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: ref %s handle %p, ref: %d -> %d",
-               __func__, mono_w32handle_ops_typename (handle_data->type), handle, old, new);
-
-       return TRUE;
-}
-
-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))
-                       g_error ("%s: handle %p has ref %d, it should be >= %d", __func__, handle, 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 (type), handle, old, new, new == 0 ? "true" : "false");
-
-       return new == 0;
-}
-
-void mono_w32handle_ref (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to ref handle %p, unknown handle", __func__, handle);
-               return;
-       }
-
-       if (!mono_w32handle_ref_core (handle, handle_data))
-               g_error ("%s: failed to ref handle %p", __func__, handle);
-}
-
-static void (*_wapi_handle_ops_get_close_func (MonoW32HandleType type))(gpointer, gpointer);
-
-/* The handle must not be locked on entry to this function */
-void
-mono_w32handle_unref (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-       gboolean destroy;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: failed to unref handle %p, unknown handle",
-                       __func__, handle);
-               return;
-       }
-
-       destroy = mono_w32handle_unref_core (handle, handle_data, 1);
-
-       if (destroy) {
-               /* Need to copy the handle info, reset the slot in the
-                * array, and _only then_ call the close function to
-                * avoid race conditions (eg file descriptors being
-                * closed, and another file being opened getting the
-                * same fd racing the memset())
-                */
-               MonoW32HandleType type;
-               gpointer handle_specific;
-               void (*close_func)(gpointer, gpointer);
-
-               type = handle_data->type;
-               handle_specific = handle_data->specific;
-
-               mono_os_mutex_lock (&scan_mutex);
-
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: destroy %s handle %p", __func__, mono_w32handle_ops_typename (type), handle);
-
-               mono_os_mutex_destroy (&handle_data->signal_mutex);
-               mono_os_cond_destroy (&handle_data->signal_cond);
-
-               memset (handle_data, 0, sizeof (MonoW32HandleBase));
-
-               mono_os_mutex_unlock (&scan_mutex);
-
-               close_func = _wapi_handle_ops_get_close_func (type);
-               if (close_func != NULL) {
-                       close_func (handle, handle_specific);
-               }
-
-               g_free (handle_specific);
-       }
-}
-
-void
-mono_w32handle_register_ops (MonoW32HandleType type, MonoW32HandleOps *ops)
-{
-       handle_ops [type] = ops;
-}
-
-void mono_w32handle_register_capabilities (MonoW32HandleType type,
-                                        MonoW32HandleCapability caps)
-{
-       handle_caps[type] = caps;
-}
-
-gboolean mono_w32handle_test_capabilities (gpointer handle,
-                                        MonoW32HandleCapability caps)
-{
-       MonoW32HandleBase *handle_data;
-       MonoW32HandleType type;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(FALSE);
-       }
-
-       type = handle_data->type;
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: testing 0x%x against 0x%x (%d)", __func__,
-                  handle_caps[type], caps, handle_caps[type] & caps);
-
-       return((handle_caps[type] & caps) != 0);
-}
-
-static void (*_wapi_handle_ops_get_close_func (MonoW32HandleType type))(gpointer, gpointer)
-{
-       if (handle_ops[type] != NULL &&
-           handle_ops[type]->close != NULL) {
-               return (handle_ops[type]->close);
-       }
-
-       return (NULL);
-}
-
-void mono_w32handle_ops_close (gpointer handle, gpointer data)
-{
-       MonoW32HandleBase *handle_data;
-       MonoW32HandleType type;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return;
-       }
-
-       type = handle_data->type;
-
-       if (handle_ops[type] != NULL &&
-           handle_ops[type]->close != NULL) {
-               handle_ops[type]->close (handle, data);
-       }
-}
-
-void mono_w32handle_ops_details (MonoW32HandleType type, gpointer data)
-{
-       if (handle_ops[type] != NULL &&
-           handle_ops[type]->details != NULL) {
-               handle_ops[type]->details (data);
-       }
-}
-
-const gchar* mono_w32handle_ops_typename (MonoW32HandleType type)
-{
-       g_assert (handle_ops [type]);
-       g_assert (handle_ops [type]->typename);
-       return handle_ops [type]->typename ();
-}
-
-gsize mono_w32handle_ops_typesize (MonoW32HandleType type)
-{
-       g_assert (handle_ops [type]);
-       g_assert (handle_ops [type]->typesize);
-       return handle_ops [type]->typesize ();
-}
-
-void mono_w32handle_ops_signal (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-       MonoW32HandleType type;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return;
-       }
-
-       type = handle_data->type;
-
-       if (handle_ops[type] != NULL && handle_ops[type]->signal != NULL) {
-               handle_ops[type]->signal (handle);
-       }
-}
-
-gboolean mono_w32handle_ops_own (gpointer handle, guint32 *statuscode)
-{
-       MonoW32HandleBase *handle_data;
-       MonoW32HandleType type;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(FALSE);
-       }
-
-       type = handle_data->type;
-
-       if (handle_ops[type] != NULL && handle_ops[type]->own_handle != NULL) {
-               return(handle_ops[type]->own_handle (handle, statuscode));
-       } else {
-               return(FALSE);
-       }
-}
-
-gboolean mono_w32handle_ops_isowned (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-       MonoW32HandleType type;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(FALSE);
-       }
-
-       type = handle_data->type;
-
-       if (handle_ops[type] != NULL && handle_ops[type]->is_owned != NULL) {
-               return(handle_ops[type]->is_owned (handle));
-       } else {
-               return(FALSE);
-       }
-}
-
-guint32 mono_w32handle_ops_specialwait (gpointer handle, guint32 timeout, gboolean *alerted)
-{
-       MonoW32HandleBase *handle_data;
-       MonoW32HandleType type;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return(WAIT_FAILED);
-       }
-
-       type = handle_data->type;
-
-       if (handle_ops[type] != NULL &&
-           handle_ops[type]->special_wait != NULL) {
-               return(handle_ops[type]->special_wait (handle, timeout, alerted));
-       } else {
-               return(WAIT_FAILED);
-       }
-}
-
-void mono_w32handle_ops_prewait (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-       MonoW32HandleType type;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data)) {
-               return;
-       }
-
-       type = handle_data->type;
-
-       if (handle_ops[type] != NULL &&
-           handle_ops[type]->prewait != NULL) {
-               handle_ops[type]->prewait (handle);
-       }
-}
-
-static void
-spin (guint32 ms)
-{
-       struct timespec sleepytime;
-
-       g_assert (ms < 1000);
-
-       sleepytime.tv_sec = 0;
-       sleepytime.tv_nsec = ms * 1000000;
-       nanosleep (&sleepytime, NULL);
-}
-
-static void
-mono_w32handle_lock_handles (gpointer *handles, gsize numhandles)
-{
-       guint32 i, iter=0;
-       int thr_ret;
-
-       /* Lock all the handles, with backoff */
-again:
-       for(i=0; i<numhandles; i++) {
-               gpointer handle = handles[i];
-
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: attempting to lock %p", __func__, handle);
-
-               thr_ret = mono_w32handle_trylock_handle (handle);
-
-               if (thr_ret != 0) {
-                       /* Bummer */
-
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: attempt failed for %p: %s", __func__,
-                                  handle, strerror (thr_ret));
-
-                       while (i--) {
-                               handle = handles[i];
-
-                               thr_ret = mono_w32handle_unlock_handle (handle);
-                               g_assert (thr_ret == 0);
-                       }
-
-                       /* If iter ever reaches 100 the nanosleep will
-                        * return EINVAL immediately, but we have a
-                        * design flaw if that happens.
-                        */
-                       iter++;
-                       if(iter==100) {
-                               g_warning ("%s: iteration overflow!",
-                                          __func__);
-                               iter=1;
-                       }
-
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: Backing off for %d ms", __func__,
-                                  iter*10);
-                       spin (10 * iter);
-
-                       goto again;
-               }
-       }
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: Locked all handles", __func__);
-}
-
-static void
-mono_w32handle_unlock_handles (gpointer *handles, gsize numhandles)
-{
-       guint32 i;
-       int thr_ret;
-
-       for(i=0; i<numhandles; i++) {
-               gpointer handle = handles[i];
-
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: unlocking handle %p", __func__, handle);
-
-               thr_ret = mono_w32handle_unlock_handle (handle);
-               g_assert (thr_ret == 0);
-       }
-}
-
-static int
-mono_w32handle_timedwait_signal_naked (mono_cond_t *cond, mono_mutex_t *mutex, guint32 timeout, gboolean poll, gboolean *alerted)
-{
-       int res;
-
-       if (!poll) {
-               res = mono_os_cond_timedwait (cond, mutex, timeout);
-       } else {
-               /* This is needed when waiting for process handles */
-               if (!alerted) {
-                       /*
-                        * pthread_cond_(timed)wait() can return 0 even if the condition was not
-                        * signalled.  This happens at least on Darwin.  We surface this, i.e., we
-                        * get spurious wake-ups.
-                        *
-                        * http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_cond_wait.html
-                        */
-                       res = mono_os_cond_timedwait (cond, mutex, timeout);
-               } else {
-                       if (timeout < 100) {
-                               /* Real timeout is less than 100ms time */
-                               res = mono_os_cond_timedwait (cond, mutex, timeout);
-                       } else {
-                               res = mono_os_cond_timedwait (cond, mutex, 100);
-
-                               /* Mask the fake timeout, this will cause
-                                * another poll if the cond was not really signaled
-                                */
-                               if (res == -1)
-                                       res = 0;
-                       }
-               }
-       }
-
-       return res;
-}
-
-static void
-signal_global (gpointer unused)
-{
-       /* If we reach here, then interrupt token is set to the flag value, which
-        * means that the target thread is either
-        * - before the first CAS in timedwait, which means it won't enter the wait.
-        * - it is after the first CAS, so it is already waiting, or it will enter
-        *    the wait, and it will be interrupted by the broadcast. */
-       mono_os_mutex_lock (&global_signal_mutex);
-       mono_os_cond_broadcast (&global_signal_cond);
-       mono_os_mutex_unlock (&global_signal_mutex);
-}
-
-static int
-mono_w32handle_timedwait_signal (guint32 timeout, gboolean poll, gboolean *alerted)
-{
-       int res;
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: waiting for global", __func__);
-
-       if (alerted)
-               *alerted = FALSE;
-
-       if (alerted) {
-               mono_thread_info_install_interrupt (signal_global, NULL, alerted);
-               if (*alerted)
-                       return 0;
-       }
-
-       res = mono_w32handle_timedwait_signal_naked (&global_signal_cond, &global_signal_mutex, timeout, poll, alerted);
-
-       if (alerted)
-               mono_thread_info_uninstall_interrupt (alerted);
-
-       return res;
-}
-
-static void
-signal_handle_and_unref (gpointer handle)
-{
-       MonoW32HandleBase *handle_data;
-       mono_cond_t *cond;
-       mono_mutex_t *mutex;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data))
-               g_error ("cannot signal unknown handle %p", handle);
-
-       /* If we reach here, then interrupt token is set to the flag value, which
-        * means that the target thread is either
-        * - before the first CAS in timedwait, which means it won't enter the wait.
-        * - it is after the first CAS, so it is already waiting, or it will enter
-        *    the wait, and it will be interrupted by the broadcast. */
-       cond = &handle_data->signal_cond;
-       mutex = &handle_data->signal_mutex;
-
-       mono_os_mutex_lock (mutex);
-       mono_os_cond_broadcast (cond);
-       mono_os_mutex_unlock (mutex);
-
-       mono_w32handle_unref (handle);
-}
-
-static int
-mono_w32handle_timedwait_signal_handle (gpointer handle, guint32 timeout, gboolean poll, gboolean *alerted)
-{
-       MonoW32HandleBase *handle_data;
-       int res;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data))
-               g_error ("cannot wait on unknown handle %p", handle);
-
-       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: waiting for %p (type %s)", __func__, handle,
-                  mono_w32handle_ops_typename (mono_w32handle_get_type (handle)));
-
-       if (alerted)
-               *alerted = FALSE;
-
-       if (alerted) {
-               mono_thread_info_install_interrupt (signal_handle_and_unref, handle, alerted);
-               if (*alerted)
-                       return 0;
-               mono_w32handle_ref (handle);
-       }
-
-       res = mono_w32handle_timedwait_signal_naked (&handle_data->signal_cond, &handle_data->signal_mutex, timeout, poll, alerted);
-
-       if (alerted) {
-               mono_thread_info_uninstall_interrupt (alerted);
-               if (!*alerted) {
-                       /* if it is alerted, then the handle is unref in the interrupt callback */
-                       mono_w32handle_unref (handle);
-               }
-       }
-
-       return res;
-}
-
-static gboolean
-dump_callback (gpointer handle, gpointer handle_specific, gpointer user_data)
-{
-       MonoW32HandleBase *handle_data;
-
-       if (!mono_w32handle_lookup_data (handle, &handle_data))
-               g_error ("cannot dump unknown handle %p", handle);
-
-       g_print ("%p [%7s] signalled: %5s ref: %3d ",
-               handle, mono_w32handle_ops_typename (handle_data->type), handle_data->signalled ? "true" : "false", handle_data->ref);
-       mono_w32handle_ops_details (handle_data->type, handle_data->specific);
-       g_print ("\n");
-
-       return FALSE;
-}
-
-void mono_w32handle_dump (void)
-{
-       mono_w32handle_foreach (dump_callback, NULL);
-}
-
-static gboolean
-own_if_signalled (gpointer handle, guint32 *statuscode)
-{
-       if (!mono_w32handle_issignalled (handle))
-               return FALSE;
-
-       *statuscode = WAIT_OBJECT_0;
-       mono_w32handle_ops_own (handle, statuscode);
-       return TRUE;
-}
-
-static gboolean
-own_if_owned( gpointer handle, guint32 *statuscode)
-{
-       if (!mono_w32handle_ops_isowned (handle))
-               return FALSE;
-
-       *statuscode = WAIT_OBJECT_0;
-       mono_w32handle_ops_own (handle, statuscode);
-       return TRUE;
-}
-
-MonoW32HandleWaitRet
-mono_w32handle_wait_one (gpointer handle, guint32 timeout, gboolean alertable)
-{
-       MonoW32HandleWaitRet ret;
-       gboolean alerted;
-       gint64 start;
-       gint thr_ret;
-       guint32 statuscode = 0;
-
-       alerted = FALSE;
-
-       if (mono_w32handle_test_capabilities (handle, MONO_W32HANDLE_CAP_SPECIAL_WAIT)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p has special wait",
-                       __func__, handle);
-
-               switch (mono_w32handle_ops_specialwait (handle, timeout, alertable ? &alerted : NULL)) {
-               case WAIT_OBJECT_0:
-                       ret = MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
-                       break;
-               case WAIT_ABANDONED_0:
-                       ret = MONO_W32HANDLE_WAIT_RET_ABANDONED_0;
-                       break;
-               case WAIT_IO_COMPLETION:
-                       ret = MONO_W32HANDLE_WAIT_RET_ALERTED;
-                       break;
-               case WAIT_TIMEOUT:
-                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-                       break;
-               case WAIT_FAILED:
-                       ret = MONO_W32HANDLE_WAIT_RET_FAILED;
-                       break;
-               default:
-                       g_assert_not_reached ();
-               }
-
-               if (alerted)
-                       ret = MONO_W32HANDLE_WAIT_RET_ALERTED;
-
-               return ret;
-       }
-
-       if (!mono_w32handle_test_capabilities (handle, MONO_W32HANDLE_CAP_WAIT)) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p can't be waited for",
-                       __func__, handle);
-
-               return MONO_W32HANDLE_WAIT_RET_FAILED;
-       }
-
-       thr_ret = mono_w32handle_lock_handle (handle);
-       g_assert (thr_ret == 0);
-
-       if (mono_w32handle_test_capabilities (handle, MONO_W32HANDLE_CAP_OWN)) {
-               if (own_if_owned (handle, &statuscode)) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p already owned",
-                               __func__, handle);
-
-                       ret = statuscode == WAIT_ABANDONED_0 ? MONO_W32HANDLE_WAIT_RET_ABANDONED_0 : MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
-                       goto done;
-               }
-       }
-
-       if (timeout != INFINITE)
-               start = mono_msec_ticks ();
-
-       for (;;) {
-               gint waited;
-
-               if (own_if_signalled (handle, &statuscode)) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p signalled",
-                               __func__, handle);
-
-                       ret = statuscode == WAIT_ABANDONED_0 ? MONO_W32HANDLE_WAIT_RET_ABANDONED_0 : MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
-                       goto done;
-               }
-
-               mono_w32handle_ops_prewait (handle);
-
-               if (timeout == INFINITE) {
-                       waited = mono_w32handle_timedwait_signal_handle (handle, INFINITE, FALSE, alertable ? &alerted : NULL);
-               } else {
-                       gint64 elapsed;
-
-                       elapsed = mono_msec_ticks () - start;
-                       if (elapsed > timeout) {
-                               ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-                               goto done;
-                       }
-
-                       waited = mono_w32handle_timedwait_signal_handle (handle, timeout - elapsed, FALSE, alertable ? &alerted : NULL);
-               }
-
-               if (alerted) {
-                       ret = MONO_W32HANDLE_WAIT_RET_ALERTED;
-                       goto done;
-               }
-
-               if (waited != 0) {
-                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-                       goto done;
-               }
-       }
-
-done:
-       thr_ret = mono_w32handle_unlock_handle (handle);
-       g_assert (thr_ret == 0);
-
-       return ret;
-}
-
-MonoW32HandleWaitRet
-mono_w32handle_wait_multiple (gpointer *handles, gsize nhandles, gboolean waitall, guint32 timeout, gboolean alertable)
-{
-       MonoW32HandleWaitRet ret;
-       gboolean alerted, poll;
-       gint i, thr_ret;
-       gint64 start;
-       gpointer handles_sorted [MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS];
-       guint32 statuscodes [MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS] = {0};
-
-       if (nhandles == 0)
-               return MONO_W32HANDLE_WAIT_RET_FAILED;
-
-       if (nhandles == 1)
-               return mono_w32handle_wait_one (handles [0], timeout, alertable);
-
-       alerted = FALSE;
-
-       if (nhandles > MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
-               mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: too many handles: %d",
-                       __func__, nhandles);
-
-               return MONO_W32HANDLE_WAIT_RET_FAILED;
-       }
-
-       for (i = 0; i < nhandles; ++i) {
-               if (!mono_w32handle_test_capabilities (handles[i], MONO_W32HANDLE_CAP_WAIT)
-                        && !mono_w32handle_test_capabilities (handles[i], MONO_W32HANDLE_CAP_SPECIAL_WAIT))
-               {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p can't be waited for",
-                                  __func__, handles [i]);
-
-                       return MONO_W32HANDLE_WAIT_RET_FAILED;
-               }
-
-               handles_sorted [i] = handles [i];
-       }
-
-       qsort (handles_sorted, nhandles, sizeof (gpointer), g_direct_equal);
-       for (i = 1; i < nhandles; ++i) {
-               if (handles_sorted [i - 1] == handles_sorted [i]) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p is duplicated",
-                               __func__, handles_sorted [i]);
-
-                       return MONO_W32HANDLE_WAIT_RET_FAILED;
-               }
-       }
-
-       poll = FALSE;
-       for (i = 0; i < nhandles; ++i) {
-               if (mono_w32handle_get_type (handles [i]) == MONO_W32HANDLE_PROCESS) {
-                       /* Can't wait for a process handle + another handle without polling */
-                       poll = TRUE;
-               }
-       }
-
-       if (timeout != INFINITE)
-               start = mono_msec_ticks ();
-
-       for (i = 0; i < nhandles; ++i) {
-               /* Add a reference, as we need to ensure the handle wont
-                * disappear from under us while we're waiting in the loop
-                * (not lock, as we don't want exclusive access here) */
-               mono_w32handle_ref (handles [i]);
-       }
-
-       for (;;) {
-               gsize count, lowest;
-               gboolean signalled;
-               gint waited;
-
-               count = 0;
-               lowest = nhandles;
-
-               mono_w32handle_lock_handles (handles, nhandles);
-
-               for (i = 0; i < nhandles; i++) {
-                       if ((mono_w32handle_test_capabilities (handles [i], MONO_W32HANDLE_CAP_OWN) && mono_w32handle_ops_isowned (handles [i]))
-                                || mono_w32handle_issignalled (handles [i]))
-                       {
-                               count ++;
-
-                               if (i < lowest)
-                                       lowest = i;
-                       }
-               }
-
-               signalled = (waitall && count == nhandles) || (!waitall && count > 0);
-
-               if (signalled) {
-                       for (i = 0; i < nhandles; i++)
-                               own_if_signalled (handles [i], &statuscodes [i]);
-               }
-
-               mono_w32handle_unlock_handles (handles, nhandles);
-
-               if (signalled) {
-                       ret = MONO_W32HANDLE_WAIT_RET_SUCCESS_0 + lowest;
-                       for (i = lowest; i < nhandles; i++) {
-                               if (statuscodes [i] == WAIT_ABANDONED_0) {
-                                       ret = MONO_W32HANDLE_WAIT_RET_ABANDONED_0 + lowest;
-                                       break;
-                               }
-                       }
-                       goto done;
-               }
-
-               for (i = 0; i < nhandles; i++) {
-                       mono_w32handle_ops_prewait (handles[i]);
-
-                       if (mono_w32handle_test_capabilities (handles [i], MONO_W32HANDLE_CAP_SPECIAL_WAIT)
-                                && !mono_w32handle_issignalled (handles [i]))
-                       {
-                               mono_w32handle_ops_specialwait (handles [i], 0, alertable ? &alerted : NULL);
-                       }
-               }
-
-               thr_ret = mono_w32handle_lock_signal_mutex ();
-               g_assert (thr_ret == 0);
-
-               if (waitall) {
-                       signalled = TRUE;
-                       for (i = 0; i < nhandles; ++i) {
-                               if (!mono_w32handle_issignalled (handles [i])) {
-                                       signalled = FALSE;
-                                       break;
-                               }
-                       }
-               } else {
-                       signalled = FALSE;
-                       for (i = 0; i < nhandles; ++i) {
-                               if (mono_w32handle_issignalled (handles [i])) {
-                                       signalled = TRUE;
-                                       break;
-                               }
-                       }
-               }
-
-               waited = 0;
-
-               if (!signalled) {
-                       if (timeout == INFINITE) {
-                               waited = mono_w32handle_timedwait_signal (INFINITE, poll, alertable ? &alerted : NULL);
-                       } else {
-                               gint64 elapsed;
-
-                               elapsed = mono_msec_ticks () - start;
-                               if (elapsed > timeout) {
-                                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-
-                                       thr_ret = mono_w32handle_unlock_signal_mutex ();
-                                       g_assert (thr_ret == 0);
-
-                                       goto done;
-                               }
-
-                               waited = mono_w32handle_timedwait_signal (timeout - elapsed, poll, alertable ? &alerted : NULL);
-                       }
-               }
-
-               thr_ret = mono_w32handle_unlock_signal_mutex ();
-               g_assert (thr_ret == 0);
-
-               if (alerted) {
-                       ret = MONO_W32HANDLE_WAIT_RET_ALERTED;
-                       goto done;
-               }
-
-               if (waited != 0) {
-                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-                       goto done;
-               }
-       }
-
-done:
-       for (i = 0; i < nhandles; i++) {
-               /* Unref everything we reffed above */
-               mono_w32handle_unref (handles [i]);
-       }
-
-       return ret;
-}
-
-MonoW32HandleWaitRet
-mono_w32handle_signal_and_wait (gpointer signal_handle, gpointer wait_handle, guint32 timeout, gboolean alertable)
-{
-       MonoW32HandleWaitRet ret;
-       gint64 start;
-       gboolean alerted;
-       gint thr_ret;
-       guint32 statuscode = 0;
-
-       alerted = FALSE;
-
-       if (!mono_w32handle_test_capabilities (signal_handle, MONO_W32HANDLE_CAP_SIGNAL))
-               return MONO_W32HANDLE_WAIT_RET_FAILED;
-       if (!mono_w32handle_test_capabilities (wait_handle, MONO_W32HANDLE_CAP_WAIT))
-               return MONO_W32HANDLE_WAIT_RET_FAILED;
-
-       if (mono_w32handle_test_capabilities (wait_handle, MONO_W32HANDLE_CAP_SPECIAL_WAIT)) {
-               g_warning ("%s: handle %p has special wait, implement me!!", __func__, wait_handle);
-               return MONO_W32HANDLE_WAIT_RET_FAILED;
-       }
-
-       thr_ret = mono_w32handle_lock_handle (wait_handle);
-       g_assert (thr_ret == 0);
-
-       mono_w32handle_ops_signal (signal_handle);
-
-       if (mono_w32handle_test_capabilities (wait_handle, MONO_W32HANDLE_CAP_OWN)) {
-               if (own_if_owned (wait_handle, &statuscode)) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p already owned",
-                               __func__, wait_handle);
-
-                       ret = statuscode == WAIT_ABANDONED_0 ? MONO_W32HANDLE_WAIT_RET_ABANDONED_0 : MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
-                       goto done;
-               }
-       }
-
-       if (timeout != INFINITE)
-               start = mono_msec_ticks ();
-
-       for (;;) {
-               gint waited;
-
-               if (own_if_signalled (wait_handle, &statuscode)) {
-                       mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: handle %p signalled",
-                               __func__, wait_handle);
-
-                       ret = statuscode == WAIT_ABANDONED_0 ? MONO_W32HANDLE_WAIT_RET_ABANDONED_0 : MONO_W32HANDLE_WAIT_RET_SUCCESS_0;
-                       goto done;
-               }
-
-               mono_w32handle_ops_prewait (wait_handle);
-
-               if (timeout == INFINITE) {
-                       waited = mono_w32handle_timedwait_signal_handle (wait_handle, INFINITE, FALSE, alertable ? &alerted : NULL);
-               } else {
-                       gint64 elapsed;
-
-                       elapsed = mono_msec_ticks () - start;
-                       if (elapsed > timeout) {
-                               ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-                               goto done;
-                       }
-
-                       waited = mono_w32handle_timedwait_signal_handle (wait_handle, timeout - elapsed, FALSE, alertable ? &alerted : NULL);
-               }
-
-               if (alerted) {
-                       ret = MONO_W32HANDLE_WAIT_RET_ALERTED;
-                       goto done;
-               }
-
-               if (waited != 0) {
-                       ret = MONO_W32HANDLE_WAIT_RET_TIMEOUT;
-                       goto done;
-               }
-       }
-
-done:
-       thr_ret = mono_w32handle_unlock_handle (wait_handle);
-       g_assert (thr_ret == 0);
-
-       return ret;
-}
-
-#endif /* !defined(HOST_WIN32) */
diff --git a/mono/utils/w32handle.h b/mono/utils/w32handle.h
deleted file mode 100644 (file)
index de65da1..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-
-#ifndef _MONO_UTILS_W32HANDLE_H_
-#define _MONO_UTILS_W32HANDLE_H_
-
-#include <config.h>
-#include <glib.h>
-
-#ifndef INVALID_HANDLE_VALUE
-#define INVALID_HANDLE_VALUE (gpointer)-1
-#endif
-
-#define MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS 64
-
-typedef enum {
-       MONO_W32HANDLE_UNUSED = 0,
-       MONO_W32HANDLE_FILE,
-       MONO_W32HANDLE_CONSOLE,
-       MONO_W32HANDLE_THREAD,
-       MONO_W32HANDLE_SEM,
-       MONO_W32HANDLE_MUTEX,
-       MONO_W32HANDLE_EVENT,
-       MONO_W32HANDLE_SOCKET,
-       MONO_W32HANDLE_FIND,
-       MONO_W32HANDLE_PROCESS,
-       MONO_W32HANDLE_PIPE,
-       MONO_W32HANDLE_NAMEDMUTEX,
-       MONO_W32HANDLE_NAMEDSEM,
-       MONO_W32HANDLE_NAMEDEVENT,
-       MONO_W32HANDLE_COUNT
-} MonoW32HandleType;
-
-typedef struct 
-{
-       void (*close)(gpointer handle, gpointer data);
-
-       /* SignalObjectAndWait */
-       void (*signal)(gpointer signal);
-
-       /* Called by WaitForSingleObject and WaitForMultipleObjects,
-        * with the handle locked (shared handles aren't locked.)
-        * Returns TRUE if ownership was established, false otherwise.
-        * If TRUE, *statuscode contains a status code such as
-        * WAIT_OBJECT_0 or WAIT_ABANDONED_0.
-        */
-       gboolean (*own_handle)(gpointer handle, guint32 *statuscode);
-
-       /* Called by WaitForSingleObject and WaitForMultipleObjects, if the
-        * handle in question is "ownable" (ie mutexes), to see if the current
-        * thread already owns this handle
-        */
-       gboolean (*is_owned)(gpointer handle);
-
-       /* Called by WaitForSingleObject and WaitForMultipleObjects,
-        * if the handle in question needs a special wait function
-        * instead of using the normal handle signal mechanism.
-        * Returns the WaitForSingleObject return code.
-        */
-       guint32 (*special_wait)(gpointer handle, guint32 timeout, gboolean *alerted);
-
-       /* Called by WaitForSingleObject and WaitForMultipleObjects,
-        * if the handle in question needs some preprocessing before the
-        * signal wait.
-        */
-       void (*prewait)(gpointer handle);
-
-       /* Called when dumping the handles */
-       void (*details)(gpointer data);
-
-       /* Called to get the name of the handle type */
-       const gchar* (*typename) (void);
-
-       /* Called to get the size of the handle type */
-       gsize (*typesize) (void);
-} MonoW32HandleOps;
-
-typedef enum {
-       MONO_W32HANDLE_CAP_WAIT         = 0x01,
-       MONO_W32HANDLE_CAP_SIGNAL       = 0x02,
-       MONO_W32HANDLE_CAP_OWN          = 0x04,
-       MONO_W32HANDLE_CAP_SPECIAL_WAIT = 0x08,
-} MonoW32HandleCapability;
-
-extern guint32 mono_w32handle_fd_reserve;
-
-void
-mono_w32handle_init (void);
-
-void
-mono_w32handle_cleanup (void);
-
-void
-mono_w32handle_register_ops (MonoW32HandleType type, MonoW32HandleOps *ops);
-
-gpointer
-mono_w32handle_new (MonoW32HandleType type, gpointer handle_specific);
-
-gpointer
-mono_w32handle_new_fd (MonoW32HandleType type, int fd, gpointer handle_specific);
-
-MonoW32HandleType
-mono_w32handle_get_type (gpointer handle);
-
-gboolean
-mono_w32handle_lookup (gpointer handle, MonoW32HandleType type, gpointer *handle_specific);
-
-gpointer
-mono_w32handle_search (MonoW32HandleType type, gboolean (*check)(gpointer, gpointer), gpointer user_data, gpointer *handle_specific, gboolean search_shared);
-
-void
-mono_w32handle_foreach (gboolean (*on_each)(gpointer handle, gpointer data, gpointer user_data), gpointer user_data);
-
-void
-mono_w32handle_dump (void);
-
-void
-mono_w32handle_ref (gpointer handle);
-
-void
-mono_w32handle_unref (gpointer handle);
-
-void
-mono_w32handle_register_capabilities (MonoW32HandleType type, MonoW32HandleCapability caps);
-
-gboolean
-mono_w32handle_test_capabilities (gpointer handle, MonoW32HandleCapability caps);
-
-void
-mono_w32handle_ops_close (gpointer handle, gpointer data);
-
-void
-mono_w32handle_ops_signal (gpointer handle);
-
-gboolean
-mono_w32handle_ops_own (gpointer handle, guint32 *statuscode);
-
-gboolean
-mono_w32handle_ops_isowned (gpointer handle);
-
-guint32
-mono_w32handle_ops_specialwait (gpointer handle, guint32 timeout, gboolean *alerted);
-
-void
-mono_w32handle_ops_prewait (gpointer handle);
-
-void
-mono_w32handle_ops_details (MonoW32HandleType type, gpointer data);
-
-const gchar*
-mono_w32handle_ops_typename (MonoW32HandleType type);
-
-gsize
-mono_w32handle_ops_typesize (MonoW32HandleType type);
-
-void
-mono_w32handle_set_signal_state (gpointer handle, gboolean state, gboolean broadcast);
-
-gboolean
-mono_w32handle_issignalled (gpointer handle);
-
-int
-mono_w32handle_lock_handle (gpointer handle);
-
-int
-mono_w32handle_trylock_handle (gpointer handle);
-
-int
-mono_w32handle_unlock_handle (gpointer handle);
-
-typedef enum {
-       MONO_W32HANDLE_WAIT_RET_SUCCESS_0   =  0,
-       MONO_W32HANDLE_WAIT_RET_ABANDONED_0 =  MONO_W32HANDLE_WAIT_RET_SUCCESS_0 + MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS,
-       MONO_W32HANDLE_WAIT_RET_ALERTED     = -1,
-       MONO_W32HANDLE_WAIT_RET_TIMEOUT     = -2,
-       MONO_W32HANDLE_WAIT_RET_FAILED      = -3,
-} MonoW32HandleWaitRet;
-
-MonoW32HandleWaitRet
-mono_w32handle_wait_one (gpointer handle, guint32 timeout, gboolean alertable);
-
-MonoW32HandleWaitRet
-mono_w32handle_wait_multiple (gpointer *handles, gsize nhandles, gboolean waitall, guint32 timeout, gboolean alertable);
-
-MonoW32HandleWaitRet
-mono_w32handle_signal_and_wait (gpointer signal_handle, gpointer wait_handle, guint32 timeout, gboolean alertable);
-
-#endif /* _MONO_UTILS_W32HANDLE_H_ */
index 15984b6c059dfdabc3d03ba6f7f91df67ab3bc06..1ac7e077af462557f02a22fb47bf04a457638998 100644 (file)
@@ -13,13 +13,13 @@ ifdef RAX
 PUBLIC mono_context_get_current
 
 mono_context_get_current PROC
-;rdi has the ctx ptr
+;rcx has the ctx ptr
        mov [rcx + 00h], rax
-       mov [rcx + 08h], rbx
-       mov [rcx + 10h], rcx
-       mov [rcx + 18h], rdx
-       mov [rcx + 20h], rbp
-       mov [rcx + 28h], rsp
+       mov [rcx + 08h], rcx
+       mov [rcx + 10h], rdx
+       mov [rcx + 18h], rbx
+       mov [rcx + 20h], rsp
+       mov [rcx + 28h], rbp
        mov [rcx + 30h], rsi
        mov [rcx + 38h], rdi
        mov [rcx + 40h], r8
index 94a7127d7318cad19bd892a6f7e50eb800455856..98a8849ab35efb07f61a8c00374ca6cdce77dbe9 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
 <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|Win32">\r
     <ClCompile Include="..\eglib\src\gstr.c" />\r
     <ClCompile Include="..\eglib\src\gstring.c" />\r
     <ClCompile Include="..\eglib\src\gtimer-win32.c" />\r
+    <ClCompile Include="..\eglib\src\gunicode-win32.c" />\r
     <ClCompile Include="..\eglib\src\gunicode.c" />\r
     <ClCompile Include="..\eglib\src\gutf8.c" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\eglib\src\glib.h" />\r
+    <ClInclude Include="..\eglib\src\gmodule-win32-internals.h" />\r
     <ClInclude Include="..\eglib\src\gmodule.h" />\r
     <ClInclude Include="..\eglib\src\sort.frag.h" />\r
   </ItemGroup>\r
       <Project>{92ae7622-5f58-4234-9a26-9ec71876b3f4}</Project>\r
     </ProjectReference>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\eglib\src\Makefile.am" />\r
+  </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>\r
+</Project>
\ No newline at end of file
index 680ff1a9fd998f8e518d723e3d93cb9f68a901c4..f49e42ae1598c84abe46799a2e66114c1017bfa9 100644 (file)
@@ -88,7 +88,7 @@
     <ClCompile Include="..\eglib\src\gutf8.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\eglib\src\vasprintf.c">\r
+    <ClCompile Include="..\eglib\src\gunicode-win32.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
     <ClInclude Include="..\eglib\src\sort.frag.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\eglib\src\gmodule-win32-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Source Files">\r
       <UniqueIdentifier>{38a39ff1-842b-431b-b54b-24094e8283eb}</UniqueIdentifier>\r
     </Filter>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\eglib\src\Makefile.am">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
 </Project>
\ No newline at end of file
index 5d638f1b8fb83ca27fd2e0ea78b5c61c346f91f7..b8ba2add1e26cb63a52cf948d3b12717f7d75910 100644 (file)
@@ -60,6 +60,7 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
     </ClInclude>\r
+    <ClInclude Include="..\mono\mini\mini-windows.h" />\r
     <ClInclude Include="..\mono\mini\mini-x86.h">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
       <Project>{8fc2b0c8-51ad-49df-851f-5d01a77a75e4}</Project>\r
     </ProjectReference>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\mono\mini\Makefile.am.in" />\r
+  </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
index 35641c0e6af5d06deb99314d48f855f80a571cc8..77099bed2f10b87c0f4fcfd21ac3839069c5e2a6 100644 (file)
     <ClInclude Include="..\mono\mini\mini-amd64-gsharedvt.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\mono\mini\mini-windows.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Header Files">\r
       <UniqueIdentifier>{5370c3c4-b6ec-4f8a-8b21-ce4e782720a6}</UniqueIdentifier>\r
     </Filter>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\mono\mini\Makefile.am.in">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
 </Project>
\ No newline at end of file
index 78517bc7c3aece3e8f2b96fc3d519c791872fe43..762947af907c7144679b385094aa5574ac0cdde7 100644 (file)
     <ClCompile Include="..\mono\metadata\assembly.c" />\r
     <ClCompile Include="..\mono\metadata\attach.c" />\r
     <ClCompile Include="..\mono\metadata\boehm-gc.c" />\r
+    <ClCompile Include="..\mono\metadata\class-accessors.c" />\r
     <ClCompile Include="..\mono\metadata\class.c" />\r
     <ClCompile Include="..\mono\metadata\cominterop.c" />\r
     <ClCompile Include="..\mono\metadata\console-win32.c" />\r
+    <ClCompile Include="..\mono\metadata\property-bag.c" />\r
+    <ClCompile Include="..\mono\metadata\socket-io-windows.c" />\r
+    <ClCompile Include="..\mono\metadata\file-io-windows.c" />\r
+    <ClCompile Include="..\mono\metadata\icall-windows.c" />\r
+    <ClCompile Include="..\mono\metadata\marshal-windows.c" />\r
+    <ClCompile Include="..\mono\metadata\mono-security-windows.c" />\r
     <ClCompile Include="..\mono\metadata\w32mutex-win32.c" />\r
     <ClCompile Include="..\mono\metadata\w32semaphore-win32.c" />\r
     <ClCompile Include="..\mono\metadata\w32event-win32.c" />\r
+    <ClCompile Include="..\mono\metadata\w32process.c" />\r
+    <ClCompile Include="..\mono\metadata\w32process-win32.c" />\r
     <ClCompile Include="..\mono\metadata\coree.c" />\r
     <ClCompile Include="..\mono\metadata\custom-attrs.c" />\r
     <ClCompile Include="..\mono\metadata\debug-helpers.c" />\r
@@ -72,7 +81,6 @@
     <ClCompile Include="..\mono\metadata\number-ms.c" />\r
     <ClCompile Include="..\mono\metadata\object.c" />\r
     <ClCompile Include="..\mono\metadata\opcodes.c" />\r
-    <ClCompile Include="..\mono\metadata\process.c" />\r
     <ClCompile Include="..\mono\metadata\profiler.c" />\r
     <ClCompile Include="..\mono\metadata\rand.c" />\r
     <ClCompile Include="..\mono\metadata\reflection.c" />\r
     <ClCompile Include="..\mono\metadata\mono-security.c" />\r
     <ClCompile Include="..\mono\metadata\seq-points-data.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-mono.c" />\r
-    <ClCompile Include="..\mono\metadata\sgen-os-coop.c" />\r
     <ClCompile Include="..\mono\metadata\threadpool-ms-io.c" />\r
     <ClCompile Include="..\mono\metadata\threadpool-ms.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-bridge.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-new-bridge.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-old-bridge.c" />\r
-    <ClCompile Include="..\mono\metadata\sgen-os-mach.c">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-posix.c">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-win32.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-tarjan-bridge.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-toggleref.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-stw.c" />\r
     <ClInclude Include="..\mono\metadata\class.h" />\r
     <ClInclude Include="..\mono\metadata\cominterop.h" />\r
     <ClInclude Include="..\mono\metadata\console-io.h" />\r
+    <ClInclude Include="..\mono\metadata\console-win32-internals.h" />\r
+    <ClInclude Include="..\mono\metadata\coree-internals.h" />\r
     <ClInclude Include="..\mono\metadata\coree.h" />\r
     <ClInclude Include="..\mono\metadata\culture-info-tables.h" />\r
     <ClInclude Include="..\mono\metadata\culture-info.h" />\r
     <ClInclude Include="..\mono\metadata\dynamic-stream-internals.h" />\r
     <ClInclude Include="..\mono\metadata\environment.h" />\r
     <ClInclude Include="..\mono\metadata\exception.h" />\r
+    <ClInclude Include="..\mono\metadata\file-io-internals.h" />\r
+    <ClInclude Include="..\mono\metadata\file-io-windows-internals.h" />\r
     <ClInclude Include="..\mono\metadata\file-io.h" />\r
     <ClInclude Include="..\mono\metadata\filewatcher.h" />\r
     <ClInclude Include="..\mono\metadata\gc-internals.h" />\r
     <ClInclude Include="..\mono\metadata\handle.h" />\r
+    <ClInclude Include="..\mono\metadata\icall-windows-internals.h" />\r
+    <ClInclude Include="..\mono\metadata\icall-internals.h" />\r
+    <ClInclude Include="..\mono\metadata\marshal-internals.h" />\r
+    <ClInclude Include="..\mono\metadata\marshal-windows-internals.h" />\r
+    <ClInclude Include="..\mono\metadata\mono-security-windows-internals.h" />\r
     <ClInclude Include="..\mono\metadata\number-ms.h" />\r
+    <ClInclude Include="..\mono\metadata\property-bag.h" />\r
+    <ClInclude Include="..\mono\metadata\w32process.h" />\r
+    <ClInclude Include="..\mono\metadata\w32process-internals.h" />\r
+    <ClInclude Include="..\mono\metadata\w32process-win32-internals.h" />\r
     <ClInclude Include="..\mono\metadata\remoting.h" />\r
     <ClInclude Include="..\mono\metadata\seq-points-data.h" />\r
     <ClInclude Include="..\mono\metadata\sgen-bridge-internals.h" />\r
     <ClInclude Include="..\mono\metadata\sgen-client-mono.h" />\r
+    <ClInclude Include="..\mono\metadata\socket-io-windows-internals.h" />\r
     <ClInclude Include="..\mono\metadata\threadpool-ms-io.h" />\r
     <ClInclude Include="..\mono\metadata\threadpool-ms.h" />\r
     <ClInclude Include="..\mono\sgen\gc-internal-agnostic.h" />\r
     <ClInclude Include="..\mono\metadata\object-internals.h" />\r
     <ClInclude Include="..\mono\metadata\object.h" />\r
     <ClInclude Include="..\mono\metadata\opcodes.h" />\r
-    <ClInclude Include="..\mono\metadata\process.h" />\r
     <ClInclude Include="..\mono\metadata\profiler-private.h" />\r
     <ClInclude Include="..\mono\metadata\profiler.h" />\r
     <ClInclude Include="..\mono\metadata\rand.h" />\r
       <Project>{158073ed-99ae-4196-9edc-ddb2344f8466}</Project>\r
     </ProjectReference>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\mono\metadata\Makefile.am" />\r
+  </ItemGroup>\r
   <PropertyGroup Label="Globals">\r
     <ProjectGuid>{C36612BD-22D3-4B95-85E2-7FDC4FC5D739}</ProjectGuid>\r
     <Keyword>Win32Proj</Keyword>\r
index ba4d25f1ba94d8e9c6028b819c66bbfb4f414532..d36472937a11002b372216ac0db1d035b0d1d18b 100644 (file)
     <ClCompile Include="..\mono\metadata\opcodes.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\process.c">\r
+    <ClCompile Include="..\mono\metadata\w32process.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\w32process-win32.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\mono\metadata\profiler.c">\r
     <ClCompile Include="..\mono\metadata\boehm-gc.c">\r
       <Filter>Source Files\boehm</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-mach.c">\r
-      <Filter>Source Files\sgen</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-posix.c">\r
-      <Filter>Source Files\sgen</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-win32.c">\r
-      <Filter>Source Files\sgen</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\mono\metadata\appdomain.c">\r
       <Filter>Source Files\gc</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\mono\metadata\sre-save.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-coop.c">\r
-      <Filter>Source Files\sgen</Filter>\r
+    <ClCompile Include="..\mono\metadata\socket-io-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\file-io-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\icall-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\marshal-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\mono-security-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\class-accessors.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\property-bag.c">\r
+      <Filter>Source Files</Filter>\r
     </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\mono\metadata\opcodes.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\mono\metadata\process.h">\r
+    <ClInclude Include="..\mono\metadata\w32process.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\w32process-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\w32process-win32-internals.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
     <ClInclude Include="..\mono\metadata\profiler.h">\r
     <ClInclude Include="..\mono\metadata\sre-internals.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\socket-io-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\coree-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\console-win32-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\file-io-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\file-io-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\icall-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\icall-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\marshal-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\marshal-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\mono-security-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\metadata\property-bag.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Header Files">\r
       <UniqueIdentifier>{e37c9a88-bfb3-47dd-948c-a74dea25b3ad}</UniqueIdentifier>\r
     </Filter>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\mono\metadata\Makefile.am">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
 </Project>
\ No newline at end of file
index ca9ce67c4658365ada96d183ab9f909a5e9a2ec0..bd512ab75e69be5420df3b1f02b3fdfaec296edc 100644 (file)
     <ClCompile Include="..\mono\utils\mono-log-common.c" />\r
     <ClCompile Include="..\mono\utils\mono-math.c" />\r
     <ClCompile Include="..\mono\utils\mono-md5.c" />\r
+    <ClCompile Include="..\mono\utils\mono-mmap-windows.c" />\r
     <ClCompile Include="..\mono\utils\mono-mmap.c" />\r
     <ClCompile Include="..\mono\utils\mono-networkinterfaces.c" />\r
+    <ClCompile Include="..\mono\utils\mono-proclib-windows.c" />\r
+    <ClCompile Include="..\mono\utils\mono-rand-windows.c" />\r
     <ClCompile Include="..\mono\utils\mono-rand.c" />\r
     <ClCompile Include="..\mono\utils\mono-threads-state-machine.c" />\r
     <ClCompile Include="..\mono\utils\networking.c" />\r
     <ClCompile Include="..\mono\utils\mono-threads-windows.c" />\r
     <ClCompile Include="..\mono\utils\mono-threads.c" />\r
     <ClCompile Include="..\mono\utils\mono-threads-coop.c" />\r
-    <ClCompile Include="..\mono\utils\mono-threads-posix-abort-syscall.c">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\utils\mono-threads-mach-abort-syscall.c">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\utils\mono-threads-windows-abort-syscall.c" />\r
     <ClCompile Include="..\mono\utils\mono-time.c" />\r
     <ClCompile Include="..\mono\utils\mono-tls.c" />\r
     <ClCompile Include="..\mono\utils\mono-uri.c" />\r
     <ClCompile Include="..\mono\utils\mono-value-hash.c" />\r
     <ClCompile Include="..\mono\utils\monobitset.c" />\r
+    <ClCompile Include="..\mono\utils\os-event-win32.c" />\r
     <ClCompile Include="..\mono\utils\strenc.c" />\r
     <ClCompile Include="..\mono\utils\atomic.c" />\r
     <ClCompile Include="..\mono\utils\mono-hwcap.c" />\r
     <ClInclude Include="..\mono\utils\mono-counters.h" />\r
     <ClInclude Include="..\mono\utils\mono-digest.h" />\r
     <ClInclude Include="..\mono\utils\mono-dl-fallback.h" />\r
+    <ClInclude Include="..\mono\utils\mono-dl-windows-internals.h" />\r
     <ClInclude Include="..\mono\utils\mono-dl.h" />\r
     <ClInclude Include="..\mono\utils\mono-error-internals.h" />\r
     <ClInclude Include="..\mono\utils\mono-error.h" />\r
     <ClInclude Include="..\mono\utils\mono-math.h" />\r
     <ClInclude Include="..\mono\utils\mono-membar.h" />\r
     <ClInclude Include="..\mono\utils\mono-memory-model.h" />\r
+    <ClInclude Include="..\mono\utils\mono-mmap-internals.h" />\r
+    <ClInclude Include="..\mono\utils\mono-mmap-windows-internals.h" />\r
     <ClInclude Include="..\mono\utils\mono-mmap.h" />\r
     <ClInclude Include="..\mono\utils\mono-networkinterfaces.h" />\r
     <ClInclude Include="..\mono\utils\mono-once.h" />\r
     <ClInclude Include="..\mono\utils\mono-os-semaphore.h" />\r
     <ClInclude Include="..\mono\utils\mono-path.h" />\r
     <ClInclude Include="..\mono\utils\mono-poll.h" />\r
+    <ClInclude Include="..\mono\utils\mono-proclib-windows-internals.h" />\r
     <ClInclude Include="..\mono\utils\mono-proclib.h" />\r
     <ClInclude Include="..\mono\utils\mono-property-hash.h" />\r
     <ClInclude Include="..\mono\utils\mono-publib.h" />\r
+    <ClInclude Include="..\mono\utils\mono-rand-windows-internals.h" />\r
     <ClInclude Include="..\mono\utils\mono-rand.h" />\r
     <ClInclude Include="..\mono\utils\mono-sigcontext.h" />\r
     <ClInclude Include="..\mono\utils\mono-stack-unwinding.h" />\r
     <ClInclude Include="..\mono\utils\mono-threads.h" />\r
     <ClInclude Include="..\mono\utils\mono-threads-api.h" />\r
     <ClInclude Include="..\mono\utils\mono-threads-coop.h" />\r
-    <ClInclude Include="..\mono\utils\mono-threads-posix-signals.h" />\r
     <ClInclude Include="..\mono\utils\mono-time.h" />\r
     <ClInclude Include="..\mono\utils\mono-tls.h" />\r
     <ClInclude Include="..\mono\utils\mono-uri.h" />\r
     <ClInclude Include="..\mono\utils\mono-value-hash.h" />\r
     <ClInclude Include="..\mono\utils\monobitset.h" />\r
+    <ClInclude Include="..\mono\utils\os-event.h" />\r
     <ClInclude Include="..\mono\utils\strenc.h" />\r
     <ClInclude Include="..\mono\utils\valgrind.h" />\r
     <ClInclude Include="..\mono\utils\atomic.h" />\r
       <Project>{158073ed-99ae-4196-9edc-ddb2344f8466}</Project>\r
     </ProjectReference>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\mono\utils\Makefile.am" />\r
+  </ItemGroup>\r
   <PropertyGroup Label="Globals">\r
     <ProjectGuid>{8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}</ProjectGuid>\r
     <Keyword>Win32Proj</Keyword>\r
   <ImportGroup Label="ExtensionTargets">\r
     <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />\r
   </ImportGroup>\r
-</Project>
+</Project>
\ No newline at end of file
index dae5e304a8738c178927c709bde9b29795b02e85..30b819626b6fc91f3f5f3cea2ffabec06f416384 100644 (file)
     <ClCompile Include="..\mono\utils\mono-log-windows.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\mono\utils\mono-rand-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\utils\mono-proclib-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\utils\mono-mmap-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\utils\os-event-win32.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\mono\utils\atomic.h">\r
     <ClInclude Include="..\mono\utils\valgrind.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\mono\utils\mono-mmap-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\utils\mono-mmap-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\utils\mono-proclib-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\utils\mono-rand-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\utils\mono-dl-windows-internals.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mono\utils\os-event.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Header Files">\r
       <Filter>Resource Files</Filter>\r
     </MASM>\r
   </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\mono\utils\Makefile.am">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
 </Project>
\ No newline at end of file
index fca1c3d1d9c09cfb2b76a2fac8804126d102934a..027280d5a91a2549a63e5564db72035a76070536 100644 (file)
@@ -92,9 +92,24 @@ Mono_Posix_ToSyslogLevel
 Mono_Posix_ToSyslogOptions\r
 Mono_Posix_ToWaitOptions\r
 Mono_Posix_ToXattrFlags\r
+Mono_Unix_VersionString\r
 CreateZStream\r
 CloseZStream\r
 ReadZStream\r
 WriteZStream\r
 Flush\r
-\r
+zipWriteInFileInZip\r
+zipCloseFileInZip\r
+zipOpen2\r
+zipClose\r
+zipOpenNewFileInZip\r
+unzOpen2\r
+unzCloseCurrentFile\r
+unztell\r
+unzGoToFirstFile\r
+unzGoToNextFile\r
+unzLocateFile\r
+unzOpenCurrentFile2\r
+unzGetCurrentFileInfo\r
+unzReadCurrentFile\r
+unzClose\r
index 83304969ab20ec2f93929d747146fd03db64a965..de0276892fa51410ace9318b026d559401d2cdc4 100644 (file)
@@ -87,7 +87,6 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>_DEBUG;__i386__;TARGET_X86;_WIN32_WINNT=0x0600;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
@@ -96,6 +95,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <CompileAs>CompileAsC</CompileAs>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_DIR)/support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <AdditionalDependencies>eglib.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>_DEBUG;__x86_64__;_WIN32_WINNT=0x0600;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <CompileAs>CompileAsC</CompileAs>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_DIR)/support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>NDEBUG;__i386__;TARGET_X86;i386;_WIN32_WINNT=0x0600;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <CompileAs>CompileAsC</CompileAs>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_DIR)/support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <AdditionalDependencies>eglib.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>NDEBUG;__x86_64__;_WIN32_WINNT=0x0600;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <CompileAs>CompileAsC</CompileAs>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_DIR)/support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     <ClCompile Include="..\support\inflate.c" />\r
     <ClCompile Include="..\support\inftrees.c" />\r
     <ClCompile Include="..\support\map.c" />\r
+    <ClCompile Include="..\support\minizip\ioapi.c" />\r
+    <ClCompile Include="..\support\minizip\iowin32.c" />\r
+    <ClCompile Include="..\support\minizip\minizip.c" />\r
+    <ClCompile Include="..\support\minizip\unzip.c" />\r
+    <ClCompile Include="..\support\minizip\zip.c" />\r
     <ClCompile Include="..\support\signal.c" />\r
     <ClCompile Include="..\support\stdio.c" />\r
     <ClCompile Include="..\support\stdlib.c" />\r
     <ClInclude Include="..\support\inflate.h" />\r
     <ClInclude Include="..\support\inftrees.h" />\r
     <ClInclude Include="..\support\map.h" />\r
+    <ClInclude Include="..\support\minizip\crypt.h" />\r
+    <ClInclude Include="..\support\minizip\ioapi.h" />\r
+    <ClInclude Include="..\support\minizip\iowin32.h" />\r
+    <ClInclude Include="..\support\minizip\unzip.h" />\r
+    <ClInclude Include="..\support\minizip\zip.h" />\r
     <ClInclude Include="..\support\mph.h" />\r
     <ClInclude Include="..\support\trees.h" />\r
     <ClInclude Include="..\support\zconf.h" />\r
+    <ClInclude Include="..\support\zlib.h" />\r
     <ClInclude Include="..\support\zutil.h" />\r
   </ItemGroup>\r
   <ItemGroup>\r
index 9df33f5e0d4580e92a5ec3325a5827f1df5a95d1..1cd4d6b86659f977351c9e9a6ab4f309af855c4f 100644 (file)
     <ClCompile Include="..\support\zutil.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\support\minizip\iowin32.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\support\minizip\minizip.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\support\minizip\unzip.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\support\minizip\zip.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\support\minizip\ioapi.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\support\crc32.h">\r
     <ClInclude Include="..\support\zutil.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\support\minizip\crypt.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\minizip\unzip.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\minizip\iowin32.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\minizip\zip.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\zlib.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\minizip\ioapi.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Header Files">\r
index 5a6e9116bd9759204af84f6bbdaa11fd2f611fb0..ad0d476fd93bb58a0f64d00d9978c38a414291e0 100644 (file)
@@ -96,7 +96,7 @@
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
       <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(MONO_JIT_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WINDOWS;__WIN32__;HOST_WIN32;TARGET_WIN32;__i386__;TARGET_X86;GC_NOT_DLL;GC_GCJ_SUPPORT;GC_WIN32_THREADS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;_DEBUG;_CONSOLE;_WINDOWS;__WIN32__;HOST_WIN32;TARGET_WIN32;__i386__;TARGET_X86;GC_NOT_DLL;GC_GCJ_SUPPORT;GC_WIN32_THREADS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <PrecompiledHeader>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
       <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_INCLUDE_DIR);$(MONO_JIT_INCLUDE_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WINDOWS;__WIN32__;HOST_WIN32;TARGET_WIN32;__i386__;TARGET_X86;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;_DEBUG;_CONSOLE;_WINDOWS;__WIN32__;HOST_WIN32;TARGET_WIN32;__i386__;TARGET_X86;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <PrecompiledHeader>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
     <ClCompile Include="..\mono\metadata\console-win32.c" />\r
     <ClCompile Include="..\mono\metadata\domain.c" />\r
     <ClCompile Include="..\mono\metadata\environment.c" />\r
+    <ClCompile Include="..\mono\metadata\file-io-windows.c" />\r
     <ClCompile Include="..\mono\metadata\file-io.c" />\r
     <ClCompile Include="..\mono\metadata\filewatcher.c" />\r
     <ClCompile Include="..\mono\metadata\gc.c" />\r
+    <ClCompile Include="..\mono\metadata\icall-windows.c" />\r
     <ClCompile Include="..\mono\metadata\icall.c" />\r
     <ClCompile Include="..\mono\metadata\image.c" />\r
     <ClCompile Include="..\mono\metadata\loader.c" />\r
     <ClCompile Include="..\mono\metadata\locales.c" />\r
+    <ClCompile Include="..\mono\metadata\marshal-windows.c" />\r
     <ClCompile Include="..\mono\metadata\marshal.c" />\r
     <ClCompile Include="..\mono\metadata\metadata.c" />\r
     <ClCompile Include="..\mono\metadata\monitor.c" />\r
     <ClCompile Include="..\mono\metadata\mono-config.c" />\r
     <ClCompile Include="..\mono\utils\mono-dl.c" />\r
     <ClCompile Include="..\mono\metadata\object.c" />\r
-    <ClCompile Include="..\mono\metadata\process.c" />\r
+    <ClCompile Include="..\mono\metadata\w32process.c" />\r
+    <ClCompile Include="..\mono\metadata\w32process-win32.c" />\r
     <ClCompile Include="..\mono\metadata\profiler.c" />\r
     <ClCompile Include="..\mono\metadata\rand.c" />\r
     <ClCompile Include="..\mono\metadata\reflection.c" />\r
index 7658bc13f5ccac3041bad6c063a548c009266315..72a54e162553c060c3b513b3724e503de4a7dff7 100644 (file)
     <ClCompile Include="..\mono\metadata\object.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\process.c">\r
+    <ClCompile Include="..\mono\metadata\w32process.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\w32process-win32.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\mono\metadata\profiler.c">\r
     <ClCompile Include="..\tools\pedump\pedump.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\marshal-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\icall-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mono\metadata\file-io-windows.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Header Files">\r
index 02ef2e45743d279ddbe795a9c3cb20ce3334647c..4c7e1dba13730b023206ef8b0b1da39c9aced209 100644 (file)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
+<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
index e958929f8e2f12ed3059b7ed98adbd07be2ab915..cece22ecd78d5ca0c055dff860963d787cbdd29d 100644 (file)
@@ -13,7 +13,7 @@
     </project>
     <project dir="class/corlib" library="corlib-basic">
       <boot>true</boot>
-      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -lib:./../../class/lib/basic -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -lib:./../../class/lib/basic -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
       <output>mscorlib.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/basic/mscorlib.dll</library_output>
@@ -35,7 +35,7 @@
     </project>
     <project dir="class/System" library="System-basic">
       <boot>true</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -lib:./../../class/lib/basic -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/basic/System.Xml.dll -r:./../../class/lib/basic/System.Configuration.dll -r:MonoSecurity=./../../class/lib/basic/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -lib:./../../class/lib/basic -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/basic/System.Xml.dll -r:./../../class/lib/basic/System.Configuration.dll -r:MonoSecurity=./../../class/lib/basic/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/basic/System.dll</library_output>
@@ -68,7 +68,7 @@
     </project>
     <project dir="class/corlib" library="corlib-build">
       <boot>true</boot>
-      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
       <output>mscorlib.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/mscorlib.dll</library_output>
@@ -90,7 +90,7 @@
     </project>
     <project dir="class/System" library="System-build">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/build/System.Xml.dll -r:./../../class/lib/build/System.Configuration.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/build/System.Xml.dll -r:./../../class/lib/build/System.Configuration.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-build">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-build">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/build/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/build/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/secxml/System.dll</library_output>
     </project>
     <project dir="class/Mono.Cecil" library="Mono.Cecil-build">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -keyfile:../mono.snk -d:NET_3_5 /publicsign -r:./../../class/lib/build/System.Core.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -keyfile:../mono.snk -d:NET_4_0 /publicsign -r:./../../class/lib/build/System.Core.dll</flags>
       <output>Mono.Cecil.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/Mono.Cecil.dll</library_output>
       <resources></resources>
       <response>Mono.Cecil.Mdb.dll.sources</response>
     </project>
+    <project dir="class/System.ComponentModel.Composition.4.5" library="System.ComponentModel.Composition-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -r:./../../class/lib/build/System.dll -r:./../../class/lib/build/System.Core.dll</flags>
+      <output>System.ComponentModel.Composition.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/build/System.ComponentModel.Composition.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Composition.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig /unsafe -nowarn:414 -r:./../../class/lib/build/System.dll</flags>
+      <output>System.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/build/System.Numerics.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -r:./../../class/lib/build/System.dll -r:./../../class/lib/build/System.Core.dll -r:./../../class/lib/build/System.Xml.dll</flags>
+      <output>System.Xml.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/build/System.Xml.Linq.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Xml.Linq.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime" library="Facades_System.Runtime-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll -r:./../../../class/lib/build/System.ComponentModel.Composition.dll -r:./../../../class/lib/build/System.Core.dll</flags>
+      <output>System.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Runtime.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection" library="Facades_System.Reflection-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Reflection.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Reflection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections" library="Facades_System.Collections-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll -r:./../../../class/lib/build/System.Core.dll</flags>
+      <output>System.Collections.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Collections.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Collections.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ResourceManager" library="Facades_System.Resources.ResourceManager-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Resources.ResourceManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Resources.ResourceManager.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Resources.ResourceManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization" library="Facades_System.Globalization-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Globalization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Globalization.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Globalization.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks" library="Facades_System.Threading.Tasks-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.Core.dll</flags>
+      <output>System.Threading.Tasks.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Threading.Tasks.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Concurrent" library="Facades_System.Collections.Concurrent-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll</flags>
+      <output>System.Collections.Concurrent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Collections.Concurrent.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Collections.Concurrent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding" library="Facades_System.Text.Encoding-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Text.Encoding.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO" library="Facades_System.IO-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll</flags>
+      <output>System.IO.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.IO.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.IO.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading" library="Facades_System.Threading-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll -r:./../../../class/lib/build/System.Core.dll</flags>
+      <output>System.Threading.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Threading.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Threading.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Debug" library="Facades_System.Diagnostics.Debug-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll</flags>
+      <output>System.Diagnostics.Debug.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Diagnostics.Debug.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Debug.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Expressions" library="Facades_System.Linq.Expressions-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.Core.dll</flags>
+      <output>System.Linq.Expressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Linq.Expressions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Linq.Expressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Dynamic.Runtime" library="Facades_System.Dynamic.Runtime-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.Core.dll -r:./../../../class/lib/build/System.dll</flags>
+      <output>System.Dynamic.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Dynamic.Runtime.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Dynamic.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq" library="Facades_System.Linq-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.Core.dll</flags>
+      <output>System.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Linq.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Linq.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks.Parallel" library="Facades_System.Threading.Tasks.Parallel-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Threading.Tasks.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Threading.Tasks.Parallel.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.ReaderWriter" library="Facades_System.Xml.ReaderWriter-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.Xml.dll</flags>
+      <output>System.Xml.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Xml.ReaderWriter.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Xml.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tools" library="Facades_System.Diagnostics.Tools-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll</flags>
+      <output>System.Diagnostics.Tools.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Diagnostics.Tools.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tools.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Primitives" library="Facades_System.Reflection.Primitives-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Reflection.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Reflection.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Extensions" library="Facades_System.Runtime.Extensions-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll</flags>
+      <output>System.Runtime.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Runtime.Extensions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Runtime.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices" library="Facades_System.Runtime.InteropServices-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.dll -r:./../../../class/lib/build/System.Core.dll</flags>
+      <output>System.Runtime.InteropServices.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Runtime.InteropServices.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.Extensions" library="Facades_System.Text.Encoding.Extensions-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Text.Encoding.Extensions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Numerics" library="Facades_System.Runtime.Numerics-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.Numerics.dll</flags>
+      <output>System.Runtime.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Runtime.Numerics.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Runtime.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XDocument" library="Facades_System.Xml.XDocument-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/build/System.Xml.Linq.dll -r:./../../../class/lib/build/System.Xml.dll</flags>
+      <output>System.Xml.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Xml.XDocument.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Xml.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Extensions" library="Facades_System.Reflection.Extensions-build">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/build/Facades/System.Reflection.Extensions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>build</profile>
+      <resources></resources>
+      <response>System.Reflection.Extensions.dll.sources</response>
+    </project>
     <project dir="mcs" library="mcs-build">
       <boot></boot>
       <flags>/codepage:65001 -debug -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_PROCESS_START -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../class/lib/build/mscorlib.dll -optimize /noconfig -r:System -r:System.Core -r:System.Xml</flags>
     </project>
     <project dir="tools/gacutil" library="gacutil-build">
       <boot></boot>
-      <flags>/codepage:65001 -unsafe -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -r:Mono.Security</flags>
+      <flags>/codepage:65001 -unsafe -define:NO_SYMBOL_WRITER -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -r:System -r:Mono.Security -r:System.Security</flags>
       <output>gacutil.exe</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/gacutil.exe</library_output>
     </project>
     <project dir="class/corlib" library="corlib-net_4_x">
       <boot>true</boot>
-      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -debug -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -debug -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
       <output>mscorlib.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/mscorlib.dll</library_output>
       <fx_version>4.5</fx_version>
       <profile>net_4_x</profile>
       <resources></resources>
-      <response>./../../build/deps/net_4_x_corlib.dll.sources</response>
+      <response>corlib.dll.sources</response>
     </project>
     <project dir="class/corlib" library="corlib-tests-net_4_x">
       <boot>false</boot>
-      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -debug -optimize -r:./../../class/lib/net_4_x/mscorlib.dll -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -debug -optimize -r:./../../class/lib/net_4_x/mscorlib.dll -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
       <output>net_4_x_corlib_test.dll</output>
       <built_sources></built_sources>
       <library_output>net_4_x_corlib_test.dll</library_output>
     </project>
     <project dir="class/System" library="System-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 -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
+      <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:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-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 -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav</flags>
+      <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:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-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 -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
+      <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:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/secxml/System.dll</library_output>
     </project>
     <project dir="class/System.Data" library="System.Data-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 -nowarn:169,219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Numerics.dll -r:./../../class/lib/net_4_x/System.EnterpriseServices.dll -r:./../../class/lib/net_4_x/Mono.Data.Tds.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Transactions.dll</flags>
+      <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 -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Numerics.dll -r:./../../class/lib/net_4_x/System.EnterpriseServices.dll -r:./../../class/lib/net_4_x/Mono.Data.Tds.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Transactions.dll</flags>
       <output>System.Data.dll</output>
       <built_sources>gen_OdbcConnection.cs gen_OleDbConnection.cs gen_OdbcParameter.cs gen_OleDbParameter.cs gen_OdbcParameterCollection.cs gen_OleDbParameterCollection.cs</built_sources>
       <library_output>./../../class/lib/net_4_x/System.Data.dll</library_output>
     </project>
     <project dir="class/System.Data" library="System.Data-tests-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 -r:./../../class/lib/net_4_x/System.Data.dll -nowarn:169,219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Numerics.dll -r:./../../class/lib/net_4_x/System.EnterpriseServices.dll -r:./../../class/lib/net_4_x/Mono.Data.Tds.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -nowarn:618,169,612,219,168</flags>
+      <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 -r:./../../class/lib/net_4_x/System.Data.dll -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Numerics.dll -r:./../../class/lib/net_4_x/System.EnterpriseServices.dll -r:./../../class/lib/net_4_x/Mono.Data.Tds.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -nowarn:618,169,612,219,168</flags>
       <output>net_4_x_System.Data_test.dll</output>
       <built_sources>gen_OdbcConnection.cs gen_OleDbConnection.cs gen_OdbcParameter.cs gen_OleDbParameter.cs gen_OdbcParameterCollection.cs gen_OleDbParameterCollection.cs</built_sources>
       <library_output>net_4_x_System.Data_test.dll</library_output>
     </project>
     <project dir="class/System.IdentityModel" library="System.IdentityModel-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:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
+      <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:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
       <output>System.IdentityModel.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/System.IdentityModel.dll</library_output>
       <fx_version>4.5</fx_version>
       <profile>net_4_x</profile>
       <resources></resources>
-      <response>System.IdentityModel.dll.sources</response>
+      <response>./../../build/deps/net_4_x_System.IdentityModel.dll.sources</response>
     </project>
     <project dir="class/System.IdentityModel" library="System.IdentityModel-tests-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 -r:./../../class/lib/net_4_x/System.IdentityModel.dll /d:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
+      <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 -r:./../../class/lib/net_4_x/System.IdentityModel.dll /d:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
       <output>net_4_x_System.IdentityModel_test.dll</output>
       <built_sources></built_sources>
       <library_output>net_4_x_System.IdentityModel_test.dll</library_output>
     </project>
     <project dir="class/System.ServiceModel" library="System.ServiceModel-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 /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -define:HAS_ACTIVATION -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Data.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../class/lib/net_4_x/System.IdentityModel.Selectors.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -r:./../../class/lib/net_4_x/System.Messaging.dll -r:./../../class/lib/net_4_x/System.Web.Services.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.ServiceModel.Activation.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
+      <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 /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -define:HAS_ACTIVATION -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Data.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.IdentityModel.Selectors.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -r:./../../class/lib/net_4_x/System.Messaging.dll -r:./../../class/lib/net_4_x/System.Web.Services.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.ServiceModel.Activation.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
       <output>System.ServiceModel.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/System.ServiceModel.dll</library_output>
     </project>
     <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-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 -r:./../../class/lib/net_4_x/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Data.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../class/lib/net_4_x/System.IdentityModel.Selectors.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -r:./../../class/lib/net_4_x/System.Messaging.dll -r:./../../class/lib/net_4_x/System.Web.Services.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
+      <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 -r:./../../class/lib/net_4_x/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Data.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.IdentityModel.Selectors.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -r:./../../class/lib/net_4_x/System.Messaging.dll -r:./../../class/lib/net_4_x/System.Web.Services.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
       <output>net_4_x_System.ServiceModel_test.dll</output>
       <built_sources></built_sources>
       <library_output>net_4_x_System.ServiceModel_test.dll</library_output>
     </project>
     <project dir="class/System.ServiceModel" library="System.ServiceModel-plainservice-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 /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Data.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../class/lib/net_4_x/System.IdentityModel.Selectors.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -r:./../../class/lib/net_4_x/System.Messaging.dll -r:./../../class/lib/net_4_x/System.Web.Services.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
+      <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 /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Data.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.IdentityModel.Selectors.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -r:./../../class/lib/net_4_x/System.Messaging.dll -r:./../../class/lib/net_4_x/System.Web.Services.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
       <output>System.ServiceModel.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/plainservice/System.ServiceModel.dll</library_output>
     </project>
     <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-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 -r:./../../class/lib/net_4_x/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Data.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../class/lib/net_4_x/System.IdentityModel.Selectors.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -r:./../../class/lib/net_4_x/System.Messaging.dll -r:./../../class/lib/net_4_x/System.Web.Services.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
+      <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 -r:./../../class/lib/net_4_x/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/System.Runtime.Serialization.dll -r:./../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:./../../class/lib/net_4_x/System.Data.dll -r:./../../class/lib/net_4_x/System.Security.dll -r:./../../class/lib/net_4_x/System.IdentityModel.Selectors.dll -r:./../../class/lib/net_4_x/System.Transactions.dll -r:./../../class/lib/net_4_x/System.Messaging.dll -r:./../../class/lib/net_4_x/System.Web.Services.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/System.Web.ApplicationServices.dll</flags>
       <output>net_4_x_System.ServiceModel_test.dll</output>
       <built_sources></built_sources>
       <library_output>net_4_x_System.ServiceModel_test.dll</library_output>
       <resources></resources>
       <response>./../../../build/deps/net_4_x_I18N.CJK_test.dll.response</response>
     </project>
+    <project dir="class/Mono.Btls.Interface" library="Mono.Btls.Interface-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.Btls.Interface.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/net_4_x/Mono.Btls.Interface.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>net_4_x</profile>
+      <resources></resources>
+      <response>Mono.Btls.Interface.dll.sources</response>
+    </project>
     <project dir="class/Mono.Http" library="Mono.Http-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 -nowarn:618 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Web.dll -r:./../../class/lib/net_4_x/ICSharpCode.SharpZipLib.dll -r:./../../class/lib/net_4_x/Mono.Security.dll</flags>
     </project>
     <project dir="class/Mono.Cecil" library="Mono.Cecil-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 -keyfile:../mono.snk -d:NET_3_5 /publicsign -r:./../../class/lib/net_4_x/System.Core.dll</flags>
+      <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 -keyfile:../../mono.snk -d:NET_3_5 /publicsign -r:./../../../class/lib/net_4_x/System.Core.dll</flags>
       <output>Mono.Cecil.dll</output>
       <built_sources></built_sources>
-      <library_output>./../../class/lib/net_4_x/Mono.Cecil.dll</library_output>
+      <library_output>./../../../class/lib/net_4_x/legacy/Mono.Cecil.dll</library_output>
       <fx_version>4.5</fx_version>
       <profile>net_4_x</profile>
       <resources></resources>
     </project>
     <project dir="class/Mono.CodeContracts" library="Mono.CodeContracts-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.Core.dll -r:./../../class/lib/net_4_x/Mono.Cecil.dll -r:./../../class/lib/net_4_x/Mono.Cecil.Mdb.dll</flags>
+      <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 -nowarn:618 -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Core.dll -r:./../../class/lib/net_4_x/Mono.Cecil.dll -r:./../../class/lib/net_4_x/Mono.Cecil.Mdb.dll</flags>
       <output>Mono.CodeContracts.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/Mono.CodeContracts.dll</library_output>
       <resources></resources>
       <response>System.Reflection.Context.dll.sources</response>
     </project>
+    <project dir="class/legacy/Mono.Cecil" library="Mono.Cecil-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 -keyfile:../../mono.snk -d:NET_3_5 /publicsign -r:./../../../class/lib/net_4_x/System.Core.dll</flags>
+      <output>Mono.Cecil.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/net_4_x/legacy/Mono.Cecil.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>net_4_x</profile>
+      <resources></resources>
+      <response>Mono.Cecil.dll.sources</response>
+    </project>
     <project dir="class/Facades/System.Security.Cryptography.X509Certificates" library="Facades_System.Security.Cryptography.X509Certificates-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll -r:./../../../class/lib/net_4_x/System.Core.dll</flags>
     </project>
     <project dir="class/Facades/System.ServiceModel.Primitives" library="Facades_System.ServiceModel.Primitives-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 /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll -r:./../../../class/lib/net_4_x/System.ServiceModel.dll -r:./../../../class/lib/net_4_x/System.Xml.dll -r:./../../../class/lib/net_4_x/Facades/System.Security.Cryptography.X509Certificates.dll -r:./../../../class/lib/net_4_x/System.IdentityModel.dll</flags>
+      <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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll -r:./../../../class/lib/net_4_x/System.ServiceModel.dll -r:./../../../class/lib/net_4_x/System.Xml.dll -r:./../../../class/lib/net_4_x/System.IdentityModel.dll -r:./../../../class/lib/net_4_x/Facades/System.Security.Cryptography.X509Certificates.dll</flags>
       <output>System.ServiceModel.Primitives.dll</output>
       <built_sources></built_sources>
       <library_output>./../../../class/lib/net_4_x/Facades/System.ServiceModel.Primitives.dll</library_output>
       <resources></resources>
       <response>System.IO.FileSystem.AccessControl.dll.sources</response>
     </project>
-    <project dir="class/Facades/System.Private.CoreLib.InteropServices" library="Facades_System.Private.CoreLib.InteropServices-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll</flags>
-      <output>System.Private.CoreLib.InteropServices.dll</output>
-      <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Private.CoreLib.InteropServices.dll</library_output>
-      <fx_version>4.5</fx_version>
-      <profile>net_4_x</profile>
-      <resources></resources>
-      <response>System.Private.CoreLib.InteropServices.dll.sources</response>
-    </project>
     <project dir="class/Facades/System.Reflection.TypeExtensions" library="Facades_System.Reflection.TypeExtensions-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 /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll</flags>
       <resources></resources>
       <response>System.Reflection.TypeExtensions.dll.sources</response>
     </project>
-    <project dir="class/Facades/System.Security.SecureString" library="Facades_System.Security.SecureString-net_4_x">
+    <project dir="class/Facades/System.Reflection.Emit.Lightweight" library="Facades_System.Reflection.Emit.Lightweight-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 /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll</flags>
-      <output>System.Security.SecureString.dll</output>
+      <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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.Lightweight.dll</output>
       <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Security.SecureString.dll</library_output>
+      <library_output>./../../../class/lib/net_4_x/Facades/System.Reflection.Emit.Lightweight.dll</library_output>
       <fx_version>4.5</fx_version>
       <profile>net_4_x</profile>
       <resources></resources>
-      <response>System.Security.SecureString.dll.sources</response>
+      <response>System.Reflection.Emit.Lightweight.dll.sources</response>
     </project>
-    <project dir="class/Facades/System.Threading.AccessControl" library="Facades_System.Threading.AccessControl-net_4_x">
+    <project dir="class/Facades/System.Reflection.Emit.ILGeneration" library="Facades_System.Reflection.Emit.ILGeneration-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 /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll</flags>
-      <output>System.Threading.AccessControl.dll</output>
+      <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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.ILGeneration.dll</output>
       <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Threading.AccessControl.dll</library_output>
+      <library_output>./../../../class/lib/net_4_x/Facades/System.Reflection.Emit.ILGeneration.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>net_4_x</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.ILGeneration.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit" library="Facades_System.Reflection.Emit-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/net_4_x/Facades/System.Reflection.Emit.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>net_4_x</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.SecureString" library="Facades_System.Security.SecureString-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 /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll</flags>
+      <output>System.Security.SecureString.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/net_4_x/Facades/System.Security.SecureString.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>net_4_x</profile>
+      <resources></resources>
+      <response>System.Security.SecureString.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.AccessControl" library="Facades_System.Threading.AccessControl-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 /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll</flags>
+      <output>System.Threading.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/net_4_x/Facades/System.Threading.AccessControl.dll</library_output>
       <fx_version>4.5</fx_version>
       <profile>net_4_x</profile>
       <resources></resources>
       <resources></resources>
       <response>System.Xml.XPath.XDocument.dll.sources</response>
     </project>
-    <project dir="class/Facades/System.Security.Cryptography.Algorithms" library="Facades_System.Security.Cryptography.Algorithms-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 /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll -r:./../../../class/lib/net_4_x/System.Core.dll</flags>
-      <output>System.Security.Cryptography.Algorithms.dll</output>
-      <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Security.Cryptography.Algorithms.dll</library_output>
-      <fx_version>4.5</fx_version>
-      <profile>net_4_x</profile>
-      <resources></resources>
-      <response>System.Security.Cryptography.Algorithms.dll.sources</response>
-    </project>
     <project dir="class/Facades/System.Security.Cryptography.Primitives" library="Facades_System.Security.Cryptography.Primitives-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll</flags>
       <resources></resources>
       <response>System.IO.Pipes.dll.sources</response>
     </project>
-    <project dir="class/Facades/System.Reflection.Emit.ILGeneration" library="Facades_System.Reflection.Emit.ILGeneration-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
-      <output>System.Reflection.Emit.ILGeneration.dll</output>
-      <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Reflection.Emit.ILGeneration.dll</library_output>
-      <fx_version>4.5</fx_version>
-      <profile>net_4_x</profile>
-      <resources></resources>
-      <response>System.Reflection.Emit.ILGeneration.dll.sources</response>
-    </project>
-    <project dir="class/Facades/System.Reflection.Emit.Lightweight" library="Facades_System.Reflection.Emit.Lightweight-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
-      <output>System.Reflection.Emit.Lightweight.dll</output>
-      <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Reflection.Emit.Lightweight.dll</library_output>
-      <fx_version>4.5</fx_version>
-      <profile>net_4_x</profile>
-      <resources></resources>
-      <response>System.Reflection.Emit.Lightweight.dll.sources</response>
-    </project>
-    <project dir="class/Facades/System.Reflection.Emit" library="Facades_System.Reflection.Emit-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
-      <output>System.Reflection.Emit.dll</output>
-      <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Reflection.Emit.dll</library_output>
-      <fx_version>4.5</fx_version>
-      <profile>net_4_x</profile>
-      <resources></resources>
-      <response>System.Reflection.Emit.dll.sources</response>
-    </project>
-    <project dir="class/Facades/System.Diagnostics.PerformanceCounter" library="Facades_System.Diagnostics.PerformanceCounter-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll</flags>
-      <output>System.Diagnostics.PerformanceCounter.dll</output>
-      <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Diagnostics.PerformanceCounter.dll</library_output>
-      <fx_version>4.5</fx_version>
-      <profile>net_4_x</profile>
-      <resources></resources>
-      <response>System.Diagnostics.PerformanceCounter.dll.sources</response>
-    </project>
-    <project dir="class/Facades/System.Net.Http.WebRequestHandler" library="Facades_System.Net.Http.WebRequestHandler-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 -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/net_4_x/System.dll -r:./../../../class/lib/net_4_x/System.Net.Http.WebRequest.dll -r:./../../../class/lib/net_4_x/System.Net.Http.dll</flags>
-      <output>System.Net.Http.WebRequestHandler.dll</output>
-      <built_sources></built_sources>
-      <library_output>./../../../class/lib/net_4_x/Facades/System.Net.Http.WebRequestHandler.dll</library_output>
-      <fx_version>4.5</fx_version>
-      <profile>net_4_x</profile>
-      <resources></resources>
-      <response>System.Net.Http.WebRequestHandler.dll.sources</response>
-    </project>
     <project dir="nunit24/NUnitFramework/framework" library="NUnit.Framework-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:StronglyNamedAssembly -warn:1 /publicsign -r:./../../../class/lib/net_4_x/System.Xml.dll -r:./../../../class/lib/net_4_x/System.dll</flags>
     </project>
     <project dir="tools/gacutil" library="gacutil-net_4_x">
       <boot></boot>
-      <flags>/codepage:65001 -unsafe -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:Mono.Security</flags>
+      <flags>/codepage:65001 -unsafe -define:NO_SYMBOL_WRITER -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:System -r:Mono.Security -r:System.Security</flags>
       <output>gacutil.exe</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/gacutil.exe</library_output>
       <resources></resources>
       <response>monolinker.exe.sources</response>
     </project>
-    <project dir="tools/tuner" library="Mono.Tuner-net_4_x">
-      <boot>false</boot>
-      <flags>/codepage:65001 -r:./../../class/lib/net_4_x/monolinker.exe -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.Core.dll -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/Mono.Cecil.dll</flags>
-      <output>Mono.Tuner.dll</output>
-      <built_sources></built_sources>
-      <library_output>./../../class/lib/net_4_x/Mono.Tuner.dll</library_output>
-      <fx_version>4.5</fx_version>
-      <profile>net_4_x</profile>
-      <resources></resources>
-      <response>Mono.Tuner.dll.sources</response>
-    </project>
     <project dir="tools/culevel" library="culevel-net_4_x">
       <boot></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:System -r:System.Xml</flags>
     </project>
     <project dir="tools/mkbundle" library="mkbundle-net_4_x">
       <boot></boot>
-      <flags>/codepage:65001 -resource:template.c -resource:template_z.c -resource:template_main.c -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -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:System.Xml -r:System -r:System.Core</flags>
+      <flags>/codepage:65001 -resource:template.c -resource:template_z.c -resource:template_main.c -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -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:System.Xml -r:System -r:System.Core -r:System.IO.Compression.FileSystem</flags>
       <output>mkbundle.exe</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/mkbundle.exe</library_output>
     </project>
     <project dir="tools/gacutil" library="gacutil-net_4_x">
       <boot></boot>
-      <flags>/codepage:65001 -unsafe -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:Mono.Security</flags>
+      <flags>/codepage:65001 -unsafe -define:NO_SYMBOL_WRITER -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:System -r:Mono.Security -r:System.Security</flags>
       <output>gacutil.exe</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/gacutil.exe</library_output>
     </project>
     <project dir="tools/mono-api-html" library="mono-api-html-net_4_x">
       <boot></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:Mono.Cecil -r:System.Xml -r:System.Core -r:System -r:System.Xml.Linq</flags>
+      <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:System.Xml -r:System.Core -r:System -r:System.Xml.Linq</flags>
       <output>mono-api-html.exe</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/mono-api-html.exe</library_output>
       <resources></resources>
       <response>pdb2mdb.exe.sources</response>
     </project>
-    <project dir="tools/SqlSharp" library="sqlsharp-net_4_x">
+    <project dir="tools/sqlsharp" library="sqlsharp-net_4_x">
       <boot></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:System -r:System.Xml -r:System.Data</flags>
       <output>sqlsharp.exe</output>
     <project dir="tools/mdoc" library="mdoc-net_4_x">
       <boot></boot>
       <flags>/codepage:65001 /resource:../../class/monodoc/Resources/mdoc-html-format.xsl,mdoc-html-format.xsl /resource:../../class/monodoc/Resources/mdoc-html-utils.xsl,mdoc-html-utils.xsl /resource:../../class/monodoc/Resources/mdoc-sections-css.xsl,mdoc-sections-css.xsl /resource:../../class/monodoc/Resources/mono-ecma-css.xsl,mono-ecma-css.xsl /resource:Resources/defaulttemplate.xsl,defaulttemplate.xsl /resource:Resources/monodoc-ecma.xsd,monodoc-ecma.xsd /resource:Resources/msitomsx.xsl,msitomsx.xsl /resource:Resources/overview.xsl,overview.xsl /resource:Resources/stylesheet.xsl,stylesheet.xsl -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:monodoc -r:System -r:System.Xml -r:System.Core -r:Mono.Cecil -r:ICSharpCode.SharpZipLib -r:System.Xml.Linq -r:System.Web</flags>
-      <output>mdoc.exe</output>
+      <output>./../../class/lib/net_4_x/mdoc.exe</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/mdoc.exe</library_output>
       <fx_version>4.5</fx_version>
     </project>
     <project dir="tools/mono-symbolicate" library="mono-symbolicate-net_4_x">
       <boot></boot>
-      <flags>/codepage:65001 /D:NO_AUTHENTICODE -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:Mono.Cecil -r:Mono.Cecil.Mdb -r:System.Xml -r:System.Core -r:System</flags>
+      <flags>/codepage:65001 /D:NO_AUTHENTICODE /D:CECIL -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:System.Xml -r:System.Core -r:System</flags>
       <output>mono-symbolicate.exe</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/mono-symbolicate.exe</library_output>
       <resources></resources>
       <response>linkeranalyzer.exe.sources</response>
     </project>
+    <project dir="tools/btls" library="btls-cert-sync-net_4_x">
+      <boot></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:System -r:Mono.Security -r:Mono.Btls.Interface</flags>
+      <output>btls-cert-sync.exe</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/net_4_x/btls-cert-sync.exe</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>net_4_x</profile>
+      <resources></resources>
+      <response>btls-cert-sync.exe.sources</response>
+    </project>
     <project dir="class/Microsoft.Build.Framework" library="Microsoft.Build.Framework-xbuild_12">
       <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 -d:XBUILD_12 -optimize /noconfig -r:./../../class/lib/xbuild_12/../net_4_x/System.dll</flags>
       <resources></resources>
       <response>xbuild.exe.sources</response>
     </project>
+    <project dir="class/corlib" library="corlib-monodroid">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/mscorlib.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>corlib.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030,3009 -r:./../../class/lib/monodroid/bare/System.dll</flags>
+      <output>Mono.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/Mono.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_Mono.Security.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monodroid/System.Xml.dll -r:MonoSecurity=./../../class/lib/monodroid/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-bare-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/bare/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-secxml-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monodroid/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monodroid/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/secxml/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR,FEATURE_REFEMIT -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR,FEATURE_REFEMIT -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/plaincore/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/monodroid/secxml/System.dll -r:./../../class/lib/monodroid/bare/System.Xml.dll -r:./../../class/lib/monodroid/Mono.Security.dll</flags>
+      <output>System.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Security.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monodroid/secxml/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monodroid/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/bare/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Common" library="I18N-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig</flags>
+      <output>I18N.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/I18N.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>I18N.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/monodroid/I18N.dll</flags>
+      <output>I18N.West.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/I18N.West.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>I18N.West.dll.sources</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/monodroid/I18N.dll</flags>
+      <output>I18N.MidEast.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/I18N.MidEast.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>I18N.MidEast.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Other" library="I18N.Other-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/monodroid/I18N.dll</flags>
+      <output>I18N.Other.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/I18N.Other.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>I18N.Other.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Rare" library="I18N.Rare-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/monodroid/I18N.dll</flags>
+      <output>I18N.Rare.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/I18N.Rare.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>I18N.Rare.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/monodroid/I18N.dll</flags>
+      <output>I18N.CJK.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/I18N.CJK.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>I18N.CJK.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel.Internals" library="System.ServiceModel.Internals-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /unsafe -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.ServiceModel.Internals.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.ServiceModel.Internals.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Internals.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NO_CONFIGURATION /d:NO_SECURITY_ATTRIBUTES /d:NO_CODEDOM /d:NO_DESKTOP_SECURITY -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.ServiceModel.Internals.dll</flags>
+      <output>System.Runtime.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Runtime.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Runtime.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:FEATURE_SERIALIZATION -d:MONO_HYBRID_SYSTEM_XML -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.Runtime.Serialization.dll</flags>
+      <output>System.Xml.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Xml.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.Linq.dll.sources</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /d:NET_3_0 -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.Security.dll -r:./../../class/lib/monodroid/Mono.Security.dll -r:./../../class/lib/monodroid/System.Runtime.Serialization.dll</flags>
+      <output>System.IdentityModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.IdentityModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.IdentityModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Runtime.Serialization.dll -r:./../../class/lib/monodroid/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-plainservice-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Runtime.Serialization.dll -r:./../../class/lib/monodroid/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/plainservice/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.Runtime.Serialization.dll -r:./../../class/lib/monodroid/System.ServiceModel.dll -r:./../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.ServiceModel.Web.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.ServiceModel.Web.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.ServiceModel.Web.dll.sources</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Json.dll.sources</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:649 -nowarn:169 -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Web.Services.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Web.Services.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Web.Services.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Tds" library="Mono.Data.Tds-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/Mono.Security.dll</flags>
+      <output>Mono.Data.Tds.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/Mono.Data.Tds.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Mono.Data.Tds.dll.sources</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /define:MOBILE -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Transactions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Transactions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Transactions.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /unsafe -nowarn:414 -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics.Vectors" library="System.Numerics.Vectors-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -unsafe -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Numerics.dll</flags>
+      <output>System.Numerics.Vectors.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Numerics.Vectors.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Numerics.Vectors.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Numerics.dll -r:./../../class/lib/monodroid/Mono.Data.Tds.dll -r:./../../class/lib/monodroid/System.Transactions.dll</flags>
+      <output>System.Data.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Data.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Data.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Data.dll -r:./../../class/lib/monodroid/System.Transactions.dll -r:./../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>Mono.Data.Sqlite.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/Mono.Data.Sqlite.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Mono.Data.Sqlite.dll.sources</response>
+    </project>
+    <project dir="class/System.Data.Services.Client" library="System.Data.Services.Client-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:NET_3_5 -warn:2 -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Xml.Linq.dll -r:./../../class/lib/monodroid/System.Data.dll -r:./../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Data.Services.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Data.Services.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources>System.Data.Services.Client,Client/System.Data.Services.Client.txt</resources>
+      <response>System.Data.Services.Client.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /unsafe -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.IO.Compression.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.IO.Compression.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.Compression.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.IO.Compression.dll</flags>
+      <output>System.IO.Compression.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.IO.Compression.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.Compression.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:414 -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Data.dll -r:./../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.ComponentModel.DataAnnotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.ComponentModel.DataAnnotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ComponentModel.DataAnnotations.dll.sources</response>
+    </project>
+    <project dir="class/System.ComponentModel.Composition.4.5" library="System.ComponentModel.Composition-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.ComponentModel.Composition.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.ComponentModel.Composition.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources>Microsoft.Internal.Strings,src/ComponentModel/Strings.resx</resources>
+      <response>System.ComponentModel.Composition.dll.sources</response>
+    </project>
+    <project dir="class/System.Net" library="System.Net-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -unsafe -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Net.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Net.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:XAMARIN_MODERN -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Net.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>./../../build/deps/monodroid_System.Net.Http.dll.sources</response>
+    </project>
+    <project dir="class/System.Windows" library="System.Windows-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -optimize /noconfig -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Windows.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Serialization" library="System.Xml.Serialization-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -optimize /noconfig -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.ServiceModel.dll</flags>
+      <output>System.Xml.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Xml.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:MONO_FEATURE_THREAD_ABORT -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/System.Xml.dll -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/Mono.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Microsoft.CSharp" library="Microsoft.CSharp-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.Core.dll -r:./../../class/lib/monodroid/Mono.CSharp.dll</flags>
+      <output>Microsoft.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/Microsoft.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Microsoft.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.InteropServices.RuntimeInformation" library="System.Runtime.InteropServices.RuntimeInformation-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Runtime.InteropServices.RuntimeInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Runtime.InteropServices.RuntimeInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.RuntimeInformation.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.DispatchProxy" library="System.Reflection.DispatchProxy-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Reflection.DispatchProxy.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Reflection.DispatchProxy.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.DispatchProxy.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.XPath.XmlDocument" library="System.Xml.XPath.XmlDocument-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Xml.XPath.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Xml.XPath.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.Context" library="System.Reflection.Context-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>System.Reflection.Context.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Reflection.Context.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.Context.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http.WinHttpHandler" library="System.Net.Http.WinHttpHandler-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/System.Net.Http.dll</flags>
+      <output>System.Net.Http.WinHttpHandler.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/System.Net.Http.WinHttpHandler.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Http.WinHttpHandler.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CompilerServices.SymbolWriter" library="Mono.CompilerServices.SymbolWriter-monodroid">
+      <boot>true</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/monodroid/System.dll</flags>
+      <output>Mono.CompilerServices.SymbolWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/Mono.CompilerServices.SymbolWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Mono.CompilerServices.SymbolWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.X509Certificates" library="Facades_System.Security.Cryptography.X509Certificates-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Security.Cryptography.X509Certificates.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.X509Certificates.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.X509Certificates.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Primitives" library="Facades_System.ServiceModel.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.ServiceModel.dll -r:./../../../class/lib/monodroid/System.Xml.dll -r:./../../../class/lib/monodroid/System.IdentityModel.dll -r:./../../../class/lib/monodroid/Facades/System.Security.Cryptography.X509Certificates.dll</flags>
+      <output>System.ServiceModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ServiceModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Primitives" library="Facades_System.Runtime.Serialization.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.Serialization.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Xml" library="Facades_System.Runtime.Serialization.Xml-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /d:NO_CODEDOM -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Runtime.Serialization.dll -r:./../../../class/lib/monodroid/System.Xml.dll -r:./../../../class/lib/monodroid/Facades/System.Runtime.Serialization.Primitives.dll</flags>
+      <output>System.Runtime.Serialization.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.Serialization.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Xml.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Algorithms" library="Facades_System.Security.Cryptography.Algorithms-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.OpenSsl" library="Facades_System.Security.Cryptography.OpenSsl-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Core.dll -r:./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Algorithms.dll</flags>
+      <output>System.Security.Cryptography.OpenSsl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.OpenSsl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.OpenSsl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Concurrent" library="Facades_System.Collections.Concurrent-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Collections.Concurrent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Collections.Concurrent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Collections.Concurrent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections" library="Facades_System.Collections-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Collections.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Collections.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Collections.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Annotations" library="Facades_System.ComponentModel.Annotations-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.ComponentModel.DataAnnotations.dll</flags>
+      <output>System.ComponentModel.Annotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ComponentModel.Annotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Annotations.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.EventBasedAsync" library="Facades_System.ComponentModel.EventBasedAsync-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.ComponentModel.EventBasedAsync.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ComponentModel.EventBasedAsync.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ComponentModel.EventBasedAsync.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel" library="Facades_System.ComponentModel-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.ComponentModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ComponentModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ComponentModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Contracts" library="Facades_System.Diagnostics.Contracts-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Contracts.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.Contracts.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Contracts.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Debug" library="Facades_System.Diagnostics.Debug-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Diagnostics.Debug.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.Debug.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Debug.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tracing" library="Facades_System.Diagnostics.Tracing-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Tracing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.Tracing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tracing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tools" library="Facades_System.Diagnostics.Tools-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Diagnostics.Tools.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.Tools.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tools.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Dynamic.Runtime" library="Facades_System.Dynamic.Runtime-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Core.dll -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Dynamic.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Dynamic.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Dynamic.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization" library="Facades_System.Globalization-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Globalization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Globalization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Globalization.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO" library="Facades_System.IO-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.IO.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Expressions" library="Facades_System.Linq.Expressions-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Linq.Expressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Linq.Expressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Linq.Expressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Parallel" library="Facades_System.Linq.Parallel-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Linq.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Linq.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Linq.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Queryable" library="Facades_System.Linq.Queryable-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Linq.Queryable.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Linq.Queryable.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Linq.Queryable.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq" library="Facades_System.Linq-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Linq.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NetworkInformation" library="Facades_System.Net.NetworkInformation-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.NetworkInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.NetworkInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.NetworkInformation.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Primitives" library="Facades_System.Net.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Requests" library="Facades_System.Net.Requests-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Requests.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.Requests.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Requests.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ObjectModel" library="Facades_System.ObjectModel-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.ObjectModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ObjectModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ObjectModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Extensions" library="Facades_System.Reflection.Extensions-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Reflection.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Primitives" library="Facades_System.Reflection.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Reflection.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection" library="Facades_System.Reflection-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Reflection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ResourceManager" library="Facades_System.Resources.ResourceManager-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Resources.ResourceManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Resources.ResourceManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Resources.ResourceManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Extensions" library="Facades_System.Runtime.Extensions-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Runtime.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices" library="Facades_System.Runtime.InteropServices-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Runtime.InteropServices.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.InteropServices.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices.WindowsRuntime" library="Facades_System.Runtime.InteropServices.WindowsRuntime-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Runtime.InteropServices.WindowsRuntime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.InteropServices.WindowsRuntime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.WindowsRuntime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Numerics" library="Facades_System.Runtime.Numerics-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Numerics.dll</flags>
+      <output>System.Runtime.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Json" library="Facades_System.Runtime.Serialization.Json-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.Serialization.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Json.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime" library="Facades_System.Runtime-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.ComponentModel.Composition.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal" library="Facades_System.Security.Principal-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Security.Principal.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Principal.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Principal.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Http" library="Facades_System.ServiceModel.Http-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ServiceModel.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Http.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Security" library="Facades_System.ServiceModel.Security-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ServiceModel.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.Extensions" library="Facades_System.Text.Encoding.Extensions-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Text.Encoding.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding" library="Facades_System.Text.Encoding-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Text.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.RegularExpressions" library="Facades_System.Text.RegularExpressions-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Text.RegularExpressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Text.RegularExpressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Text.RegularExpressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks.Parallel" library="Facades_System.Threading.Tasks.Parallel-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Threading.Tasks.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Threading.Tasks.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks" library="Facades_System.Threading.Tasks-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Threading.Tasks.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Threading.Tasks.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Timer" library="Facades_System.Threading.Timer-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Threading.Timer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Threading.Timer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Threading.Timer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading" library="Facades_System.Threading-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Threading.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Threading.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Threading.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.ReaderWriter" library="Facades_System.Xml.ReaderWriter-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Xml.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Xml.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XDocument" library="Facades_System.Xml.XDocument-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Xml.Linq.dll -r:./../../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Xml.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Xml.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlSerializer" library="Facades_System.Xml.XmlSerializer-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Xml.XmlSerializer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Xml.XmlSerializer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.XmlSerializer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Handles" library="Facades_System.Runtime.Handles-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Runtime.Handles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.Handles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.Handles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Duplex" library="Facades_System.ServiceModel.Duplex-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Duplex.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ServiceModel.Duplex.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Duplex.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.NetTcp" library="Facades_System.ServiceModel.NetTcp-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.NetTcp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ServiceModel.NetTcp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ServiceModel.NetTcp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Primitives" library="Facades_Microsoft.Win32.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>Microsoft.Win32.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/Microsoft.Win32.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry" library="Facades_Microsoft.Win32.Registry-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>Microsoft.Win32.Registry.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/Microsoft.Win32.Registry.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.AppContext" library="Facades_System.AppContext-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.AppContext.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.AppContext.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.AppContext.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.NonGeneric" library="Facades_System.Collections.NonGeneric-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Collections.NonGeneric.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Collections.NonGeneric.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Collections.NonGeneric.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Specialized" library="Facades_System.Collections.Specialized-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Collections.Specialized.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Collections.Specialized.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Collections.Specialized.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Primitives" library="Facades_System.ComponentModel.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.ComponentModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ComponentModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.TypeConverter" library="Facades_System.ComponentModel.TypeConverter-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.ComponentModel.TypeConverter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ComponentModel.TypeConverter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ComponentModel.TypeConverter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Console" library="Facades_System.Console-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Console.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Console.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Console.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.Common" library="Facades_System.Data.Common-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Data.dll -r:./../../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Data.Common.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Data.Common.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Data.Common.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.SqlClient" library="Facades_System.Data.SqlClient-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Data.dll -r:./../../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Data.SqlClient.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Data.SqlClient.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Data.SqlClient.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.FileVersionInfo" library="Facades_System.Diagnostics.FileVersionInfo-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Diagnostics.FileVersionInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.FileVersionInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.FileVersionInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Process" library="Facades_System.Diagnostics.Process-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Diagnostics.Process.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.Process.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Process.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TextWriterTraceListener" library="Facades_System.Diagnostics.TextWriterTraceListener-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Diagnostics.TextWriterTraceListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.TextWriterTraceListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TextWriterTraceListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceEvent" library="Facades_System.Diagnostics.TraceEvent-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Diagnostics.TraceEvent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.TraceEvent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceEvent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceSource" library="Facades_System.Diagnostics.TraceSource-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Diagnostics.TraceSource.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.TraceSource.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceSource.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Calendars" library="Facades_System.Globalization.Calendars-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Globalization.Calendars.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Globalization.Calendars.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Globalization.Calendars.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Compression.ZipFile" library="Facades_System.IO.Compression.ZipFile-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.IO.Compression.FileSystem.dll</flags>
+      <output>System.IO.Compression.ZipFile.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.Compression.ZipFile.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.Compression.ZipFile.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem" library="Facades_System.IO.FileSystem-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.IO.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.DriveInfo" library="Facades_System.IO.FileSystem.DriveInfo-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.IO.FileSystem.DriveInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.FileSystem.DriveInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.DriveInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Primitives" library="Facades_System.IO.FileSystem.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.IO.FileSystem.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.FileSystem.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.IsolatedStorage" library="Facades_System.IO.IsolatedStorage-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.IO.IsolatedStorage.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.IsolatedStorage.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.IsolatedStorage.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.MemoryMappedFiles" library="Facades_System.IO.MemoryMappedFiles-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.IO.MemoryMappedFiles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.MemoryMappedFiles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.MemoryMappedFiles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.UnmanagedMemoryStream" library="Facades_System.IO.UnmanagedMemoryStream-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.IO.UnmanagedMemoryStream.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.UnmanagedMemoryStream.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.UnmanagedMemoryStream.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.AuthenticationManager" library="Facades_System.Net.AuthenticationManager-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.AuthenticationManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.AuthenticationManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.AuthenticationManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Cache" library="Facades_System.Net.Cache-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Cache.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.Cache.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Cache.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.HttpListener" library="Facades_System.Net.HttpListener-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.HttpListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.HttpListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.HttpListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Mail" library="Facades_System.Net.Mail-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Mail.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.Mail.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Mail.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NameResolution" library="Facades_System.Net.NameResolution-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.NameResolution.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.NameResolution.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.NameResolution.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Security" library="Facades_System.Net.Security-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.ServicePoint" library="Facades_System.Net.ServicePoint-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.ServicePoint.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.ServicePoint.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.ServicePoint.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Sockets" library="Facades_System.Net.Sockets-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Sockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.Sockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Sockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Utilities" library="Facades_System.Net.Utilities-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Utilities.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.Utilities.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Utilities.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebHeaderCollection" library="Facades_System.Net.WebHeaderCollection-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.WebHeaderCollection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.WebHeaderCollection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.WebHeaderCollection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets" library="Facades_System.Net.WebSockets-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.WebSockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.WebSockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets.Client" library="Facades_System.Net.WebSockets.Client-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.WebSockets.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.WebSockets.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.Client.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ReaderWriter" library="Facades_System.Resources.ReaderWriter-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Resources.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Resources.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Resources.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.CompilerServices.VisualC" library="Facades_System.Runtime.CompilerServices.VisualC-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Runtime.CompilerServices.VisualC.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.CompilerServices.VisualC.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.CompilerServices.VisualC.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.AccessControl" library="Facades_System.Security.AccessControl-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Claims" library="Facades_System.Security.Claims-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Claims.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Claims.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Claims.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.DeriveBytes" library="Facades_System.Security.Cryptography.DeriveBytes-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.DeriveBytes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.DeriveBytes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.DeriveBytes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encoding" library="Facades_System.Security.Cryptography.Encoding-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption" library="Facades_System.Security.Cryptography.Encryption-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Encryption.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.Aes" library="Facades_System.Security.Cryptography.Encryption.Aes-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.Aes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Encryption.Aes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.Aes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman" library="Facades_System.Security.Cryptography.Encryption.ECDiffieHellman-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDiffieHellman.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDiffieHellman.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDsa" library="Facades_System.Security.Cryptography.Encryption.ECDsa-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDsa.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Encryption.ECDsa.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDsa.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing" library="Facades_System.Security.Cryptography.Hashing-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Hashing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing.Algorithms" library="Facades_System.Security.Cryptography.Hashing.Algorithms-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Hashing.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RSA" library="Facades_System.Security.Cryptography.RSA-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.RSA.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.RSA.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RSA.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RandomNumberGenerator" library="Facades_System.Security.Cryptography.RandomNumberGenerator-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.RandomNumberGenerator.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.RandomNumberGenerator.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RandomNumberGenerator.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal.Windows" library="Facades_System.Security.Principal.Windows-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Principal.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Principal.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Principal.Windows.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Thread" library="Facades_System.Threading.Thread-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Threading.Thread.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Threading.Thread.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Threading.Thread.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.ThreadPool" library="Facades_System.Threading.ThreadPool-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Threading.ThreadPool.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Threading.ThreadPool.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Threading.ThreadPool.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath" library="Facades_System.Xml.XPath-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Xml.XPath.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Xml.XPath.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlDocument" library="Facades_System.Xml.XmlDocument-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Xml.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Xml.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.Xsl.Primitives" library="Facades_System.Xml.Xsl.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Xml.dll</flags>
+      <output>System.Xml.Xsl.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Xml.Xsl.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.Xsl.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry.AccessControl" library="Facades_Microsoft.Win32.Registry.AccessControl-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>Microsoft.Win32.Registry.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/Microsoft.Win32.Registry.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.StackTrace" library="Facades_System.Diagnostics.StackTrace-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Diagnostics.StackTrace.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Diagnostics.StackTrace.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Diagnostics.StackTrace.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Extensions" library="Facades_System.Globalization.Extensions-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Globalization.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Globalization.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Globalization.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.AccessControl" library="Facades_System.IO.FileSystem.AccessControl-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.IO.FileSystem.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.FileSystem.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.TypeExtensions" library="Facades_System.Reflection.TypeExtensions-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Reflection.TypeExtensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Reflection.TypeExtensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.TypeExtensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.Lightweight" library="Facades_System.Reflection.Emit.Lightweight-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.Lightweight.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Reflection.Emit.Lightweight.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.Lightweight.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.ILGeneration" library="Facades_System.Reflection.Emit.ILGeneration-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.ILGeneration.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Reflection.Emit.ILGeneration.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.ILGeneration.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit" library="Facades_System.Reflection.Emit-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Reflection.Emit.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.SecureString" library="Facades_System.Security.SecureString-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.SecureString.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.SecureString.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.SecureString.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.AccessControl" library="Facades_System.Threading.AccessControl-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Threading.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Threading.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Threading.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Overlapped" library="Facades_System.Threading.Overlapped-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -unsafe -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Threading.Overlapped.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Threading.Overlapped.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Threading.Overlapped.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath.XDocument" library="Facades_System.Xml.XPath.XDocument-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Xml.dll -r:./../../../class/lib/monodroid/System.Xml.Linq.dll</flags>
+      <output>System.Xml.XPath.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Xml.XPath.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Primitives" library="Facades_System.Security.Cryptography.Primitives-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.CodePages" library="Facades_System.Text.Encoding.CodePages-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Text.Encoding.CodePages.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Text.Encoding.CodePages.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.CodePages.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Watcher" library="Facades_System.IO.FileSystem.Watcher-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.IO.FileSystem.Watcher.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.FileSystem.Watcher.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Watcher.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.ProtectedData" library="Facades_System.Security.Cryptography.ProtectedData-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Security.dll</flags>
+      <output>System.Security.Cryptography.ProtectedData.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.ProtectedData.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.ProtectedData.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceProcess.ServiceController" library="Facades_System.ServiceProcess.ServiceController-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.ServiceProcess.ServiceController.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.ServiceProcess.ServiceController.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.ServiceProcess.ServiceController.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Pipes" library="Facades_System.IO.Pipes-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.IO.Pipes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.IO.Pipes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.IO.Pipes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Ping" library="Facades_System.Net.Ping-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Net.Ping.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Net.Ping.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Net.Ping.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Formatters" library="Facades_System.Runtime.Serialization.Formatters-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Runtime.Serialization.Formatters.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Runtime.Serialization.Formatters.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Formatters.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Csp" library="Facades_System.Security.Cryptography.Csp-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll</flags>
+      <output>System.Security.Cryptography.Csp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Csp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Csp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Pkcs" library="Facades_System.Security.Cryptography.Pkcs-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Security.dll</flags>
+      <output>System.Security.Cryptography.Pkcs.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Pkcs.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Pkcs.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Cng" library="Facades_System.Security.Cryptography.Cng-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monodroid/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monodroid/System.dll -r:./../../../class/lib/monodroid/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Cng.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monodroid/Facades/System.Security.Cryptography.Cng.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Cng.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Btls.Interface" library="Mono.Btls.Interface-monodroid">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP -r:./../../class/lib/monodroid/System.dll -r:./../../class/lib/monodroid/Mono.Security.dll</flags>
+      <output>Mono.Btls.Interface.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monodroid/Mono.Btls.Interface.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monodroid</profile>
+      <resources></resources>
+      <response>Mono.Btls.Interface.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-monotouch">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch/mscorlib.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_corlib.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/mscorlib.dll -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
+      <output>monotouch_corlib_test.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_corlib_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_corlib_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -unsafe -nowarn:1030,3009 -r:./../../class/lib/monotouch/bare/System.dll</flags>
+      <output>Mono.Security.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch/Mono.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_Mono.Security.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/Mono.Security.dll -unsafe -nowarn:1030,3009 -r:./../../class/lib/monotouch/bare/System.dll -nowarn:169,219,618,672</flags>
+      <output>monotouch_Mono.Security_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_Mono.Security_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_Mono.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-bare-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/bare/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-secxml-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/secxml/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:MONO_INTERPRETER -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/Mono.Dynamic.Interpreter.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>monotouch_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch/plaincore/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>monotouch_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/monotouch/secxml/System.dll -r:./../../class/lib/monotouch/bare/System.Xml.dll -r:./../../class/lib/monotouch/Mono.Security.dll</flags>
+      <output>System.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Security.dll.sources</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Security.dll -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/monotouch/secxml/System.dll -r:./../../class/lib/monotouch/bare/System.Xml.dll -r:./../../class/lib/monotouch/Mono.Security.dll -nowarn:168,169,183,219,414</flags>
+      <output>monotouch_System.Security_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Security_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch/secxml/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/bare/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/Common" library="I18N-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig</flags>
+      <output>I18N.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/I18N.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>I18N.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../../class/lib/monotouch/I18N.dll</flags>
+      <output>I18N.West.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/I18N.West.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>I18N.West.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../../class/lib/monotouch/I18N.West.dll</flags>
+      <output>monotouch_I18N.West_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_I18N.West_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_I18N.West_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../../class/lib/monotouch/I18N.dll</flags>
+      <output>I18N.MidEast.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/I18N.MidEast.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>I18N.MidEast.dll.sources</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../../class/lib/monotouch/I18N.MidEast.dll</flags>
+      <output>monotouch_I18N.MidEast_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_I18N.MidEast_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_I18N.MidEast_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/Other" library="I18N.Other-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../../class/lib/monotouch/I18N.dll</flags>
+      <output>I18N.Other.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/I18N.Other.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>I18N.Other.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Rare" library="I18N.Rare-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../../class/lib/monotouch/I18N.dll</flags>
+      <output>I18N.Rare.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/I18N.Rare.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>I18N.Rare.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../../class/lib/monotouch/I18N.dll</flags>
+      <output>I18N.CJK.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/I18N.CJK.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>I18N.CJK.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../../class/lib/monotouch/I18N.CJK.dll</flags>
+      <output>monotouch_I18N.CJK_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_I18N.CJK_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_I18N.CJK_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel.Internals" library="System.ServiceModel.Internals-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /unsafe -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.ServiceModel.Internals.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.ServiceModel.Internals.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.ServiceModel.Internals.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NO_CONFIGURATION /d:NO_SECURITY_ATTRIBUTES /d:NO_CODEDOM /d:NO_DESKTOP_SECURITY -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.ServiceModel.Internals.dll</flags>
+      <output>System.Runtime.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Runtime.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Runtime.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NO_CONFIGURATION /d:NO_SECURITY_ATTRIBUTES /d:NO_CODEDOM /d:NO_DESKTOP_SECURITY -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.ServiceModel.Internals.dll /resource:Test/Resources/WSDL/collections.wsdl /resource:Test/Resources/WSDL/custom-collections.wsdl</flags>
+      <output>monotouch_System.Runtime.Serialization_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Runtime.Serialization_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Runtime.Serialization_test.dll.response</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:FEATURE_SERIALIZATION -d:MONO_HYBRID_SYSTEM_XML -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll</flags>
+      <output>System.Xml.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Xml.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.Linq.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Xml.Linq.dll -d:FEATURE_SERIALIZATION -d:MONO_HYBRID_SYSTEM_XML -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll</flags>
+      <output>monotouch_System.Xml.Linq_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Xml.Linq_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Xml.Linq_test.dll.response</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /d:NET_3_0 -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Security.dll -r:./../../class/lib/monotouch/Mono.Security.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll</flags>
+      <output>System.IdentityModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.IdentityModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.IdentityModel.dll.sources</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.IdentityModel.dll /d:NET_3_0 -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Security.dll -r:./../../class/lib/monotouch/Mono.Security.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll</flags>
+      <output>monotouch_System.IdentityModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.IdentityModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.IdentityModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch/System.IdentityModel.dll</flags>
+      <output>monotouch_System.ServiceModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.ServiceModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.ServiceModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-plainservice-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/plainservice/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch/System.IdentityModel.dll</flags>
+      <output>monotouch_System.ServiceModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.ServiceModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.ServiceModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch/System.ServiceModel.dll -r:./../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.ServiceModel.Web.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.ServiceModel.Web.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.ServiceModel.Web.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.ServiceModel.Web.dll -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch/System.ServiceModel.dll -r:./../../class/lib/monotouch/System.Core.dll</flags>
+      <output>monotouch_System.ServiceModel.Web_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.ServiceModel.Web_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.ServiceModel.Web_test.dll.response</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Json.dll.sources</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Json.dll -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll</flags>
+      <output>monotouch_System.Json_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Json_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Json_test.dll.response</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:649 -nowarn:169 -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Web.Services.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Web.Services.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Web.Services.dll.sources</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Web.Services.dll -nowarn:649 -nowarn:169 -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -nowarn:618 -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME</flags>
+      <output>monotouch_System.Web.Services_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Web.Services_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Web.Services_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Data.Tds" library="Mono.Data.Tds-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/Mono.Security.dll</flags>
+      <output>Mono.Data.Tds.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/Mono.Data.Tds.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Mono.Data.Tds.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Tds" library="Mono.Data.Tds-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/Mono.Data.Tds.dll</flags>
+      <output>monotouch_Mono.Data.Tds_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_Mono.Data.Tds_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_Mono.Data.Tds_test.dll.response</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /define:MOBILE -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>System.Transactions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Transactions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Transactions.dll.sources</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Transactions.dll /define:MOBILE -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>monotouch_System.Transactions_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Transactions_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Transactions_test.dll.response</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /unsafe -nowarn:414 -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>System.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Numerics.dll /unsafe -nowarn:414 -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>monotouch_System.Numerics_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Numerics_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Numerics_test.dll.response</response>
+    </project>
+    <project dir="class/System.Numerics.Vectors" library="System.Numerics.Vectors-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -unsafe -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Numerics.dll</flags>
+      <output>System.Numerics.Vectors.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Numerics.Vectors.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Numerics.Vectors.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Numerics.dll -r:./../../class/lib/monotouch/Mono.Data.Tds.dll -r:./../../class/lib/monotouch/System.Transactions.dll</flags>
+      <output>System.Data.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Data.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Data.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Data.dll -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Numerics.dll -r:./../../class/lib/monotouch/Mono.Data.Tds.dll -r:./../../class/lib/monotouch/System.Transactions.dll -nowarn:618,169,612,219,168</flags>
+      <output>monotouch_System.Data_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Data_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Data_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Data.dll -r:./../../class/lib/monotouch/System.Transactions.dll -r:./../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>Mono.Data.Sqlite.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/Mono.Data.Sqlite.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Mono.Data.Sqlite.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/Mono.Data.Sqlite.dll /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Data.dll -r:./../../class/lib/monotouch/System.Transactions.dll -r:./../../class/lib/monotouch/System.Xml.dll /nowarn:618</flags>
+      <output>monotouch_Mono.Data.Sqlite_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_Mono.Data.Sqlite_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_Mono.Data.Sqlite_test.dll.response</response>
+    </project>
+    <project dir="class/System.Data.Services.Client" library="System.Data.Services.Client-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:NET_3_5 -warn:2 -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Xml.Linq.dll -r:./../../class/lib/monotouch/System.Data.dll -r:./../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Data.Services.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Data.Services.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources>System.Data.Services.Client,Client/System.Data.Services.Client.txt</resources>
+      <response>System.Data.Services.Client.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /unsafe -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.IO.Compression.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.IO.Compression.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.Compression.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.IO.Compression.dll</flags>
+      <output>monotouch_System.IO.Compression_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.IO.Compression_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.IO.Compression_test.dll.response</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.IO.Compression.dll</flags>
+      <output>System.IO.Compression.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.IO.Compression.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.Compression.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.IO.Compression.FileSystem.dll</flags>
+      <output>monotouch_System.IO.Compression.FileSystem_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.IO.Compression.FileSystem_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.IO.Compression.FileSystem_test.dll.response</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:414 -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Data.dll -r:./../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.ComponentModel.DataAnnotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.ComponentModel.DataAnnotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.DataAnnotations.dll.sources</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.ComponentModel.DataAnnotations.dll -nowarn:414 -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Data.dll -r:./../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>monotouch_System.ComponentModel.DataAnnotations_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.ComponentModel.DataAnnotations_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.ComponentModel.DataAnnotations_test.dll.response</response>
+    </project>
+    <project dir="class/System.ComponentModel.Composition.4.5" library="System.ComponentModel.Composition-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.ComponentModel.Composition.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.ComponentModel.Composition.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources>Microsoft.Internal.Strings,src/ComponentModel/Strings.resx</resources>
+      <response>System.ComponentModel.Composition.dll.sources</response>
+    </project>
+    <project dir="class/System.Net" library="System.Net-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -unsafe -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Net.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Net.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Net.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Http.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/System.Net.Http.dll</flags>
+      <output>monotouch_System.Net.Http_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_System.Net.Http_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_System.Net.Http_test.dll.response</response>
+    </project>
+    <project dir="class/System.Windows" library="System.Windows-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>System.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Windows.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Serialization" library="System.Xml.Serialization-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.ServiceModel.dll</flags>
+      <output>System.Xml.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Xml.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:IOS_REFLECTION -d:MONO_FEATURE_THREAD_ABORT -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/System.Xml.dll -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/Mono.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-tests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize -r:./../../class/lib/monotouch/Mono.CSharp.dll</flags>
+      <output>monotouch_Mono.CSharp_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_Mono.CSharp_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_Mono.CSharp_test.dll.response</response>
+    </project>
+    <project dir="class/Microsoft.CSharp" library="Microsoft.CSharp-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.Core.dll -r:./../../class/lib/monotouch/Mono.CSharp.dll</flags>
+      <output>Microsoft.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/Microsoft.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Microsoft.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.InteropServices.RuntimeInformation" library="System.Runtime.InteropServices.RuntimeInformation-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>System.Runtime.InteropServices.RuntimeInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Runtime.InteropServices.RuntimeInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.RuntimeInformation.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.DispatchProxy" library="System.Reflection.DispatchProxy-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>System.Reflection.DispatchProxy.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Reflection.DispatchProxy.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.DispatchProxy.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.XPath.XmlDocument" library="System.Xml.XPath.XmlDocument-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Xml.XPath.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Xml.XPath.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.Context" library="System.Reflection.Context-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>System.Reflection.Context.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Reflection.Context.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.Context.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http.WinHttpHandler" library="System.Net.Http.WinHttpHandler-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/System.Net.Http.dll</flags>
+      <output>System.Net.Http.WinHttpHandler.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/System.Net.Http.WinHttpHandler.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Http.WinHttpHandler.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Dynamic.Interpreter" library="Mono.Dynamic.Interpreter-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:FEATURE_CORE_DLR,FEATURE_DBNULL,FEATURE_DEFAULT_PARAMETER_VALUE,FEATURE_GET_TYPE_INFO,FEATURE_VARIANCE,FEATURE_SERIALIZATION,CLR45 -d:MONO_INTERPRETER -delaysign -keyfile:../mono.pub -r:./../../class/lib/monotouch/System.dll -r:./../../class/lib/monotouch/plaincore/System.Core.dll</flags>
+      <output>Mono.Dynamic.Interpreter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/Mono.Dynamic.Interpreter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Mono.Dynamic.Interpreter.dll.sources</response>
+    </project>
+    <project dir="class/PEAPI" library="PEAPI-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:414,618 -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>PEAPI.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/PEAPI.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>PEAPI.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CompilerServices.SymbolWriter" library="Mono.CompilerServices.SymbolWriter-monotouch">
+      <boot>true</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -r:./../../class/lib/monotouch/System.dll</flags>
+      <output>Mono.CompilerServices.SymbolWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/Mono.CompilerServices.SymbolWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Mono.CompilerServices.SymbolWriter.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Simd" library="Mono.Simd-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /unsafe -r:./../../class/lib/monotouch/System.Core.dll</flags>
+      <output>Mono.Simd.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch/Mono.Simd.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Mono.Simd.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.X509Certificates" library="Facades_System.Security.Cryptography.X509Certificates-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.X509Certificates.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.X509Certificates.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.X509Certificates.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Primitives" library="Facades_System.ServiceModel.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.ServiceModel.dll -r:./../../../class/lib/monotouch/System.Xml.dll -r:./../../../class/lib/monotouch/System.IdentityModel.dll -r:./../../../class/lib/monotouch/Facades/System.Security.Cryptography.X509Certificates.dll</flags>
+      <output>System.ServiceModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ServiceModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Primitives" library="Facades_System.Runtime.Serialization.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.Serialization.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Xml" library="Facades_System.Runtime.Serialization.Xml-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /d:NO_CODEDOM -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Runtime.Serialization.dll -r:./../../../class/lib/monotouch/System.Xml.dll -r:./../../../class/lib/monotouch/Facades/System.Runtime.Serialization.Primitives.dll</flags>
+      <output>System.Runtime.Serialization.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.Serialization.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Xml.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Algorithms" library="Facades_System.Security.Cryptography.Algorithms-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.OpenSsl" library="Facades_System.Security.Cryptography.OpenSsl-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Core.dll -r:./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Algorithms.dll</flags>
+      <output>System.Security.Cryptography.OpenSsl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.OpenSsl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.OpenSsl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Concurrent" library="Facades_System.Collections.Concurrent-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Collections.Concurrent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Collections.Concurrent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Collections.Concurrent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections" library="Facades_System.Collections-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Collections.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Collections.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Collections.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Annotations" library="Facades_System.ComponentModel.Annotations-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.ComponentModel.DataAnnotations.dll</flags>
+      <output>System.ComponentModel.Annotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ComponentModel.Annotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Annotations.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.EventBasedAsync" library="Facades_System.ComponentModel.EventBasedAsync-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.ComponentModel.EventBasedAsync.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ComponentModel.EventBasedAsync.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.EventBasedAsync.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel" library="Facades_System.ComponentModel-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.ComponentModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ComponentModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Contracts" library="Facades_System.Diagnostics.Contracts-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Contracts.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.Contracts.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Contracts.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Debug" library="Facades_System.Diagnostics.Debug-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Diagnostics.Debug.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.Debug.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Debug.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tracing" library="Facades_System.Diagnostics.Tracing-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Tracing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.Tracing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tracing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tools" library="Facades_System.Diagnostics.Tools-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Diagnostics.Tools.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.Tools.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tools.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Dynamic.Runtime" library="Facades_System.Dynamic.Runtime-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Core.dll -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Dynamic.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Dynamic.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Dynamic.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization" library="Facades_System.Globalization-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Globalization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Globalization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Globalization.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO" library="Facades_System.IO-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.IO.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Expressions" library="Facades_System.Linq.Expressions-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Linq.Expressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Linq.Expressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Linq.Expressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Parallel" library="Facades_System.Linq.Parallel-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Linq.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Linq.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Linq.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Queryable" library="Facades_System.Linq.Queryable-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Linq.Queryable.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Linq.Queryable.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Linq.Queryable.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq" library="Facades_System.Linq-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Linq.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NetworkInformation" library="Facades_System.Net.NetworkInformation-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.NetworkInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.NetworkInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.NetworkInformation.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Primitives" library="Facades_System.Net.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Requests" library="Facades_System.Net.Requests-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Requests.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.Requests.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Requests.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ObjectModel" library="Facades_System.ObjectModel-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.ObjectModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ObjectModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ObjectModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Extensions" library="Facades_System.Reflection.Extensions-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Reflection.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Primitives" library="Facades_System.Reflection.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Reflection.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection" library="Facades_System.Reflection-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Reflection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ResourceManager" library="Facades_System.Resources.ResourceManager-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Resources.ResourceManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Resources.ResourceManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Resources.ResourceManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Extensions" library="Facades_System.Runtime.Extensions-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Runtime.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices" library="Facades_System.Runtime.InteropServices-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Runtime.InteropServices.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.InteropServices.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices.WindowsRuntime" library="Facades_System.Runtime.InteropServices.WindowsRuntime-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Runtime.InteropServices.WindowsRuntime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.InteropServices.WindowsRuntime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.WindowsRuntime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Numerics" library="Facades_System.Runtime.Numerics-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Numerics.dll</flags>
+      <output>System.Runtime.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Json" library="Facades_System.Runtime.Serialization.Json-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.Serialization.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Json.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime" library="Facades_System.Runtime-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.ComponentModel.Composition.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal" library="Facades_System.Security.Principal-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Security.Principal.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Principal.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Principal.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Http" library="Facades_System.ServiceModel.Http-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ServiceModel.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Http.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Security" library="Facades_System.ServiceModel.Security-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ServiceModel.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.Extensions" library="Facades_System.Text.Encoding.Extensions-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Text.Encoding.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding" library="Facades_System.Text.Encoding-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Text.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.RegularExpressions" library="Facades_System.Text.RegularExpressions-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Text.RegularExpressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Text.RegularExpressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Text.RegularExpressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks.Parallel" library="Facades_System.Threading.Tasks.Parallel-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Threading.Tasks.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Threading.Tasks.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks" library="Facades_System.Threading.Tasks-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Threading.Tasks.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Threading.Tasks.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Timer" library="Facades_System.Threading.Timer-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Threading.Timer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Threading.Timer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Threading.Timer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading" library="Facades_System.Threading-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Threading.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Threading.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Threading.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.ReaderWriter" library="Facades_System.Xml.ReaderWriter-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Xml.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Xml.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XDocument" library="Facades_System.Xml.XDocument-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Xml.Linq.dll -r:./../../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Xml.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Xml.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlSerializer" library="Facades_System.Xml.XmlSerializer-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Xml.XmlSerializer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Xml.XmlSerializer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.XmlSerializer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Handles" library="Facades_System.Runtime.Handles-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Runtime.Handles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.Handles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.Handles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Duplex" library="Facades_System.ServiceModel.Duplex-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Duplex.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ServiceModel.Duplex.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Duplex.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.NetTcp" library="Facades_System.ServiceModel.NetTcp-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.NetTcp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ServiceModel.NetTcp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.NetTcp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Primitives" library="Facades_Microsoft.Win32.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>Microsoft.Win32.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/Microsoft.Win32.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry" library="Facades_Microsoft.Win32.Registry-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>Microsoft.Win32.Registry.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/Microsoft.Win32.Registry.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.AppContext" library="Facades_System.AppContext-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.AppContext.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.AppContext.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.AppContext.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.NonGeneric" library="Facades_System.Collections.NonGeneric-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Collections.NonGeneric.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Collections.NonGeneric.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Collections.NonGeneric.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Specialized" library="Facades_System.Collections.Specialized-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Collections.Specialized.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Collections.Specialized.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Collections.Specialized.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Primitives" library="Facades_System.ComponentModel.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.ComponentModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ComponentModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.TypeConverter" library="Facades_System.ComponentModel.TypeConverter-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.ComponentModel.TypeConverter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ComponentModel.TypeConverter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.TypeConverter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Console" library="Facades_System.Console-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Console.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Console.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Console.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.Common" library="Facades_System.Data.Common-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Data.dll -r:./../../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Data.Common.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Data.Common.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Data.Common.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.SqlClient" library="Facades_System.Data.SqlClient-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Data.dll -r:./../../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Data.SqlClient.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Data.SqlClient.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Data.SqlClient.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.FileVersionInfo" library="Facades_System.Diagnostics.FileVersionInfo-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Diagnostics.FileVersionInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.FileVersionInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.FileVersionInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Process" library="Facades_System.Diagnostics.Process-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Diagnostics.Process.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.Process.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Process.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TextWriterTraceListener" library="Facades_System.Diagnostics.TextWriterTraceListener-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Diagnostics.TextWriterTraceListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.TextWriterTraceListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TextWriterTraceListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceEvent" library="Facades_System.Diagnostics.TraceEvent-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Diagnostics.TraceEvent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.TraceEvent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceEvent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceSource" library="Facades_System.Diagnostics.TraceSource-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Diagnostics.TraceSource.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.TraceSource.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceSource.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Calendars" library="Facades_System.Globalization.Calendars-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Globalization.Calendars.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Globalization.Calendars.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Globalization.Calendars.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Compression.ZipFile" library="Facades_System.IO.Compression.ZipFile-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.IO.Compression.FileSystem.dll</flags>
+      <output>System.IO.Compression.ZipFile.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.Compression.ZipFile.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.Compression.ZipFile.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem" library="Facades_System.IO.FileSystem-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.IO.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.DriveInfo" library="Facades_System.IO.FileSystem.DriveInfo-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.IO.FileSystem.DriveInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.FileSystem.DriveInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.DriveInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Primitives" library="Facades_System.IO.FileSystem.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.IO.FileSystem.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.FileSystem.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.IsolatedStorage" library="Facades_System.IO.IsolatedStorage-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.IO.IsolatedStorage.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.IsolatedStorage.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.IsolatedStorage.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.MemoryMappedFiles" library="Facades_System.IO.MemoryMappedFiles-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.IO.MemoryMappedFiles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.MemoryMappedFiles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.MemoryMappedFiles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.UnmanagedMemoryStream" library="Facades_System.IO.UnmanagedMemoryStream-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.IO.UnmanagedMemoryStream.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.UnmanagedMemoryStream.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.UnmanagedMemoryStream.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.AuthenticationManager" library="Facades_System.Net.AuthenticationManager-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.AuthenticationManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.AuthenticationManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.AuthenticationManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Cache" library="Facades_System.Net.Cache-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Cache.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.Cache.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Cache.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.HttpListener" library="Facades_System.Net.HttpListener-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.HttpListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.HttpListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.HttpListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Mail" library="Facades_System.Net.Mail-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Mail.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.Mail.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Mail.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NameResolution" library="Facades_System.Net.NameResolution-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.NameResolution.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.NameResolution.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.NameResolution.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Security" library="Facades_System.Net.Security-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.ServicePoint" library="Facades_System.Net.ServicePoint-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.ServicePoint.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.ServicePoint.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.ServicePoint.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Sockets" library="Facades_System.Net.Sockets-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Sockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.Sockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Sockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Utilities" library="Facades_System.Net.Utilities-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Utilities.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.Utilities.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Utilities.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebHeaderCollection" library="Facades_System.Net.WebHeaderCollection-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.WebHeaderCollection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.WebHeaderCollection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.WebHeaderCollection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets" library="Facades_System.Net.WebSockets-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.WebSockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.WebSockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets.Client" library="Facades_System.Net.WebSockets.Client-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.WebSockets.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.WebSockets.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.Client.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ReaderWriter" library="Facades_System.Resources.ReaderWriter-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Resources.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Resources.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Resources.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.CompilerServices.VisualC" library="Facades_System.Runtime.CompilerServices.VisualC-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Runtime.CompilerServices.VisualC.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.CompilerServices.VisualC.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.CompilerServices.VisualC.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.AccessControl" library="Facades_System.Security.AccessControl-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Claims" library="Facades_System.Security.Claims-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Claims.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Claims.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Claims.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.DeriveBytes" library="Facades_System.Security.Cryptography.DeriveBytes-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.DeriveBytes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.DeriveBytes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.DeriveBytes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encoding" library="Facades_System.Security.Cryptography.Encoding-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption" library="Facades_System.Security.Cryptography.Encryption-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Encryption.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.Aes" library="Facades_System.Security.Cryptography.Encryption.Aes-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.Aes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Encryption.Aes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.Aes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman" library="Facades_System.Security.Cryptography.Encryption.ECDiffieHellman-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDiffieHellman.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDiffieHellman.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDsa" library="Facades_System.Security.Cryptography.Encryption.ECDsa-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDsa.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Encryption.ECDsa.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDsa.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing" library="Facades_System.Security.Cryptography.Hashing-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Hashing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing.Algorithms" library="Facades_System.Security.Cryptography.Hashing.Algorithms-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Hashing.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RSA" library="Facades_System.Security.Cryptography.RSA-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.RSA.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.RSA.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RSA.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RandomNumberGenerator" library="Facades_System.Security.Cryptography.RandomNumberGenerator-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.RandomNumberGenerator.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.RandomNumberGenerator.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RandomNumberGenerator.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal.Windows" library="Facades_System.Security.Principal.Windows-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Principal.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Principal.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Principal.Windows.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Thread" library="Facades_System.Threading.Thread-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Threading.Thread.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Threading.Thread.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Threading.Thread.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.ThreadPool" library="Facades_System.Threading.ThreadPool-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Threading.ThreadPool.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Threading.ThreadPool.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Threading.ThreadPool.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath" library="Facades_System.Xml.XPath-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Xml.XPath.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Xml.XPath.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlDocument" library="Facades_System.Xml.XmlDocument-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Xml.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Xml.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.Xsl.Primitives" library="Facades_System.Xml.Xsl.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Xml.dll</flags>
+      <output>System.Xml.Xsl.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Xml.Xsl.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.Xsl.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry.AccessControl" library="Facades_Microsoft.Win32.Registry.AccessControl-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>Microsoft.Win32.Registry.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/Microsoft.Win32.Registry.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.StackTrace" library="Facades_System.Diagnostics.StackTrace-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Diagnostics.StackTrace.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Diagnostics.StackTrace.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.StackTrace.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Extensions" library="Facades_System.Globalization.Extensions-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Globalization.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Globalization.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Globalization.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.AccessControl" library="Facades_System.IO.FileSystem.AccessControl-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.IO.FileSystem.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.FileSystem.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.TypeExtensions" library="Facades_System.Reflection.TypeExtensions-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Reflection.TypeExtensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Reflection.TypeExtensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.TypeExtensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.Lightweight" library="Facades_System.Reflection.Emit.Lightweight-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.Lightweight.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Reflection.Emit.Lightweight.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.Lightweight.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.ILGeneration" library="Facades_System.Reflection.Emit.ILGeneration-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.ILGeneration.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Reflection.Emit.ILGeneration.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.ILGeneration.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit" library="Facades_System.Reflection.Emit-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Reflection.Emit.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.SecureString" library="Facades_System.Security.SecureString-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.SecureString.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.SecureString.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.SecureString.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.AccessControl" library="Facades_System.Threading.AccessControl-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Threading.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Threading.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Threading.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Overlapped" library="Facades_System.Threading.Overlapped-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -unsafe -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Threading.Overlapped.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Threading.Overlapped.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Threading.Overlapped.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath.XDocument" library="Facades_System.Xml.XPath.XDocument-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Xml.dll -r:./../../../class/lib/monotouch/System.Xml.Linq.dll</flags>
+      <output>System.Xml.XPath.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Xml.XPath.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Primitives" library="Facades_System.Security.Cryptography.Primitives-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.CodePages" library="Facades_System.Text.Encoding.CodePages-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Text.Encoding.CodePages.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Text.Encoding.CodePages.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.CodePages.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Watcher" library="Facades_System.IO.FileSystem.Watcher-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.IO.FileSystem.Watcher.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.FileSystem.Watcher.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Watcher.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.ProtectedData" library="Facades_System.Security.Cryptography.ProtectedData-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Security.dll</flags>
+      <output>System.Security.Cryptography.ProtectedData.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.ProtectedData.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.ProtectedData.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceProcess.ServiceController" library="Facades_System.ServiceProcess.ServiceController-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.ServiceProcess.ServiceController.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.ServiceProcess.ServiceController.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.ServiceProcess.ServiceController.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Pipes" library="Facades_System.IO.Pipes-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.IO.Pipes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.IO.Pipes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.IO.Pipes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Ping" library="Facades_System.Net.Ping-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Net.Ping.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Net.Ping.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Net.Ping.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Formatters" library="Facades_System.Runtime.Serialization.Formatters-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Runtime.Serialization.Formatters.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Runtime.Serialization.Formatters.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Formatters.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Csp" library="Facades_System.Security.Cryptography.Csp-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll</flags>
+      <output>System.Security.Cryptography.Csp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Csp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Csp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Pkcs" library="Facades_System.Security.Cryptography.Pkcs-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Security.dll</flags>
+      <output>System.Security.Cryptography.Pkcs.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Pkcs.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Pkcs.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Cng" library="Facades_System.Security.Cryptography.Cng-monotouch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch/mscorlib.dll -d:FULL_AOT_RUNTIME -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch/System.dll -r:./../../../class/lib/monotouch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Cng.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch/Facades/System.Security.Cryptography.Cng.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Cng.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-monotouch_runtime">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/mscorlib.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_corlib.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -optimize -r:./../../class/lib/monotouch_runtime/mscorlib.dll -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
+      <output>monotouch_runtime_corlib_test.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_runtime_corlib_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_corlib_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030,3009 -r:./../../class/lib/monotouch_runtime/bare/System.dll</flags>
+      <output>Mono.Security.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/Mono.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>Mono.Security.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/Mono.Security.dll -unsafe -nowarn:1030,3009 -r:./../../class/lib/monotouch_runtime/bare/System.dll -nowarn:169,219,618,672</flags>
+      <output>monotouch_runtime_Mono.Security_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_runtime_Mono.Security_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_Mono.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_runtime/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_runtime/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-bare-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/bare/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-secxml-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_runtime/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_runtime/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/secxml/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:MONO_INTERPRETER -d:FULL_AOT_RUNTIME -r:./../../class/lib/monotouch_runtime/System.dll -r:./../../class/lib/monotouch_runtime/Mono.Dynamic.Interpreter.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:FULL_AOT_RUNTIME -r:./../../class/lib/monotouch_runtime/System.dll</flags>
+      <output>monotouch_runtime_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_runtime_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:FULL_AOT_RUNTIME -r:./../../class/lib/monotouch_runtime/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/plaincore/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:FULL_AOT_RUNTIME -r:./../../class/lib/monotouch_runtime/System.dll</flags>
+      <output>monotouch_runtime_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_runtime_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_runtime/secxml/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_runtime/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_runtime_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_runtime_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_runtime/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/bare/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_runtime/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_runtime_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_runtime_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:IOS_REFLECTION -d:MONO_FEATURE_THREAD_ABORT -r:./../../class/lib/monotouch_runtime/System.Core.dll -r:./../../class/lib/monotouch_runtime/System.Xml.dll -r:./../../class/lib/monotouch_runtime/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_runtime/Mono.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-tests-monotouch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize -r:./../../class/lib/monotouch_runtime/Mono.CSharp.dll</flags>
+      <output>monotouch_runtime_Mono.CSharp_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_runtime_Mono.CSharp_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_runtime_Mono.CSharp_test.dll.response</response>
+    </project>
+    <project dir="class/corlib" library="corlib-monotouch_watch">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_watch/mscorlib.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_corlib.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
+      <output>monotouch_watch_corlib_test.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_watch_corlib_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_corlib_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt</flags>
+      <output>monotouch_watch_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-bare-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/bare/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt</flags>
+      <output>monotouch_watch_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-secxml-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch/bare/System.Xml.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/secxml/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt</flags>
+      <output>monotouch_watch_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:MONO_INTERPRETER -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/Mono.Dynamic.Interpreter.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>monotouch_watch_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_watch_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_watch/plaincore/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>monotouch_watch_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_watch_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/monotouch_watch/secxml/System.dll -r:./../../class/lib/monotouch_watch/bare/System.Xml.dll</flags>
+      <output>System.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Security.dll.sources</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Security.dll -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/monotouch_watch/secxml/System.dll -r:./../../class/lib/monotouch_watch/bare/System.Xml.dll -nowarn:168,169,183,219,414</flags>
+      <output>monotouch_watch_System.Security_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Security_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_watch/secxml/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_watch/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_watch_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_watch/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/bare/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_watch/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_watch_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/Common" library="I18N-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig</flags>
+      <output>I18N.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/I18N.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>I18N.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../../class/lib/monotouch_watch/I18N.dll</flags>
+      <output>I18N.West.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/I18N.West.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>I18N.West.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../../class/lib/monotouch_watch/I18N.West.dll</flags>
+      <output>monotouch_watch_I18N.West_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_I18N.West_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_watch_I18N.West_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../../class/lib/monotouch_watch/I18N.dll</flags>
+      <output>I18N.MidEast.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/I18N.MidEast.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>I18N.MidEast.dll.sources</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../../class/lib/monotouch_watch/I18N.MidEast.dll</flags>
+      <output>monotouch_watch_I18N.MidEast_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_I18N.MidEast_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_watch_I18N.MidEast_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/Other" library="I18N.Other-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../../class/lib/monotouch_watch/I18N.dll</flags>
+      <output>I18N.Other.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/I18N.Other.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>I18N.Other.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Rare" library="I18N.Rare-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../../class/lib/monotouch_watch/I18N.dll</flags>
+      <output>I18N.Rare.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/I18N.Rare.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>I18N.Rare.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../../class/lib/monotouch_watch/I18N.dll</flags>
+      <output>I18N.CJK.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/I18N.CJK.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>I18N.CJK.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../../class/lib/monotouch_watch/I18N.CJK.dll</flags>
+      <output>monotouch_watch_I18N.CJK_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_I18N.CJK_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_watch_I18N.CJK_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel.Internals" library="System.ServiceModel.Internals-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /unsafe -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.ServiceModel.Internals.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.ServiceModel.Internals.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.ServiceModel.Internals.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NO_CONFIGURATION /d:NO_SECURITY_ATTRIBUTES /d:NO_CODEDOM /d:NO_DESKTOP_SECURITY -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.ServiceModel.Internals.dll</flags>
+      <output>System.Runtime.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Runtime.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NO_CONFIGURATION /d:NO_SECURITY_ATTRIBUTES /d:NO_CODEDOM /d:NO_DESKTOP_SECURITY -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.ServiceModel.Internals.dll /resource:Test/Resources/WSDL/collections.wsdl /resource:Test/Resources/WSDL/custom-collections.wsdl</flags>
+      <output>monotouch_watch_System.Runtime.Serialization_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Runtime.Serialization_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Runtime.Serialization_test.dll.response</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:FEATURE_SERIALIZATION -d:MONO_HYBRID_SYSTEM_XML -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll</flags>
+      <output>System.Xml.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Xml.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.Linq.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Xml.Linq.dll -d:FEATURE_SERIALIZATION -d:MONO_HYBRID_SYSTEM_XML -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll</flags>
+      <output>monotouch_watch_System.Xml.Linq_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Xml.Linq_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Xml.Linq_test.dll.response</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /d:NET_3_0 -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Security.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll</flags>
+      <output>System.IdentityModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.IdentityModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.IdentityModel.dll.sources</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.IdentityModel.dll /d:NET_3_0 -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Security.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll</flags>
+      <output>monotouch_watch_System.IdentityModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.IdentityModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.IdentityModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_watch/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_watch/System.IdentityModel.dll</flags>
+      <output>monotouch_watch_System.ServiceModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.ServiceModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.ServiceModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-plainservice-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_watch/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/plainservice/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_watch/System.IdentityModel.dll</flags>
+      <output>monotouch_watch_System.ServiceModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.ServiceModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.ServiceModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_watch/System.ServiceModel.dll -r:./../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.ServiceModel.Web.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.ServiceModel.Web.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.ServiceModel.Web.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.ServiceModel.Web.dll -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_watch/System.ServiceModel.dll -r:./../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>monotouch_watch_System.ServiceModel.Web_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.ServiceModel.Web_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.ServiceModel.Web_test.dll.response</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Json.dll.sources</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Json.dll -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>monotouch_watch_System.Json_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Json_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Json_test.dll.response</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:649 -nowarn:169 -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Web.Services.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Web.Services.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Web.Services.dll.sources</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Web.Services.dll -nowarn:649 -nowarn:169 -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -nowarn:618</flags>
+      <output>monotouch_watch_System.Web.Services_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Web.Services_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Web.Services_test.dll.response</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /define:MOBILE -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Transactions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Transactions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Transactions.dll.sources</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Transactions.dll /define:MOBILE -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>monotouch_watch_System.Transactions_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Transactions_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Transactions_test.dll.response</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /unsafe -nowarn:414 -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Numerics.dll /unsafe -nowarn:414 -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>monotouch_watch_System.Numerics_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Numerics_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Numerics_test.dll.response</response>
+    </project>
+    <project dir="class/System.Numerics.Vectors" library="System.Numerics.Vectors-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -unsafe -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Numerics.dll</flags>
+      <output>System.Numerics.Vectors.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Numerics.Vectors.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Numerics.Vectors.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Numerics.dll -r:./../../class/lib/monotouch_watch/System.Transactions.dll</flags>
+      <output>System.Data.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Data.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Data.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Data.dll -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Numerics.dll -r:./../../class/lib/monotouch_watch/System.Transactions.dll -nowarn:618,169,612,219,168</flags>
+      <output>monotouch_watch_System.Data_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Data_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Data_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Data.dll -r:./../../class/lib/monotouch_watch/System.Transactions.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>Mono.Data.Sqlite.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/Mono.Data.Sqlite.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>Mono.Data.Sqlite.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/Mono.Data.Sqlite.dll /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Data.dll -r:./../../class/lib/monotouch_watch/System.Transactions.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll /nowarn:618</flags>
+      <output>monotouch_watch_Mono.Data.Sqlite_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_Mono.Data.Sqlite_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_Mono.Data.Sqlite_test.dll.response</response>
+    </project>
+    <project dir="class/System.Data.Services.Client" library="System.Data.Services.Client-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:NET_3_5 -warn:2 -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Xml.Linq.dll -r:./../../class/lib/monotouch_watch/System.Data.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Data.Services.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Data.Services.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources>System.Data.Services.Client,Client/System.Data.Services.Client.txt</resources>
+      <response>System.Data.Services.Client.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /unsafe -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.IO.Compression.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.IO.Compression.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.Compression.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.IO.Compression.dll</flags>
+      <output>monotouch_watch_System.IO.Compression_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.IO.Compression_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.IO.Compression_test.dll.response</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.IO.Compression.dll</flags>
+      <output>System.IO.Compression.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.IO.Compression.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.Compression.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.IO.Compression.FileSystem.dll</flags>
+      <output>monotouch_watch_System.IO.Compression.FileSystem_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.IO.Compression.FileSystem_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.IO.Compression.FileSystem_test.dll.response</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:414 -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Data.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.ComponentModel.DataAnnotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.ComponentModel.DataAnnotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.DataAnnotations.dll.sources</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.ComponentModel.DataAnnotations.dll -nowarn:414 -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Data.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>monotouch_watch_System.ComponentModel.DataAnnotations_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.ComponentModel.DataAnnotations_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.ComponentModel.DataAnnotations_test.dll.response</response>
+    </project>
+    <project dir="class/System.ComponentModel.Composition.4.5" library="System.ComponentModel.Composition-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.ComponentModel.Composition.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.ComponentModel.Composition.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources>Microsoft.Internal.Strings,src/ComponentModel/Strings.resx</resources>
+      <response>System.ComponentModel.Composition.dll.sources</response>
+    </project>
+    <project dir="class/System.Net" library="System.Net-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -unsafe -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Net.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Net.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Net.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Net.Http.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/System.Net.Http.dll</flags>
+      <output>monotouch_watch_System.Net.Http_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_System.Net.Http_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_System.Net.Http_test.dll.response</response>
+    </project>
+    <project dir="class/System.Windows" library="System.Windows-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Windows.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Serialization" library="System.Xml.Serialization-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.ServiceModel.dll</flags>
+      <output>System.Xml.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Xml.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:IOS_REFLECTION -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/Mono.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-tests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch/Mono.CSharp.dll</flags>
+      <output>monotouch_watch_Mono.CSharp_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_Mono.CSharp_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_Mono.CSharp_test.dll.response</response>
+    </project>
+    <project dir="class/Microsoft.CSharp" library="Microsoft.CSharp-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.Core.dll -r:./../../class/lib/monotouch_watch/Mono.CSharp.dll</flags>
+      <output>Microsoft.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/Microsoft.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>Microsoft.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.InteropServices.RuntimeInformation" library="System.Runtime.InteropServices.RuntimeInformation-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Runtime.InteropServices.RuntimeInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Runtime.InteropServices.RuntimeInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.RuntimeInformation.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.DispatchProxy" library="System.Reflection.DispatchProxy-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Reflection.DispatchProxy.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Reflection.DispatchProxy.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.DispatchProxy.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.XPath.XmlDocument" library="System.Xml.XPath.XmlDocument-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Xml.XPath.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Xml.XPath.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.Context" library="System.Reflection.Context-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Reflection.Context.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Reflection.Context.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.Context.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http.WinHttpHandler" library="System.Net.Http.WinHttpHandler-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/System.Net.Http.dll</flags>
+      <output>System.Net.Http.WinHttpHandler.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/System.Net.Http.WinHttpHandler.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Http.WinHttpHandler.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Dynamic.Interpreter" library="Mono.Dynamic.Interpreter-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:FEATURE_CORE_DLR,FEATURE_DBNULL,FEATURE_DEFAULT_PARAMETER_VALUE,FEATURE_GET_TYPE_INFO,FEATURE_VARIANCE,FEATURE_SERIALIZATION,CLR45 -d:MONO_INTERPRETER -delaysign -keyfile:../mono.pub -r:./../../class/lib/monotouch_watch/System.dll -r:./../../class/lib/monotouch_watch/plaincore/System.Core.dll</flags>
+      <output>Mono.Dynamic.Interpreter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/Mono.Dynamic.Interpreter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>Mono.Dynamic.Interpreter.dll.sources</response>
+    </project>
+    <project dir="class/PEAPI" library="PEAPI-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:414,618 -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>PEAPI.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/PEAPI.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>PEAPI.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CompilerServices.SymbolWriter" library="Mono.CompilerServices.SymbolWriter-monotouch_watch">
+      <boot>true</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -r:./../../class/lib/monotouch_watch/System.dll</flags>
+      <output>Mono.CompilerServices.SymbolWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/Mono.CompilerServices.SymbolWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>Mono.CompilerServices.SymbolWriter.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Simd" library="Mono.Simd-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /unsafe -r:./../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>Mono.Simd.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch/Mono.Simd.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>Mono.Simd.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.X509Certificates" library="Facades_System.Security.Cryptography.X509Certificates-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.X509Certificates.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.X509Certificates.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.X509Certificates.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Primitives" library="Facades_System.ServiceModel.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.ServiceModel.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll -r:./../../../class/lib/monotouch_watch/System.IdentityModel.dll -r:./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.X509Certificates.dll</flags>
+      <output>System.ServiceModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ServiceModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Primitives" library="Facades_System.Runtime.Serialization.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.Serialization.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Xml" library="Facades_System.Runtime.Serialization.Xml-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /d:NO_CODEDOM -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Runtime.Serialization.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll -r:./../../../class/lib/monotouch_watch/Facades/System.Runtime.Serialization.Primitives.dll</flags>
+      <output>System.Runtime.Serialization.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.Serialization.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Xml.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Algorithms" library="Facades_System.Security.Cryptography.Algorithms-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.OpenSsl" library="Facades_System.Security.Cryptography.OpenSsl-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Core.dll -r:./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Algorithms.dll</flags>
+      <output>System.Security.Cryptography.OpenSsl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.OpenSsl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.OpenSsl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Drawing.Primitives" library="Facades_System.Drawing.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Drawing.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Drawing.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_watch_System.Drawing.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Concurrent" library="Facades_System.Collections.Concurrent-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Collections.Concurrent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Collections.Concurrent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Collections.Concurrent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections" library="Facades_System.Collections-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Collections.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Collections.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Collections.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Annotations" library="Facades_System.ComponentModel.Annotations-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.ComponentModel.DataAnnotations.dll</flags>
+      <output>System.ComponentModel.Annotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ComponentModel.Annotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Annotations.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.EventBasedAsync" library="Facades_System.ComponentModel.EventBasedAsync-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.ComponentModel.EventBasedAsync.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ComponentModel.EventBasedAsync.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.EventBasedAsync.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel" library="Facades_System.ComponentModel-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.ComponentModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ComponentModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Contracts" library="Facades_System.Diagnostics.Contracts-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Contracts.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.Contracts.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Contracts.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Debug" library="Facades_System.Diagnostics.Debug-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Diagnostics.Debug.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.Debug.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Debug.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tracing" library="Facades_System.Diagnostics.Tracing-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Tracing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.Tracing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tracing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tools" library="Facades_System.Diagnostics.Tools-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Diagnostics.Tools.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.Tools.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tools.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Dynamic.Runtime" library="Facades_System.Dynamic.Runtime-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Core.dll -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Dynamic.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Dynamic.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Dynamic.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization" library="Facades_System.Globalization-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Globalization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Globalization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Globalization.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO" library="Facades_System.IO-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.IO.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Expressions" library="Facades_System.Linq.Expressions-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Linq.Expressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Linq.Expressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Linq.Expressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Parallel" library="Facades_System.Linq.Parallel-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Linq.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Linq.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Linq.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Queryable" library="Facades_System.Linq.Queryable-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Linq.Queryable.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Linq.Queryable.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Linq.Queryable.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq" library="Facades_System.Linq-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Linq.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NetworkInformation" library="Facades_System.Net.NetworkInformation-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.NetworkInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.NetworkInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.NetworkInformation.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Primitives" library="Facades_System.Net.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Requests" library="Facades_System.Net.Requests-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Requests.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.Requests.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Requests.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ObjectModel" library="Facades_System.ObjectModel-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.ObjectModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ObjectModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ObjectModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Extensions" library="Facades_System.Reflection.Extensions-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Reflection.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Primitives" library="Facades_System.Reflection.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Reflection.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection" library="Facades_System.Reflection-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Reflection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ResourceManager" library="Facades_System.Resources.ResourceManager-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Resources.ResourceManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Resources.ResourceManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Resources.ResourceManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Extensions" library="Facades_System.Runtime.Extensions-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Runtime.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices" library="Facades_System.Runtime.InteropServices-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Runtime.InteropServices.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.InteropServices.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices.WindowsRuntime" library="Facades_System.Runtime.InteropServices.WindowsRuntime-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Runtime.InteropServices.WindowsRuntime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.InteropServices.WindowsRuntime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.WindowsRuntime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Numerics" library="Facades_System.Runtime.Numerics-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Numerics.dll</flags>
+      <output>System.Runtime.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Json" library="Facades_System.Runtime.Serialization.Json-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.Serialization.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Json.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime" library="Facades_System.Runtime-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.ComponentModel.Composition.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal" library="Facades_System.Security.Principal-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Security.Principal.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Principal.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Principal.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Http" library="Facades_System.ServiceModel.Http-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ServiceModel.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Http.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Security" library="Facades_System.ServiceModel.Security-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ServiceModel.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.Extensions" library="Facades_System.Text.Encoding.Extensions-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Text.Encoding.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding" library="Facades_System.Text.Encoding-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Text.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.RegularExpressions" library="Facades_System.Text.RegularExpressions-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Text.RegularExpressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Text.RegularExpressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Text.RegularExpressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks.Parallel" library="Facades_System.Threading.Tasks.Parallel-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Threading.Tasks.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Threading.Tasks.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks" library="Facades_System.Threading.Tasks-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Threading.Tasks.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Threading.Tasks.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Timer" library="Facades_System.Threading.Timer-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Threading.Timer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Threading.Timer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Threading.Timer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading" library="Facades_System.Threading-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Threading.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Threading.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Threading.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.ReaderWriter" library="Facades_System.Xml.ReaderWriter-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Xml.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Xml.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XDocument" library="Facades_System.Xml.XDocument-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Xml.Linq.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Xml.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Xml.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlSerializer" library="Facades_System.Xml.XmlSerializer-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Xml.XmlSerializer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Xml.XmlSerializer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.XmlSerializer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Handles" library="Facades_System.Runtime.Handles-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Runtime.Handles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.Handles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.Handles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Duplex" library="Facades_System.ServiceModel.Duplex-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Duplex.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ServiceModel.Duplex.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Duplex.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.NetTcp" library="Facades_System.ServiceModel.NetTcp-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.NetTcp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ServiceModel.NetTcp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ServiceModel.NetTcp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Primitives" library="Facades_Microsoft.Win32.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>Microsoft.Win32.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/Microsoft.Win32.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry" library="Facades_Microsoft.Win32.Registry-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>Microsoft.Win32.Registry.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/Microsoft.Win32.Registry.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.AppContext" library="Facades_System.AppContext-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.AppContext.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.AppContext.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.AppContext.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.NonGeneric" library="Facades_System.Collections.NonGeneric-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Collections.NonGeneric.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Collections.NonGeneric.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Collections.NonGeneric.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Specialized" library="Facades_System.Collections.Specialized-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Collections.Specialized.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Collections.Specialized.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Collections.Specialized.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Primitives" library="Facades_System.ComponentModel.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.ComponentModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ComponentModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.TypeConverter" library="Facades_System.ComponentModel.TypeConverter-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.ComponentModel.TypeConverter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ComponentModel.TypeConverter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ComponentModel.TypeConverter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Console" library="Facades_System.Console-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Console.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Console.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Console.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.Common" library="Facades_System.Data.Common-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Data.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Data.Common.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Data.Common.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Data.Common.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.SqlClient" library="Facades_System.Data.SqlClient-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Data.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Data.SqlClient.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Data.SqlClient.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Data.SqlClient.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.FileVersionInfo" library="Facades_System.Diagnostics.FileVersionInfo-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Diagnostics.FileVersionInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.FileVersionInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.FileVersionInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Process" library="Facades_System.Diagnostics.Process-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Diagnostics.Process.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.Process.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Process.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TextWriterTraceListener" library="Facades_System.Diagnostics.TextWriterTraceListener-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Diagnostics.TextWriterTraceListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.TextWriterTraceListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TextWriterTraceListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceEvent" library="Facades_System.Diagnostics.TraceEvent-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Diagnostics.TraceEvent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.TraceEvent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceEvent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceSource" library="Facades_System.Diagnostics.TraceSource-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Diagnostics.TraceSource.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.TraceSource.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceSource.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Calendars" library="Facades_System.Globalization.Calendars-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Globalization.Calendars.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Globalization.Calendars.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Globalization.Calendars.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Compression.ZipFile" library="Facades_System.IO.Compression.ZipFile-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.IO.Compression.FileSystem.dll</flags>
+      <output>System.IO.Compression.ZipFile.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.Compression.ZipFile.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.Compression.ZipFile.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem" library="Facades_System.IO.FileSystem-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.IO.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.DriveInfo" library="Facades_System.IO.FileSystem.DriveInfo-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.IO.FileSystem.DriveInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.FileSystem.DriveInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.DriveInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Primitives" library="Facades_System.IO.FileSystem.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.IO.FileSystem.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.FileSystem.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.IsolatedStorage" library="Facades_System.IO.IsolatedStorage-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.IO.IsolatedStorage.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.IsolatedStorage.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.IsolatedStorage.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.MemoryMappedFiles" library="Facades_System.IO.MemoryMappedFiles-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.IO.MemoryMappedFiles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.MemoryMappedFiles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.MemoryMappedFiles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.UnmanagedMemoryStream" library="Facades_System.IO.UnmanagedMemoryStream-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.IO.UnmanagedMemoryStream.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.UnmanagedMemoryStream.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.UnmanagedMemoryStream.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.AuthenticationManager" library="Facades_System.Net.AuthenticationManager-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.AuthenticationManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.AuthenticationManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.AuthenticationManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Cache" library="Facades_System.Net.Cache-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Cache.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.Cache.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Cache.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.HttpListener" library="Facades_System.Net.HttpListener-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.HttpListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.HttpListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.HttpListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Mail" library="Facades_System.Net.Mail-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Mail.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.Mail.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Mail.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NameResolution" library="Facades_System.Net.NameResolution-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.NameResolution.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.NameResolution.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.NameResolution.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Security" library="Facades_System.Net.Security-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.ServicePoint" library="Facades_System.Net.ServicePoint-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.ServicePoint.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.ServicePoint.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.ServicePoint.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Sockets" library="Facades_System.Net.Sockets-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Sockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.Sockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Sockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Utilities" library="Facades_System.Net.Utilities-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Utilities.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.Utilities.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Utilities.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebHeaderCollection" library="Facades_System.Net.WebHeaderCollection-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.WebHeaderCollection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.WebHeaderCollection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.WebHeaderCollection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets" library="Facades_System.Net.WebSockets-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.WebSockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.WebSockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets.Client" library="Facades_System.Net.WebSockets.Client-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.WebSockets.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.WebSockets.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.Client.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ReaderWriter" library="Facades_System.Resources.ReaderWriter-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Resources.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Resources.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Resources.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.CompilerServices.VisualC" library="Facades_System.Runtime.CompilerServices.VisualC-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Runtime.CompilerServices.VisualC.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.CompilerServices.VisualC.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.CompilerServices.VisualC.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.AccessControl" library="Facades_System.Security.AccessControl-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Claims" library="Facades_System.Security.Claims-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Claims.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Claims.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Claims.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.DeriveBytes" library="Facades_System.Security.Cryptography.DeriveBytes-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.DeriveBytes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.DeriveBytes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.DeriveBytes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encoding" library="Facades_System.Security.Cryptography.Encoding-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption" library="Facades_System.Security.Cryptography.Encryption-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Encryption.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.Aes" library="Facades_System.Security.Cryptography.Encryption.Aes-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.Aes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Encryption.Aes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.Aes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman" library="Facades_System.Security.Cryptography.Encryption.ECDiffieHellman-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDiffieHellman.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDiffieHellman.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDsa" library="Facades_System.Security.Cryptography.Encryption.ECDsa-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDsa.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Encryption.ECDsa.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDsa.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing" library="Facades_System.Security.Cryptography.Hashing-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Hashing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing.Algorithms" library="Facades_System.Security.Cryptography.Hashing.Algorithms-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Hashing.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RSA" library="Facades_System.Security.Cryptography.RSA-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.RSA.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.RSA.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RSA.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RandomNumberGenerator" library="Facades_System.Security.Cryptography.RandomNumberGenerator-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.RandomNumberGenerator.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.RandomNumberGenerator.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RandomNumberGenerator.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal.Windows" library="Facades_System.Security.Principal.Windows-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Principal.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Principal.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Principal.Windows.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Thread" library="Facades_System.Threading.Thread-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Threading.Thread.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Threading.Thread.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Threading.Thread.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.ThreadPool" library="Facades_System.Threading.ThreadPool-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Threading.ThreadPool.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Threading.ThreadPool.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Threading.ThreadPool.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath" library="Facades_System.Xml.XPath-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Xml.XPath.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Xml.XPath.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlDocument" library="Facades_System.Xml.XmlDocument-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Xml.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Xml.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.Xsl.Primitives" library="Facades_System.Xml.Xsl.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <output>System.Xml.Xsl.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Xml.Xsl.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.Xsl.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry.AccessControl" library="Facades_Microsoft.Win32.Registry.AccessControl-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>Microsoft.Win32.Registry.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/Microsoft.Win32.Registry.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.StackTrace" library="Facades_System.Diagnostics.StackTrace-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Diagnostics.StackTrace.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Diagnostics.StackTrace.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Diagnostics.StackTrace.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Extensions" library="Facades_System.Globalization.Extensions-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Globalization.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Globalization.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Globalization.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.AccessControl" library="Facades_System.IO.FileSystem.AccessControl-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.IO.FileSystem.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.FileSystem.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.TypeExtensions" library="Facades_System.Reflection.TypeExtensions-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Reflection.TypeExtensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Reflection.TypeExtensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.TypeExtensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.Lightweight" library="Facades_System.Reflection.Emit.Lightweight-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.Lightweight.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Reflection.Emit.Lightweight.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.Lightweight.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.ILGeneration" library="Facades_System.Reflection.Emit.ILGeneration-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.ILGeneration.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Reflection.Emit.ILGeneration.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.ILGeneration.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit" library="Facades_System.Reflection.Emit-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Reflection.Emit.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.SecureString" library="Facades_System.Security.SecureString-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.SecureString.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.SecureString.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.SecureString.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.AccessControl" library="Facades_System.Threading.AccessControl-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Threading.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Threading.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Threading.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Overlapped" library="Facades_System.Threading.Overlapped-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -unsafe -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Threading.Overlapped.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Threading.Overlapped.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Threading.Overlapped.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath.XDocument" library="Facades_System.Xml.XPath.XDocument-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Xml.dll -r:./../../../class/lib/monotouch_watch/System.Xml.Linq.dll</flags>
+      <output>System.Xml.XPath.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Xml.XPath.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Primitives" library="Facades_System.Security.Cryptography.Primitives-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.CodePages" library="Facades_System.Text.Encoding.CodePages-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Text.Encoding.CodePages.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Text.Encoding.CodePages.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.CodePages.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Watcher" library="Facades_System.IO.FileSystem.Watcher-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.IO.FileSystem.Watcher.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.FileSystem.Watcher.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Watcher.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.ProtectedData" library="Facades_System.Security.Cryptography.ProtectedData-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Security.dll</flags>
+      <output>System.Security.Cryptography.ProtectedData.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.ProtectedData.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.ProtectedData.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceProcess.ServiceController" library="Facades_System.ServiceProcess.ServiceController-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.ServiceProcess.ServiceController.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.ServiceProcess.ServiceController.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.ServiceProcess.ServiceController.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Pipes" library="Facades_System.IO.Pipes-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.IO.Pipes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.IO.Pipes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.IO.Pipes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Ping" library="Facades_System.Net.Ping-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Net.Ping.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Net.Ping.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Net.Ping.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Formatters" library="Facades_System.Runtime.Serialization.Formatters-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Runtime.Serialization.Formatters.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Runtime.Serialization.Formatters.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Formatters.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Csp" library="Facades_System.Security.Cryptography.Csp-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll</flags>
+      <output>System.Security.Cryptography.Csp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Csp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Csp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Pkcs" library="Facades_System.Security.Cryptography.Pkcs-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Security.dll</flags>
+      <output>System.Security.Cryptography.Pkcs.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Pkcs.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Pkcs.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Cng" library="Facades_System.Security.Cryptography.Cng-monotouch_watch">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_watch/mscorlib.dll -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_watch/System.dll -r:./../../../class/lib/monotouch_watch/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Cng.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_watch/Facades/System.Security.Cryptography.Cng.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Cng.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-monotouch_watch_runtime">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/mscorlib.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_corlib.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
+      <output>monotouch_watch_runtime_corlib_test.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_watch_runtime_corlib_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_corlib_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch_runtime/System.Xml.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_watch_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-bare-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/bare/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_watch_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-secxml-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch_runtime/bare/System.Xml.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/secxml/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_watch_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:MONO_INTERPRETER -r:./../../class/lib/monotouch_watch_runtime/System.dll -r:./../../class/lib/monotouch_watch_runtime/Mono.Dynamic.Interpreter.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_watch_runtime/System.dll</flags>
+      <output>monotouch_watch_runtime_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_watch_runtime_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_watch_runtime/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/plaincore/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_watch_runtime/System.dll</flags>
+      <output>monotouch_watch_runtime_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_watch_runtime_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_watch_runtime/secxml/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_watch_runtime/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_watch_runtime_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_runtime_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_watch_runtime/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/bare/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_watch_runtime/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_watch_runtime_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_runtime_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:IOS_REFLECTION -r:./../../class/lib/monotouch_watch_runtime/System.Core.dll -r:./../../class/lib/monotouch_watch_runtime/System.Xml.dll -r:./../../class/lib/monotouch_watch_runtime/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_watch_runtime/Mono.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-tests-monotouch_watch_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize -r:./../../class/lib/monotouch_watch_runtime/Mono.CSharp.dll</flags>
+      <output>monotouch_watch_runtime_Mono.CSharp_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_watch_runtime_Mono.CSharp_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_watch_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_watch_runtime_Mono.CSharp_test.dll.response</response>
+    </project>
+    <project dir="class/corlib" library="corlib-monotouch_tv">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_tv/mscorlib.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_corlib.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
+      <output>monotouch_tv_corlib_test.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_tv_corlib_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_corlib_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -unsafe -nowarn:1030,3009 -r:./../../class/lib/monotouch_tv/bare/System.dll</flags>
+      <output>Mono.Security.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_tv/Mono.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_Mono.Security.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/Mono.Security.dll -unsafe -nowarn:1030,3009 -r:./../../class/lib/monotouch_tv/bare/System.dll -nowarn:169,219,618,672</flags>
+      <output>monotouch_tv_Mono.Security_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_tv_Mono.Security_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_Mono.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt</flags>
+      <output>monotouch_tv_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-bare-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/bare/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt</flags>
+      <output>monotouch_tv_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-secxml-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/secxml/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt</flags>
+      <output>monotouch_tv_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:MONO_INTERPRETER -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/Mono.Dynamic.Interpreter.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>monotouch_tv_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_tv_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_tv/plaincore/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>monotouch_tv_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_tv_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/monotouch_tv/secxml/System.dll -r:./../../class/lib/monotouch_tv/bare/System.Xml.dll -r:./../../class/lib/monotouch_tv/Mono.Security.dll</flags>
+      <output>System.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Security.dll.sources</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Security.dll -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/monotouch_tv/secxml/System.dll -r:./../../class/lib/monotouch_tv/bare/System.Xml.dll -r:./../../class/lib/monotouch_tv/Mono.Security.dll -nowarn:168,169,183,219,414</flags>
+      <output>monotouch_tv_System.Security_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Security_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_tv/secxml/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_tv/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_tv_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_tv/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/bare/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_tv/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_tv_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/Common" library="I18N-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig</flags>
+      <output>I18N.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/I18N.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>I18N.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../../class/lib/monotouch_tv/I18N.dll</flags>
+      <output>I18N.West.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/I18N.West.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>I18N.West.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../../class/lib/monotouch_tv/I18N.West.dll</flags>
+      <output>monotouch_tv_I18N.West_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_I18N.West_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_tv_I18N.West_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../../class/lib/monotouch_tv/I18N.dll</flags>
+      <output>I18N.MidEast.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/I18N.MidEast.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>I18N.MidEast.dll.sources</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../../class/lib/monotouch_tv/I18N.MidEast.dll</flags>
+      <output>monotouch_tv_I18N.MidEast_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_I18N.MidEast_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_tv_I18N.MidEast_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/Other" library="I18N.Other-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../../class/lib/monotouch_tv/I18N.dll</flags>
+      <output>I18N.Other.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/I18N.Other.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>I18N.Other.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Rare" library="I18N.Rare-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../../class/lib/monotouch_tv/I18N.dll</flags>
+      <output>I18N.Rare.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/I18N.Rare.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>I18N.Rare.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../../class/lib/monotouch_tv/I18N.dll</flags>
+      <output>I18N.CJK.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/I18N.CJK.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>I18N.CJK.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../../class/lib/monotouch_tv/I18N.CJK.dll</flags>
+      <output>monotouch_tv_I18N.CJK_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_I18N.CJK_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../../build/deps/monotouch_tv_I18N.CJK_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel.Internals" library="System.ServiceModel.Internals-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /unsafe -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.ServiceModel.Internals.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.ServiceModel.Internals.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.ServiceModel.Internals.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NO_CONFIGURATION /d:NO_SECURITY_ATTRIBUTES /d:NO_CODEDOM /d:NO_DESKTOP_SECURITY -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.ServiceModel.Internals.dll</flags>
+      <output>System.Runtime.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Runtime.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NO_CONFIGURATION /d:NO_SECURITY_ATTRIBUTES /d:NO_CODEDOM /d:NO_DESKTOP_SECURITY -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.ServiceModel.Internals.dll /resource:Test/Resources/WSDL/collections.wsdl /resource:Test/Resources/WSDL/custom-collections.wsdl</flags>
+      <output>monotouch_tv_System.Runtime.Serialization_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Runtime.Serialization_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Runtime.Serialization_test.dll.response</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:FEATURE_SERIALIZATION -d:MONO_HYBRID_SYSTEM_XML -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll</flags>
+      <output>System.Xml.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Xml.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.Linq.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Xml.Linq.dll -d:FEATURE_SERIALIZATION -d:MONO_HYBRID_SYSTEM_XML -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll</flags>
+      <output>monotouch_tv_System.Xml.Linq_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Xml.Linq_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Xml.Linq_test.dll.response</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /d:NET_3_0 -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Security.dll -r:./../../class/lib/monotouch_tv/Mono.Security.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll</flags>
+      <output>System.IdentityModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.IdentityModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.IdentityModel.dll.sources</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.IdentityModel.dll /d:NET_3_0 -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Security.dll -r:./../../class/lib/monotouch_tv/Mono.Security.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll</flags>
+      <output>monotouch_tv_System.IdentityModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.IdentityModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.IdentityModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_tv/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_tv/System.IdentityModel.dll</flags>
+      <output>monotouch_tv_System.ServiceModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.ServiceModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.ServiceModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-plainservice-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_tv/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/plainservice/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_tv/System.IdentityModel.dll</flags>
+      <output>monotouch_tv_System.ServiceModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.ServiceModel_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.ServiceModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_tv/System.ServiceModel.dll -r:./../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.ServiceModel.Web.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.ServiceModel.Web.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.ServiceModel.Web.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.ServiceModel.Web.dll -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Runtime.Serialization.dll -r:./../../class/lib/monotouch_tv/System.ServiceModel.dll -r:./../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>monotouch_tv_System.ServiceModel.Web_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.ServiceModel.Web_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.ServiceModel.Web_test.dll.response</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Json.dll.sources</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Json.dll -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>monotouch_tv_System.Json_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Json_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Json_test.dll.response</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:649 -nowarn:169 -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Web.Services.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Web.Services.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Web.Services.dll.sources</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Web.Services.dll -nowarn:649 -nowarn:169 -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -nowarn:618</flags>
+      <output>monotouch_tv_System.Web.Services_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Web.Services_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Web.Services_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Data.Tds" library="Mono.Data.Tds-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/Mono.Security.dll</flags>
+      <output>Mono.Data.Tds.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/Mono.Data.Tds.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Mono.Data.Tds.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Tds" library="Mono.Data.Tds-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/Mono.Data.Tds.dll</flags>
+      <output>monotouch_tv_Mono.Data.Tds_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_Mono.Data.Tds_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_Mono.Data.Tds_test.dll.response</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /define:MOBILE -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Transactions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Transactions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Transactions.dll.sources</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Transactions.dll /define:MOBILE -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>monotouch_tv_System.Transactions_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Transactions_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Transactions_test.dll.response</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /unsafe -nowarn:414 -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Numerics.dll /unsafe -nowarn:414 -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>monotouch_tv_System.Numerics_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Numerics_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Numerics_test.dll.response</response>
+    </project>
+    <project dir="class/System.Numerics.Vectors" library="System.Numerics.Vectors-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -unsafe -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Numerics.dll</flags>
+      <output>System.Numerics.Vectors.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Numerics.Vectors.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Numerics.Vectors.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Numerics.dll -r:./../../class/lib/monotouch_tv/Mono.Data.Tds.dll -r:./../../class/lib/monotouch_tv/System.Transactions.dll</flags>
+      <output>System.Data.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Data.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Data.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Data.dll -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Numerics.dll -r:./../../class/lib/monotouch_tv/Mono.Data.Tds.dll -r:./../../class/lib/monotouch_tv/System.Transactions.dll -nowarn:618,169,612,219,168</flags>
+      <output>monotouch_tv_System.Data_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Data_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Data_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Data.dll -r:./../../class/lib/monotouch_tv/System.Transactions.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>Mono.Data.Sqlite.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/Mono.Data.Sqlite.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Mono.Data.Sqlite.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/Mono.Data.Sqlite.dll /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Data.dll -r:./../../class/lib/monotouch_tv/System.Transactions.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll /nowarn:618</flags>
+      <output>monotouch_tv_Mono.Data.Sqlite_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_Mono.Data.Sqlite_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_Mono.Data.Sqlite_test.dll.response</response>
+    </project>
+    <project dir="class/System.Data.Services.Client" library="System.Data.Services.Client-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:NET_3_5 -warn:2 -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Xml.Linq.dll -r:./../../class/lib/monotouch_tv/System.Data.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Data.Services.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Data.Services.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources>System.Data.Services.Client,Client/System.Data.Services.Client.txt</resources>
+      <response>System.Data.Services.Client.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /unsafe -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.IO.Compression.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.IO.Compression.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.Compression.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.IO.Compression.dll</flags>
+      <output>monotouch_tv_System.IO.Compression_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.IO.Compression_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.IO.Compression_test.dll.response</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.IO.Compression.dll</flags>
+      <output>System.IO.Compression.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.IO.Compression.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.Compression.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.IO.Compression.FileSystem.dll</flags>
+      <output>monotouch_tv_System.IO.Compression.FileSystem_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.IO.Compression.FileSystem_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.IO.Compression.FileSystem_test.dll.response</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:414 -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Data.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.ComponentModel.DataAnnotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.ComponentModel.DataAnnotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ComponentModel.DataAnnotations.dll.sources</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.ComponentModel.DataAnnotations.dll -nowarn:414 -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Data.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>monotouch_tv_System.ComponentModel.DataAnnotations_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.ComponentModel.DataAnnotations_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.ComponentModel.DataAnnotations_test.dll.response</response>
+    </project>
+    <project dir="class/System.ComponentModel.Composition.4.5" library="System.ComponentModel.Composition-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.ComponentModel.Composition.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.ComponentModel.Composition.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources>Microsoft.Internal.Strings,src/ComponentModel/Strings.resx</resources>
+      <response>System.ComponentModel.Composition.dll.sources</response>
+    </project>
+    <project dir="class/System.Net" library="System.Net-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -unsafe -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Net.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Net.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Net.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Http.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/System.Net.Http.dll</flags>
+      <output>monotouch_tv_System.Net.Http_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_System.Net.Http_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_System.Net.Http_test.dll.response</response>
+    </project>
+    <project dir="class/System.Windows" library="System.Windows-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Windows.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Serialization" library="System.Xml.Serialization-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.ServiceModel.dll</flags>
+      <output>System.Xml.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Xml.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:IOS_REFLECTION -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/Mono.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-tests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv/Mono.CSharp.dll</flags>
+      <output>monotouch_tv_Mono.CSharp_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_Mono.CSharp_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_Mono.CSharp_test.dll.response</response>
+    </project>
+    <project dir="class/Microsoft.CSharp" library="Microsoft.CSharp-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.Core.dll -r:./../../class/lib/monotouch_tv/Mono.CSharp.dll</flags>
+      <output>Microsoft.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/Microsoft.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Microsoft.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.InteropServices.RuntimeInformation" library="System.Runtime.InteropServices.RuntimeInformation-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Runtime.InteropServices.RuntimeInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Runtime.InteropServices.RuntimeInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.RuntimeInformation.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.DispatchProxy" library="System.Reflection.DispatchProxy-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Reflection.DispatchProxy.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Reflection.DispatchProxy.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.DispatchProxy.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.XPath.XmlDocument" library="System.Xml.XPath.XmlDocument-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Xml.XPath.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Xml.XPath.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.Context" library="System.Reflection.Context-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Reflection.Context.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Reflection.Context.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.Context.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http.WinHttpHandler" library="System.Net.Http.WinHttpHandler-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/System.Net.Http.dll</flags>
+      <output>System.Net.Http.WinHttpHandler.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/System.Net.Http.WinHttpHandler.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Http.WinHttpHandler.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Dynamic.Interpreter" library="Mono.Dynamic.Interpreter-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:FEATURE_CORE_DLR,FEATURE_DBNULL,FEATURE_DEFAULT_PARAMETER_VALUE,FEATURE_GET_TYPE_INFO,FEATURE_VARIANCE,FEATURE_SERIALIZATION,CLR45 -d:MONO_INTERPRETER -delaysign -keyfile:../mono.pub -r:./../../class/lib/monotouch_tv/System.dll -r:./../../class/lib/monotouch_tv/plaincore/System.Core.dll</flags>
+      <output>Mono.Dynamic.Interpreter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/Mono.Dynamic.Interpreter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Mono.Dynamic.Interpreter.dll.sources</response>
+    </project>
+    <project dir="class/PEAPI" library="PEAPI-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:414,618 -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>PEAPI.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/PEAPI.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>PEAPI.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CompilerServices.SymbolWriter" library="Mono.CompilerServices.SymbolWriter-monotouch_tv">
+      <boot>true</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -r:./../../class/lib/monotouch_tv/System.dll</flags>
+      <output>Mono.CompilerServices.SymbolWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/Mono.CompilerServices.SymbolWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Mono.CompilerServices.SymbolWriter.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Simd" library="Mono.Simd-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /unsafe -r:./../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>Mono.Simd.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv/Mono.Simd.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Mono.Simd.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.X509Certificates" library="Facades_System.Security.Cryptography.X509Certificates-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Security.Cryptography.X509Certificates.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.X509Certificates.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.X509Certificates.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Primitives" library="Facades_System.ServiceModel.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.ServiceModel.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll -r:./../../../class/lib/monotouch_tv/System.IdentityModel.dll -r:./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.X509Certificates.dll</flags>
+      <output>System.ServiceModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ServiceModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Primitives" library="Facades_System.Runtime.Serialization.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.Serialization.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Xml" library="Facades_System.Runtime.Serialization.Xml-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /d:NO_CODEDOM -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Runtime.Serialization.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll -r:./../../../class/lib/monotouch_tv/Facades/System.Runtime.Serialization.Primitives.dll</flags>
+      <output>System.Runtime.Serialization.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.Serialization.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Xml.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Algorithms" library="Facades_System.Security.Cryptography.Algorithms-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.OpenSsl" library="Facades_System.Security.Cryptography.OpenSsl-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Core.dll -r:./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Algorithms.dll</flags>
+      <output>System.Security.Cryptography.OpenSsl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.OpenSsl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.OpenSsl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Concurrent" library="Facades_System.Collections.Concurrent-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Collections.Concurrent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Collections.Concurrent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Collections.Concurrent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections" library="Facades_System.Collections-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Collections.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Collections.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Collections.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Annotations" library="Facades_System.ComponentModel.Annotations-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.ComponentModel.DataAnnotations.dll</flags>
+      <output>System.ComponentModel.Annotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ComponentModel.Annotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Annotations.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.EventBasedAsync" library="Facades_System.ComponentModel.EventBasedAsync-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.ComponentModel.EventBasedAsync.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ComponentModel.EventBasedAsync.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ComponentModel.EventBasedAsync.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel" library="Facades_System.ComponentModel-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.ComponentModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ComponentModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ComponentModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Contracts" library="Facades_System.Diagnostics.Contracts-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Contracts.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.Contracts.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Contracts.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Debug" library="Facades_System.Diagnostics.Debug-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Diagnostics.Debug.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.Debug.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Debug.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tracing" library="Facades_System.Diagnostics.Tracing-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Tracing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.Tracing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tracing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tools" library="Facades_System.Diagnostics.Tools-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Diagnostics.Tools.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.Tools.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tools.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Dynamic.Runtime" library="Facades_System.Dynamic.Runtime-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Core.dll -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Dynamic.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Dynamic.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Dynamic.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization" library="Facades_System.Globalization-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Globalization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Globalization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Globalization.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO" library="Facades_System.IO-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.IO.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Expressions" library="Facades_System.Linq.Expressions-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Linq.Expressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Linq.Expressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Linq.Expressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Parallel" library="Facades_System.Linq.Parallel-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Linq.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Linq.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Linq.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Queryable" library="Facades_System.Linq.Queryable-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Linq.Queryable.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Linq.Queryable.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Linq.Queryable.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq" library="Facades_System.Linq-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Linq.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NetworkInformation" library="Facades_System.Net.NetworkInformation-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.NetworkInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.NetworkInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.NetworkInformation.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Primitives" library="Facades_System.Net.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Requests" library="Facades_System.Net.Requests-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Requests.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.Requests.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Requests.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ObjectModel" library="Facades_System.ObjectModel-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.ObjectModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ObjectModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ObjectModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Extensions" library="Facades_System.Reflection.Extensions-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Reflection.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Primitives" library="Facades_System.Reflection.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Reflection.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection" library="Facades_System.Reflection-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Reflection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ResourceManager" library="Facades_System.Resources.ResourceManager-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Resources.ResourceManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Resources.ResourceManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Resources.ResourceManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Extensions" library="Facades_System.Runtime.Extensions-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Runtime.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices" library="Facades_System.Runtime.InteropServices-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Runtime.InteropServices.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.InteropServices.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices.WindowsRuntime" library="Facades_System.Runtime.InteropServices.WindowsRuntime-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Runtime.InteropServices.WindowsRuntime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.InteropServices.WindowsRuntime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.WindowsRuntime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Numerics" library="Facades_System.Runtime.Numerics-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Numerics.dll</flags>
+      <output>System.Runtime.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Json" library="Facades_System.Runtime.Serialization.Json-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.Serialization.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Json.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime" library="Facades_System.Runtime-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.ComponentModel.Composition.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal" library="Facades_System.Security.Principal-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Security.Principal.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Principal.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Principal.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Http" library="Facades_System.ServiceModel.Http-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ServiceModel.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Http.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Security" library="Facades_System.ServiceModel.Security-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ServiceModel.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.Extensions" library="Facades_System.Text.Encoding.Extensions-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Text.Encoding.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding" library="Facades_System.Text.Encoding-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Text.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.RegularExpressions" library="Facades_System.Text.RegularExpressions-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Text.RegularExpressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Text.RegularExpressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Text.RegularExpressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks.Parallel" library="Facades_System.Threading.Tasks.Parallel-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Threading.Tasks.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Threading.Tasks.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks" library="Facades_System.Threading.Tasks-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Threading.Tasks.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Threading.Tasks.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Timer" library="Facades_System.Threading.Timer-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Threading.Timer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Threading.Timer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Threading.Timer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading" library="Facades_System.Threading-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Threading.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Threading.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Threading.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.ReaderWriter" library="Facades_System.Xml.ReaderWriter-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Xml.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Xml.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XDocument" library="Facades_System.Xml.XDocument-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Xml.Linq.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Xml.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Xml.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlSerializer" library="Facades_System.Xml.XmlSerializer-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Xml.XmlSerializer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Xml.XmlSerializer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.XmlSerializer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Handles" library="Facades_System.Runtime.Handles-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Runtime.Handles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.Handles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.Handles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Duplex" library="Facades_System.ServiceModel.Duplex-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Duplex.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ServiceModel.Duplex.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Duplex.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.NetTcp" library="Facades_System.ServiceModel.NetTcp-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.NetTcp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ServiceModel.NetTcp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ServiceModel.NetTcp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Primitives" library="Facades_Microsoft.Win32.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>Microsoft.Win32.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/Microsoft.Win32.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry" library="Facades_Microsoft.Win32.Registry-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>Microsoft.Win32.Registry.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/Microsoft.Win32.Registry.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.AppContext" library="Facades_System.AppContext-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.AppContext.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.AppContext.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.AppContext.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.NonGeneric" library="Facades_System.Collections.NonGeneric-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Collections.NonGeneric.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Collections.NonGeneric.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Collections.NonGeneric.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Specialized" library="Facades_System.Collections.Specialized-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Collections.Specialized.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Collections.Specialized.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Collections.Specialized.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Primitives" library="Facades_System.ComponentModel.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.ComponentModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ComponentModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.TypeConverter" library="Facades_System.ComponentModel.TypeConverter-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.ComponentModel.TypeConverter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ComponentModel.TypeConverter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ComponentModel.TypeConverter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Console" library="Facades_System.Console-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Console.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Console.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Console.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.Common" library="Facades_System.Data.Common-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Data.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Data.Common.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Data.Common.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Data.Common.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.SqlClient" library="Facades_System.Data.SqlClient-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Data.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Data.SqlClient.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Data.SqlClient.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Data.SqlClient.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.FileVersionInfo" library="Facades_System.Diagnostics.FileVersionInfo-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Diagnostics.FileVersionInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.FileVersionInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.FileVersionInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Process" library="Facades_System.Diagnostics.Process-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Diagnostics.Process.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.Process.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Process.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TextWriterTraceListener" library="Facades_System.Diagnostics.TextWriterTraceListener-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Diagnostics.TextWriterTraceListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.TextWriterTraceListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TextWriterTraceListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceEvent" library="Facades_System.Diagnostics.TraceEvent-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Diagnostics.TraceEvent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.TraceEvent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceEvent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceSource" library="Facades_System.Diagnostics.TraceSource-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Diagnostics.TraceSource.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.TraceSource.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceSource.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Calendars" library="Facades_System.Globalization.Calendars-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Globalization.Calendars.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Globalization.Calendars.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Globalization.Calendars.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Compression.ZipFile" library="Facades_System.IO.Compression.ZipFile-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.IO.Compression.FileSystem.dll</flags>
+      <output>System.IO.Compression.ZipFile.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.Compression.ZipFile.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.Compression.ZipFile.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem" library="Facades_System.IO.FileSystem-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.IO.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.DriveInfo" library="Facades_System.IO.FileSystem.DriveInfo-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.IO.FileSystem.DriveInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.FileSystem.DriveInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.DriveInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Primitives" library="Facades_System.IO.FileSystem.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.IO.FileSystem.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.FileSystem.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.IsolatedStorage" library="Facades_System.IO.IsolatedStorage-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.IO.IsolatedStorage.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.IsolatedStorage.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.IsolatedStorage.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.MemoryMappedFiles" library="Facades_System.IO.MemoryMappedFiles-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.IO.MemoryMappedFiles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.MemoryMappedFiles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.MemoryMappedFiles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.UnmanagedMemoryStream" library="Facades_System.IO.UnmanagedMemoryStream-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.IO.UnmanagedMemoryStream.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.UnmanagedMemoryStream.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.UnmanagedMemoryStream.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.AuthenticationManager" library="Facades_System.Net.AuthenticationManager-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.AuthenticationManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.AuthenticationManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.AuthenticationManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Cache" library="Facades_System.Net.Cache-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Cache.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.Cache.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Cache.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.HttpListener" library="Facades_System.Net.HttpListener-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.HttpListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.HttpListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.HttpListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Mail" library="Facades_System.Net.Mail-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Mail.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.Mail.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Mail.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NameResolution" library="Facades_System.Net.NameResolution-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.NameResolution.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.NameResolution.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.NameResolution.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Security" library="Facades_System.Net.Security-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.ServicePoint" library="Facades_System.Net.ServicePoint-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.ServicePoint.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.ServicePoint.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.ServicePoint.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Sockets" library="Facades_System.Net.Sockets-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Sockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.Sockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Sockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Utilities" library="Facades_System.Net.Utilities-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Utilities.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.Utilities.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Utilities.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebHeaderCollection" library="Facades_System.Net.WebHeaderCollection-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.WebHeaderCollection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.WebHeaderCollection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.WebHeaderCollection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets" library="Facades_System.Net.WebSockets-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.WebSockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.WebSockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets.Client" library="Facades_System.Net.WebSockets.Client-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.WebSockets.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.WebSockets.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.Client.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ReaderWriter" library="Facades_System.Resources.ReaderWriter-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Resources.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Resources.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Resources.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.CompilerServices.VisualC" library="Facades_System.Runtime.CompilerServices.VisualC-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Runtime.CompilerServices.VisualC.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.CompilerServices.VisualC.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.CompilerServices.VisualC.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.AccessControl" library="Facades_System.Security.AccessControl-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Claims" library="Facades_System.Security.Claims-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Claims.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Claims.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Claims.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.DeriveBytes" library="Facades_System.Security.Cryptography.DeriveBytes-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.DeriveBytes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.DeriveBytes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.DeriveBytes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encoding" library="Facades_System.Security.Cryptography.Encoding-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption" library="Facades_System.Security.Cryptography.Encryption-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Encryption.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.Aes" library="Facades_System.Security.Cryptography.Encryption.Aes-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.Aes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Encryption.Aes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.Aes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman" library="Facades_System.Security.Cryptography.Encryption.ECDiffieHellman-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDiffieHellman.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDiffieHellman.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDsa" library="Facades_System.Security.Cryptography.Encryption.ECDsa-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDsa.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Encryption.ECDsa.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDsa.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing" library="Facades_System.Security.Cryptography.Hashing-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Hashing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing.Algorithms" library="Facades_System.Security.Cryptography.Hashing.Algorithms-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Hashing.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RSA" library="Facades_System.Security.Cryptography.RSA-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.RSA.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.RSA.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RSA.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RandomNumberGenerator" library="Facades_System.Security.Cryptography.RandomNumberGenerator-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.RandomNumberGenerator.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.RandomNumberGenerator.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RandomNumberGenerator.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal.Windows" library="Facades_System.Security.Principal.Windows-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Principal.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Principal.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Principal.Windows.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Thread" library="Facades_System.Threading.Thread-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Threading.Thread.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Threading.Thread.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Threading.Thread.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.ThreadPool" library="Facades_System.Threading.ThreadPool-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Threading.ThreadPool.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Threading.ThreadPool.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Threading.ThreadPool.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath" library="Facades_System.Xml.XPath-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Xml.XPath.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Xml.XPath.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlDocument" library="Facades_System.Xml.XmlDocument-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Xml.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Xml.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.Xsl.Primitives" library="Facades_System.Xml.Xsl.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll</flags>
+      <output>System.Xml.Xsl.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Xml.Xsl.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.Xsl.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry.AccessControl" library="Facades_Microsoft.Win32.Registry.AccessControl-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>Microsoft.Win32.Registry.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/Microsoft.Win32.Registry.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.StackTrace" library="Facades_System.Diagnostics.StackTrace-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Diagnostics.StackTrace.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Diagnostics.StackTrace.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Diagnostics.StackTrace.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Extensions" library="Facades_System.Globalization.Extensions-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Globalization.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Globalization.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Globalization.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.AccessControl" library="Facades_System.IO.FileSystem.AccessControl-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.IO.FileSystem.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.FileSystem.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.TypeExtensions" library="Facades_System.Reflection.TypeExtensions-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Reflection.TypeExtensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Reflection.TypeExtensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.TypeExtensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.Lightweight" library="Facades_System.Reflection.Emit.Lightweight-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.Lightweight.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Reflection.Emit.Lightweight.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.Lightweight.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.ILGeneration" library="Facades_System.Reflection.Emit.ILGeneration-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.ILGeneration.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Reflection.Emit.ILGeneration.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.ILGeneration.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit" library="Facades_System.Reflection.Emit-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Reflection.Emit.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.SecureString" library="Facades_System.Security.SecureString-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.SecureString.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.SecureString.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.SecureString.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.AccessControl" library="Facades_System.Threading.AccessControl-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Threading.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Threading.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Threading.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Overlapped" library="Facades_System.Threading.Overlapped-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -unsafe -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Threading.Overlapped.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Threading.Overlapped.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Threading.Overlapped.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath.XDocument" library="Facades_System.Xml.XPath.XDocument-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Xml.dll -r:./../../../class/lib/monotouch_tv/System.Xml.Linq.dll</flags>
+      <output>System.Xml.XPath.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Xml.XPath.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Primitives" library="Facades_System.Security.Cryptography.Primitives-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.CodePages" library="Facades_System.Text.Encoding.CodePages-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Text.Encoding.CodePages.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Text.Encoding.CodePages.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.CodePages.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Watcher" library="Facades_System.IO.FileSystem.Watcher-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.IO.FileSystem.Watcher.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.FileSystem.Watcher.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Watcher.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.ProtectedData" library="Facades_System.Security.Cryptography.ProtectedData-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Security.dll</flags>
+      <output>System.Security.Cryptography.ProtectedData.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.ProtectedData.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.ProtectedData.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceProcess.ServiceController" library="Facades_System.ServiceProcess.ServiceController-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.ServiceProcess.ServiceController.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.ServiceProcess.ServiceController.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.ServiceProcess.ServiceController.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Pipes" library="Facades_System.IO.Pipes-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.IO.Pipes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.IO.Pipes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.IO.Pipes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Ping" library="Facades_System.Net.Ping-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Net.Ping.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Net.Ping.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Net.Ping.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Formatters" library="Facades_System.Runtime.Serialization.Formatters-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Runtime.Serialization.Formatters.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Runtime.Serialization.Formatters.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Formatters.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Csp" library="Facades_System.Security.Cryptography.Csp-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll</flags>
+      <output>System.Security.Cryptography.Csp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Csp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Csp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Pkcs" library="Facades_System.Security.Cryptography.Pkcs-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Security.dll</flags>
+      <output>System.Security.Cryptography.Pkcs.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Pkcs.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Pkcs.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Cng" library="Facades_System.Security.Cryptography.Cng-monotouch_tv">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/monotouch_tv/mscorlib.dll -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/monotouch_tv/System.dll -r:./../../../class/lib/monotouch_tv/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Cng.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/monotouch_tv/Facades/System.Security.Cryptography.Cng.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Cng.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-monotouch_tv_runtime">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:MONOTOUCH_TV -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/mscorlib.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_corlib.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
+      <output>monotouch_tv_runtime_corlib_test.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_tv_runtime_corlib_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_corlib_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -unsafe -nowarn:1030,3009 -r:./../../class/lib/monotouch_tv_runtime/bare/System.dll</flags>
+      <output>Mono.Security.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/Mono.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>Mono.Security.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/Mono.Security.dll -unsafe -nowarn:1030,3009 -r:./../../class/lib/monotouch_tv_runtime/bare/System.dll -nowarn:169,219,618,672</flags>
+      <output>monotouch_tv_runtime_Mono.Security_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>monotouch_tv_runtime_Mono.Security_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_Mono.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv_runtime/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv_runtime/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_tv_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-bare-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/bare/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_tv_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-secxml-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv_runtime/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv_runtime/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/secxml/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>monotouch_tv_runtime_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_runtime_System_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -d:MONO_INTERPRETER -r:./../../class/lib/monotouch_tv_runtime/System.dll -r:./../../class/lib/monotouch_tv_runtime/Mono.Dynamic.Interpreter.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_tv_runtime/System.dll</flags>
+      <output>monotouch_tv_runtime_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_tv_runtime_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_tv_runtime/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/plaincore/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR -r:./../../class/lib/monotouch_tv_runtime/System.dll</flags>
+      <output>monotouch_tv_runtime_System.Core_test.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>monotouch_tv_runtime_System.Core_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_tv_runtime/secxml/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_tv_runtime/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_tv_runtime_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_runtime_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_tv_runtime/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/bare/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/monotouch_tv_runtime/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>monotouch_tv_runtime_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_runtime_System.Xml_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:IOS_REFLECTION -r:./../../class/lib/monotouch_tv_runtime/System.Core.dll -r:./../../class/lib/monotouch_tv_runtime/System.Xml.dll -r:./../../class/lib/monotouch_tv_runtime/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/monotouch_tv_runtime/Mono.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-tests-monotouch_tv_runtime">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize -r:./../../class/lib/monotouch_tv_runtime/Mono.CSharp.dll</flags>
+      <output>monotouch_tv_runtime_Mono.CSharp_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>monotouch_tv_runtime_Mono.CSharp_test.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>monotouch_tv_runtime</profile>
+      <resources></resources>
+      <response>./../../build/deps/monotouch_tv_runtime_Mono.CSharp_test.dll.response</response>
+    </project>
+    <project dir="class/corlib" library="corlib-xammac">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -debug -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources>CommonCrypto/MD5CryptoServiceProvider.g.cs CommonCrypto/SHA256Managed.g.cs CommonCrypto/RC2CryptoServiceProvider.g.cs CommonCrypto/SHA384Managed.g.cs CommonCrypto/DESCryptoServiceProvider.g.cs CommonCrypto/SHA1CryptoServiceProvider.g.cs CommonCrypto/SHA512Managed.g.cs CommonCrypto/MD2Managed.g.cs CommonCrypto/SHA1Managed.g.cs CommonCrypto/TripleDESCryptoServiceProvider.g.cs CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/xammac/mscorlib.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_corlib.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030,3009 -r:./../../class/lib/xammac/bare/System.dll</flags>
+      <output>Mono.Security.dll</output>
+      <built_sources>../corlib/CommonCrypto/SHA224Managed.g.cs ../corlib/CommonCrypto/MD2Managed.g.cs ../corlib/CommonCrypto/MD4Managed.g.cs</built_sources>
+      <library_output>./../../class/lib/xammac/Mono.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_Mono.Security.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/xammac/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-bare-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/bare/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-secxml-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/xammac/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/secxml/System.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR,FEATURE_REFEMIT -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/xammac/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:FEATURE_CORE_DLR,FEATURE_REFEMIT -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources>../corlib/CommonCrypto/AesManaged.g.cs ../corlib/CommonCrypto/AesCryptoServiceProvider.g.cs</built_sources>
+      <library_output>./../../class/lib/xammac/plaincore/System.Core.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/xammac/secxml/System.dll -r:./../../class/lib/xammac/bare/System.Xml.dll -r:./../../class/lib/xammac/Mono.Security.dll</flags>
+      <output>System.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Security.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/xammac/secxml/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:AGCLR -d:DISABLE_XSLT_COMPILER -d:DISABLE_XSLT_SCRIPT,MONO_HYBRID_SYSTEM_XML -d:DISABLE_CAS_USE -r:./../../class/lib/xammac/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/bare/System.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Common" library="I18N-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig</flags>
+      <output>I18N.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/I18N.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>I18N.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/xammac/I18N.dll</flags>
+      <output>I18N.West.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/I18N.West.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>I18N.West.dll.sources</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/xammac/I18N.dll</flags>
+      <output>I18N.MidEast.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/I18N.MidEast.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>I18N.MidEast.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Other" library="I18N.Other-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/xammac/I18N.dll</flags>
+      <output>I18N.Other.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/I18N.Other.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>I18N.Other.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Rare" library="I18N.Rare-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/xammac/I18N.dll</flags>
+      <output>I18N.Rare.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/I18N.Rare.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>I18N.Rare.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../../class/lib/xammac/I18N.dll</flags>
+      <output>I18N.CJK.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/I18N.CJK.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>I18N.CJK.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel.Internals" library="System.ServiceModel.Internals-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /unsafe -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.ServiceModel.Internals.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.ServiceModel.Internals.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.ServiceModel.Internals.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NO_CONFIGURATION /d:NO_SECURITY_ATTRIBUTES /d:NO_CODEDOM /d:NO_DESKTOP_SECURITY -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.ServiceModel.Internals.dll</flags>
+      <output>System.Runtime.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Runtime.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Runtime.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:FEATURE_SERIALIZATION -d:MONO_HYBRID_SYSTEM_XML -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.Runtime.Serialization.dll</flags>
+      <output>System.Xml.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Xml.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.Linq.dll.sources</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /d:NET_3_0 -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.Security.dll -r:./../../class/lib/xammac/Mono.Security.dll -r:./../../class/lib/xammac/System.Runtime.Serialization.dll</flags>
+      <output>System.IdentityModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.IdentityModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.IdentityModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Runtime.Serialization.dll -r:./../../class/lib/xammac/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-plainservice-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Runtime.Serialization.dll -r:./../../class/lib/xammac/System.IdentityModel.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/plainservice/System.ServiceModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.Runtime.Serialization.dll -r:./../../class/lib/xammac/System.ServiceModel.dll -r:./../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.ServiceModel.Web.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.ServiceModel.Web.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.ServiceModel.Web.dll.sources</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Json.dll.sources</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:649 -nowarn:169 -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Web.Services.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Web.Services.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Web.Services.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Tds" library="Mono.Data.Tds-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/Mono.Security.dll</flags>
+      <output>Mono.Data.Tds.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/Mono.Data.Tds.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>Mono.Data.Tds.dll.sources</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /define:MOBILE -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Transactions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Transactions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Transactions.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /unsafe -nowarn:414 -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics.Vectors" library="System.Numerics.Vectors-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -unsafe -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Numerics.dll</flags>
+      <output>System.Numerics.Vectors.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Numerics.Vectors.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Numerics.Vectors.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -d:NO_CODEDOM -d:NO_OLEDB -d:NO_ODBC -d:NO_CONFIGURATION -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Numerics.dll -r:./../../class/lib/xammac/Mono.Data.Tds.dll -r:./../../class/lib/xammac/System.Transactions.dll</flags>
+      <output>System.Data.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Data.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Data.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Data.dll -r:./../../class/lib/xammac/System.Transactions.dll -r:./../../class/lib/xammac/System.Xml.dll</flags>
+      <output>Mono.Data.Sqlite.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/Mono.Data.Sqlite.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>Mono.Data.Sqlite.dll.sources</response>
+    </project>
+    <project dir="class/System.Data.Services.Client" library="System.Data.Services.Client-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:NET_3_5 -warn:2 -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Xml.Linq.dll -r:./../../class/lib/xammac/System.Data.dll -r:./../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Data.Services.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Data.Services.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources>System.Data.Services.Client,Client/System.Data.Services.Client.txt</resources>
+      <response>System.Data.Services.Client.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /unsafe -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.IO.Compression.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.IO.Compression.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.Compression.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.IO.Compression.dll</flags>
+      <output>System.IO.Compression.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.IO.Compression.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.Compression.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:414 -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Data.dll -r:./../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.ComponentModel.DataAnnotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.ComponentModel.DataAnnotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ComponentModel.DataAnnotations.dll.sources</response>
+    </project>
+    <project dir="class/System.ComponentModel.Composition.4.5" library="System.ComponentModel.Composition-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.ComponentModel.Composition.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.ComponentModel.Composition.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources>Microsoft.Internal.Strings,src/ComponentModel/Strings.resx</resources>
+      <response>System.ComponentModel.Composition.dll.sources</response>
+    </project>
+    <project dir="class/System.Net" library="System.Net-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -unsafe -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Net.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Net.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Net.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_System.Net.Http.dll.sources</response>
+    </project>
+    <project dir="class/System.Windows" library="System.Windows-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -optimize /noconfig -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Windows.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Serialization" library="System.Xml.Serialization-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -optimize /noconfig -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.ServiceModel.dll</flags>
+      <output>System.Xml.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Xml.Serialization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:MONO_FEATURE_THREAD_ABORT -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/System.Xml.dll -r:./../../class/lib/xammac/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/Mono.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Microsoft.CSharp" library="Microsoft.CSharp-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.Core.dll -r:./../../class/lib/xammac/Mono.CSharp.dll</flags>
+      <output>Microsoft.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/Microsoft.CSharp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>Microsoft.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.InteropServices.RuntimeInformation" library="System.Runtime.InteropServices.RuntimeInformation-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Runtime.InteropServices.RuntimeInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Runtime.InteropServices.RuntimeInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.RuntimeInformation.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.DispatchProxy" library="System.Reflection.DispatchProxy-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Reflection.DispatchProxy.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Reflection.DispatchProxy.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.DispatchProxy.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.XPath.XmlDocument" library="System.Xml.XPath.XmlDocument-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Xml.XPath.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Xml.XPath.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.Context" library="System.Reflection.Context-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll</flags>
+      <output>System.Reflection.Context.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Reflection.Context.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.Context.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http.WinHttpHandler" library="System.Net.Http.WinHttpHandler-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll -r:./../../class/lib/xammac/System.Net.Http.dll</flags>
+      <output>System.Net.Http.WinHttpHandler.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/System.Net.Http.WinHttpHandler.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Http.WinHttpHandler.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CompilerServices.SymbolWriter" library="Mono.CompilerServices.SymbolWriter-xammac">
+      <boot>true</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/xammac/System.dll</flags>
+      <output>Mono.CompilerServices.SymbolWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac/Mono.CompilerServices.SymbolWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>Mono.CompilerServices.SymbolWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.X509Certificates" library="Facades_System.Security.Cryptography.X509Certificates-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Security.Cryptography.X509Certificates.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.X509Certificates.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.X509Certificates.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Primitives" library="Facades_System.ServiceModel.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.ServiceModel.dll -r:./../../../class/lib/xammac/System.Xml.dll -r:./../../../class/lib/xammac/System.IdentityModel.dll -r:./../../../class/lib/xammac/Facades/System.Security.Cryptography.X509Certificates.dll</flags>
+      <output>System.ServiceModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ServiceModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Primitives" library="Facades_System.Runtime.Serialization.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.Serialization.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Xml" library="Facades_System.Runtime.Serialization.Xml-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 /d:NO_CODEDOM -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Runtime.Serialization.dll -r:./../../../class/lib/xammac/System.Xml.dll -r:./../../../class/lib/xammac/Facades/System.Runtime.Serialization.Primitives.dll</flags>
+      <output>System.Runtime.Serialization.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.Serialization.Xml.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Xml.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Algorithms" library="Facades_System.Security.Cryptography.Algorithms-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.OpenSsl" library="Facades_System.Security.Cryptography.OpenSsl-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Core.dll -r:./../../../class/lib/xammac/Facades/System.Security.Cryptography.Algorithms.dll</flags>
+      <output>System.Security.Cryptography.OpenSsl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.OpenSsl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.OpenSsl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Concurrent" library="Facades_System.Collections.Concurrent-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Collections.Concurrent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Collections.Concurrent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Collections.Concurrent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections" library="Facades_System.Collections-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Collections.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Collections.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Collections.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Annotations" library="Facades_System.ComponentModel.Annotations-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.ComponentModel.DataAnnotations.dll</flags>
+      <output>System.ComponentModel.Annotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ComponentModel.Annotations.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Annotations.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.EventBasedAsync" library="Facades_System.ComponentModel.EventBasedAsync-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.ComponentModel.EventBasedAsync.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ComponentModel.EventBasedAsync.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ComponentModel.EventBasedAsync.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel" library="Facades_System.ComponentModel-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.ComponentModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ComponentModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ComponentModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Contracts" library="Facades_System.Diagnostics.Contracts-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Contracts.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.Contracts.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Contracts.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Debug" library="Facades_System.Diagnostics.Debug-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Diagnostics.Debug.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.Debug.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Debug.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tracing" library="Facades_System.Diagnostics.Tracing-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Tracing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.Tracing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tracing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tools" library="Facades_System.Diagnostics.Tools-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Diagnostics.Tools.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.Tools.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tools.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Dynamic.Runtime" library="Facades_System.Dynamic.Runtime-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Core.dll -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Dynamic.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Dynamic.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Dynamic.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization" library="Facades_System.Globalization-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Globalization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Globalization.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Globalization.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO" library="Facades_System.IO-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.IO.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Expressions" library="Facades_System.Linq.Expressions-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Linq.Expressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Linq.Expressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Linq.Expressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Parallel" library="Facades_System.Linq.Parallel-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Linq.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Linq.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Linq.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Queryable" library="Facades_System.Linq.Queryable-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Linq.Queryable.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Linq.Queryable.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Linq.Queryable.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq" library="Facades_System.Linq-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Linq.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Linq.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NetworkInformation" library="Facades_System.Net.NetworkInformation-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.NetworkInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.NetworkInformation.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.NetworkInformation.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Primitives" library="Facades_System.Net.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Requests" library="Facades_System.Net.Requests-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Requests.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.Requests.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Requests.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ObjectModel" library="Facades_System.ObjectModel-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.ObjectModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ObjectModel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ObjectModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Extensions" library="Facades_System.Reflection.Extensions-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Reflection.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Primitives" library="Facades_System.Reflection.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Reflection.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection" library="Facades_System.Reflection-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Reflection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ResourceManager" library="Facades_System.Resources.ResourceManager-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Resources.ResourceManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Resources.ResourceManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Resources.ResourceManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Extensions" library="Facades_System.Runtime.Extensions-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Runtime.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices" library="Facades_System.Runtime.InteropServices-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Runtime.InteropServices.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.InteropServices.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices.WindowsRuntime" library="Facades_System.Runtime.InteropServices.WindowsRuntime-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Runtime.InteropServices.WindowsRuntime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.InteropServices.WindowsRuntime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.WindowsRuntime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Numerics" library="Facades_System.Runtime.Numerics-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Numerics.dll</flags>
+      <output>System.Runtime.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.Numerics.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Json" library="Facades_System.Runtime.Serialization.Json-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.Serialization.Json.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Json.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime" library="Facades_System.Runtime-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.ComponentModel.Composition.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal" library="Facades_System.Security.Principal-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Security.Principal.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Principal.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Principal.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Http" library="Facades_System.ServiceModel.Http-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ServiceModel.Http.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Http.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Security" library="Facades_System.ServiceModel.Security-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ServiceModel.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.Extensions" library="Facades_System.Text.Encoding.Extensions-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Text.Encoding.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding" library="Facades_System.Text.Encoding-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Text.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.RegularExpressions" library="Facades_System.Text.RegularExpressions-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Text.RegularExpressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Text.RegularExpressions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Text.RegularExpressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks.Parallel" library="Facades_System.Threading.Tasks.Parallel-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Threading.Tasks.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Threading.Tasks.Parallel.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks" library="Facades_System.Threading.Tasks-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Threading.Tasks.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Threading.Tasks.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Timer" library="Facades_System.Threading.Timer-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Threading.Timer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Threading.Timer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Threading.Timer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading" library="Facades_System.Threading-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Threading.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Threading.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Threading.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.ReaderWriter" library="Facades_System.Xml.ReaderWriter-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Xml.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Xml.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XDocument" library="Facades_System.Xml.XDocument-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Xml.Linq.dll -r:./../../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Xml.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Xml.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlSerializer" library="Facades_System.Xml.XmlSerializer-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Xml.XmlSerializer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Xml.XmlSerializer.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.XmlSerializer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Handles" library="Facades_System.Runtime.Handles-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Runtime.Handles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.Handles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.Handles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Duplex" library="Facades_System.ServiceModel.Duplex-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Duplex.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ServiceModel.Duplex.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Duplex.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.NetTcp" library="Facades_System.ServiceModel.NetTcp-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.NetTcp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ServiceModel.NetTcp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ServiceModel.NetTcp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Primitives" library="Facades_Microsoft.Win32.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>Microsoft.Win32.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/Microsoft.Win32.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry" library="Facades_Microsoft.Win32.Registry-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>Microsoft.Win32.Registry.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/Microsoft.Win32.Registry.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.AppContext" library="Facades_System.AppContext-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.AppContext.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.AppContext.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.AppContext.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.NonGeneric" library="Facades_System.Collections.NonGeneric-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Collections.NonGeneric.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Collections.NonGeneric.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Collections.NonGeneric.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Specialized" library="Facades_System.Collections.Specialized-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Collections.Specialized.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Collections.Specialized.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Collections.Specialized.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Primitives" library="Facades_System.ComponentModel.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.ComponentModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ComponentModel.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.TypeConverter" library="Facades_System.ComponentModel.TypeConverter-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.ComponentModel.TypeConverter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ComponentModel.TypeConverter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ComponentModel.TypeConverter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Console" library="Facades_System.Console-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Console.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Console.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Console.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.Common" library="Facades_System.Data.Common-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Data.dll -r:./../../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Data.Common.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Data.Common.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Data.Common.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.SqlClient" library="Facades_System.Data.SqlClient-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Data.dll -r:./../../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Data.SqlClient.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Data.SqlClient.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Data.SqlClient.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.FileVersionInfo" library="Facades_System.Diagnostics.FileVersionInfo-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Diagnostics.FileVersionInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.FileVersionInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.FileVersionInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Process" library="Facades_System.Diagnostics.Process-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Diagnostics.Process.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.Process.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Process.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TextWriterTraceListener" library="Facades_System.Diagnostics.TextWriterTraceListener-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Diagnostics.TextWriterTraceListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.TextWriterTraceListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TextWriterTraceListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceEvent" library="Facades_System.Diagnostics.TraceEvent-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Diagnostics.TraceEvent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.TraceEvent.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceEvent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceSource" library="Facades_System.Diagnostics.TraceSource-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Diagnostics.TraceSource.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.TraceSource.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceSource.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Calendars" library="Facades_System.Globalization.Calendars-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Globalization.Calendars.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Globalization.Calendars.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Globalization.Calendars.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Compression.ZipFile" library="Facades_System.IO.Compression.ZipFile-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.IO.Compression.FileSystem.dll</flags>
+      <output>System.IO.Compression.ZipFile.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.Compression.ZipFile.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.Compression.ZipFile.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem" library="Facades_System.IO.FileSystem-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.IO.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.FileSystem.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.DriveInfo" library="Facades_System.IO.FileSystem.DriveInfo-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.IO.FileSystem.DriveInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.FileSystem.DriveInfo.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.DriveInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Primitives" library="Facades_System.IO.FileSystem.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.IO.FileSystem.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.FileSystem.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.IsolatedStorage" library="Facades_System.IO.IsolatedStorage-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.IO.IsolatedStorage.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.IsolatedStorage.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.IsolatedStorage.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.MemoryMappedFiles" library="Facades_System.IO.MemoryMappedFiles-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.IO.MemoryMappedFiles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.MemoryMappedFiles.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.MemoryMappedFiles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.UnmanagedMemoryStream" library="Facades_System.IO.UnmanagedMemoryStream-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.IO.UnmanagedMemoryStream.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.UnmanagedMemoryStream.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.UnmanagedMemoryStream.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.AuthenticationManager" library="Facades_System.Net.AuthenticationManager-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.AuthenticationManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.AuthenticationManager.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.AuthenticationManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Cache" library="Facades_System.Net.Cache-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Cache.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.Cache.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Cache.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.HttpListener" library="Facades_System.Net.HttpListener-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.HttpListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.HttpListener.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.HttpListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Mail" library="Facades_System.Net.Mail-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Mail.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.Mail.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Mail.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NameResolution" library="Facades_System.Net.NameResolution-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.NameResolution.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.NameResolution.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.NameResolution.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Security" library="Facades_System.Net.Security-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.Security.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.ServicePoint" library="Facades_System.Net.ServicePoint-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.ServicePoint.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.ServicePoint.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.ServicePoint.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Sockets" library="Facades_System.Net.Sockets-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Sockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.Sockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Sockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Utilities" library="Facades_System.Net.Utilities-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Utilities.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.Utilities.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Utilities.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebHeaderCollection" library="Facades_System.Net.WebHeaderCollection-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.WebHeaderCollection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.WebHeaderCollection.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.WebHeaderCollection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets" library="Facades_System.Net.WebSockets-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.WebSockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.WebSockets.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets.Client" library="Facades_System.Net.WebSockets.Client-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.WebSockets.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.WebSockets.Client.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.Client.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ReaderWriter" library="Facades_System.Resources.ReaderWriter-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Resources.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Resources.ReaderWriter.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Resources.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.CompilerServices.VisualC" library="Facades_System.Runtime.CompilerServices.VisualC-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Runtime.CompilerServices.VisualC.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.CompilerServices.VisualC.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.CompilerServices.VisualC.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.AccessControl" library="Facades_System.Security.AccessControl-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Claims" library="Facades_System.Security.Claims-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Claims.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Claims.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Claims.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.DeriveBytes" library="Facades_System.Security.Cryptography.DeriveBytes-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.DeriveBytes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.DeriveBytes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.DeriveBytes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encoding" library="Facades_System.Security.Cryptography.Encoding-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Encoding.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption" library="Facades_System.Security.Cryptography.Encryption-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Encryption.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.Aes" library="Facades_System.Security.Cryptography.Encryption.Aes-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.Aes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Encryption.Aes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.Aes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman" library="Facades_System.Security.Cryptography.Encryption.ECDiffieHellman-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDiffieHellman.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDiffieHellman.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDsa" library="Facades_System.Security.Cryptography.Encryption.ECDsa-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDsa.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Encryption.ECDsa.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDsa.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing" library="Facades_System.Security.Cryptography.Hashing-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Hashing.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing.Algorithms" library="Facades_System.Security.Cryptography.Hashing.Algorithms-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Hashing.Algorithms.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RSA" library="Facades_System.Security.Cryptography.RSA-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.RSA.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.RSA.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RSA.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RandomNumberGenerator" library="Facades_System.Security.Cryptography.RandomNumberGenerator-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.RandomNumberGenerator.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.RandomNumberGenerator.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RandomNumberGenerator.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal.Windows" library="Facades_System.Security.Principal.Windows-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Principal.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Principal.Windows.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Principal.Windows.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Thread" library="Facades_System.Threading.Thread-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Threading.Thread.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Threading.Thread.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Threading.Thread.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.ThreadPool" library="Facades_System.Threading.ThreadPool-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Threading.ThreadPool.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Threading.ThreadPool.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Threading.ThreadPool.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath" library="Facades_System.Xml.XPath-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Xml.XPath.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Xml.XPath.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlDocument" library="Facades_System.Xml.XmlDocument-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Xml.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Xml.XmlDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.Xsl.Primitives" library="Facades_System.Xml.Xsl.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Xml.dll</flags>
+      <output>System.Xml.Xsl.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Xml.Xsl.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.Xsl.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry.AccessControl" library="Facades_Microsoft.Win32.Registry.AccessControl-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>Microsoft.Win32.Registry.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/Microsoft.Win32.Registry.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.StackTrace" library="Facades_System.Diagnostics.StackTrace-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Diagnostics.StackTrace.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Diagnostics.StackTrace.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Diagnostics.StackTrace.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Extensions" library="Facades_System.Globalization.Extensions-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Globalization.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Globalization.Extensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Globalization.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.AccessControl" library="Facades_System.IO.FileSystem.AccessControl-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.IO.FileSystem.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.FileSystem.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.TypeExtensions" library="Facades_System.Reflection.TypeExtensions-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Reflection.TypeExtensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Reflection.TypeExtensions.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.TypeExtensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.Lightweight" library="Facades_System.Reflection.Emit.Lightweight-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.Lightweight.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Reflection.Emit.Lightweight.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.Lightweight.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.ILGeneration" library="Facades_System.Reflection.Emit.ILGeneration-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.ILGeneration.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Reflection.Emit.ILGeneration.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.ILGeneration.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit" library="Facades_System.Reflection.Emit-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Reflection.Emit.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.SecureString" library="Facades_System.Security.SecureString-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.SecureString.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.SecureString.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.SecureString.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.AccessControl" library="Facades_System.Threading.AccessControl-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Threading.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Threading.AccessControl.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Threading.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Overlapped" library="Facades_System.Threading.Overlapped-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -unsafe -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Threading.Overlapped.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Threading.Overlapped.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Threading.Overlapped.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath.XDocument" library="Facades_System.Xml.XPath.XDocument-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Xml.dll -r:./../../../class/lib/xammac/System.Xml.Linq.dll</flags>
+      <output>System.Xml.XPath.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Xml.XPath.XDocument.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Primitives" library="Facades_System.Security.Cryptography.Primitives-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Primitives.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.CodePages" library="Facades_System.Text.Encoding.CodePages-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Text.Encoding.CodePages.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Text.Encoding.CodePages.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.CodePages.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Watcher" library="Facades_System.IO.FileSystem.Watcher-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.IO.FileSystem.Watcher.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.FileSystem.Watcher.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Watcher.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.ProtectedData" library="Facades_System.Security.Cryptography.ProtectedData-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Security.dll</flags>
+      <output>System.Security.Cryptography.ProtectedData.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.ProtectedData.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.ProtectedData.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceProcess.ServiceController" library="Facades_System.ServiceProcess.ServiceController-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.ServiceProcess.ServiceController.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.ServiceProcess.ServiceController.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.ServiceProcess.ServiceController.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Pipes" library="Facades_System.IO.Pipes-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.IO.Pipes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.IO.Pipes.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.IO.Pipes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Ping" library="Facades_System.Net.Ping-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Net.Ping.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Net.Ping.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Net.Ping.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Formatters" library="Facades_System.Runtime.Serialization.Formatters-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Runtime.Serialization.Formatters.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Runtime.Serialization.Formatters.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Formatters.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Csp" library="Facades_System.Security.Cryptography.Csp-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll</flags>
+      <output>System.Security.Cryptography.Csp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Csp.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Csp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Pkcs" library="Facades_System.Security.Cryptography.Pkcs-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Security.dll</flags>
+      <output>System.Security.Cryptography.Pkcs.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Pkcs.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Pkcs.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Cng" library="Facades_System.Security.Cryptography.Cng-xammac">
+      <boot>false</boot>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac/mscorlib.dll -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac/System.dll -r:./../../../class/lib/xammac/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Cng.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac/Facades/System.Security.Cryptography.Cng.dll</library_output>
+      <fx_version>2.1</fx_version>
+      <profile>xammac</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Cng.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-xammac_net_4_5">
+      <boot>true</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4</flags>
+      <output>mscorlib.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/mscorlib.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>corlib.dll.sources</response>
+    </project>
+    <project dir="class/corlib" library="corlib-tests-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -debug -nowarn:168,219,618,672 -unsafe -define:MONO_DATACONVERTER_STATIC_METHODS -resource:Test/resources/Resources.resources</flags>
+      <output>xammac_net_4_5_corlib_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_corlib_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_corlib_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -unsafe -nowarn:1030,3009 -r:./../../class/lib/xammac_net_4_5/bare/System.dll</flags>
+      <output>Mono.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/Mono.Security.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Mono.Security.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Security" library="Mono.Security-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll -unsafe -nowarn:1030,3009 -r:./../../class/lib/xammac_net_4_5/bare/System.dll -nowarn:169,219,618,672</flags>
+      <output>xammac_net_4_5_Mono.Security_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_Mono.Security_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_Mono.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:MonoSecurity=./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>xammac_net_4_5_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-bare-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/bare/System.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>xammac_net_4_5_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System_test.dll.response</response>
+    </project>
+    <project dir="class/System" library="System-secxml-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/xammac_net_4_5/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <output>System.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/secxml/System.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.dll.sources</response>
+    </project>
+    <project dir="class/System" library="System-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/secxml/System.dll -nowarn:618,672,219,67,169,612 -resource:Test/System/test-uri-props.txt,test-uri-props.txt -resource:Test/System/test-uri-props-manual.txt,test-uri-props-manual.txt -resource:Test/System/test-uri-relative-props.txt,test-uri-relative-props.txt -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS</flags>
+      <output>xammac_net_4_5_System_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Posix" library="Mono.Posix-xammac_net_4_5">
+      <boot>true</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /unsafe /nowarn:0618,612 -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>Mono.Posix.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/Mono.Posix.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Mono.Posix.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Posix" library="Mono.Posix-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/Mono.Posix.dll /unsafe /nowarn:0219,0618</flags>
+      <output>xammac_net_4_5_Mono.Posix_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_Mono.Posix_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_Mono.Posix_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/Mono.Posix.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Core.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/Mono.Posix.dll</flags>
+      <output>xammac_net_4_5_System.Core_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Core_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-plaincore-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/Mono.Posix.dll</flags>
+      <output>System.Core.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/plaincore/System.Core.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Core.dll.sources</response>
+    </project>
+    <project dir="class/System.Core" library="System.Core-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/Mono.Posix.dll</flags>
+      <output>xammac_net_4_5_System.Core_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Core_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Core_test.dll.response</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/xammac_net_4_5/secxml/System.dll -r:./../../class/lib/xammac_net_4_5/bare/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <output>System.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Security.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.dll.sources</response>
+    </project>
+    <project dir="class/System.Security" library="System.Security-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Security.dll -nowarn:618 -d:SECURITY_DEP -nowarn:414 -r:./../../class/lib/xammac_net_4_5/secxml/System.dll -r:./../../class/lib/xammac_net_4_5/bare/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll -nowarn:168,169,183,219,414</flags>
+      <output>xammac_net_4_5_System.Security_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Security_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Security_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -d:CONFIGURATION_DEP -r:./../../class/lib/xammac_net_4_5/secxml/System.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Xml.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -r:./../../class/lib/xammac_net_4_5/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>xammac_net_4_5_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Xml_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-bare-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:219,414,649,1717 -unsafe -d:ASYNC -r:./../../class/lib/xammac_net_4_5/bare/System.dll</flags>
+      <output>System.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/bare/System.Xml.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.dll.sources</response>
+    </project>
+    <project dir="class/System.XML" library="System.Xml-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/bare/System.Xml.dll -nowarn:219,414,649,1717 -unsafe -d:ASYNC -r:./../../class/lib/xammac_net_4_5/bare/System.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>xammac_net_4_5_System.Xml_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Xml_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Xml_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/Common" library="I18N-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /define:DISABLE_UNSAFE -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig</flags>
+      <output>I18N.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/I18N.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>I18N.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../../class/lib/xammac_net_4_5/I18N.dll</flags>
+      <output>I18N.West.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/I18N.West.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>I18N.West.dll.sources</response>
+    </project>
+    <project dir="class/I18N/West" library="I18N.West-tests-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../../class/lib/xammac_net_4_5/I18N.West.dll</flags>
+      <output>xammac_net_4_5_I18N.West_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_I18N.West_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../../build/deps/xammac_net_4_5_I18N.West_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../../class/lib/xammac_net_4_5/I18N.dll</flags>
+      <output>I18N.MidEast.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/I18N.MidEast.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>I18N.MidEast.dll.sources</response>
+    </project>
+    <project dir="class/I18N/MidEast" library="I18N.MidEast-tests-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../../class/lib/xammac_net_4_5/I18N.MidEast.dll</flags>
+      <output>xammac_net_4_5_I18N.MidEast_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_I18N.MidEast_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../../build/deps/xammac_net_4_5_I18N.MidEast_test.dll.response</response>
+    </project>
+    <project dir="class/I18N/Other" library="I18N.Other-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../../class/lib/xammac_net_4_5/I18N.dll</flags>
+      <output>I18N.Other.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/I18N.Other.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>I18N.Other.dll.sources</response>
+    </project>
+    <project dir="class/I18N/Rare" library="I18N.Rare-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../../class/lib/xammac_net_4_5/I18N.dll</flags>
+      <output>I18N.Rare.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/I18N.Rare.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>I18N.Rare.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../../class/lib/xammac_net_4_5/I18N.dll</flags>
+      <output>I18N.CJK.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/I18N.CJK.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>I18N.CJK.dll.sources</response>
+    </project>
+    <project dir="class/I18N/CJK" library="I18N.CJK-tests-xammac_net_4_5">
+      <boot>false</boot>
+      <flags>/codepage:65001 /unsafe /resource:big5.table /resource:gb2312.table /resource:jis.table /resource:ks.table /resource:gb18030.table /define:DISABLE_UNSAFE -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../../class/lib/xammac_net_4_5/I18N.CJK.dll</flags>
+      <output>xammac_net_4_5_I18N.CJK_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_I18N.CJK_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../../build/deps/xammac_net_4_5_I18N.CJK_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel.Internals" library="System.ServiceModel.Internals-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /unsafe -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>System.ServiceModel.Internals.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.ServiceModel.Internals.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Internals.dll.sources</response>
+    </project>
+    <project dir="class/SMDiagnostics" library="SMDiagnostics-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.Internals.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>SMDiagnostics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/SMDiagnostics.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>SMDiagnostics.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /unsafe -nowarn:414 -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Numerics.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/System.Numerics" library="System.Numerics-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Numerics.dll /unsafe -nowarn:414 -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>xammac_net_4_5_System.Numerics_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Numerics_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Numerics_test.dll.response</response>
+    </project>
+    <project dir="class/System.Numerics.Vectors" library="System.Numerics.Vectors-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -unsafe -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Numerics.dll</flags>
+      <output>System.Numerics.Vectors.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Numerics.Vectors.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Numerics.Vectors.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Tds" library="Mono.Data.Tds-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <output>Mono.Data.Tds.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/Mono.Data.Tds.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Mono.Data.Tds.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Tds" library="Mono.Data.Tds-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/Mono.Data.Tds.dll</flags>
+      <output>xammac_net_4_5_Mono.Data.Tds_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_Mono.Data.Tds_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_Mono.Data.Tds_test.dll.response</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>System.Transactions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Transactions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Transactions.dll.sources</response>
+    </project>
+    <project dir="class/System.Transactions" library="System.Transactions-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>xammac_net_4_5_System.Transactions_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Transactions_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Transactions_test.dll.response</response>
+    </project>
+    <project dir="class/System.EnterpriseServices" library="System.EnterpriseServices-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /nowarn:0168 /nowarn:0162 -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll</flags>
+      <output>System.EnterpriseServices.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.EnterpriseServices.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.EnterpriseServices.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Numerics.dll -r:./../../class/lib/xammac_net_4_5/System.EnterpriseServices.dll -r:./../../class/lib/xammac_net_4_5/Mono.Data.Tds.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll</flags>
+      <output>System.Data.dll</output>
+      <built_sources>gen_OdbcConnection.cs gen_OleDbConnection.cs gen_OdbcParameter.cs gen_OleDbParameter.cs gen_OdbcParameterCollection.cs gen_OleDbParameterCollection.cs</built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Data.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Data.dll.sources</response>
+    </project>
+    <project dir="class/System.Data" library="System.Data-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Data.dll -nowarn:219,414,649 -d:PLATFORM_UNIX -d:USEOFFSET -d:MONO_PARTIAL_DATA_IMPORT -unsafe -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Numerics.dll -r:./../../class/lib/xammac_net_4_5/System.EnterpriseServices.dll -r:./../../class/lib/xammac_net_4_5/Mono.Data.Tds.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll -nowarn:618,169,612,219,168</flags>
+      <output>xammac_net_4_5_System.Data_test.dll</output>
+      <built_sources>gen_OdbcConnection.cs gen_OleDbConnection.cs gen_OdbcParameter.cs gen_OleDbParameter.cs gen_OdbcParameterCollection.cs gen_OleDbParameterCollection.cs</built_sources>
+      <library_output>xammac_net_4_5_System.Data_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Data_test.dll.response</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NET_3_0 /d:NO_CONFIGURATION -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.Internals.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:./../../class/lib/xammac_net_4_5/SMDiagnostics.dll</flags>
+      <output>System.Runtime.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Runtime.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization" library="System.Runtime.Serialization-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -unsafe -d:NO_DYNAMIC_CODEGEN /nowarn:168,169,219,414 /d:NET_3_0 /d:NO_CONFIGURATION -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.Internals.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:./../../class/lib/xammac_net_4_5/SMDiagnostics.dll /resource:Test/Resources/WSDL/collections.wsdl /resource:Test/Resources/WSDL/custom-collections.wsdl</flags>
+      <output>xammac_net_4_5_System.Runtime.Serialization_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Runtime.Serialization_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Runtime.Serialization_test.dll.response</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:FEATURE_SERIALIZATION -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll</flags>
+      <output>System.Xml.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Xml.Linq.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.Linq.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Linq" library="System.Xml.Linq-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Xml.Linq.dll -d:FEATURE_SERIALIZATION -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll</flags>
+      <output>xammac_net_4_5_System.Xml.Linq_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Xml.Linq_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Xml.Linq_test.dll.response</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>Mono.Data.Sqlite.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/Mono.Data.Sqlite.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Mono.Data.Sqlite.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Data.Sqlite" library="Mono.Data.Sqlite-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/Mono.Data.Sqlite.dll /unsafe -resource:resources/SR.resources -resource:resources/SQLiteCommand.bmp -resource:resources/SQLiteConnection.bmp -resource:resources/SQLiteDataAdapter.bmp -d:SQLITE_STANDARD -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll /nowarn:618</flags>
+      <output>xammac_net_4_5_Mono.Data.Sqlite_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_Mono.Data.Sqlite_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_Mono.Data.Sqlite_test.dll.response</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization.Formatters.Soap" library="System.Runtime.Serialization.Formatters.Soap-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Runtime.Serialization.Formatters.Soap.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.Formatters.Soap.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Formatters.Soap.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.Serialization.Formatters.Soap" library="System.Runtime.Serialization.Formatters.Soap-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.Formatters.Soap.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>xammac_net_4_5_System.Runtime.Serialization.Formatters.Soap_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Runtime.Serialization.Formatters.Soap_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Runtime.Serialization.Formatters.Soap_test.dll.response</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:414 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.ComponentModel.DataAnnotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.ComponentModel.DataAnnotations.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ComponentModel.DataAnnotations.dll.sources</response>
+    </project>
+    <project dir="class/System.ComponentModel.DataAnnotations" library="System.ComponentModel.DataAnnotations-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.ComponentModel.DataAnnotations.dll -nowarn:414 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>xammac_net_4_5_System.ComponentModel.DataAnnotations_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.ComponentModel.DataAnnotations_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.ComponentModel.DataAnnotations_test.dll.response</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Security.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>System.IdentityModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.IdentityModel.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.IdentityModel.dll.sources</response>
+    </project>
+    <project dir="class/System.IdentityModel" library="System.IdentityModel-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.dll /d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Security.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>xammac_net_4_5_System.IdentityModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.IdentityModel_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.IdentityModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.IdentityModel.Selectors" library="System.IdentityModel.Selectors-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Security.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.dll</flags>
+      <output>System.IdentityModel.Selectors.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.IdentityModel.Selectors.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IdentityModel.Selectors.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Messaging" library="Mono.Messaging-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>Mono.Messaging.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/Mono.Messaging.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Mono.Messaging.dll.sources</response>
+    </project>
+    <project dir="class/Mono.Messaging" library="Mono.Messaging-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/Mono.Messaging.dll -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>xammac_net_4_5_Mono.Messaging_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_Mono.Messaging_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_Mono.Messaging_test.dll.response</response>
+    </project>
+    <project dir="class/System.Configuration.Install" library="System.Configuration.Install-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Configuration.Install.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Configuration.Install.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Configuration.Install.dll.sources</response>
+    </project>
+    <project dir="class/System.Messaging" library="System.Messaging-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /resource:System.Messaging/MessageQueue.resx -d:NO_WINFORMS_DEPENDENCY -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/Mono.Messaging.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.Install.dll</flags>
+      <output>System.Messaging.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Messaging.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Messaging.dll.sources</response>
+    </project>
+    <project dir="class/System.Messaging" library="System.Messaging-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Messaging.dll /resource:System.Messaging/MessageQueue.resx -d:NO_WINFORMS_DEPENDENCY -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/Mono.Messaging.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.Install.dll -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+      <output>xammac_net_4_5_System.Messaging_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Messaging_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Messaging_test.dll.response</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:168,169,219,414,612,649 -d:MONO_BROKEN_CONFIGURATION_DLL -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.EnterpriseServices.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>System.Web.Services.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Web.Services.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Web.Services.dll.sources</response>
+    </project>
+    <project dir="class/System.Web.Services" library="System.Web.Services-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Web.Services.dll -nowarn:168,169,219,414,612,649 -d:MONO_BROKEN_CONFIGURATION_DLL -resource:System.Web.Services.Description/wsdl-1.1.xsd,wsdl-1.1.xsd -resource:System.Web.Services.Description/wsdl-1.1-soap.xsd,wsdl-1.1-soap.xsd -resource:System.Web.Services.Description/web-reference.xsd,web-reference.xsd -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.EnterpriseServices.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -nowarn:618 -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME</flags>
+      <output>xammac_net_4_5_System.Web.Services_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Web.Services_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Web.Services_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.Internals.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Security.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.Selectors.dll -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll -r:./../../class/lib/xammac_net_4_5/System.Messaging.dll -r:./../../class/lib/xammac_net_4_5/System.Web.Services.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.ServiceModel.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.Internals.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Security.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.Selectors.dll -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll -r:./../../class/lib/xammac_net_4_5/System.Messaging.dll -r:./../../class/lib/xammac_net_4_5/System.Web.Services.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <output>xammac_net_4_5_System.ServiceModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.ServiceModel_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.ServiceModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-plainservice-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.Internals.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Security.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.Selectors.dll -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll -r:./../../class/lib/xammac_net_4_5/System.Messaging.dll -r:./../../class/lib/xammac_net_4_5/System.Web.Services.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <output>System.ServiceModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/plainservice/System.ServiceModel.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.ServiceModel.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel" library="System.ServiceModel-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/plainservice/System.ServiceModel.dll /nowarn:414,169,67,3005,436,219,618 /unsafe /d:TRACE /resource:resources/WS-Addressing.schema /resource:resources/ws-addr.xsd /d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.Internals.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Security.dll -r:./../../class/lib/xammac_net_4_5/System.IdentityModel.Selectors.dll -r:./../../class/lib/xammac_net_4_5/System.Transactions.dll -r:./../../class/lib/xammac_net_4_5/System.Messaging.dll -r:./../../class/lib/xammac_net_4_5/System.Web.Services.dll -r:./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <output>xammac_net_4_5_System.ServiceModel_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.ServiceModel_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.ServiceModel_test.dll.response</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:NET_3_5 -d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>System.ServiceModel.Web.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.ServiceModel.Web.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.ServiceModel.Web.dll.sources</response>
+    </project>
+    <project dir="class/System.ServiceModel.Web" library="System.ServiceModel.Web-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.Web.dll -d:NET_3_5 -d:NET_3_0 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll</flags>
+      <output>xammac_net_4_5_System.ServiceModel.Web_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.ServiceModel.Web_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.ServiceModel.Web_test.dll.response</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Json.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Json.dll.sources</response>
+    </project>
+    <project dir="class/System.Json" library="System.Json-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Json.dll -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>xammac_net_4_5_System.Json_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Json_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Json_test.dll.response</response>
+    </project>
+    <project dir="class/System.Data.Services.Client" library="System.Data.Services.Client-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:NET_3_5 -warn:2 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.Linq.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Data.Services.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Data.Services.Client.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources>System.Data.Services.Client,Client/System.Data.Services.Client.txt</resources>
+      <response>System.Data.Services.Client.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /unsafe -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.IO.Compression.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.IO.Compression.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.Compression.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression" library="System.IO.Compression-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.IO.Compression.dll</flags>
+      <output>xammac_net_4_5_System.IO.Compression_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.IO.Compression_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.IO.Compression_test.dll.response</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.IO.Compression.dll</flags>
+      <output>System.IO.Compression.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.IO.Compression.FileSystem.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.Compression.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.IO.Compression.FileSystem.dll</flags>
+      <output>xammac_net_4_5_System.IO.Compression.FileSystem_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.IO.Compression.FileSystem_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.IO.Compression.FileSystem_test.dll.response</response>
+    </project>
+    <project dir="class/System.ComponentModel.Composition.4.5" library="System.ComponentModel.Composition-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.ComponentModel.Composition.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.ComponentModel.Composition.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources>Microsoft.Internal.Strings,src/ComponentModel/Strings.resx</resources>
+      <response>System.ComponentModel.Composition.dll.sources</response>
+    </project>
+    <project dir="class/System.Net" library="System.Net-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -unsafe -d:NET_3_5 -nowarn:1720 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Net.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Net.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.dll.sources</response>
+    </project>
+    <project dir="class/System.Windows" library="System.Windows-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Windows.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Windows.dll.sources</response>
+    </project>
+    <project dir="class/System.Xml.Serialization" library="System.Xml.Serialization-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.ServiceModel.dll</flags>
+      <output>System.Xml.Serialization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Xml.Serialization.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.Serialization.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:MONO_FEATURE_THREAD_ABORT -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>Mono.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/Mono.CSharp.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Mono.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CSharp" library="Mono.CSharp-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/Mono.CSharp.dll</flags>
+      <output>xammac_net_4_5_Mono.CSharp_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_Mono.CSharp_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_Mono.CSharp_test.dll.response</response>
+    </project>
+    <project dir="class/Microsoft.CSharp" library="Microsoft.CSharp-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/Mono.CSharp.dll</flags>
+      <output>Microsoft.CSharp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/Microsoft.CSharp.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Microsoft.CSharp.dll.sources</response>
+    </project>
+    <project dir="class/Mono.CompilerServices.SymbolWriter" library="Mono.CompilerServices.SymbolWriter-xammac_net_4_5">
+      <boot>true</boot>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>Mono.CompilerServices.SymbolWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/Mono.CompilerServices.SymbolWriter.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Mono.CompilerServices.SymbolWriter.dll.sources</response>
+    </project>
+    <project dir="class/System.Data.Linq" library="System.Data.Linq-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /resource:./src/DbLinq/Schema/Dbml/DbmlSchema.xsd,DbLinq.Schema.Dbml.DbmlSchema.xsd /d:MONO_STRICT /d:MONO_DEPLOY -warn:1 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll</flags>
+      <output>System.Data.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Data.Linq.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Data.Linq.dll.sources</response>
+    </project>
+    <project dir="class/System.Data.Linq" library="System.Data.Linq-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Data.Linq.dll /resource:./src/DbLinq/Schema/Dbml/DbmlSchema.xsd,DbLinq.Schema.Dbml.DbmlSchema.xsd /d:MONO_STRICT /d:MONO_DEPLOY -warn:1 -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll</flags>
+      <output>xammac_net_4_5_System.Data.Linq_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Data.Linq_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Data.Linq_test.dll.response</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Net.Http.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Net.Http.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http" library="System.Net.Http-tests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize -r:./../../class/lib/xammac_net_4_5/System.Net.Http.dll</flags>
+      <output>xammac_net_4_5_System.Net.Http_test.dll</output>
+      <built_sources></built_sources>
+      <library_output>xammac_net_4_5_System.Net.Http_test.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../build/deps/xammac_net_4_5_System.Net.Http_test.dll.response</response>
+    </project>
+    <project dir="class/System.Net.Http.WebRequest" library="System.Net.Http.WebRequest-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.Net.Http.dll -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Http.WebRequest.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Net.Http.WebRequest.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Http.WebRequest.dll.sources</response>
+    </project>
+    <project dir="class/System.Runtime.InteropServices.RuntimeInformation" library="System.Runtime.InteropServices.RuntimeInformation-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Runtime.InteropServices.RuntimeInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Runtime.InteropServices.RuntimeInformation.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.RuntimeInformation.dll.sources</response>
+    </project>
+    <project dir="class/System.Reflection.Context" library="System.Reflection.Context-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Reflection.Context.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Reflection.Context.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Reflection.Context.dll.sources</response>
+    </project>
+    <project dir="class/System.Net.Http.WinHttpHandler" library="System.Net.Http.WinHttpHandler-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -r:./../../class/lib/xammac_net_4_5/System.dll -r:./../../class/lib/xammac_net_4_5/System.Net.Http.dll</flags>
+      <output>System.Net.Http.WinHttpHandler.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../class/lib/xammac_net_4_5/System.Net.Http.WinHttpHandler.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Http.WinHttpHandler.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.X509Certificates" library="Facades_System.Security.Cryptography.X509Certificates-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Security.Cryptography.X509Certificates.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.X509Certificates.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.X509Certificates.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Primitives" library="Facades_System.ServiceModel.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.ServiceModel.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../../class/lib/xammac_net_4_5/System.IdentityModel.dll -r:./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.X509Certificates.dll</flags>
+      <output>System.ServiceModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ServiceModel.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Primitives" library="Facades_System.Runtime.Serialization.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.Serialization.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Xml" library="Facades_System.Runtime.Serialization.Xml-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.Serialization.Primitives.dll</flags>
+      <output>System.Runtime.Serialization.Xml.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.Serialization.Xml.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Xml.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Drawing.Primitives" library="Facades_System.Drawing.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Drawing.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Drawing.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>./../../../build/deps/xammac_net_4_5_System.Drawing.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Concurrent" library="Facades_System.Collections.Concurrent-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Collections.Concurrent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Collections.Concurrent.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Collections.Concurrent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections" library="Facades_System.Collections-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Collections.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Collections.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Collections.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Annotations" library="Facades_System.ComponentModel.Annotations-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.ComponentModel.DataAnnotations.dll</flags>
+      <output>System.ComponentModel.Annotations.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ComponentModel.Annotations.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Annotations.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.EventBasedAsync" library="Facades_System.ComponentModel.EventBasedAsync-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.ComponentModel.EventBasedAsync.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ComponentModel.EventBasedAsync.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ComponentModel.EventBasedAsync.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel" library="Facades_System.ComponentModel-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.ComponentModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ComponentModel.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ComponentModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Contracts" library="Facades_System.Diagnostics.Contracts-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Contracts.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.Contracts.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Contracts.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Debug" library="Facades_System.Diagnostics.Debug-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Diagnostics.Debug.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.Debug.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Debug.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tracing" library="Facades_System.Diagnostics.Tracing-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Diagnostics.Tracing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.Tracing.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tracing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Tools" library="Facades_System.Diagnostics.Tools-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Diagnostics.Tools.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.Tools.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Tools.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Dynamic.Runtime" library="Facades_System.Dynamic.Runtime-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Core.dll -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Dynamic.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Dynamic.Runtime.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Dynamic.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization" library="Facades_System.Globalization-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Globalization.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Globalization.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Globalization.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO" library="Facades_System.IO-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.IO.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Expressions" library="Facades_System.Linq.Expressions-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Linq.Expressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Linq.Expressions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Linq.Expressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Parallel" library="Facades_System.Linq.Parallel-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Linq.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Linq.Parallel.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Linq.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq.Queryable" library="Facades_System.Linq.Queryable-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Linq.Queryable.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Linq.Queryable.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Linq.Queryable.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Linq" library="Facades_System.Linq-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Linq.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Linq.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Linq.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NetworkInformation" library="Facades_System.Net.NetworkInformation-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.NetworkInformation.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.NetworkInformation.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.NetworkInformation.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Primitives" library="Facades_System.Net.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Requests" library="Facades_System.Net.Requests-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Requests.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.Requests.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Requests.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ObjectModel" library="Facades_System.ObjectModel-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.ObjectModel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ObjectModel.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ObjectModel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Extensions" library="Facades_System.Reflection.Extensions-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Reflection.Extensions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Reflection.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Primitives" library="Facades_System.Reflection.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Reflection.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Reflection.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection" library="Facades_System.Reflection-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Reflection.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Reflection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ResourceManager" library="Facades_System.Resources.ResourceManager-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Resources.ResourceManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Resources.ResourceManager.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Resources.ResourceManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Extensions" library="Facades_System.Runtime.Extensions-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Runtime.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.Extensions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices" library="Facades_System.Runtime.InteropServices-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Runtime.InteropServices.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.InteropServices.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.InteropServices.WindowsRuntime" library="Facades_System.Runtime.InteropServices.WindowsRuntime-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Runtime.InteropServices.WindowsRuntime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.InteropServices.WindowsRuntime.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.InteropServices.WindowsRuntime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Numerics" library="Facades_System.Runtime.Numerics-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Numerics.dll</flags>
+      <output>System.Runtime.Numerics.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.Numerics.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.Numerics.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Serialization.Json" library="Facades_System.Runtime.Serialization.Json-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Runtime.Serialization.dll</flags>
+      <output>System.Runtime.Serialization.Json.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.Serialization.Json.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.Serialization.Json.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime" library="Facades_System.Runtime-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.ComponentModel.Composition.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Runtime.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal" library="Facades_System.Security.Principal-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Security.Principal.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Principal.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Principal.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Http" library="Facades_System.ServiceModel.Http-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Http.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ServiceModel.Http.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Http.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Security" library="Facades_System.ServiceModel.Security-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ServiceModel.Security.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.Extensions" library="Facades_System.Text.Encoding.Extensions-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Text.Encoding.Extensions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding" library="Facades_System.Text.Encoding-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Text.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Text.Encoding.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.RegularExpressions" library="Facades_System.Text.RegularExpressions-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Text.RegularExpressions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Text.RegularExpressions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Text.RegularExpressions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks.Parallel" library="Facades_System.Threading.Tasks.Parallel-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Threading.Tasks.Parallel.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Threading.Tasks.Parallel.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.Parallel.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Tasks" library="Facades_System.Threading.Tasks-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Threading.Tasks.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Threading.Tasks.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Threading.Tasks.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Timer" library="Facades_System.Threading.Timer-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Threading.Timer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Threading.Timer.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Threading.Timer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading" library="Facades_System.Threading-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Threading.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Threading.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Threading.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.ReaderWriter" library="Facades_System.Xml.ReaderWriter-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Xml.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Xml.ReaderWriter.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XDocument" library="Facades_System.Xml.XDocument-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Xml.Linq.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Xml.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Xml.XDocument.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlSerializer" library="Facades_System.Xml.XmlSerializer-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Xml.XmlSerializer.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Xml.XmlSerializer.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.XmlSerializer.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.Handles" library="Facades_System.Runtime.Handles-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Runtime.Handles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.Handles.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.Handles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.Duplex" library="Facades_System.ServiceModel.Duplex-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.Duplex.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ServiceModel.Duplex.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ServiceModel.Duplex.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceModel.NetTcp" library="Facades_System.ServiceModel.NetTcp-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.ServiceModel.dll</flags>
+      <output>System.ServiceModel.NetTcp.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ServiceModel.NetTcp.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ServiceModel.NetTcp.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Primitives" library="Facades_Microsoft.Win32.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>Microsoft.Win32.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/Microsoft.Win32.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry" library="Facades_Microsoft.Win32.Registry-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>Microsoft.Win32.Registry.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/Microsoft.Win32.Registry.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.AppContext" library="Facades_System.AppContext-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.AppContext.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.AppContext.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.AppContext.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.NonGeneric" library="Facades_System.Collections.NonGeneric-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Collections.NonGeneric.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Collections.NonGeneric.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Collections.NonGeneric.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Collections.Specialized" library="Facades_System.Collections.Specialized-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Collections.Specialized.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Collections.Specialized.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Collections.Specialized.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.Primitives" library="Facades_System.ComponentModel.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.ComponentModel.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ComponentModel.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ComponentModel.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ComponentModel.TypeConverter" library="Facades_System.ComponentModel.TypeConverter-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.ComponentModel.TypeConverter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ComponentModel.TypeConverter.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ComponentModel.TypeConverter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Console" library="Facades_System.Console-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Console.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Console.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Console.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.Common" library="Facades_System.Data.Common-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Data.Common.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Data.Common.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Data.Common.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Data.SqlClient" library="Facades_System.Data.SqlClient-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Data.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Data.SqlClient.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Data.SqlClient.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Data.SqlClient.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.FileVersionInfo" library="Facades_System.Diagnostics.FileVersionInfo-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Diagnostics.FileVersionInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.FileVersionInfo.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.FileVersionInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.Process" library="Facades_System.Diagnostics.Process-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Diagnostics.Process.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.Process.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.Process.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TextWriterTraceListener" library="Facades_System.Diagnostics.TextWriterTraceListener-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Diagnostics.TextWriterTraceListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.TextWriterTraceListener.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TextWriterTraceListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceEvent" library="Facades_System.Diagnostics.TraceEvent-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Diagnostics.TraceEvent.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.TraceEvent.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceEvent.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.TraceSource" library="Facades_System.Diagnostics.TraceSource-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Diagnostics.TraceSource.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.TraceSource.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.TraceSource.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Calendars" library="Facades_System.Globalization.Calendars-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Globalization.Calendars.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Globalization.Calendars.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Globalization.Calendars.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Compression.ZipFile" library="Facades_System.IO.Compression.ZipFile-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.IO.Compression.FileSystem.dll</flags>
+      <output>System.IO.Compression.ZipFile.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.Compression.ZipFile.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.Compression.ZipFile.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem" library="Facades_System.IO.FileSystem-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.IO.FileSystem.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.FileSystem.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.DriveInfo" library="Facades_System.IO.FileSystem.DriveInfo-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.IO.FileSystem.DriveInfo.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.FileSystem.DriveInfo.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.DriveInfo.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Primitives" library="Facades_System.IO.FileSystem.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.IO.FileSystem.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.FileSystem.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.IsolatedStorage" library="Facades_System.IO.IsolatedStorage-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.IO.IsolatedStorage.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.IsolatedStorage.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.IsolatedStorage.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.MemoryMappedFiles" library="Facades_System.IO.MemoryMappedFiles-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.IO.MemoryMappedFiles.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.MemoryMappedFiles.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.MemoryMappedFiles.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.UnmanagedMemoryStream" library="Facades_System.IO.UnmanagedMemoryStream-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.IO.UnmanagedMemoryStream.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.UnmanagedMemoryStream.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.UnmanagedMemoryStream.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.AuthenticationManager" library="Facades_System.Net.AuthenticationManager-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.AuthenticationManager.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.AuthenticationManager.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.AuthenticationManager.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Cache" library="Facades_System.Net.Cache-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Cache.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.Cache.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Cache.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.HttpListener" library="Facades_System.Net.HttpListener-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.HttpListener.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.HttpListener.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.HttpListener.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Mail" library="Facades_System.Net.Mail-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Mail.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.Mail.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Mail.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.NameResolution" library="Facades_System.Net.NameResolution-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.NameResolution.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.NameResolution.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.NameResolution.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Security" library="Facades_System.Net.Security-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Security.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.Security.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Security.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.ServicePoint" library="Facades_System.Net.ServicePoint-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.ServicePoint.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.ServicePoint.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.ServicePoint.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Sockets" library="Facades_System.Net.Sockets-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Sockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.Sockets.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Sockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.Utilities" library="Facades_System.Net.Utilities-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.Utilities.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.Utilities.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.Utilities.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebHeaderCollection" library="Facades_System.Net.WebHeaderCollection-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.WebHeaderCollection.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.WebHeaderCollection.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.WebHeaderCollection.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets" library="Facades_System.Net.WebSockets-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.WebSockets.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.WebSockets.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Net.WebSockets.Client" library="Facades_System.Net.WebSockets.Client-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Net.WebSockets.Client.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Net.WebSockets.Client.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Net.WebSockets.Client.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Resources.ReaderWriter" library="Facades_System.Resources.ReaderWriter-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Resources.ReaderWriter.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Resources.ReaderWriter.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Resources.ReaderWriter.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Runtime.CompilerServices.VisualC" library="Facades_System.Runtime.CompilerServices.VisualC-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Runtime.CompilerServices.VisualC.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Runtime.CompilerServices.VisualC.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Runtime.CompilerServices.VisualC.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.AccessControl" library="Facades_System.Security.AccessControl-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.AccessControl.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Claims" library="Facades_System.Security.Claims-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Claims.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Claims.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Claims.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.DeriveBytes" library="Facades_System.Security.Cryptography.DeriveBytes-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.DeriveBytes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.DeriveBytes.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.DeriveBytes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encoding" library="Facades_System.Security.Cryptography.Encoding-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.Encoding.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.Encoding.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encoding.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption" library="Facades_System.Security.Cryptography.Encryption-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.Encryption.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.Aes" library="Facades_System.Security.Cryptography.Encryption.Aes-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.Encryption.Aes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.Encryption.Aes.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.Aes.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman" library="Facades_System.Security.Cryptography.Encryption.ECDiffieHellman-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDiffieHellman.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.Encryption.ECDiffieHellman.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDiffieHellman.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Encryption.ECDsa" library="Facades_System.Security.Cryptography.Encryption.ECDsa-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.Security.Cryptography.Encryption.ECDsa.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.Encryption.ECDsa.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Encryption.ECDsa.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing" library="Facades_System.Security.Cryptography.Hashing-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.Hashing.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Hashing.Algorithms" library="Facades_System.Security.Cryptography.Hashing.Algorithms-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.Hashing.Algorithms.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.Hashing.Algorithms.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Hashing.Algorithms.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RSA" library="Facades_System.Security.Cryptography.RSA-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.RSA.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.RSA.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RSA.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.RandomNumberGenerator" library="Facades_System.Security.Cryptography.RandomNumberGenerator-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.RandomNumberGenerator.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.RandomNumberGenerator.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.RandomNumberGenerator.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Principal.Windows" library="Facades_System.Security.Principal.Windows-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Principal.Windows.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Principal.Windows.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Principal.Windows.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Thread" library="Facades_System.Threading.Thread-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Threading.Thread.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Threading.Thread.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Threading.Thread.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.ThreadPool" library="Facades_System.Threading.ThreadPool-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Threading.ThreadPool.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Threading.ThreadPool.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Threading.ThreadPool.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath" library="Facades_System.Xml.XPath-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Xml.XPath.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Xml.XPath.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XmlDocument" library="Facades_System.Xml.XmlDocument-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Xml.XmlDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Xml.XmlDocument.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.XmlDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.Xsl.Primitives" library="Facades_System.Xml.Xsl.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll</flags>
+      <output>System.Xml.Xsl.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Xml.Xsl.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.Xsl.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/Microsoft.Win32.Registry.AccessControl" library="Facades_Microsoft.Win32.Registry.AccessControl-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>Microsoft.Win32.Registry.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/Microsoft.Win32.Registry.AccessControl.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>Microsoft.Win32.Registry.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Diagnostics.StackTrace" library="Facades_System.Diagnostics.StackTrace-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Diagnostics.StackTrace.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Diagnostics.StackTrace.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Diagnostics.StackTrace.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Globalization.Extensions" library="Facades_System.Globalization.Extensions-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Globalization.Extensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Globalization.Extensions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Globalization.Extensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.AccessControl" library="Facades_System.IO.FileSystem.AccessControl-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.IO.FileSystem.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.FileSystem.AccessControl.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.TypeExtensions" library="Facades_System.Reflection.TypeExtensions-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Reflection.TypeExtensions.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Reflection.TypeExtensions.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Reflection.TypeExtensions.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.Lightweight" library="Facades_System.Reflection.Emit.Lightweight-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.Lightweight.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Reflection.Emit.Lightweight.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.Lightweight.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit.ILGeneration" library="Facades_System.Reflection.Emit.ILGeneration-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.ILGeneration.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Reflection.Emit.ILGeneration.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.ILGeneration.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Reflection.Emit" library="Facades_System.Reflection.Emit-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+      <output>System.Reflection.Emit.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Reflection.Emit.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Reflection.Emit.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.SecureString" library="Facades_System.Security.SecureString-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.SecureString.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.SecureString.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.SecureString.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.AccessControl" library="Facades_System.Threading.AccessControl-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Threading.AccessControl.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Threading.AccessControl.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Threading.AccessControl.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Threading.Overlapped" library="Facades_System.Threading.Overlapped-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -unsafe -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Threading.Overlapped.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Threading.Overlapped.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Threading.Overlapped.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Xml.XPath.XDocument" library="Facades_System.Xml.XPath.XDocument-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../../class/lib/xammac_net_4_5/System.Xml.Linq.dll</flags>
+      <output>System.Xml.XPath.XDocument.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Xml.XPath.XDocument.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Xml.XPath.XDocument.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.Primitives" library="Facades_System.Security.Cryptography.Primitives-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Security.Cryptography.Primitives.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.Primitives.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.Primitives.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Text.Encoding.CodePages" library="Facades_System.Text.Encoding.CodePages-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.Text.Encoding.CodePages.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Text.Encoding.CodePages.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Text.Encoding.CodePages.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.FileSystem.Watcher" library="Facades_System.IO.FileSystem.Watcher-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.IO.FileSystem.Watcher.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.FileSystem.Watcher.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.FileSystem.Watcher.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.Security.Cryptography.ProtectedData" library="Facades_System.Security.Cryptography.ProtectedData-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Security.dll</flags>
+      <output>System.Security.Cryptography.ProtectedData.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.Security.Cryptography.ProtectedData.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.Security.Cryptography.ProtectedData.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.ServiceProcess.ServiceController" library="Facades_System.ServiceProcess.ServiceController-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll</flags>
+      <output>System.ServiceProcess.ServiceController.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.ServiceProcess.ServiceController.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.ServiceProcess.ServiceController.dll.sources</response>
+    </project>
+    <project dir="class/Facades/System.IO.Pipes" library="Facades_System.IO.Pipes-xammac_net_4_5">
+      <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/xammac_net_4_5/mscorlib.dll -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699 -r:./../../../class/lib/xammac_net_4_5/System.dll -r:./../../../class/lib/xammac_net_4_5/System.Core.dll</flags>
+      <output>System.IO.Pipes.dll</output>
+      <built_sources></built_sources>
+      <library_output>./../../../class/lib/xammac_net_4_5/Facades/System.IO.Pipes.dll</library_output>
+      <fx_version>4.5</fx_version>
+      <profile>xammac_net_4_5</profile>
+      <resources></resources>
+      <response>System.IO.Pipes.dll.sources</response>
+    </project>
 </root>
index 97642ca158a70e2e16d7b747fe3516f163d25cb0..e0164c4ebcd6b12f041d954b00cf6fe6961a0a2a 100644 (file)
@@ -181,6 +181,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.SelfHost-ne
 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}") = "System.Runtime.InteropServices.RuntimeInformation-net_4_x", "mcs/class/System.Runtime.InteropServices.RuntimeInformation/System.Runtime.InteropServices.RuntimeInformation-net_4_x.csproj", "{1E1BC1A8-EAD2-496C-A6D6-8AFABD741F56}"
+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}"
@@ -207,11 +209,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "I18N.Rare-net_4_x", "mcs/cl
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "I18N.CJK-net_4_x", "mcs/class/I18N/CJK/I18N.CJK-net_4_x.csproj", "{4742C0FA-2C03-4598-A3F2-4E7D9CDFF81B}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Btls.Interface-net_4_x", "mcs/class/Mono.Btls.Interface/Mono.Btls.Interface-net_4_x.csproj", "{BF32D586-8FBB-4A2A-A734-AA17CDAB283F}"
+EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Http-net_4_x", "mcs/class/Mono.Http/Mono.Http-net_4_x.csproj", "{11DD6F15-65AB-4CBD-9EFE-2C9626388C53}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cairo-net_4_x", "mcs/class/Mono.Cairo/Mono.Cairo-net_4_x.csproj", "{D76A0C93-56FE-4339-99A8-B7A3D49D6DDE}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil-net_4_x", "mcs/class/Mono.Cecil/Mono.Cecil-net_4_x.csproj", "{2C0D558F-0B38-4691-967E-A910A1B995C1}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil-net_4_x", "mcs/class/legacy/Mono.Cecil/Mono.Cecil-net_4_x.csproj", "{6DE38817-EC25-433A-AE58-0D30C5E6C460}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Mdb-net_4_x", "mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_x.csproj", "{CF14D34A-F69B-47FB-A99C-D25C77198F30}"
 EndProject
@@ -303,6 +307,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Workflow.ComponentMo
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Workflow.Runtime-net_4_x", "mcs/class/System.Workflow.Runtime/System.Workflow.Runtime-net_4_x.csproj", "{E4180397-83B3-4F7B-9878-6891698F7C52}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Context-net_4_x", "mcs/class/System.Reflection.Context/System.Reflection.Context-net_4_x.csproj", "{50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Cryptography.X509Certificates-net_4_x", "mcs/class/Facades/System.Security.Cryptography.X509Certificates/Facades_System.Security.Cryptography.X509Certificates-net_4_x.csproj", "{C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.ServiceModel.Primitives-net_4_x", "mcs/class/Facades/System.ServiceModel.Primitives/Facades_System.ServiceModel.Primitives-net_4_x.csproj", "{524B10FC-880D-4131-8CAE-027BC3A68B6F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Runtime.Serialization.Primitives-net_4_x", "mcs/class/Facades/System.Runtime.Serialization.Primitives/Facades_System.Runtime.Serialization.Primitives-net_4_x.csproj", "{49BB9015-6989-4BD0-AF82-9184BE637D57}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Runtime.Serialization.Xml-net_4_x", "mcs/class/Facades/System.Runtime.Serialization.Xml/Facades_System.Runtime.Serialization.Xml-net_4_x.csproj", "{C948B3D4-0BEE-4363-B4A7-635A169C8D63}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Drawing.Primitives-net_4_x", "mcs/class/Facades/System.Drawing.Primitives/Facades_System.Drawing.Primitives-net_4_x.csproj", "{1AFDB281-5FB8-48A9-8694-7F515D835862}"
+EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Collections.Concurrent-net_4_x", "mcs/class/Facades/System.Collections.Concurrent/Facades_System.Collections.Concurrent-net_4_x.csproj", "{EFD0287C-3651-4D42-B8CA-430776CB1E6D}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Collections-net_4_x", "mcs/class/Facades/System.Collections/Facades_System.Collections-net_4_x.csproj", "{2597261D-EC05-4333-928D-1CA44AB1A5D2}"
@@ -361,18 +377,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Runtime.Nume
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Runtime.Serialization.Json-net_4_x", "mcs/class/Facades/System.Runtime.Serialization.Json/Facades_System.Runtime.Serialization.Json-net_4_x.csproj", "{88B512E6-3E9D-4F87-A9E4-5F9239848665}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Runtime.Serialization.Primitives-net_4_x", "mcs/class/Facades/System.Runtime.Serialization.Primitives/Facades_System.Runtime.Serialization.Primitives-net_4_x.csproj", "{49BB9015-6989-4BD0-AF82-9184BE637D57}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Runtime.Serialization.Xml-net_4_x", "mcs/class/Facades/System.Runtime.Serialization.Xml/Facades_System.Runtime.Serialization.Xml-net_4_x.csproj", "{C948B3D4-0BEE-4363-B4A7-635A169C8D63}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Runtime-net_4_x", "mcs/class/Facades/System.Runtime/Facades_System.Runtime-net_4_x.csproj", "{CFB32425-69C5-425B-BF9A-66CB3AC52D71}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Principal-net_4_x", "mcs/class/Facades/System.Security.Principal/Facades_System.Security.Principal-net_4_x.csproj", "{9040CA8B-4352-4621-A2B3-5C32A383DE15}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.ServiceModel.Http-net_4_x", "mcs/class/Facades/System.ServiceModel.Http/Facades_System.ServiceModel.Http-net_4_x.csproj", "{4EE0B25C-F7D7-40A9-AE37-5B874791D3C1}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.ServiceModel.Primitives-net_4_x", "mcs/class/Facades/System.ServiceModel.Primitives/Facades_System.ServiceModel.Primitives-net_4_x.csproj", "{524B10FC-880D-4131-8CAE-027BC3A68B6F}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.ServiceModel.Security-net_4_x", "mcs/class/Facades/System.ServiceModel.Security/Facades_System.ServiceModel.Security-net_4_x.csproj", "{F937A550-0A4A-4A10-9FD9-E8DE7696671F}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Text.Encoding.Extensions-net_4_x", "mcs/class/Facades/System.Text.Encoding.Extensions/Facades_System.Text.Encoding.Extensions-net_4_x.csproj", "{28CEA696-8466-4826-9128-B83318184EF4}"
@@ -499,8 +509,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Cry
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Cryptography.RandomNumberGenerator-net_4_x", "mcs/class/Facades/System.Security.Cryptography.RandomNumberGenerator/Facades_System.Security.Cryptography.RandomNumberGenerator-net_4_x.csproj", "{C87878D2-CDEF-4EC9-8C94-C1381144F4EC}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Cryptography.X509Certificates-net_4_x", "mcs/class/Facades/System.Security.Cryptography.X509Certificates/Facades_System.Security.Cryptography.X509Certificates-net_4_x.csproj", "{C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Principal.Windows-net_4_x", "mcs/class/Facades/System.Security.Principal.Windows/Facades_System.Security.Principal.Windows-net_4_x.csproj", "{47977802-4193-48DC-AA0F-58D18AEDA405}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Threading.Thread-net_4_x", "mcs/class/Facades/System.Threading.Thread/Facades_System.Threading.Thread-net_4_x.csproj", "{4D9EF694-5260-432D-BA34-503FFBE43B6C}"
@@ -521,11 +529,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Globalizatio
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.IO.FileSystem.AccessControl-net_4_x", "mcs/class/Facades/System.IO.FileSystem.AccessControl/Facades_System.IO.FileSystem.AccessControl-net_4_x.csproj", "{321A53F3-A681-4CA5-A093-1C6650243F6A}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Private.CoreLib.InteropServices-net_4_x", "mcs/class/Facades/System.Private.CoreLib.InteropServices/Facades_System.Private.CoreLib.InteropServices-net_4_x.csproj", "{5D05F5E2-7378-4A35-B1A3-76ABEB4A71C3}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Reflection.TypeExtensions-net_4_x", "mcs/class/Facades/System.Reflection.TypeExtensions/Facades_System.Reflection.TypeExtensions-net_4_x.csproj", "{C315A617-25A4-447F-AA4F-0E0E7E35F919}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Reflection.Emit.Lightweight-net_4_x", "mcs/class/Facades/System.Reflection.Emit.Lightweight/Facades_System.Reflection.Emit.Lightweight-net_4_x.csproj", "{03B29131-9D1A-4446-92F2-237F9EF70C5C}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Private.CoreLib.Threading-net_4_x", "mcs/class/Facades/System.Private.CoreLib.Threading/Facades_System.Private.CoreLib.Threading-net_4_x.csproj", "{642A1B9E-1A2F-4C55-B184-E22F8C2E95B5}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Reflection.Emit.ILGeneration-net_4_x", "mcs/class/Facades/System.Reflection.Emit.ILGeneration/Facades_System.Reflection.Emit.ILGeneration-net_4_x.csproj", "{ACF5E339-FB52-48E0-A859-2CE75756DFE8}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Reflection.TypeExtensions-net_4_x", "mcs/class/Facades/System.Reflection.TypeExtensions/Facades_System.Reflection.TypeExtensions-net_4_x.csproj", "{C315A617-25A4-447F-AA4F-0E0E7E35F919}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Reflection.Emit-net_4_x", "mcs/class/Facades/System.Reflection.Emit/Facades_System.Reflection.Emit-net_4_x.csproj", "{5327CF02-204D-45CD-A68D-3D836470E439}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.SecureString-net_4_x", "mcs/class/Facades/System.Security.SecureString/Facades_System.Security.SecureString-net_4_x.csproj", "{57C02AD3-1118-4982-BCE3-53158D30F4E9}"
 EndProject
@@ -535,23 +545,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Threading.Ov
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Xml.XPath.XDocument-net_4_x", "mcs/class/Facades/System.Xml.XPath.XDocument/Facades_System.Xml.XPath.XDocument-net_4_x.csproj", "{38F046A2-EEBD-4FE7-B70E-636F5DB4BBF3}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Reflection.Emit.ILGeneration-net_4_x", "mcs/class/Facades/System.Reflection.Emit.ILGeneration/Facades_System.Reflection.Emit.ILGeneration-net_4_x.csproj", "{ACF5E339-FB52-48E0-A859-2CE75756DFE8}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Cryptography.Primitives-net_4_x", "mcs/class/Facades/System.Security.Cryptography.Primitives/Facades_System.Security.Cryptography.Primitives-net_4_x.csproj", "{62880D99-1C4C-4D38-A8FE-57EF2C9E2150}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Reflection.Emit.Lightweight-net_4_x", "mcs/class/Facades/System.Reflection.Emit.Lightweight/Facades_System.Reflection.Emit.Lightweight-net_4_x.csproj", "{03B29131-9D1A-4446-92F2-237F9EF70C5C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Reflection.Emit-net_4_x", "mcs/class/Facades/System.Reflection.Emit/Facades_System.Reflection.Emit-net_4_x.csproj", "{5327CF02-204D-45CD-A68D-3D836470E439}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Diagnostics.PerformanceCounter-net_4_x", "mcs/class/Facades/System.Diagnostics.PerformanceCounter/Facades_System.Diagnostics.PerformanceCounter-net_4_x.csproj", "{BA0C64F1-3762-437D-8B58-75F68A5B4E7E}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Text.Encoding.CodePages-net_4_x", "mcs/class/Facades/System.Text.Encoding.CodePages/Facades_System.Text.Encoding.CodePages-net_4_x.csproj", "{DF49AC88-C6F2-43B1-8560-3B74542BD874}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.IO.FileSystem.Watcher-net_4_x", "mcs/class/Facades/System.IO.FileSystem.Watcher/Facades_System.IO.FileSystem.Watcher-net_4_x.csproj", "{44647FAA-F785-44DE-B6B2-ABC2B9768233}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.IO.Pipes-net_4_x", "mcs/class/Facades/System.IO.Pipes/Facades_System.IO.Pipes-net_4_x.csproj", "{D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Security.Cryptography.ProtectedData-net_4_x", "mcs/class/Facades/System.Security.Cryptography.ProtectedData/Facades_System.Security.Cryptography.ProtectedData-net_4_x.csproj", "{66B88E44-F7DA-4C83-B028-A49D4D3EBD16}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.ServiceProcess.ServiceController-net_4_x", "mcs/class/Facades/System.ServiceProcess.ServiceController/Facades_System.ServiceProcess.ServiceController-net_4_x.csproj", "{8C71A924-2561-434B-A792-2F84ABA1C0C2}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.Net.Http.WebRequestHandler-net_4_x", "mcs/class/Facades/System.Net.Http.WebRequestHandler/Facades_System.Net.Http.WebRequestHandler-net_4_x.csproj", "{ACA10642-1D5B-443D-99BE-65C31491C54F}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facades_System.IO.Pipes-net_4_x", "mcs/class/Facades/System.IO.Pipes/Facades_System.IO.Pipes-net_4_x.csproj", "{D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUnit.Framework-net_4_x", "mcs/nunit24/NUnitFramework/framework/NUnit.Framework-net_4_x.csproj", "{B2272696-96AA-4638-B17C-60A4BA37CA0E}"
 EndProject
@@ -585,8 +589,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "al-net_4_x", "mcs/tools/al/
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "monolinker-net_4_x", "mcs/tools/linker/monolinker-net_4_x.csproj", "{FA920637-C202-4E75-AC0F-1A8DBD631DF1}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Tuner-net_4_x", "mcs/tools/tuner/Mono.Tuner-net_4_x.csproj", "{8CCE7044-3466-4599-B09E-9F8E0C2F4614}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "genxs-net_4_x", "mcs/tools/genxs/genxs-net_4_x.csproj", "{DCD2613C-B1A0-489B-BCA1-79BEBB9B9541}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mkbundle-net_4_x", "mcs/tools/mkbundle/mkbundle-net_4_x.csproj", "{3A3DAEC2-3DF4-4968-A191-8D6F207ABA5E}"
@@ -621,7 +623,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunitreport-net_4_x", "mcs/
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pdb2mdb-net_4_x", "mcs/tools/pdb2mdb/pdb2mdb-net_4_x.csproj", "{F7C83E4F-C1C4-4939-8BA3-3EF6E3631E08}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sqlsharp-net_4_x", "mcs/tools/SqlSharp/sqlsharp-net_4_x.csproj", "{DCCC3618-803B-4492-A968-010E2C0851E8}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sqlsharp-net_4_x", "mcs/tools/sqlsharp/sqlsharp-net_4_x.csproj", "{DCCC3618-803B-4492-A968-010E2C0851E8}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sqlmetal-net_4_x", "mcs/tools/sqlmetal/sqlmetal-net_4_x.csproj", "{71A04260-D8F6-4E97-898D-5F3D5A2F3D94}"
 EndProject
@@ -667,6 +669,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mono-symbolicate-net_4_x",
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "linkeranalyzer-net_4_x", "mcs/tools/linker-analyzer/linkeranalyzer-net_4_x.csproj", "{D7789C48-C33A-4FE5-BD42-4DBAB2850796}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "btls-cert-sync-net_4_x", "mcs/tools/btls/btls-cert-sync-net_4_x.csproj", "{2323EB4F-0DBA-47C7-B4AA-AD38CCD16BF8}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU
@@ -1033,6 +1037,10 @@ Global
                {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
+               {1E1BC1A8-EAD2-496C-A6D6-8AFABD741F56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {1E1BC1A8-EAD2-496C-A6D6-8AFABD741F56}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {1E1BC1A8-EAD2-496C-A6D6-8AFABD741F56}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {1E1BC1A8-EAD2-496C-A6D6-8AFABD741F56}.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
@@ -1085,6 +1093,10 @@ Global
                {4742C0FA-2C03-4598-A3F2-4E7D9CDFF81B}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {4742C0FA-2C03-4598-A3F2-4E7D9CDFF81B}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {4742C0FA-2C03-4598-A3F2-4E7D9CDFF81B}.Release|Any CPU.Build.0 = Release|Any CPU
+               {BF32D586-8FBB-4A2A-A734-AA17CDAB283F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {BF32D586-8FBB-4A2A-A734-AA17CDAB283F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {BF32D586-8FBB-4A2A-A734-AA17CDAB283F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {BF32D586-8FBB-4A2A-A734-AA17CDAB283F}.Release|Any CPU.Build.0 = Release|Any CPU
                {11DD6F15-65AB-4CBD-9EFE-2C9626388C53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {11DD6F15-65AB-4CBD-9EFE-2C9626388C53}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {11DD6F15-65AB-4CBD-9EFE-2C9626388C53}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1093,10 +1105,10 @@ Global
                {D76A0C93-56FE-4339-99A8-B7A3D49D6DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {D76A0C93-56FE-4339-99A8-B7A3D49D6DDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {D76A0C93-56FE-4339-99A8-B7A3D49D6DDE}.Release|Any CPU.Build.0 = Release|Any CPU
-               {2C0D558F-0B38-4691-967E-A910A1B995C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {2C0D558F-0B38-4691-967E-A910A1B995C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {2C0D558F-0B38-4691-967E-A910A1B995C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {2C0D558F-0B38-4691-967E-A910A1B995C1}.Release|Any CPU.Build.0 = Release|Any CPU
+               {6DE38817-EC25-433A-AE58-0D30C5E6C460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {6DE38817-EC25-433A-AE58-0D30C5E6C460}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {6DE38817-EC25-433A-AE58-0D30C5E6C460}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {6DE38817-EC25-433A-AE58-0D30C5E6C460}.Release|Any CPU.Build.0 = Release|Any CPU
                {CF14D34A-F69B-47FB-A99C-D25C77198F30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {CF14D34A-F69B-47FB-A99C-D25C77198F30}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {CF14D34A-F69B-47FB-A99C-D25C77198F30}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1277,6 +1289,30 @@ Global
                {E4180397-83B3-4F7B-9878-6891698F7C52}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {E4180397-83B3-4F7B-9878-6891698F7C52}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {E4180397-83B3-4F7B-9878-6891698F7C52}.Release|Any CPU.Build.0 = Release|Any CPU
+               {50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {50A4818C-4BD7-49DB-AD2C-FF3FB0A9D392}.Release|Any CPU.Build.0 = Release|Any CPU
+               {C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Release|Any CPU.Build.0 = Release|Any CPU
+               {524B10FC-880D-4131-8CAE-027BC3A68B6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {524B10FC-880D-4131-8CAE-027BC3A68B6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {524B10FC-880D-4131-8CAE-027BC3A68B6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {524B10FC-880D-4131-8CAE-027BC3A68B6F}.Release|Any CPU.Build.0 = Release|Any CPU
+               {49BB9015-6989-4BD0-AF82-9184BE637D57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {49BB9015-6989-4BD0-AF82-9184BE637D57}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {49BB9015-6989-4BD0-AF82-9184BE637D57}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {49BB9015-6989-4BD0-AF82-9184BE637D57}.Release|Any CPU.Build.0 = Release|Any CPU
+               {C948B3D4-0BEE-4363-B4A7-635A169C8D63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {C948B3D4-0BEE-4363-B4A7-635A169C8D63}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {C948B3D4-0BEE-4363-B4A7-635A169C8D63}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {C948B3D4-0BEE-4363-B4A7-635A169C8D63}.Release|Any CPU.Build.0 = Release|Any CPU
+               {1AFDB281-5FB8-48A9-8694-7F515D835862}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {1AFDB281-5FB8-48A9-8694-7F515D835862}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {1AFDB281-5FB8-48A9-8694-7F515D835862}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {1AFDB281-5FB8-48A9-8694-7F515D835862}.Release|Any CPU.Build.0 = Release|Any CPU
                {EFD0287C-3651-4D42-B8CA-430776CB1E6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {EFD0287C-3651-4D42-B8CA-430776CB1E6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {EFD0287C-3651-4D42-B8CA-430776CB1E6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1393,14 +1429,6 @@ Global
                {88B512E6-3E9D-4F87-A9E4-5F9239848665}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {88B512E6-3E9D-4F87-A9E4-5F9239848665}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {88B512E6-3E9D-4F87-A9E4-5F9239848665}.Release|Any CPU.Build.0 = Release|Any CPU
-               {49BB9015-6989-4BD0-AF82-9184BE637D57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {49BB9015-6989-4BD0-AF82-9184BE637D57}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {49BB9015-6989-4BD0-AF82-9184BE637D57}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {49BB9015-6989-4BD0-AF82-9184BE637D57}.Release|Any CPU.Build.0 = Release|Any CPU
-               {C948B3D4-0BEE-4363-B4A7-635A169C8D63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {C948B3D4-0BEE-4363-B4A7-635A169C8D63}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {C948B3D4-0BEE-4363-B4A7-635A169C8D63}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {C948B3D4-0BEE-4363-B4A7-635A169C8D63}.Release|Any CPU.Build.0 = Release|Any CPU
                {CFB32425-69C5-425B-BF9A-66CB3AC52D71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {CFB32425-69C5-425B-BF9A-66CB3AC52D71}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {CFB32425-69C5-425B-BF9A-66CB3AC52D71}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1413,10 +1441,6 @@ Global
                {4EE0B25C-F7D7-40A9-AE37-5B874791D3C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {4EE0B25C-F7D7-40A9-AE37-5B874791D3C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {4EE0B25C-F7D7-40A9-AE37-5B874791D3C1}.Release|Any CPU.Build.0 = Release|Any CPU
-               {524B10FC-880D-4131-8CAE-027BC3A68B6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {524B10FC-880D-4131-8CAE-027BC3A68B6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {524B10FC-880D-4131-8CAE-027BC3A68B6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {524B10FC-880D-4131-8CAE-027BC3A68B6F}.Release|Any CPU.Build.0 = Release|Any CPU
                {F937A550-0A4A-4A10-9FD9-E8DE7696671F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {F937A550-0A4A-4A10-9FD9-E8DE7696671F}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {F937A550-0A4A-4A10-9FD9-E8DE7696671F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1669,10 +1693,6 @@ Global
                {C87878D2-CDEF-4EC9-8C94-C1381144F4EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {C87878D2-CDEF-4EC9-8C94-C1381144F4EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {C87878D2-CDEF-4EC9-8C94-C1381144F4EC}.Release|Any CPU.Build.0 = Release|Any CPU
-               {C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {C2E71C2B-A806-4FEB-AE2D-A5BE884E3BA7}.Release|Any CPU.Build.0 = Release|Any CPU
                {47977802-4193-48DC-AA0F-58D18AEDA405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {47977802-4193-48DC-AA0F-58D18AEDA405}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {47977802-4193-48DC-AA0F-58D18AEDA405}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1713,18 +1733,22 @@ Global
                {321A53F3-A681-4CA5-A093-1C6650243F6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {321A53F3-A681-4CA5-A093-1C6650243F6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {321A53F3-A681-4CA5-A093-1C6650243F6A}.Release|Any CPU.Build.0 = Release|Any CPU
-               {5D05F5E2-7378-4A35-B1A3-76ABEB4A71C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {5D05F5E2-7378-4A35-B1A3-76ABEB4A71C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {5D05F5E2-7378-4A35-B1A3-76ABEB4A71C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {5D05F5E2-7378-4A35-B1A3-76ABEB4A71C3}.Release|Any CPU.Build.0 = Release|Any CPU
-               {642A1B9E-1A2F-4C55-B184-E22F8C2E95B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {642A1B9E-1A2F-4C55-B184-E22F8C2E95B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {642A1B9E-1A2F-4C55-B184-E22F8C2E95B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {642A1B9E-1A2F-4C55-B184-E22F8C2E95B5}.Release|Any CPU.Build.0 = Release|Any CPU
                {C315A617-25A4-447F-AA4F-0E0E7E35F919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {C315A617-25A4-447F-AA4F-0E0E7E35F919}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {C315A617-25A4-447F-AA4F-0E0E7E35F919}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {C315A617-25A4-447F-AA4F-0E0E7E35F919}.Release|Any CPU.Build.0 = Release|Any CPU
+               {03B29131-9D1A-4446-92F2-237F9EF70C5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {03B29131-9D1A-4446-92F2-237F9EF70C5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {03B29131-9D1A-4446-92F2-237F9EF70C5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {03B29131-9D1A-4446-92F2-237F9EF70C5C}.Release|Any CPU.Build.0 = Release|Any CPU
+               {ACF5E339-FB52-48E0-A859-2CE75756DFE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {ACF5E339-FB52-48E0-A859-2CE75756DFE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {ACF5E339-FB52-48E0-A859-2CE75756DFE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {ACF5E339-FB52-48E0-A859-2CE75756DFE8}.Release|Any CPU.Build.0 = Release|Any CPU
+               {5327CF02-204D-45CD-A68D-3D836470E439}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {5327CF02-204D-45CD-A68D-3D836470E439}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {5327CF02-204D-45CD-A68D-3D836470E439}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {5327CF02-204D-45CD-A68D-3D836470E439}.Release|Any CPU.Build.0 = Release|Any CPU
                {57C02AD3-1118-4982-BCE3-53158D30F4E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {57C02AD3-1118-4982-BCE3-53158D30F4E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {57C02AD3-1118-4982-BCE3-53158D30F4E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1741,30 +1765,18 @@ Global
                {38F046A2-EEBD-4FE7-B70E-636F5DB4BBF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {38F046A2-EEBD-4FE7-B70E-636F5DB4BBF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {38F046A2-EEBD-4FE7-B70E-636F5DB4BBF3}.Release|Any CPU.Build.0 = Release|Any CPU
-               {ACF5E339-FB52-48E0-A859-2CE75756DFE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {ACF5E339-FB52-48E0-A859-2CE75756DFE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {ACF5E339-FB52-48E0-A859-2CE75756DFE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {ACF5E339-FB52-48E0-A859-2CE75756DFE8}.Release|Any CPU.Build.0 = Release|Any CPU
-               {03B29131-9D1A-4446-92F2-237F9EF70C5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {03B29131-9D1A-4446-92F2-237F9EF70C5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {03B29131-9D1A-4446-92F2-237F9EF70C5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {03B29131-9D1A-4446-92F2-237F9EF70C5C}.Release|Any CPU.Build.0 = Release|Any CPU
-               {5327CF02-204D-45CD-A68D-3D836470E439}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {5327CF02-204D-45CD-A68D-3D836470E439}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {5327CF02-204D-45CD-A68D-3D836470E439}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {5327CF02-204D-45CD-A68D-3D836470E439}.Release|Any CPU.Build.0 = Release|Any CPU
-               {BA0C64F1-3762-437D-8B58-75F68A5B4E7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {BA0C64F1-3762-437D-8B58-75F68A5B4E7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {BA0C64F1-3762-437D-8B58-75F68A5B4E7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {BA0C64F1-3762-437D-8B58-75F68A5B4E7E}.Release|Any CPU.Build.0 = Release|Any CPU
+               {62880D99-1C4C-4D38-A8FE-57EF2C9E2150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {62880D99-1C4C-4D38-A8FE-57EF2C9E2150}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {62880D99-1C4C-4D38-A8FE-57EF2C9E2150}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {62880D99-1C4C-4D38-A8FE-57EF2C9E2150}.Release|Any CPU.Build.0 = Release|Any CPU
+               {DF49AC88-C6F2-43B1-8560-3B74542BD874}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {DF49AC88-C6F2-43B1-8560-3B74542BD874}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {DF49AC88-C6F2-43B1-8560-3B74542BD874}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {DF49AC88-C6F2-43B1-8560-3B74542BD874}.Release|Any CPU.Build.0 = Release|Any CPU
                {44647FAA-F785-44DE-B6B2-ABC2B9768233}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {44647FAA-F785-44DE-B6B2-ABC2B9768233}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {44647FAA-F785-44DE-B6B2-ABC2B9768233}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {44647FAA-F785-44DE-B6B2-ABC2B9768233}.Release|Any CPU.Build.0 = Release|Any CPU
-               {D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}.Release|Any CPU.Build.0 = Release|Any CPU
                {66B88E44-F7DA-4C83-B028-A49D4D3EBD16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {66B88E44-F7DA-4C83-B028-A49D4D3EBD16}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {66B88E44-F7DA-4C83-B028-A49D4D3EBD16}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1773,10 +1785,10 @@ Global
                {8C71A924-2561-434B-A792-2F84ABA1C0C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {8C71A924-2561-434B-A792-2F84ABA1C0C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {8C71A924-2561-434B-A792-2F84ABA1C0C2}.Release|Any CPU.Build.0 = Release|Any CPU
-               {ACA10642-1D5B-443D-99BE-65C31491C54F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {ACA10642-1D5B-443D-99BE-65C31491C54F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {ACA10642-1D5B-443D-99BE-65C31491C54F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {ACA10642-1D5B-443D-99BE-65C31491C54F}.Release|Any CPU.Build.0 = Release|Any CPU
+               {D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {D835F3A9-C4FE-4162-8AB5-DC26D06AC81F}.Release|Any CPU.Build.0 = Release|Any CPU
                {B2272696-96AA-4638-B17C-60A4BA37CA0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {B2272696-96AA-4638-B17C-60A4BA37CA0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {B2272696-96AA-4638-B17C-60A4BA37CA0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1841,10 +1853,6 @@ Global
                {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {FA920637-C202-4E75-AC0F-1A8DBD631DF1}.Release|Any CPU.Build.0 = Release|Any CPU
-               {8CCE7044-3466-4599-B09E-9F8E0C2F4614}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-               {8CCE7044-3466-4599-B09E-9F8E0C2F4614}.Debug|Any CPU.Build.0 = Debug|Any CPU
-               {8CCE7044-3466-4599-B09E-9F8E0C2F4614}.Release|Any CPU.ActiveCfg = Release|Any CPU
-               {8CCE7044-3466-4599-B09E-9F8E0C2F4614}.Release|Any CPU.Build.0 = Release|Any CPU
                {DCD2613C-B1A0-489B-BCA1-79BEBB9B9541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {DCD2613C-B1A0-489B-BCA1-79BEBB9B9541}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {DCD2613C-B1A0-489B-BCA1-79BEBB9B9541}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -2005,6 +2013,10 @@ Global
                {D7789C48-C33A-4FE5-BD42-4DBAB2850796}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {D7789C48-C33A-4FE5-BD42-4DBAB2850796}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {D7789C48-C33A-4FE5-BD42-4DBAB2850796}.Release|Any CPU.Build.0 = Release|Any CPU
+               {2323EB4F-0DBA-47C7-B4AA-AD38CCD16BF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {2323EB4F-0DBA-47C7-B4AA-AD38CCD16BF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {2323EB4F-0DBA-47C7-B4AA-AD38CCD16BF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {2323EB4F-0DBA-47C7-B4AA-AD38CCD16BF8}.Release|Any CPU.Build.0 = Release|Any CPU
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
diff --git a/packaging/MacSDK/__init__.py b/packaging/MacSDK/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packaging/MacSDK/fsharp.py b/packaging/MacSDK/fsharp.py
new file mode 100644 (file)
index 0000000..9e53489
--- /dev/null
@@ -0,0 +1,24 @@
+class FsharpPackage(GitHubTarballPackage):
+
+    def __init__(self):
+        GitHubTarballPackage.__init__(self,
+                                      'fsharp', 'fsharp',
+                                      '4.0.1.9',
+                                      '0a6c66a8f18eb8a5c4d0bfac61d883b6994a918a',
+                                      configure='./configure --prefix="%{package_prefix}"')
+
+        self.extra_stage_files = [
+            'lib/mono/xbuild/Microsoft/VisualStudio/v/FSharp/Microsoft.FSharp.Targets']
+
+    def prep(self):
+        Package.prep(self)
+
+        for p in range(1, len(self.sources)):
+            self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"')
+
+    def build(self):
+        self.sh('autoreconf')
+        Package.configure(self)
+        Package.make(self)
+
+FsharpPackage()
diff --git a/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch b/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch
new file mode 100644 (file)
index 0000000..2ca1c6a
--- /dev/null
@@ -0,0 +1,56 @@
+From f6d2db5a0c105785ee6f03717966ef0dbb1421f6 Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Tue, 16 Jul 2013 10:32:11 +0200
+Subject: [PATCH] pixbuf: Add getter/setter for the 2x variants
+
+---
+ gdk-pixbuf/gdk-pixbuf-core.h |  3 +++
+ gdk-pixbuf/gdk-pixbuf.c      | 22 ++++++++++++++++++++++
+ 2 files changed, 25 insertions(+)
+
+diff --git a/gdk-pixbuf/gdk-pixbuf-core.h b/gdk-pixbuf/gdk-pixbuf-core.h
+index eb4d0a1..60c4ea3 100644
+--- a/gdk-pixbuf/gdk-pixbuf-core.h
++++ b/gdk-pixbuf/gdk-pixbuf-core.h
+@@ -474,6 +474,9 @@ GdkPixbuf *gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src);
+ const gchar * gdk_pixbuf_get_option (GdkPixbuf   *pixbuf,
+                                               const gchar *key);
+
++GdkPixbuf * gdk_pixbuf_get_hires_variant (GdkPixbuf *pixbuf);
++void        gdk_pixbuf_set_hires_variant (GdkPixbuf *pixbuf,
++                                          GdkPixbuf *hires);
+
+ G_END_DECLS
+
+diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
+index 0e13f27..d61f2c7 100644
+--- a/gdk-pixbuf/gdk-pixbuf.c
++++ b/gdk-pixbuf/gdk-pixbuf.c
+@@ -990,3 +990,25 @@ gdk_pixbuf_get_property (GObject         *object,
+                   break;
+           }
+ }
++
++GdkPixbuf *
++gdk_pixbuf_get_hires_variant (GdkPixbuf *pixbuf)
++{
++        g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
++
++        return g_object_get_data (G_OBJECT (pixbuf),
++                                  "gdk-pixbuf-2x-variant");
++}
++
++void
++gdk_pixbuf_set_hires_variant (GdkPixbuf *pixbuf,
++                              GdkPixbuf *hires)
++{
++        g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
++        g_return_if_fail (GDK_IS_PIXBUF (hires));
++
++        g_object_set_data_full (G_OBJECT (pixbuf),
++                                "gdk-pixbuf-2x-variant",
++                                g_object_ref (hires),
++                                (GDestroyNotify) g_object_unref);
++}
+--
+1.8.3.2
diff --git a/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch b/packaging/MacSDK/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch
new file mode 100644 (file)
index 0000000..80d3d39
--- /dev/null
@@ -0,0 +1,99 @@
+>From de5d91aa15cc98795a68c8e553eb4baadaa0e501 Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Fri, 17 May 2013 15:56:28 +0200
+Subject: [PATCH] pixbuf: load "@2x" variants as pixbuf gobject data
+
+if a variant of the filename is found that has a "@2x" appended
+to the file name (before the extension), such file is loaded
+and added as GObject data to the pixbuf
+---
+ gdk-pixbuf/gdk-pixbuf-io.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
+
+diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
+index dac21b8..ed98cd3 100644
+--- a/gdk-pixbuf/gdk-pixbuf-io.c
++++ b/gdk-pixbuf/gdk-pixbuf-io.c
+@@ -1025,6 +1025,40 @@ _gdk_pixbuf_generic_image_load (GdkPixbufModule *module,
+         return pixbuf;
+ }
+
++static gboolean
++_gdk_pixbuf_file_is_scaled (const gchar *filename)
++{
++      gchar *basename, *ext;
++
++      basename = g_path_get_basename (filename);
++      ext = strrchr (basename, '.');
++
++      if (!ext)
++              ext = &basename[strlen(basename)];
++
++      if (ext > basename + 3 && strncmp (ext - 3, "@2x", 3) == 0)
++              return TRUE;
++
++      return FALSE;
++}
++
++static gchar *
++_gdk_pixbuf_compose_scaled_filename (const gchar *filename)
++{
++      gchar *ext, *first, *composed;
++
++      ext = strrchr (filename, '.');
++
++      if (!ext)
++              return NULL;
++
++      first = g_strndup (filename, ext - filename);
++      composed = g_strdup_printf ("%s@2x%s", first, ext);
++      g_free (first);
++
++      return composed;
++}
++
+ /**
+  * gdk_pixbuf_new_from_file:
+  * @filename: Name of file to load, in the GLib file name encoding
+@@ -1049,11 +1083,13 @@ gdk_pixbuf_new_from_file (const char *filename,
+         guchar buffer[SNIFF_BUFFER_SIZE];
+         GdkPixbufModule *image_module;
+         gchar *display_name;
++      gboolean filename_is_scaled;
+
+         g_return_val_if_fail (filename != NULL, NULL);
+         g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+         display_name = g_filename_display_name (filename);
++      filename_is_scaled = _gdk_pixbuf_file_is_scaled (filename);
+
+         f = g_fopen (filename, "rb");
+         if (!f) {
+@@ -1097,6 +1133,25 @@ gdk_pixbuf_new_from_file (const char *filename,
+         pixbuf = _gdk_pixbuf_generic_image_load (image_module, f, error);
+         fclose (f);
+
++      if (pixbuf && !filename_is_scaled) {
++              GdkPixbuf *scaled_pixbuf = NULL;
++              gchar *scaled_filename;
++
++              scaled_filename = _gdk_pixbuf_compose_scaled_filename (filename);
++
++              if (scaled_filename) {
++                      scaled_pixbuf = gdk_pixbuf_new_from_file (scaled_filename, NULL);
++                      g_free (scaled_filename);
++              }
++
++              if (scaled_pixbuf) {
++                      g_object_set_data_full (G_OBJECT (pixbuf),
++                                                "gdk-pixbuf-2x-variant",
++                                                scaled_pixbuf,
++                                                (GDestroyNotify) g_object_unref);
++              }
++      }
++
+         if (pixbuf == NULL && error != NULL && *error == NULL) {
+
+                 /* I don't trust these crufty longjmp()'ing image libs
+--
+1.8.3.rc1
diff --git a/packaging/MacSDK/gtkrc b/packaging/MacSDK/gtkrc
new file mode 100644 (file)
index 0000000..b1168d6
--- /dev/null
@@ -0,0 +1,216 @@
+include "/Library/Frameworks/Mono.framework/Versions/Current/share/themes/Clearlooks/gtk-2.0/gtkrc"
+#gtk-icon-theme-name = "OSX"
+gtk-icon-theme-name = "Tango"
+gtk_color_scheme = "fg_color:#222\nbg_color:#e6e6e6\nbase_color:#f9f9f9\ntext_color:#222\nselected_bg_color:#788ab0\nselected_fg_color:#fff"
+gtk-menu-popup-delay = 1
+gtk-button-images = 0
+gtk-menu-images = 0
+gtk-enable-mnemonics = 0
+
+style "theme-default"
+{
+    GtkButton      ::default_border    = { 0, 0, 0, 0 }
+    GtkRange       ::trough_border     = 0
+    GtkPaned       ::handle_size       = 8
+    GtkRange       ::slider_width      = 15
+    GtkRange       ::stepper_size      = 15
+    GtkScrollbar   ::min_slider_length = 30
+    GtkCheckButton ::indicator_size    = 14
+    GtkMenuBar     ::internal-padding  = 0
+    GtkTreeView    ::expander_size     = 12
+    GtkExpander    ::expander_size     = 14
+
+    xthickness = 2
+    ythickness = 2
+
+    fg[NORMAL]        = @fg_color #"#000000" # black
+    fg[PRELIGHT]      = @fg_color #"#000000" # black
+    fg[SELECTED]      = @selected_fg_color #"#ffffff" # white
+    fg[ACTIVE]        = @fg_color #"#000000" # black
+    fg[INSENSITIVE]   = darker (@bg_color) #"#b5b3ac" # dark beige
+
+    bg[NORMAL]        = @bg_color # "#ede9e3"
+    bg[PRELIGHT]      = shade (1.02, @bg_color) #"#f9f7f3" # very light beige
+    bg[SELECTED]      = @selected_bg_color # "#5598d7" # deepsky
+    bg[INSENSITIVE]   = @bg_color # "#efebe5" # beige
+    bg[ACTIVE]        = shade (0.9, @bg_color) #"#dcd4c9" #"#d7d3ca" # dark beige
+
+    base[NORMAL]      = @base_color # "#ffffff" # white
+    base[PRELIGHT]    = shade (0.95, @bg_color) # "#5f8ec4" # dark beige
+    base[ACTIVE]      = shade (0.9, @selected_bg_color) # "#a69f91" # darker deepsky
+    base[SELECTED]    = @selected_bg_color # "#5598d7" # deepsky
+    base[INSENSITIVE] = @bg_color # "#e8e5de" # beige
+
+    text[NORMAL]      = @text_color # "#000000" # black
+    text[PRELIGHT]    = @text_color # "#000000" # black
+    text[ACTIVE]      = @selected_fg_color # "#ffffff" # white
+    text[SELECTED]    = @selected_fg_color # "#ffffff" # white
+    text[INSENSITIVE] = darker (@bg_color) # "#b5b3ac" # dark beige
+
+    engine "clearlooks"  {
+      style               = GUMMY   # gummy look
+      toolbarstyle        = 0       # flat toolbars
+      animation           = TRUE    # animated progressbars
+      menubarstyle        = 2       # rounded menus
+      colorize_scrollbar  = TRUE    # colored slider
+    }
+
+    font              = "Lucida Grande 14"
+}
+
+style "theme-wide" = "theme-default"
+{
+    xthickness = 3
+    ythickness = 3
+}
+
+style "theme-text" = "theme-default"
+{
+    #base[SELECTED]     = "#fc9747"  # Outline?
+}
+
+style "theme-toolbar" = "theme-default"
+{
+    #top and bottom border
+    bg[NORMAL] = @bg_color
+}
+
+style "theme-scrollbar" = "theme-default"
+{
+    bg[SELECTED] = shade (1.1, @selected_bg_color)
+}
+
+style "theme-tasklist" = "theme-default"
+{
+    xthickness = 5
+    ythickness = 3
+}
+
+style "theme-menu" = "theme-default"
+{
+    xthickness = 3
+    ythickness = 3
+    bg[NORMAL] = shade (1.1,@bg_color)
+}
+
+style "theme-menu-item" = "theme-default"
+{
+    xthickness = 2
+    ythickness = 4
+    fg[PRELIGHT] = @selected_fg_color
+    text[PRELIGHT] = @selected_fg_color
+    base[PRELIGHT] = @selected_bg_color # Selection color
+}
+
+style "theme-menu-itembar" = "theme-default"
+{
+    xthickness = 0
+    ythickness = 0
+}
+
+style "theme-tree" = "theme-default"
+{
+    xthickness = 2
+    ythickness = 2
+    GtkTreeView::odd-row-color = shade(0.9, @base_color)
+    GtkTreeView::even-row-color = @base_color
+}
+
+style "theme-frame-title" = "theme-default"
+{
+    #fg[NORMAL] = "#f00" #button frames
+}
+
+style "theme-tooltips" = "theme-default"
+{
+    xthickness = 4
+    ythickness = 4
+    bg[NORMAL] = { 1.0,1.0,0.75 }
+}
+
+style "theme-progressbar" = "theme-default"
+{
+    xthickness = 1
+    ythickness = 1
+    fg[PRELIGHT]  = @base_color
+}
+
+style "theme-combo" = "theme-default"
+{
+    xthickness = 2
+    ythickness = 4
+}
+
+style "theme-button" = "theme-wide"
+{
+    bg[NORMAL] = @bg_color
+    bg[PRELIGHT] = shade (1.1, @bg_color)
+    bg[ACTIVE] = shade (0.9, @bg_color)
+    #xthickness = 4
+    #ythickness = 2
+}
+
+style "theme-check" = "theme-button"
+{
+}
+
+style "theme-panel" = "theme-default"
+{
+    xthickness = 3
+    ythickness = 3
+    bg[ACTIVE] = shade (1.1, @selected_bg_color)
+    fg[ACTIVE] = @selected_fg_color
+}
+
+style "theme-notebook" = "theme-wide"
+{
+    base[SELECTED]    = @selected_bg_color  # Tab selection color
+    bg[ACTIVE]        = shade(0.9, @bg_color)  # Unselected tabs
+
+#    engine "clearlooks" {
+#        style = CLASSIC
+#    }
+}
+
+# widget styles
+class "GtkWidget" style "theme-default"
+class "GtkButton" style "theme-button"
+class "GtkCombo"  style "theme-button"
+class "GtkRange"  style "theme-wide"
+class "GtkFrame"  style "theme-wide"
+class "GtkMenu"   style "theme-menu"
+class "GtkEntry"  style "theme-button"
+class "GtkMenuItem"    style "theme-menu-item"
+class "GtkStatusbar"   style "theme-wide"
+class "GtkNotebook"    style "theme-notebook"
+class "GtkProgressBar" style "theme-progressbar"
+class "GtkCheckButton" style "theme-check"
+class "GtkRadioButton" style "theme-check"
+class "GtkToolbar" style "theme-toolbar"
+
+widget_class "*MenuItem.*" style "theme-menu-item"
+
+# combobox stuff
+widget_class "*.GtkComboBox.GtkButton" style "theme-combo"
+widget_class "*.GtkCombo.GtkButton"    style "theme-combo"
+
+# tooltips stuff
+widget_class "*.tooltips.*.GtkToggleButton" style "theme-tasklist"
+widget "gtk-tooltips" style "theme-tooltips"
+
+# treeview stuff
+widget "*GtkTreeView*" style "theme-tree"
+widget_class "*.GtkTreeView.GtkButton" style "theme-tree"
+widget_class "*.GtkCTree.GtkButton" style "theme-tree"
+widget_class "*.GtkList.GtkButton" style "theme-tree"
+widget_class "*.GtkCList.GtkButton" style "theme-tree"
+widget_class "*.GtkFrame.GtkLabel" style "theme-frame-title"
+
+# notebook stuff
+widget_class "*.GtkNotebook.*.GtkEventBox" style "theme-notebook"
+widget_class "*.GtkNotebook.*.GtkViewport" style "theme-notebook"
+
+# scrollbar stuff
+class "GtkScrollbar" style "theme-scrollbar"
+
+gtk-font-name = "Lucida Grande 12"
diff --git a/packaging/MacSDK/ironlangs.py b/packaging/MacSDK/ironlangs.py
new file mode 100644 (file)
index 0000000..0d4e336
--- /dev/null
@@ -0,0 +1,66 @@
+import os
+import string
+
+
+class IronLanguagesPackage(GitHubTarballPackage):
+
+    def __init__(self):
+        GitHubTarballPackage.__init__(self,
+                                      'IronLanguages', 'iron-languages',
+                                      '2.11',
+                                      'de63773744ccf9873c1826470730ae0446fd64d7',
+                                      configure='')
+
+        # override: avoid naming the package 'main' because of the repo name
+        self.sources = [
+            'https://github.com/%{organization}/main/tarball/%{revision}']
+        self.source_dir_name = '%s-%s-%s' % (
+            self.organization, 'main', self.revision[:7])
+
+    def build(self):
+        self.ironruby = os.path.join(
+            self.workspace, 'ironruby', 'bin') + os.sep
+        self.ironpython = os.path.join(
+            self.workspace, 'ironpython', 'bin') + os.sep
+        self.sh(
+            'xbuild /p:Configuration=Release /p:OutDir="%{ironruby}" Solutions/Ruby.sln')
+        self.sh(
+            'xbuild /p:Configuration=Release /p:OutDir="%{ironpython}" Solutions/IronPython.Mono.sln')
+
+    def install_ruby_scripts(self, path, installdir):
+        for cmd, ext in map(os.path.splitext, os.listdir(path)):
+            if ext != '.exe':
+                continue
+            wrapper = os.path.join(self.staged_prefix, "bin", cmd)
+            with open(wrapper, "w") as output:
+                output.write("#!/bin/sh\n")
+                output.write(
+                    "exec {0}/bin/mono {0}/lib/{1}/{2}.exe \"$@\"\n".format(
+                        self.staged_prefix, installdir, cmd))
+            os.chmod(wrapper, 0o755)
+
+    def install_python_scripts(self, path, installdir):
+        for cmd, ext in map(os.path.splitext, os.listdir(path)):
+            if ext != '.exe':
+                continue
+            wrapper = os.path.join(self.staged_prefix, "bin", cmd)
+            with open(wrapper, "w") as output:
+                output.write("#!/bin/sh\n")
+                output.write(
+                    'export IRONPYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/\n')
+                output.write(
+                    "exec {0}/bin/mono {0}/lib/{1}/{2}.exe \"$@\"\n".format(
+                        self.staged_prefix, installdir, cmd))
+            os.chmod(wrapper, 0o755)
+
+    def install(self):
+        self.sh("mkdir -p %{staged_prefix}/lib/ironruby/")
+        self.sh("mkdir -p %{staged_prefix}/bin/")
+        self.sh("cp -R %{ironruby} %{staged_prefix}/lib/ironruby/")
+        self.install_ruby_scripts(self.ironruby, 'ironruby')
+
+        self.sh("mkdir -p %{staged_prefix}/lib/ironpython/")
+        self.sh("cp -R %{ironpython} %{staged_prefix}/lib/ironpython/")
+        self.install_python_scripts(self.ironpython, 'ironpython')
+
+IronLanguagesPackage()
diff --git a/packaging/MacSDK/libgdiplus.py b/packaging/MacSDK/libgdiplus.py
new file mode 100644 (file)
index 0000000..e40baac
--- /dev/null
@@ -0,0 +1,8 @@
+GitHubTarballPackage(
+    'mono',
+    'libgdiplus',
+    '2.11',
+    '4e7ab0f555a13a6b2f954c714c4ee5213954ff79',
+    configure='CFLAGS="%{gcc_flags} %{local_gcc_flags} -I/opt/X11/include" ./autogen.sh --prefix="%{package_prefix}"',
+    override_properties={
+        'make': 'C_INCLUDE_PATH="" make'})
diff --git a/packaging/MacSDK/mono-basic.py b/packaging/MacSDK/mono-basic.py
new file mode 100644 (file)
index 0000000..ffdbde0
--- /dev/null
@@ -0,0 +1,12 @@
+
+class MonoBasicPackage (GitHubTarballPackage):
+
+    def __init__(self):
+        GitHubTarballPackage.__init__(self, 'mono', 'mono-basic', '4.6', 'c93133db1d511f994918391f429fee29b9250004',
+                                      configure='./configure --prefix="%{staged_profile}"')
+
+    def install(self):
+        self.sh('./configure --prefix="%{staged_prefix}"')
+        self.sh('make install')
+
+MonoBasicPackage()
diff --git a/packaging/MacSDK/mono-llvm.py b/packaging/MacSDK/mono-llvm.py
new file mode 100644 (file)
index 0000000..cf9e89b
--- /dev/null
@@ -0,0 +1,35 @@
+import os
+
+
+class MonoLlvmPackage (GitHubPackage):
+
+    def __init__(self):
+        GitHubPackage.__init__(self, 'mono', 'llvm', '3.0',
+                               revision='8b1520c8aae53e219cf80cdc0f02ad96600887d6',
+                               configure_flags=[
+                                   '--enable-optimized',
+                                   '--enable-assertions=no',
+                                   '--enable-targets="x86,x86_64"']
+                               )
+
+        # This package would like to be lipoed.
+        self.needs_lipo = True
+
+        # TODO: find out which flags are causing issues. reset ld_flags for the
+        # package
+        self.ld_flags = []
+        self.cpp_flags = []
+
+    def arch_build(self, arch):
+        if arch == 'darwin-64':  # 64-bit  build pass
+            self.local_configure_flags = ['--build=x86_64-apple-darwin11.2.0']
+
+        if arch == 'darwin-32':
+            self.local_configure_flags = ['--build=i386-apple-darwin11.2.0']
+
+        # LLVM says that libstdc++4.6 is broken and we should use libstdc++4.7.
+        # This switches it to the right libstdc++.
+        if Package.profile.name == 'darwin':
+            self.local_configure_flags.extend(['--enable-libcpp=yes'])
+
+MonoLlvmPackage()
diff --git a/packaging/MacSDK/mono.py b/packaging/MacSDK/mono.py
new file mode 100644 (file)
index 0000000..8b9f6b3
--- /dev/null
@@ -0,0 +1,99 @@
+import os
+import re
+
+from bockbuild.package import Package
+from bockbuild.util.util import *
+
+
+class MonoMasterPackage(Package):
+
+    def __init__(self):
+        Package.__init__(self, 'mono', None,
+                         sources=[
+                             Package.profile.git_root],
+                         git_branch=os.getenv('MONO_BRANCH') or None,
+                         revision=os.getenv('MONO_BUILD_REVISION'),
+                         configure_flags=[
+                             '--enable-nls=no',
+                             '--with-ikvm=yes'
+                         ]
+                         )
+        self.source_dir_name = 'mono'
+        # This package would like to be lipoed.
+        self.needs_lipo = True
+
+        # Don't clean the workspace, so we can run 'make check' afterwards
+        self.dont_clean = True
+
+        if Package.profile.name == 'darwin':
+            self.configure_flags.extend([
+                '--with-libgdiplus=%s/lib/libgdiplus.dylib' % Package.profile.staged_prefix,
+                '--enable-loadedllvm',
+                'CXXFLAGS=-stdlib=libc++'
+            ])
+
+            self.sources.extend([
+                # Fixes up pkg-config usage on the Mac
+                'patches/mcs-pkgconfig.patch'
+            ])
+        else:
+            self.configure_flags.extend([
+                '--with-libgdiplus=%s/lib/libgdiplus.so' % Package.profile.staged_prefix
+            ])
+
+        self.gcc_flags.extend(['-O2'])
+
+        self.configure = './autogen.sh --prefix="%{package_prefix}"'
+
+        self.extra_stage_files = ['etc/mono/config']
+
+    def build(self):
+        self.make = '%s EXTERNAL_MCS=%s EXTERNAL_RUNTIME=%s' % (
+            self.make, self.profile.env.system_mcs, self.profile.env.system_mono)
+        Package.build(self)
+
+    def prep(self):
+        Package.prep(self)
+        for p in range(1, len(self.local_sources)):
+            self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"')
+
+    def arch_build(self, arch):
+        if arch == 'darwin-64':  # 64-bit build pass
+            self.local_gcc_flags = ['-m64']
+            self.local_configure_flags = ['--build=x86_64-apple-darwin11.2.0']
+
+        if arch == 'darwin-32':  # 32-bit build pass
+            self.local_gcc_flags = ['-m32']
+            self.local_configure_flags = ['--build=i386-apple-darwin11.2.0']
+
+        self.local_configure_flags.extend(
+            ['--cache-file=%s/%s-%s.cache' % (self.profile.bockbuild.build_root, self.name, arch)])
+
+    def install(self):
+        Package.install(self)
+
+        registry_dir = os.path.join(
+            self.staged_prefix,
+            "etc",
+            "mono",
+            "registry",
+            "LocalMachine")
+        ensure_dir(registry_dir)
+
+        # Add ImportBefore/ImportAfter files from xbuild to the msbuild
+        # directories
+        xbuild_dir = os.path.join(self.staged_prefix, 'lib/mono/xbuild')
+        new_xbuild_tv_dir = os.path.join(xbuild_dir, self.version)
+        os.makedirs(new_xbuild_tv_dir)
+
+        self.sh('cp -R %s/14.0/Imports %s' % (xbuild_dir, new_xbuild_tv_dir))
+        self.sh(
+            'cp -R %s/14.0/Microsoft.Common.targets %s' %
+            (xbuild_dir, new_xbuild_tv_dir))
+
+    def deploy(self):
+        if bockbuild.cmd_options.arch == 'darwin-universal':
+            os.symlink('mono-sgen64', '%s/bin/mono64' % self.staged_profile)
+            os.symlink('mono-sgen32', '%s/bin/mono32' % self.staged_profile)
+
+MonoMasterPackage()
diff --git a/packaging/MacSDK/msbuild.py b/packaging/MacSDK/msbuild.py
new file mode 100644 (file)
index 0000000..0e16af1
--- /dev/null
@@ -0,0 +1,44 @@
+import fileinput
+
+
+class MSBuild (GitHubPackage):
+
+    def __init__(self):
+        GitHubPackage.__init__(self, 'mono', 'msbuild', '15.0',
+                               git_branch='xplat-c8p')
+
+    def build(self):
+        self.sh('./cibuild.sh --scope Compile --target Mono --host Mono')
+
+    def install(self):
+        # adjusted from 'install-mono-prefix.sh'
+
+        build_output = 'bin/Debug-MONO/OSX_Deployment'
+        new_location = os.path.join(
+            self.staged_prefix,
+            'lib/mono/msbuild/%s/bin' %
+            self.version)
+        bindir = os.path.join(self.staged_prefix, 'bin')
+
+        os.makedirs(new_location)
+        self.sh('cp -R %s/* %s' % (build_output, new_location))
+
+        os.makedirs(bindir)
+
+        self.sh('cp msbuild-mono-deploy.in %s/msbuild' % bindir)
+
+        for line in fileinput.input('%s/msbuild' % bindir, inplace=True):
+            line = line.replace('@bindir@', '%s/bin' % self.staged_prefix)
+            line = line.replace(
+                '@mono_instdir@',
+                '%s/lib/mono' %
+                self.staged_prefix)
+            print line
+
+        for excluded in glob.glob("%s/*UnitTests*" % new_location):
+            self.rm(excluded)
+
+        for excluded in glob.glob("%s/*xunit*" % new_location):
+            self.rm(excluded)
+
+MSBuild()
diff --git a/packaging/MacSDK/nuget.py b/packaging/MacSDK/nuget.py
new file mode 100644 (file)
index 0000000..321bedf
--- /dev/null
@@ -0,0 +1,18 @@
+
+class NuGetPackage(GitHubPackage):
+
+    def __init__(self):
+        GitHubPackage.__init__(self,
+                               'mono', 'nuget',
+                               '2.12.0',
+                               '9e2d2c1cc09d2a40eeb72e8c5db789e3b9bf2586',
+                               configure='')
+
+    def build(self):
+        self.sh('%{make} update_submodules')
+        self.sh('%{make} PREFIX=%{package_prefix}')
+
+    def install(self):
+        self.sh('%{makeinstall} PREFIX=%{staged_prefix}')
+
+NuGetPackage()
diff --git a/packaging/MacSDK/packaging/Info.plist b/packaging/MacSDK/packaging/Info.plist
new file mode 100644 (file)
index 0000000..8c3799d
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>CFBundleGetInfoString</key>
+        <string>@@MONO_VERSION_RELEASE@@</string>
+        <key>CFBundleIdentifier</key>
+        <string>com.ximian.mono-@@MONO_VERSION@@</string>
+        <key>CFBundleName</key>
+        <string>Mono.framework</string>
+        <key>CFBundleShortVersionString</key>
+        <string>@@MONO_VERSION@@</string>
+        <key>IFPkgFlagAllowBackRev</key>
+        <true/>
+        <key>IFPkgFlagAuthorizationAction</key>
+        <string>AdminAuthorization</string>
+        <key>IFPkgFlagDefaultLocation</key>
+        <string>/</string>
+        <key>IFPkgFlagInstallFat</key>
+        <false/>
+        <key>IFPkgFlagIsRequired</key>
+        <false/>
+        <key>IFPkgFlagRelocatable</key>
+        <false/>
+        <key>IFPkgFlagRestartAction</key>
+        <string>NoRestart</string>
+        <key>IFPkgFlagRootVolumeOnly</key>
+        <true/>
+        <key>IFPkgFlagUpdateInstalledLanguages</key>
+        <false/>
+        <key>IFPkgFormatVersion</key>
+        <real>0.10000000149011612</real>
+</dict>
+</plist>
diff --git a/packaging/MacSDK/packaging/Info_sdk.plist b/packaging/MacSDK/packaging/Info_sdk.plist
new file mode 100644 (file)
index 0000000..7d75b1a
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>CFBundleGetInfoString</key>
+        <string>@@MONO_VERSION_RELEASE@@</string>
+        <key>CFBundleIdentifier</key>
+        <string>com.ximian.mono-@@MONO_VERSION@@-csdk</string>
+        <key>CFBundleName</key>
+        <string>Mono.framework</string>
+        <key>CFBundleShortVersionString</key>
+        <string>@@MONO_VERSION@@</string>
+        <key>IFPkgFlagAllowBackRev</key>
+        <true/>
+        <key>IFPkgFlagAuthorizationAction</key>
+        <string>AdminAuthorization</string>
+        <key>IFPkgFlagDefaultLocation</key>
+        <string>/</string>
+        <key>IFPkgFlagInstallFat</key>
+        <false/>
+        <key>IFPkgFlagIsRequired</key>
+        <false/>
+        <key>IFPkgFlagRelocatable</key>
+        <false/>
+        <key>IFPkgFlagRestartAction</key>
+        <string>NoRestart</string>
+        <key>IFPkgFlagRootVolumeOnly</key>
+        <true/>
+        <key>IFPkgFlagUpdateInstalledLanguages</key>
+        <false/>
+        <key>IFPkgFormatVersion</key>
+        <real>0.10000000149011612</real>
+</dict>
+</plist>
diff --git a/packaging/MacSDK/packaging/mdk_blacklist.sh b/packaging/MacSDK/packaging/mdk_blacklist.sh
new file mode 100755 (executable)
index 0000000..ab426a7
--- /dev/null
@@ -0,0 +1,135 @@
+#!/bin/bash
+
+if test x$1 = x; then
+   echo usage is cleanup MONODIR
+   exit 1
+fi
+
+MONODIR=$1
+
+cd $MONODIR
+rm -rf lib/gtk-2.0/2.10.0/engines/libcrux-engine.so
+rm -rf lib/gtk-2.0/2.10.0/engines/libglide.so
+rm -rf lib/gtk-2.0/2.10.0/engines/libhcengine.so
+rm -rf lib/gtk-2.0/2.10.0/engines/libindustrial.so
+rm -rf lib/gtk-2.0/2.10.0/engines/libmist.so
+rm -rf lib/gtk-2.0/2.10.0/engines/libpixmap.so
+rm -rf lib/gtk-2.0/2.10.0/engines/libredmond95.so
+rm -rf lib/gtk-2.0/2.10.0/engines/libthinice.so
+rm -rf gtk-2.0/modules/libferret.*
+rm -rf gtk-2.0/modules/libgail.*
+rm -rf share/gtk-2.0/demo/*
+rm -rf share/man/man1/oldmono.1
+rm -rf share/themes/Crux
+rm -rf share/themes/Default
+rm -rf share/themes/Emacs
+rm -rf share/themes/Industrial
+rm -rf share/themes/Mist
+rm -rf share/themes/Raleigh
+rm -rf share/themes/Redmond
+rm -rf share/themes/ThinIce
+rm -rf share/info
+rm -rf share/icons/gnome
+rm -rf share/icons/hicolor
+rm -rf share/gtk-doc
+rm -rf share/gettext/*.class
+rm -rf share/doc
+rm -rf share/emacs
+rm -rf share/strings
+rm -rf share/pixmaps
+rm -rf share/intltool
+rm -rf var/cache/fontconfig
+
+# delete most of the *.a files
+rm -rf lib/cairo/libcairo-trace.a
+rm -rf lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.a
+rm -rf lib/gtk-2.0/2.10.0/engines/libsvg.a
+rm -rf lib/libCompilerDriver.a
+rm -rf lib/libEnhancedDisassembly.a
+rm -rf lib/libLLVMAnalysis.a
+rm -rf lib/libLLVMArchive.a
+rm -rf lib/libLLVMAsmParser.a
+rm -rf lib/libLLVMAsmPrinter.a
+rm -rf lib/libLLVMBitReader.a
+rm -rf lib/libLLVMBitWriter.a
+rm -rf lib/libLLVMCodeGen.a
+rm -rf lib/libLLVMCore.a
+rm -rf lib/libLLVMExecutionEngine.a
+rm -rf lib/libLLVMInstCombine.a
+rm -rf lib/libLLVMInstrumentation.a
+rm -rf lib/libLLVMInterpreter.a
+rm -rf lib/libLLVMJIT.a
+rm -rf lib/libLLVMLinker.a
+rm -rf lib/libLLVMMC.a
+rm -rf lib/libLLVMMCDisassembler.a
+rm -rf lib/libLLVMMCJIT.a
+rm -rf lib/libLLVMMCParser.a
+rm -rf lib/libLLVMObject.a
+rm -rf lib/libLLVMScalarOpts.a
+rm -rf lib/libLLVMSelectionDAG.a
+rm -rf lib/libLLVMSupport.a
+rm -rf lib/libLLVMTarget.a
+rm -rf lib/libLLVMTransformUtils.a
+rm -rf lib/libLLVMX86AsmParser.a
+rm -rf lib/libLLVMX86AsmPrinter.a
+rm -rf lib/libLLVMX86CodeGen.a
+rm -rf lib/libLLVMX86Disassembler.a
+rm -rf lib/libLLVMX86Info.a
+rm -rf lib/libLLVMipa.a
+rm -rf lib/libLLVMipo.a
+rm -rf lib/libLTO.a
+# rm -rf lib/libMonoPosixHelper.a
+# rm -rf lib/libMonoSupportW.a
+rm -rf lib/libUnitTestMain.a
+rm -rf lib/libatksharpglue-2.a
+rm -rf lib/libcairo-gobject.a
+rm -rf lib/libcairo-script-interpreter.a
+rm -rf lib/libcairo.a
+rm -rf lib/libcroco-0.6.a
+rm -rf lib/libexpat.a
+rm -rf lib/libffi.a
+rm -rf lib/libfontconfig.a
+rm -rf lib/libfreetype.a
+rm -rf lib/libgdiplus.a
+rm -rf lib/libgdksharpglue-2.a
+rm -rf lib/libgettextpo.a
+rm -rf lib/libgif.a
+rm -rf lib/libglade-2.0.a
+rm -rf lib/libgladesharpglue-2.a
+rm -rf lib/libglibsharpglue-2.a
+rm -rf lib/libgtksharpglue-2.a
+rm -rf lib/libikvm-native.a
+rm -rf lib/libintl.a
+rm -rf lib/libjpeg.a
+rm -rf lib/liblzma.a
+# rm -rf lib/libmono-2.0.a
+# rm -rf lib/libmono-llvm.a
+# rm -rf lib/libmono-profiler-aot.a
+# rm -rf lib/libmono-profiler-cov.a
+# rm -rf lib/libmono-profiler-iomap.a
+# rm -rf lib/libmono-profiler-log.a
+# rm -rf lib/libmonosgen-2.0.a
+rm -rf lib/libpangosharpglue-2.a
+rm -rf lib/libpixman-1.a
+rm -rf lib/libpng.a
+rm -rf lib/libpng14.a
+rm -rf lib/librsvg-2.a
+rm -rf lib/libsqlite3.a
+rm -rf lib/libtiff.a
+rm -rf lib/libtiffxx.a
+rm -rf lib/libxml2.a
+
+# we don't need any of the llvm executables except llc and opt
+rm -rf bin/bugpoint
+rm -rf bin/lli
+rm -rf bin/llvm-*
+rm -rf bin/macho-dump
+rm -rf bin/ccache
+
+#
+# 14:39 <baulig> the install script needs to be modified not to
+#                install .mdb's for these
+# 14:39 <baulig> System.Windows.dll, System.Xml.Serialization.dll and
+#                everything in Facades
+
+find ./lib/mono/4.5/Facades -name "*.mdb" -delete
diff --git a/packaging/MacSDK/packaging/resources/License.rtf b/packaging/MacSDK/packaging/resources/License.rtf
new file mode 100644 (file)
index 0000000..ab13fe4
--- /dev/null
@@ -0,0 +1,26 @@
+{\rtf1\mac\ansicpg10000\cocoartf102
+{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww9000\viewh9000\viewkind0
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+
+\f0\fs24 \cf0 The software included in the package is licensed under several different agreements.\
+\
+MIT License:\
+\
+http://www.opensource.org/licenses/mit-license.php\
+\
+LGPL:\
+\
+http://www.opensource.org/licenses/lgpl-2.1.php\
+\
+GPL:\
+\
+http://www.opensource.org/licenses/gpl-2.0.php\
+\
+You can develop commercial applications and redistribute the code in this package.
+You only need to obtain a commercial license if you wish to make changes to Mono or
+if you are using Mono as an embedded runtime into your application.\
+\
+Contact contact@xamarin.com if you think you need a license.
+}
diff --git a/packaging/MacSDK/packaging/resources/ReadMe.rtf b/packaging/MacSDK/packaging/resources/ReadMe.rtf
new file mode 100644 (file)
index 0000000..704571f
--- /dev/null
@@ -0,0 +1,41 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww15940\viewh15760\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
+
+\f0\fs24 \cf0 This README is for
+\b  Mono.framework @@MONO_VERSION_RELEASE@@
+\b0 .\
+\
+This is the Mono Runtime and Development Platform (http://www.mono-project.com/).\
+\
+This package installs Mono and all of its dependencies inside of /Library/Frameworks/Mono.framework.  This behavior is likely to change with a future release so that dependancies will get their own frameworks.\
+\
+The following components are included inside Mono.framework:\
+@@PACKAGES@@\
+\
+Other packages used to build Mono.framework:\
+@@DEP_PACKAGES@@\
+If you want to build native Mac applications with Mono, you can use the MonoMac bindings, an add-on to this product available from http://www.mono-project.com/MonoMac\
+\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
+\cf0 \
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
+\cf0 \
+\
+A simple uninstallMono.sh script is included in the disk image.  This is shell script that must be run as root, and it will remove the Mono.framework and the links in /usr/bin.\
+\
+This package was created by the Mono team.  Major contributors to this team include (in alphabetical order): \
+\
+Wade Berrier\
+Adhamh Findlay\
+Miguel de Icaza\
+Urs Muff\
+Geoff Norton\
+Andy Satori\
+\
+Questions or problems related directly to the Mono.framework should be addressed to mono-osx@lists.xamarin.com.\
+\
+Questions about Mono should be directed to an appropriate resource that can be found on http://www.mono-project.com/about. \
+}
\ No newline at end of file
diff --git a/packaging/MacSDK/packaging/resources/Welcome.rtf b/packaging/MacSDK/packaging/resources/Welcome.rtf
new file mode 100644 (file)
index 0000000..200bc99
--- /dev/null
@@ -0,0 +1,12 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;}
+{\colortbl;\red255\green255\blue255;}
+\margl1440\margr1440\vieww9000\viewh9000\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
+
+\f0\fs32 \cf0 Welcome to
+\b Mono.framework @@MONO_VERSION_RELEASE@@
+\b0  for OS X.
+\fs36 \
+\
+}
\ No newline at end of file
diff --git a/packaging/MacSDK/packaging/resources/distribution.xml b/packaging/MacSDK/packaging/resources/distribution.xml
new file mode 100644 (file)
index 0000000..39926f9
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<installer-gui-script minSpecVersion="1">
+    <title>Mono Framework</title>
+    <license file="License.rtf" mime-type="application/rtf" />
+    <readme file="ReadMe.rtf" mime-type="application/rtf" />
+    <pkg-ref id="mono">
+        <bundle-version/>
+    </pkg-ref>
+    <choices-outline>
+        <line choice="default">
+            <line choice="mono"/>
+        </line>
+    </choices-outline>
+    <choice id="default"/>
+    <choice id="mono" visible="false">
+        <pkg-ref id="mono"/>
+    </choice>
+    <pkg-ref id="mono">#mono.pkg</pkg-ref>
+</installer-gui-script>
diff --git a/packaging/MacSDK/packaging/resources/postinstall b/packaging/MacSDK/packaging/resources/postinstall
new file mode 100755 (executable)
index 0000000..5ad19ad
--- /dev/null
@@ -0,0 +1,107 @@
+#!/bin/sh -x
+
+FW=/Library/Frameworks/Mono.framework
+FW_CURRENT=${FW}/Versions/Current
+CURRENT=`basename $(readlink ${FW_CURRENT})`
+
+# Remove PCL assemblies that we installed from Mono 3.1.1
+LICENSE="Portable Class Library Reference Assemblies License-07JUN2013.docx"
+if [ -f "$FW/External/xbuild-frameworks/.NETPortable/$LICENSE" ]; then
+    echo "Removing PCL because we're upgrading from 3.1.1" >> /tmp/mono-installation
+    rm -rf $FW/External/xbuild-frameworks/.NETPortable
+fi
+
+# Remove /usr/local/bin/pkg-config if it's a symlink to the Mono-installed one
+PKG_CONFIG_LINK="/usr/local/bin/pkg-config"
+if [ -L $PKG_CONFIG_LINK ]; then
+    location=`readlink $PKG_CONFIG_LINK`
+    case "$location" in
+    *Mono.framework*) rm $PKG_CONFIG_LINK;;
+    esac
+fi
+
+WHITELIST=$(cat "$(dirname "$0")/whitelist.txt")
+MONO_COMMANDS_FILE=/etc/paths.d/mono-commands
+FW_WHITELISTED_COMMANDS=${FW_CURRENT}/Commands
+
+mkdir ${FW_WHITELISTED_COMMANDS}
+mkdir /etc/paths.d
+
+if test -e ${MONO_COMMANDS_FILE}; then
+    rm "${MONO_COMMANDS_FILE}"
+fi
+
+echo "${FW_WHITELISTED_COMMANDS}" >> "${MONO_COMMANDS_FILE}"
+
+if [ -d "${FW}"/Commands ]; then
+    for i in ${WHITELIST}; do
+        if test -e "${FW}/Commands/${i}"; then
+            ln -s "${FW}/Commands/${i}" "${FW_WHITELISTED_COMMANDS}/${i}"
+        fi
+    done;
+else
+    echo "${FW}/Commands does not exist"
+    echo "Can not add command links to $PATH."
+fi
+
+if [ -d ${FW_CURRENT} ]; then
+    cd ${FW_CURRENT}/share/man
+    for i in ${WHITELIST}; do
+        for j in $(ls man*/${i}.*); do
+            if test ! -e "/usr/local/share/man/${j}"; then
+                ln -sf "${FW_CURRENT}/share/man/${j}" "/usr/local/share/man/${j}"
+            fi
+        done
+    done
+
+    cd ${FW_CURRENT}/etc
+    # Make sure we run the files we lay down, and not other stuff installed on the system
+    export PATH=${FW_CURRENT}/bin:$PATH
+    # gtk+ setup
+    gdk-pixbuf-query-loaders --update-cache
+    # pango setup
+    mkdir -p pango
+    pango-querymodules >  pango/pango.modules
+    pango-querymodules --update-cache
+    fc-cache
+
+    cd ${FW_CURRENT}/lib/gtk-2.0/2.10.0
+    gtk-query-immodules-2.0 > immodules.cache
+fi
+
+# Delete older Monos
+#
+# - keep if the major version is different
+# - keep if 'Versions/x.y.z/keep' exists
+# - Keep if it is greater than $CURRENT
+#
+echo "Current:" $CURRENT >> /tmp/mono-installation
+
+pushd ${FW}/Versions
+for i in `ls -d *`; do
+    result=`echo "${i:0:1} == ${CURRENT:0:1}" | bc`
+    if [ $result -ne 1 ]; then
+        echo "keeping" $i "because it has a different major version" >> /tmp/mono-installation
+        continue
+    fi
+
+    if [ -f $i/keep ]; then
+        echo "Keeping" $i "because of keep file" >> /tmp/mono-installation
+        continue
+    fi
+
+    # A magical bit of Perl: http://stackoverflow.com/a/7366753/494990
+    result=$(perl -e '($a,$b)=@ARGV; for ($a,$b) {s/(\d+)/sprintf "%5d", $1/ge}; print $a cmp $b;' $i $CURRENT)
+    if [ $result -ge 0 ]; then
+        echo "Skipping" $i "because $i >= $CURRENT" >> /tmp/mono-installation
+        continue
+
+    else
+        echo "rm -rf" $i >> /tmp/mono-installation
+        rm -rf $i
+    fi
+done
+popd
+
+# Mono framework should be owned by root
+chown -R root:admin ${FW}
diff --git a/packaging/MacSDK/packaging/resources/version.plist b/packaging/MacSDK/packaging/resources/version.plist
new file mode 100644 (file)
index 0000000..df2e67c
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>BuildVersion</key>
+        <string>@@MONO_VERSION_RELEASE@@</string>
+        <key>CFBundleShortVersionString</key>
+        <string>@@MONO_VERSION_RELEASE@@</string>
+        <key>CFBundleVersion</key>
+        <string>@@MONO_VERSION_RELEASE@@</string>
+        <key>ProjectName</key>
+        <string>Mono</string>
+        <key>SourceVersion</key>
+        <string>@@MONO_VERSION_RELEASE@@</string>
+</dict>
+</plist>
diff --git a/packaging/MacSDK/packaging/resources/whitelist.txt b/packaging/MacSDK/packaging/resources/whitelist.txt
new file mode 100644 (file)
index 0000000..7d329a9
--- /dev/null
@@ -0,0 +1,129 @@
+al
+al2
+asp-state
+asp-state2
+asp-state4
+booc
+booi
+booish
+caspol
+ccrewrite
+cccheck
+cert2spc
+certmgr
+chktrust
+ClassInitGenerator
+csharp
+csharp2
+dbsessmgr
+dbsessmgr2
+dbsessmgr4
+disco
+dmcs
+dtd2rng
+dtd2xsd
+fastcgi-mono-server
+fastcgi-mono-server2
+fastcgi-mono-server4
+fsharpc
+fsharpc2
+fsharpi
+fsharpi2
+gacutil
+gacutil2
+gapi2-codegen
+gapi2-fixup
+gapi2-parser
+genxs
+gmcs
+httpcfg
+ikdasm
+ilasm
+installvst
+ipy
+ipy64
+ipyw
+ipyw64
+ir
+ir64
+IronRuby.Tests
+irw
+irw64
+lc
+macpack
+makecert
+mautil
+mconfig
+mcs
+mdassembler
+mdoc
+mdoc-assemble
+mdoc-export-html
+mdoc-export-msxdoc
+mdoc-update
+mdoc-validate
+mdvalidater
+mkbundle
+mod
+mod-mono-server
+mod-mono-server2
+mod-mono-server4
+mono
+mono64
+mono-boehm
+mono-api-info
+mono-api-html
+mono-cil-strip
+mono-configuration-crypto
+monodis
+monodocer
+monodocs2html
+monodocs2slashdoc
+mono-find-provides
+mono-find-requires
+mono-gdb.py
+monograph
+mono-heapviz
+monolinker
+monop
+monop2
+mono-service
+mono-service2
+mono-sgen
+mono-shlib-cop
+mono-symbolicate
+mono-test-install
+mono-xmltool
+mozroots
+mprof-report
+msbuild
+nant
+nuget
+nunit-console
+nunit-console2
+nunit-console4
+pdb2mdb
+pedump
+permview
+peverify
+prj2make
+resgen
+resgen2
+secutil
+setreg
+sgen
+signcode
+sn
+soapsuds
+sqlmetal
+sqlsharp
+svcutil
+vbnc
+vbnc2
+wsdl
+wsdl2
+xbuild
+xsd
+xsp
+xsp2
+xsp4
diff --git a/packaging/MacSDK/packaging/uninstallMono.sh b/packaging/MacSDK/packaging/uninstallMono.sh
new file mode 100755 (executable)
index 0000000..9e88ad1
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh -x
+
+#This script removes Mono from an OS X System.  It must be run as root
+
+rm -r /Library/Frameworks/Mono.framework
+
+# In 10.6+ the receipts are stored here
+rm /var/db/receipts/com.ximian.mono*
+
+for dir in /usr/local/bin; do
+   (cd ${dir};
+    for i in `ls -al | grep /Library/Frameworks/Mono.framework/ | awk '{print $9}'`; do
+      rm ${i}
+    done);
+done
diff --git a/packaging/MacSDK/patches/find-unused-patches.sh b/packaging/MacSDK/patches/find-unused-patches.sh
new file mode 100755 (executable)
index 0000000..b758c97
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+for f in *.patch; do grep $f ../*.py > /dev/null || echo $f; done
+for f in */*.patch; do grep $f ../*.py > /dev/null || echo $f; done
diff --git a/packaging/MacSDK/patches/mcs-pkgconfig.patch b/packaging/MacSDK/patches/mcs-pkgconfig.patch
new file mode 100644 (file)
index 0000000..eeefebc
--- /dev/null
@@ -0,0 +1,23 @@
+diff --git a/scripts/Makefile.am b/scripts/Makefile.am
+index 73b9cea..98b8cfb 100644
+--- a/scripts/Makefile.am
++++ b/scripts/Makefile.am
+@@ -179,7 +179,8 @@ REWRITE_COMMON = sed \
+       -e 's,@''bindir@,$(bindir),g'                           \
+       -e 's,@''plat_bindir@,$(plat_bindir),g'                 \
+       -e 's,@''mono_instdir@,$(mono_instdir),g'               \
+-      -e 's,@''gtkdir@,$(gtkdir),g'
++      -e 's,@''gtkdir@,$(gtkdir),g'                           \
++      -e 's,@''mono_version@,$(VERSION),g'
+
+ REWRITE = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp),g'
+ REWRITE_DEBUG = $(REWRITE_COMMON) -e 's,@''mono_interp@,$(mono_interp) --debug,g'
+diff --git a/scripts/mcs.in b/scripts/mcs.in
+index 32498fa..c15087e 100644
+--- a/scripts/mcs.in
++++ b/scripts/mcs.in
+@@ -1,2 +1,4 @@
+ #!/bin/sh
++export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/@mono_version@/bin
++export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/External/pkgconfig:/Library/Frameworks/Mono.framework/Versions/@mono_version@/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/@mono_version@/share/pkgconfig:$PKG_CONFIG_PATH
+ exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/2.0/mcs.exe -lib:@mono_instdir@/2.0 -lib:@mono_instdir@/3.5 "$@"
diff --git a/packaging/MacSDK/pcl-reference-assemblies.py b/packaging/MacSDK/pcl-reference-assemblies.py
new file mode 100644 (file)
index 0000000..216e9f7
--- /dev/null
@@ -0,0 +1,57 @@
+import glob
+import os
+import shutil
+
+
+class PCLReferenceAssembliesPackage(Package):
+
+    def __init__(self):
+        Package.__init__(self,
+                         name='PortableReferenceAssemblies',
+                         version='2014-04-14',
+                         sources=['http://xamarin-storage/bot-provisioning/PortableReferenceAssemblies-2014-04-14.zip'])
+
+    def build(self):
+        pass
+
+    # A bunch of shell script written inside python literals ;(
+    def install(self):
+        dest = os.path.join(
+            self.staged_prefix,
+            "lib",
+            "mono",
+            "xbuild-frameworks",
+            ".NETPortable")
+        if not os.path.exists(dest):
+            os.makedirs(dest)
+
+        shutil.rmtree(dest, ignore_errors=True)
+
+        self.sh("rsync -abv -q %s/* %s" % (self.workspace, dest))
+
+        for f in glob.glob("%s/*/Profile/*/SupportedFrameworks" % dest):
+            self.write_xml(f)
+
+    def write_xml(self, directory):
+        # print "Writing iOS/Android/Mac listings for " + directory
+        data = {
+            os.path.join(directory, "MonoTouch.xml"):
+            """<Framework Identifier="MonoTouch" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.iOS Classic"/>""",
+            os.path.join(directory, "Xamarin.iOS.xml"):
+            """<Framework Identifier="Xamarin.iOS" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.iOS Unified"/>""",
+            os.path.join(directory, "Xamarin.Android.xml"):
+            """<Framework Identifier="MonoAndroid" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.Android"/>""",
+            os.path.join(directory, "Xamarin.Mac.xml"):
+            """<Framework Identifier="Xamarin.Mac" MinimumVersion="2.0" Profile="*" DisplayName="Xamarin.Mac Unified"/>""",
+            os.path.join(directory, "Xamarin.TVOS.xml"):
+            """<Framework Identifier="Xamarin.TVOS" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.TVOS"/>""",
+            os.path.join(directory, "Xamarin.WatchOS.xml"):
+            """<Framework Identifier="Xamarin.WatchOS" MinimumVersion="1.0" Profile="*" DisplayName="Xamarin.WatchOS"/>""",
+        }
+        for filename, content in data.iteritems():
+            f = open(filename, "w")
+            f.write(content + "\n")
+            f.close()
+
+
+PCLReferenceAssembliesPackage()
diff --git a/packaging/MacSDK/profile.py b/packaging/MacSDK/profile.py
new file mode 100755 (executable)
index 0000000..1a7827d
--- /dev/null
@@ -0,0 +1,394 @@
+import itertools
+import os
+import re
+import shutil
+import string
+import sys
+import tempfile
+import subprocess
+import stat
+
+from bockbuild.darwinprofile import DarwinProfile
+from bockbuild.util.util import *
+from glob import glob
+
+class MonoReleaseProfile(DarwinProfile):
+    description = 'The Mono Framework for MacOS'
+    packages = [
+        'gettext',
+        'pkg-config',
+
+        # Base Libraries
+        'libpng',
+        'libjpeg',
+        'libtiff',
+        'libgif',
+        'libxml2',
+        'freetype',
+        'fontconfig',
+        'pixman',
+        'cairo',
+        'libffi',
+        'glib',
+        'pango',
+        'atk',
+        'intltool',
+        'gdk-pixbuf',
+        'gtk+',
+        'libglade',
+        'sqlite',
+        'expat',
+        'ige-mac-integration',
+
+        # Theme
+        'libcroco',
+        'librsvg',
+        'hicolor-icon-theme',
+        'gtk-engines',
+        'murrine',
+        'xamarin-gtk-theme',
+        'gtk-quartz-engine',
+
+        # Mono
+        'mono-llvm',
+        'mono',
+        'msbuild',
+        'pcl-reference-assemblies',
+        'libgdiplus',
+        'xsp',
+        'gtk-sharp',
+        'ironlangs',
+        'fsharp',
+        'mono-basic',
+        'nuget'
+    ]
+
+    def attach (self, bockbuild):
+        self.min_version = 7
+        DarwinProfile.attach (self, bockbuild)
+
+        # quick disk space check (http://stackoverflow.com/questions/787776/)
+        s = os.statvfs(bockbuild.root)
+        free_space = (s.f_bavail * s.f_frsize) / (1024 * 1024 * 1024)  # in GB
+
+        if free_space < 10:
+            error('Low disk space (less than 10GB), aborting')
+
+        # check for XQuartz installation (needed for libgdiplus)
+        if not os.path.exists('/opt/X11/include/X11/Xlib.h'):
+            error(
+                'XQuartz is required to be installed (download from http://xquartz.macosforge.org/) ')
+
+        self.MONO_ROOT = "/Library/Frameworks/Mono.framework"
+        self.BUILD_NUMBER = "0"
+        self.MDK_GUID = "964ebddd-1ffe-47e7-8128-5ce17ffffb05"
+
+        system_mono_dir = '/Library/Frameworks/Mono.framework/Versions/Current'
+        self.env.set('system_mono', os.path.join(
+            system_mono_dir, 'bin', 'mono'))
+        self.env.set('system_mcs', os.path.join(system_mono_dir, 'bin', 'mcs'))
+
+        self.env.set('system_mono_version', backtick(
+            '%s --version' % self.env.system_mono)[0])
+
+        # config overrides for some programs to be functional while staged
+
+        self.env.set('GDK_PIXBUF_MODULE_FILE',
+                     '%{staged_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache')
+        self.env.set('GDK_PIXBUF_MODULEDIR',
+                     '%{staged_prefix}/lib/gdk-pixbuf-2.0/2.10.0/loaders')
+        self.env.set('PANGO_SYSCONFDIR', '%{staged_prefix}/etc')
+        self.env.set('PANGO_LIBDIR', '%{staged_prefix}/lib')
+        # self.env.set ('MONO_PATH', '%{staged_prefix}/lib/mono/4.0')
+        self.debug_info = ['gtk+', 'cairo',
+                           'pango', 'mono', 'llvm', 'libgdiplus']
+        self.cache_host = None
+
+    def setup_release(self):
+        self.mono_package = self.release_packages['mono']
+        self.mono_package.fetch()
+
+        verbose('Mono version: %s' % self.mono_package.version)
+        self.RELEASE_VERSION = self.mono_package.version
+        self.prefix = os.path.join(
+            self.MONO_ROOT, "Versions", self.RELEASE_VERSION)
+
+        if os.path.exists(self.prefix):
+            error('Prefix %s exists, and may interfere with the staged build. Please remove and try again.' % self.prefix)
+
+        self.calculate_updateid()
+        trace(self.package_info('MDK'))
+
+        self.dont_optimize = ['pixman']
+
+        for p in self.release_packages.values():
+            if p.name in self.dont_optimize:
+                continue
+            self.gcc_flags.extend(['-O2'])
+
+    # THIS IS THE MAIN METHOD FOR MAKING A PACKAGE
+    def package(self):
+        self.fix_gtksharp_configs()
+        self.verify_binaries()
+
+        working = self.setup_working_dir()
+        uninstall_script = os.path.join(working, "uninstallMono.sh")
+
+        # make the MDK
+        self.apply_blacklist(working, 'mdk_blacklist.sh')
+        self.make_updateinfo(working, self.MDK_GUID)
+        mdk_pkg = self.run_pkgbuild(working, "MDK")
+        title(mdk_pkg)
+        # self.make_dmg(mdk_dmg, title, mdk_pkg, uninstall_script)
+
+        shutil.rmtree(working)
+
+    def calculate_updateid(self):
+        # Create the updateid
+        pwd = os.getcwd()
+        git_bin = self.bockbuild.git_bin
+        trace("cur path is %s and git is %s" % (pwd, git_bin))
+        blame_rev_str = 'cd %s; %s blame configure.ac HEAD | grep AC_INIT | sed \'s/ .*//\' ' % (
+            self.mono_package.workspace, git_bin)
+        blame_rev = backtick(blame_rev_str)[0]
+        trace("Last commit to the version string %s" % (blame_rev))
+        version_number_str = 'cd %s; %s log %s..HEAD --oneline | wc -l | sed \'s/ //g\'' % (
+            self.mono_package.workspace, git_bin, blame_rev)
+        self.BUILD_NUMBER = backtick(version_number_str)[0]
+        trace("Calculating commit distance, %s" % (self.BUILD_NUMBER))
+        self.FULL_VERSION = self.RELEASE_VERSION + "." + self.BUILD_NUMBER
+        os.chdir(pwd)
+
+        parts = self.RELEASE_VERSION.split(".")
+        version_list = (parts + ["0"] * (3 - len(parts)))[:4]
+        for i in range(1, 3):
+            version_list[i] = version_list[i].zfill(2)
+            self.updateid = "".join(version_list)
+            self.updateid += self.BUILD_NUMBER.replace(
+                ".", "").zfill(9 - len(self.updateid))
+        trace(self.updateid)
+
+    # creates and returns the path to a working directory containing:
+    #   PKGROOT/ - this root will be bundled into the .pkg and extracted at /
+    #   uninstallMono.sh - copied onto the DMG
+    #   Info{_sdk}.plist - used by packagemaker to make the installer
+    #   resources/ - other resources used by packagemaker for the installer
+    def setup_working_dir(self):
+        def make_package_symlinks(root):
+            os.symlink(self.prefix, os.path.join(root, "Versions", "Current"))
+            currentlink = os.path.join(self.MONO_ROOT, "Versions", "Current")
+            links = [
+                ("bin", "Commands"),
+                ("include", "Headers"),
+                ("lib", "Libraries"),
+                ("", "Home"),
+                (os.path.join("lib", "libmono-2.0.dylib"), "Mono")
+            ]
+            for srcname, destname in links:
+                src = os.path.join(currentlink, srcname)
+                dest = os.path.join(root, destname)
+                # If the symlink exists, we remove it so we can create a fresh
+                # one
+                if os.path.exists(dest):
+                    os.unlink(dest)
+                os.symlink(src, dest)
+
+        tmpdir = tempfile.mkdtemp()
+        monoroot = os.path.join(tmpdir, "PKGROOT", self.MONO_ROOT[1:])
+        versions = os.path.join(monoroot, "Versions")
+        os.makedirs(versions)
+
+        print "Setting up temporary package directory:", tmpdir
+
+        # setup metadata
+        self.packaging_dir = os.path.join(self.resource_path, "packaging")
+        run_shell('rsync -aPq %s/* %s' % (self.packaging_dir, tmpdir), False)
+
+        packages_list = string.join(
+            [pkg.desc for pkg in self.release_packages.values()], "\\\n")
+        deps_list = 'bockbuild (rev. %s)\\\n' % bockbuild.bockbuild_rev + string.join(
+            [pkg.desc for pkg in self.toolchain_packages.values()], "\\\n")
+
+        parameter_map = {
+            '@@MONO_VERSION@@': self.RELEASE_VERSION,
+            '@@MONO_RELEASE@@': self.BUILD_NUMBER,
+            '@@MONO_VERSION_RELEASE@@': self.RELEASE_VERSION + '_' + self.BUILD_NUMBER,
+            '@@MONO_CSDK_GUID@@': self.MDK_GUID,
+            '@@MONO_VERSION_RELEASE_INT@@': self.updateid,
+            '@@PACKAGES@@': packages_list,
+            '@@DEP_PACKAGES@@': deps_list
+        }
+        for dirpath, d, files in os.walk(tmpdir):
+            for name in files:
+                if not name.startswith('.'):
+                    replace_in_file(os.path.join(dirpath, name), parameter_map)
+
+        make_package_symlinks(monoroot)
+
+        # copy to package root
+        run_shell('rsync -aPq "%s"/* "%s/%s"' %
+                  (bockbuild.package_root, versions, self.RELEASE_VERSION), False)
+
+        return tmpdir
+
+    def apply_blacklist(self, working_dir, blacklist_name):
+        print "Applying blacklist script:", blacklist_name
+        blacklist = os.path.join(self.packaging_dir, blacklist_name)
+        root = os.path.join(working_dir, "PKGROOT", self.prefix[1:])
+        run_shell('%s "%s" > /dev/null' % (blacklist, root), print_cmd=False)
+
+    def run_pkgbuild(self, working_dir, package_type):
+        print 'Running pkgbuild & productbuild...',
+        info = self.package_info(package_type)
+        output = os.path.join(self.resource_path, info["filename"])
+        identifier = "com.xamarin.mono-" + info["type"] + ".pkg"
+        resources_dir = os.path.join(working_dir, "resources")
+        distribution_xml = os.path.join(resources_dir, "distribution.xml")
+
+        old_cwd = os.getcwd()
+        os.chdir(working_dir)
+        pkgbuild = "/usr/bin/pkgbuild"
+        pkgbuild_cmd = ' '.join([pkgbuild,
+                                 "--identifier " + identifier,
+                                 "--root '%s/PKGROOT'" % working_dir,
+                                 "--version '%s'" % self.RELEASE_VERSION,
+                                 "--install-location '/'",
+                                 "--scripts '%s'" % resources_dir,
+                                 "--quiet",
+                                 os.path.join(working_dir, "mono.pkg")])
+
+        run_shell(pkgbuild_cmd)
+
+        productbuild = "/usr/bin/productbuild"
+        productbuild_cmd = ' '.join([productbuild,
+                                     "--resources %s" % resources_dir,
+                                     "--distribution %s" % distribution_xml,
+                                     "--package-path %s" % working_dir,
+                                     "--quiet",
+                                     output])
+
+        run_shell(productbuild_cmd)
+
+        assert_exists(output)
+        os.chdir(old_cwd)
+        print output
+        return output
+
+    def make_updateinfo(self, working_dir, guid):
+        updateinfo = os.path.join(
+            working_dir, "PKGROOT", self.prefix[1:], "updateinfo")
+        with open(updateinfo, "w") as updateinfo:
+            updateinfo.write(guid + ' ' + self.updateid + "\n")
+
+    def package_info(self, pkg_type):
+        arch = self.bockbuild.cmd_options.arch
+        arch_str = None
+        if  arch == "darwin-32":
+            arch_str = "x86"
+        elif arch == "darwin-64":
+            arch_str = "x64"
+        elif arch == "darwin-universal":
+            arch_str = "universal"
+        else:
+            error ("Unknown architecture")
+
+        if self.bockbuild.cmd_options.release_build:
+            info = (pkg_type, self.FULL_VERSION, arch_str)
+        else:
+            info = (pkg_type, '%s-%s' % (git_shortid(self.bockbuild,
+                                                     self.mono_package.workspace), self.FULL_VERSION), arch_str)
+
+        filename = "MonoFramework-%s-%s.macos10.xamarin.%s.pkg" % info
+        return {
+            "type": pkg_type,
+            "filename": filename
+        }
+
+    def fix_line(self, line, matcher):
+        def insert_install_root(matches):
+            root = self.prefix
+            captures = matches.groupdict()
+            return 'target="%s"' % os.path.join(root, "lib", captures["lib"])
+
+        if matcher(line):
+            pattern = r'target="(?P<lib>.+\.dylib)"'
+            result = re.sub(pattern, insert_install_root, line)
+            return result
+        else:
+            return line
+
+    def fix_dllmap(self, config, matcher):
+        handle, temp = tempfile.mkstemp()
+        with open(config) as c:
+            with open(temp, "w") as output:
+                for line in c:
+                    output.write(self.fix_line(line, matcher))
+        os.rename(temp, config)
+        os.system('chmod a+r %s' % config)
+
+    def fix_gtksharp_configs(self):
+        print 'Fixing GTK# configuration files...',
+        count = 0
+        libs = [
+            'atk-sharp',
+            'gdk-sharp',
+            'glade-sharp',
+            'glib-sharp',
+            'gtk-dotnet',
+            'gtk-sharp',
+            'pango-sharp'
+        ]
+        gac = os.path.join(bockbuild.package_root, "lib", "mono", "gac")
+        confs = [glob.glob(os.path.join(gac, x, "*", "*.dll.config")) for x in libs]
+        for c in itertools.chain(*confs):
+            count = count + 1
+            self.fix_dllmap(c, lambda line: "dllmap" in line)
+        print count
+
+    def verify(self, f):
+        result = " ".join(backtick("otool -L " + f))
+        regex = os.path.join(self.MONO_ROOT, "Versions", r"(\d+\.\d+\.\d+)")
+
+        match = re.search(regex, result)
+        if match is None:
+            return
+        token = match.group(1)
+        trace(token)
+        if self.RELEASE_VERSION not in token:
+            raise Exception("%s references Mono %s\n%s" % (f, token, text))
+
+    def verify_binaries(self):
+        bindir = os.path.join(bockbuild.package_root, "bin")
+        for path, dirs, files in os.walk(bindir):
+            for name in files:
+                f = os.path.join(path, name)
+                file_type = backtick('file "%s"' % f)
+                if "Mach-O executable" in "".join(file_type):
+                    self.verify(f)
+
+    def shell(self):
+        envscript = '''#!/bin/sh
+        PROFNAME="%s"
+        INSTALLDIR="%s"
+        ROOT="%s"
+        export DYLD_FALLBACK_LIBRARY_PATH="$INSTALLDIR/lib:/lib:/usr/lib"
+        export ACLOCAL_PATH="$INSTALLDIR/share/aclocal"
+        export CONFIG_SITE="$INSTALLDIR/$PROFNAME-config.site"
+        export MONO_GAC_PREFIX="$INSTALLDIR"
+        export MONO_ADDINS_REGISTRY="$ROOT/addinreg"
+        export MONO_INSTALL_PREFIX="$INSTALLDIR"
+
+        export PS1="\[\e[1;3m\][$PROFNAME] \w @ "
+        bash -i
+        ''' % (self.profile_name, self.staged_prefix, self.root)
+
+        path = os.path.join(self.root, self.profile_name + '.sh')
+
+        with open(path, 'w') as f:
+            f.write(envscript)
+
+        os.chmod(path, os.stat(path).st_mode | stat.S_IEXEC)
+
+        subprocess.call(['bash', '-c', path])
+
+MonoReleaseProfile()
\ No newline at end of file
diff --git a/packaging/MacSDK/sqlite.py b/packaging/MacSDK/sqlite.py
new file mode 100644 (file)
index 0000000..f0f5082
--- /dev/null
@@ -0,0 +1,3 @@
+Package('sqlite-autoconf', '3090200', sources=[
+    'http://www.sqlite.org/2015/%{name}-%{version}.tar.gz'
+])
diff --git a/packaging/MacSDK/xamarin-gtk-theme.py b/packaging/MacSDK/xamarin-gtk-theme.py
new file mode 100644 (file)
index 0000000..34d3ae0
--- /dev/null
@@ -0,0 +1,20 @@
+class XamarinGtkThemePackage (Package):
+
+    def __init__(self):
+        Package.__init__(self, 'xamarin-gtk-theme',
+                         sources=[
+                             'git://github.com/mono/xamarin-gtk-theme.git'],
+                         revision='cc3fb66e56d494e968be3a529a0737a60e31c1f3')
+
+    def build(self):
+        try:
+            self.sh('./autogen.sh --prefix=%{staged_prefix}')
+        except:
+            pass
+        finally:
+            #self.sh ('intltoolize --force --copy --debug')
+            #self.sh ('./configure --prefix="%{package_prefix}"')
+            Package.build(self)
+
+
+XamarinGtkThemePackage()
diff --git a/packaging/MacSDK/xsp.py b/packaging/MacSDK/xsp.py
new file mode 100644 (file)
index 0000000..8180001
--- /dev/null
@@ -0,0 +1,23 @@
+class XspPackage (GitHubTarballPackage):
+
+    def __init__(self):
+        GitHubTarballPackage.__init__(self, 'mono', 'xsp', '4.4',
+                                      'c98e068f5647fb06ff2fbef7cd5f1b35417362b1',
+                                      configure='./autogen.sh --prefix="%{package_prefix}"')
+
+    def install(self):
+        # scoop up some mislocated files
+        misdir = '%s%s' % (self.stage_root, self.staged_profile)
+        unprotect_dir(self.stage_root)
+        Package.install(self)
+        if not os.path.exists(misdir):
+            for path in iterate_dir(self.stage_root):
+                print path
+            error('Could not find mislocated files')
+
+        self.sh('rsync -a --ignore-existing %s/* %s' %
+                (misdir, self.profile.staged_prefix))
+        self.sh('rm -rf %s/*' % misdir)
+
+
+XspPackage()
diff --git a/packaging/MacSDKRelease/mono-extensions.py b/packaging/MacSDKRelease/mono-extensions.py
new file mode 100644 (file)
index 0000000..2d52fda
--- /dev/null
@@ -0,0 +1,25 @@
+from bockbuild.package import Package
+
+
+class MonoExtensionsPackage(Package):
+
+    def __init__(self):
+        Package.__init__(self, 'mono-extensions', None,
+                         sources=['git@github.com:xamarin/mono-extensions.git'],
+                         git_branch=self.profile.release_packages[
+                             'mono'].git_branch
+                         )
+        self.source_dir_name = 'mono-extensions'
+
+        # Mono pull requests won't have mono-extensions branches
+        if not self.git_branch or 'pull/' in self.git_branch:
+            warn('Using master branch for mono_extensions')
+            self.git_branch = 'master'
+
+    def build(self):
+        pass
+
+    def install(self):
+        pass
+
+MonoExtensionsPackage()
diff --git a/packaging/MacSDKRelease/packaging b/packaging/MacSDKRelease/packaging
new file mode 120000 (symlink)
index 0000000..714bc29
--- /dev/null
@@ -0,0 +1 @@
+../MacSDK/packaging
\ No newline at end of file
diff --git a/packaging/MacSDKRelease/profile.py b/packaging/MacSDKRelease/profile.py
new file mode 100755 (executable)
index 0000000..2b0d99a
--- /dev/null
@@ -0,0 +1,89 @@
+import itertools
+import os
+import re
+import shutil
+import string
+import sys
+import tempfile
+import traceback
+
+from glob import glob
+
+from MacSDK import profile
+from bockbuild.util.util import *
+
+
+class MonoXamarinPackageProfile(MonoReleaseProfile):
+    description = 'The Mono Framework for MacOS (official release)'
+
+    def setup (self):
+        MonoReleaseProfile.setup (self)
+        bockbuild.packages_to_build.extend(['mono-extensions'])
+        if bockbuild.cmd_options.release_build:
+            self.setup_codesign()
+        else:
+            info("'--release' option not set, will not attempt to sign package!")
+
+        self.cache_host = 'http://xamarin-storage/bockbuild_cache/'
+
+    def setup_codesign(self):
+        self.identity = "Developer ID Installer: Xamarin Inc"
+
+        output = backtick("security -v find-identity")
+        if self.identity not in " ".join(output):
+            error("Identity '%s' was not found. You can create an unsigned package by removing '--release' to your command line." % self.identity)
+
+        password = os.getenv("CODESIGN_KEYCHAIN_PASSWORD")
+        if password:
+            print "Unlocking the keychain"
+            run_shell("security unlock-keychain -p %s" % password)
+        else:
+            error("CODESIGN_KEYCHAIN_PASSWORD needs to be defined.")
+
+    def setup_release(self):
+        MonoReleaseProfile.setup_release(self)
+        self.release_packages['mono'].configure_flags.extend(
+            ['--enable-extension-module=xamarin --enable-native-types --enable-pecrypt'])
+        info('Xamarin extensions enabled')
+
+    def run_pkgbuild(self, working_dir, package_type):
+        output = MonoReleaseProfile.run_pkgbuild(
+            self, working_dir, package_type)
+
+        output_unsigned = os.path.join(os.path.dirname(
+            output), os.path.basename(output).replace('.pkg', '.UNSIGNED.pkg'))
+        shutil.move(output, output_unsigned)
+
+        if not bockbuild.cmd_options.release_build:
+            return output_unsigned
+
+        productsign = "/usr/bin/productsign"
+        productsign_cmd = ' '.join([productsign,
+                                    "-s '%s'" % self.identity,
+                                    "'%s'" % output_unsigned,
+                                    "'%s'" % output])
+        run_shell(productsign_cmd)
+        os.remove(output_unsigned)
+        self.verify_codesign(output)
+
+        return output
+
+    def verify_codesign(self, pkg):
+        oldcwd = os.getcwd()
+        try:
+            name = os.path.basename(pkg)
+            pkgdir = os.path.dirname(pkg)
+            os.chdir(pkgdir)
+            spctl = "/usr/sbin/spctl"
+            spctl_cmd = ' '.join(
+                [spctl, "-vvv", "--assess", "--type install", name, "2>&1"])
+            output = backtick(spctl_cmd)
+
+            if "accepted" in " ".join(output):
+                warn("%s IS SIGNED" % pkg)
+            else:
+                error("%s IS NOT SIGNED:" % pkg)
+        finally:
+            os.chdir(oldcwd)
+
+MonoXamarinPackageProfile()
\ No newline at end of file
index 068bb1d3dc0269bc87633813b76bae786ca0ac63..9ca318346557b586ab6b35914619cfa8fbe249dc 100644 (file)
@@ -165,10 +165,13 @@ CLEANFILES = etc/mono/config
 etc/mono/config: ../data/config Makefile $(symlinks)
        d=`cd ../support && pwd`; \
        sed 's,target="$$mono_libdir/libMonoPosixHelper$(libsuffix)",target="'$$d'/libMonoPosixHelper.la",' ../data/config > $@t
+       d=`cd ../mono/btls/build-shared && pwd`; \
+       sed 's,target="$$mono_libdir/libmono-btls-shared$(libsuffix)",target="'$$d'/libmono-btls-shared$(libsuffix)",' $@t > $@tt
        if test -z "$(libgdiplus_loc)"; then :; else \
-         sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@t > $@tt; \
-         mv -f $@tt $@t; fi
-       mv -f $@t $@
+         sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@tt > $@ttt; \
+         mv -f $@ttt $@tt; fi
+       mv -f $@tt $@
+       rm -f $@t
 
 $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
        $(mkinstalldirs) $(tmpinst)/bin
index a036cf1f8dbc283329b0c3c07ec21baf97d9f750..a22d2a91ff418265354bc59c8043ba1a16403891 100644 (file)
@@ -2,6 +2,7 @@
 /al
 /al1
 /al2
+/btls-cert-sync
 /caspol
 /cert-sync
 /cert2spc
index 4447e30939f9a727a9952fea1f950c5570fd201b..39595455dadf28dc64a1a5e957b13143d0b365b0 100644 (file)
@@ -73,6 +73,7 @@ scripts_4_0 = \
        prj2make$(SCRIPT_SUFFIX)                \
        soapsuds$(SCRIPT_SUFFIX)                \
        caspol$(SCRIPT_SUFFIX)                  \
+       btls-cert-sync$(SCRIPT_SUFFIX)          \
        cert-sync$(SCRIPT_SUFFIX)               \
        cert2spc$(SCRIPT_SUFFIX)                \
        certmgr$(SCRIPT_SUFFIX)                 \
@@ -157,6 +158,7 @@ EXTRA_DIST =                        \
        update_submodules               \
        mcs.in                          \
        dmcs.in                         \
+       mono-package-runtime    \
        mono-test-install       \
        mono-heapviz            \
        $(MDOC_COMPAT)          \
index 059ae97cff2cbe200a06713ff7f16c9b49ab1e63..fed23f7b1ba304b180df33525ffe72ed69831ae0 100755 (executable)
@@ -26,7 +26,7 @@ if [[ ${CI_TAGS} == *'mobile_static'* ]];
 elif [[ ${CI_TAGS} == *'acceptance-tests'* ]];
     then
     EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=${WORKSPACE}/tmp/mono-acceptance-tests --with-sgen-default-concurrent=yes";
-elif [[ ${label} != w* ]] && [[ ${label} != 'debian-ppc64el' ]] && [[ ${label} != 'centos-s390x' ]] && [[ ${CI_TAGS} != *'monolite'* ]];
+elif [[ ${label} != w* ]] && [[ ${label} != 'debian-8-ppc64el' ]] && [[ ${label} != 'centos-s390x' ]] && [[ ${CI_TAGS} != *'monolite'* ]];
     then
     # Override the defaults to skip profiles
     # only enable the mobile profiles and mobile_static on the main architectures
@@ -54,12 +54,10 @@ fi
 
 if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi
 
-${TESTCMD} --label=make --timeout=300m --fatal make -j4 -w V=1
-if [[ -n "${ghprbPullId}" ]] && [[ ${label} == w* ]];
-    then
-    exit 0
-    # we don't run the test suite on Windows PRs, we just ensure the build succeeds, so end here
-fi
+make_parallelism=-j4
+if [[ ${label} == 'debian-8-ppc64el' ]]; then make_parallelism=-j1; fi
+
+${TESTCMD} --label=make --timeout=300m --fatal make ${make_parallelism} -w V=1
 
 if [[ ${CI_TAGS} == *'acceptance-tests'* ]];
     then
@@ -67,6 +65,9 @@ if [[ ${CI_TAGS} == *'acceptance-tests'* ]];
 elif [[ ${CI_TAGS} == *'profiler-stress-tests'* ]];
     then
        $(dirname "${BASH_SOURCE[0]}")/run-test-profiler-stress-tests.sh
+elif [[ ${CI_TAGS} == *'no-tests'* ]];
+    then
+       exit 0
 else
        make check-ci
 fi
index bffda6b73f7191f1673b4e3123ca9c18b95589ea..5f0767219f8ab2300666f59f05788c27919e122e 100755 (executable)
@@ -3,32 +3,39 @@
 export TESTCMD=`dirname "${BASH_SOURCE[0]}"`/run-step.sh
 
 ${TESTCMD} --label=mini --timeout=5m make -w -C mono/mini -k check check-seq-points EMIT_NUNIT=1
-${TESTCMD} --label=runtime --timeout=160m make -w -C mono/tests -k test-wrench V=1 CI=1
+${TESTCMD} --label=compile-runtime-tests --timeout=20m make -w -C mono/tests -j4 tests
+${TESTCMD} --label=runtime --timeout=160m make -w -C mono/tests -k test-wrench V=1 CI=1 CI_PR=${ghprbPullId}
+${TESTCMD} --label=runtime-unit-tests --timeout=5m make -w -C mono/unit-tests -k check
 ${TESTCMD} --label=corlib --timeout=30m make -w -C mcs/class/corlib run-test
 ${TESTCMD} --label=verify --timeout=15m make -w -C runtime mcs-compileall
 ${TESTCMD} --label=profiler --timeout=30m make -w -C mono/profiler -k check
 ${TESTCMD} --label=compiler --timeout=30m make -w -C mcs/tests run-test
 ${TESTCMD} --label=compiler-errors --timeout=30m make -w -C mcs/errors run-test
-${TESTCMD} --label=System --timeout=10m make -w -C mcs/class/System run-test
+${TESTCMD} --label=System --timeout=10m bash -c "export MONO_TLS_PROVIDER=legacy && make -w -C mcs/class/System run-test"
+if [[ ${label} == osx-* ]]; then ${TESTCMD} --label=System-btls --timeout=10m bash -c "export MONO_TLS_PROVIDER=btls && make -w -C mcs/class/System run-test"; fi
 ${TESTCMD} --label=System.XML --timeout=5m make -w -C mcs/class/System.XML run-test
 ${TESTCMD} --label=Mono.Security --timeout=5m make -w -C mcs/class/Mono.Security run-test
-${TESTCMD} --label=System.Security --timeout=5m make -w -C mcs/class/System.Security run-test;
-${TESTCMD} --label=System.Drawing --timeout=5m make -w -C mcs/class/System.Drawing run-test
-if [[ ${label} == osx-* ]]
+${TESTCMD} --label=System.Security --timeout=5m make -w -C mcs/class/System.Security run-test
+if [[ ${label} == w* ]]
+then ${TESTCMD} --label=System.Drawing --skip;
+else ${TESTCMD} --label=System.Drawing --timeout=5m make -w -C mcs/class/System.Drawing run-test
+fi
+if [[ ${label} == osx-* ]] || [[ ${label} == w* ]]
 then ${TESTCMD} --label=Windows.Forms --skip;
 else ${TESTCMD} --label=Windows.Forms --timeout=5m make -w -C mcs/class/System.Windows.Forms run-test
 fi
 ${TESTCMD} --label=System.Data --timeout=5m make -w -C mcs/class/System.Data run-test
+if [[ ${label} == w* ]]; then ${TESTCMD} --label=Mono.Data.Sqlite --skip; else ${TESTCMD} --label=Mono.Data.Sqlite --timeout=5m make -w -C mcs/class/Mono.Data.Sqlite run-test; fi
 ${TESTCMD} --label=System.Data.OracleClient --timeout=5m make -w -C mcs/class/System.Data.OracleClient run-test;
 ${TESTCMD} --label=System.Design --timeout=5m make -w -C mcs/class/System.Design run-test;
-${TESTCMD} --label=Mono.Posix --timeout=5m make -w -C mcs/class/Mono.Posix run-test
+if [[ -n "${ghprbPullId}" ]] && [[ ${label} == w* ]]; then ${TESTCMD} --label=Mono.Posix --skip; else ${TESTCMD} --label=Mono.Posix --timeout=5m make -w -C mcs/class/Mono.Posix run-test; fi
 ${TESTCMD} --label=System.Web --timeout=30m make -w -C mcs/class/System.Web run-test
 ${TESTCMD} --label=System.Web.Services --timeout=5m make -w -C mcs/class/System.Web.Services run-test
 ${TESTCMD} --label=System.Runtime.SFS --timeout=5m make -w -C mcs/class/System.Runtime.Serialization.Formatters.Soap run-test;
-${TESTCMD} --label=System.Runtime.Remoting --timeout=5m make -w -C mcs/class/System.Runtime.Remoting run-test;
+${TESTCMD} --label=System.Runtime.Remoting --timeout=5m make -w -C mcs/class/System.Runtime.Remoting run-test
 ${TESTCMD} --label=Cscompmgd --timeout=5m make -w -C mcs/class/Cscompmgd run-test;
 ${TESTCMD} --label=Commons.Xml.Relaxng --timeout=5m make -w -C mcs/class/Commons.Xml.Relaxng run-test;
-${TESTCMD} --label=System.ServiceProcess --timeout=5m make -w -C mcs/class/System.ServiceProcess run-test;
+${TESTCMD} --label=System.ServiceProcess --timeout=5m make -w -C mcs/class/System.ServiceProcess run-test
 ${TESTCMD} --label=I18N.CJK --timeout=5m make -w -C mcs/class/I18N/CJK run-test
 ${TESTCMD} --label=I18N.West --timeout=5m make -w -C mcs/class/I18N/West run-test
 ${TESTCMD} --label=I18N.MidEast --timeout=5m make -w -C mcs/class/I18N/MidEast run-test
@@ -43,7 +50,7 @@ ${TESTCMD} --label=System.Configuration --timeout=5m make -w -C mcs/class/System
 ${TESTCMD} --label=System.Transactions --timeout=5m make -w -C mcs/class/System.Transactions run-test
 ${TESTCMD} --label=System.Web.Extensions --timeout=5m make -w -C mcs/class/System.Web.Extensions run-test
 ${TESTCMD} --label=System.Core --timeout=15m make -w -C mcs/class/System.Core run-test
-${TESTCMD} --label=symbolicate --timeout=60m make -w -C mcs/tools/mono-symbolicate check
+if [[ -n "${ghprbPullId}" ]] && [[ ${label} == w* ]]; then ${TESTCMD} --label=symbolicate --skip; else ${TESTCMD} --label=symbolicate --timeout=60m make -w -C mcs/tools/mono-symbolicate check; fi
 ${TESTCMD} --label=System.Xml.Linq --timeout=5m make -w -C mcs/class/System.Xml.Linq run-test
 ${TESTCMD} --label=System.Data.DSE --timeout=5m make -w -C mcs/class/System.Data.DataSetExtensions run-test
 ${TESTCMD} --label=System.Web.Abstractions --timeout=5m make -w -C mcs/class/System.Web.Abstractions run-test
@@ -80,6 +87,7 @@ ${TESTCMD} --label=Microsoft.Build.Engine-14 --timeout=60m make -w -C mcs/class/
 ${TESTCMD} --label=Microsoft.Build.Framework-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Framework run-test PROFILE=xbuild_14
 ${TESTCMD} --label=Microsoft.Build.Tasks-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Tasks run-test PROFILE=xbuild_14
 ${TESTCMD} --label=Microsoft.Build.Utilities-14 --timeout=60m make -w -C mcs/class/Microsoft.Build.Utilities run-test PROFILE=xbuild_14
+${TESTCMD} --label=System.IO.Compression --timeout=5m make -w -C mcs/class/System.IO.Compression run-test
 if [[ ${label} == osx-* ]]
 then ${TESTCMD} --label=ms-test-suite --timeout=15m make -w -C acceptance-tests check-ms-test-suite
 else ${TESTCMD} --label=ms-test-suite --skip;
index 52d6f1668003d6eb79373b94101697d66f0f8bfa..05f5015611ec91e07ef669e6eb671ff84a830339 100755 (executable)
@@ -2,4 +2,4 @@
 
 export TESTCMD=`dirname "${BASH_SOURCE[0]}"`/run-step.sh
 
-${TESTCMD} --label=check-profiler-stress --timeout=20h make -C acceptance-tests check-profiler-stress
+${TESTCMD} --label=check-profiler-stress --timeout=24h make -C acceptance-tests check-profiler-stress
old mode 100644 (file)
new mode 100755 (executable)
index f364a66095fcaf23a35524746f18d4accf891736..9dcebc7e967d6b04e9d8780c6cf7807e51bac228 100644 (file)
@@ -194,21 +194,22 @@ ReadZStream (ZStream *stream, guchar *buffer, gint length)
        while (zs->avail_out > 0) {
                if (zs->avail_in == 0) {
                        n = stream->func (stream->buffer, BUFFER_SIZE, stream->gchandle);
+                       n = n < 0 ? 0 : n;
                        stream->total_in += n;
-                       if (n <= 0) {
-                               stream->eof = TRUE;
-                       }
                        zs->next_in = stream->buffer;
-                       zs->avail_in = n < 0 ? 0 : n;
+                       zs->avail_in = n;
                }
 
-               if (zs->avail_in == 0 && (zs->total_in == 0 || stream->total_in == zs->total_in))
-                       return Z_STREAM_END;
+               if (zs->avail_in == 0 && zs->total_in == 0)
+                       return 0;
 
                status = inflate (stream->stream, Z_SYNC_FLUSH);
                if (status == Z_STREAM_END) {
                        stream->eof = TRUE;
                        break;
+               } else if (status == Z_BUF_ERROR && stream->total_in == zs->total_in) {
+                       stream->eof = TRUE;
+                       break;
                } else if (status != Z_OK) {
                        return status;
                }
index 27f1a5f3cf9cf801d857e750382395fcb80cccff..4d3cb8370693ebaa8616f7bc163d43ef3bc7d8fb 100644 (file)
@@ -260,9 +260,9 @@ method_stats (MonoMethod *method) {
                        if (i == MONO_CEE_CASTCLASS || i == MONO_CEE_ISINST) {
                                guint32 token = read32 (ip + 1);
                                MonoClass *k = mono_class_get (method->klass->image, token);
-                               if (k && k->flags & TYPE_ATTRIBUTE_SEALED)
+                               if (k && mono_class_get_flags (k) & TYPE_ATTRIBUTE_SEALED)
                                        cast_sealed++;
-                               if (k && k->flags & TYPE_ATTRIBUTE_INTERFACE)
+                               if (k && mono_class_get_flags (k) & TYPE_ATTRIBUTE_INTERFACE)
                                        cast_iface++;
                                total_cast++;
                        }
@@ -364,7 +364,7 @@ method_stats (MonoMethod *method) {
                                MonoMethod *cm = mono_get_method (method->klass->image, read32 (ip + 1), NULL);
                                if (cm && !(cm->flags & METHOD_ATTRIBUTE_VIRTUAL))
                                        nonvirt_callvirt++;
-                               if (cm && (cm->klass->flags & TYPE_ATTRIBUTE_INTERFACE))
+                               if (cm && (mono_class_get_flags (cm->klass) & TYPE_ATTRIBUTE_INTERFACE))
                                        iface_callvirt++;
                                total_callvirt++;
                        }
@@ -430,7 +430,7 @@ type_stats (MonoClass *klass) {
        MonoClass *parent;
        int depth = 1;
 
-       if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+       if (mono_class_get_flags (klass) & TYPE_ATTRIBUTE_INTERFACE) {
                num_ifaces++;
                return;
        }
index b4c6b68c22369b55c3ffcb20899241328b3287f5..37909156cee069bd22496d34967a1aac901f55d6 100644 (file)
@@ -1,7 +1,34 @@
-CPPSHARP_DIR = CppSharp
+CPPSHARP_BASE_DIR = CppSharp
+
+ifeq ($(OS),Windows_NT)
+       CPPSHARP_OS=windows
+       ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
+               CPPSHARP_ARCH=64
+       else
+               ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
+                       CPPSHARP_ARCH=64
+               endif
+               ifeq ($(PROCESSOR_ARCHITECTURE),x86)
+                       CPPSHARP_ARCH=32
+               endif
+       endif
+else
+       UNAME_S := $(shell uname -s)
+       ifeq ($(UNAME_S),Linux)
+               CPPSHARP_OS=linux
+               CPPSHARP_ARCH=64
+       endif
+       ifeq ($(UNAME_S),Darwin)
+               CPPSHARP_OS=osx
+               CPPSHARP_ARCH=32
+       endif
+endif
+
+CPPSHARP_DIR = $(CPPSHARP_BASE_DIR)/$(CPPSHARP_OS)_$(CPPSHARP_ARCH)
 
 CPPSHARP_REFS = -r:$(CPPSHARP_DIR)/CppSharp.dll \
        -r:$(CPPSHARP_DIR)/CppSharp.AST.dll \
+       -r:$(CPPSHARP_DIR)/CppSharp.Parser.dll \
        -r:$(CPPSHARP_DIR)/CppSharp.Parser.CSharp.dll \
        -r:$(CPPSHARP_DIR)/CppSharp.Generator.dll
 
@@ -10,8 +37,8 @@ SRC_ROOT = ../..
 MONO_OPTIONS_SRC = $(SRC_ROOT)/mcs/class/Mono.Options/Mono.Options/Options.cs
 
 .stamp-clone:
-       @if [ ! -d $(CPPSHARP_DIR) ]; then \
-               git clone git://github.com/xamarin/CppSharpBinaries.git $(CPPSHARP_DIR) && touch $@; \
+       @if [ ! -d $(CPPSHARP_BASE_DIR) ]; then \
+               git clone -b 60f763a9 --depth 1 git://github.com/xamarin/CppSharpBinaries.git $(CPPSHARP_BASE_DIR) && touch $@; \
        fi
 
 MonoAotOffsetsDumper.exe: .stamp-clone MonoAotOffsetsDumper.cs $(MONO_OPTIONS_SRC)
index e04a23809a5428a760d06b8225467abacd3bbdaf..0f9a984833d766fdc48ceba51617882d361f3237 100644 (file)
@@ -235,7 +235,7 @@ namespace CppSharp
                 if (!driver.ParseCode())
                     return;
 
-                Dump(driver.ASTContext, driver.TargetInfo, target);
+                Dump(driver.Context.ASTContext, driver.Context.TargetInfo, target);
             }
         }
 
@@ -244,13 +244,13 @@ namespace CppSharp
             foreach (var header in driver.Options.Headers)
             {
                 var source = driver.Project.AddFile(header);
-                source.Options = driver.BuildParseOptions(source);
+                source.Options = driver.BuildParserOptions(source);
 
                 if (header.Contains ("mini"))
                     continue;
 
-                source.Options.addDefines ("HAVE_SGEN_GC");
-                source.Options.addDefines ("HAVE_MOVING_COLLECTOR");
+                source.Options.AddDefines ("HAVE_SGEN_GC");
+                source.Options.AddDefines ("HAVE_MOVING_COLLECTOR");
             }
         }
 
@@ -306,22 +306,24 @@ namespace CppSharp
         {
             var options = driver.Options;
             options.DryRun = true;
-            options.Verbose = false;
             options.LibraryName = "Mono";
-            options.MicrosoftMode = false;
-            options.addArguments("-xc");
-            options.addArguments("-std=gnu99");
-            options.addDefines("CPPSHARP");
+
+            var parserOptions = driver.ParserOptions;
+            parserOptions.Verbose = false;
+            parserOptions.MicrosoftMode = false;
+            parserOptions.AddArguments("-xc");
+            parserOptions.AddArguments("-std=gnu99");
+            parserOptions.AddDefines("CPPSHARP");
 
             foreach (var define in target.Defines)
-                options.addDefines(define);
+                parserOptions.AddDefines(define);
 
             SetupToolchainPaths(driver, target);
 
-            SetupMono(options, target);
+            SetupMono(driver, target);
         }
 
-        static void SetupMono(DriverOptions options, Target target)
+        static void SetupMono(Driver driver, Target target)
         {
             string targetPath;
             switch (target.Platform) {
@@ -356,7 +358,7 @@ namespace CppSharp
             };
 
             foreach (var inc in includeDirs)
-                options.addIncludeDirs(inc);
+                driver.ParserOptions.AddIncludeDirs(inc);
 
             var filesToParse = new[]
             {
@@ -365,15 +367,15 @@ namespace CppSharp
             };
 
             foreach (var file in filesToParse)
-                options.Headers.Add(file);
+                driver.Options.Headers.Add(file);
         }
 
         static void SetupMSVC(Driver driver, string triple)
         {
-            var options = driver.Options;
+            var parserOptions = driver.ParserOptions;
 
-            options.Abi = Parser.AST.CppAbi.Microsoft;
-            options.MicrosoftMode = true;
+            parserOptions.Abi = Parser.AST.CppAbi.Microsoft;
+            parserOptions.MicrosoftMode = true;
 
             var systemIncludeDirs = new[]
             {
@@ -382,9 +384,9 @@ namespace CppSharp
             };
 
             foreach (var inc in systemIncludeDirs)
-                options.addSystemIncludeDirs(inc);
+                parserOptions.AddSystemIncludeDirs(inc);
 
-            options.addDefines("HOST_WIN32");
+            parserOptions.AddDefines("HOST_WIN32");
         }
 
         static void SetupToolchainPaths(Driver driver, Target target)
@@ -487,7 +489,7 @@ namespace CppSharp
 
         static void SetupXcode(Driver driver, Target target)
         {
-            var options = driver.Options;
+            var parserOptions = driver.ParserOptions;
 
             var builtinsPath = GetXcodeBuiltinIncludesFolder();
             string includePath;
@@ -503,12 +505,12 @@ namespace CppSharp
                 throw new ArgumentOutOfRangeException ();
             }
 
-            options.addSystemIncludeDirs(builtinsPath);
-            options.addSystemIncludeDirs(includePath);
+            parserOptions.AddSystemIncludeDirs(builtinsPath);
+            parserOptions.AddSystemIncludeDirs(includePath);
 
-            options.NoBuiltinIncludes = true;
-            options.NoStandardIncludes = true;
-            options.TargetTriple = target.Triple;
+            parserOptions.NoBuiltinIncludes = true;
+            parserOptions.NoStandardIncludes = true;
+            parserOptions.TargetTriple = target.Triple;
         }
 
         static string GetAndroidHostToolchainPath()
@@ -555,9 +557,10 @@ namespace CppSharp
         static void SetupAndroidNDK(Driver driver, Target target)
         {
             var options = driver.Options;
+            var parserOptions = driver.ParserOptions;
 
             var builtinsPath = GetAndroidBuiltinIncludesFolder();
-            options.addSystemIncludeDirs(builtinsPath);
+            parserOptions.AddSystemIncludeDirs(builtinsPath);
 
             var androidNdkRoot = GetAndroidNdkPath ();
             const int androidNdkApiLevel = 21;
@@ -565,11 +568,11 @@ namespace CppSharp
             var toolchainPath = Path.Combine(androidNdkRoot, "platforms",
                 "android-" + androidNdkApiLevel, "arch-" + GetArchFromTriple(target.Triple),
                 "usr", "include");
-            options.addSystemIncludeDirs(toolchainPath);
+            parserOptions.AddSystemIncludeDirs(toolchainPath);
 
-            options.NoBuiltinIncludes = true;
-            options.NoStandardIncludes = true;
-            options.TargetTriple = target.Triple;
+            parserOptions.NoBuiltinIncludes = true;
+            parserOptions.NoStandardIncludes = true;
+            parserOptions.TargetTriple = target.Triple;
         }
 
         static uint GetTypeAlign(ParserTargetInfo target, ParserIntType type)
@@ -638,8 +641,8 @@ namespace CppSharp
         {
             var targetFile = target.Triple;
 
-                       if (!string.IsNullOrEmpty (OutputDir))
-                               targetFile = Path.Combine (OutputDir, targetFile);
+            if (!string.IsNullOrEmpty (OutputDir))
+                targetFile = Path.Combine (OutputDir, targetFile);
 
             targetFile += ".h";
 
@@ -754,7 +757,7 @@ namespace CppSharp
             var types = new List<string>
             {
                 "MonoObject",
-               "MonoObjectHandlePayload",
+                "MonoObjectHandlePayload",
                 "MonoClass",
                 "MonoVTable",
                 "MonoDelegate",
@@ -803,7 +806,7 @@ namespace CppSharp
                 "SeqPointInfo",
                 "DynCallArgs", 
                 "MonoLMFTramp",
-            };            
+            };
 
             DumpClasses(writer, ctx, optionalTypes, optional: true);
 
@@ -813,8 +816,8 @@ namespace CppSharp
         static void DumpStruct(TextWriter writer, Class @class)
         {
             var name = @class.Name;
-                       if (name.StartsWith ("_", StringComparison.Ordinal))
-                               name = name.Substring (1);
+            if (name.StartsWith ("_", StringComparison.Ordinal))
+                name = name.Substring (1);
 
             foreach (var field in @class.Fields)
             {
@@ -823,8 +826,10 @@ namespace CppSharp
                 if (name == "SgenThreadInfo" && field.Name == "regs")
                     continue;
 
+                var layout = @class.Layout.Fields.First(f => f.FieldPtr == field.OriginalPtr);
+
                 writer.WriteLine("DECL_OFFSET2({0},{1},{2})", name, field.Name,
-                    field.Offset / 8);
+                    layout.Offset);
             }
         }
     }
index d15685302eb4ca05c6a649ecba90f9911b7e6131..73f67534019a237795922f6b7b855ce5e4c8a259 100644 (file)
 #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
        #define HAVE_CLASSIC_WINAPI_SUPPORT 0
        #define HAVE_UWP_WINAPI_SUPPORT 1
+#ifndef HAVE_EXTERN_DEFINED_WINAPI_SUPPORT
+       #error Unsupported WINAPI family
+#endif
 #else
        #define HAVE_CLASSIC_WINAPI_SUPPORT 0
        #define HAVE_UWP_WINAPI_SUPPORT 0
+#ifndef HAVE_EXTERN_DEFINED_WINAPI_SUPPORT
+       #error Unsupported WINAPI family
+#endif
 #endif
 
 #endif