FromReader() public static method

public static FromReader ( MetadataHeader header, IBinaryStreamReader reader ) : MethodSignature
header MetadataHeader
reader IBinaryStreamReader
return MethodSignature
        public static CallingConventionSignature FromReader(MetadataImage image, IBinaryStreamReader reader)
        {
            var flag = reader.ReadByte();

            reader.Position--;

            switch ((CallingConventionAttributes)flag & SignatureTypeMask)
            {
            case CallingConventionAttributes.Default:
            case CallingConventionAttributes.C:
            case CallingConventionAttributes.ExplicitThis:
            case CallingConventionAttributes.FastCall:
            case CallingConventionAttributes.StdCall:
            case CallingConventionAttributes.ThisCall:
            case CallingConventionAttributes.VarArg:
                return(MethodSignature.FromReader(image, reader));

            case CallingConventionAttributes.Property:
                return(PropertySignature.FromReader(image, reader));

            case CallingConventionAttributes.Local:
                return(LocalVariableSignature.FromReader(image, reader));

            case CallingConventionAttributes.GenericInstance:
                return(GenericInstanceMethodSignature.FromReader(image, reader));

            case CallingConventionAttributes.Field:
                return(FieldSignature.FromReader(image, reader));
            }
            throw new NotSupportedException();
        }
Beispiel #2
0
 /// <summary>
 /// Reads a single function pointer type at the current position of the provided stream reader.
 /// </summary>
 /// <param name="image">The image the function pointer was defined in.</param>
 /// <param name="reader">The reader to use.</param>
 /// <param name="protection">The recursion protection that is used to detect malicious loops in the metadata.</param>
 /// <returns>The read function pointer</returns>
 public static FunctionPointerTypeSignature FromReader(
     MetadataImage image,
     IBinaryStreamReader reader,
     RecursionProtection protection)
 {
     return(new FunctionPointerTypeSignature(MethodSignature.FromReader(image, reader, false, protection)));
 }
Beispiel #3
0
        public new static FunctionPointerTypeSignature FromReader(MetadataHeader header, IBinaryStreamReader reader)
        {
            long position = reader.Position;

            return(new FunctionPointerTypeSignature(MethodSignature.FromReader(header, reader))
            {
                StartOffset = position
            });
        }
 public new static FunctionPointerTypeSignature FromReader(MetadataImage image, IBinaryStreamReader reader)
 {
     return(new FunctionPointerTypeSignature(MethodSignature.FromReader(image, reader)));
 }
Beispiel #5
0
 public static FunctionPointerTypeSignature FromReader(MetadataHeader header, IBinaryStreamReader reader)
 {
     return(new FunctionPointerTypeSignature(MethodSignature.FromReader(header, reader)));
 }