mono_gc_wbarrier_arrayref_copy (__p, __s, (count)); \
} while (0)
+static inline gboolean
+mono_handle_array_has_bounds (MonoArrayHandle arr)
+{
+ return MONO_HANDLE_GETVAL (arr, bounds) != NULL;
+}
+
+static inline void
+mono_handle_array_get_bounds_dim (MonoArrayHandle arr, gint32 dim, MonoArrayBounds *bounds)
+{
+ MonoArrayBounds *src = MONO_HANDLE_GETVAL (arr, bounds);
+ memcpy (bounds, &src[dim], sizeof (MonoArrayBounds));
+}
+
typedef struct {
MonoObject obj;
CallType_OneWay = 3
} MonoCallType;
+/* MonoSafeHandle is in class-internals.h. */
+/* Safely access System.Net.Sockets.SafeSocketHandle from native code */
+TYPED_HANDLE_DECL (MonoSafeHandle);
+
/* This corresponds to System.Type */
struct _MonoReflectionType {
MonoObject object;
gpointer last;
};
+/* It's safe to access System.Threading.InternalThread from native code via a
+ * raw pointer because all instances should be pinned. But for uniformity of
+ * icall wrapping, let's declare a MonoInternalThreadHandle anyway.
+ */
+TYPED_HANDLE_DECL (MonoInternalThread);
+
struct _MonoThread {
MonoObject obj;
struct _MonoInternalThread *internal_thread;
mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoArray *out_args, MonoError *error);
gboolean
-mono_delegate_ctor_with_method (MonoObject *this_obj, MonoObject *target, gpointer addr, MonoMethod *method, MonoError *error);
+mono_delegate_ctor_with_method (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoMethod *method, MonoError *error);
gboolean
-mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr, MonoError *error);
+mono_delegate_ctor (MonoObjectHandle this_obj, MonoObjectHandle target, gpointer addr, MonoError *error);
void*
mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean for_box, gboolean *pass_size_in_words);
MonoBoolean method_is_virtual;
};
+/* Safely access System.Delegate from native code */
+TYPED_HANDLE_DECL (MonoDelegate);
+
typedef struct _MonoMulticastDelegate MonoMulticastDelegate;
struct _MonoMulticastDelegate {
MonoDelegate delegate;
MonoArray *delegates;
};
+/* Safely access System.MulticastDelegate from native code */
+TYPED_HANDLE_DECL (MonoMulticastDelegate);
+
struct _MonoReflectionField {
MonoObject object;
MonoClass *klass;
MonoProperty *prop;
} CattrNamedArg;
+/* All MonoInternalThread instances should be pinned, so it's safe to use the raw ptr. However
+ * for uniformity, icall wrapping will make handles anyway. So this is the method for getting the payload.
+ */
+static inline MonoInternalThread*
+mono_internal_thread_handle_ptr (MonoInternalThreadHandle h)
+{
+ return MONO_HANDLE_RAW (h); /* Safe */
+}
+
gboolean mono_image_create_pefile (MonoReflectionModuleBuilder *module, gpointer file, MonoError *error);
guint32 mono_image_insert_string (MonoReflectionModuleBuilderHandle module, MonoStringHandle str, MonoError *error);
guint32 mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj, gboolean create_methodspec, gboolean register_token, MonoError *error);
void
mono_nullable_init (guint8 *buf, MonoObject *value, MonoClass *klass);
+void
+mono_nullable_init_from_handle (guint8 *buf, MonoObjectHandle value, MonoClass *klass);
+
MonoObject *
mono_value_box_checked (MonoDomain *domain, MonoClass *klass, void* val, MonoError *error);