#include <mono/metadata/file-mmap.h>
#include <mono/metadata/seq-points-data.h>
#include <mono/metadata/handle.h>
+#include <mono/metadata/w32mutex.h>
+#include <mono/metadata/w32semaphore.h>
+#include <mono/metadata/w32event.h>
#include <mono/io-layer/io-layer.h>
#include <mono/utils/monobitset.h>
#include <mono/utils/mono-time.h>
#include <sys/utsname.h>
#endif
+#if HAVE_BTLS
+#include <btls/btls-ssl.h>
+#include <btls/btls-bio.h>
+#include <btls/btls-error.h>
+#include <btls/btls-key.h>
+#include <btls/btls-pkcs12.h>
+#include <btls/btls-x509-crl.h>
+#include <btls/btls-x509-chain.h>
+#include <btls/btls-x509-lookup.h>
+#include <btls/btls-x509-lookup-mono.h>
+#include <btls/btls-x509-name.h>
+#include <btls/btls-x509-revoked.h>
+#include <btls/btls-x509-store-ctx.h>
+#include <btls/btls-x509-verify-param.h>
+#endif
+
extern MonoString* ves_icall_System_Environment_GetOSVersionString (void);
ICALL_EXPORT MonoReflectionAssembly* ves_icall_System_Reflection_Assembly_GetCallingAssembly (void);
/* if we have no info we are optimistic and assume there is enough room */
if (!stack_addr)
return TRUE;
-#ifdef HOST_WIN32
- // FIXME: Windows dynamically extends the stack, so stack_addr might be close
- // to the current sp
- return TRUE;
-#endif
current = (guint8 *)&stack_addr;
if (current > stack_addr) {
if ((current - stack_addr) < min_size)
if (type == NULL){
if (throwOnError) {
- mono_error_set_type_load_name (&error, g_strdup (str), NULL, "");
+ mono_error_set_type_load_name (&error, g_strdup (str), g_strdup (""), "");
goto leave;
}
}
/* need to report exceptions ? */
if (throwOnError && mono_class_has_failure (klass)) {
/* report SecurityException (or others) that occured when loading the assembly */
- MonoException *exc = mono_class_get_exception_for_failure (klass);
- mono_set_pending_exception (exc);
+ mono_error_set_for_class_failure (&error, klass);
+ mono_error_set_pending_exception (&error);
return NULL;
}
}
check_for_invalid_type (MonoClass *klass, MonoError *error)
{
char *name;
- MonoString *str;
mono_error_init (error);
return;
name = mono_type_get_full_name (klass);
- str = mono_string_new (mono_domain_get (), name);
- g_free (name);
- mono_error_set_exception_instance (error, mono_get_exception_type_load (str, NULL));
-
+ mono_error_set_type_load_name (error, name, g_strdup (""), "");
}
ICALL_EXPORT MonoReflectionType *
ves_icall_RuntimeType_make_array_type (MonoReflectionType *type, int rank)
klass = mono_class_from_mono_type (type->type);
check_for_invalid_type (klass, &error);
- mono_error_set_pending_exception (&error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
if (rank == 0) //single dimentional array
aklass = mono_array_class_get (klass, 1);
klass = klass->generic_class->container_class;
}
+retry:
if (definition) {
/* At the end of the loop, klass points to the eldest class that has this virtual function slot. */
for (parent = klass->parent; parent != NULL; parent = parent->parent) {
result = klass->vtable [slot];
if (result == NULL) {
/* It is an abstract method */
+ gboolean found = FALSE;
gpointer iter = NULL;
- while ((result = mono_class_get_methods (klass, &iter)))
- if (result->slot == slot)
+ while ((result = mono_class_get_methods (klass, &iter))) {
+ if (result->slot == slot) {
+ found = TRUE;
break;
+ }
+ }
+ /* found might be FALSE if we looked in an abstract class
+ * that doesn't override an abstract method of its
+ * parent:
+ * abstract class Base {
+ * public abstract void Foo ();
+ * }
+ * abstract class Derived : Base { }
+ * class Child : Derived {
+ * public override void Foo () { }
+ * }
+ *
+ * if m was Child.Foo and we ask for the base method,
+ * then we get here with klass == Derived and found == FALSE
+ */
+ /* but it shouldn't be the case that if we're looking
+ * for the definition and didn't find a result; the
+ * loop above should've taken us as far as we could
+ * go! */
+ g_assert (!(definition && !found));
+ if (!found)
+ goto retry;
}
- if (result == NULL)
- return m;
+ g_assert (result != NULL);
ret = mono_method_get_object_checked (mono_domain_get (), result, NULL, &error);
mono_error_set_pending_exception (&error);
return SetPriorityClass (handle, priorityClass);
}
+ICALL_EXPORT MonoBoolean
+ves_icall_Mono_Btls_Provider_IsSupported (void)
+{
+#if HAVE_BTLS
+ return TRUE;
+#else
+ return FALSE;
+#endif
+}
+
#ifndef DISABLE_ICALL_TABLES
#define ICALL_TYPE(id,name,first)