Esempio n. 1
0
        public static unsafe ValueType Box(RuntimeArgumentHandle arg)
        {
            ValueType empty = (ValueType)FormatterServices.GetUninitializedObject(typeof(RuntimeArgumentHandle));

            TypedReference innerRef;

            TypedReferenceTools.MakeTypedReference(&innerRef, empty);
            __refvalue(innerRef, RuntimeArgumentHandle) = arg;
            return(empty);
        }
Esempio n. 2
0
        // A few tests depends on this. Remove this after clearing up the tests.
        internal static object[] ArgListToParams(RuntimeArgumentHandle handle)
        {
            var iter  = new ArgIterator(handle);
            var count = iter.GetRemainingCount();
            var args  = new object[count];

            for (var i = 0; i < count; i++)
            {
                args[i] = TypedReference.ToObject(iter.GetNextArg());
            }

            return(args);
        }
Esempio n. 3
0
        object getInnerHandle(__arglist)
        {
            RuntimeArgumentHandle handle = __arglist;
            ArgIterator           args   = new ArgIterator(handle);
            var mi   = typeof(ArgIterator).GetMembers();
            var meth = typeof(ArgIterator).GetMethod("GetNextArg", Type.EmptyTypes);
            var il   = meth.GetMethodBody().GetILAsByteArray();
            //ExecuteTyped(meth, __arglist(handle));
            var            t           = args.GetNextArgType();
            TypedReference tr          = args.GetNextArg();
            var            targetType  = TypedReference.GetTargetType(tr);
            var            typedObject = TypedReference.ToObject(tr);

            return(typedObject);
        }
Esempio n. 4
0
        public void GetArgIterator(object a, __arglist)
        {
            RuntimeArgumentHandle handle = __arglist;

            GetArgIterator(1, __arglist(handle));
            ArgIterator       args = new ArgIterator(handle);
            TypedReference    tr   = args.GetNextArg();
            RuntimeTypeHandle runtimeTypeHandle = TypedReference.TargetTypeToken(tr);
            ModuleHandle      mh    = runtimeTypeHandle.GetModuleHandle();
            IntPtr            mhPtr = runtimeTypeHandle.Value;

            var targetType  = TypedReference.GetTargetType(tr);
            var typedObject = TypedReference.ToObject(tr);



            args.End();
        }
Esempio n. 5
0
        private object[] CreateRefArray(RuntimeArgumentHandle handle)
        {
            var iterator = new ArgIterator(handle);
            var len      = iterator.GetRemainingCount();

            if ((_format != null && _format.Length != len) || (_format == null && len != 0))
            {
                throw new ArgumentException("Invalid arguments");
            }

            var args = new object[len];

            for (var idx = 0; idx < len; idx++)
            {
                args[idx] = TypedReference.ToObject(iterator.GetNextArg());
            }

            return(args);
        }
 void ITestClass.Restricted(RuntimeArgumentHandle runtimeArgumentHandle) => Restricted(runtimeArgumentHandle);
        // The contents of this class were created by the Mocklis code-generator.
        // Any changes you make will be overwritten if the contents are re-generated.

        protected virtual void Restricted(RuntimeArgumentHandle runtimeArgumentHandle)
        {
            throw new MockMissingException(MockType.VirtualMethod, "TestClass", "ITestClass", "Restricted", "Restricted");
        }
Esempio n. 8
0
 // Must use "__arglist" inside a vararg method.
 void m2()
 {
     RuntimeArgumentHandle handle = __arglist;
 }
	public ArgIterator(RuntimeArgumentHandle arglist, void* ptr) {}
	// Constructors
	public ArgIterator(RuntimeArgumentHandle arglist) {}
Esempio n. 11
0
        // The contents of this class were created by the Mocklis code-generator.
        // Any changes you make will be overwritten if the contents are re-generated.

        protected virtual string Concat(string arglist, RuntimeArgumentHandle arglist0)
        {
            throw new MockMissingException(MockType.VirtualMethod, "TestClass", "ITestClass", "Concat", "Concat");
        }
Esempio n. 12
0
 void m1(__arglist)
 {
     RuntimeArgumentHandle handle = __arglist;
 }
Esempio n. 13
0
 public static IEnumerable Enumerate(this RuntimeArgumentHandle arglist)
 {
     return(new ArgIterator(arglist).ToIEnumerable());
 }
Esempio n. 14
0
 void m1(String format, __arglist)
 {
     RuntimeArgumentHandle handle = __arglist;
 }
Esempio n. 15
0
 // Constructors
 public ArgIterator(RuntimeArgumentHandle arglist)
 {
 }
Esempio n. 16
0
 static void F(RuntimeArgumentHandle rah)
 {
 }
Esempio n. 17
0
 public ArgIterator(RuntimeArgumentHandle arglist, void *ptr)
 {
 }
Esempio n. 18
0
	static void F (RuntimeArgumentHandle rah)
	{
	}