-Subproject commit 8c7937a9e7cc3f61f9ceb6a9d6f19fefdf1672b0
+Subproject commit 836ed963de7fc898e60062175babeca17e67520b
thisdir = class
-# Note that Mono.Security and System.Security aren't listed.
-# We may have to add those if 'mcs' starts using them.
-basic_SUBDIRS := corlib System System.XML System Mono.Security System.Core
+basic_SUBDIRS := corlib Mono.Security System System.XML System.Core
# resgen is corlib specific so we need to wait until corlib is build
# and build it just a step before first dll needs it
build_SUBDIRS := \
corlib \
+ Mono.Security \
System \
System.XML \
- System Mono.Security \
Mono.Posix \
System.Core \
Mono.Cecil \
mobile_common_dirs := \
corlib \
+ Mono.Security \
System \
System.Core \
System.XML \
- Mono.Security \
- System \
I18N \
System.ServiceModel.Internals \
SMDiagnostics \
monotouch_runtime_dirs := \
corlib \
+ Mono.Security \
System \
System.Core \
System.XML \
xammac_4_5_dirs := \
corlib \
+ Mono.Security \
System \
Mono.Posix \
System.Core \
System.XML \
- Mono.Security \
- System \
I18N \
System.ServiceModel.Internals \
SMDiagnostics \
net_4_x_dirs := \
corlib \
+ Mono.Security \
System \
System.XML \
Mono.CompilerServices.SymbolWriter \
Mono.Posix \
System.Core \
- Mono.Security \
System.Security \
System.Configuration \
$(resgen_dir) \
ifdef MOBILE_PROFILE
LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP
else
-EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS -d:MONO_X509_ALIAS
+EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS
endif
#
ifeq (secxml/, $(intermediate))
LOCAL_MCS_FLAGS =
LIB_REFS += bare/System.Xml MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(bare_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
+LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP $(EXTERN_ALIAS_FLAGS)
endif
#
#
ifndef intermediate
LIB_REFS += System.Xml MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/System.dll $(EXTERN_ALIAS_FLAGS)
+LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP $(EXTERN_ALIAS_FLAGS)
ifndef MOBILE_PROFILE
LIB_REFS += System.Configuration
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
#else
using MSI = Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-using XX509Chain = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509Chain;
-#else
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-using XX509Chain = System.Security.Cryptography.X509Certificates.X509Chain;
-#endif
using System;
using System.IO;
if (callback == null)
return null;
- return (h, c, ch, e) => callback (h, c, (X509Chain)(object)ch, (SslPolicyErrors)e);
+ return (h, c, ch, e) => callback (h, c, ch, (SslPolicyErrors)e);
}
internal static MSI.MonoLocalCertificateSelectionCallback PublicToMono (LocalCertificateSelectionCallback callback)
if (callback == null)
return null;
- return (t, lc, rc, ai) => callback (null, t, (XX509CertificateCollection)(object)lc, rc, ai);
+ return (t, lc, rc, ai) => callback (null, t, lc, rc, ai);
}
internal static MSI.MonoRemoteCertificateValidationCallback InternalToMono (RemoteCertValidationCallback callback)
if (callback == null)
return null;
- return (h, c, ch, e) => callback (h, c, (X509Chain)(object)ch, (SslPolicyErrors)e);
+ return (h, c, ch, e) => callback (h, c, ch, (SslPolicyErrors)e);
}
internal static RemoteCertificateValidationCallback InternalToPublic (string hostname, RemoteCertValidationCallback callback)
if (callback == null)
return null;
- return (t, lc, rc, ai) => callback (t, (XX509CertificateCollection)(object)lc, rc, ai);
+ return (t, lc, rc, ai) => callback (t, lc, rc, ai);
}
internal static RemoteCertificateValidationCallback MonoToPublic (MSI.MonoRemoteCertificateValidationCallback callback)
if (callback == null)
return null;
- return (t, c, ch, e) => callback (null, c, (XX509Chain)(object)ch, (MSI.MonoSslPolicyErrors)e);
+ return (t, c, ch, e) => callback (null, c, ch, (MSI.MonoSslPolicyErrors)e);
}
internal static LocalCertificateSelectionCallback MonoToPublic (MSI.MonoLocalCertificateSelectionCallback callback)
if (callback == null)
return null;
- return (s, t, lc, rc, ai) => callback (t, (XX509CertificateCollection)(object)lc, rc, ai);
+ return (s, t, lc, rc, ai) => callback (t, lc, rc, ai);
}
internal static RemoteCertValidationCallback MonoToInternal (MSI.MonoRemoteCertificateValidationCallback callback)
if (callback == null)
return null;
- return (h, c, ch, e) => callback (h, c, (XX509Chain)(object)ch, (MSI.MonoSslPolicyErrors)e);
+ return (h, c, ch, e) => callback (h, c, ch, (MSI.MonoSslPolicyErrors)e);
}
internal static LocalCertSelectionCallback MonoToInternal (MSI.MonoLocalCertificateSelectionCallback callback)
if (callback == null)
return null;
- return (t, lc, rc, ai) => callback (t, (XX509CertificateCollection)(object)lc, rc, ai);
+ return (t, lc, rc, ai) => callback (t, lc, rc, ai);
}
}
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
using MonoSecurity::Mono.Security.Interface;
using MSX = Mono.Security.X509;
using Mono.Security.X509.Extensions;
#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-using XX509Chain = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509Chain;
-#else
using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
using XX509Chain = System.Security.Cryptography.X509Certificates.X509Chain;
-#endif
using System;
using System.Net;
public ValidationResult ValidateCertificate (string host, bool serverMode, X509Certificate leaf, XX509Chain xchain)
{
try {
- var chain = (X509Chain)(object)xchain;
+ var chain = xchain;
var result = ValidateChain (host, serverMode, leaf, chain, null, 0);
if (tlsStream != null)
tlsStream.CertificateValidationFailed = result == null || !result.Trusted || result.UserDenied;
bool providerValidated = false;
if (provider != null && provider.HasCustomSystemCertificateValidator) {
var xerrors = (MonoSslPolicyErrors)errors;
- var xchain = (XX509Chain)(object)chain;
+ var xchain = chain;
providerValidated = provider.InvokeSystemCertificateValidator (this, host, server, certs, wantsChain, ref xchain, out result, ref xerrors, ref status11);
- chain = (X509Chain)(object)xchain;
+ chain = xchain;
errors = (SslPolicyErrors)xerrors;
} else if (wantsChain) {
chain = SystemCertificateValidator.CreateX509Chain (certs);
public bool InvokeSystemValidator (string targetHost, bool serverMode, XX509CertificateCollection certificates, XX509Chain xchain, ref MonoSslPolicyErrors xerrors, ref int status11)
{
- X509Chain chain = (X509Chain)(object)xchain;
+ X509Chain chain = xchain;
var errors = (SslPolicyErrors)xerrors;
var result = SystemCertificateValidator.Evaluate (settings, targetHost, certificates, chain, ref errors, ref status11);
xerrors = (MonoSslPolicyErrors)errors;
// THE SOFTWARE.
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
#if MONO_SECURITY_ALIAS
using MSI = MonoSecurity::Mono.Security.Interface;
#else
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
using MonoSecurity::Mono.Security.Interface;
#else
using Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
#endif
-#endif
using System;
using System.IO;
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
using Mono.Security.Protocol.Tls;
using Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
using HashAlgorithmType = System.Security.Authentication.HashAlgorithmType;
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-using XHttpWebRequest = PrebuiltSystem::System.Net.HttpWebRequest;
-using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
using XHttpWebRequest = System.Net.HttpWebRequest;
using XSslProtocols = System.Security.Authentication.SslProtocols;
using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
#if MONO_SECURITY_ALIAS
using MonoSecurity::Mono.Security.Interface;
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
#else
using MSI = Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-
-using XTransportContext = PrebuiltSystem::System.Net.TransportContext;
-using XAuthenticatedStream = PrebuiltSystem::System.Net.Security.AuthenticatedStream;
-
-using XCipherAlgorithmType = PrebuiltSystem::System.Security.Authentication.CipherAlgorithmType;
-using XHashAlgorithmType = PrebuiltSystem::System.Security.Authentication.HashAlgorithmType;
-using XExchangeAlgorithmType = PrebuiltSystem::System.Security.Authentication.ExchangeAlgorithmType;
-using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
-#else
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-
-using XTransportContext = System.Net.TransportContext;
-using XAuthenticatedStream = System.Net.Security.AuthenticatedStream;
-
-using XCipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
-using XHashAlgorithmType = System.Security.Authentication.HashAlgorithmType;
-using XExchangeAlgorithmType = System.Security.Authentication.ExchangeAlgorithmType;
-using XSslProtocols = System.Security.Authentication.SslProtocols;
-#endif
using System;
using System.IO;
Impl.AuthenticateAsClient (targetHost);
}
- public void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+ public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- Impl.AuthenticateAsClient (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
}
public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
}
- public IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+ public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
{
- return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+ return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
}
public void EndAuthenticateAsClient (IAsyncResult asyncResult)
Impl.AuthenticateAsServer (serverCertificate);
}
- public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+ public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
}
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState);
}
- public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+ public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
{
- return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+ return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
}
public void EndAuthenticateAsServer (IAsyncResult asyncResult)
return Impl.AuthenticateAsClientAsync (targetHost);
}
- public Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+ public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, (SslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
}
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
return Impl.AuthenticateAsServerAsync (serverCertificate);
}
- public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, XSslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+ public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, (SslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
}
public void Flush ()
Impl.EndWrite (asyncResult);
}
- public XTransportContext TransportContext {
- get { return (XTransportContext)(object)Impl.TransportContext; }
+ public TransportContext TransportContext {
+ get { return Impl.TransportContext; }
}
public bool IsAuthenticated {
get { return Impl.IsServer; }
}
- public XCipherAlgorithmType CipherAlgorithm {
- get { return (XCipherAlgorithmType)Impl.CipherAlgorithm; }
+ public CipherAlgorithmType CipherAlgorithm {
+ get { return Impl.CipherAlgorithm; }
}
public int CipherStrength {
get { return Impl.CipherStrength; }
}
- public XHashAlgorithmType HashAlgorithm {
- get { return (XHashAlgorithmType)Impl.HashAlgorithm; }
+ public HashAlgorithmType HashAlgorithm {
+ get { return Impl.HashAlgorithm; }
}
public int HashStrength {
get { return Impl.HashStrength; }
}
- public XExchangeAlgorithmType KeyExchangeAlgorithm {
- get { return (XExchangeAlgorithmType)Impl.KeyExchangeAlgorithm; }
+ public ExchangeAlgorithmType KeyExchangeAlgorithm {
+ get { return Impl.KeyExchangeAlgorithm; }
}
public int KeyExchangeStrength {
Impl.SetLength (value);
}
- public XAuthenticatedStream AuthenticatedStream {
- get { return (XAuthenticatedStream)(Stream)Impl.AuthenticatedStream; }
+ public AuthenticatedStream AuthenticatedStream {
+ get { return Impl.AuthenticatedStream; }
}
public int ReadTimeout {
get { return Impl.RemoteCertificate; }
}
- public XSslProtocols SslProtocol {
- get { return (XSslProtocols)Impl.SslProtocol; }
+ public SslProtocols SslProtocol {
+ get { return Impl.SslProtocol; }
}
public MSI.MonoTlsProvider Provider {
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
#else
using MSI = Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XSslProtocols = System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
-
-using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
-using HashAlgorithmType = System.Security.Authentication.HashAlgorithmType;
-using ExchangeAlgorithmType = System.Security.Authentication.ExchangeAlgorithmType;
using System;
using System.IO;
Impl.AuthenticateAsClient (targetHost);
}
- public void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+ public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- Impl.AuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
}
public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
}
- public IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+ public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
{
- return Impl.BeginAuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+ return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
}
public void EndAuthenticateAsClient (IAsyncResult asyncResult)
public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
}
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
{
- return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+ return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
}
public void EndAuthenticateAsServer (IAsyncResult asyncResult)
return Impl.AuthenticateAsClientAsync (targetHost);
}
- public Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+ public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
}
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
}
public void Flush ()
}
public TransportContext TransportContext {
- get { return (TransportContext)(object)Impl.TransportContext; }
+ get { return Impl.TransportContext; }
}
public bool IsAuthenticated {
}
public AuthenticatedStream AuthenticatedStream {
- get { return (AuthenticatedStream)(object)Impl.AuthenticatedStream; }
+ get { return Impl.AuthenticatedStream; }
}
public int ReadTimeout {
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
#else
using MSI = Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XHttpWebRequest = PrebuiltSystem::System.Net.HttpWebRequest;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XHttpWebRequest = System.Net.HttpWebRequest;
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using System;
using System.IO;
MSI.IMonoTlsContext IMonoTlsProvider.CreateTlsContext (
string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
- X509Certificate serverCertificate, XX509CertificateCollection clientCertificates,
+ X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus,
MSI.MonoEncryptionPolicy encryptionPolicy, MSI.MonoTlsSettings settings)
{
return CreateTlsContextImpl (
hostname, serverMode, protocolFlags,
- serverCertificate, (X509CertificateCollection)(object)clientCertificates,
+ serverCertificate, clientCertificates,
remoteCertRequired, encryptionPolicy, settings);
}
internal override MSI.IMonoTlsContext CreateTlsContext (
string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
- X509Certificate serverCertificate, XX509CertificateCollection clientCertificates,
+ X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
bool remoteCertRequired, MSI.MonoEncryptionPolicy encryptionPolicy,
MSI.MonoTlsSettings settings)
{
return CreateTlsContextImpl (
hostname, serverMode, (MSI.TlsProtocols)protocolFlags,
- serverCertificate, (X509CertificateCollection)(object)clientCertificates,
+ serverCertificate, clientCertificates,
remoteCertRequired, (MSI.MonoEncryptionPolicy)encryptionPolicy,
settings);
}
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
#else
using MSI = Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XHttpWebRequest = PrebuiltSystem::System.Net.HttpWebRequest;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XHttpWebRequest = System.Net.HttpWebRequest;
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using System;
using System.IO;
public MSI.IMonoTlsContext CreateTlsContext (
string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
- X509Certificate serverCertificate, XX509CertificateCollection clientCertificates,
+ X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus,
MSI.MonoEncryptionPolicy encryptionPolicy, MSI.MonoTlsSettings settings)
{
return provider.CreateTlsContext (
hostname, serverMode, protocolFlags,
- serverCertificate, (XX509CertificateCollection)(object)clientCertificates,
+ serverCertificate, clientCertificates,
remoteCertRequired, (MSI.MonoEncryptionPolicy)encryptionPolicy,
settings);
}
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
using MonoSecurity::Mono.Security.Interface;
#else
using Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
#endif
-#endif
using System;
using System.IO;
try {
sslStream.AuthenticateAsClient (
- request.Address.Host, (XX509CertificateCollection)(object)request.ClientCertificates,
+ request.Address.Host, request.ClientCertificates,
(SslProtocols)ServicePointManager.SecurityProtocol,
ServicePointManager.CheckCertificateRevocationList);
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
using MonoSecurity::Mono.Security.Interface;
using MSX = Mono.Security.X509;
using Mono.Security.X509.Extensions;
#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-using XX509Chain = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509Chain;
-#else
using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
using XX509Chain = System.Security.Cryptography.X509Certificates.X509Chain;
-#endif
using System;
using System.Net;
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
using MX = MonoSecurity::Mono.Security.X509;
using MX = Mono.Security.X509;
using Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using System.Runtime.InteropServices;
using System.Security.Authentication.ExtendedProtection;
internal static class GlobalSSPI
{
- internal static SSPIInterface Create (string hostname, bool serverMode, SchProtocols protocolFlags, X509Certificate serverCertificate, XX509CertificateCollection clientCertificates,
+ internal static SSPIInterface Create (string hostname, bool serverMode, SchProtocols protocolFlags, X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus, EncryptionPolicy encryptionPolicy,
LocalCertSelectionCallback certSelectionDelegate, RemoteCertValidationCallback remoteValidationCallback, SSPIConfiguration userConfig)
{
internal static X509Certificate2 GetRemoteCertificate (SafeDeleteContext safeContext, out X509Certificate2Collection remoteCertificateStore)
{
- XX509CertificateCollection monoCollection;
+ X509CertificateCollection monoCollection;
if (safeContext == null || safeContext.IsInvalid) {
remoteCertificateStore = null;
return null;
//
#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using TypeDescriptor = PrebuiltSystem.System.ComponentModel.TypeDescriptor;
-
using System;
using System.Collections.Generic;
using System.ComponentModel;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
-
using System.Reflection;
using System.Collections.Specialized;
// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
//
-#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
#if CONFIGURATION_DEP
using System.IO;
using System.Xml.Serialization;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
-
using System;
using System.Collections;
using System.Collections.Specialized;
#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Collections.Specialized;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-
namespace System.Configuration
{
// location to store user configuration settings.
//
#if CONFIGURATION_DEP
-#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
using System;
using System.Collections.Specialized;
return;
// e.Name
- string name = path.Substring (fullPathNoLastSlash.Length + 1);
+ string name = (path.Length > fullPathNoLastSlash.Length) ? path.Substring (fullPathNoLastSlash.Length + 1) : String.Empty;
// only post events that match filter pattern. check both old and new paths for renames
if (!fsw.Pattern.IsMatch (path) && (newPath == null || !fsw.Pattern.IsMatch (newPath)))
return;
if (action == FileAction.RenamedNewName) {
- string newName = newPath.Substring (fullPathNoLastSlash.Length + 1);
+ string newName = (newPath.Length > fullPathNoLastSlash.Length) ? newPath.Substring (fullPathNoLastSlash.Length + 1) : String.Empty;
renamed = new RenamedEventArgs (WatcherChangeTypes.Renamed, fsw.Path, newName, name);
}
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
using MSI = MonoSecurity::Mono.Security.Interface;
#else
using MSI = Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using X509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using System.Security.Cryptography.X509Certificates;
#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if SECURITY_DEP && !MONO_FEATURE_NEW_TLS
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using System.Security.Cryptography.X509Certificates;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if !MONO_FEATURE_NEW_TLS
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-using X509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using System.Security.Cryptography.X509Certificates;
#if !MONO_FEATURE_NEW_TLS
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
#else
using Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XSslProtocols = System.Security.Authentication.SslProtocols;
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using CipherAlgorithmType = System.Security.Authentication.CipherAlgorithmType;
using HashAlgorithmType = System.Security.Authentication.HashAlgorithmType;
internal delegate X509Certificate LocalCertSelectionCallback (
string targetHost,
- XX509CertificateCollection localCertificates,
+ X509CertificateCollection localCertificates,
X509Certificate remoteCertificate,
string[] acceptableIssuers);
Impl.AuthenticateAsClient (targetHost);
}
- public virtual void AuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+ public virtual void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- Impl.AuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
}
// [HostProtection (ExternalThreading=true)]
}
// [HostProtection (ExternalThreading=true)]
- public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
+ public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
{
- return Impl.BeginAuthenticateAsClient (targetHost, (XX509CertificateCollection)(object)clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+ return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
}
public virtual void EndAuthenticateAsClient (IAsyncResult asyncResult)
public virtual void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
}
// [HostProtection (ExternalThreading=true)]
public virtual IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
{
- return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
+ return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
}
public virtual void EndAuthenticateAsServer (IAsyncResult asyncResult)
return Impl.AuthenticateAsClientAsync (targetHost);
}
- public virtual Task AuthenticateAsClientAsync (string targetHost, XX509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
+ public virtual Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
}
public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
public virtual Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
{
- return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, (XSslProtocols)enabledSslProtocols, checkCertificateRevocation);
+ return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
}
public override bool IsAuthenticated {
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
using MSI = MonoSecurity::Mono.Security.Interface;
#else
using MSI = Mono.Security.Interface;
#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
-using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using System.IO;
using System.Net.Sockets;
//
#if CONFIGURATION_DEP
-extern alias PrebuiltSystem;
-
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Xml;
-using TypeConverter = PrebuiltSystem::System.ComponentModel.TypeConverter;
-
namespace System.Security.Authentication.ExtendedProtection.Configuration
{
internal static class ConfigUtil
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if SECURITY_DEP
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
-#if MONO_X509_ALIAS
-using XX509CertificateCollection = PrebuiltSystem::System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#else
using XX509CertificateCollection = System.Security.Cryptography.X509Certificates.X509CertificateCollection;
-#endif
using System;
using System.Runtime.InteropServices;
#if MONO_SECURITY_ALIAS
extern alias MonoSecurity;
#endif
-#if MONO_X509_ALIAS
-extern alias PrebuiltSystem;
-#endif
#if MONO_SECURITY_ALIAS
using MonoSecurity::Mono.Security.Interface;
var provider = MonoTlsProviderFactory.GetProvider ();
if (provider.HasNativeCertificates) {
var impl = provider.GetNativeCertificate (rawData, password, keyStorageFlags);
- return (X509Certificate2Impl)(object)impl;
+ return impl;
} else {
var impl = new X509Certificate2ImplMono ();
impl.Import (rawData, password, keyStorageFlags);
var provider = MonoTlsProviderFactory.GetProvider ();
if (provider.HasNativeCertificates) {
var impl = provider.GetNativeCertificate (cert);
- return (X509Certificate2Impl)(object)impl;
+ return impl;
}
var impl2 = cert.Impl as X509Certificate2Impl;
if (impl2 != null)
public void Ctor ()
{
var cp = new CspParameters ();
- Assert.AreEqual (24, cp.ProviderType);
+ Assert.AreEqual (1, cp.ProviderType);
}
}
}
-// CS0029: Cannot implicitly convert type `B [cs0029-26, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]' to `B [CS0029-26-lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=36f3ae7e947792e3]'
+// CS0029: Cannot implicitly convert type `B [cs0029-26, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null -- *PATH*/cs0029-26.cs]' to `B [CS0029-26-lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=36f3ae7e947792e3 -- *PATH*/CS0029-26-lib.dll]'
// Line: 16
// Compiler options: -r:R1=CS0029-26-lib.dll
/// false if candidate ain't better
/// true if candidate is better than the current best match
/// </remarks>
- static bool BetterFunction (ResolveContext ec, Arguments args, MemberSpec candidate, AParametersCollection cparam, bool candidate_params,
+ bool BetterFunction (ResolveContext ec, Arguments args, MemberSpec candidate, AParametersCollection cparam, bool candidate_params,
MemberSpec best, AParametersCollection bparam, bool best_params)
{
AParametersCollection candidate_pd = ((IParametersMember) candidate).Parameters;
// for each argument, the conversion to 'ct' should be no worse than
// the conversion to 'bt'.
if (result == 2) {
+ //
+ // No optional parameters tie breaking rules for delegates overload resolution
+ //
+ if ((this.restrictions & Restrictions.CovariantDelegate) != 0)
+ return false;
+
better_at_least_one = false;
++j;
public string GetSignatureForErrorIncludingAssemblyName ()
{
- return string.Format ("{0} [{1}]", GetSignatureForError (), MemberDefinition.DeclaringAssembly.FullName);
+ var imported = MemberDefinition.DeclaringAssembly as ImportedAssemblyDefinition;
+
+ var location = imported != null ?
+ System.IO.Path.GetFullPath (imported.Location) :
+ ((MemberCore)MemberDefinition).Location.NameFullPath;
+
+ return string.Format ("{0} [{1} -- {2}]", GetSignatureForError (),
+ MemberDefinition.DeclaringAssembly.FullName,
+ location);
}
protected virtual string GetTypeNameSignature ()
--- /dev/null
+using System;
+
+class Test1
+{
+ static object Foo (int arg = 1, int arg2 = 2)
+ {
+ return null;
+ }
+
+ static object Foo (object arg, object arg2)
+ {
+ return null;
+ }
+
+ public static void Main ()
+ {
+ Func<int, int, object> o = Foo;
+ }
+}
\ No newline at end of file
</method>
</type>
</test>
+ <test name="gtest-optional-37.cs">
+ <type name="Test1">
+ <method name="System.Object Foo(Int32, Int32)" attrs="145">
+ <size>10</size>
+ </method>
+ <method name="System.Object Foo(System.Object, System.Object)" attrs="145">
+ <size>10</size>
+ </method>
+ <method name="Void Main()" attrs="150">
+ <size>32</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-partial-01.cs">
<type name="B`1[U]">
<method name="Void .ctor()" attrs="6278">
static bool TryToMatchErrorMessage (string actual, string expected)
{
actual = actual.Replace ("\\", "/");
- var path_mask_start = expected.IndexOf ("*PATH*");
+ var path_mask_start = expected.IndexOf ("*PATH*", StringComparison.Ordinal);
if (path_mask_start > 0 && actual.Length > path_mask_start) {
- var path_mask_continue = expected.Substring (path_mask_start + 6);
- var expected_continue = actual.IndexOf (path_mask_continue, path_mask_start);
- if (expected_continue > 0) {
- var path = actual.Substring (path_mask_start, expected_continue - path_mask_start);
- if (actual == expected.Replace ("*PATH*", path))
- return true;
-
- throw new ApplicationException (expected.Replace ("*PATH*", path));
+ var parts = expected.Split (new [] { "*PATH*" }, StringSplitOptions.None);
+ foreach (var part in parts) {
+ if (!actual.Contains (part))
+ return false;
}
}
- return false;
+ return true;
}
bool HandleFailure (string file, CompilerError status)
<Compile Include="AssemblyComparer.cs" />
<Compile Include="ClassComparer.cs" />
<Compile Include="ApiDiff.cs" />
- <Compile Include="..\..\..\class\Mono.Options\Mono.Options\Options.cs">
+ <Compile Include="..\..\class\Mono.Options\Mono.Options\Options.cs">
<Link>Options.cs</Link>
</Compile>
<Compile Include="ApiChange.cs" />
result->sre_method = FALSE;
result->signature = NULL;
- if (!context->method_inst) {
+ if (iresult->context.method_inst) {
/* Set the generic_container of the result to the generic_container of method */
MonoGenericContainer *generic_container = mono_method_get_generic_container (method);
- if (generic_container) {
+ if (generic_container && iresult->context.method_inst == generic_container->context.method_inst) {
result->is_generic = 1;
mono_method_set_generic_container (result, generic_container);
}
mach_port_t host = mach_host_self();
vm_size_t page_size;
vm_statistics_data_t vmstat;
- if (KERN_SUCCESS != host_statistics(host, HOST_VM_INFO, (host_info_t)&vmstat, &count)) {
+ kern_return_t ret;
+ do {
+ ret = host_statistics(host, HOST_VM_INFO, (host_info_t)&vmstat, &count);
+ } while (ret == KERN_ABORTED);
+
+ if (ret != KERN_SUCCESS) {
g_warning ("Mono was unable to retrieve memory usage!");
return 0;
}
g_assert_not_reached ();
}
- if (atype != ATYPE_SMALL) {
- /* size += ALLOC_ALIGN - 1; */
- mono_mb_emit_ldloc (mb, size_var);
- mono_mb_emit_icon (mb, SGEN_ALLOC_ALIGN - 1);
- mono_mb_emit_byte (mb, CEE_ADD);
- /* size &= ~(ALLOC_ALIGN - 1); */
- mono_mb_emit_icon (mb, ~(SGEN_ALLOC_ALIGN - 1));
- mono_mb_emit_byte (mb, CEE_AND);
- mono_mb_emit_stloc (mb, size_var);
- }
+ /* size += ALLOC_ALIGN - 1; */
+ mono_mb_emit_ldloc (mb, size_var);
+ mono_mb_emit_icon (mb, SGEN_ALLOC_ALIGN - 1);
+ mono_mb_emit_byte (mb, CEE_ADD);
+ /* size &= ~(ALLOC_ALIGN - 1); */
+ mono_mb_emit_icon (mb, ~(SGEN_ALLOC_ALIGN - 1));
+ mono_mb_emit_byte (mb, CEE_AND);
+ mono_mb_emit_stloc (mb, size_var);
/* if (size > MAX_SMALL_OBJ_SIZE) goto slowpath */
if (atype != ATYPE_SMALL) {
gboolean
sgen_resume_thread (SgenThreadInfo *info)
{
- return thread_resume (info->client_info.info.native_handle) == KERN_SUCCESS;
+ kern_return_t ret;
+ do {
+ ret = thread_resume (info->client_info.info.native_handle);
+ } while (ret == KERN_ABORTED);
+ return ret == KERN_SUCCESS;
}
gboolean
state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
- ret = thread_suspend (info->client_info.info.native_handle);
+ do {
+ ret = thread_suspend (info->client_info.info.native_handle);
+ } while (ret == KERN_ABORTED);
if (ret != KERN_SUCCESS)
return FALSE;
- ret = mono_mach_arch_get_thread_state (info->client_info.info.native_handle, state, &num_state);
+ do {
+ ret = mono_mach_arch_get_thread_state (info->client_info.info.native_handle, state, &num_state);
+ } while (ret == KERN_ABORTED);
if (ret != KERN_SUCCESS)
return FALSE;
if (!sgen_suspend_thread (info))
continue;
} else {
- ret = thread_resume (info->client_info.info.native_handle);
+ do {
+ ret = thread_resume (info->client_info.info.native_handle);
+ } while (ret == KERN_ABORTED);
if (ret != KERN_SUCCESS)
continue;
}
mono_release_type_locks (thread);
/* Can happen when we attach the profiler helper thread in order to heapshot. */
- if (!mono_thread_info_lookup (thread->tid)->tools_thread)
+ if (!mono_thread_info_lookup (MONO_UINT_TO_NATIVE_THREAD_ID (thread->tid))->tools_thread)
mono_profiler_thread_end (thread->tid);
if (thread == mono_thread_internal_current ()) {
if (internal->name && (internal->flags & MONO_THREAD_FLAG_NAME_SET)) {
char *tname = g_utf16_to_utf8 (internal->name, internal->name_len, NULL, NULL, NULL);
mono_profiler_thread_name (internal->tid, tname);
- mono_thread_info_set_name (internal->tid, tname);
+ mono_thread_info_set_name (MONO_UINT_TO_NATIVE_THREAD_ID (internal->tid), tname);
g_free (tname);
}
/* start_func is set only for unmanaged start functions */
/* allocate two contiguous pages of memory: the first page will contain the data (like a local constant pool)
* while the second will contain the trampolines.
*/
- ret = vm_allocate (mach_task_self (), &addr, psize * 2, VM_FLAGS_ANYWHERE);
+ do {
+ ret = vm_allocate (mach_task_self (), &addr, psize * 2, VM_FLAGS_ANYWHERE);
+ } while (ret == KERN_ABORTED);
if (ret != KERN_SUCCESS) {
g_error ("Cannot allocate memory for trampolines: %d", ret);
break;
if (enable_profile) {
mono_profiler_load (profile_options);
- mono_profiler_thread_name (mono_native_thread_id_get (), "Main");
+ mono_profiler_thread_name (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ()), "Main");
}
mono_attach_parse_options (attach_options);
if (size < sizeof (MonoObject))
g_error ("Invalid size %d for class %s", size, mono_type_get_full_name (klass));
- EMIT_NEW_ICONST (cfg, iargs [1], mono_gc_get_aligned_size_for_allocator (size));
+ EMIT_NEW_ICONST (cfg, iargs [1], size);
}
return mono_emit_method_call (cfg, managed_alloc, iargs, NULL);
}
g_error ("Invalid size %d for class %s", size, mono_type_get_full_name (klass));
EMIT_NEW_VTABLECONST (cfg, iargs [0], vtable);
- EMIT_NEW_ICONST (cfg, iargs [1], mono_gc_get_aligned_size_for_allocator (size));
+ EMIT_NEW_ICONST (cfg, iargs [1], size);
return mono_emit_method_call (cfg, managed_alloc, iargs, NULL);
}
alloc_ftn = mono_class_get_allocation_ftn (vtable, for_box, &pass_lw);
#include <dlfcn.h>
#include <AvailabilityMacros.h>
-#if defined (TARGET_OSX) && (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5)
-#define NEEDS_EXCEPTION_THREAD
-#endif
-
-#ifdef NEEDS_EXCEPTION_THREAD
-
-/*
- * This code disables the CrashReporter of MacOS X by installing
- * a dummy Mach exception handler.
- */
-
-/*
- * http://darwinsource.opendarwin.org/10.4.3/xnu-792.6.22/osfmk/man/exc_server.html
- */
-extern boolean_t exc_server (mach_msg_header_t *request_msg, mach_msg_header_t *reply_msg);
-
-/*
- * The exception message
- */
-typedef struct {
- mach_msg_base_t msg; /* common mach message header */
- char payload [1024]; /* opaque */
-} mach_exception_msg_t;
-
-/* The exception port */
-static mach_port_t mach_exception_port = VM_MAP_NULL;
-
-kern_return_t
-catch_exception_raise (
- mach_port_t exception_port,
- mach_port_t thread,
- mach_port_t task,
- exception_type_t exception,
- exception_data_t code,
- mach_msg_type_number_t code_count);
-
-/*
- * Implicitly called by exc_server. Must be public.
- *
- * http://darwinsource.opendarwin.org/10.4.3/xnu-792.6.22/osfmk/man/catch_exception_raise.html
- */
-kern_return_t
-catch_exception_raise (
- mach_port_t exception_port,
- mach_port_t thread,
- mach_port_t task,
- exception_type_t exception,
- exception_data_t code,
- mach_msg_type_number_t code_count)
-{
- /* consume the exception */
- return KERN_FAILURE;
-}
-
-/*
- * Exception thread handler.
- */
-static
-void *
-mach_exception_thread (void *arg)
-{
- for (;;) {
- mach_exception_msg_t request;
- mach_exception_msg_t reply;
- mach_msg_return_t result;
-
- /* receive from "mach_exception_port" */
- result = mach_msg (&request.msg.header,
- MACH_RCV_MSG | MACH_RCV_LARGE,
- 0,
- sizeof (request),
- mach_exception_port,
- MACH_MSG_TIMEOUT_NONE,
- MACH_PORT_NULL);
-
- g_assert (result == MACH_MSG_SUCCESS);
-
- /* dispatch to catch_exception_raise () */
- exc_server (&request.msg.header, &reply.msg.header);
-
- /* send back to sender */
- result = mach_msg (&reply.msg.header,
- MACH_SEND_MSG,
- reply.msg.header.msgh_size,
- 0,
- MACH_PORT_NULL,
- MACH_MSG_TIMEOUT_NONE,
- MACH_PORT_NULL);
-
- /*
- If we try to abort the thread while delivering an exception. The port will be gone since the kernel
- setup a send once port to deliver the resume message and thread_abort will consume it.
- */
- g_assert (result == MACH_MSG_SUCCESS || result == MACH_SEND_INVALID_DEST);
- }
- return NULL;
-}
-
-static void
-macosx_register_exception_handler (void)
-{
- mach_port_t task;
- pthread_attr_t attr;
- pthread_t thread;
-
- if (mach_exception_port != VM_MAP_NULL)
- return;
-
- task = mach_task_self ();
-
- /* create the "mach_exception_port" with send & receive rights */
- g_assert (mach_port_allocate (task, MACH_PORT_RIGHT_RECEIVE,
- &mach_exception_port) == KERN_SUCCESS);
- g_assert (mach_port_insert_right (task, mach_exception_port, mach_exception_port,
- MACH_MSG_TYPE_MAKE_SEND) == KERN_SUCCESS);
-
- /* create the exception handler thread */
- g_assert (!pthread_attr_init (&attr));
- g_assert (!pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED));
- g_assert (!pthread_create (&thread, &attr, mach_exception_thread, NULL));
- pthread_attr_destroy (&attr);
-
- /*
- * register "mach_exception_port" as a receiver for the
- * EXC_BAD_ACCESS exception
- *
- * http://darwinsource.opendarwin.org/10.4.3/xnu-792.6.22/osfmk/man/task_set_exception_ports.html
- */
- g_assert (task_set_exception_ports (task, EXC_MASK_BAD_ACCESS,
- mach_exception_port,
- EXCEPTION_DEFAULT,
- MACHINE_THREAD_STATE) == KERN_SUCCESS);
-
- mono_gc_register_mach_exception_thread (thread);
-}
-
-#endif
-
/* This is #define'd by Boehm GC to _GC_dlopen. */
#undef dlopen
void
mono_runtime_install_handlers (void)
{
-#ifdef NEEDS_EXCEPTION_THREAD
- macosx_register_exception_handler ();
-#endif
mono_runtime_posix_install_handlers ();
/* Snow Leopard has a horrible bug: http://openradar.appspot.com/7209349
state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
- ret = mono_mach_arch_get_thread_state (info->native_handle, state, &num_state);
+ do {
+ ret = mono_mach_arch_get_thread_state (info->native_handle, state, &num_state);
+ } while (ret == KERN_ABORTED);
if (ret != KERN_SUCCESS)
return FALSE;
{
kern_return_t ret;
- if ((ret = host_get_clock_service (mach_host_self (), SYSTEM_CLOCK, &sampling_clock_service)) != KERN_SUCCESS)
+ do {
+ ret = host_get_clock_service (mach_host_self (), SYSTEM_CLOCK, &sampling_clock_service);
+ } while (ret == KERN_ABORTED);
+
+ if (ret != KERN_SUCCESS)
g_error ("%s: host_get_clock_service () returned %d", __func__, ret);
}
{
kern_return_t ret;
- if ((ret = mach_port_deallocate (mach_task_self (), sampling_clock_service)) != KERN_SUCCESS)
+ do {
+ ret = mach_port_deallocate (mach_task_self (), sampling_clock_service);
+ } while (ret == KERN_ABORTED);
+
+ if (ret != KERN_SUCCESS)
g_error ("%s: mach_port_deallocate () returned %d", __func__, ret);
}
kern_return_t ret;
mach_timespec_t mach_ts;
- if ((ret = clock_get_time (sampling_clock_service, &mach_ts)) != KERN_SUCCESS)
+ do {
+ ret = clock_get_time (sampling_clock_service, &mach_ts);
+ } while (ret == KERN_ABORTED);
+
+ if (ret != KERN_SUCCESS)
g_error ("%s: clock_get_time () returned %d", __func__, ret);
return ((guint64) mach_ts.tv_sec * 1000000000) + (guint64) mach_ts.tv_nsec;
do {
ret = clock_sleep (sampling_clock_service, TIME_ABSOLUTE, then, &remain_unused);
-
- if (ret != KERN_SUCCESS && ret != KERN_ABORTED)
- g_error ("%s: clock_sleep () returned %d", __func__, ret);
} while (ret == KERN_ABORTED);
+
+ if (ret != KERN_SUCCESS)
+ g_error ("%s: clock_sleep () returned %d", __func__, ret);
+
}
#else
mono_counters_register ("Methods from AOT", MONO_COUNTER_JIT | MONO_COUNTER_INT, &mono_jit_stats.methods_aot);
mono_counters_register ("Methods JITted using mono JIT", MONO_COUNTER_JIT | MONO_COUNTER_INT, &mono_jit_stats.methods_without_llvm);
mono_counters_register ("Methods JITted using LLVM", MONO_COUNTER_JIT | MONO_COUNTER_INT, &mono_jit_stats.methods_with_llvm);
- mono_counters_register ("JIT/method-to-IR (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_method_to_ir);
+ mono_counters_register ("JIT/method_to_ir (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_method_to_ir);
mono_counters_register ("JIT/liveness_handle_exception_clauses (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_liveness_handle_exception_clauses);
mono_counters_register ("JIT/handle_out_of_line_bblock (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_handle_out_of_line_bblock);
mono_counters_register ("JIT/decompose_long_opts (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_decompose_long_opts);
TMP_FILE_PREFIX=$(basename $0).tmp
BASEDIR=$(dirname $0)
-MONO_PATH=$BASEDIR/../../mcs/class/lib/net_4_x:$BASEDIR
+case "$(uname -s)" in
+ CYGWIN*) PLATFORM_PATH_SEPARATOR=';';;
+ *) PLATFORM_PATH_SEPARATOR=':';;
+esac
+
+MONO_PATH=$BASEDIR/../../mcs/class/lib/net_4_x$PLATFORM_PATH_SEPARATOR$BASEDIR
RUNTIME=$BASEDIR/../../runtime/mono-wrapper
trap "rm -rf ${TMP_FILE_PREFIX}*" EXIT
}
clean_aot () {
- rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM
+ rm -rf *.exe.so *.exe.dylib *.exe.dylib.dSYM *.exe.dll
}
# The test compares the generated native code size between a compilation with and without seq points.
}
diff_methods () {
- TMP_FILE=$(tmp_file)
- echo "$(MONO_DEBUG=single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE
- diff <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points,single-imm-size get_methods $1 $2 $3 $4)")
+ TMP_FILE1=$(tmp_file)
+ TMP_FILE2=$(tmp_file)
+ echo "$(MONO_DEBUG=single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE1
+ echo "$(MONO_DEBUG=gen-compact-seq-points,single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE2
+ diff $TMP_FILE1 $TMP_FILE2
}
diff_method () {
- TMP_FILE=$(tmp_file)
- echo "$(MONO_DEBUG=single-imm-size get_method $1 $2 $3 $4 $5)" >$TMP_FILE
- sdiff -w 150 <(cat $TMP_FILE) <(echo "$(MONO_DEBUG=gen-compact-seq-points,single-imm-size get_method $1 $2 $3 $4 $5 | grep -Ev il_seq_point)")
+ TMP_FILE1=$(tmp_file)
+ TMP_FILE2=$(tmp_file)
+ echo "$(MONO_DEBUG=single-imm-size get_method $1 $2 $3 $4 $5)" >$TMP_FILE1
+ echo "$(MONO_DEBUG=gen-compact-seq-points,single-imm-size get_method $1 $2 $3 $4 $5 | grep -Ev il_seq_point)" >$TMP_FILE2
+ sdiff -w 150 $TMP_FILE1 $TMP_FILE2
}
get_method_name () {
pinvoke_ppcs.cs \
pinvoke_ppci.cs \
pinvoke_ppcf.cs \
- pinvoke_ppcd.cs
+ pinvoke_ppcd.cs \
+ bug-29585.cs
TEST_CS_SRC_DIST= \
$(BASE_TEST_CS_SRC) \
--- /dev/null
+namespace TestCase
+{
+ using System;
+ using System.Linq;
+ using System.Reflection;
+
+
+ public class MainClass
+ {
+ public static int Main()
+ {
+ return new GenericDerived<Param>().FindMethod();
+ }
+ }
+
+
+ interface Param
+ {
+ }
+
+
+ class GenericDerived<T> :
+ Abstract<GenericDerived<T>>
+ {
+ public int FindMethod()
+ {
+ return FindGenericMethod<T>();
+ }
+ }
+
+
+ abstract class Abstract<TDerived>
+ where TDerived : Abstract<TDerived>
+ {
+ protected virtual int FindGenericMethod<T>()
+ {
+ var method = typeof(TDerived)
+ .GetMethods(BindingFlags.Instance | BindingFlags.NonPublic)
+ .FirstOrDefault(x => x.Name == "FindGenericMethod" && x.IsGenericMethod);
+
+ Console.WriteLine("TDerived = {0}", typeof(TDerived));
+ Console.WriteLine("method = {0}", method);
+ Console.WriteLine("method.DeclaringType = {0}", method.DeclaringType);
+ Console.WriteLine("method.IsGenericMethod = {0}", method.IsGenericMethod);
+ Console.WriteLine("method.IsGenericMethodDefinition = {0}", method.IsGenericMethodDefinition);
+
+ if (!method.IsGenericMethod)
+ return 1;
+ if (!method.IsGenericMethodDefinition)
+ return 2;
+ return 0;
+ }
+ }
+}
\ No newline at end of file
do {
ret = task_threads (current_task (), threads, count);
- } while (ret != KERN_SUCCESS);
+ } while (ret == KERN_ABORTED);
return ret;
}
mono_os_sem_post (MonoSemType *sem)
{
int res;
-
+retry:
res = semaphore_signal (*sem);
g_assert (res != KERN_INVALID_ARGUMENT);
+ if (res == KERN_ABORTED)
+ goto retry;
+
return res != KERN_SUCCESS ? -1 : 0;
}
mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT, th_count;
thread_array_t th_array;
size_t i;
+ kern_return_t ret;
if (pid == getpid ()) {
/* task_for_pid () doesn't work on ios, even for the current process */
task = mach_task_self ();
} else {
- if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
+ do {
+ ret = task_for_pid (mach_task_self (), pid, &task);
+ } while (ret == KERN_ABORTED);
+
+ if (ret != KERN_SUCCESS)
RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
}
- if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count) != KERN_SUCCESS) {
+ do {
+ ret = task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count);
+ } while (ret == KERN_ABORTED);
+
+ if (ret != KERN_SUCCESS) {
if (pid != getpid ())
mach_port_deallocate (mach_task_self (), task);
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
}
+
+ do {
+ ret = task_threads (task, &th_array, &th_count);
+ } while (ret == KERN_ABORTED);
- if (task_threads(task, &th_array, &th_count) != KERN_SUCCESS) {
+ if (ret != KERN_SUCCESS) {
if (pid != getpid ())
mach_port_deallocate (mach_task_self (), task);
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
struct thread_basic_info th_info;
mach_msg_type_number_t th_info_count = THREAD_BASIC_INFO_COUNT;
- if (thread_info(th_array[i], THREAD_BASIC_INFO, (thread_info_t)&th_info, &th_info_count) == KERN_SUCCESS) {
+ do {
+ ret = thread_info(th_array[i], THREAD_BASIC_INFO, (thread_info_t)&th_info, &th_info_count);
+ } while (ret == KERN_ABORTED);
+
+ if (ret == KERN_SUCCESS) {
thread_user_time = th_info.user_time.seconds + th_info.user_time.microseconds / 1e6;
thread_system_time = th_info.system_time.seconds + th_info.system_time.microseconds / 1e6;
//thread_percent = (double)th_info.cpu_usage / TH_USAGE_SCALE;
task_t task;
struct task_basic_info t_info;
mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
+ kern_return_t mach_ret;
if (pid == getpid ()) {
/* task_for_pid () doesn't work on ios, even for the current process */
task = mach_task_self ();
} else {
- if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
+ do {
+ mach_ret = task_for_pid (mach_task_self (), pid, &task);
+ } while (mach_ret == KERN_ABORTED);
+
+ if (mach_ret != KERN_SUCCESS)
RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
}
-
- if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
+
+ do {
+ mach_ret = task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count);
+ } while (mach_ret == KERN_ABORTED);
+
+ if (mach_ret != KERN_SUCCESS) {
if (pid != getpid ())
mach_port_deallocate (mach_task_self (), task);
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
{
kern_return_t ret;
- ret = thread_suspend (info->native_handle);
+ do {
+ ret = thread_suspend (info->native_handle);
+ } while (ret == KERN_ABORTED);
+
if (ret != KERN_SUCCESS)
return;
- ret = thread_abort_safely (info->native_handle);
+ do {
+ ret = thread_abort_safely (info->native_handle);
+ } while (ret == KERN_ABORTED);
/*
* We are doing thread_abort when thread_abort_safely returns KERN_SUCCESS because
if (ret == KERN_SUCCESS)
ret = thread_abort (info->native_handle);
- g_assert (thread_resume (info->native_handle) == KERN_SUCCESS);
+ do {
+ ret = thread_resume (info->native_handle);
+ } while (ret == KERN_ABORTED);
+
+ g_assert (ret == KERN_SUCCESS);
}
gboolean
g_assert (info);
- ret = thread_suspend (info->native_handle);
+
+ do {
+ ret = thread_suspend (info->native_handle);
+ } while (ret == KERN_ABORTED);
+
THREADS_SUSPEND_DEBUG ("SUSPEND %p -> %d\n", (void*)info->native_handle, ret);
if (ret != KERN_SUCCESS)
return FALSE;
/* We're in the middle of a self-suspend, resume and register */
if (!mono_threads_transition_finish_async_suspend (info)) {
mono_threads_add_to_pending_operation_set (info);
- g_assert (thread_resume (info->native_handle) == KERN_SUCCESS);
+ do {
+ ret = thread_resume (info->native_handle);
+ } while (ret == KERN_ABORTED);
+ g_assert (ret == KERN_SUCCESS);
THREADS_SUSPEND_DEBUG ("FAILSAFE RESUME/1 %p -> %d\n", (void*)info->native_handle, 0);
//XXX interrupt_kernel doesn't make sense in this case as the target is not in a syscall
return TRUE;
thread_abort (info->native_handle);
} else {
mono_threads_transition_async_suspend_compensation (info);
- g_assert (thread_resume (info->native_handle) == KERN_SUCCESS);
+ do {
+ ret = thread_resume (info->native_handle);
+ } while (ret == KERN_ABORTED);
+ g_assert (ret == KERN_SUCCESS);
THREADS_SUSPEND_DEBUG ("FAILSAFE RESUME/2 %p -> %d\n", (void*)info->native_handle, 0);
}
return res;
state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
- ret = mono_mach_arch_get_thread_state (info->native_handle, state, &num_state);
+ do {
+ ret = mono_mach_arch_get_thread_state (info->native_handle, state, &num_state);
+ } while (ret == KERN_ABORTED);
+
if (ret != KERN_SUCCESS)
return FALSE;
mono_mach_arch_mcontext_to_thread_state (mctx, state);
- ret = mono_mach_arch_set_thread_state (info->native_handle, state, num_state);
+ do {
+ ret = mono_mach_arch_set_thread_state (info->native_handle, state, num_state);
+ } while (ret == KERN_ABORTED);
+
if (ret != KERN_SUCCESS)
return FALSE;
}
- ret = thread_resume (info->native_handle);
+ do {
+ ret = thread_resume (info->native_handle);
+ } while (ret == KERN_ABORTED);
THREADS_SUSPEND_DEBUG ("RESUME %p -> %d\n", (void*)info->native_handle, ret);
return ret == KERN_SUCCESS;