8.2版本上传

This commit is contained in:
2025-06-12 18:00:06 +08:00
parent a10df85379
commit 6a881f2e8a
263 changed files with 9063 additions and 1338 deletions

View File

@@ -122,7 +122,7 @@ namespace HybridCLR.Editor.Meta
}
return new GenericInstSig(gia.GenericType, gia.GenericArguments.Select(ga => ToShareTypeSig(corTypes, ga)).ToList());
}
case ElementType.FnPtr: return corTypes.IntPtr;
case ElementType.FnPtr: return corTypes.UIntPtr;
case ElementType.ValueArray: return typeSig;
case ElementType.Module: return typeSig;
default:
@@ -189,5 +189,29 @@ namespace HybridCLR.Editor.Meta
}
return methodGenericParams;
}
public static bool IsSupportedPInvokeTypeSig(TypeSig typeSig)
{
typeSig = typeSig.RemovePinnedAndModifiers();
if (typeSig.IsByRef)
{
return true;
}
switch (typeSig.ElementType)
{
case ElementType.SZArray:
case ElementType.Array:
//case ElementType.Class:
case ElementType.String:
//case ElementType.Object:
return false;
default: return true;
}
}
public static bool IsSupportedPInvokeMethodSignature(MethodSig methodSig)
{
return IsSupportedPInvokeTypeSig(methodSig.RetType) && methodSig.Params.All(p => IsSupportedPInvokeTypeSig(p));
}
}
}