Merge pull request #1333 from joero74/ignore-missing-host
[mono.git] / mono / metadata / marshal.h
index a8f7057d6294272322cbde71319577a086d3f966..3ba8addbda74dfdc724f7cb4120e7bab4c0a879b 100644 (file)
@@ -104,12 +104,17 @@ typedef enum {
        /* Subtypes of MONO_WRAPPER_MANAGED_TO_NATIVE */
        WRAPPER_SUBTYPE_ICALL_WRAPPER,
        WRAPPER_SUBTYPE_NATIVE_FUNC_AOT,
+       WRAPPER_SUBTYPE_PINVOKE,
        /* Subtypes of MONO_WRAPPER_UNKNOWN */
        WRAPPER_SUBTYPE_SYNCHRONIZED_INNER,
        WRAPPER_SUBTYPE_GSHAREDVT_IN,
        WRAPPER_SUBTYPE_GSHAREDVT_OUT,
+       WRAPPER_SUBTYPE_ARRAY_ACCESSOR,
        /* Subtypes of MONO_WRAPPER_MANAGED_TO_MANAGED */
-       WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER
+       WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER,
+       /* Subtypes of MONO_WRAPPER_DELEGATE_INVOKE */
+       WRAPPER_SUBTYPE_DELEGATE_INVOKE_VIRTUAL,
+       WRAPPER_SUBTYPE_DELEGATE_INVOKE_BOUND
 } WrapperSubtype;
 
 typedef struct {
@@ -151,6 +156,14 @@ typedef struct {
        gpointer func;
 } ICallWrapperInfo;
 
+typedef struct {
+       MonoMethod *method;
+} ArrayAccessorWrapperInfo;
+
+typedef struct {
+       MonoClass *klass;
+} ProxyWrapperInfo;
+
 /*
  * This structure contains additional information to uniquely identify a given wrapper
  * method. It can be retrieved by mono_marshal_get_wrapper_info () for certain types
@@ -177,13 +190,17 @@ typedef struct {
                GenericArrayHelperWrapperInfo generic_array_helper;
                /* ICALL_WRAPPER */
                ICallWrapperInfo icall;
+               /* ARRAY_ACCESSOR */
+               ArrayAccessorWrapperInfo array_accessor;
+               /* PROXY_ISINST etc. */
+               ProxyWrapperInfo proxy;
        } d;
 } WrapperInfo;
 
 G_BEGIN_DECLS
 
 /*type of the function pointer of methods returned by mono_marshal_get_runtime_invoke*/
-typedef MonoObject *(*RuntimeInvokeFunction) (MonoObject *this, void **params, MonoObject **exc, void* compiled_method);
+typedef MonoObject *(*RuntimeInvokeFunction) (MonoObject *this_obj, void **params, MonoObject **exc, void* compiled_method);
 
 typedef void (*RuntimeInvokeDynamicFunction) (void *args, MonoObject **exc, void* compiled_method);
 
@@ -192,6 +209,9 @@ typedef void (*RuntimeInvokeDynamicFunction) (void *args, MonoObject **exc, void
 void
 mono_marshal_init (void) MONO_INTERNAL;
 
+void
+mono_marshal_init_tls (void) MONO_INTERNAL;
+
 void
 mono_marshal_cleanup (void) MONO_INTERNAL;
 
@@ -285,7 +305,7 @@ MonoMethod *
 mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del) MONO_INTERNAL;
 
 MonoMethod *
-mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual) MONO_INTERNAL;
+mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean is_virtual) MONO_INTERNAL;
 
 MonoMethod*
 mono_marshal_get_runtime_invoke_dynamic (void) MONO_INTERNAL;
@@ -351,7 +371,10 @@ MonoMethod*
 mono_marshal_get_array_address (int rank, int elem_size) MONO_INTERNAL;
 
 MonoMethod *
-mono_marshal_get_generic_array_helper (MonoClass *class, MonoClass *iface,
+mono_marshal_get_array_accessor_wrapper (MonoMethod *method) MONO_INTERNAL;
+
+MonoMethod *
+mono_marshal_get_generic_array_helper (MonoClass *klass, MonoClass *iface,
                                       gchar *name, MonoMethod *method) MONO_INTERNAL;
 
 MonoMethod *
@@ -394,36 +417,6 @@ void
 ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (gpointer src, gint32 start_index,
                                                                      MonoArray *dest, gint32 length) MONO_INTERNAL;
 
-gpointer
-ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr (gpointer ptr, gint32 offset) MONO_INTERNAL;
-
-unsigned char
-ves_icall_System_Runtime_InteropServices_Marshal_ReadByte (gpointer ptr, gint32 offset) MONO_INTERNAL;
-
-gint16
-ves_icall_System_Runtime_InteropServices_Marshal_ReadInt16 (gpointer ptr, gint32 offset) MONO_INTERNAL;
-
-gint32
-ves_icall_System_Runtime_InteropServices_Marshal_ReadInt32 (gpointer ptr, gint32 offset) MONO_INTERNAL;
-
-gint64
-ves_icall_System_Runtime_InteropServices_Marshal_ReadInt64 (gpointer ptr, gint32 offset) MONO_INTERNAL;
-
-void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteByte (gpointer ptr, gint32 offset, unsigned char val) MONO_INTERNAL;
-
-void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteIntPtr (gpointer ptr, gint32 offset, gpointer val) MONO_INTERNAL;
-
-void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteInt16 (gpointer ptr, gint32 offset, gint16 val) MONO_INTERNAL;
-
-void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteInt32 (gpointer ptr, gint32 offset, gint32 val) MONO_INTERNAL;
-
-void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteInt64 (gpointer ptr, gint32 offset, gint64 val) MONO_INTERNAL;
-
 MonoString *
 ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi (char *ptr) MONO_INTERNAL;
 
@@ -541,16 +534,16 @@ ves_icall_Mono_Interop_ComInteropProxy_AddProxy (gpointer pUnk, MonoComInteropPr
 MonoComInteropProxy*
 ves_icall_Mono_Interop_ComInteropProxy_FindProxy (gpointer pUnk) MONO_INTERNAL;
 
-void
+MONO_API void
 mono_win32_compat_CopyMemory (gpointer dest, gconstpointer source, gsize length);
 
-void
+MONO_API void
 mono_win32_compat_FillMemory (gpointer dest, gsize length, guchar fill);
 
-void
+MONO_API void
 mono_win32_compat_MoveMemory (gpointer dest, gconstpointer source, gsize length);
 
-void
+MONO_API void
 mono_win32_compat_ZeroMemory (gpointer dest, gsize length);
 
 void