Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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();
        }
Beispiel #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");
        }
Beispiel #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) {}
Beispiel #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");
        }
Beispiel #12
0
 void m1(__arglist)
 {
     RuntimeArgumentHandle handle = __arglist;
 }
Beispiel #13
0
 public static IEnumerable Enumerate(this RuntimeArgumentHandle arglist)
 {
     return(new ArgIterator(arglist).ToIEnumerable());
 }
Beispiel #14
0
 void m1(String format, __arglist)
 {
     RuntimeArgumentHandle handle = __arglist;
 }
Beispiel #15
0
 // Constructors
 public ArgIterator(RuntimeArgumentHandle arglist)
 {
 }
Beispiel #16
0
 static void F(RuntimeArgumentHandle rah)
 {
 }
Beispiel #17
0
 public ArgIterator(RuntimeArgumentHandle arglist, void *ptr)
 {
 }
Beispiel #18
0
	static void F (RuntimeArgumentHandle rah)
	{
	}