Beispiel #1
0
        internal static T[] OutParamsToArray <T>(OutMethod <T> outMethod)
        {
            UIntPtr out_size = outMethod(null, UIntPtr.Zero);

            if (out_size.Equals(UIntPtr.Zero))
            {
                return(new T[0]);
            }
            T[] array = new T[out_size.ToUInt64()];
            outMethod(array, out_size);
            return(array);
        }
Beispiel #2
0
        internal static T[] OutParamsToArray <T>(OutMethod <T> outMethod)
        {
            UIntPtr ptr = outMethod(null, UIntPtr.Zero);

            if (ptr.Equals(UIntPtr.Zero))
            {
                return(new T[0]);
            }
            T[] localArray = new T[ptr.ToUInt64()];
            outMethod(localArray, ptr);
            return(localArray);
        }
        internal static T[] OutParamsToArray <T>(OutMethod <T> outMethod)
        {
            var requiredSize = outMethod(null, UIntPtr.Zero);

            if (requiredSize.Equals(UIntPtr.Zero))
            {
                return(new T[0]);
            }

            var array = new T[requiredSize.ToUInt64()];

            outMethod(array, requiredSize);
            return(array);
        }