summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Reflection/MdImport.cs
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
commita56e30c8d33048216567753d9d3fefc2152af8ac (patch)
tree7e5d979695fc4a431740982eb1cfecc2898b23a5 /src/mscorlib/src/System/Reflection/MdImport.cs
parent4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff)
downloadcoreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
Diffstat (limited to 'src/mscorlib/src/System/Reflection/MdImport.cs')
-rw-r--r--src/mscorlib/src/System/Reflection/MdImport.cs476
1 files changed, 238 insertions, 238 deletions
diff --git a/src/mscorlib/src/System/Reflection/MdImport.cs b/src/mscorlib/src/System/Reflection/MdImport.cs
index b1d9c5eae8..a224a50513 100644
--- a/src/mscorlib/src/System/Reflection/MdImport.cs
+++ b/src/mscorlib/src/System/Reflection/MdImport.cs
@@ -21,149 +21,149 @@ using System.Diagnostics.Contracts;
namespace System.Reflection
{
[Serializable]
- internal enum CorElementType : byte
+ internal enum CorElementType : byte
{
- End = 0x00,
- Void = 0x01,
- Boolean = 0x02,
- Char = 0x03,
- I1 = 0x04,
- U1 = 0x05,
- I2 = 0x06,
- U2 = 0x07,
- I4 = 0x08,
- U4 = 0x09,
- I8 = 0x0A,
- U8 = 0x0B,
- R4 = 0x0C,
- R8 = 0x0D,
- String = 0x0E,
- Ptr = 0x0F,
- ByRef = 0x10,
- ValueType = 0x11,
- Class = 0x12,
- Var = 0x13,
- Array = 0x14,
- GenericInst = 0x15,
- TypedByRef = 0x16,
- I = 0x18,
- U = 0x19,
- FnPtr = 0x1B,
- Object = 0x1C,
- SzArray = 0x1D,
- MVar = 0x1E,
- CModReqd = 0x1F,
- CModOpt = 0x20,
- Internal = 0x21,
- Max = 0x22,
- Modifier = 0x40,
- Sentinel = 0x41,
- Pinned = 0x45,
+ End = 0x00,
+ Void = 0x01,
+ Boolean = 0x02,
+ Char = 0x03,
+ I1 = 0x04,
+ U1 = 0x05,
+ I2 = 0x06,
+ U2 = 0x07,
+ I4 = 0x08,
+ U4 = 0x09,
+ I8 = 0x0A,
+ U8 = 0x0B,
+ R4 = 0x0C,
+ R8 = 0x0D,
+ String = 0x0E,
+ Ptr = 0x0F,
+ ByRef = 0x10,
+ ValueType = 0x11,
+ Class = 0x12,
+ Var = 0x13,
+ Array = 0x14,
+ GenericInst = 0x15,
+ TypedByRef = 0x16,
+ I = 0x18,
+ U = 0x19,
+ FnPtr = 0x1B,
+ Object = 0x1C,
+ SzArray = 0x1D,
+ MVar = 0x1E,
+ CModReqd = 0x1F,
+ CModOpt = 0x20,
+ Internal = 0x21,
+ Max = 0x22,
+ Modifier = 0x40,
+ Sentinel = 0x41,
+ Pinned = 0x45,
}
-[Serializable]
-[Flags()]
- internal enum MdSigCallingConvention: byte
+ [Serializable]
+ [Flags()]
+ internal enum MdSigCallingConvention : byte
{
- CallConvMask = 0x0f, // Calling convention is bottom 4 bits
-
- Default = 0x00,
- C = 0x01,
- StdCall = 0x02,
- ThisCall = 0x03,
- FastCall = 0x04,
- Vararg = 0x05,
- Field = 0x06,
- LocalSig = 0x07,
- Property = 0x08,
- Unmgd = 0x09,
- GenericInst = 0x0a, // generic method instantiation
-
- Generic = 0x10, // Generic method sig with explicit number of type arguments (precedes ordinary parameter count)
- HasThis = 0x20, // Top bit indicates a 'this' parameter
- ExplicitThis = 0x40, // This parameter is explicitly in the signature
+ CallConvMask = 0x0f, // Calling convention is bottom 4 bits
+
+ Default = 0x00,
+ C = 0x01,
+ StdCall = 0x02,
+ ThisCall = 0x03,
+ FastCall = 0x04,
+ Vararg = 0x05,
+ Field = 0x06,
+ LocalSig = 0x07,
+ Property = 0x08,
+ Unmgd = 0x09,
+ GenericInst = 0x0a, // generic method instantiation
+
+ Generic = 0x10, // Generic method sig with explicit number of type arguments (precedes ordinary parameter count)
+ HasThis = 0x20, // Top bit indicates a 'this' parameter
+ ExplicitThis = 0x40, // This parameter is explicitly in the signature
}
-[Serializable]
-[Flags()]
+ [Serializable]
+ [Flags()]
internal enum PInvokeAttributes
- {
- NoMangle = 0x0001,
-
-
- CharSetMask = 0x0006,
- CharSetNotSpec = 0x0000,
- CharSetAnsi = 0x0002,
- CharSetUnicode = 0x0004,
- CharSetAuto = 0x0006,
-
-
- BestFitUseAssem = 0x0000,
- BestFitEnabled = 0x0010,
- BestFitDisabled = 0x0020,
- BestFitMask = 0x0030,
-
- ThrowOnUnmappableCharUseAssem = 0x0000,
- ThrowOnUnmappableCharEnabled = 0x1000,
- ThrowOnUnmappableCharDisabled = 0x2000,
- ThrowOnUnmappableCharMask = 0x3000,
-
- SupportsLastError = 0x0040,
-
- CallConvMask = 0x0700,
- CallConvWinapi = 0x0100,
- CallConvCdecl = 0x0200,
- CallConvStdcall = 0x0300,
- CallConvThiscall = 0x0400,
- CallConvFastcall = 0x0500,
-
- MaxValue = 0xFFFF,
+ {
+ NoMangle = 0x0001,
+
+
+ CharSetMask = 0x0006,
+ CharSetNotSpec = 0x0000,
+ CharSetAnsi = 0x0002,
+ CharSetUnicode = 0x0004,
+ CharSetAuto = 0x0006,
+
+
+ BestFitUseAssem = 0x0000,
+ BestFitEnabled = 0x0010,
+ BestFitDisabled = 0x0020,
+ BestFitMask = 0x0030,
+
+ ThrowOnUnmappableCharUseAssem = 0x0000,
+ ThrowOnUnmappableCharEnabled = 0x1000,
+ ThrowOnUnmappableCharDisabled = 0x2000,
+ ThrowOnUnmappableCharMask = 0x3000,
+
+ SupportsLastError = 0x0040,
+
+ CallConvMask = 0x0700,
+ CallConvWinapi = 0x0100,
+ CallConvCdecl = 0x0200,
+ CallConvStdcall = 0x0300,
+ CallConvThiscall = 0x0400,
+ CallConvFastcall = 0x0500,
+
+ MaxValue = 0xFFFF,
}
-[Serializable]
-[Flags()]
+ [Serializable]
+ [Flags()]
internal enum MethodSemanticsAttributes
{
- Setter = 0x0001,
- Getter = 0x0002,
- Other = 0x0004,
- AddOn = 0x0008,
- RemoveOn = 0x0010,
- Fire = 0x0020,
+ Setter = 0x0001,
+ Getter = 0x0002,
+ Other = 0x0004,
+ AddOn = 0x0008,
+ RemoveOn = 0x0010,
+ Fire = 0x0020,
}
[Serializable]
internal enum MetadataTokenType
{
- Module = 0x00000000,
- TypeRef = 0x01000000,
- TypeDef = 0x02000000,
- FieldDef = 0x04000000,
- MethodDef = 0x06000000,
- ParamDef = 0x08000000,
- InterfaceImpl = 0x09000000,
- MemberRef = 0x0a000000,
- CustomAttribute = 0x0c000000,
- Permission = 0x0e000000,
- Signature = 0x11000000,
- Event = 0x14000000,
- Property = 0x17000000,
- ModuleRef = 0x1a000000,
- TypeSpec = 0x1b000000,
- Assembly = 0x20000000,
- AssemblyRef = 0x23000000,
- File = 0x26000000,
- ExportedType = 0x27000000,
- ManifestResource = 0x28000000,
- GenericPar = 0x2a000000,
- MethodSpec = 0x2b000000,
- String = 0x70000000,
- Name = 0x71000000,
- BaseType = 0x72000000,
- Invalid = 0x7FFFFFFF,
+ Module = 0x00000000,
+ TypeRef = 0x01000000,
+ TypeDef = 0x02000000,
+ FieldDef = 0x04000000,
+ MethodDef = 0x06000000,
+ ParamDef = 0x08000000,
+ InterfaceImpl = 0x09000000,
+ MemberRef = 0x0a000000,
+ CustomAttribute = 0x0c000000,
+ Permission = 0x0e000000,
+ Signature = 0x11000000,
+ Event = 0x14000000,
+ Property = 0x17000000,
+ ModuleRef = 0x1a000000,
+ TypeSpec = 0x1b000000,
+ Assembly = 0x20000000,
+ AssemblyRef = 0x23000000,
+ File = 0x26000000,
+ ExportedType = 0x27000000,
+ ManifestResource = 0x28000000,
+ GenericPar = 0x2a000000,
+ MethodSpec = 0x2b000000,
+ String = 0x70000000,
+ Name = 0x71000000,
+ BaseType = 0x72000000,
+ Invalid = 0x7FFFFFFF,
}
[Serializable]
@@ -179,7 +179,7 @@ namespace System.Reflection
throw new IndexOutOfRangeException();
Contract.EndContractBlock();
- unsafe
+ unsafe
{
return ((byte*)m_constArray.ToPointer())[index];
}
@@ -190,7 +190,7 @@ namespace System.Reflection
internal int m_length;
internal IntPtr m_constArray;
}
-
+
[Serializable]
internal struct MetadataToken
{
@@ -211,9 +211,9 @@ namespace System.Reflection
return false;
}
- public static bool IsNullToken(int token)
- {
- return (token & 0x00FFFFFF) == 0;
+ public static bool IsNullToken(int token)
+ {
+ return (token & 0x00FFFFFF) == 0;
}
#endregion
@@ -222,11 +222,11 @@ namespace System.Reflection
#endregion
#region Constructor
- public MetadataToken(int token) { Value = token; }
+ public MetadataToken(int token) { Value = token; }
#endregion
-
+
#region Public Members
- public bool IsGlobalTypeDefToken { get { return (Value == 0x02000001); } }
+ public bool IsGlobalTypeDefToken { get { return (Value == 0x02000001); } }
public MetadataTokenType TokenType { get { return (MetadataTokenType)(Value & 0xFF000000); } }
public bool IsTypeRef { get { return TokenType == MetadataTokenType.TypeRef; } }
public bool IsTypeDef { get { return TokenType == MetadataTokenType.TypeDef; } }
@@ -288,7 +288,7 @@ namespace System.Reflection
#region Override methods from Object
internal static readonly MetadataImport EmptyImport = new MetadataImport((IntPtr)0, null);
-
+
public override int GetHashCode()
{
return ValueType.GetHashCodeOfPtr(m_metadataImport2);
@@ -296,11 +296,11 @@ namespace System.Reflection
public override bool Equals(object obj)
{
- if(!(obj is MetadataImport))
+ if (!(obj is MetadataImport))
return false;
return Equals((MetadataImport)obj);
}
-
+
private bool Equals(MetadataImport import)
{
return import.m_metadataImport2 == m_metadataImport2;
@@ -310,18 +310,18 @@ namespace System.Reflection
#region Static Members
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetMarshalAs(IntPtr pNativeType, int cNativeType, out int unmanagedType, out int safeArraySubType, out string safeArrayUserDefinedSubType,
+ private static extern void _GetMarshalAs(IntPtr pNativeType, int cNativeType, out int unmanagedType, out int safeArraySubType, out string safeArrayUserDefinedSubType,
out int arraySubType, out int sizeParamIndex, out int sizeConst, out string marshalType, out string marshalCookie,
out int iidParamIndex);
- internal static void GetMarshalAs(ConstArray nativeType,
- out UnmanagedType unmanagedType, out VarEnum safeArraySubType, out string safeArrayUserDefinedSubType,
+ internal static void GetMarshalAs(ConstArray nativeType,
+ out UnmanagedType unmanagedType, out VarEnum safeArraySubType, out string safeArrayUserDefinedSubType,
out UnmanagedType arraySubType, out int sizeParamIndex, out int sizeConst, out string marshalType, out string marshalCookie,
out int iidParamIndex)
{
int _unmanagedType, _safeArraySubType, _arraySubType;
_GetMarshalAs(nativeType.Signature, (int)nativeType.Length,
- out _unmanagedType, out _safeArraySubType, out safeArrayUserDefinedSubType,
+ out _unmanagedType, out _safeArraySubType, out safeArrayUserDefinedSubType,
out _arraySubType, out sizeParamIndex, out sizeConst, out marshalType, out marshalCookie,
out iidParamIndex);
unmanagedType = (UnmanagedType)_unmanagedType;
@@ -339,32 +339,32 @@ namespace System.Reflection
#region Constructor
internal MetadataImport(IntPtr metadataImport2, object keepalive)
- {
+ {
m_metadataImport2 = metadataImport2;
m_keepalive = keepalive;
}
#endregion
#region FCalls
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
private unsafe static extern void _Enum(IntPtr scope, int type, int parent, out MetadataEnumResult result);
- public unsafe void Enum(MetadataTokenType type, int parent, out MetadataEnumResult result)
- {
+ public unsafe void Enum(MetadataTokenType type, int parent, out MetadataEnumResult result)
+ {
_Enum(m_metadataImport2, (int)type, parent, out result);
}
- public unsafe void EnumNestedTypes(int mdTypeDef, out MetadataEnumResult result)
+ public unsafe void EnumNestedTypes(int mdTypeDef, out MetadataEnumResult result)
{
Enum(MetadataTokenType.TypeDef, mdTypeDef, out result);
}
- public unsafe void EnumCustomAttributes(int mdToken, out MetadataEnumResult result)
+ public unsafe void EnumCustomAttributes(int mdToken, out MetadataEnumResult result)
{
Enum(MetadataTokenType.CustomAttribute, mdToken, out result);
}
- public unsafe void EnumParams(int mdMethodDef, out MetadataEnumResult result)
+ public unsafe void EnumParams(int mdMethodDef, out MetadataEnumResult result)
{
Enum(MetadataTokenType.ParamDef, mdMethodDef, out result);
}
@@ -384,30 +384,30 @@ namespace System.Reflection
Enum(MetadataTokenType.Event, mdTypeDef, out result);
}
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern String _GetDefaultValue(IntPtr scope, int mdToken, out long value, out int length, out int corElementType);
- public String GetDefaultValue(int mdToken, out long value, out int length, out CorElementType corElementType)
- {
- int _corElementType;
+ public String GetDefaultValue(int mdToken, out long value, out int length, out CorElementType corElementType)
+ {
+ int _corElementType;
String stringVal;
- stringVal = _GetDefaultValue(m_metadataImport2, mdToken, out value, out length, out _corElementType);
+ stringVal = _GetDefaultValue(m_metadataImport2, mdToken, out value, out length, out _corElementType);
corElementType = (CorElementType)_corElementType;
return stringVal;
}
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
private static unsafe extern void _GetUserString(IntPtr scope, int mdToken, void** name, out int length);
- public unsafe String GetUserString(int mdToken)
- {
+ public unsafe String GetUserString(int mdToken)
+ {
void* name;
int length;
- _GetUserString(m_metadataImport2, mdToken, &name, out length);
+ _GetUserString(m_metadataImport2, mdToken, &name, out length);
if (name == null)
return null;
char[] c = new char[length];
- for (int i = 0; i < c.Length; i ++)
+ for (int i = 0; i < c.Length; i++)
{
#if ALIGN_ACCESS
c[i] = (char)Marshal.ReadInt16( (IntPtr) (((char*)name) + i) );
@@ -419,87 +419,87 @@ namespace System.Reflection
return new String(c);
}
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
private static unsafe extern void _GetName(IntPtr scope, int mdToken, void** name);
- public unsafe Utf8String GetName(int mdToken)
- {
+ public unsafe Utf8String GetName(int mdToken)
+ {
void* name;
- _GetName(m_metadataImport2, mdToken, &name);
-
+ _GetName(m_metadataImport2, mdToken, &name);
+
return new Utf8String(name);
}
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
private static unsafe extern void _GetNamespace(IntPtr scope, int mdToken, void** namesp);
- public unsafe Utf8String GetNamespace(int mdToken)
- {
+ public unsafe Utf8String GetNamespace(int mdToken)
+ {
void* namesp;
_GetNamespace(m_metadataImport2, mdToken, &namesp);
-
+
return new Utf8String(namesp);
}
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
private unsafe static extern void _GetEventProps(IntPtr scope, int mdToken, void** name, out int eventAttributes);
- public unsafe void GetEventProps(int mdToken, out void* name, out EventAttributes eventAttributes)
- {
- int _eventAttributes;
+ public unsafe void GetEventProps(int mdToken, out void* name, out EventAttributes eventAttributes)
+ {
+ int _eventAttributes;
void* _name;
_GetEventProps(m_metadataImport2, mdToken, &_name, out _eventAttributes);
name = _name;
eventAttributes = (EventAttributes)_eventAttributes;
}
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void _GetFieldDefProps(IntPtr scope, int mdToken, out int fieldAttributes);
- public void GetFieldDefProps(int mdToken, out FieldAttributes fieldAttributes)
- {
- int _fieldAttributes;
+ public void GetFieldDefProps(int mdToken, out FieldAttributes fieldAttributes)
+ {
+ int _fieldAttributes;
_GetFieldDefProps(m_metadataImport2, mdToken, out _fieldAttributes);
fieldAttributes = (FieldAttributes)_fieldAttributes;
}
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private unsafe static extern void _GetPropertyProps(IntPtr scope,
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ private unsafe static extern void _GetPropertyProps(IntPtr scope,
int mdToken, void** name, out int propertyAttributes, out ConstArray signature);
- public unsafe void GetPropertyProps(int mdToken, out void* name, out PropertyAttributes propertyAttributes, out ConstArray signature)
- {
- int _propertyAttributes;
+ public unsafe void GetPropertyProps(int mdToken, out void* name, out PropertyAttributes propertyAttributes, out ConstArray signature)
+ {
+ int _propertyAttributes;
void* _name;
- _GetPropertyProps(m_metadataImport2, mdToken, &_name, out _propertyAttributes, out signature);
+ _GetPropertyProps(m_metadataImport2, mdToken, &_name, out _propertyAttributes, out signature);
name = _name;
propertyAttributes = (PropertyAttributes)_propertyAttributes;
}
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private static extern void _GetParentToken(IntPtr scope,
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ private static extern void _GetParentToken(IntPtr scope,
int mdToken, out int tkParent);
- public int GetParentToken(int tkToken)
- {
+ public int GetParentToken(int tkToken)
+ {
int tkParent;
- _GetParentToken(m_metadataImport2, tkToken, out tkParent);
+ _GetParentToken(m_metadataImport2, tkToken, out tkParent);
return tkParent;
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetParamDefProps(IntPtr scope,
+ private static extern void _GetParamDefProps(IntPtr scope,
int parameterToken, out int sequence, out int attributes);
public void GetParamDefProps(int parameterToken, out int sequence, out ParameterAttributes attributes)
{
int _attributes;
_GetParamDefProps(m_metadataImport2, parameterToken, out sequence, out _attributes);
-
+
attributes = (ParameterAttributes)_attributes;
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetGenericParamProps(IntPtr scope,
- int genericParameter,
+ private static extern void _GetGenericParamProps(IntPtr scope,
+ int genericParameter,
out int flags);
-
+
public void GetGenericParamProps(
- int genericParameter,
+ int genericParameter,
out GenericParameterAttributes attributes)
{
int _attributes;
@@ -508,9 +508,9 @@ namespace System.Reflection
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetScopeProps(IntPtr scope,
+ private static extern void _GetScopeProps(IntPtr scope,
out Guid mvid);
-
+
public void GetScopeProps(
out Guid mvid)
{
@@ -522,15 +522,15 @@ namespace System.Reflection
{
if (token.IsMemberRef)
return GetMemberRefProps(token);
-
+
return GetSigOfMethodDef(token);
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetSigOfMethodDef(IntPtr scope,
- int methodToken,
+ private static extern void _GetSigOfMethodDef(IntPtr scope,
+ int methodToken,
ref ConstArray signature);
-
+
public ConstArray GetSigOfMethodDef(int methodToken)
{
ConstArray signature = new ConstArray();
@@ -541,10 +541,10 @@ namespace System.Reflection
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetSignatureFromToken(IntPtr scope,
- int methodToken,
+ private static extern void _GetSignatureFromToken(IntPtr scope,
+ int methodToken,
ref ConstArray signature);
-
+
public ConstArray GetSignatureFromToken(int token)
{
ConstArray signature = new ConstArray();
@@ -555,61 +555,61 @@ namespace System.Reflection
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetMemberRefProps(IntPtr scope,
- int memberTokenRef,
+ private static extern void _GetMemberRefProps(IntPtr scope,
+ int memberTokenRef,
out ConstArray signature);
-
+
public ConstArray GetMemberRefProps(int memberTokenRef)
{
ConstArray signature = new ConstArray();
-
+
_GetMemberRefProps(m_metadataImport2, memberTokenRef, out signature);
return signature;
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetCustomAttributeProps(IntPtr scope,
- int customAttributeToken,
- out int constructorToken,
+ private static extern void _GetCustomAttributeProps(IntPtr scope,
+ int customAttributeToken,
+ out int constructorToken,
out ConstArray signature);
-
- public void GetCustomAttributeProps(
- int customAttributeToken,
- out int constructorToken,
+
+ public void GetCustomAttributeProps(
+ int customAttributeToken,
+ out int constructorToken,
out ConstArray signature)
{
- _GetCustomAttributeProps(m_metadataImport2, customAttributeToken,
+ _GetCustomAttributeProps(m_metadataImport2, customAttributeToken,
out constructorToken, out signature);
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetClassLayout(IntPtr scope,
+ private static extern void _GetClassLayout(IntPtr scope,
int typeTokenDef, out int packSize, out int classSize);
public void GetClassLayout(
- int typeTokenDef,
- out int packSize,
+ int typeTokenDef,
+ out int packSize,
out int classSize)
{
_GetClassLayout(m_metadataImport2, typeTokenDef, out packSize, out classSize);
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern bool _GetFieldOffset(IntPtr scope,
+ private static extern bool _GetFieldOffset(IntPtr scope,
int typeTokenDef, int fieldTokenDef, out int offset);
public bool GetFieldOffset(
- int typeTokenDef,
- int fieldTokenDef,
+ int typeTokenDef,
+ int fieldTokenDef,
out int offset)
{
return _GetFieldOffset(m_metadataImport2, typeTokenDef, fieldTokenDef, out offset);
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetSigOfFieldDef(IntPtr scope,
- int fieldToken,
+ private static extern void _GetSigOfFieldDef(IntPtr scope,
+ int fieldToken,
ref ConstArray fieldMarshal);
-
+
public ConstArray GetSigOfFieldDef(int fieldToken)
{
ConstArray fieldMarshal = new ConstArray();
@@ -620,10 +620,10 @@ namespace System.Reflection
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void _GetFieldMarshal(IntPtr scope,
- int fieldToken,
+ private static extern void _GetFieldMarshal(IntPtr scope,
+ int fieldToken,
ref ConstArray fieldMarshal);
-
+
public ConstArray GetFieldMarshal(int fieldToken)
{
ConstArray fieldMarshal = new ConstArray();
@@ -634,16 +634,16 @@ namespace System.Reflection
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private unsafe static extern void _GetPInvokeMap(IntPtr scope,
- int token,
- out int attributes,
- void** importName,
- void** importDll);
-
+ private unsafe static extern void _GetPInvokeMap(IntPtr scope,
+ int token,
+ out int attributes,
+ void** importName,
+ void** importDll);
+
public unsafe void GetPInvokeMap(
- int token,
- out PInvokeAttributes attributes,
- out String importName,
+ int token,
+ out PInvokeAttributes attributes,
+ out String importName,
out String importDll)
{
int _attributes;
@@ -656,10 +656,10 @@ namespace System.Reflection
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern bool _IsValidToken(IntPtr scope, int token);
- public bool IsValidToken(int token)
- {
- return _IsValidToken(m_metadataImport2, token);
+ private static extern bool _IsValidToken(IntPtr scope, int token);
+ public bool IsValidToken(int token)
+ {
+ return _IsValidToken(m_metadataImport2, token);
}
#endregion
}