Skip to content

Commit

Permalink
Use hardcoded IIDs for well known IReferenceArray<T>-s
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Dec 1, 2023
1 parent 1e8c302 commit 4ec5601
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/WinRT.Runtime/ComWrappersSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -776,135 +776,135 @@ private static ComInterfaceEntry ProvideIReferenceArray(Type arrayType)
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<int>)),
IID = InterfaceIIDs.IReferenceArrayOfInt32_IID,
Vtable = BoxedArrayIReferenceArrayImpl<int>.AbiToProjectionVftablePtr
};
}
if (type == typeof(string))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<string>)),
IID = InterfaceIIDs.IReferenceArrayOfString_IID,
Vtable = BoxedArrayIReferenceArrayImpl<string>.AbiToProjectionVftablePtr
};
}
if (type == typeof(byte))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<byte>)),
IID = InterfaceIIDs.IReferenceArrayOfByte_IID,
Vtable = BoxedArrayIReferenceArrayImpl<byte>.AbiToProjectionVftablePtr
};
}
if (type == typeof(short))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<short>)),
IID = InterfaceIIDs.IReferenceArrayOfInt16_IID,
Vtable = BoxedArrayIReferenceArrayImpl<short>.AbiToProjectionVftablePtr
};
}
if (type == typeof(ushort))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<ushort>)),
IID = InterfaceIIDs.IReferenceArrayOfUInt16_IID,
Vtable = BoxedArrayIReferenceArrayImpl<ushort>.AbiToProjectionVftablePtr
};
}
if (type == typeof(uint))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<uint>)),
IID = InterfaceIIDs.IReferenceArrayOfUInt32_IID,
Vtable = BoxedArrayIReferenceArrayImpl<uint>.AbiToProjectionVftablePtr
};
}
if (type == typeof(long))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<long>)),
IID = InterfaceIIDs.IReferenceArrayOfInt64_IID,
Vtable = BoxedArrayIReferenceArrayImpl<long>.AbiToProjectionVftablePtr
};
}
if (type == typeof(ulong))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<ulong>)),
IID = InterfaceIIDs.IReferenceArrayOfUInt64_IID,
Vtable = BoxedArrayIReferenceArrayImpl<ulong>.AbiToProjectionVftablePtr
};
}
if (type == typeof(float))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<float>)),
IID = InterfaceIIDs.IReferenceArrayOfSingle_IID,
Vtable = BoxedArrayIReferenceArrayImpl<float>.AbiToProjectionVftablePtr
};
}
if (type == typeof(double))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<double>)),
IID = InterfaceIIDs.IReferenceArrayOfDouble_IID,
Vtable = BoxedArrayIReferenceArrayImpl<double>.AbiToProjectionVftablePtr
};
}
if (type == typeof(char))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<char>)),
IID = InterfaceIIDs.IReferenceArrayOfChar_IID,
Vtable = BoxedArrayIReferenceArrayImpl<char>.AbiToProjectionVftablePtr
};
}
if (type == typeof(bool))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<bool>)),
IID = InterfaceIIDs.IReferenceArrayOfBoolean_IID,
Vtable = BoxedArrayIReferenceArrayImpl<bool>.AbiToProjectionVftablePtr
};
}
if (type == typeof(Guid))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<Guid>)),
IID = InterfaceIIDs.IReferenceArrayOfGuid_IID,
Vtable = BoxedArrayIReferenceArrayImpl<Guid>.AbiToProjectionVftablePtr
};
}
if (type == typeof(DateTimeOffset))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<DateTimeOffset>)),
IID = InterfaceIIDs.IReferenceArrayOfDateTimeOffset_IID,
Vtable = BoxedArrayIReferenceArrayImpl<DateTimeOffset>.AbiToProjectionVftablePtr
};
}
if (type == typeof(TimeSpan))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<TimeSpan>)),
IID = InterfaceIIDs.IReferenceArrayOfTimeSpan_IID,
Vtable = BoxedArrayIReferenceArrayImpl<TimeSpan>.AbiToProjectionVftablePtr
};
}
if (type == typeof(object))
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<object>)),
IID = InterfaceIIDs.IReferenceArrayOfObject_IID,
Vtable = BoxedArrayIReferenceArrayImpl<object>.AbiToProjectionVftablePtr
};
}
if (type.IsTypeOfType())
{
return new ComInterfaceEntry
{
IID = global::WinRT.GuidGenerator.GetIID(typeof(IReferenceArray<Type>)),
IID = InterfaceIIDs.IReferenceArrayOfType_IID,
Vtable = BoxedArrayIReferenceArrayImpl<Type>.AbiToProjectionVftablePtr
};
}
Expand Down

0 comments on commit 4ec5601

Please sign in to comment.