mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 03:51:19 -10:00
Compare commits
114
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42f07c4e6b | ||
|
|
1d1ec7d504 | ||
|
|
5fc8e28ffa | ||
|
|
de60f3b49e | ||
|
|
7f560b39c8 | ||
|
|
73c2e4322e | ||
|
|
13166f48a8 | ||
|
|
e5b06307ca | ||
|
|
be1b671b09 | ||
|
|
817a7e7bf7 | ||
|
|
6279df6d70 | ||
|
|
cbc419bb3e | ||
|
|
39a8a8f8c0 | ||
|
|
3c9a821c7e | ||
|
|
bb900edab1 | ||
|
|
36e3d93a52 | ||
|
|
4b49283a9c | ||
|
|
00ef078380 | ||
|
|
0a3ea22257 | ||
|
|
04419ee95b | ||
|
|
fc339c2777 | ||
|
|
35b2b68bdf | ||
|
|
009d1279a2 | ||
|
|
d8eb6c91a2 | ||
|
|
d451def6a5 | ||
|
|
f95909190c | ||
|
|
fc65bbe329 | ||
|
|
eb6386af15 | ||
|
|
8236cbe950 | ||
|
|
3505d310df | ||
|
|
c0c8d0bec4 | ||
|
|
3872a400b2 | ||
|
|
a6612b4c64 | ||
|
|
4db9028cb9 | ||
|
|
b6e231d521 | ||
|
|
1ec5966c89 | ||
|
|
9280bb5e19 | ||
|
|
d470d1abbf | ||
|
|
0e4d13f5b7 | ||
|
|
933ceae45c | ||
|
|
2f1b9e8aac | ||
|
|
f03dbfcae2 | ||
|
|
d9211fcb50 | ||
|
|
153467c0c6 | ||
|
|
a1cac02732 | ||
|
|
7be144c0b7 | ||
|
|
71936252fe | ||
|
|
ab0791102f | ||
|
|
be24ada60a | ||
|
|
9c991786ac | ||
|
|
019a83f88f | ||
|
|
33697c0568 | ||
|
|
fbb82d3923 | ||
|
|
733b51587e | ||
|
|
f66e71e01b | ||
|
|
262128c941 | ||
|
|
eeb68ca307 | ||
|
|
6471bbd6ef | ||
|
|
96a2b36e82 | ||
|
|
7a704f61c9 | ||
|
|
39150458f0 | ||
|
|
0b522087c2 | ||
|
|
911cc1d438 | ||
|
|
e4b08aa7c9 | ||
|
|
2db07ca754 | ||
|
|
0d8219ea4a | ||
|
|
a38a8e4ad4 | ||
|
|
d0b9d91817 | ||
|
|
fd6d8198f7 | ||
|
|
54260048cc | ||
|
|
34ba13146f | ||
|
|
00ea5f1e17 | ||
|
|
e75b24b807 | ||
|
|
ecf65f0093 | ||
|
|
35cb8bac8a | ||
|
|
33074493a0 | ||
|
|
c5d7419186 | ||
|
|
ccf4d32e12 | ||
|
|
89014568b7 | ||
|
|
9161e4e5a9 | ||
|
|
6ac4a68c46 | ||
|
|
1b5e0f7331 | ||
|
|
c8863e1d31 | ||
|
|
dd951e909a | ||
|
|
3c21a0f3dd | ||
|
|
f031c8fba3 | ||
|
|
442d000b6c | ||
|
|
2cdb7e8648 | ||
|
|
e72203782b | ||
|
|
00e3c897d5 | ||
|
|
52a5acbd88 | ||
|
|
778e04f2d9 | ||
|
|
93ecaeb2c6 | ||
|
|
49df11fd5f | ||
|
|
c8c8b16bfd | ||
|
|
6f83951d1c | ||
|
|
f2ae4658f9 | ||
|
|
faf4fe66af | ||
|
|
998759345f | ||
|
|
c88d2cce1f | ||
|
|
3e589e2c39 | ||
|
|
4c944bc86e | ||
|
|
d3e6c9d17f | ||
|
|
7379ac1bfb | ||
|
|
2a029615aa | ||
|
|
9c345b1b02 | ||
|
|
074a1228cf | ||
|
|
e3596928d8 | ||
|
|
ac71acfd52 | ||
|
|
8909c17d9c | ||
|
|
e5d16f01fd | ||
|
|
9874928b85 | ||
|
|
9e99e20001 | ||
|
|
b3e79ebc05 |
No files matched your search
@@ -26,9 +26,6 @@
|
||||
[submodule "external/nuget-buildtasks"]
|
||||
path = external/nuget-buildtasks
|
||||
url = git://github.com/mono/NuGet.BuildTasks
|
||||
[submodule "external/buildtools"]
|
||||
path = external/buildtools
|
||||
url = git://github.com/mono/buildtools.git
|
||||
[submodule "external/cecil-legacy"]
|
||||
path = external/cecil-legacy
|
||||
url = git://github.com/mono/cecil.git
|
||||
|
||||
+6
-1
@@ -1,7 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#AC_PREREQ([2.62])
|
||||
|
||||
AC_INIT(mono, [5.3.0],
|
||||
AC_INIT(mono, [5.4.0],
|
||||
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
@@ -3534,6 +3534,11 @@ fi
|
||||
|
||||
AM_CONDITIONAL(ENABLE_INTERPRETER, [test x$enable_interpreter = xyes])
|
||||
|
||||
if test "x$enable_interpreter" = "xyes" || test "x$mono_feature_disable_jit" != "xyes"; then
|
||||
AC_DEFINE(HAVE_ONLINE_VES, 1, [Some VES is available at runtime])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_ONLINE_VES, [test x$enable_interpreter = xyes] || [test x$mono_feature_disable_jit != xyes])
|
||||
|
||||
dnl
|
||||
dnl Simple Generational checks (sgen)
|
||||
|
||||
Vendored
+1
-1
Submodule external/api-snapshot updated: c0de20bce4...b09033be33.
Vendored
+1
-1
Submodule external/bockbuild updated: fe467c0593...e7376ae3f0.
Vendored
-1
Submodule external/buildtools deleted from b5cc6e6ab5.
Vendored
+1
-1
Submodule external/cecil updated: f64903c0e0...c76ba7b410.
Vendored
+1
-1
Submodule external/corefx updated: e49886bd09...9ad53d674e.
Vendored
+1
-1
Submodule external/roslyn-binaries updated: 98069dbb17...dcb0a0534d.
Vendored
+1
-1
Submodule external/xunit-binaries updated: b8e20d265b...d4433b0972.
+10
@@ -181,6 +181,16 @@ Gives the path for the temporary LLVM bitcode file created during AOT.
|
||||
.I info
|
||||
Print the architecture the AOT in this copy of Mono targets and quit.
|
||||
.TP
|
||||
.I interp
|
||||
Generates all required wrappers, so that it is possible to run --interpreter without
|
||||
any code generation at runtime. This option only makes sense with \fBmscorlib.dll\fR.
|
||||
Embedders can set
|
||||
|
||||
.nf
|
||||
mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP);
|
||||
.fi
|
||||
.ne
|
||||
.TP
|
||||
.I ld-flags
|
||||
Additional flags to pass to the C linker (if the current AOT mode calls for invoking it).
|
||||
.TP
|
||||
|
||||
@@ -20,9 +20,10 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
|
||||
ifndef NO_TEST
|
||||
|
||||
test_nunit_lib = nunitlite.dll
|
||||
xunit_core := xunit.core xunit.abstractions xunit.assert
|
||||
xunit_core := xunit.core xunit.abstractions xunit.assert Xunit.NetCore.Extensions
|
||||
xunit_deps := System.Runtime
|
||||
xunit_class_deps := Xunit.NetCore.Extensions
|
||||
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs)
|
||||
xunit_class_deps :=
|
||||
|
||||
xunit_libs_ref = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(xunit_core))
|
||||
xunit_libs_ref += $(patsubst %,-r:$(topdir)/class/lib/$(PROFILE)/Facades/%.dll,$(xunit_deps))
|
||||
@@ -89,9 +90,6 @@ endif
|
||||
|
||||
tests_CLEAN_FILES += $(topdir)/build/deps/nunit-$(PROFILE).stamp
|
||||
|
||||
$(topdir)/class/lib/$(PROFILE)/$(PARENT_PROFILE)Xunit.NetCore.Extensions.dll:
|
||||
$(MAKE) -C $(topdir)/class/Xunit.NetCore.Extensions
|
||||
|
||||
endif
|
||||
|
||||
test_assemblies :=
|
||||
@@ -222,8 +220,8 @@ run-xunit-test-lib: xunit-test-local
|
||||
$$ok
|
||||
@rm -f xunit.execution.desktop.dll
|
||||
|
||||
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response)
|
||||
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
|
||||
|
||||
xtest_response_preprocessed = $(xtest_response)_preprocessed
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ namespace Mono.Security.Interface
|
||||
|
||||
void EndWrite (IAsyncResult asyncResult);
|
||||
|
||||
Task ShutdownAsync ();
|
||||
|
||||
TransportContext TransportContext {
|
||||
get;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ Mono.Security.Cryptography/PKCS8Test.cs
|
||||
Mono.Security.Cryptography/RSAManagedTest.cs
|
||||
Mono.Security.Cryptography/SHA224ManagedTest.cs
|
||||
Mono.Security.Cryptography/SHA224Test.cs
|
||||
Mono.Security.Interface/TestProvider.cs
|
||||
Mono.Security.Protocol.Ntlm/ChallengeResponseTest.cs
|
||||
Mono.Security.Protocol.Ntlm/MessageBaseTest.cs
|
||||
Mono.Security.Protocol.Ntlm/Type1MessageTest.cs
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// TestProvider.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2017 Xamarin, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
using Mono.Security;
|
||||
using Mono.Security.Interface;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.Mono.Security
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestProvider
|
||||
{
|
||||
[Test]
|
||||
public void GetProvider ()
|
||||
{
|
||||
var provider = MonoTlsProviderFactory.GetProvider ();
|
||||
Assert.IsNotNull (provider, "TLS Provider");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,19 +310,20 @@ namespace System.IO.MemoryMappedFiles
|
||||
[MonoLimitation ("Named mappings scope is process local")]
|
||||
public static MemoryMappedFile OpenExisting (string mapName)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return OpenExisting (mapName, MemoryMappedFileRights.ReadWrite);
|
||||
}
|
||||
|
||||
[MonoLimitation ("Named mappings scope is process local")]
|
||||
public static MemoryMappedFile OpenExisting (string mapName, MemoryMappedFileRights desiredAccessRights)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return OpenExisting (mapName, desiredAccessRights, HandleInheritability.None);
|
||||
}
|
||||
|
||||
[MonoLimitation ("Named mappings scope is process local")]
|
||||
public static MemoryMappedFile OpenExisting (string mapName, MemoryMappedFileRights desiredAccessRights, HandleInheritability inheritability)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
// FIXME: Actually use desiredAccessRights
|
||||
return CoreShmCreate (mapName, 0, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None, null, inheritability, FileMode.Open);
|
||||
}
|
||||
|
||||
public MemoryMappedViewStream CreateViewStream ()
|
||||
@@ -393,10 +394,9 @@ namespace System.IO.MemoryMappedFiles
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public SafeMemoryMappedFileHandle SafeMemoryMappedFileHandle {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -301,9 +301,12 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
|
||||
var name = MkNamedMapping ();
|
||||
using (var m0 = MemoryMappedFile.CreateNew(name, 4096, MemoryMappedFileAccess.ReadWrite)) {
|
||||
using (var m1 = MemoryMappedFile.CreateOrOpen (name, 4096, MemoryMappedFileAccess.ReadWrite)) {
|
||||
using (MemoryMappedViewAccessor v0 = m0.CreateViewAccessor (), v1 = m1.CreateViewAccessor ()) {
|
||||
v0.Write (10, 0x12345);
|
||||
Assert.AreEqual (0x12345, v1.ReadInt32 (10));
|
||||
using (var m2 = MemoryMappedFile.OpenExisting (name)) {
|
||||
using (MemoryMappedViewAccessor v0 = m0.CreateViewAccessor (), v1 = m1.CreateViewAccessor (), v2 = m2.CreateViewAccessor ()) {
|
||||
v0.Write (10, 0x12345);
|
||||
Assert.AreEqual (0x12345, v1.ReadInt32 (10));
|
||||
Assert.AreEqual (0x12345, v2.ReadInt32 (10));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -466,5 +469,13 @@ namespace MonoTests.System.IO.MemoryMappedFiles {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void OpenExistingWithNoExistingThrows()
|
||||
{
|
||||
Assert.Throws<FileNotFoundException>(() => {
|
||||
MemoryMappedFile.OpenExisting (MkNamedMapping ());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
../../../external/corefx/src/Common/tests/System/AssertExtensions.cs
|
||||
../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
|
||||
|
||||
# ../../../external/corefx/src/System.Runtime.Numerics/tests/*.cs
|
||||
|
||||
@@ -36,7 +36,11 @@ namespace Mono.AppleTls
|
||||
*/
|
||||
var certificate2 = certificate as X509Certificate2;
|
||||
if (certificate2 != null)
|
||||
#if MONOTOUCH
|
||||
return SecIdentity.Import (certificate2);
|
||||
#else
|
||||
return SecImportExport.ItemImport (certificate2);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Reading Certificates from the Mac Keychain
|
||||
|
||||
@@ -848,12 +848,12 @@ namespace Mono.AppleTls
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static /* OSStatus */ SslStatus SSLClose (/* SSLContextRef */ IntPtr context);
|
||||
|
||||
public override void Close ()
|
||||
public override void Shutdown ()
|
||||
{
|
||||
if (Interlocked.Exchange (ref pendingIO, 1) == 1)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
Debug ("Close");
|
||||
Debug ("Shutdown");
|
||||
|
||||
lastException = null;
|
||||
|
||||
@@ -862,7 +862,7 @@ namespace Mono.AppleTls
|
||||
return;
|
||||
|
||||
var status = SSLClose (Handle);
|
||||
Debug ("Close done: {0}", status);
|
||||
Debug ("Shutdown done: {0}", status);
|
||||
CheckStatusAndThrow (status);
|
||||
} finally {
|
||||
closed = true;
|
||||
|
||||
@@ -38,12 +38,12 @@ namespace Mono.AppleTls
|
||||
}
|
||||
|
||||
protected override MNS.MobileTlsContext CreateContext (
|
||||
MNS.MobileAuthenticatedStream parent, bool serverMode, string targetHost,
|
||||
SslProtocols enabledProtocols, X509Certificate serverCertificate,
|
||||
X509CertificateCollection clientCertificates, bool askForClientCert)
|
||||
bool serverMode, string targetHost, SslProtocols enabledProtocols,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool askForClientCert)
|
||||
{
|
||||
return new AppleTlsContext (
|
||||
parent, serverMode, targetHost,
|
||||
this, serverMode, targetHost,
|
||||
enabledProtocols, serverCertificate,
|
||||
clientCertificates, askForClientCert);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace Mono.AppleTls {
|
||||
return code;
|
||||
}
|
||||
|
||||
#if !MONOTOUCH
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
extern static SecStatusCode SecItemImport (
|
||||
/* CFDataRef */ IntPtr importedData,
|
||||
@@ -217,6 +218,7 @@ namespace Mono.AppleTls {
|
||||
IntPtr keyUsage;
|
||||
IntPtr keyAttributes;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -316,6 +316,9 @@ namespace Mono.Btls
|
||||
if (status == MonoBtlsSslError.WantRead) {
|
||||
wantMore = true;
|
||||
return 0;
|
||||
} else if (status == MonoBtlsSslError.ZeroReturn) {
|
||||
wantMore = false;
|
||||
return size;
|
||||
} else if (status != MonoBtlsSslError.None) {
|
||||
throw GetException (status);
|
||||
}
|
||||
@@ -358,26 +361,11 @@ namespace Mono.Btls
|
||||
}
|
||||
}
|
||||
|
||||
public override void Close ()
|
||||
public override void Shutdown ()
|
||||
{
|
||||
Debug ("Close!");
|
||||
|
||||
if (ssl != null) {
|
||||
ssl.Dispose ();
|
||||
ssl = null;
|
||||
}
|
||||
if (ctx != null) {
|
||||
ctx.Dispose ();
|
||||
ctx = null;
|
||||
}
|
||||
if (bio != null) {
|
||||
bio.Dispose ();
|
||||
bio = null;
|
||||
}
|
||||
if (errbio != null) {
|
||||
errbio.Dispose ();
|
||||
errbio = null;
|
||||
}
|
||||
Debug ("Shutdown!");
|
||||
// ssl.SetQuietShutdown ();
|
||||
ssl.Shutdown ();
|
||||
}
|
||||
|
||||
void Dispose<T> (ref T disposable)
|
||||
@@ -397,12 +385,12 @@ namespace Mono.Btls
|
||||
{
|
||||
try {
|
||||
if (disposing) {
|
||||
Dispose (ref ssl);
|
||||
Dispose (ref ctx);
|
||||
Dispose (ref remoteCertificate);
|
||||
Dispose (ref nativeServerCertificate);
|
||||
Dispose (ref nativeClientCertificate);
|
||||
Dispose (ref clientCertificate);
|
||||
Dispose (ref ctx);
|
||||
Dispose (ref ssl);
|
||||
Dispose (ref bio);
|
||||
Dispose (ref errbio);
|
||||
}
|
||||
|
||||
@@ -102,6 +102,20 @@ namespace Mono.Btls
|
||||
CheckError (ret == 1, callerName);
|
||||
}
|
||||
|
||||
protected internal void CheckLastError ([CallerMemberName] string callerName = null)
|
||||
{
|
||||
var error = Interlocked.Exchange (ref lastError, null);
|
||||
if (error == null)
|
||||
return;
|
||||
|
||||
string message;
|
||||
if (callerName != null)
|
||||
message = string.Format ("Caught unhandled exception in {0}.{1}.", GetType ().Name, callerName);
|
||||
else
|
||||
message = string.Format ("Caught unhandled exception.");
|
||||
throw new MonoBtlsException (message, error);
|
||||
}
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static void mono_btls_free (IntPtr data);
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace Mono.Btls
|
||||
protected override bool ReleaseHandle ()
|
||||
{
|
||||
mono_btls_ssl_destroy (handle);
|
||||
handle = IntPtr.Zero;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -78,6 +79,12 @@ namespace Mono.Btls
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static void mono_btls_ssl_close (IntPtr handle);
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static int mono_btls_ssl_shutdown (IntPtr handle);
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static void mono_btls_ssl_set_quiet_shutdown (IntPtr handle, int mode);
|
||||
|
||||
[DllImport (BTLS_DYLIB)]
|
||||
extern static void mono_btls_ssl_set_bio (IntPtr handle, IntPtr bio);
|
||||
|
||||
@@ -131,6 +138,7 @@ namespace Mono.Btls
|
||||
return new BoringSslHandle (handle);
|
||||
}
|
||||
|
||||
MonoBtlsBio bio;
|
||||
PrintErrorsCallbackFunc printErrorsFunc;
|
||||
IntPtr printErrorsFuncPtr;
|
||||
|
||||
@@ -148,6 +156,7 @@ namespace Mono.Btls
|
||||
public void SetBio (MonoBtlsBio bio)
|
||||
{
|
||||
CheckThrow ();
|
||||
this.bio = bio;
|
||||
mono_btls_ssl_set_bio (
|
||||
Handle.DangerousGetHandle (),
|
||||
bio.Handle.DangerousGetHandle ());
|
||||
@@ -164,18 +173,17 @@ namespace Mono.Btls
|
||||
errors = null;
|
||||
}
|
||||
|
||||
if (errors != null) {
|
||||
Console.Error.WriteLine ("ERROR: {0} failed: {1}", callerName, errors);
|
||||
if (errors != null)
|
||||
throw new MonoBtlsException ("{0} failed: {1}.", callerName, errors);
|
||||
} else {
|
||||
Console.Error.WriteLine ("ERROR: {0} failed.", callerName);
|
||||
else
|
||||
throw new MonoBtlsException ("{0} failed.", callerName);
|
||||
}
|
||||
}
|
||||
|
||||
MonoBtlsSslError GetError (int ret_code)
|
||||
{
|
||||
CheckThrow ();
|
||||
bio.CheckLastError ();
|
||||
|
||||
var error = mono_btls_ssl_get_error (
|
||||
Handle.DangerousGetHandle (), ret_code);
|
||||
return (MonoBtlsSslError)error;
|
||||
@@ -287,15 +295,20 @@ namespace Mono.Btls
|
||||
var ret = mono_btls_ssl_read (
|
||||
Handle.DangerousGetHandle (), data, dataSize);
|
||||
|
||||
if (ret >= 0) {
|
||||
if (ret > 0) {
|
||||
dataSize = ret;
|
||||
return MonoBtlsSslError.None;
|
||||
}
|
||||
|
||||
var error = mono_btls_ssl_get_error (
|
||||
Handle.DangerousGetHandle (), ret);
|
||||
var error = GetError (ret);
|
||||
if (ret == 0 && error == MonoBtlsSslError.Syscall) {
|
||||
// End-of-stream
|
||||
dataSize = 0;
|
||||
return MonoBtlsSslError.None;
|
||||
}
|
||||
|
||||
dataSize = 0;
|
||||
return (MonoBtlsSslError)error;
|
||||
return error;
|
||||
}
|
||||
|
||||
public MonoBtlsSslError Write (IntPtr data, ref int dataSize)
|
||||
@@ -416,9 +429,24 @@ namespace Mono.Btls
|
||||
return Marshal.PtrToStringAnsi (namePtr);
|
||||
}
|
||||
|
||||
public void Shutdown ()
|
||||
{
|
||||
CheckThrow ();
|
||||
var ret = mono_btls_ssl_shutdown (Handle.DangerousGetHandle ());
|
||||
if (ret < 0)
|
||||
throw ThrowError ();
|
||||
}
|
||||
|
||||
public void SetQuietShutdown ()
|
||||
{
|
||||
CheckThrow ();
|
||||
mono_btls_ssl_set_quiet_shutdown (Handle.DangerousGetHandle (), 1);
|
||||
}
|
||||
|
||||
protected override void Close ()
|
||||
{
|
||||
mono_btls_ssl_close (Handle.DangerousGetHandle ());
|
||||
if (!Handle.IsInvalid)
|
||||
mono_btls_ssl_close (Handle.DangerousGetHandle ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,12 +53,12 @@ namespace Mono.Btls
|
||||
}
|
||||
|
||||
protected override MNS.MobileTlsContext CreateContext (
|
||||
MNS.MobileAuthenticatedStream parent, bool serverMode, string targetHost,
|
||||
SslProtocols enabledProtocols, X509Certificate serverCertificate,
|
||||
X509CertificateCollection clientCertificates, bool askForClientCert)
|
||||
bool serverMode, string targetHost, SslProtocols enabledProtocols,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool askForClientCert)
|
||||
{
|
||||
return new MonoBtlsContext (
|
||||
parent, serverMode, targetHost,
|
||||
this, serverMode, targetHost,
|
||||
enabledProtocols, serverCertificate,
|
||||
clientCertificates, askForClientCert);
|
||||
}
|
||||
|
||||
@@ -11,14 +11,14 @@ using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Security.Authentication;
|
||||
using SD = System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.ExceptionServices;
|
||||
|
||||
namespace Mono.Net.Security
|
||||
{
|
||||
delegate AsyncOperationStatus AsyncOperation (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status);
|
||||
|
||||
class BufferOffsetSize
|
||||
{
|
||||
public byte[] Buffer;
|
||||
@@ -37,6 +37,13 @@ namespace Mono.Net.Security
|
||||
|
||||
public BufferOffsetSize (byte[] buffer, int offset, int size)
|
||||
{
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException (nameof (buffer));
|
||||
if (offset < 0)
|
||||
throw new ArgumentOutOfRangeException (nameof (offset));
|
||||
if (size < 0 || offset + size > buffer.Length)
|
||||
throw new ArgumentOutOfRangeException (nameof (size));
|
||||
|
||||
Buffer = buffer;
|
||||
Offset = offset;
|
||||
Size = size;
|
||||
@@ -54,7 +61,7 @@ namespace Mono.Net.Security
|
||||
public readonly int InitialSize;
|
||||
|
||||
public BufferOffsetSize2 (int size)
|
||||
: base (new byte [size], 0, 0)
|
||||
: base (new byte[size], 0, 0)
|
||||
{
|
||||
InitialSize = size;
|
||||
}
|
||||
@@ -63,7 +70,7 @@ namespace Mono.Net.Security
|
||||
{
|
||||
Offset = Size = 0;
|
||||
TotalBytes = 0;
|
||||
Buffer = new byte [InitialSize];
|
||||
Buffer = new byte[InitialSize];
|
||||
Complete = false;
|
||||
}
|
||||
|
||||
@@ -74,11 +81,11 @@ namespace Mono.Net.Security
|
||||
|
||||
int missing = size - Remaining;
|
||||
if (Offset == 0 && Size == 0) {
|
||||
Buffer = new byte [size];
|
||||
Buffer = new byte[size];
|
||||
return;
|
||||
}
|
||||
|
||||
var buffer = new byte [Buffer.Length + missing];
|
||||
var buffer = new byte[Buffer.Length + missing];
|
||||
Buffer.CopyTo (buffer, 0);
|
||||
Buffer = buffer;
|
||||
}
|
||||
@@ -91,201 +98,296 @@ namespace Mono.Net.Security
|
||||
}
|
||||
}
|
||||
|
||||
enum AsyncOperationStatus {
|
||||
NotStarted,
|
||||
enum AsyncOperationStatus
|
||||
{
|
||||
Initialize,
|
||||
Continue,
|
||||
Running,
|
||||
Complete,
|
||||
WantRead,
|
||||
WantWrite,
|
||||
ReadDone,
|
||||
FinishWrite
|
||||
Complete
|
||||
}
|
||||
|
||||
class AsyncProtocolRequest
|
||||
class AsyncProtocolResult
|
||||
{
|
||||
public readonly MobileAuthenticatedStream Parent;
|
||||
public readonly BufferOffsetSize UserBuffer;
|
||||
|
||||
int RequestedSize;
|
||||
public int CurrentSize;
|
||||
public int UserResult;
|
||||
|
||||
AsyncOperation Operation;
|
||||
int Status;
|
||||
|
||||
public readonly int ID = ++next_id;
|
||||
static int next_id;
|
||||
|
||||
public readonly LazyAsyncResult UserAsyncResult;
|
||||
|
||||
public AsyncProtocolRequest (MobileAuthenticatedStream parent, LazyAsyncResult lazyResult, BufferOffsetSize userBuffer = null)
|
||||
{
|
||||
Parent = parent;
|
||||
UserAsyncResult = lazyResult;
|
||||
UserBuffer = userBuffer;
|
||||
public int UserResult {
|
||||
get;
|
||||
}
|
||||
public ExceptionDispatchInfo Error {
|
||||
get;
|
||||
}
|
||||
|
||||
public bool CompleteWithError (Exception ex)
|
||||
public AsyncProtocolResult (int result)
|
||||
{
|
||||
Status = (int)AsyncOperationStatus.Complete;
|
||||
if (UserAsyncResult == null)
|
||||
return true;
|
||||
if (!UserAsyncResult.InternalPeekCompleted)
|
||||
UserAsyncResult.InvokeCallback (ex);
|
||||
return false;
|
||||
UserResult = result;
|
||||
}
|
||||
|
||||
public AsyncProtocolResult (ExceptionDispatchInfo error)
|
||||
{
|
||||
Error = error;
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AsyncProtocolRequest
|
||||
{
|
||||
public MobileAuthenticatedStream Parent {
|
||||
get;
|
||||
}
|
||||
|
||||
public bool RunSynchronously {
|
||||
get;
|
||||
}
|
||||
|
||||
public int ID => ++next_id;
|
||||
|
||||
public string Name => GetType ().Name;
|
||||
|
||||
public int UserResult {
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
int Started;
|
||||
int RequestedSize;
|
||||
int WriteRequested;
|
||||
readonly object locker = new object ();
|
||||
|
||||
static int next_id;
|
||||
|
||||
public AsyncProtocolRequest (MobileAuthenticatedStream parent, bool sync)
|
||||
{
|
||||
Parent = parent;
|
||||
RunSynchronously = sync;
|
||||
}
|
||||
|
||||
[SD.Conditional ("MARTIN_DEBUG")]
|
||||
protected void Debug (string message, params object[] args)
|
||||
{
|
||||
Parent.Debug ("AsyncProtocolRequest({0}:{1}): {2}", Parent.ID, ID, string.Format (message, args));
|
||||
Parent.Debug ("{0}({1}:{2}): {3}", Name, Parent.ID, ID, string.Format (message, args));
|
||||
}
|
||||
|
||||
internal void RequestRead (int size)
|
||||
{
|
||||
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantRead, (int)AsyncOperationStatus.Running);
|
||||
Debug ("RequestRead: {0} {1}", oldStatus, size);
|
||||
if (oldStatus == AsyncOperationStatus.Running)
|
||||
RequestedSize = size;
|
||||
else if (oldStatus == AsyncOperationStatus.WantRead)
|
||||
lock (locker) {
|
||||
RequestedSize += size;
|
||||
else if (oldStatus != AsyncOperationStatus.WantWrite)
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
internal void ResetRead ()
|
||||
{
|
||||
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantRead);
|
||||
Debug ("ResetRead: {0} {1}", oldStatus, Status);
|
||||
}
|
||||
|
||||
internal void ResetWrite ()
|
||||
{
|
||||
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantWrite);
|
||||
Debug ("ResetWrite: {0} {1}", oldStatus, Status);
|
||||
Debug ("RequestRead: {0}", size);
|
||||
}
|
||||
}
|
||||
|
||||
internal void RequestWrite ()
|
||||
{
|
||||
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantWrite, (int)AsyncOperationStatus.Running);
|
||||
Debug ("RequestWrite: {0} {1}", oldStatus, Status);
|
||||
if (oldStatus == AsyncOperationStatus.Running)
|
||||
return;
|
||||
else if (oldStatus != AsyncOperationStatus.WantRead && oldStatus != AsyncOperationStatus.WantWrite)
|
||||
throw new InvalidOperationException ();
|
||||
WriteRequested = 1;
|
||||
}
|
||||
|
||||
internal void StartOperation (AsyncOperation operation)
|
||||
internal async Task<AsyncProtocolResult> StartOperation (CancellationToken cancellationToken)
|
||||
{
|
||||
Debug ("Start Operation: {0} {1}", Status, operation);
|
||||
if (Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Initialize, (int)AsyncOperationStatus.NotStarted) != (int)AsyncOperationStatus.NotStarted)
|
||||
Debug ("Start Operation: {0}", this);
|
||||
if (Interlocked.CompareExchange (ref Started, 1, 0) != 0)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
Operation = operation;
|
||||
|
||||
if (UserAsyncResult == null) {
|
||||
StartOperation ();
|
||||
return;
|
||||
}
|
||||
|
||||
ThreadPool.QueueUserWorkItem (_ => StartOperation ());
|
||||
}
|
||||
|
||||
void StartOperation ()
|
||||
{
|
||||
try {
|
||||
ProcessOperation ();
|
||||
if (UserAsyncResult != null && !UserAsyncResult.InternalPeekCompleted)
|
||||
UserAsyncResult.InvokeCallback (UserResult);
|
||||
await ProcessOperation (cancellationToken).ConfigureAwait (false);
|
||||
return new AsyncProtocolResult (UserResult);
|
||||
} catch (Exception ex) {
|
||||
if (UserAsyncResult == null)
|
||||
throw;
|
||||
if (!UserAsyncResult.InternalPeekCompleted)
|
||||
UserAsyncResult.InvokeCallback (ex);
|
||||
var info = Parent.SetException (MobileAuthenticatedStream.GetSSPIException (ex));
|
||||
return new AsyncProtocolResult (info);
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessOperation ()
|
||||
async Task ProcessOperation (CancellationToken cancellationToken)
|
||||
{
|
||||
AsyncOperationStatus status;
|
||||
do {
|
||||
status = (AsyncOperationStatus)Interlocked.Exchange (ref Status, (int)AsyncOperationStatus.Running);
|
||||
|
||||
var status = AsyncOperationStatus.Initialize;
|
||||
while (status != AsyncOperationStatus.Complete) {
|
||||
cancellationToken.ThrowIfCancellationRequested ();
|
||||
Debug ("ProcessOperation: {0}", status);
|
||||
|
||||
status = ProcessOperation (status);
|
||||
|
||||
Debug ("ProcessOperation done: {0}", status);
|
||||
|
||||
AsyncOperationStatus oldStatus;
|
||||
if (status == AsyncOperationStatus.Complete) {
|
||||
oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.FinishWrite, (int)AsyncOperationStatus.WantWrite);
|
||||
if (oldStatus == AsyncOperationStatus.WantWrite) {
|
||||
// We are done, but still need to flush the write queue.
|
||||
status = AsyncOperationStatus.FinishWrite;
|
||||
continue;
|
||||
var ret = await InnerRead (cancellationToken).ConfigureAwait (false);
|
||||
if (ret != null) {
|
||||
if (ret == 0) {
|
||||
// End-of-stream
|
||||
Debug ("END OF STREAM!");
|
||||
status = AsyncOperationStatus.ReadDone;
|
||||
} else if (ret < 0) {
|
||||
// remote prematurely closed connection.
|
||||
throw new IOException ("Remote prematurely closed connection.");
|
||||
}
|
||||
}
|
||||
|
||||
oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running);
|
||||
Debug ("ProcessOperation done: {0} -> {1}", oldStatus, status);
|
||||
Debug ("ProcessOperation run: {0}", status);
|
||||
|
||||
if (oldStatus != AsyncOperationStatus.Running) {
|
||||
if (status == oldStatus || status == AsyncOperationStatus.Continue || status == AsyncOperationStatus.Complete)
|
||||
status = oldStatus;
|
||||
else
|
||||
throw new InvalidOperationException ();
|
||||
AsyncOperationStatus newStatus;
|
||||
switch (status) {
|
||||
case AsyncOperationStatus.Initialize:
|
||||
case AsyncOperationStatus.Continue:
|
||||
case AsyncOperationStatus.ReadDone:
|
||||
newStatus = Run (status);
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
} while (status != AsyncOperationStatus.Complete);
|
||||
|
||||
if (Interlocked.Exchange (ref WriteRequested, 0) != 0) {
|
||||
// Flush the write queue.
|
||||
await Parent.InnerWrite (RunSynchronously, cancellationToken);
|
||||
}
|
||||
|
||||
Debug ("ProcessOperation done: {0} -> {1}", status, newStatus);
|
||||
|
||||
status = newStatus;
|
||||
}
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessOperation (AsyncOperationStatus status)
|
||||
async Task<int?> InnerRead (CancellationToken cancellationToken)
|
||||
{
|
||||
if (status == AsyncOperationStatus.WantRead) {
|
||||
if (RequestedSize < 0)
|
||||
int? totalRead = null;
|
||||
var requestedSize = Interlocked.Exchange (ref RequestedSize, 0);
|
||||
while (requestedSize > 0) {
|
||||
Debug ("ProcessOperation - read inner: {0}", requestedSize);
|
||||
|
||||
var ret = await Parent.InnerRead (RunSynchronously, requestedSize, cancellationToken).ConfigureAwait (false);
|
||||
Debug ("ProcessOperation - read inner done: {0} - {1}", requestedSize, ret);
|
||||
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
if (ret > requestedSize)
|
||||
throw new InvalidOperationException ();
|
||||
else if (RequestedSize == 0)
|
||||
return AsyncOperationStatus.Continue;
|
||||
|
||||
Debug ("ProcessOperation - read inner: {0}", RequestedSize);
|
||||
var ret = Parent.InnerRead (RequestedSize);
|
||||
Debug ("ProcessOperation - read inner done: {0} - {1}", RequestedSize, ret);
|
||||
totalRead += ret;
|
||||
requestedSize -= ret;
|
||||
var newRequestedSize = Interlocked.Exchange (ref RequestedSize, 0);
|
||||
requestedSize += newRequestedSize;
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
return AsyncOperationStatus.ReadDone;
|
||||
return totalRead;
|
||||
}
|
||||
|
||||
RequestedSize -= ret;
|
||||
/*
|
||||
* This will operate on the internal buffers and never block.
|
||||
*/
|
||||
protected abstract AsyncOperationStatus Run (AsyncOperationStatus status);
|
||||
|
||||
if (ret == 0 || RequestedSize == 0)
|
||||
return AsyncOperationStatus.Continue;
|
||||
else
|
||||
return AsyncOperationStatus.WantRead;
|
||||
} else if (status == AsyncOperationStatus.WantWrite) {
|
||||
Debug ("ProcessOperation - want write");
|
||||
Parent.InnerWrite ();
|
||||
Debug ("ProcessOperation - want write done");
|
||||
return AsyncOperationStatus.Continue;
|
||||
} else if (status == AsyncOperationStatus.Initialize || status == AsyncOperationStatus.Continue) {
|
||||
Debug ("ProcessOperation - continue");
|
||||
status = Operation (this, status);
|
||||
Debug ("ProcessOperation - continue done: {0}", status);
|
||||
return status;
|
||||
} else if (status == AsyncOperationStatus.ReadDone) {
|
||||
Debug ("ProcessOperation - read done");
|
||||
status = Operation (this, status);
|
||||
Debug ("ProcessOperation - read done: {0}", status);
|
||||
return status;
|
||||
} else if (status == AsyncOperationStatus.FinishWrite) {
|
||||
Debug ("ProcessOperation - finish write");
|
||||
Parent.InnerWrite ();
|
||||
Debug ("ProcessOperation - finish write done");
|
||||
public override string ToString ()
|
||||
{
|
||||
return string.Format ("[{0}]", Name);
|
||||
}
|
||||
}
|
||||
|
||||
class AsyncHandshakeRequest : AsyncProtocolRequest
|
||||
{
|
||||
public AsyncHandshakeRequest (MobileAuthenticatedStream parent, bool sync)
|
||||
: base (parent, sync)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
|
||||
{
|
||||
return Parent.ProcessHandshake (status);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AsyncReadOrWriteRequest : AsyncProtocolRequest
|
||||
{
|
||||
protected BufferOffsetSize UserBuffer {
|
||||
get;
|
||||
}
|
||||
|
||||
protected int CurrentSize {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public AsyncReadOrWriteRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
|
||||
: base (parent, sync)
|
||||
{
|
||||
UserBuffer = new BufferOffsetSize (buffer, offset, size);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return string.Format ("[{0}: {1}]", Name, UserBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
class AsyncReadRequest : AsyncReadOrWriteRequest
|
||||
{
|
||||
public AsyncReadRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
|
||||
: base (parent, sync, buffer, offset, size)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessRead - read user: {0} {1}", this, status);
|
||||
|
||||
var (ret, wantMore) = Parent.ProcessRead (UserBuffer);
|
||||
|
||||
Debug ("ProcessRead - read user done: {0} - {1} {2}", this, ret, wantMore);
|
||||
|
||||
if (ret < 0) {
|
||||
UserResult = -1;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
throw new InvalidOperationException ();
|
||||
CurrentSize += ret;
|
||||
UserBuffer.Offset += ret;
|
||||
UserBuffer.Size -= ret;
|
||||
|
||||
Debug ("Process Read - read user done #1: {0} - {1} {2}", this, CurrentSize, wantMore);
|
||||
|
||||
if (wantMore && CurrentSize == 0)
|
||||
return AsyncOperationStatus.Continue;
|
||||
|
||||
UserResult = CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
}
|
||||
|
||||
class AsyncWriteRequest : AsyncReadOrWriteRequest
|
||||
{
|
||||
public AsyncWriteRequest (MobileAuthenticatedStream parent, bool sync, byte[] buffer, int offset, int size)
|
||||
: base (parent, sync, buffer, offset, size)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessWrite - write user: {0} {1}", this, status);
|
||||
|
||||
if (UserBuffer.Size == 0) {
|
||||
UserResult = CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
var (ret, wantMore) = Parent.ProcessWrite (UserBuffer);
|
||||
|
||||
Debug ("ProcessWrite - write user done: {0} - {1} {2}", this, ret, wantMore);
|
||||
|
||||
if (ret < 0) {
|
||||
UserResult = -1;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
CurrentSize += ret;
|
||||
UserBuffer.Offset += ret;
|
||||
UserBuffer.Size -= ret;
|
||||
|
||||
if (wantMore)
|
||||
return AsyncOperationStatus.Continue;
|
||||
|
||||
UserResult = CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
}
|
||||
|
||||
class AsyncShutdownRequest : AsyncProtocolRequest
|
||||
{
|
||||
public AsyncShutdownRequest (MobileAuthenticatedStream parent)
|
||||
: base (parent, false)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AsyncOperationStatus Run (AsyncOperationStatus status)
|
||||
{
|
||||
return Parent.ProcessShutdown (status);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -575,6 +575,11 @@ namespace Mono.Net.Security.Private
|
||||
|
||||
#region IMonoSslStream
|
||||
|
||||
Task IMonoSslStream.ShutdownAsync ()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
AuthenticatedStream IMonoSslStream.AuthenticatedStream {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Globalization;
|
||||
using System.Security.Authentication;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -36,8 +37,13 @@ namespace Mono.Net.Security
|
||||
{
|
||||
abstract class MobileAuthenticatedStream : AuthenticatedStream, MSI.IMonoSslStream
|
||||
{
|
||||
/*
|
||||
* This is intentionally called `xobileTlsContext'. It is a "dangerous" object
|
||||
* that must not be touched outside the `ioLock' and we need to be very careful
|
||||
* where we access it.
|
||||
*/
|
||||
MobileTlsContext xobileTlsContext;
|
||||
Exception lastException;
|
||||
ExceptionDispatchInfo lastException;
|
||||
|
||||
AsyncProtocolRequest asyncHandshakeRequest;
|
||||
AsyncProtocolRequest asyncReadRequest;
|
||||
@@ -47,11 +53,12 @@ namespace Mono.Net.Security
|
||||
|
||||
object ioLock = new object ();
|
||||
int closeRequested;
|
||||
bool shutdown;
|
||||
|
||||
static int uniqueNameInteger = 123;
|
||||
|
||||
public MobileAuthenticatedStream (Stream innerStream, bool leaveInnerStreamOpen, SslStream owner,
|
||||
MSI.MonoTlsSettings settings, MSI.MonoTlsProvider provider)
|
||||
MSI.MonoTlsSettings settings, MSI.MonoTlsProvider provider)
|
||||
: base (innerStream, leaveInnerStreamOpen)
|
||||
{
|
||||
SslStream = owner;
|
||||
@@ -78,42 +85,47 @@ namespace Mono.Net.Security
|
||||
get { return xobileTlsContext != null; }
|
||||
}
|
||||
|
||||
internal MobileTlsContext Context {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
return xobileTlsContext;
|
||||
}
|
||||
}
|
||||
|
||||
internal void CheckThrow (bool authSuccessCheck)
|
||||
internal void CheckThrow (bool authSuccessCheck, bool shutdownCheck = false)
|
||||
{
|
||||
if (closeRequested != 0)
|
||||
throw new InvalidOperationException ("Stream is closed.");
|
||||
if (lastException != null)
|
||||
throw lastException;
|
||||
lastException.Throw ();
|
||||
if (authSuccessCheck && !IsAuthenticated)
|
||||
throw new InvalidOperationException ("Must be authenticated.");
|
||||
throw new InvalidOperationException (SR.net_auth_noauth);
|
||||
if (shutdownCheck && shutdown)
|
||||
throw new InvalidOperationException (SR.net_ssl_io_already_shutdown);
|
||||
}
|
||||
|
||||
Exception SetException (Exception e)
|
||||
internal static Exception GetSSPIException (Exception e)
|
||||
{
|
||||
e = SetException_internal (e);
|
||||
if (e != null && xobileTlsContext != null)
|
||||
xobileTlsContext.Dispose ();
|
||||
return e;
|
||||
if (e is OperationCanceledException || e is IOException || e is ObjectDisposedException || e is AuthenticationException)
|
||||
return e;
|
||||
return new AuthenticationException (SR.net_auth_SSPI, e);
|
||||
}
|
||||
|
||||
Exception SetException_internal (Exception e)
|
||||
internal static Exception GetIOException (Exception e, string message)
|
||||
{
|
||||
if (lastException == null)
|
||||
lastException = e;
|
||||
return lastException;
|
||||
if (e is OperationCanceledException || e is IOException || e is ObjectDisposedException || e is AuthenticationException)
|
||||
return e;
|
||||
return new IOException (message, e);
|
||||
}
|
||||
|
||||
internal ExceptionDispatchInfo SetException (Exception e)
|
||||
{
|
||||
var info = ExceptionDispatchInfo.Capture (e);
|
||||
var old = Interlocked.CompareExchange (ref lastException, info, null);
|
||||
return old ?? info;
|
||||
}
|
||||
|
||||
SslProtocols DefaultProtocols {
|
||||
get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
|
||||
}
|
||||
|
||||
enum OperationType {
|
||||
Read,
|
||||
Write,
|
||||
Shutdown
|
||||
}
|
||||
|
||||
public void AuthenticateAsClient (string targetHost)
|
||||
{
|
||||
AuthenticateAsClient (targetHost, new X509CertificateCollection (), DefaultProtocols, false);
|
||||
@@ -121,8 +133,8 @@ namespace Mono.Net.Security
|
||||
|
||||
public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
ValidateCreateContext (false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
ProcessAuthentication (null);
|
||||
var task = ProcessAuthentication (true, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
task.Wait ();
|
||||
}
|
||||
|
||||
public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
|
||||
@@ -132,15 +144,13 @@ namespace Mono.Net.Security
|
||||
|
||||
public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
ValidateCreateContext (false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
var result = new LazyAsyncResult (this, asyncState, asyncCallback);
|
||||
ProcessAuthentication (result);
|
||||
return result;
|
||||
var task = ProcessAuthentication (false, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
return TaskToApm.Begin (task, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public void EndAuthenticateAsClient (IAsyncResult asyncResult)
|
||||
{
|
||||
EndProcessAuthentication (asyncResult);
|
||||
TaskToApm.End (asyncResult);
|
||||
}
|
||||
|
||||
public void AuthenticateAsServer (X509Certificate serverCertificate)
|
||||
@@ -150,8 +160,8 @@ namespace Mono.Net.Security
|
||||
|
||||
public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
ValidateCreateContext (true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
ProcessAuthentication (null);
|
||||
var task = ProcessAuthentication (true, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
task.Wait ();
|
||||
}
|
||||
|
||||
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
|
||||
@@ -161,218 +171,214 @@ namespace Mono.Net.Security
|
||||
|
||||
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
ValidateCreateContext (true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
var result = new LazyAsyncResult (this, asyncState, asyncCallback);
|
||||
ProcessAuthentication (result);
|
||||
return result;
|
||||
var task = ProcessAuthentication (false, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
return TaskToApm.Begin (task, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public void EndAuthenticateAsServer (IAsyncResult asyncResult)
|
||||
{
|
||||
EndProcessAuthentication (asyncResult);
|
||||
TaskToApm.End (asyncResult);
|
||||
}
|
||||
|
||||
public Task AuthenticateAsClientAsync (string targetHost)
|
||||
{
|
||||
return Task.Factory.FromAsync (BeginAuthenticateAsClient, EndAuthenticateAsClient, targetHost, null);
|
||||
return ProcessAuthentication (false, false, targetHost, DefaultProtocols, null, null, false);
|
||||
}
|
||||
|
||||
public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
return Task.Factory.FromAsync ((callback, state) => BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsClient, null);
|
||||
return ProcessAuthentication (false, false, targetHost, enabledSslProtocols, null, clientCertificates, false);
|
||||
}
|
||||
|
||||
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
|
||||
{
|
||||
return Task.Factory.FromAsync (BeginAuthenticateAsServer, EndAuthenticateAsServer, serverCertificate, null);
|
||||
return AuthenticateAsServerAsync (serverCertificate, false, DefaultProtocols, false);
|
||||
}
|
||||
|
||||
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
|
||||
{
|
||||
return Task.Factory.FromAsync ((callback, state) => BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, callback, state), EndAuthenticateAsServer, null);
|
||||
return ProcessAuthentication (false, true, string.Empty, enabledSslProtocols, serverCertificate, null, clientCertificateRequired);
|
||||
}
|
||||
|
||||
public Task ShutdownAsync ()
|
||||
{
|
||||
Debug ("ShutdownAsync");
|
||||
|
||||
/*
|
||||
* SSLClose() is a little bit tricky as it might attempt to send a close_notify alert
|
||||
* and thus call our write callback.
|
||||
*
|
||||
* It is also not thread-safe with SSLRead() or SSLWrite(), so we need to take the I/O lock here.
|
||||
*/
|
||||
var asyncRequest = new AsyncShutdownRequest (this);
|
||||
var task = StartOperation (OperationType.Shutdown, asyncRequest, CancellationToken.None);
|
||||
return task;
|
||||
}
|
||||
|
||||
public AuthenticatedStream AuthenticatedStream {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
internal void ProcessAuthentication (LazyAsyncResult lazyResult)
|
||||
async Task ProcessAuthentication (
|
||||
bool runSynchronously, bool serverMode, string targetHost, SslProtocols enabledProtocols,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired)
|
||||
{
|
||||
var asyncRequest = new AsyncProtocolRequest (this, lazyResult);
|
||||
if (Interlocked.CompareExchange (ref asyncHandshakeRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
|
||||
try {
|
||||
if (lastException != null)
|
||||
throw lastException;
|
||||
if (xobileTlsContext == null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
|
||||
try {
|
||||
asyncRequest.StartOperation (ProcessHandshake);
|
||||
} catch (Exception ex) {
|
||||
ExceptionDispatchInfo.Capture (SetException (ex)).Throw ();
|
||||
}
|
||||
} finally {
|
||||
if (lazyResult == null || lastException != null) {
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
asyncHandshakeRequest = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void EndProcessAuthentication (IAsyncResult result)
|
||||
{
|
||||
if (result == null)
|
||||
throw new ArgumentNullException ("asyncResult");
|
||||
|
||||
var lazyResult = (LazyAsyncResult)result;
|
||||
if (Interlocked.Exchange (ref asyncHandshakeRequest, null) == null)
|
||||
throw new InvalidOperationException ("Invalid end call.");
|
||||
|
||||
lazyResult.InternalWaitForCompletion ();
|
||||
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
|
||||
var e = lazyResult.Result as Exception;
|
||||
if (e != null)
|
||||
ExceptionDispatchInfo.Capture (SetException (e)).Throw ();
|
||||
}
|
||||
|
||||
internal void ValidateCreateContext (bool serverMode, string targetHost, SslProtocols enabledProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired)
|
||||
{
|
||||
if (xobileTlsContext != null)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (serverMode) {
|
||||
if (serverCertificate == null)
|
||||
throw new ArgumentException ("serverCertificate");
|
||||
} else {
|
||||
throw new ArgumentException (nameof (serverCertificate));
|
||||
} else {
|
||||
if (targetHost == null)
|
||||
throw new ArgumentException ("targetHost");
|
||||
throw new ArgumentException (nameof (targetHost));
|
||||
if (targetHost.Length == 0)
|
||||
targetHost = "?" + Interlocked.Increment (ref uniqueNameInteger).ToString (NumberFormatInfo.InvariantInfo);
|
||||
}
|
||||
|
||||
xobileTlsContext = CreateContext (this, serverMode, targetHost, enabledProtocols, serverCertificate, clientCertificates, clientCertRequired);
|
||||
if (lastException != null)
|
||||
lastException.Throw ();
|
||||
|
||||
var asyncRequest = new AsyncHandshakeRequest (this, runSynchronously);
|
||||
if (Interlocked.CompareExchange (ref asyncHandshakeRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
// Make sure no other async requests can be started during the handshake.
|
||||
if (Interlocked.CompareExchange (ref asyncReadRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
if (Interlocked.CompareExchange (ref asyncWriteRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
|
||||
AsyncProtocolResult result;
|
||||
|
||||
try {
|
||||
lock (ioLock) {
|
||||
if (xobileTlsContext != null)
|
||||
throw new InvalidOperationException ();
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
|
||||
xobileTlsContext = CreateContext (
|
||||
serverMode, targetHost, enabledProtocols, serverCertificate,
|
||||
clientCertificates, clientCertRequired);
|
||||
}
|
||||
|
||||
try {
|
||||
result = await asyncRequest.StartOperation (CancellationToken.None).ConfigureAwait (false);
|
||||
} catch (Exception ex) {
|
||||
result = new AsyncProtocolResult (SetException (GetSSPIException (ex)));
|
||||
}
|
||||
} finally {
|
||||
lock (ioLock) {
|
||||
readBuffer.Reset ();
|
||||
writeBuffer.Reset ();
|
||||
asyncWriteRequest = null;
|
||||
asyncReadRequest = null;
|
||||
asyncHandshakeRequest = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (result.Error != null)
|
||||
result.Error.Throw ();
|
||||
}
|
||||
|
||||
protected abstract MobileTlsContext CreateContext (
|
||||
MobileAuthenticatedStream parent, bool serverMode, string targetHost,
|
||||
SSA.SslProtocols enabledProtocols, X509Certificate serverCertificate,
|
||||
X509CertificateCollection clientCertificates, bool askForClientCert);
|
||||
bool serverMode, string targetHost, SSA.SslProtocols enabledProtocols,
|
||||
X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
|
||||
bool askForClientCert);
|
||||
|
||||
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
return BeginReadOrWrite (ref asyncReadRequest, ref readBuffer, ProcessRead, new BufferOffsetSize (buffer, offset, count), asyncCallback, asyncState);
|
||||
var asyncRequest = new AsyncReadRequest (this, false, buffer, offset, count);
|
||||
var task = StartOperation (OperationType.Read, asyncRequest, CancellationToken.None);
|
||||
return TaskToApm.Begin (task, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public override int EndRead (IAsyncResult asyncResult)
|
||||
{
|
||||
return (int)EndReadOrWrite (asyncResult, ref asyncReadRequest);
|
||||
return TaskToApm.End<int> (asyncResult);
|
||||
}
|
||||
|
||||
public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
|
||||
{
|
||||
return BeginReadOrWrite (ref asyncWriteRequest, ref writeBuffer, ProcessWrite, new BufferOffsetSize (buffer, offset, count), asyncCallback, asyncState);
|
||||
var asyncRequest = new AsyncWriteRequest (this, false, buffer, offset, count);
|
||||
var task = StartOperation (OperationType.Write, asyncRequest, CancellationToken.None);
|
||||
return TaskToApm.Begin (task, asyncCallback, asyncState);
|
||||
}
|
||||
|
||||
public override void EndWrite (IAsyncResult asyncResult)
|
||||
{
|
||||
EndReadOrWrite (asyncResult, ref asyncWriteRequest);
|
||||
TaskToApm.End (asyncResult);
|
||||
}
|
||||
|
||||
public override int Read (byte[] buffer, int offset, int count)
|
||||
{
|
||||
return ProcessReadOrWrite (ref asyncReadRequest, ref readBuffer, ProcessRead, new BufferOffsetSize (buffer, offset, count), null);
|
||||
var asyncRequest = new AsyncReadRequest (this, true, buffer, offset, count);
|
||||
var task = StartOperation (OperationType.Read, asyncRequest, CancellationToken.None);
|
||||
return task.Result;
|
||||
}
|
||||
|
||||
public void Write (byte[] buffer)
|
||||
{
|
||||
Write (buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
public override void Write (byte[] buffer, int offset, int count)
|
||||
{
|
||||
ProcessReadOrWrite (ref asyncWriteRequest, ref writeBuffer, ProcessWrite, new BufferOffsetSize (buffer, offset, count), null);
|
||||
var asyncRequest = new AsyncWriteRequest (this, true, buffer, offset, count);
|
||||
var task = StartOperation (OperationType.Write, asyncRequest, CancellationToken.None);
|
||||
task.Wait ();
|
||||
}
|
||||
|
||||
IAsyncResult BeginReadOrWrite (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, BufferOffsetSize userBuffer, AsyncCallback asyncCallback, object asyncState)
|
||||
public override Task<int> ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
{
|
||||
LazyAsyncResult lazyResult = new LazyAsyncResult (this, asyncState, asyncCallback);
|
||||
ProcessReadOrWrite (ref nestedRequest, ref internalBuffer, operation, userBuffer, lazyResult);
|
||||
return lazyResult;
|
||||
var asyncRequest = new AsyncReadRequest (this, false, buffer, offset, count);
|
||||
return StartOperation (OperationType.Read, asyncRequest, cancellationToken);
|
||||
}
|
||||
|
||||
object EndReadOrWrite (IAsyncResult asyncResult, ref AsyncProtocolRequest nestedRequest)
|
||||
public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
{
|
||||
if (asyncResult == null)
|
||||
throw new ArgumentNullException("asyncResult");
|
||||
var asyncRequest = new AsyncWriteRequest (this, false, buffer, offset, count);
|
||||
return StartOperation (OperationType.Write, asyncRequest, cancellationToken);
|
||||
}
|
||||
|
||||
var lazyResult = (LazyAsyncResult)asyncResult;
|
||||
async Task<int> StartOperation (OperationType type, AsyncProtocolRequest asyncRequest, CancellationToken cancellationToken)
|
||||
{
|
||||
CheckThrow (true, type != OperationType.Read);
|
||||
Debug ("StartOperationAsync: {0} {1}", asyncRequest, type);
|
||||
|
||||
if (Interlocked.Exchange (ref nestedRequest, null) == null)
|
||||
throw new InvalidOperationException ("Invalid end call.");
|
||||
|
||||
// No "artificial" timeouts implemented so far, InnerStream controls timeout.
|
||||
lazyResult.InternalWaitForCompletion ();
|
||||
|
||||
Debug ("EndReadOrWrite");
|
||||
|
||||
var e = lazyResult.Result as Exception;
|
||||
if (e != null) {
|
||||
var ioEx = e as IOException;
|
||||
if (ioEx != null)
|
||||
throw ioEx;
|
||||
throw new IOException ("read failed", e);
|
||||
if (type == OperationType.Read) {
|
||||
if (Interlocked.CompareExchange (ref asyncReadRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
} else {
|
||||
if (Interlocked.CompareExchange (ref asyncWriteRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
}
|
||||
|
||||
return lazyResult.Result;
|
||||
}
|
||||
AsyncProtocolResult result;
|
||||
|
||||
int ProcessReadOrWrite (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, BufferOffsetSize userBuffer, LazyAsyncResult lazyResult)
|
||||
{
|
||||
if (userBuffer == null || userBuffer.Buffer == null)
|
||||
throw new ArgumentNullException ("buffer");
|
||||
if (userBuffer.Offset < 0)
|
||||
throw new ArgumentOutOfRangeException ("offset");
|
||||
if (userBuffer.Size < 0 || userBuffer.Offset + userBuffer.Size > userBuffer.Buffer.Length)
|
||||
throw new ArgumentOutOfRangeException ("count");
|
||||
|
||||
CheckThrow (true);
|
||||
|
||||
var name = internalBuffer == readBuffer ? "read" : "write";
|
||||
Debug ("ProcessReadOrWrite: {0} {1}", name, userBuffer);
|
||||
|
||||
var asyncRequest = new AsyncProtocolRequest (this, lazyResult, userBuffer);
|
||||
return StartOperation (ref nestedRequest, ref internalBuffer, operation, asyncRequest, name);
|
||||
}
|
||||
|
||||
int StartOperation (ref AsyncProtocolRequest nestedRequest, ref BufferOffsetSize2 internalBuffer, AsyncOperation operation, AsyncProtocolRequest asyncRequest, string name)
|
||||
{
|
||||
if (Interlocked.CompareExchange (ref nestedRequest, asyncRequest, null) != null)
|
||||
throw new InvalidOperationException ("Invalid nested call.");
|
||||
|
||||
bool failed = false;
|
||||
try {
|
||||
internalBuffer.Reset ();
|
||||
asyncRequest.StartOperation (operation);
|
||||
return asyncRequest.UserResult;
|
||||
lock (ioLock) {
|
||||
if (type == OperationType.Read)
|
||||
readBuffer.Reset ();
|
||||
else
|
||||
writeBuffer.Reset ();
|
||||
}
|
||||
result = await asyncRequest.StartOperation (cancellationToken).ConfigureAwait (false);
|
||||
} catch (Exception e) {
|
||||
failed = true;
|
||||
if (e is IOException)
|
||||
throw;
|
||||
throw new IOException (name + " failed", e);
|
||||
var info = SetException (GetIOException (e, asyncRequest.Name + " failed"));
|
||||
result = new AsyncProtocolResult (info);
|
||||
} finally {
|
||||
if (asyncRequest.UserAsyncResult == null || failed) {
|
||||
internalBuffer.Reset ();
|
||||
nestedRequest = null;
|
||||
lock (ioLock) {
|
||||
if (type == OperationType.Read) {
|
||||
readBuffer.Reset ();
|
||||
asyncReadRequest = null;
|
||||
} else {
|
||||
writeBuffer.Reset ();
|
||||
asyncWriteRequest = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result.Error != null)
|
||||
result.Error.Throw ();
|
||||
return result.UserResult;
|
||||
}
|
||||
|
||||
static int nextId;
|
||||
@@ -384,26 +390,31 @@ namespace Mono.Net.Security
|
||||
Console.Error.WriteLine ("MobileAuthenticatedStream({0}): {1}", ID, string.Format (message, args));
|
||||
}
|
||||
|
||||
#region Called back from native code via SslConnection
|
||||
#region Called back from native code via SslConnection
|
||||
|
||||
/*
|
||||
* Called from within SSLRead() and SSLHandshake(). We only access tha managed byte[] here.
|
||||
*/
|
||||
internal int InternalRead (byte[] buffer, int offset, int size, out bool wantMore)
|
||||
internal int InternalRead (byte[] buffer, int offset, int size, out bool outWantMore)
|
||||
{
|
||||
try {
|
||||
Debug ("InternalRead: {0} {1} {2} {3}", offset, size, asyncReadRequest != null, readBuffer != null);
|
||||
Debug ("InternalRead: {0} {1} {2} {3} {4}", offset, size,
|
||||
asyncHandshakeRequest != null ? "handshake" : "",
|
||||
asyncReadRequest != null ? "async" : "",
|
||||
readBuffer != null ? readBuffer.ToString () : "");
|
||||
var asyncRequest = asyncHandshakeRequest ?? asyncReadRequest;
|
||||
return InternalRead (asyncRequest, readBuffer, buffer, offset, size, out wantMore);
|
||||
var (ret, wantMore) = InternalRead (asyncRequest, readBuffer, buffer, offset, size);
|
||||
outWantMore = wantMore;
|
||||
return ret;
|
||||
} catch (Exception ex) {
|
||||
Debug ("InternalRead failed: {0}", ex);
|
||||
SetException_internal (ex);
|
||||
wantMore = false;
|
||||
SetException (GetIOException (ex, "InternalRead() failed"));
|
||||
outWantMore = false;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int InternalRead (AsyncProtocolRequest asyncRequest, BufferOffsetSize internalBuffer, byte[] buffer, int offset, int size, out bool wantMore)
|
||||
(int, bool) InternalRead (AsyncProtocolRequest asyncRequest, BufferOffsetSize internalBuffer, byte[] buffer, int offset, int size)
|
||||
{
|
||||
if (asyncRequest == null)
|
||||
throw new InvalidOperationException ();
|
||||
@@ -422,11 +433,10 @@ namespace Mono.Net.Security
|
||||
* native function again.
|
||||
*/
|
||||
if (internalBuffer.Size == 0 && !internalBuffer.Complete) {
|
||||
Debug ("InternalRead #1: {0} {1}", internalBuffer.Offset, internalBuffer.TotalBytes);
|
||||
Debug ("InternalRead #1: {0} {1} {2}", internalBuffer.Offset, internalBuffer.TotalBytes, size);
|
||||
internalBuffer.Offset = internalBuffer.Size = 0;
|
||||
asyncRequest.RequestRead (size);
|
||||
wantMore = true;
|
||||
return 0;
|
||||
return (0, true);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -441,8 +451,7 @@ namespace Mono.Net.Security
|
||||
Buffer.BlockCopy (internalBuffer.Buffer, internalBuffer.Offset, buffer, offset, len);
|
||||
internalBuffer.Offset += len;
|
||||
internalBuffer.Size -= len;
|
||||
wantMore = !internalBuffer.Complete && len < size;
|
||||
return len;
|
||||
return (len, !internalBuffer.Complete && len < size);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -456,7 +465,7 @@ namespace Mono.Net.Security
|
||||
return InternalWrite (asyncRequest, writeBuffer, buffer, offset, size);
|
||||
} catch (Exception ex) {
|
||||
Debug ("InternalWrite failed: {0}", ex);
|
||||
SetException_internal (ex);
|
||||
SetException (GetIOException (ex, "InternalWrite() failed"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -511,22 +520,30 @@ namespace Mono.Net.Security
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Inner Stream
|
||||
#region Inner Stream
|
||||
|
||||
/*
|
||||
* Read / write data from the inner stream; we're only called from managed code and only manipulate
|
||||
* the internal buffers.
|
||||
*/
|
||||
internal int InnerRead (int requestedSize)
|
||||
internal async Task<int> InnerRead (bool sync, int requestedSize, CancellationToken cancellationToken)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested ();
|
||||
Debug ("InnerRead: {0} {1} {2} {3}", readBuffer.Offset, readBuffer.Size, readBuffer.Remaining, requestedSize);
|
||||
|
||||
var len = System.Math.Min (readBuffer.Remaining, requestedSize);
|
||||
if (len == 0)
|
||||
throw new InvalidOperationException ();
|
||||
var ret = InnerStream.Read (readBuffer.Buffer, readBuffer.EndOffset, len);
|
||||
|
||||
Task<int> task;
|
||||
if (sync)
|
||||
task = Task.Run (() => InnerStream.Read (readBuffer.Buffer, readBuffer.EndOffset, len));
|
||||
else
|
||||
task = InnerStream.ReadAsync (readBuffer.Buffer, readBuffer.EndOffset, len, cancellationToken);
|
||||
|
||||
var ret = await task.ConfigureAwait (false);
|
||||
Debug ("InnerRead done: {0} {1} - {2}", readBuffer.Remaining, len, ret);
|
||||
|
||||
if (ret >= 0) {
|
||||
@@ -549,165 +566,126 @@ namespace Mono.Net.Security
|
||||
return ret;
|
||||
}
|
||||
|
||||
internal void InnerWrite ()
|
||||
internal async Task InnerWrite (bool sync, CancellationToken cancellationToken)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested ();
|
||||
Debug ("InnerWrite: {0} {1}", writeBuffer.Offset, writeBuffer.Size);
|
||||
InnerFlush ();
|
||||
|
||||
if (writeBuffer.Size == 0)
|
||||
return;
|
||||
|
||||
Task task;
|
||||
if (sync)
|
||||
task = Task.Run (() => InnerStream.Write (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size));
|
||||
else
|
||||
task = InnerStream.WriteAsync (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size);
|
||||
|
||||
await task.ConfigureAwait (false);
|
||||
|
||||
writeBuffer.TotalBytes += writeBuffer.Size;
|
||||
writeBuffer.Offset = writeBuffer.Size = 0;
|
||||
}
|
||||
|
||||
internal void InnerFlush ()
|
||||
{
|
||||
if (writeBuffer.Size > 0) {
|
||||
InnerStream.Write (writeBuffer.Buffer, writeBuffer.Offset, writeBuffer.Size);
|
||||
writeBuffer.TotalBytes += writeBuffer.Size;
|
||||
writeBuffer.Offset = writeBuffer.Size = 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#region Main async I/O loop
|
||||
|
||||
#region Main async I/O loop
|
||||
|
||||
AsyncOperationStatus ProcessHandshake (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
internal AsyncOperationStatus ProcessHandshake (AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessHandshake: {0}", status);
|
||||
|
||||
/*
|
||||
* The first time we're called (AsyncOperationStatus.Initialize), we need to setup the SslContext and
|
||||
* start the handshake.
|
||||
*/
|
||||
if (status == AsyncOperationStatus.Initialize) {
|
||||
xobileTlsContext.StartHandshake ();
|
||||
return AsyncOperationStatus.Continue;
|
||||
} else if (status == AsyncOperationStatus.ReadDone) {
|
||||
// remote prematurely closed connection.
|
||||
throw new IOException ("Remote prematurely closed connection.");
|
||||
} else if (status != AsyncOperationStatus.Continue) {
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
/*
|
||||
* SSLHandshake() will return repeatedly with 'SslStatus.WouldBlock', we then need
|
||||
* to take care of I/O and call it again.
|
||||
*/
|
||||
if (!xobileTlsContext.ProcessHandshake ()) {
|
||||
lock (ioLock) {
|
||||
/*
|
||||
* Flush the internal write buffer.
|
||||
*/
|
||||
InnerFlush ();
|
||||
return AsyncOperationStatus.Continue;
|
||||
}
|
||||
* The first time we're called (AsyncOperationStatus.Initialize), we need to setup the SslContext and
|
||||
* start the handshake.
|
||||
*/
|
||||
if (status == AsyncOperationStatus.Initialize) {
|
||||
xobileTlsContext.StartHandshake ();
|
||||
return AsyncOperationStatus.Continue;
|
||||
} else if (status == AsyncOperationStatus.ReadDone) {
|
||||
throw new IOException (SR.net_auth_eof);
|
||||
} else if (status != AsyncOperationStatus.Continue) {
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
xobileTlsContext.FinishHandshake ();
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessRead (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessRead - read user: {0} {1}", status, asyncRequest.UserBuffer);
|
||||
|
||||
int ret;
|
||||
bool wantMore;
|
||||
lock (ioLock) {
|
||||
ret = Context.Read (asyncRequest.UserBuffer.Buffer, asyncRequest.UserBuffer.Offset, asyncRequest.UserBuffer.Size, out wantMore);
|
||||
}
|
||||
Debug ("ProcessRead - read user done: {0} - {1} {2}", asyncRequest.UserBuffer, ret, wantMore);
|
||||
|
||||
if (ret < 0) {
|
||||
asyncRequest.UserResult = -1;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
asyncRequest.CurrentSize += ret;
|
||||
asyncRequest.UserBuffer.Offset += ret;
|
||||
asyncRequest.UserBuffer.Size -= ret;
|
||||
|
||||
Debug ("Process Read - read user done #1: {0} - {1} {2}", asyncRequest.UserBuffer, asyncRequest.CurrentSize, wantMore);
|
||||
|
||||
if (wantMore && asyncRequest.CurrentSize == 0)
|
||||
return AsyncOperationStatus.WantRead;
|
||||
|
||||
asyncRequest.ResetRead ();
|
||||
asyncRequest.UserResult = asyncRequest.CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessWrite (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessWrite - write user: {0} {1}", status, asyncRequest.UserBuffer);
|
||||
|
||||
if (asyncRequest.UserBuffer.Size == 0) {
|
||||
asyncRequest.UserResult = asyncRequest.CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
int ret;
|
||||
bool wantMore;
|
||||
lock (ioLock) {
|
||||
ret = Context.Write (asyncRequest.UserBuffer.Buffer, asyncRequest.UserBuffer.Offset, asyncRequest.UserBuffer.Size, out wantMore);
|
||||
}
|
||||
Debug ("ProcessWrite - write user done: {0} - {1} {2}", asyncRequest.UserBuffer, ret, wantMore);
|
||||
|
||||
if (ret < 0) {
|
||||
asyncRequest.UserResult = -1;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
asyncRequest.CurrentSize += ret;
|
||||
asyncRequest.UserBuffer.Offset += ret;
|
||||
asyncRequest.UserBuffer.Size -= ret;
|
||||
|
||||
if (wantMore || writeBuffer.Size > 0)
|
||||
return AsyncOperationStatus.WantWrite;
|
||||
|
||||
asyncRequest.ResetWrite ();
|
||||
asyncRequest.UserResult = asyncRequest.CurrentSize;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessClose (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessClose: {0}", status);
|
||||
|
||||
lock (ioLock) {
|
||||
if (xobileTlsContext == null)
|
||||
/*
|
||||
* SSLHandshake() will return repeatedly with 'SslStatus.WouldBlock', we then need
|
||||
* to take care of I/O and call it again.
|
||||
*/
|
||||
if (xobileTlsContext.ProcessHandshake ()) {
|
||||
xobileTlsContext.FinishHandshake ();
|
||||
return AsyncOperationStatus.Complete;
|
||||
|
||||
xobileTlsContext.Close ();
|
||||
xobileTlsContext = null;
|
||||
}
|
||||
return AsyncOperationStatus.Continue;
|
||||
}
|
||||
}
|
||||
|
||||
AsyncOperationStatus ProcessFlush (AsyncProtocolRequest asyncRequest, AsyncOperationStatus status)
|
||||
internal (int, bool) ProcessRead (BufferOffsetSize userBuffer)
|
||||
{
|
||||
Debug ("ProcessFlush: {0}", status);
|
||||
return AsyncOperationStatus.Complete;
|
||||
lock (ioLock) {
|
||||
// This operates on the internal buffer and will never block.
|
||||
var ret = xobileTlsContext.Read (userBuffer.Buffer, userBuffer.Offset, userBuffer.Size, out bool wantMore);
|
||||
return (ret, wantMore);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
internal (int, bool) ProcessWrite (BufferOffsetSize userBuffer)
|
||||
{
|
||||
lock (ioLock) {
|
||||
// This operates on the internal buffer and will never block.
|
||||
var ret = xobileTlsContext.Write (userBuffer.Buffer, userBuffer.Offset, userBuffer.Size, out bool wantMore);
|
||||
return (ret, wantMore);
|
||||
}
|
||||
}
|
||||
|
||||
internal AsyncOperationStatus ProcessShutdown (AsyncOperationStatus status)
|
||||
{
|
||||
Debug ("ProcessShutdown: {0}", status);
|
||||
|
||||
lock (ioLock) {
|
||||
xobileTlsContext.Shutdown ();
|
||||
shutdown = true;
|
||||
return AsyncOperationStatus.Complete;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override bool IsServer {
|
||||
get { return xobileTlsContext != null && xobileTlsContext.IsServer; }
|
||||
get {
|
||||
CheckThrow (false);
|
||||
return xobileTlsContext != null && xobileTlsContext.IsServer;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsAuthenticated {
|
||||
get { return xobileTlsContext != null && lastException == null && xobileTlsContext.IsAuthenticated; }
|
||||
get {
|
||||
lock (ioLock) {
|
||||
// Don't use CheckThrow(), we want to return false if we're not authenticated.
|
||||
return xobileTlsContext != null && lastException == null && xobileTlsContext.IsAuthenticated;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsMutuallyAuthenticated {
|
||||
get {
|
||||
return IsAuthenticated &&
|
||||
(Context.IsServer? Context.LocalServerCertificate: Context.LocalClientCertificate) != null &&
|
||||
Context.IsRemoteCertificateAvailable;
|
||||
lock (ioLock) {
|
||||
// Don't use CheckThrow() here.
|
||||
if (!IsAuthenticated)
|
||||
return false;
|
||||
if ((xobileTlsContext.IsServer ? xobileTlsContext.LocalServerCertificate : xobileTlsContext.LocalClientCertificate) == null)
|
||||
return false;
|
||||
return xobileTlsContext.IsRemoteCertificateAvailable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
try {
|
||||
lastException = new ObjectDisposedException ("MobileAuthenticatedStream");
|
||||
lock (ioLock) {
|
||||
Debug ("Dispose: {0}", xobileTlsContext != null);
|
||||
lastException = ExceptionDispatchInfo.Capture (new ObjectDisposedException ("MobileAuthenticatedStream"));
|
||||
if (xobileTlsContext != null) {
|
||||
xobileTlsContext.Dispose ();
|
||||
xobileTlsContext = null;
|
||||
@@ -720,26 +698,53 @@ namespace Mono.Net.Security
|
||||
|
||||
public override void Flush ()
|
||||
{
|
||||
CheckThrow (true);
|
||||
var asyncRequest = new AsyncProtocolRequest (this, null);
|
||||
StartOperation (ref asyncWriteRequest, ref writeBuffer, ProcessFlush, asyncRequest, "flush");
|
||||
// Write() automatically flushes the underlying stream.
|
||||
}
|
||||
|
||||
public override void Close ()
|
||||
{
|
||||
/*
|
||||
* SSLClose() is a little bit tricky as it might attempt to send a close_notify alert
|
||||
* and thus call our write callback.
|
||||
*
|
||||
* It is also not thread-safe with SSLRead() or SSLWrite(), so we need to take the I/O lock here.
|
||||
*/
|
||||
if (Interlocked.Exchange (ref closeRequested, 1) == 1)
|
||||
return;
|
||||
if (xobileTlsContext == null)
|
||||
return;
|
||||
public SslProtocols SslProtocol {
|
||||
get {
|
||||
lock (ioLock) {
|
||||
CheckThrow (true);
|
||||
return (SslProtocols)xobileTlsContext.NegotiatedProtocol;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var asyncRequest = new AsyncProtocolRequest (this, null);
|
||||
StartOperation (ref asyncWriteRequest, ref writeBuffer, ProcessClose, asyncRequest, "close");
|
||||
public X509Certificate RemoteCertificate {
|
||||
get {
|
||||
lock (ioLock) {
|
||||
CheckThrow (true);
|
||||
return xobileTlsContext.RemoteCertificate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate LocalCertificate {
|
||||
get {
|
||||
lock (ioLock) {
|
||||
CheckThrow (true);
|
||||
return InternalLocalCertificate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate InternalLocalCertificate {
|
||||
get {
|
||||
lock (ioLock) {
|
||||
CheckThrow (false);
|
||||
if (xobileTlsContext == null)
|
||||
return null;
|
||||
return xobileTlsContext.IsServer ? xobileTlsContext.LocalServerCertificate : xobileTlsContext.LocalClientCertificate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
|
||||
{
|
||||
lock (ioLock) {
|
||||
CheckThrow (true);
|
||||
return xobileTlsContext.ConnectionInfo;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -769,7 +774,7 @@ namespace Mono.Net.Security
|
||||
}
|
||||
|
||||
public override bool CanWrite {
|
||||
get { return IsAuthenticated & InnerStream.CanWrite; }
|
||||
get { return IsAuthenticated & InnerStream.CanWrite && !shutdown; }
|
||||
}
|
||||
|
||||
public override bool CanSeek {
|
||||
@@ -803,46 +808,10 @@ namespace Mono.Net.Security
|
||||
set { InnerStream.WriteTimeout = value; }
|
||||
}
|
||||
|
||||
public SslProtocols SslProtocol {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
return (SslProtocols)Context.NegotiatedProtocol;
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate RemoteCertificate {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
return Context.RemoteCertificate;
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate LocalCertificate {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
return InternalLocalCertificate;
|
||||
}
|
||||
}
|
||||
|
||||
public X509Certificate InternalLocalCertificate {
|
||||
get {
|
||||
CheckThrow (false);
|
||||
if (!HasContext)
|
||||
return null;
|
||||
return Context.IsServer ? Context.LocalServerCertificate : Context.LocalClientCertificate;
|
||||
}
|
||||
}
|
||||
|
||||
public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
|
||||
{
|
||||
CheckThrow (true);
|
||||
return Context.ConnectionInfo;
|
||||
}
|
||||
|
||||
public SSA.CipherAlgorithmType CipherAlgorithm {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
var info = Context.ConnectionInfo;
|
||||
var info = GetConnectionInfo ();
|
||||
if (info == null)
|
||||
return SSA.CipherAlgorithmType.None;
|
||||
switch (info.CipherAlgorithmType) {
|
||||
@@ -861,7 +830,7 @@ namespace Mono.Net.Security
|
||||
public SSA.HashAlgorithmType HashAlgorithm {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
var info = Context.ConnectionInfo;
|
||||
var info = GetConnectionInfo ();
|
||||
if (info == null)
|
||||
return SSA.HashAlgorithmType.None;
|
||||
switch (info.HashAlgorithmType) {
|
||||
@@ -883,7 +852,7 @@ namespace Mono.Net.Security
|
||||
public SSA.ExchangeAlgorithmType KeyExchangeAlgorithm {
|
||||
get {
|
||||
CheckThrow (true);
|
||||
var info = Context.ConnectionInfo;
|
||||
var info = GetConnectionInfo ();
|
||||
if (info == null)
|
||||
return SSA.ExchangeAlgorithmType.None;
|
||||
switch (info.ExchangeAlgorithmType) {
|
||||
@@ -898,7 +867,7 @@ namespace Mono.Net.Security
|
||||
}
|
||||
}
|
||||
|
||||
#region Need to Implement
|
||||
#region Need to Implement
|
||||
public int CipherStrength {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
@@ -920,7 +889,7 @@ namespace Mono.Net.Security
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -169,7 +169,7 @@ namespace Mono.Net.Security
|
||||
|
||||
public abstract int Write (byte[] buffer, int offset, int count, out bool wantMore);
|
||||
|
||||
public abstract void Close ();
|
||||
public abstract void Shutdown ();
|
||||
|
||||
protected bool ValidateCertificate (X509Certificate leaf, X509Chain chain)
|
||||
{
|
||||
|
||||
@@ -83,6 +83,8 @@ namespace Mono.Net.Security
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
InitializeProviderRegistration ();
|
||||
|
||||
MSI.MonoTlsProvider provider;
|
||||
try {
|
||||
provider = CreateDefaultProviderImpl ();
|
||||
|
||||
@@ -9,6 +9,8 @@ partial class SR
|
||||
{
|
||||
public const string mono_net_io_shutdown = "mono_net_io_shutdown";
|
||||
public const string mono_net_io_renegotiate = "mono_net_io_renegotiate";
|
||||
|
||||
public const string net_ssl_io_already_shutdown = "Write operations are not allowed after the channel was shutdown.";
|
||||
|
||||
public const string net_log_set_socketoption_reuseport_default_on = "net_log_set_socketoption_reuseport_default_on";
|
||||
public const string net_log_set_socketoption_reuseport_not_supported = "net_log_set_socketoption_reuseport_not_supported";
|
||||
|
||||
@@ -223,6 +223,11 @@ namespace System.Net.Security
|
||||
return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
|
||||
}
|
||||
|
||||
public virtual Task ShutdownAsync ()
|
||||
{
|
||||
return Impl.ShutdownAsync ();
|
||||
}
|
||||
|
||||
public override bool IsAuthenticated {
|
||||
get { return Impl.IsAuthenticated; }
|
||||
}
|
||||
|
||||
@@ -152,6 +152,11 @@ namespace System.Net.Security
|
||||
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
public virtual Task ShutdownAsync ()
|
||||
{
|
||||
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
public override bool IsAuthenticated {
|
||||
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
|
||||
}
|
||||
|
||||
@@ -24,11 +24,12 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
using System.Security.Principal;
|
||||
namespace System.Net {
|
||||
public class HttpListenerBasicIdentity {
|
||||
internal const string EXCEPTION_MESSAGE = "System.Net.HttpListenerBasicIdentity is not supported on the current platform.";
|
||||
public class HttpListenerBasicIdentity : GenericIdentity {
|
||||
const string EXCEPTION_MESSAGE = "System.Net.HttpListenerBasicIdentity is not supported on the current platform.";
|
||||
|
||||
public HttpListenerBasicIdentity (string username, string password)
|
||||
public HttpListenerBasicIdentity (string username, string password) : base (username, "Basic")
|
||||
{
|
||||
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
@@ -37,12 +37,18 @@ namespace MonoTests.System.Net {
|
||||
[ExpectedException (typeof (ArgumentNullException))]
|
||||
public void Basic1 ()
|
||||
{
|
||||
#if MONOTOUCH_WATCH || __WATCHOS__
|
||||
Assert.Ignore ("HttpListenerBasicIdentity is not supported on watchOS");
|
||||
#endif
|
||||
HttpListenerBasicIdentity bi = new HttpListenerBasicIdentity (null, null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Basic2 ()
|
||||
{
|
||||
#if MONOTOUCH_WATCH || __WATCHOS__
|
||||
Assert.Ignore ("HttpListenerBasicIdentity is not supported on watchOS");
|
||||
#endif
|
||||
HttpListenerBasicIdentity bi = new HttpListenerBasicIdentity ("", null);
|
||||
Assert.AreEqual ("Basic", bi.AuthenticationType, "#01");
|
||||
Assert.AreEqual ("", bi.Name, "#02");
|
||||
@@ -53,6 +59,9 @@ namespace MonoTests.System.Net {
|
||||
[Test]
|
||||
public void Basic3 ()
|
||||
{
|
||||
#if MONOTOUCH_WATCH || __WATCHOS__
|
||||
Assert.Ignore ("HttpListenerBasicIdentity is not supported on watchOS");
|
||||
#endif
|
||||
HttpListenerBasicIdentity bi = new HttpListenerBasicIdentity ("hey", null);
|
||||
Assert.AreEqual ("Basic", bi.AuthenticationType, "#01");
|
||||
Assert.AreEqual ("hey", bi.Name, "#02");
|
||||
@@ -63,6 +72,9 @@ namespace MonoTests.System.Net {
|
||||
[Test]
|
||||
public void Basic4 ()
|
||||
{
|
||||
#if MONOTOUCH_WATCH || __WATCHOS__
|
||||
Assert.Ignore ("HttpListenerBasicIdentity is not supported on watchOS");
|
||||
#endif
|
||||
HttpListenerBasicIdentity bi = new HttpListenerBasicIdentity ("hey", "pass");
|
||||
Assert.AreEqual ("Basic", bi.AuthenticationType, "#01");
|
||||
Assert.AreEqual ("hey", bi.Name, "#02");
|
||||
|
||||
@@ -276,6 +276,7 @@ ReferenceSources/SettingsSectionInternal.cs
|
||||
ReferenceSources/SecureStringHelper.cs
|
||||
ReferenceSources/Socket.cs
|
||||
ReferenceSources/SR.cs
|
||||
ReferenceSources/SR2.cs
|
||||
ReferenceSources/SRCategoryAttribute.cs
|
||||
ReferenceSources/Win32Exception.cs
|
||||
|
||||
|
||||
@@ -245,7 +245,6 @@ Mono.Net.Dns/ResolverError.cs
|
||||
Mono.Net.Dns/SimpleResolverEventArgs.cs
|
||||
ReferenceSources/BinaryCompatibility.cs
|
||||
ReferenceSources/ConfigurationManagerInternalFactory.cs
|
||||
ReferenceSources/SR2.cs
|
||||
|
||||
../referencesource/System/misc/PrivilegedConfigurationManager.cs
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
thisdir = class/Xunit.NetCore.Extensions
|
||||
SUBDIRS =
|
||||
include ../../build/rules.make
|
||||
|
||||
XUNIT_LIBS := xunit.core xunit.abstractions xunit.execution.desktop xunit.assert
|
||||
|
||||
LIBRARY = Xunit.NetCore.Extensions.dll
|
||||
LIB_REFS = System System.Core Facades/System.Runtime.InteropServices.RuntimeInformation Facades/System.Runtime Facades/System.Threading.Tasks
|
||||
LIB_MCS_FLAGS = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(XUNIT_LIBS))
|
||||
|
||||
EXTRA_DISTFILES =
|
||||
|
||||
NO_TEST = yes
|
||||
NO_INSTALL = yes
|
||||
NO_SIGN_ASSEMBLY = yes
|
||||
|
||||
include ../../build/library.make
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using Xunit;
|
||||
using Xunit.Sdk;
|
||||
|
||||
namespace Microsoft.Xunit.Performance
|
||||
{
|
||||
[TraitDiscoverer("Microsoft.Xunit.Performance.BenchmarkDiscoverer", "Xunit.NetCore.Extensions")]
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
|
||||
public class BenchmarkAttribute : Attribute, ITraitAttribute
|
||||
{
|
||||
public long InnerIterationCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Xunit.Sdk;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace Xunit.NetCore.Extensions
|
||||
{
|
||||
public class BenchmarkDiscoverer : ITraitDiscoverer
|
||||
{
|
||||
public IEnumerable<KeyValuePair<string, string>> GetTraits(IAttributeInfo traitAttribute)
|
||||
{
|
||||
yield return new KeyValuePair<string, string>("Benchmark", "True");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
../../../external/buildtools/src/xunit.netcore.extensions/*.cs
|
||||
../../../external/buildtools/src/xunit.netcore.extensions/Attributes/*.cs
|
||||
../../../external/buildtools/src/xunit.netcore.extensions/Discoverers/*.cs
|
||||
|
||||
Microsoft.Xunit.Performance/BenchmarkAttribute.cs
|
||||
Microsoft.Xunit.Performance/BenchmarkDiscover.cs
|
||||
@@ -35,6 +35,7 @@ namespace System.Reflection.Emit
|
||||
[ComVisible (true)]
|
||||
[Serializable]
|
||||
[Flags]
|
||||
#region Sync with sre-internals.h
|
||||
public enum AssemblyBuilderAccess {
|
||||
Run = 1,
|
||||
Save = 2,
|
||||
@@ -42,4 +43,5 @@ namespace System.Reflection.Emit
|
||||
ReflectionOnly = 6,
|
||||
RunAndCollect = 9
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -131,7 +131,7 @@ namespace System.Reflection.Emit {
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
private extern void create_dynamic_method (DynamicMethod m);
|
||||
private static extern void create_dynamic_method (DynamicMethod m);
|
||||
|
||||
private void CreateDynMethod () {
|
||||
if (mhandle.Value == IntPtr.Zero) {
|
||||
|
||||
@@ -229,7 +229,9 @@ namespace System.Reflection.Emit {
|
||||
}
|
||||
|
||||
internal FieldInfo RuntimeResolve () {
|
||||
return typeb.CreateType ().GetField (this);
|
||||
// typeb.CreateType() populates this.handle
|
||||
var type_handle = new RuntimeTypeHandle (typeb.CreateType () as RuntimeType);
|
||||
return FieldInfo.GetFieldFromHandle (handle, type_handle);
|
||||
}
|
||||
|
||||
public override Module Module {
|
||||
|
||||
@@ -73,19 +73,59 @@ namespace System.Runtime.Remoting.Messaging {
|
||||
[Serializable]
|
||||
internal class CADMethodRef
|
||||
{
|
||||
internal string FullTypeName;
|
||||
internal IntPtr MethodHandlePtr;
|
||||
Type[] GetTypes (string[] typeArray)
|
||||
{
|
||||
Type[] res = new Type [typeArray.Length];
|
||||
for (int i = 0; i < typeArray.Length; ++i)
|
||||
res [i] = Type.GetType (typeArray [i], true);
|
||||
return res;
|
||||
}
|
||||
|
||||
public RuntimeMethodHandle MethodHandle {
|
||||
get {
|
||||
return new RuntimeMethodHandle (MethodHandlePtr);
|
||||
}
|
||||
bool ctor;
|
||||
string typeName;
|
||||
string methodName;
|
||||
string[] param_names;
|
||||
string[] generic_arg_names;
|
||||
|
||||
public MethodBase Resolve ()
|
||||
{
|
||||
Type type = Type.GetType (typeName, true);
|
||||
MethodBase sig_cand = null;
|
||||
Type[] param_types = GetTypes (param_names);
|
||||
if (ctor)
|
||||
sig_cand = type.GetConstructor (BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance, null, param_types, null);
|
||||
else
|
||||
sig_cand = type.GetMethod (methodName, BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance, null, param_types, null);
|
||||
|
||||
if (sig_cand != null && generic_arg_names != null)
|
||||
sig_cand = ((MethodInfo)sig_cand).MakeGenericMethod (GetTypes (generic_arg_names));
|
||||
|
||||
if (sig_cand == null)
|
||||
throw new RemotingException ($"Method '{methodName}' not found in type '{typeName}'");
|
||||
|
||||
return sig_cand;
|
||||
}
|
||||
|
||||
public CADMethodRef (IMethodMessage msg)
|
||||
{
|
||||
MethodHandlePtr = msg.MethodBase.MethodHandle.Value;
|
||||
FullTypeName = msg.MethodBase.DeclaringType.AssemblyQualifiedName;
|
||||
MethodBase method = msg.MethodBase;
|
||||
typeName = method.DeclaringType.AssemblyQualifiedName;
|
||||
ctor = method.IsConstructor;
|
||||
methodName = method.Name;
|
||||
|
||||
if (!ctor && method.IsGenericMethod) {
|
||||
var ga = method.GetGenericArguments ();
|
||||
generic_arg_names = new string [ga.Length];
|
||||
for (int i = 0; i < ga.Length; ++i)
|
||||
generic_arg_names [i] = ga [i].AssemblyQualifiedName;
|
||||
|
||||
method = ((MethodInfo)method).GetGenericMethodDefinition ();
|
||||
}
|
||||
|
||||
var param_types = method.GetParameters ();
|
||||
param_names = new string [param_types.Length];
|
||||
for (int i = 0; i < param_types.Length; ++i)
|
||||
param_names [i] = param_types [i].ParameterType.AssemblyQualifiedName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,62 +142,11 @@ namespace System.Runtime.Remoting.Messaging {
|
||||
serializedMethod = CADSerializer.SerializeObject (methodRef).GetBuffer ();
|
||||
}
|
||||
|
||||
internal MethodBase method {
|
||||
get { return GetMethod (); }
|
||||
}
|
||||
|
||||
internal MethodBase GetMethod ()
|
||||
{
|
||||
CADMethodRef methRef = (CADMethodRef)CADSerializer.DeserializeObjectSafe (serializedMethod);
|
||||
|
||||
MethodBase _method;
|
||||
|
||||
Type tt = Type.GetType (methRef.FullTypeName, true);
|
||||
if (tt.IsGenericType || tt.IsGenericTypeDefinition) {
|
||||
_method = MethodBase.GetMethodFromHandleNoGenericCheck (methRef.MethodHandle);
|
||||
} else {
|
||||
_method = MethodBase.GetMethodFromHandle (methRef.MethodHandle);
|
||||
}
|
||||
|
||||
if (tt != _method.DeclaringType) {
|
||||
// The target domain has loaded the type from a different assembly.
|
||||
// We need to locate the correct type and get the method from it
|
||||
Type [] signature = GetSignature (_method, true);
|
||||
if (_method.IsGenericMethod) {
|
||||
MethodBase [] methods = tt.GetMethods (BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance);
|
||||
Type [] base_args = _method.GetGenericArguments ();
|
||||
foreach (MethodBase method in methods) {
|
||||
if (!method.IsGenericMethod || method.Name != _method.Name)
|
||||
continue;
|
||||
Type [] method_args = method.GetGenericArguments ();
|
||||
if (base_args.Length != method_args.Length)
|
||||
continue;
|
||||
|
||||
MethodInfo method_instance = ((MethodInfo) method).MakeGenericMethod (base_args);
|
||||
Type [] base_sig = GetSignature (method_instance, false);
|
||||
if (base_sig.Length != signature.Length) {
|
||||
continue;
|
||||
}
|
||||
bool dont = false;
|
||||
for (int i = base_sig.Length - 1; i >= 0; i--) {
|
||||
if (base_sig [i] != signature [i]) {
|
||||
dont = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dont)
|
||||
continue;
|
||||
return method_instance;
|
||||
}
|
||||
return _method;
|
||||
}
|
||||
|
||||
MethodBase mb = tt.GetMethod (_method.Name, BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance, null, signature, null);
|
||||
if (mb == null)
|
||||
throw new RemotingException ("Method '" + _method.Name + "' not found in type '" + tt + "'");
|
||||
return mb;
|
||||
}
|
||||
return _method;
|
||||
return methRef.Resolve ();
|
||||
}
|
||||
|
||||
static protected Type [] GetSignature (MethodBase methodBase, bool load)
|
||||
@@ -174,6 +163,7 @@ namespace System.Runtime.Remoting.Messaging {
|
||||
}
|
||||
return signature;
|
||||
}
|
||||
|
||||
// Helper to marshal properties
|
||||
internal static int MarshalProperties (IDictionary dict, ref ArrayList args) {
|
||||
IDictionary serDict = dict;
|
||||
@@ -457,7 +447,7 @@ namespace System.Runtime.Remoting.Messaging {
|
||||
_returnValue = MarshalArgument ( retMsg.ReturnValue, ref serializeList);
|
||||
_args = MarshalArguments ( retMsg.Args, ref serializeList);
|
||||
|
||||
_sig = GetSignature (method, true);
|
||||
_sig = GetSignature (GetMethod (), true);
|
||||
|
||||
if (null != retMsg.Exception) {
|
||||
if (null == serializeList)
|
||||
|
||||
@@ -1844,5 +1844,68 @@ public class AssemblyBuilderTest
|
||||
} catch (NotSupportedException e) {
|
||||
}
|
||||
}
|
||||
|
||||
class AssemblyBuilderResolver {
|
||||
private Assembly mock;
|
||||
private ResolveEventHandler d;
|
||||
private string theName;
|
||||
|
||||
public AssemblyBuilderResolver (string theName) {
|
||||
mock = CreateMock (theName);
|
||||
d = new ResolveEventHandler (HandleResolveEvent);
|
||||
this.theName = theName;
|
||||
}
|
||||
|
||||
public void StartHandling () {
|
||||
AppDomain.CurrentDomain.AssemblyResolve += d;
|
||||
}
|
||||
|
||||
public void StopHandling () {
|
||||
AppDomain.CurrentDomain.AssemblyResolve -= d;
|
||||
}
|
||||
|
||||
public Assembly HandleResolveEvent (Object sender, ResolveEventArgs args) {
|
||||
if (args.Name.StartsWith (theName))
|
||||
return mock;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
private static Assembly CreateMock (string name) {
|
||||
var an = new AssemblyName (name);
|
||||
var ab = AssemblyBuilder.DefineDynamicAssembly (an, AssemblyBuilderAccess.ReflectionOnly);
|
||||
var mb = ab.DefineDynamicModule (an.Name);
|
||||
|
||||
// Just make some content for the assembly
|
||||
var tb = mb.DefineType ("Foo", TypeAttributes.Public);
|
||||
tb.DefineDefaultConstructor (MethodAttributes.Public);
|
||||
|
||||
tb.CreateType ();
|
||||
|
||||
return ab;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ResolveEventHandlerReflectionOnlyError ()
|
||||
{
|
||||
// Regression test for 57850.
|
||||
|
||||
// If a ResolveEventHandler returns a reflection-only
|
||||
// AssemblyBuilder, we should throw a FileNotFoundException.
|
||||
var s = "ResolveEventHandlerReflectionOnlyErrorAssembly";
|
||||
var h = new AssemblyBuilderResolver (s);
|
||||
Assert.Throws<FileNotFoundException>(() => {
|
||||
h.StartHandling ();
|
||||
var aName = new AssemblyName (s);
|
||||
try {
|
||||
AppDomain.CurrentDomain.Load (aName);
|
||||
} finally {
|
||||
h.StopHandling ();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -100,21 +100,41 @@ namespace MonoTests.System.Reflection.Emit
|
||||
|
||||
private ModuleBuilder module;
|
||||
|
||||
string tempDir = Path.Combine (Path.GetTempPath (), typeof (TypeBuilderTest).FullName);
|
||||
|
||||
static string ASSEMBLY_NAME = "MonoTests.System.Reflection.Emit.TypeBuilderTest";
|
||||
|
||||
[SetUp]
|
||||
protected void SetUp ()
|
||||
{
|
||||
Random AutoRand = new Random ();
|
||||
string basePath = tempDir;
|
||||
while (Directory.Exists (tempDir))
|
||||
tempDir = Path.Combine (basePath, AutoRand.Next ().ToString ());
|
||||
Directory.CreateDirectory (tempDir);
|
||||
|
||||
AssemblyName assemblyName = new AssemblyName ();
|
||||
assemblyName.Name = ASSEMBLY_NAME;
|
||||
|
||||
assembly =
|
||||
Thread.GetDomain ().DefineDynamicAssembly (
|
||||
assemblyName, AssemblyBuilderAccess.RunAndSave, Path.GetTempPath ());
|
||||
assemblyName, AssemblyBuilderAccess.RunAndSave, tempDir);
|
||||
|
||||
module = assembly.DefineDynamicModule (ASSEMBLY_NAME, ASSEMBLY_NAME + ".dll");
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
protected void TearDown ()
|
||||
{
|
||||
try {
|
||||
Directory.Delete (tempDir, true);
|
||||
} catch (DirectoryNotFoundException) {
|
||||
} catch (IOException) {
|
||||
// Can happen on Windows if assemblies from this dir are still used
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int typeIndexer = 0;
|
||||
|
||||
// Return a unique type name
|
||||
@@ -738,30 +758,6 @@ namespace MonoTests.System.Reflection.Emit
|
||||
Assert.IsTrue (tb2.IsSealed, "#2");
|
||||
}
|
||||
|
||||
static string CreateTempAssembly ()
|
||||
{
|
||||
FileStream f = null;
|
||||
string path;
|
||||
Random rnd;
|
||||
int num = 0;
|
||||
|
||||
rnd = new Random ();
|
||||
do {
|
||||
num = rnd.Next ();
|
||||
num++;
|
||||
path = Path.Combine (Path.GetTempPath (), "tmp" + num.ToString ("x") + ".dll");
|
||||
|
||||
try {
|
||||
f = new FileStream (path, FileMode.CreateNew);
|
||||
} catch { }
|
||||
} while (f == null);
|
||||
|
||||
f.Close ();
|
||||
|
||||
|
||||
return "tmp" + num.ToString ("x") + ".dll";
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsSerializable ()
|
||||
{
|
||||
@@ -774,10 +770,10 @@ namespace MonoTests.System.Reflection.Emit
|
||||
tb.SetCustomAttribute (new CustomAttributeBuilder (ctors [0], new object [0]));
|
||||
Type createdType = tb.CreateType ();
|
||||
|
||||
string an = CreateTempAssembly ();
|
||||
string an = "IsSerializableTestAssembly.dll";
|
||||
assembly.Save (an);
|
||||
Assert.IsTrue (createdType.IsSerializable, "#3");
|
||||
File.Delete (Path.Combine (Path.GetTempPath (), an));
|
||||
File.Delete (Path.Combine (tempDir, an));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -2054,7 +2050,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
|
||||
assembly =
|
||||
Thread.GetDomain ().DefineDynamicAssembly (
|
||||
assemblyName, AssemblyBuilderAccess.RunAndSave | (AssemblyBuilderAccess)0x800, Path.GetTempPath ());
|
||||
assemblyName, AssemblyBuilderAccess.RunAndSave | (AssemblyBuilderAccess)0x800, tempDir);
|
||||
|
||||
module = assembly.DefineDynamicModule ("module1");
|
||||
|
||||
@@ -9706,7 +9702,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
|
||||
[Test] //bug #399047
|
||||
public void FieldOnTypeBuilderInstDontInflateWhenEncoded () {
|
||||
assembly = Thread.GetDomain ().DefineDynamicAssembly (new AssemblyName (ASSEMBLY_NAME), AssemblyBuilderAccess.RunAndSave, Path.GetTempPath ());
|
||||
assembly = Thread.GetDomain ().DefineDynamicAssembly (new AssemblyName (ASSEMBLY_NAME), AssemblyBuilderAccess.RunAndSave, tempDir);
|
||||
|
||||
module = assembly.DefineDynamicModule ("Instance.exe");
|
||||
|
||||
@@ -9743,10 +9739,11 @@ namespace MonoTests.System.Reflection.Emit
|
||||
|
||||
assembly.SetEntryPoint (main);
|
||||
G.CreateType ();
|
||||
P.CreateType ();
|
||||
var PCreated = P.CreateType ();
|
||||
|
||||
assembly.Save ("Instance.exe");
|
||||
Thread.GetDomain ().ExecuteAssembly(Path.GetTempPath () + Path.DirectorySeparatorChar + "Instance.exe");
|
||||
|
||||
PCreated.InvokeMember ("Main", BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod, null, null, null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -9756,7 +9753,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
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 ());
|
||||
assembly = Thread.GetDomain ().DefineDynamicAssembly (new AssemblyName (ASSEMBLY_NAME+"2"), AssemblyBuilderAccess.RunAndSave, tempDir);
|
||||
module = assembly.DefineDynamicModule ("Instance.exe");
|
||||
|
||||
TypeBuilder tb2 = module.DefineType ("Type2", TypeAttributes.Public);
|
||||
@@ -9783,7 +9780,7 @@ namespace MonoTests.System.Reflection.Emit
|
||||
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 ());
|
||||
assembly = Thread.GetDomain ().DefineDynamicAssembly (new AssemblyName (ASSEMBLY_NAME+"2"), AssemblyBuilderAccess.RunAndSave, tempDir);
|
||||
module = assembly.DefineDynamicModule ("Instance.exe");
|
||||
|
||||
TypeBuilder tb2 = module.DefineType ("Type2", TypeAttributes.Public);
|
||||
@@ -11306,5 +11303,76 @@ namespace MonoTests.System.Reflection.Emit
|
||||
|
||||
Assert.AreSame (buildX, defX);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FieldsWithSameName () {
|
||||
// Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=57222
|
||||
var typeBuilder = module.DefineType ("type1", TypeAttributes.Public | TypeAttributes.Class);
|
||||
|
||||
var mainMethod = typeBuilder.DefineMethod ("Main", MethodAttributes.Public | MethodAttributes.Static, typeof (int), new Type[0]);
|
||||
var mainMethodIl = mainMethod.GetILGenerator ();
|
||||
|
||||
var f1 = typeBuilder.DefineField ("x", typeof (byte), FieldAttributes.Private | FieldAttributes.Static);
|
||||
var f2 = typeBuilder.DefineField ("x", typeof (sbyte), FieldAttributes.Private | FieldAttributes.Static);
|
||||
|
||||
mainMethodIl.Emit (OpCodes.Ldsflda, f1);
|
||||
mainMethodIl.Emit (OpCodes.Ldsflda, f2);
|
||||
mainMethodIl.Emit (OpCodes.Pop);
|
||||
mainMethodIl.Emit (OpCodes.Pop);
|
||||
mainMethodIl.Emit (OpCodes.Ldc_I4_0);
|
||||
mainMethodIl.Emit (OpCodes.Ret);
|
||||
|
||||
typeBuilder.CreateType ();
|
||||
assembly.SetEntryPoint (mainMethod);
|
||||
|
||||
assembly.Save (ASSEMBLY_NAME + ".dll");
|
||||
}
|
||||
[Test]
|
||||
public void FieldsWithSameNameAndType () {
|
||||
// https://bugzilla.xamarin.com/show_bug.cgi?id=57222
|
||||
var typeBuilder = module.DefineType ("type1", TypeAttributes.Public | TypeAttributes.Class);
|
||||
|
||||
var mainMethod = typeBuilder.DefineMethod ("Main", MethodAttributes.Public | MethodAttributes.Static, typeof (int), new Type[0]);
|
||||
var mainMethodIl = mainMethod.GetILGenerator ();
|
||||
|
||||
var f1 = typeBuilder.DefineField ("x", typeof (sbyte), FieldAttributes.Private | FieldAttributes.Static);
|
||||
var f2 = typeBuilder.DefineField ("x", typeof (sbyte), FieldAttributes.Private | FieldAttributes.Static);
|
||||
|
||||
mainMethodIl.Emit (OpCodes.Ldsflda, f1);
|
||||
mainMethodIl.Emit (OpCodes.Ldsflda, f2);
|
||||
mainMethodIl.Emit (OpCodes.Pop);
|
||||
mainMethodIl.Emit (OpCodes.Pop);
|
||||
mainMethodIl.Emit (OpCodes.Ldc_I4_0);
|
||||
mainMethodIl.Emit (OpCodes.Ret);
|
||||
|
||||
typeBuilder.CreateType ();
|
||||
assembly.SetEntryPoint (mainMethod);
|
||||
|
||||
assembly.Save (ASSEMBLY_NAME + ".dll");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MethodsWithSameNameAndSig () {
|
||||
// https://bugzilla.xamarin.com/show_bug.cgi?id=57222
|
||||
var typeBuilder = module.DefineType ("type1", TypeAttributes.Public | TypeAttributes.Class);
|
||||
|
||||
var mainMethod = typeBuilder.DefineMethod ("Main", MethodAttributes.Public | MethodAttributes.Static, typeof (int), new Type[0]);
|
||||
var mainMethodIl = mainMethod.GetILGenerator ();
|
||||
|
||||
var m1 = typeBuilder.DefineMethod ("X", MethodAttributes.Private | MethodAttributes.Static, typeof (void), new Type [0]);
|
||||
var m2 = typeBuilder.DefineMethod ("X", MethodAttributes.Private | MethodAttributes.Static, typeof (void), new Type [0]);
|
||||
m1.GetILGenerator ().Emit (OpCodes.Ret);
|
||||
m2.GetILGenerator ().Emit (OpCodes.Ret);
|
||||
|
||||
mainMethodIl.Emit (OpCodes.Call, m1);
|
||||
mainMethodIl.Emit (OpCodes.Call, m2);
|
||||
mainMethodIl.Emit (OpCodes.Ldc_I4_0);
|
||||
mainMethodIl.Emit (OpCodes.Ret);
|
||||
|
||||
typeBuilder.CreateType ();
|
||||
assembly.SetEntryPoint (mainMethod);
|
||||
|
||||
assembly.Save (ASSEMBLY_NAME + ".dll");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,8 +68,6 @@ namespace MonoTests.System.Security.Cryptography.X509Certificates {
|
||||
public void TearDown ()
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = oldcult;
|
||||
File.Delete("temp.cer");
|
||||
File.Delete("temp.b64");
|
||||
}
|
||||
|
||||
#if !MOBILE && !MONOMAC
|
||||
|
||||
-1
@@ -37,7 +37,6 @@ public void SetUp () {
|
||||
[TearDown]
|
||||
public void TearDown () {
|
||||
Thread.CurrentThread.CurrentCulture = oldcult;
|
||||
File.Delete("temp.b64");
|
||||
try {
|
||||
File.Delete (temp_certificate_filename);
|
||||
} catch {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// CS0128: A local variable named `x' is already defined in this scope
|
||||
// Line: 9
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Foo (out int x);
|
||||
Foo (out int x);
|
||||
}
|
||||
|
||||
static void Foo (out int arg)
|
||||
{
|
||||
arg = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// CS0128: A local variable named `s' is already defined in this scope
|
||||
// Line: 12
|
||||
|
||||
class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
object o = null;
|
||||
|
||||
var x1 = o is string s;
|
||||
var x2 = o is string s;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// CS0136: A local variable named `s' cannot be declared in this scope because it would give a different meaning to `s', which is already used in a `parent or current' scope to denote something else
|
||||
// Line: 10
|
||||
|
||||
internal class Program
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
object o = null;
|
||||
if (o is string s) {
|
||||
int s = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// CS0165: Use of unassigned local variable `s'
|
||||
// Line: 12
|
||||
|
||||
class X
|
||||
{
|
||||
static string Foo (object arg)
|
||||
{
|
||||
if (arg is string s) {
|
||||
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// CS0165: Use of unassigned local variable `v'
|
||||
// Line: 52
|
||||
|
||||
struct Vector3
|
||||
{
|
||||
int field1, field2, field3;
|
||||
}
|
||||
|
||||
public class C
|
||||
{
|
||||
void Update ()
|
||||
{
|
||||
int v1 = 0;
|
||||
int v2 = 0;
|
||||
int v3 = 0;
|
||||
int v4 = 0;
|
||||
int v5 = 0;
|
||||
int v6 = 0;
|
||||
int v7 = 0;
|
||||
int v8 = 0;
|
||||
int v9 = 0;
|
||||
int v10 = 0;
|
||||
int v11 = 0;
|
||||
int v12 = 0;
|
||||
int v13 = 0;
|
||||
int v14 = 0;
|
||||
int v15 = 0;
|
||||
int v16 = 0;
|
||||
int v17 = 0;
|
||||
int v18 = 0;
|
||||
int v19 = 0;
|
||||
int v20 = 0;
|
||||
int v21 = 0;
|
||||
int v22 = 0;
|
||||
int v23 = 0;
|
||||
int v24 = 0;
|
||||
int v25 = 0;
|
||||
int v26 = 0;
|
||||
int v27 = 0;
|
||||
int v29;
|
||||
|
||||
Vector3 v;
|
||||
if (v1 == 0)
|
||||
{
|
||||
v = new Vector3 ();
|
||||
}
|
||||
else if (v2 >= 0.5)
|
||||
{
|
||||
v = new Vector3 ();
|
||||
}
|
||||
|
||||
System.GC.KeepAlive (v);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// CS0165: Use of unassigned local variable `v'
|
||||
// Line: 52
|
||||
|
||||
struct Vector3
|
||||
{
|
||||
int field1, field2, field3;
|
||||
}
|
||||
|
||||
public class C
|
||||
{
|
||||
void Update ()
|
||||
{
|
||||
int v1 = 0;
|
||||
int v2 = 0;
|
||||
int v3 = 0;
|
||||
int v4 = 0;
|
||||
int v5 = 0;
|
||||
int v6 = 0;
|
||||
int v7 = 0;
|
||||
int v8 = 0;
|
||||
int v9 = 0;
|
||||
int v10 = 0;
|
||||
int v11 = 0;
|
||||
int v12 = 0;
|
||||
int v13 = 0;
|
||||
int v14 = 0;
|
||||
int v15 = 0;
|
||||
int v16 = 0;
|
||||
int v17 = 0;
|
||||
int v18 = 0;
|
||||
int v19 = 0;
|
||||
int v20 = 0;
|
||||
int v21 = 0;
|
||||
int v22 = 0;
|
||||
int v23 = 0;
|
||||
int v24 = 0;
|
||||
int v25 = 0;
|
||||
int v26 = 0;
|
||||
int v27 = 0;
|
||||
int v29;
|
||||
|
||||
Vector3 v;
|
||||
while (v8 != 0) {
|
||||
v = new Vector3 ();
|
||||
}
|
||||
|
||||
System.GC.KeepAlive (v);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// CS0815: An implicitly typed local variable declaration cannot be initialized with `void'
|
||||
// Line: 8
|
||||
// Compiler options: -langversion:experimental
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Foo (out var x = Main ());
|
||||
}
|
||||
|
||||
static void Foo (out int i)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
// CS1061: No overload for method `Call' takes `0' arguments
|
||||
// Line: 11
|
||||
|
||||
using System;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main ()
|
||||
{
|
||||
Action<dynamic, object> action = delegate { };
|
||||
Foo (action).NoDynamicBinding ();
|
||||
}
|
||||
|
||||
static T Foo<T>(Action<T, T> x)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
// CS1501: Argument `#1' cannot convert `ref string' expression to type `ref int'
|
||||
// Line: 8
|
||||
// Compiler options: -langversion:experimental
|
||||
|
||||
class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Foo (ref var x = "");
|
||||
}
|
||||
|
||||
static void Foo (ref int i)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 5.0 language specification
|
||||
// Line: 12
|
||||
// CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 5.0 language specification
|
||||
// Line: 9
|
||||
// Compiler options: -langversion:5
|
||||
|
||||
class C
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// CS1644: Feature `pattern matching' cannot be used because it is not part of the C# 6.0 language specification
|
||||
// Line: 9
|
||||
// Compiler options: -langversion:6
|
||||
|
||||
class Class
|
||||
{
|
||||
static void Foo (object arg)
|
||||
{
|
||||
if (arg is Type v) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
// CS4001: Cannot await `void' expression
|
||||
// Line: 10
|
||||
|
||||
using System;
|
||||
|
||||
class A
|
||||
{
|
||||
static async void Test ()
|
||||
{
|
||||
await Console.WriteLine;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// CS8116: The nullable type `byte?' pattern matching is not allowed. Consider using underlying type `byte'
|
||||
// Line: 11
|
||||
|
||||
using System;
|
||||
|
||||
class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
object o2 = null;
|
||||
bool r2 = o2 is Nullable<byte> t3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// CS8117: Cannot use null as pattern matching operand
|
||||
// Line: 8
|
||||
|
||||
class C
|
||||
{
|
||||
static object Test ()
|
||||
{
|
||||
return null is object res;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// CS8122: An expression tree cannot contain a pattern matching operator
|
||||
// Line: 12
|
||||
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
object o = 1;
|
||||
Expression<Func<bool>> e = () => o is int y;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// CS8196: Reference to an implicitly typed out variable `x1' is not permitted in the same argument list
|
||||
// Line: 8
|
||||
|
||||
public class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Test (out var x1, out x1);
|
||||
}
|
||||
|
||||
static void Test (out int x, out int x2)
|
||||
{
|
||||
x = 1;
|
||||
x2 = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// CS8196: Reference to an implicitly typed out variable `x1' is not permitted in the same argument list
|
||||
// Line: 8
|
||||
|
||||
public class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Test (out var x1, out x1);
|
||||
}
|
||||
|
||||
static void Test (out int x, out int x2)
|
||||
{
|
||||
x = 1;
|
||||
x2 = 2;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
// CS8047: Declaration expression cannot be used in this context
|
||||
// Line: 8
|
||||
// Compiler options: -langversion:experimental
|
||||
// CS8197: Cannot infer the type of implicitly-typed out variable `y'
|
||||
// Line: 9
|
||||
|
||||
public class C
|
||||
{
|
||||
@@ -1,6 +1,5 @@
|
||||
// CS8046: An expression tree cannot contain a declaration expression
|
||||
// CS8198: An expression tree cannot contain out variable declaration
|
||||
// Line: 11
|
||||
// Compiler options: -langversion:experimental
|
||||
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
@@ -0,0 +1,13 @@
|
||||
// CS8200: Out variable and pattern variable declarations are not allowed within constructor initializers, field initializers, or property initializers
|
||||
// Line: 6
|
||||
|
||||
public class C
|
||||
{
|
||||
bool res = Foo (out int arg);
|
||||
|
||||
static bool Foo (out int arg)
|
||||
{
|
||||
arg = 2;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// CS8200: Out variable and pattern variable declarations are not allowed within constructor initializers, field initializers, or property initializers
|
||||
// Line: 11
|
||||
|
||||
public class C
|
||||
{
|
||||
bool Prop { get; } = Foo (out int arg);
|
||||
|
||||
static bool Foo (out int arg)
|
||||
{
|
||||
arg = 2;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// CS8200: Out variable and pattern variable declarations are not allowed within constructor initializers, field initializers, or property initializers
|
||||
// Line: 8
|
||||
|
||||
using System;
|
||||
|
||||
public class C
|
||||
{
|
||||
event Action H = Foo (out var res);
|
||||
|
||||
static Action Foo (out int arg)
|
||||
{
|
||||
arg = 2;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// CS8200: Out variable and pattern variable declarations are not allowed within constructor initializers, field initializers, or property initializers
|
||||
// Line: 6
|
||||
|
||||
public class C
|
||||
{
|
||||
bool res = Foo () is string s;
|
||||
|
||||
static object Foo ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// CS8200: Out variable and pattern variable declarations are not allowed within constructor initializers, field initializers, or property initializers
|
||||
// Line: 6
|
||||
|
||||
class X
|
||||
{
|
||||
public static bool Test { get; } = Foo () is bool x;
|
||||
|
||||
static object Foo ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// CS8200: Out variable and pattern variable declarations are not allowed within constructor initializers, field initializers, or property initializers
|
||||
// Line: 11
|
||||
|
||||
public class C
|
||||
{
|
||||
public C (bool value)
|
||||
{
|
||||
}
|
||||
|
||||
public C ()
|
||||
: this (Foo (out int arg))
|
||||
{
|
||||
}
|
||||
|
||||
static bool Foo (out int arg)
|
||||
{
|
||||
arg = 2;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// CS8201: Out variable and pattern variable declarations are not allowed within a query clause
|
||||
// Line: 11
|
||||
|
||||
using System.Linq;
|
||||
|
||||
class Program
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
var a = "abcdef";
|
||||
var res = from x in a from y in M (a, out var z) select x;
|
||||
}
|
||||
|
||||
public static T M<T>(T x, out T z) => z = x;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// CS8208: The type `dynamic' pattern matching is not allowed
|
||||
// Line: 9
|
||||
|
||||
static class Program
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
object o = null;
|
||||
if (o is dynamic res) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
-3
@@ -651,13 +651,35 @@ namespace Mono.CSharp
|
||||
//
|
||||
// Returns dynamic when at least one argument is of dynamic type
|
||||
//
|
||||
public void Resolve (ResolveContext ec, out bool dynamic)
|
||||
public void Resolve (ResolveContext rc, out bool dynamic)
|
||||
{
|
||||
dynamic = false;
|
||||
|
||||
List<LocalVariable> var_locals = null;
|
||||
foreach (Argument a in args) {
|
||||
a.Resolve (ec);
|
||||
if (a.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && !a.IsByRef)
|
||||
a.Resolve (rc);
|
||||
|
||||
if (a.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && !a.IsByRef) {
|
||||
dynamic = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (a.Type == InternalType.VarOutType) {
|
||||
var de = a.Expr as DeclarationExpression;
|
||||
if (de != null) {
|
||||
if (var_locals == null)
|
||||
var_locals = new List<LocalVariable> ();
|
||||
|
||||
var_locals.Add (de.Variable);
|
||||
continue;
|
||||
}
|
||||
|
||||
var lvr = a.Expr as LocalVariableReference;
|
||||
if (lvr != null && var_locals != null && var_locals.Contains (lvr.local_info)) {
|
||||
rc.Report.Error (8196, lvr.Location, "Reference to an implicitly typed out variable `{0}' is not permitted in the same argument list", lvr.Name);
|
||||
lvr.Type = InternalType.ErrorType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2227,7 +2227,7 @@ namespace Mono.CSharp
|
||||
Module.PredefinedAttributes.CompilerGenerated.EmitAttribute (TypeBuilder);
|
||||
|
||||
#if STATIC
|
||||
if (Kind == MemberKind.Struct && HasInstanceField) {
|
||||
if (Kind == MemberKind.Struct && !HasStructLayout && HasInstanceField) {
|
||||
TypeBuilder.__SetLayout (0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,9 @@ namespace Mono.CSharp
|
||||
|
||||
if (rc.HasSet (ResolveContext.Options.BaseInitializer))
|
||||
flags |= ResolveContext.Options.BaseInitializer;
|
||||
|
||||
if (rc.HasSet (ResolveContext.Options.QueryClauseScope))
|
||||
flags |= ResolveContext.Options.QueryClauseScope;
|
||||
}
|
||||
|
||||
public ExceptionStatement CurrentTryBlock { get; set; }
|
||||
@@ -196,6 +199,8 @@ namespace Mono.CSharp
|
||||
|
||||
NameOfScope = 1 << 17,
|
||||
|
||||
QueryClauseScope = 1 << 18,
|
||||
|
||||
///
|
||||
/// Indicates the current context is in probing mode, no errors are reported.
|
||||
///
|
||||
@@ -560,6 +565,11 @@ namespace Mono.CSharp
|
||||
variable.SetAssigned (DefiniteAssignment, generatedAssignment);
|
||||
}
|
||||
|
||||
public void SetVariableAssigned (VariableInfo variable, DefiniteAssignmentBitSet da)
|
||||
{
|
||||
variable.SetAssigned (da, false);
|
||||
}
|
||||
|
||||
public void SetStructFieldAssigned (VariableInfo variable, string name)
|
||||
{
|
||||
variable.SetStructFieldAssigned (DefiniteAssignment, name);
|
||||
|
||||
+37
-57
@@ -918,11 +918,25 @@ named_argument
|
||||
$$ = new NamedArgument (lt.Value, lt.Location, (Expression) $4, arg_mod);
|
||||
lbag.AddLocation ($$, GetLocation($2));
|
||||
}
|
||||
| identifier_inside_body COLON OUT named_argument_expr_or_out_variable_declaration
|
||||
{
|
||||
if (lang_version <= LanguageVersion.V_3)
|
||||
FeatureIsNotAvailable (GetLocation ($1), "named argument");
|
||||
|
||||
var lt = (LocatedToken) $1;
|
||||
$$ = new NamedArgument (lt.Value, lt.Location, (Expression) $4, Argument.AType.Out);
|
||||
lbag.AddLocation ($$, GetLocation($2));
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
named_argument_expr
|
||||
: expression_or_error
|
||||
// | declaration_expression
|
||||
;
|
||||
|
||||
named_argument_expr_or_out_variable_declaration
|
||||
: expression_or_error
|
||||
| out_variable_declaration
|
||||
;
|
||||
|
||||
opt_named_modifier
|
||||
@@ -931,10 +945,6 @@ opt_named_modifier
|
||||
{
|
||||
$$ = Argument.AType.Ref;
|
||||
}
|
||||
| OUT
|
||||
{
|
||||
$$ = Argument.AType.Out;
|
||||
}
|
||||
;
|
||||
|
||||
opt_class_member_declarations
|
||||
@@ -2632,15 +2642,10 @@ event_declarator
|
||||
$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null);
|
||||
lbag.AddLocation ($$, GetLocation ($1));
|
||||
}
|
||||
| COMMA IDENTIFIER ASSIGN
|
||||
| COMMA IDENTIFIER ASSIGN event_variable_initializer
|
||||
{
|
||||
++lexer.parsing_block;
|
||||
}
|
||||
event_variable_initializer
|
||||
{
|
||||
--lexer.parsing_block;
|
||||
var lt = (LocatedToken) $2;
|
||||
$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (Expression) $5);
|
||||
$$ = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (Expression) $4);
|
||||
lbag.AddLocation ($$, GetLocation ($1), GetLocation ($3));
|
||||
}
|
||||
;
|
||||
@@ -2655,11 +2660,19 @@ event_variable_initializer
|
||||
if ((current_event_field.ModFlags & Modifiers.ABSTRACT) != 0) {
|
||||
report.Error (74, lexer.Location, "`{0}': abstract event cannot have an initializer",
|
||||
current_event_field.GetSignatureForError ());
|
||||
}
|
||||
}
|
||||
|
||||
++lexer.parsing_block;
|
||||
current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;
|
||||
start_block (lexer.Location);
|
||||
}
|
||||
variable_initializer
|
||||
{
|
||||
$$ = $2;
|
||||
|
||||
--lexer.parsing_block;
|
||||
end_block (lexer.Location);
|
||||
current_local_parameters = null;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -3722,16 +3735,12 @@ non_simple_argument
|
||||
$$ = new Argument ((Expression) $2, Argument.AType.Ref);
|
||||
lbag.AddLocation ($$, GetLocation ($1));
|
||||
}
|
||||
| REF declaration_expression
|
||||
{
|
||||
$$ = new Argument ((Expression) $2, Argument.AType.Ref);
|
||||
}
|
||||
| OUT variable_reference
|
||||
{
|
||||
$$ = new Argument ((Expression) $2, Argument.AType.Out);
|
||||
lbag.AddLocation ($$, GetLocation ($1));
|
||||
}
|
||||
| OUT declaration_expression
|
||||
| OUT out_variable_declaration
|
||||
{
|
||||
$$ = new Argument ((Expression) $2, Argument.AType.Out);
|
||||
}
|
||||
@@ -3747,46 +3756,17 @@ non_simple_argument
|
||||
}
|
||||
;
|
||||
|
||||
declaration_expression
|
||||
: OPEN_PARENS declaration_expression CLOSE_PARENS
|
||||
out_variable_declaration
|
||||
: variable_type identifier_inside_body
|
||||
{
|
||||
$$ = new ParenthesizedExpression ((Expression) $2, GetLocation ($1));
|
||||
lbag.AddLocation ($$, GetLocation ($1), GetLocation ($3));
|
||||
}
|
||||
/*
|
||||
| CHECKED open_parens_any declaration_expression CLOSE_PARENS
|
||||
{
|
||||
$$ = new CheckedExpr ((Expression) $3, GetLocation ($1));
|
||||
lbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));
|
||||
}
|
||||
| UNCHECKED open_parens_any declaration_expression CLOSE_PARENS
|
||||
{
|
||||
$$ = new UnCheckedExpr ((Expression) $3, GetLocation ($1));
|
||||
lbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));
|
||||
}
|
||||
*/
|
||||
| variable_type identifier_inside_body
|
||||
{
|
||||
if (lang_version != LanguageVersion.Experimental)
|
||||
FeatureIsNotAvailable (GetLocation ($1), "declaration expression");
|
||||
if (lang_version < LanguageVersion.V_7)
|
||||
FeatureIsNotAvailable (GetLocation ($1), "out variable declaration");
|
||||
|
||||
var lt = (LocatedToken) $2;
|
||||
var lv = new LocalVariable (current_block, lt.Value, lt.Location);
|
||||
current_block.AddLocalName (lv);
|
||||
$$ = new DeclarationExpression ((FullNamedExpression) $1, lv);
|
||||
}
|
||||
| variable_type identifier_inside_body ASSIGN expression
|
||||
{
|
||||
if (lang_version != LanguageVersion.Experimental)
|
||||
FeatureIsNotAvailable (GetLocation ($1), "declaration expression");
|
||||
|
||||
var lt = (LocatedToken) $2;
|
||||
var lv = new LocalVariable (current_block, lt.Value, lt.Location);
|
||||
current_block.AddLocalName (lv);
|
||||
$$ = new DeclarationExpression ((FullNamedExpression) $1, lv) {
|
||||
Initializer = (Expression) $4
|
||||
};
|
||||
}
|
||||
;
|
||||
|
||||
variable_reference
|
||||
@@ -4487,12 +4467,13 @@ additive_expression
|
||||
{
|
||||
var is_expr = new Is ((Expression) $1, (Expression) $3, GetLocation ($2));
|
||||
if ($4 != null) {
|
||||
if (lang_version != LanguageVersion.Experimental)
|
||||
FeatureIsNotAvailable (GetLocation ($4), "type pattern matching");
|
||||
if (lang_version < LanguageVersion.V_7)
|
||||
FeatureIsNotAvailable (GetLocation ($4), "pattern matching");
|
||||
|
||||
var lt = (LocatedToken) $4;
|
||||
is_expr.Variable = new LocalVariable (current_block, lt.Value, lt.Location);
|
||||
current_block.AddLocalName (is_expr.Variable);
|
||||
var lv = new LocalVariable (current_block, lt.Value, lt.Location);
|
||||
is_expr.Variable = lv;
|
||||
current_block.AddLocalName (lv);
|
||||
}
|
||||
|
||||
$$ = is_expr;
|
||||
@@ -7725,8 +7706,7 @@ void start_block (Location loc)
|
||||
}
|
||||
}
|
||||
|
||||
Block
|
||||
end_block (Location loc)
|
||||
Block end_block (Location loc)
|
||||
{
|
||||
Block retval = current_block.Explicit;
|
||||
retval.SetEndLocation (loc);
|
||||
|
||||
@@ -1325,7 +1325,8 @@ namespace Mono.CSharp
|
||||
}
|
||||
|
||||
if (d == '.') {
|
||||
return Token.INTERR_OPERATOR;
|
||||
d = reader.Peek ();
|
||||
return d >= '0' && d <= '9' ? Token.INTERR : Token.INTERR_OPERATOR;
|
||||
}
|
||||
|
||||
if (d != ' ') {
|
||||
|
||||
+1
-1
@@ -282,7 +282,7 @@ namespace Mono.CSharp
|
||||
foreach (var arg in arguments) {
|
||||
if (arg.Type == InternalType.VarOutType) {
|
||||
// Should be special error message about dynamic dispatch
|
||||
rc.Report.Error (8047, arg.Expr.Location, "Declaration expression cannot be used in this context");
|
||||
rc.Report.Error (8197, arg.Expr.Location, "Cannot infer the type of implicitly-typed out variable `{0}'", ((DeclarationExpression) arg.Expr).Variable.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -239,6 +239,15 @@ namespace Mono.CSharp {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void CheckExpressionVariable (ResolveContext rc)
|
||||
{
|
||||
if (rc.HasAny (ResolveContext.Options.BaseInitializer | ResolveContext.Options.FieldInitializerScope)) {
|
||||
rc.Report.Error (8200, loc, "Out variable and pattern variable declarations are not allowed within constructor initializers, field initializers, or property initializers");
|
||||
} else if (rc.HasSet (ResolveContext.Options.QueryClauseScope)) {
|
||||
rc.Report.Error (8201, loc, "Out variable and pattern variable declarations are not allowed within a query clause");
|
||||
}
|
||||
}
|
||||
|
||||
public static void ErrorIsInaccesible (IMemberContext rc, string member, Location loc)
|
||||
{
|
||||
rc.Module.Compiler.Report.Error (122, loc, "`{0}' is inaccessible due to its protection level", member);
|
||||
@@ -638,6 +647,10 @@ namespace Mono.CSharp {
|
||||
ec.Emit (OpCodes.Pop);
|
||||
}
|
||||
|
||||
public virtual void EmitPrepare (EmitContext ec)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Emits the expression into temporary field variable. The method
|
||||
// should be used for await expressions only
|
||||
|
||||
+61
-7
@@ -1490,6 +1490,11 @@ namespace Mono.CSharp
|
||||
expr.EmitSideEffect (ec);
|
||||
}
|
||||
|
||||
public override void EmitPrepare (EmitContext ec)
|
||||
{
|
||||
expr.EmitPrepare (ec);
|
||||
}
|
||||
|
||||
public override void FlowAnalysis (FlowAnalysisContext fc)
|
||||
{
|
||||
expr.FlowAnalysis (fc);
|
||||
@@ -1535,7 +1540,7 @@ namespace Mono.CSharp
|
||||
public override Expression CreateExpressionTree (ResolveContext ec)
|
||||
{
|
||||
if (Variable != null)
|
||||
throw new NotSupportedException ();
|
||||
ec.Report.Error (8122, loc, "An expression tree cannot contain a pattern matching operator");
|
||||
|
||||
Arguments args = Arguments.CreateForExpressionTree (ec, null,
|
||||
expr.CreateExpressionTree (ec),
|
||||
@@ -1590,6 +1595,14 @@ namespace Mono.CSharp
|
||||
ec.Emit (on_true ? OpCodes.Brtrue : OpCodes.Brfalse, target);
|
||||
}
|
||||
|
||||
public override void EmitPrepare (EmitContext ec)
|
||||
{
|
||||
base.EmitPrepare (ec);
|
||||
|
||||
if (Variable != null)
|
||||
Variable.CreateBuilder (ec);
|
||||
}
|
||||
|
||||
void EmitPatternMatch (EmitContext ec)
|
||||
{
|
||||
var no_match = ec.DefineLabel ();
|
||||
@@ -1695,7 +1708,13 @@ namespace Mono.CSharp
|
||||
value_on_stack = false;
|
||||
}
|
||||
|
||||
Variable.CreateBuilder (ec);
|
||||
//
|
||||
// It's ok to have variable builder create out of order. It simplified emit
|
||||
// of statements like while (condition) { }
|
||||
//
|
||||
if (!Variable.Created)
|
||||
Variable.CreateBuilder (ec);
|
||||
|
||||
Variable.EmitAssign (ec);
|
||||
|
||||
if (expr_unwrap != null) {
|
||||
@@ -1739,6 +1758,21 @@ namespace Mono.CSharp
|
||||
fc.SetVariableAssigned (Variable.VariableInfo, true);
|
||||
}
|
||||
|
||||
public override void FlowAnalysisConditional (FlowAnalysisContext fc)
|
||||
{
|
||||
if (Variable == null) {
|
||||
base.FlowAnalysisConditional (fc);
|
||||
return;
|
||||
}
|
||||
|
||||
expr.FlowAnalysis (fc);
|
||||
|
||||
fc.DefiniteAssignmentOnTrue = fc.BranchDefiniteAssignment ();
|
||||
fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
|
||||
|
||||
fc.SetVariableAssigned (Variable.VariableInfo, fc.DefiniteAssignmentOnTrue);
|
||||
}
|
||||
|
||||
protected override void ResolveProbeType (ResolveContext rc)
|
||||
{
|
||||
if (!(ProbeType is TypeExpr) && rc.Module.Compiler.Settings.Version == LanguageVersion.Experimental) {
|
||||
@@ -1849,6 +1883,15 @@ namespace Mono.CSharp
|
||||
|
||||
Expression ResolveResultExpression (ResolveContext ec)
|
||||
{
|
||||
if (Variable != null) {
|
||||
if (expr is NullLiteral) {
|
||||
ec.Report.Error (8117, loc, "Cannot use null as pattern matching operand");
|
||||
return this;
|
||||
}
|
||||
|
||||
CheckExpressionVariable (ec);
|
||||
}
|
||||
|
||||
TypeSpec d = expr.Type;
|
||||
bool d_is_nullable = false;
|
||||
|
||||
@@ -1856,7 +1899,7 @@ namespace Mono.CSharp
|
||||
// If E is a method group or the null literal, or if the type of E is a reference
|
||||
// type or a nullable type and the value of E is null, the result is false
|
||||
//
|
||||
if (expr.IsNull || expr.eclass == ExprClass.MethodGroup)
|
||||
if (expr.IsNull)
|
||||
return CreateConstantResult (ec, false);
|
||||
|
||||
if (d.IsNullableType) {
|
||||
@@ -1870,6 +1913,11 @@ namespace Mono.CSharp
|
||||
TypeSpec t = probe_type_expr;
|
||||
bool t_is_nullable = false;
|
||||
if (t.IsNullableType) {
|
||||
if (Variable != null) {
|
||||
ec.Report.Error (8116, loc, "The nullable type `{0}' pattern matching is not allowed. Consider using underlying type `{1}'",
|
||||
t.GetSignatureForError (), Nullable.NullableInfo.GetUnderlyingType (t).GetSignatureForError ());
|
||||
}
|
||||
|
||||
var ut = Nullable.NullableInfo.GetUnderlyingType (t);
|
||||
if (!ut.IsGenericParameter) {
|
||||
t = ut;
|
||||
@@ -1914,9 +1962,13 @@ namespace Mono.CSharp
|
||||
return ResolveGenericParameter (ec, d, tps);
|
||||
|
||||
if (t.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
|
||||
ec.Report.Warning (1981, 3, loc,
|
||||
"Using `{0}' to test compatibility with `{1}' is identical to testing compatibility with `object'",
|
||||
OperatorName, t.GetSignatureForError ());
|
||||
if (Variable != null) {
|
||||
ec.Report.Error (8208, loc, "The type `{0}' pattern matching is not allowed", t.GetSignatureForError ());
|
||||
} else {
|
||||
ec.Report.Warning (1981, 3, loc,
|
||||
"Using `{0}' to test compatibility with `{1}' is identical to testing compatibility with `object'",
|
||||
OperatorName, t.GetSignatureForError ());
|
||||
}
|
||||
}
|
||||
|
||||
if (TypeManager.IsGenericParameter (d))
|
||||
@@ -2562,12 +2614,14 @@ namespace Mono.CSharp
|
||||
|
||||
public override Expression CreateExpressionTree (ResolveContext rc)
|
||||
{
|
||||
rc.Report.Error (8046, loc, "An expression tree cannot contain a declaration expression");
|
||||
rc.Report.Error (8198, loc, "An expression tree cannot contain out variable declaration");
|
||||
return null;
|
||||
}
|
||||
|
||||
bool DoResolveCommon (ResolveContext rc)
|
||||
{
|
||||
CheckExpressionVariable (rc);
|
||||
|
||||
var var_expr = VariableType as VarExpr;
|
||||
if (var_expr != null) {
|
||||
type = InternalType.VarOutType;
|
||||
|
||||
+4
-3
@@ -79,10 +79,11 @@ namespace Mono.CSharp.Linq
|
||||
{
|
||||
}
|
||||
|
||||
protected override MethodGroupExpr DoResolveOverload (ResolveContext ec)
|
||||
protected override MethodGroupExpr DoResolveOverload (ResolveContext rc)
|
||||
{
|
||||
MethodGroupExpr rmg = mg.OverloadResolve (ec, ref arguments, this, OverloadResolver.Restrictions.None);
|
||||
return rmg;
|
||||
using (rc.Set (ResolveContext.Options.QueryClauseScope)) {
|
||||
return mg.OverloadResolve (rc, ref arguments, this, OverloadResolver.Restrictions.None);
|
||||
}
|
||||
}
|
||||
|
||||
protected override Expression DoResolveDynamic (ResolveContext ec, Expression memberExpr)
|
||||
|
||||
+11
-2
@@ -269,7 +269,7 @@ namespace Mono.CSharp {
|
||||
|
||||
var da_false = new DefiniteAssignmentBitSet (fc.DefiniteAssignmentOnFalse);
|
||||
|
||||
fc.DefiniteAssignment = fc.DefiniteAssignmentOnTrue;
|
||||
fc.BranchDefiniteAssignment (fc.DefiniteAssignmentOnTrue);
|
||||
var labels = fc.CopyLabelStack ();
|
||||
|
||||
var res = TrueStatement.FlowAnalysis (fc);
|
||||
@@ -558,6 +558,8 @@ namespace Mono.CSharp {
|
||||
ec.Emit (OpCodes.Br, ec.LoopBegin);
|
||||
ec.MarkLabel (while_loop);
|
||||
|
||||
expr.EmitPrepare (ec);
|
||||
|
||||
Statement.Emit (ec);
|
||||
|
||||
ec.MarkLabel (ec.LoopBegin);
|
||||
@@ -576,9 +578,10 @@ namespace Mono.CSharp {
|
||||
{
|
||||
expr.FlowAnalysisConditional (fc);
|
||||
|
||||
fc.DefiniteAssignment = fc.DefiniteAssignmentOnTrue;
|
||||
var da_false = new DefiniteAssignmentBitSet (fc.DefiniteAssignmentOnFalse);
|
||||
|
||||
fc.BranchDefiniteAssignment (fc.DefiniteAssignmentOnTrue);
|
||||
|
||||
Statement.FlowAnalysis (fc);
|
||||
|
||||
//
|
||||
@@ -2433,6 +2436,12 @@ namespace Mono.CSharp {
|
||||
}
|
||||
}
|
||||
|
||||
public bool Created {
|
||||
get {
|
||||
return builder != null;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDeclared {
|
||||
get {
|
||||
return type != null;
|
||||
|
||||
@@ -170,6 +170,11 @@ public class ConditionalParsing
|
||||
var t = (Int32)sbyte.MaxValue;
|
||||
}
|
||||
|
||||
void Test_22 (bool args)
|
||||
{
|
||||
var x = args ?.2f : -.2f;
|
||||
}
|
||||
|
||||
static void Helper<T> (T arg)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
# csXXXX.cs IGNORE : adds test to ignore list
|
||||
|
||||
gtest-230.cs
|
||||
test-pattern-02.cs
|
||||
@@ -1,10 +1,18 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public struct MyStruct
|
||||
{
|
||||
public int X { get; set; }
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential, Pack = 1)]
|
||||
public struct MyStruct2
|
||||
{
|
||||
public IntPtr handle;
|
||||
public uint type_reference;
|
||||
}
|
||||
|
||||
class X
|
||||
{
|
||||
public static int Main ()
|
||||
@@ -14,6 +22,14 @@ class X
|
||||
if (s.StructLayoutAttribute.Size != 0)
|
||||
return 1;
|
||||
|
||||
var s2 = typeof (MyStruct2);
|
||||
|
||||
if (s2.StructLayoutAttribute.Size != 0)
|
||||
return 2;
|
||||
|
||||
if (s2.StructLayoutAttribute.Pack != 1)
|
||||
return 3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// Compiler options: -langversion:experimental
|
||||
using System;
|
||||
|
||||
class DeclarationExpression
|
||||
@@ -14,29 +13,13 @@ class DeclarationExpression
|
||||
return 2;
|
||||
}
|
||||
|
||||
Out (out int o2 = 2);
|
||||
if (o2 != 3)
|
||||
return 3;
|
||||
|
||||
Out (out var o3);
|
||||
if (o3 != 3)
|
||||
return 4;
|
||||
|
||||
Ref (ref int r = 2);
|
||||
if (r != 7)
|
||||
return 5;
|
||||
|
||||
Ref (ref ((var r2 = 3)));
|
||||
if (r2 != 8)
|
||||
return 6;
|
||||
|
||||
// Out2 (str: "b", v: out var o5);
|
||||
// if (o5 != 9)
|
||||
// return 7;
|
||||
|
||||
Out3 (out var o6 = 9m);
|
||||
if (o6.GetType () != typeof (decimal))
|
||||
return 8;
|
||||
Out2 (str: "b", v: out var o5);
|
||||
if (o5 != 9)
|
||||
return 7;
|
||||
|
||||
Console.WriteLine ("ok");
|
||||
return 0;
|
||||
@@ -53,14 +36,4 @@ class DeclarationExpression
|
||||
v = 9;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void Out3<T> (out T t)
|
||||
{
|
||||
t = default (T);
|
||||
}
|
||||
|
||||
static void Ref (ref int arg)
|
||||
{
|
||||
arg += 5;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,11 @@
|
||||
// Compiler options: -langversion:experimental
|
||||
using System;
|
||||
|
||||
using static System.Console;
|
||||
|
||||
public class DeclarationExpressions
|
||||
public class C
|
||||
{
|
||||
public static void Main()
|
||||
public static void Main ()
|
||||
{
|
||||
// TODO:
|
||||
//Test (int value = 5);
|
||||
//WriteLine (value);
|
||||
}
|
||||
|
||||
void M2 ()
|
||||
{
|
||||
// for (int i = 0; int v = 2; ++i) {
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
static int Test (int x)
|
||||
{
|
||||
WriteLine (x);
|
||||
return x;
|
||||
}
|
||||
bool Test1 => int.TryParse ("1", out int x);
|
||||
int Test2 => int.TryParse ("2", out int x) ? x : 0;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
public class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
var a = "abcdef";
|
||||
|
||||
var t1 = from x in Foo (a, out var q1) select x;
|
||||
var t2 = from x in a join y in Foo (a, out var q2) on x equals y select x;
|
||||
}
|
||||
|
||||
public static T Foo<T> (T x, out T z) => z = x;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
public class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Test2 (Test (out var x1), x1);
|
||||
}
|
||||
|
||||
static int Test (out int x)
|
||||
{
|
||||
x = 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int Test2 (int x, int y)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
// Compiler options: -langversion:experimental
|
||||
|
||||
using System;
|
||||
|
||||
class TypePattern
|
||||
@@ -8,31 +6,14 @@ class TypePattern
|
||||
{
|
||||
object o = 3;
|
||||
bool r = o is System.String t1;
|
||||
if (t1 != null)
|
||||
return 1;
|
||||
|
||||
if (r)
|
||||
return 2;
|
||||
|
||||
if (o is string t2)
|
||||
return 3;
|
||||
|
||||
if (t2 != null)
|
||||
return 4;
|
||||
|
||||
object o2 = (int?) 4;
|
||||
bool r2 = o2 is byte? t3;
|
||||
|
||||
if (t3 != null)
|
||||
return 5;
|
||||
|
||||
if (r2)
|
||||
return 6;
|
||||
|
||||
long? l = 5;
|
||||
bool r3 = l is long t4;
|
||||
if (t4 != 5)
|
||||
return 7;
|
||||
|
||||
if (!r3)
|
||||
return 8;
|
||||
@@ -40,4 +21,22 @@ class TypePattern
|
||||
Console.WriteLine ("ok");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Test1 (object arg)
|
||||
{
|
||||
while (arg is int b) {
|
||||
b = 2;
|
||||
}
|
||||
}
|
||||
|
||||
static string Test2 (object arg)
|
||||
{
|
||||
if (arg is string s) {
|
||||
return s;
|
||||
} else {
|
||||
s = "";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
||||
@@ -48,14 +48,14 @@ class ConstantPattern
|
||||
|
||||
object o4 = (byte?)255;
|
||||
var ggg = o4 is 255;
|
||||
if (!ggg)
|
||||
if (ggg)
|
||||
return 8;
|
||||
|
||||
if (o4 is null)
|
||||
return 9;
|
||||
|
||||
object o5 = (double)-255;
|
||||
if (!(o5 is -byte.MaxValue))
|
||||
if (o5 is -byte.MaxValue)
|
||||
return 10;
|
||||
|
||||
object o6 = MyEnum.V_4;
|
||||
|
||||
@@ -14651,6 +14651,9 @@
|
||||
<method name="Void Test_21()" attrs="129">
|
||||
<size>5</size>
|
||||
</method>
|
||||
<method name="Void Test_22(Boolean)" attrs="129">
|
||||
<size>24</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="gtest-410.cs">
|
||||
@@ -52716,7 +52719,7 @@
|
||||
</type>
|
||||
<type name="X">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>44</size>
|
||||
<size>102</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
@@ -68400,7 +68403,7 @@
|
||||
<test name="test-decl-expr-01.cs">
|
||||
<type name="DeclarationExpression">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>223</size>
|
||||
<size>121</size>
|
||||
</method>
|
||||
<method name="Boolean Out(Int32 ByRef)" attrs="145">
|
||||
<size>13</size>
|
||||
@@ -68408,28 +68411,63 @@
|
||||
<method name="Boolean Out2(Int32 ByRef, System.String)" attrs="145">
|
||||
<size>14</size>
|
||||
</method>
|
||||
<method name="Void Out3[T](T ByRef)" attrs="145">
|
||||
<size>17</size>
|
||||
</method>
|
||||
<method name="Void Ref(Int32 ByRef)" attrs="145">
|
||||
<size>8</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-decl-expr-02.cs">
|
||||
<type name="DeclarationExpressions">
|
||||
<type name="C">
|
||||
<method name="Void Main()" attrs="150">
|
||||
<size>2</size>
|
||||
</method>
|
||||
<method name="Void M2()" attrs="129">
|
||||
<size>2</size>
|
||||
<method name="Boolean get_Test1()" attrs="2177">
|
||||
<size>20</size>
|
||||
</method>
|
||||
<method name="Int32 Test(Int32)" attrs="145">
|
||||
<method name="Int32 get_Test2()" attrs="2177">
|
||||
<size>32</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-decl-expr-03.cs">
|
||||
<type name="C">
|
||||
<method name="Void Main()" attrs="150">
|
||||
<size>153</size>
|
||||
</method>
|
||||
<method name="T Foo[T](T, T ByRef)" attrs="150">
|
||||
<size>18</size>
|
||||
</method>
|
||||
<method name="Char <Main>m__0(Char)" attrs="145">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Char <Main>m__1(Char)" attrs="145">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Char <Main>m__2(Char)" attrs="145">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Char <Main>m__3(Char, Char)" attrs="145">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-decl-expr-04.cs">
|
||||
<type name="C">
|
||||
<method name="Void Main()" attrs="150">
|
||||
<size>16</size>
|
||||
</method>
|
||||
<method name="Int32 Test(Int32 ByRef)" attrs="145">
|
||||
<size>13</size>
|
||||
</method>
|
||||
<method name="Int32 Test2(Int32, Int32)" attrs="145">
|
||||
<size>10</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
@@ -72183,30 +72221,16 @@
|
||||
<test name="test-pattern-01.cs">
|
||||
<type name="TypePattern">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>227</size>
|
||||
<size>118</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
<test name="test-pattern-02.cs">
|
||||
<type name="ConstantPattern">
|
||||
<method name="Int32 Main()" attrs="150">
|
||||
<size>609</size>
|
||||
<method name="Void Test1(System.Object)" attrs="145">
|
||||
<size>24</size>
|
||||
</method>
|
||||
<method name="Void .ctor()" attrs="6278">
|
||||
<size>7</size>
|
||||
</method>
|
||||
</type>
|
||||
<type name="<PatternMatchingHelper>">
|
||||
<method name="Boolean NumberMatcher(System.Object, System.Object, Boolean)" attrs="150">
|
||||
<size>69</size>
|
||||
</method>
|
||||
</type>
|
||||
<type name="ConstantPattern">
|
||||
<method name="Boolean Generic[T](T)" attrs="145">
|
||||
<size>28</size>
|
||||
<method name="System.String Test2(System.Object)" attrs="145">
|
||||
<size>39</size>
|
||||
</method>
|
||||
</type>
|
||||
</test>
|
||||
|
||||
@@ -5,6 +5,9 @@ include ../../build/rules.make
|
||||
LOCAL_MCS_FLAGS =
|
||||
LIB_REFS = System
|
||||
|
||||
# IMPORTANT: we need to keep the old copy of Cecil we have in this folder since newer Cecil
|
||||
# doesn't support keeping metadata tokens the same which would break AOT compilation
|
||||
|
||||
PROGRAM = mono-cil-strip.exe
|
||||
|
||||
include ../../build/executable.make
|
||||
@@ -1,991 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.0</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7B3D8F99-304A-4C2E-BAC5-7D1A29747B01}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>cilstrip</RootNamespace>
|
||||
<AssemblyName>cil-strip</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<Commandlineparameters>/Users/sebastienpouliot/Dropbox/iCatalogXniOS.exe /Users/sebastienpouliot/Dropbox/iCatalogXniOS-out.exe</Commandlineparameters>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Externalconsole>true</Externalconsole>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Folder Include="cil-strip\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyStripper.cs">
|
||||
<Link>cil-strip\AssemblyStripper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="cilstrip.cs">
|
||||
<Link>cil-strip\cilstrip.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AggressiveReflectionReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AggressiveReflectionReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ArrayDimension.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ArrayDimension.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ArrayDimensionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ArrayDimensionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ArrayType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ArrayType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyFactory.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyFactory.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyFlags.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyFlags.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyHashAlgorithm.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyHashAlgorithm.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyInfo.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyKind.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyKind.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyLinkedResource.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyLinkedResource.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyNameDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyNameDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyNameReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyNameReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\AssemblyNameReferenceCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\AssemblyNameReferenceCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\BaseAssemblyResolver.cs">
|
||||
<Link>cil-strip\Mono.Cecil\BaseAssemblyResolver.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\BaseReflectionReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil\BaseReflectionReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\BaseReflectionVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil\BaseReflectionVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\BaseStructureVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil\BaseStructureVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\CallSite.cs">
|
||||
<Link>cil-strip\Mono.Cecil\CallSite.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\CompactFrameworkCompatibility.cs">
|
||||
<Link>cil-strip\Mono.Cecil\CompactFrameworkCompatibility.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\Constants.cs">
|
||||
<Link>cil-strip\Mono.Cecil\Constants.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ConstraintCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ConstraintCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ConstructorCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ConstructorCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\CustomAttribute.cs">
|
||||
<Link>cil-strip\Mono.Cecil\CustomAttribute.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\CustomAttributeCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\CustomAttributeCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\DefaultAssemblyResolver.cs">
|
||||
<Link>cil-strip\Mono.Cecil\DefaultAssemblyResolver.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\DefaultImporter.cs">
|
||||
<Link>cil-strip\Mono.Cecil\DefaultImporter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\EmbeddedResource.cs">
|
||||
<Link>cil-strip\Mono.Cecil\EmbeddedResource.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\EventAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\EventAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\EventDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\EventDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\EventDefinitionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\EventDefinitionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\EventReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\EventReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ExternTypeCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ExternTypeCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\FieldAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\FieldAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\FieldDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\FieldDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\FieldDefinitionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\FieldDefinitionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\FieldReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\FieldReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\FileAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\FileAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\FunctionPointerType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\FunctionPointerType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\GenericArgumentCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\GenericArgumentCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\GenericContext.cs">
|
||||
<Link>cil-strip\Mono.Cecil\GenericContext.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\GenericInstanceMethod.cs">
|
||||
<Link>cil-strip\Mono.Cecil\GenericInstanceMethod.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\GenericInstanceType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\GenericInstanceType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\GenericParameter.cs">
|
||||
<Link>cil-strip\Mono.Cecil\GenericParameter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\GenericParameterAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\GenericParameterAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\GenericParameterCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\GenericParameterCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\HashCodeProvider.cs">
|
||||
<Link>cil-strip\Mono.Cecil\HashCodeProvider.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IAnnotationProvider.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IAnnotationProvider.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IAssemblyResolver.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IAssemblyResolver.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ICustomAttributeProvider.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ICustomAttributeProvider.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IDetailReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IDetailReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IGenericInstance.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IGenericInstance.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IGenericParameterProvider.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IGenericParameterProvider.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IHasConstant.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IHasConstant.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IHasMarshalSpec.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IHasMarshalSpec.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IHasSecurity.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IHasSecurity.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IImporter.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IImporter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IMemberDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IMemberDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IMemberReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IMemberReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IMetadataScope.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IMetadataScope.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IMetadataTokenProvider.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IMetadataTokenProvider.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IMethodSignature.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IMethodSignature.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IReflectionStructureVisitable.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IReflectionStructureVisitable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IReflectionStructureVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IReflectionStructureVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IReflectionVisitable.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IReflectionVisitable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IReflectionVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IReflectionVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\IRequireResolving.cs">
|
||||
<Link>cil-strip\Mono.Cecil\IRequireResolving.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ImportContext.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ImportContext.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\InterfaceCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\InterfaceCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\LinkedResource.cs">
|
||||
<Link>cil-strip\Mono.Cecil\LinkedResource.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ManifestResourceAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ManifestResourceAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MarshalSpec.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MarshalSpec.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MemberReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MemberReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MemberReferenceCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MemberReferenceCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MetadataResolver.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MetadataResolver.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodCallingConvention.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodCallingConvention.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodDefinitionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodDefinitionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodImplAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodImplAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodReturnType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodReturnType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodSemanticsAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodSemanticsAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\MethodSpecification.cs">
|
||||
<Link>cil-strip\Mono.Cecil\MethodSpecification.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\Modifiers.cs">
|
||||
<Link>cil-strip\Mono.Cecil\Modifiers.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ModuleDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ModuleDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ModuleDefinitionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ModuleDefinitionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ModuleReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ModuleReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ModuleReferenceCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ModuleReferenceCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\NameObjectCollectionBase.cs">
|
||||
<Link>cil-strip\Mono.Cecil\NameObjectCollectionBase.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\NativeType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\NativeType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\NestedTypeCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\NestedTypeCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\NullReferenceImporter.cs">
|
||||
<Link>cil-strip\Mono.Cecil\NullReferenceImporter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\OverrideCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\OverrideCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\PInvokeAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\PInvokeAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\PInvokeInfo.cs">
|
||||
<Link>cil-strip\Mono.Cecil\PInvokeInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ParameterAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ParameterAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ParameterDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ParameterDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ParameterDefinitionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ParameterDefinitionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ParameterReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ParameterReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\PinnedType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\PinnedType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\PointerType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\PointerType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\PropertyAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\PropertyAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\PropertyDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\PropertyDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\PropertyDefinitionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\PropertyDefinitionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\PropertyReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\PropertyReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ReferenceType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ReferenceType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ReflectionController.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ReflectionController.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ReflectionException.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ReflectionException.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ReflectionHelper.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ReflectionHelper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ReflectionReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ReflectionReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ReflectionWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ReflectionWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\Resource.cs">
|
||||
<Link>cil-strip\Mono.Cecil\Resource.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\ResourceCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\ResourceCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\SecurityAction.cs">
|
||||
<Link>cil-strip\Mono.Cecil\SecurityAction.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\SecurityDeclaration.cs">
|
||||
<Link>cil-strip\Mono.Cecil\SecurityDeclaration.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\SecurityDeclarationCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\SecurityDeclarationCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\SecurityDeclarationReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil\SecurityDeclarationReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\SentinelType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\SentinelType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\StructureReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil\StructureReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\StructureWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil\StructureWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\TableComparers.cs">
|
||||
<Link>cil-strip\Mono.Cecil\TableComparers.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\TargetRuntime.cs">
|
||||
<Link>cil-strip\Mono.Cecil\TargetRuntime.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\TypeAttributes.cs">
|
||||
<Link>cil-strip\Mono.Cecil\TypeAttributes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\TypeDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil\TypeDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\TypeDefinitionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\TypeDefinitionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\TypeReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil\TypeReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\TypeReferenceCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil\TypeReferenceCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\TypeSpecification.cs">
|
||||
<Link>cil-strip\Mono.Cecil\TypeSpecification.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil\VariantType.cs">
|
||||
<Link>cil-strip\Mono.Cecil\VariantType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\BaseImageVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\BaseImageVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\CLIHeader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\CLIHeader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\CopyImageVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\CopyImageVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\DOSHeader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\DOSHeader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\DataDirectory.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\DataDirectory.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\DebugHeader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\DebugHeader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\DebugStoreType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\DebugStoreType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ExportTable.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ExportTable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\IBinaryVisitable.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\IBinaryVisitable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\IBinaryVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\IBinaryVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\IHeader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\IHeader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\Image.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\Image.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ImageCharacteristics.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ImageCharacteristics.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ImageFormatException.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ImageFormatException.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ImageInitializer.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ImageInitializer.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ImageReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ImageReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ImageWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ImageWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\Imports.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\Imports.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\MemoryBinaryWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\MemoryBinaryWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\PEFileHeader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\PEFileHeader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\PEOptionalHeader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\PEOptionalHeader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\RVA.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\RVA.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ResourceDataEntry.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ResourceDataEntry.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ResourceDirectoryEntry.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ResourceDirectoryEntry.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ResourceDirectoryString.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ResourceDirectoryString.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ResourceDirectoryTable.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ResourceDirectoryTable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ResourceNode.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ResourceNode.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ResourceReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ResourceReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\ResourceWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\ResourceWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\RuntimeImage.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\RuntimeImage.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\Section.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\Section.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\SectionCharacteristics.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\SectionCharacteristics.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\SectionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\SectionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Binary\SubSystem.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Binary\SubSystem.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\BaseCodeVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\BaseCodeVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\CilWorker.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\CilWorker.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\Code.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\Code.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\CodeReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\CodeReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\CodeWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\CodeWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\Document.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\Document.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\DocumentHashAlgorithm.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\DocumentHashAlgorithm.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\DocumentLanguage.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\DocumentLanguage.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\DocumentLanguageVendor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\DocumentLanguageVendor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\DocumentType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\DocumentType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ExceptionHandler.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ExceptionHandler.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ExceptionHandlerCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ExceptionHandlerCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ExceptionHandlerType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ExceptionHandlerType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\FlowControl.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\FlowControl.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\GuidAttribute.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\GuidAttribute.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ICodeVisitable.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ICodeVisitable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ICodeVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ICodeVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\IScopeProvider.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\IScopeProvider.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ISymbolReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ISymbolReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ISymbolStoreFactory.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ISymbolStoreFactory.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ISymbolWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ISymbolWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\IVariableDefinitionProvider.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\IVariableDefinitionProvider.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\Instruction.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\Instruction.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\InstructionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\InstructionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\MethodBody.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\MethodBody.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\MethodDataSection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\MethodDataSection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\MethodHeader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\MethodHeader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\OpCode.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\OpCode.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\OpCodeNames.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\OpCodeNames.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\OpCodeType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\OpCodeType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\OpCodes.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\OpCodes.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\OperandType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\OperandType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\Scope.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\Scope.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\ScopeCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\ScopeCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\SequencePoint.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\SequencePoint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\StackBehaviour.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\StackBehaviour.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\SymbolStoreHelper.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\SymbolStoreHelper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\VariableDefinition.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\VariableDefinition.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\VariableDefinitionCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\VariableDefinitionCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Cil\VariableReference.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Cil\VariableReference.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Assembly.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Assembly.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\AssemblyOS.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\AssemblyOS.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\AssemblyProcessor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\AssemblyProcessor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\AssemblyRef.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\AssemblyRef.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\AssemblyRefOS.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\AssemblyRefOS.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\AssemblyRefProcessor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\AssemblyRefProcessor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\BaseMetadataVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\BaseMetadataVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\BlobHeap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\BlobHeap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\ClassLayout.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\ClassLayout.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\CodedIndex.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\CodedIndex.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Constant.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Constant.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\CultureUtils.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\CultureUtils.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\CustomAttribute.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\CustomAttribute.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\DeclSecurity.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\DeclSecurity.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\ElementType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\ElementType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Event.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Event.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\EventMap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\EventMap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\EventPtr.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\EventPtr.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\ExportedType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\ExportedType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Field.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Field.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\FieldLayout.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\FieldLayout.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\FieldMarshal.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\FieldMarshal.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\FieldPtr.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\FieldPtr.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\FieldRVA.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\FieldRVA.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\File.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\File.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\GenericParam.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\GenericParam.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\GenericParamConstraint.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\GenericParamConstraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\GuidHeap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\GuidHeap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\IMetadataRow.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\IMetadataRow.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\IMetadataTable.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\IMetadataTable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\IMetadataVisitable.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\IMetadataVisitable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\IMetadataVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\IMetadataVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\ImplMap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\ImplMap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\InterfaceImpl.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\InterfaceImpl.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\ManifestResource.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\ManifestResource.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MemberRef.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MemberRef.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataFormatException.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataFormatException.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataHeap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataHeap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataInitializer.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataInitializer.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataRoot.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataRoot.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataRowReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataRowReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataRowWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataRowWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataStream.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataStream.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataStreamCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataStreamCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataTableReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataTableReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataTableWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataTableWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataToken.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataToken.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MetadataWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MetadataWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Method.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Method.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MethodImpl.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MethodImpl.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MethodPtr.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MethodPtr.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MethodSemantics.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MethodSemantics.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\MethodSpec.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\MethodSpec.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Module.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Module.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\ModuleRef.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\ModuleRef.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\NestedClass.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\NestedClass.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Param.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Param.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\ParamPtr.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\ParamPtr.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Property.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Property.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\PropertyMap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\PropertyMap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\PropertyPtr.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\PropertyPtr.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\RowCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\RowCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\StandAloneSig.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\StandAloneSig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\StringsHeap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\StringsHeap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\TableCollection.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\TableCollection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\TablesHeap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\TablesHeap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\TokenType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\TokenType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\TypeDef.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\TypeDef.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\TypeRef.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\TypeRef.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\TypeSpec.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\TypeSpec.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\UserStringsHeap.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\UserStringsHeap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Metadata\Utilities.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Metadata\Utilities.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\Array.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\Array.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\ArrayShape.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\ArrayShape.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\BaseSignatureVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\BaseSignatureVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\Class.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\Class.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\Constraint.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\Constraint.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\CustomAttrib.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\CustomAttrib.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\CustomMod.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\CustomMod.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\FieldSig.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\FieldSig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\FnPtr.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\FnPtr.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\GenericArg.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\GenericArg.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\GenericInst.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\GenericInst.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\GenericInstSignature.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\GenericInstSignature.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\ISignatureVisitable.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\ISignatureVisitable.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\ISignatureVisitor.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\ISignatureVisitor.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\InputOutputItem.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\InputOutputItem.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\LocalVarSig.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\LocalVarSig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\MVar.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\MVar.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\MarshalSig.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\MarshalSig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\MethodDefSig.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\MethodDefSig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\MethodRefSig.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\MethodRefSig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\MethodSig.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\MethodSig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\MethodSpec.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\MethodSpec.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\Param.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\Param.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\PropertySig.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\PropertySig.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\Ptr.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\Ptr.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\RetType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\RetType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\SigType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\SigType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\Signature.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\Signature.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\SignatureReader.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\SignatureReader.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\SignatureWriter.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\SignatureWriter.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\SzArray.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\SzArray.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\TypeSpec.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\TypeSpec.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\ValueType.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\ValueType.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Cecil.Signatures\Var.cs">
|
||||
<Link>cil-strip\Mono.Cecil.Signatures\Var.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Xml\SecurityParser.cs">
|
||||
<Link>cil-strip\Mono.Xml\SecurityParser.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Mono.Xml\SmallXmlParser.cs">
|
||||
<Link>cil-strip\Mono.Xml\SmallXmlParser.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Mono.Xml\ChangeLog">
|
||||
<Link>cil-strip\Mono.Xml\ChangeLog</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1126,10 +1126,10 @@ void mono_register_config_for_assembly (const char* assembly_name, cons
|
||||
|
||||
static readonly Universe universe = new Universe ();
|
||||
static readonly Dictionary<string, string> loaded_assemblies = new Dictionary<string, string> ();
|
||||
static readonly string resourcePathSeparator = (Path.DirectorySeparatorChar == '\\') ? $"\\{Path.DirectorySeparatorChar}" : $"{Path.DirectorySeparatorChar}";
|
||||
|
||||
public static string GetAssemblyName (string path)
|
||||
{
|
||||
string resourcePathSeparator = style == "windows" ? "\\\\" : "/";
|
||||
string name = Path.GetFileName (path);
|
||||
|
||||
// A bit of a hack to support satellite assemblies. They all share the same name but
|
||||
|
||||
@@ -39,8 +39,10 @@ mono_read (BIO *bio, char *out, int outl)
|
||||
|
||||
ret = mono->read_func (mono->instance, out, outl, &wantMore);
|
||||
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
errno = EIO;
|
||||
return -1;
|
||||
}
|
||||
if (ret > 0)
|
||||
return ret;
|
||||
|
||||
|
||||
Loaded 100 of 185 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user