diff --git a/Il2CppInterop.Runtime/Injection/ClassInjector.cs b/Il2CppInterop.Runtime/Injection/ClassInjector.cs index 5d0b3254..b54ed9cb 100644 --- a/Il2CppInterop.Runtime/Injection/ClassInjector.cs +++ b/Il2CppInterop.Runtime/Injection/ClassInjector.cs @@ -534,7 +534,7 @@ private static bool IsTypeSupported(Type type) if (type.IsValueType || type == typeof(string) || type.IsGenericParameter) return true; - if (type.IsByRef) return IsTypeSupported(type.GetElementType()); + if (type.IsByRef || type.IsPointer) return IsTypeSupported(type.GetElementType()); return typeof(Il2CppObjectBase).IsAssignableFrom(type); } @@ -655,7 +655,7 @@ private static bool IsMethodEligible(MethodInfo method) var parameterType = parameterInfo.ParameterType; if (!parameterType.IsGenericParameter) { - if (parameterType.IsByRef) + if (parameterType.IsByRef || parameterType.IsPointer) { var elementType = parameterType.GetElementType(); if (!elementType.IsGenericParameter) @@ -1083,7 +1083,7 @@ private static Type RewriteType(Type type) if (type.IsValueType && !type.IsEnum) return type; - if (type == typeof(string)) + if (type == typeof(string) || type == typeof(void*)) return type; if (type.IsArray)