System.ArgIterator.GetNextArg C# (CSharp) Method

GetNextArg() private method

private GetNextArg ( RuntimeTypeHandle rth ) : TypedReference
rth RuntimeTypeHandle
return TypedReference
        public TypedReference GetNextArg(RuntimeTypeHandle rth)
        {
            if (sigPtr != IntPtr.Zero)
            {
                // This is an ordinary ArgIterator capable of determining
                // types from a signature. Just do a regular GetNextArg.
                return GetNextArg();
            }
            else
            {
                // Prevent abuse of this API with a default ArgIterator (it
                // doesn't require permission to create a zero-inited value
                // type). Check that ArgPtr isn't zero or this API will allow a
                // malicious caller to increment the pointer to an arbitrary
                // location in memory and read the contents.
                if (ArgPtr == IntPtr.Zero)
                    throw new ArgumentNullException();

                TypedReference result = new TypedReference ();
                // reference to TypedReference is banned, so have to pass result as pointer
                unsafe
                {
                    InternalGetNextArg(&result, rth);
                }
                return result;
            }
        }

Same methods

ArgIterator::GetNextArg ( ) : TypedReference

Usage Example

		private static void ArglistMethod (__arglist)
		{
			var iter = new ArgIterator (__arglist);

			for (int n = iter.GetRemainingCount (); n > 0; n--)
				Console.WriteLine (TypedReference.ToObject (iter.GetNextArg ()));
		}
All Usage Examples Of System.ArgIterator::GetNextArg