public static Array GetValues(Type enumType) { if (enumType == null) { throw new ArgumentNullException("enumType"); } Array values = GetEnumInfo(enumType).Values; int count = values.Length; EETypePtr enumArrayType = enumType.MakeArrayType().TypeHandle.ToEETypePtr(); Array result = RuntimeImports.RhNewArray(enumArrayType, count); Array.CopyImplValueTypeArrayNoInnerGcRefs(values, 0, result, 0, count); return(result); }