protected override bool IsPointerImpl() => typeImpl.IsPointer;
protected override bool IsValueTypeImpl() => typeImpl.IsValueType;
protected override bool IsCOMObjectImpl() => typeImpl.IsCOMObject;
+ public override bool IsByRefLike => typeImpl.IsByRefLike;
public override bool IsConstructedGenericType => typeImpl.IsConstructedGenericType;
public override Type GetElementType() => typeImpl.GetElementType();
protected override bool HasElementTypeImpl() => typeImpl.HasElementType;
return RuntimeTypeHandle.IsComObject(this, false);
}
+ public sealed override bool IsByRefLike => RuntimeTypeHandle.IsByRefLike(this);
+
#if FEATURE_COMINTEROP
internal override bool IsWindowsRuntimeObjectImpl()
{
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static bool IsInterface(RuntimeType type);
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ internal extern static bool IsByRefLike(RuntimeType type);
+
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.Bool)]
FCFuncElement("IsComObject", RuntimeTypeHandle::IsComObject)
FCFuncElement("IsValueType", RuntimeTypeHandle::IsValueType)
FCFuncElement("IsInterface", RuntimeTypeHandle::IsInterface)
+ FCFuncElement("IsByRefLike", RuntimeTypeHandle::IsByRefLike)
QCFuncElement("_IsVisible", RuntimeTypeHandle::IsVisible)
QCFuncElement("ConstructName", RuntimeTypeHandle::ConstructName)
FCFuncElement("CanCastTo", RuntimeTypeHandle::CanCastTo)
}
FCIMPLEND;
+
+FCIMPL1(FC_BOOL_RET, RuntimeTypeHandle::IsByRefLike, ReflectClassBaseObject *pTypeUNSAFE)
+{
+ CONTRACTL {
+ FCALL_CHECK;
+ }
+ CONTRACTL_END;
+
+ REFLECTCLASSBASEREF refType = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(pTypeUNSAFE);
+
+ _ASSERTE(refType != NULL);
+
+ TypeHandle typeHandle = refType->GetType();
+
+ FC_RETURN_BOOL(typeHandle.IsByRefLike());
+}
+FCIMPLEND
+
BOOL
QCALLTYPE
RuntimeTypeHandle::IsVisible(
return;
}
+
static FCDECL1(ReflectClassBaseObject*, GetDeclaringType, ReflectClassBaseObject* pType);
static FCDECL1(FC_BOOL_RET, IsValueType, ReflectClassBaseObject* pType);
static FCDECL1(FC_BOOL_RET, IsInterface, ReflectClassBaseObject* pType);
+ static FCDECL1(FC_BOOL_RET, IsByRefLike, ReflectClassBaseObject* pType);
static
BOOL QCALLTYPE IsVisible(EnregisteredTypeHandle pTypeHandle);
}
+BOOL TypeHandle::IsByRefLike() const
+{
+ LIMITED_METHOD_CONTRACT;
+
+ return(!IsTypeDesc() && AsMethodTable()->IsByRefLike());
+
+}
+
BOOL TypeHandle::IsPointer() const
{
LIMITED_METHOD_CONTRACT;
// BYREF
BOOL IsByRef() const;
+ // BYREFLIKE (does not return TRUE for IsByRef types)
+ BOOL IsByRefLike() const;
+
// PTR
BOOL IsPointer() const;