コード例 #1
0
        public static SignatureHelper GetMethodSigHelper(Module mod, CallingConvention unmanagedCallConv, Type returnType)
        {
            byte type;

            switch (unmanagedCallConv)
            {
            case CallingConvention.Cdecl:
                type = 0x01;                            // C
                break;

            case CallingConvention.StdCall:
            case CallingConvention.Winapi:
                type = 0x02;                            // STDCALL
                break;

            case CallingConvention.ThisCall:
                type = 0x03;                            // THISCALL
                break;

            case CallingConvention.FastCall:
                type = 0x04;                            // FASTCALL
                break;

            default:
                throw new ArgumentOutOfRangeException("unmanagedCallConv");
            }
            SignatureHelper sig = Create(mod, type, returnType);

            sig.AddArgument(returnType);
            sig.paramCount = 0;
            return(sig);
        }
コード例 #2
0
        public static SignatureHelper GetMethodSigHelper(Module mod, Type returnType, Type[] parameterTypes)
        {
            SignatureHelper sig = Create(mod, 0, returnType);

            sig.AddArgument(returnType);
            sig.paramCount = 0;
            sig.AddArguments(parameterTypes, null, null);
            return(sig);
        }
コード例 #3
0
		public LocalBuilder DeclareLocal(Type localType, bool pinned)
		{
			LocalBuilder local = new LocalBuilder(localType, localsCount++, pinned);
			locals.AddArgument(localType, pinned);
			if (scope != null)
			{
				scope.locals.Add(local);
			}
			return local;
		}
コード例 #4
0
        public static SignatureHelper GetPropertySigHelper(Module mod, Type returnType, Type[] parameterTypes)
        {
            SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, Signature.PROPERTY);

            sig.returnType = returnType;
            foreach (Type type in parameterTypes)
            {
                sig.AddArgument(type);
            }
            return(sig);
        }
コード例 #5
0
        public static SignatureHelper GetMethodSigHelper(Module mod, Type returnType, Type[] parameterTypes)
        {
            SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, 0);

            sig.returnType        = returnType;
            sig.callingConvention = CallingConventions.Standard;
            foreach (Type type in parameterTypes)
            {
                sig.AddArgument(type);
            }
            return(sig);
        }
コード例 #6
0
ファイル: SignatureHelper.cs プロジェクト: raj581/Marvin
        public static SignatureHelper GetPropertySigHelper(Module mod, Type returnType, Type[] parameterTypes)
        {
            SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, Signature.PROPERTY);

            sig.returnType = returnType;
            sig.returnTypeOptionalCustomModifiers = Type.EmptyTypes;
            sig.returnTypeRequiredCustomModifiers = Type.EmptyTypes;
            foreach (Type type in parameterTypes)
            {
                sig.AddArgument(type);
            }
            return(sig);
        }
コード例 #7
0
        public static SignatureHelper GetPropertySigHelper(Module mod, CallingConventions callingConvention, Type returnType, Type[] requiredReturnTypeCustomModifiers, Type[] optionalReturnTypeCustomModifiers, Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers)
        {
            byte type = Signature.PROPERTY;

            if ((callingConvention & CallingConventions.HasThis) != 0)
            {
                type |= Signature.HASTHIS;
            }
            SignatureHelper sig = Create(mod, type, returnType);

            sig.AddArgument(returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers);
            sig.paramCount = 0;
            sig.AddArguments(parameterTypes, requiredParameterTypeCustomModifiers, optionalParameterTypeCustomModifiers);
            return(sig);
        }
コード例 #8
0
        public static SignatureHelper GetMethodSigHelper(Module mod, CallingConventions callingConvention, Type returnType)
        {
            byte type = 0;

            if ((callingConvention & CallingConventions.HasThis) != 0)
            {
                type |= Signature.HASTHIS;
            }
            if ((callingConvention & CallingConventions.ExplicitThis) != 0)
            {
                type |= Signature.EXPLICITTHIS;
            }
            if ((callingConvention & CallingConventions.VarArgs) != 0)
            {
                type |= Signature.VARARG;
            }
            SignatureHelper sig = Create(mod, type, returnType);

            sig.AddArgument(returnType);
            sig.paramCount = 0;
            return(sig);
        }
コード例 #9
0
ファイル: SignatureHelper.cs プロジェクト: koush/mono
		public static SignatureHelper GetPropertySigHelper(Module mod, Type returnType, Type[] parameterTypes)
		{
			SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, Signature.PROPERTY);
			sig.returnType = returnType;
			sig.returnTypeOptionalCustomModifiers = Type.EmptyTypes;
			sig.returnTypeRequiredCustomModifiers = Type.EmptyTypes;
			foreach (Type type in parameterTypes)
			{
				sig.AddArgument(type);
			}
			return sig;
		}
コード例 #10
0
ファイル: SignatureHelper.cs プロジェクト: koush/mono
		public static SignatureHelper GetMethodSigHelper(Module mod, Type returnType, Type[] parameterTypes)
		{
			SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, 0);
			sig.returnType = returnType;
			sig.callingConvention = CallingConventions.Standard;
			foreach (Type type in parameterTypes)
			{
				sig.AddArgument(type);
			}
			return sig;
		}
コード例 #11
0
		public static SignatureHelper GetPropertySigHelper(Module mod, Type returnType, Type[] parameterTypes)
		{
			SignatureHelper sig = new SignatureHelper(mod as ModuleBuilder, Signature.PROPERTY);
			sig.returnType = returnType;
			foreach (Type type in parameterTypes)
			{
				sig.AddArgument(type);
			}
			return sig;
		}