2 // Mono runtime native structs surfaced to managed code.
5 // Aleksey Kliger <aleksey@xamarin.com>
6 // Rodrigo Kumpera <kumpera@xamarin.com>
8 // Copyright 2016 Dot net foundation.
9 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
13 using System
.Runtime
.InteropServices
;
15 #pragma warning disable 169
19 // Managed representations of mono runtime types
21 internal static class RuntimeStructs
{
22 // class-internals.h MonoRemoteClass
23 [StructLayout(LayoutKind
.Sequential
)]
24 internal unsafe struct RemoteClass
{
25 internal IntPtr default_vtable
;
26 internal IntPtr xdomain_vtable
;
27 internal MonoClass
* proxy_class
;
28 internal IntPtr proxy_class_name
;
29 internal uint interface_count
;
30 // FIXME: How to represent variable-length array struct member?
31 // MonoClass* interfaces [];
34 internal struct MonoClass
{
37 // class-internals.h MonoGenericParamInfo
38 internal unsafe struct GenericParamInfo
{
39 internal MonoClass
* pklass
;
41 internal ushort flags
;
43 internal MonoClass
** constraints
; /* NULL terminated */
47 internal unsafe struct GPtrArray
{
48 internal IntPtr
* data
;
52 // handle.h HandleStackMark
53 struct HandleStackMark
{
54 int size
, interior_size
;
58 // mono-error.h MonoError
62 IntPtr hidden_1
, hidden_2
, hidden_3
, hidden_4
, hidden_5
, hidden_6
, hidden_7
, hidden_8
;
63 IntPtr hidden_11
, hidden_12
, hidden_13
, hidden_14
, hidden_15
, hidden_16
, hidden_17
, hidden_18
;
67 //Maps to metadata-internals.h:: MonoAssemblyName
68 internal unsafe struct MonoAssemblyName
70 const int MONO_PUBLIC_KEY_TOKEN_LENGTH
= 17;
73 internal IntPtr culture
;
74 internal IntPtr hash_value
;
75 internal IntPtr public_key
;
76 internal fixed byte public_key_token
[MONO_PUBLIC_KEY_TOKEN_LENGTH
];
77 internal uint hash_alg
;
78 internal uint hash_len
;
80 internal ushort major
, minor
, build
, revision
;