using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Dynamic; using System.Globalization; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Numerics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.InteropServices.Marshalling; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading; using System.Windows.Input; using ABI.Microsoft.UI.Xaml.Data; using ABI.Microsoft.UI.Xaml.Interop; using ABI.System; using ABI.System.Collections; using ABI.System.Collections.Generic; using ABI.System.Collections.Specialized; using ABI.System.ComponentModel; using ABI.System.Numerics; using ABI.System.Windows.Input; using ABI.WinRT; using ABI.WinRT.Interop; using ABI.Windows.Foundation; using ABI.Windows.Foundation.Collections; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Automation; using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Interop; using Microsoft.UI.Xaml.Markup; using WinRT; using WinRT.Interop; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Automation; using Windows.UI.Xaml.Markup; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(/*Could not decode attribute arguments.*/)] [assembly: SupportedOSPlatform("Windows")] [assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] [assembly: AssemblyMetadata("IsTrimmable", "True")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")] [assembly: AssemblyDescription("C#/WinRT Runtime v2.2.0.241111.1")] [assembly: AssemblyFileVersion("2.2.0.48161")] [assembly: AssemblyInformationalVersion("2.2.0.48161+8649ee3eeb2445ca2a36d80d878ef60b96a6c65d")] [assembly: AssemblyProduct("C#/WinRT")] [assembly: AssemblyTitle("C#/WinRT Runtime v2.2.0.241111.1")] [assembly: NeutralResourcesLanguage("en")] [assembly: DisableRuntimeMarshalling] [assembly: SecurityPermission(8, SkipVerification = true)] [assembly: AssemblyVersion("2.2.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class { static () { ProjectionInitializer.InitalizeProjection(); } } namespace Windows.Foundation { internal static class GSR { public static string ArgumentOutOfRange_NeedNonNegNum = "Non-negative number required."; } [WindowsRuntimeType("Windows.Foundation.FoundationContract")] [WindowsRuntimeHelperType(typeof(ABI.Windows.Foundation.Point))] [WinRTExposedType(typeof(StructTypeDetails))] public struct Point : System.IFormattable { public float _x; public float _y; public double X { get { return _x; } set { _x = (float)value; } } public double Y { get { return _y; } set { _y = (float)value; } } public Point(float x, float y) { _x = x; _y = y; } public Point(double x, double y) : this((float)x, (float)y) { } public string ToString() { return ConvertToString(null, null); } public string ToString(IFormatProvider provider) { return ConvertToString(null, provider); } string System.IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } private string ConvertToString(string format, IFormatProvider provider) { char numericListSeparator = GetNumericListSeparator(provider); return string.Format(provider, string.Concat(new string[5] { "{1:", format, "}{0}{2:", format, "}" }), (object)numericListSeparator, (object)_x, (object)_y); } private static char GetNumericListSeparator(IFormatProvider provider) { char c = ','; NumberFormatInfo instance = NumberFormatInfo.GetInstance(provider); if (instance.NumberDecimalSeparator.Length > 0 && instance.NumberDecimalSeparator[0] == c) { c = ';'; } return c; } public static bool operator ==(Point point1, Point point2) { if (point1._x == point2._x) { return point1._y == point2._y; } return false; } public static bool operator !=(Point point1, Point point2) { return !(point1 == point2); } public bool Equals(object o) { if (o is Point) { return this == (Point)o; } return false; } public bool Equals(Point value) { return this == value; } public int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); } } [WindowsRuntimeType("Windows.Foundation.FoundationContract")] [WindowsRuntimeHelperType(typeof(ABI.Windows.Foundation.Rect))] [WinRTExposedType(typeof(StructTypeDetails))] public struct Rect : System.IFormattable { public float _x; public float _y; public float _width; public float _height; private const double EmptyX = 1.0 / 0.0; private const double EmptyY = 1.0 / 0.0; private const double EmptyWidth = -1.0 / 0.0; private const double EmptyHeight = -1.0 / 0.0; private static readonly Rect s_empty = CreateEmptyRect(); public double X { get { return _x; } set { _x = (float)value; } } public double Y { get { return _y; } set { _y = (float)value; } } public double Width { get { return _width; } set { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (value < 0.0) { throw new ArgumentOutOfRangeException("Width", GSR.ArgumentOutOfRange_NeedNonNegNum); } _width = (float)value; } } public double Height { get { return _height; } set { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (value < 0.0) { throw new ArgumentOutOfRangeException("Height", GSR.ArgumentOutOfRange_NeedNonNegNum); } _height = (float)value; } } public double Left => _x; public double Top => _y; public double Right { get { if (IsEmpty) { return -1.0 / 0.0; } return _x + _width; } } public double Bottom { get { if (IsEmpty) { return -1.0 / 0.0; } return _y + _height; } } public static Rect Empty => s_empty; public bool IsEmpty => _width < 0f; public Rect(float x, float y, float width, float height) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (width < 0f) { throw new ArgumentOutOfRangeException("width", GSR.ArgumentOutOfRange_NeedNonNegNum); } if (height < 0f) { throw new ArgumentOutOfRangeException("height", GSR.ArgumentOutOfRange_NeedNonNegNum); } _x = x; _y = y; _width = width; _height = height; } public Rect(double x, double y, double width, double height) : this((float)x, (float)y, (float)width, (float)height) { } public Rect(Point point1, Point point2) { _x = Math.Min(point1._x, point2._x); _y = Math.Min(point1._y, point2._y); _width = Math.Max(Math.Max(point1._x, point2._x) - _x, 0f); _height = Math.Max(Math.Max(point1._y, point2._y) - _y, 0f); } public Rect(Point location, Size size) { if (size.IsEmpty) { this = s_empty; return; } _x = location._x; _y = location._y; _width = size._width; _height = size._height; } public bool Contains(Point point) { return ContainsInternal(point._x, point._y); } public void Intersect(Rect rect) { if (!IntersectsWith(rect)) { this = s_empty; return; } double num = Math.Max(X, rect.X); double num2 = Math.Max(Y, rect.Y); Width = Math.Max(Math.Min(X + Width, rect.X + rect.Width) - num, 0.0); Height = Math.Max(Math.Min(Y + Height, rect.Y + rect.Height) - num2, 0.0); X = num; Y = num2; } public void Union(Rect rect) { if (IsEmpty) { this = rect; } else if (!rect.IsEmpty) { double num = Math.Min(Left, rect.Left); double num2 = Math.Min(Top, rect.Top); if (rect.Width == 1.0 / 0.0 || Width == 1.0 / 0.0) { Width = 1.0 / 0.0; } else { double num3 = Math.Max(Right, rect.Right); Width = Math.Max(num3 - num, 0.0); } if (rect.Height == 1.0 / 0.0 || Height == 1.0 / 0.0) { Height = 1.0 / 0.0; } else { double num4 = Math.Max(Bottom, rect.Bottom); Height = Math.Max(num4 - num2, 0.0); } X = num; Y = num2; } } public void Union(Point point) { Union(new Rect(point, point)); } private bool ContainsInternal(float x, float y) { if (x >= _x && x - _width <= _x && y >= _y) { return y - _height <= _y; } return false; } internal bool IntersectsWith(Rect rect) { if (_width < 0f || rect._width < 0f) { return false; } if (rect._x <= _x + _width && rect._x + rect._width >= _x && rect._y <= _y + _height) { return rect._y + rect._height >= _y; } return false; } private static Rect CreateEmptyRect() { Rect result = default(Rect); result._x = 1f / 0f; result._y = 1f / 0f; result._width = -1f / 0f; result._height = -1f / 0f; return result; } public string ToString() { return ConvertToString(null, null); } public string ToString(IFormatProvider provider) { return ConvertToString(null, provider); } string System.IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } internal string ConvertToString(string format, IFormatProvider provider) { if (IsEmpty) { return "Empty."; } char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); return string.Format(provider, string.Concat(new string[9] { "{1:", format, "}{0}{2:", format, "}{0}{3:", format, "}{0}{4:", format, "}" }), new object[5] { numericListSeparator, _x, _y, _width, _height }); } public bool Equals(Rect value) { return this == value; } public static bool operator ==(Rect rect1, Rect rect2) { if (rect1._x == rect2._x && rect1._y == rect2._y && rect1._width == rect2._width) { return rect1._height == rect2._height; } return false; } public static bool operator !=(Rect rect1, Rect rect2) { return !(rect1 == rect2); } public bool Equals(object o) { if (o is Rect) { return this == (Rect)o; } return false; } public int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode() ^ Width.GetHashCode() ^ Height.GetHashCode(); } } [WindowsRuntimeType("Windows.Foundation.FoundationContract")] [WindowsRuntimeHelperType(typeof(ABI.Windows.Foundation.Size))] [WinRTExposedType(typeof(StructTypeDetails))] public struct Size { public float _width; public float _height; private static readonly Size s_empty = CreateEmptySize(); public double Width { get { return _width; } set { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (value < 0.0) { throw new ArgumentOutOfRangeException("Width", GSR.ArgumentOutOfRange_NeedNonNegNum); } _width = (float)value; } } public double Height { get { return _height; } set { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (value < 0.0) { throw new ArgumentOutOfRangeException("Height", GSR.ArgumentOutOfRange_NeedNonNegNum); } _height = (float)value; } } public static Size Empty => s_empty; public bool IsEmpty => Width < 0.0; public Size(float width, float height) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (width < 0f) { throw new ArgumentOutOfRangeException("width", GSR.ArgumentOutOfRange_NeedNonNegNum); } if (height < 0f) { throw new ArgumentOutOfRangeException("height", GSR.ArgumentOutOfRange_NeedNonNegNum); } _width = width; _height = height; } public Size(double width, double height) : this((float)width, (float)height) { } private static Size CreateEmptySize() { Size result = default(Size); result._width = -1f / 0f; result._height = -1f / 0f; return result; } public static bool operator ==(Size size1, Size size2) { if (size1._width == size2._width) { return size1._height == size2._height; } return false; } public static bool operator !=(Size size1, Size size2) { return !(size1 == size2); } public bool Equals(object o) { if (o is Size) { return Equals(this, (Size)o); } return false; } public bool Equals(Size value) { return Equals(this, value); } public int GetHashCode() { if (IsEmpty) { return 0; } return Width.GetHashCode() ^ Height.GetHashCode(); } private static bool Equals(Size size1, Size size2) { if (size1.IsEmpty) { return size2.IsEmpty; } if (size1._width.Equals(size2._width)) { return size1._height.Equals(size2._height); } return false; } public string ToString() { if (IsEmpty) { return "Empty"; } return $"{_width},{_height}"; } } public static class TokenizerHelper { public static char GetNumericListSeparator(IFormatProvider provider) { char c = ','; NumberFormatInfo instance = NumberFormatInfo.GetInstance(provider); if (instance.NumberDecimalSeparator.Length > 0 && c == instance.NumberDecimalSeparator[0]) { c = ';'; } return c; } } internal enum PropertyType : uint { Empty = 0u, UInt8 = 1u, Int16 = 2u, UInt16 = 3u, Int32 = 4u, UInt32 = 5u, Int64 = 6u, UInt64 = 7u, Single = 8u, Double = 9u, Char16 = 10u, Boolean = 11u, String = 12u, Inspectable = 13u, DateTime = 14u, TimeSpan = 15u, Guid = 16u, Point = 17u, Size = 18u, Rect = 19u, OtherType = 20u, UInt8Array = 1025u, Int16Array = 1026u, UInt16Array = 1027u, Int32Array = 1028u, UInt32Array = 1029u, Int64Array = 1030u, UInt64Array = 1031u, SingleArray = 1032u, DoubleArray = 1033u, Char16Array = 1034u, BooleanArray = 1035u, StringArray = 1036u, InspectableArray = 1037u, DateTimeArray = 1038u, TimeSpanArray = 1039u, GuidArray = 1040u, PointArray = 1041u, SizeArray = 1042u, RectArray = 1043u, OtherTypeArray = 1044u } [Guid("4BD682DD-7554-40E9-9A9B-82654EDE7E62")] internal interface IPropertyValue { bool IsNumericScalar { get; } PropertyType Type { get; } byte GetUInt8(); short GetInt16(); ushort GetUInt16(); int GetInt32(); uint GetUInt32(); long GetInt64(); ulong GetUInt64(); float GetSingle(); double GetDouble(); char GetChar16(); bool GetBoolean(); string GetString(); Guid GetGuid(); DateTimeOffset GetDateTime(); TimeSpan GetTimeSpan(); Point GetPoint(); Size GetSize(); Rect GetRect(); void GetUInt8Array(out byte[] value); void GetInt16Array(out short[] value); void GetUInt16Array(out ushort[] value); void GetInt32Array(out int[] value); void GetUInt32Array(out uint[] value); void GetInt64Array(out long[] value); void GetUInt64Array(out ulong[] value); void GetSingleArray(out float[] value); void GetDoubleArray(out double[] value); void GetChar16Array(out char[] value); void GetBooleanArray(out bool[] value); void GetStringArray(out string[] value); void GetInspectableArray(out object[] value); void GetGuidArray(out Guid[] value); void GetDateTimeArray(out DateTimeOffset[] value); void GetTimeSpanArray(out TimeSpan[] value); void GetPointArray(out Point[] value); void GetSizeArray(out Size[] value); void GetRectArray(out Rect[] value); } [Guid("61C17707-2D65-11E0-9AE8-D48564015472")] [WindowsRuntimeHelperType(typeof(ABI.Windows.Foundation.IReferenceArray<>))] internal interface IReferenceArray { T[] Value { get; } } } namespace Windows.Foundation.Collections { [Guid("3C2925FE-8519-45C1-AA79-197B6718C1C1")] internal interface IMap : IIterable> { uint Size { get; } V Lookup(K key); bool HasKey(K key); IReadOnlyDictionary GetView(); bool Insert(K key, V value); void _Remove(K key); void Clear(); } [Guid("FAA585EA-6214-4217-AFDA-7F46DE5869B3")] internal interface IIterable { System.Collections.Generic.IEnumerator First(); } [Guid("6A79E863-4300-459A-9966-CBB660963EE1")] internal interface IIterator { T _Current { get; } bool HasCurrent { get; } bool _MoveNext(); uint GetMany(ref T[] items); } [Guid("913337E9-11A1-4345-A3A2-4E7F956E222D")] internal interface IVector : IIterable { uint Size { get; } T GetAt(uint index); System.Collections.Generic.IReadOnlyList GetView(); bool IndexOf(T value, out uint index); void SetAt(uint index, T value); void InsertAt(uint index, T value); void RemoveAt(uint index); void Append(T value); void RemoveAtEnd(); void _Clear(); uint GetMany(uint startIndex, ref T[] items); void ReplaceAll(T[] items); } [Guid("E480CE40-A338-4ADA-ADCF-272272E48CB9")] internal interface IMapView : IIterable> { uint Size { get; } V Lookup(K key); bool HasKey(K key); void Split(out IMapView first, out IMapView second); } [Guid("BBE1FA4C-B0E3-4583-BAEF-1F1B2E483E56")] internal interface IVectorView : IIterable { uint Size { get; } T GetAt(uint index); bool IndexOf(T value, out uint index); uint GetMany(uint startIndex, ref T[] items); } [Guid("02B51929-C1C4-4A7E-8940-0312B5C18500")] internal interface IKeyValuePair { K Key { get; } V Value { get; } } } namespace Windows.UI.Xaml { public class LayoutCycleException : System.Exception { public LayoutCycleException() : base("A cycle occurred while laying out the GUI.") { base.HResult = -2144665580; } public LayoutCycleException(string message) : base(message) { base.HResult = -2144665580; } public LayoutCycleException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665580; } } } namespace Windows.UI.Xaml.Markup { public class XamlParseException : System.Exception { public XamlParseException() : base("XAML parsing failed.") { base.HResult = -2144665590; } public XamlParseException(string message) : base(message) { base.HResult = -2144665590; } public XamlParseException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665590; } } } namespace Windows.UI.Xaml.Automation { public class ElementNotAvailableException : System.Exception { public ElementNotAvailableException() : base("The element is not available.") { base.HResult = -2144665569; } public ElementNotAvailableException(string message) : base(message) { base.HResult = -2144665569; } public ElementNotAvailableException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665569; } } public class ElementNotEnabledException : System.Exception { public ElementNotEnabledException() : base("The element is not enabled.") { base.HResult = -2144665570; } public ElementNotEnabledException(string message) : base(message) { base.HResult = -2144665570; } public ElementNotEnabledException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665570; } } } namespace Microsoft.UI.Xaml { public class LayoutCycleException : System.Exception { public LayoutCycleException() : base("A cycle occurred while laying out the GUI.") { base.HResult = -2144665580; } public LayoutCycleException(string message) : base(message) { base.HResult = -2144665580; } public LayoutCycleException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665580; } } } namespace Microsoft.UI.Xaml.Data { [WindowsRuntimeType(null)] [WindowsRuntimeHelperType(typeof(ABI.Microsoft.UI.Xaml.Data.ICustomProperty))] [Guid("30DA92C0-23E8-42A0-AE7C-734A0E5D2782")] internal interface ICustomProperty { bool CanRead { get; } bool CanWrite { get; } string Name { get; } System.Type Type { get; } object GetValue(object target); void SetValue(object target, object value); object GetIndexedValue(object target, object index); void SetIndexedValue(object target, object value, object index); } public interface IBindableCustomPropertyImplementation { BindableCustomProperty GetProperty(string name); BindableCustomProperty GetProperty(System.Type indexParameterType); } [WinRTExposedType(typeof(ManagedCustomPropertyWinRTTypeDetails))] public sealed class BindableCustomProperty : ICustomProperty { private readonly bool _canRead; private readonly bool _canWrite; private readonly string _name; private readonly System.Type _type; private readonly Func _getValue; private readonly Action _setValue; private readonly Func _getIndexedValue; private readonly Action _setIndexedValue; bool ICustomProperty.CanRead => _canRead; bool ICustomProperty.CanWrite => _canWrite; string ICustomProperty.Name => _name; System.Type ICustomProperty.Type => _type; public BindableCustomProperty(bool canRead, bool canWrite, string name, System.Type type, Func getValue, Action setValue, Func getIndexedValue, Action setIndexedValue) { _canRead = canRead; _canWrite = canWrite; _name = name; _type = type; _getValue = getValue; _setValue = setValue; _getIndexedValue = getIndexedValue; _setIndexedValue = setIndexedValue; } object ICustomProperty.GetIndexedValue(object target, object index) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (_getIndexedValue == null) { throw new NotImplementedException(); } return _getIndexedValue.Invoke(target, index); } object ICustomProperty.GetValue(object target) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (_getValue == null) { throw new NotImplementedException(); } return _getValue.Invoke(target); } void ICustomProperty.SetIndexedValue(object target, object value, object index) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (_setIndexedValue == null) { throw new NotImplementedException(); } _setIndexedValue.Invoke(target, value, index); } void ICustomProperty.SetValue(object target, object value) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (_setValue == null) { throw new NotImplementedException(); } _setValue.Invoke(target, value); } } } namespace Microsoft.UI.Xaml.Interop { [WindowsRuntimeType(null)] [Guid("036D2C08-DF29-41AF-8AA2-D774BE62BA6F")] [WindowsRuntimeHelperType(typeof(ABI.Microsoft.UI.Xaml.Interop.IBindableIterable))] internal interface IBindableIterable { IBindableIterator First(); } [WindowsRuntimeType(null)] [Guid("6A1D6C07-076D-49F2-8314-F52C9C9A8331")] [WindowsRuntimeHelperType(typeof(ABI.Microsoft.UI.Xaml.Interop.IBindableIterator))] internal interface IBindableIterator { object Current { get; } bool HasCurrent { get; } bool MoveNext(); uint GetMany(ref object[] items); } [WindowsRuntimeType(null)] [Guid("393DE7DE-6FD0-4C0D-BB71-47244A113E93")] internal interface IBindableVector : System.Collections.IEnumerable { uint Size { get; } object GetAt(uint index); IBindableVectorView GetView(); bool IndexOf(object value, out uint index); void SetAt(uint index, object value); void InsertAt(uint index, object value); void RemoveAt(uint index); void Append(object value); void RemoveAtEnd(); void Clear(); } [WindowsRuntimeType(null)] [Guid("346DD6E7-976E-4BC3-815D-ECE243BC0F33")] [WindowsRuntimeHelperType(typeof(ABI.Microsoft.UI.Xaml.Interop.IBindableVectorView))] internal interface IBindableVectorView : System.Collections.IEnumerable { uint Size { get; } object GetAt(uint index); bool IndexOf(object value, out uint index); } } namespace Microsoft.UI.Xaml.Markup { public class XamlParseException : System.Exception { public XamlParseException() : base("XAML parsing failed.") { base.HResult = -2144665590; } public XamlParseException(string message) : base(message) { base.HResult = -2144665590; } public XamlParseException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665590; } } } namespace Microsoft.UI.Xaml.Automation { public class ElementNotAvailableException : System.Exception { public ElementNotAvailableException() : base("The element is not available.") { base.HResult = -2144665569; } public ElementNotAvailableException(string message) : base(message) { base.HResult = -2144665569; } public ElementNotAvailableException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665569; } } public class ElementNotEnabledException : System.Exception { public ElementNotEnabledException() : base("The element is not enabled.") { base.HResult = -2144665570; } public ElementNotEnabledException(string message) : base(message) { base.HResult = -2144665570; } public ElementNotEnabledException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665570; } } } namespace ABI.Windows.Foundation { public static class Point { public static string GetGuidSignature() { return "struct(Windows.Foundation.Point;f4;f4)"; } } public static class Rect { public static string GetGuidSignature() { return "struct(Windows.Foundation.Rect;f4;f4;f4;f4)"; } } public static class Size { public static string GetGuidSignature() { return "struct(Windows.Foundation.Size;f4;f4)"; } } internal static class ManagedIPropertyValueImpl { private const int TYPE_E_TYPEMISMATCH = -2147316576; private const int DISP_E_OVERFLOW = -2147352566; private static IPropertyValue.Vftbl AbiToProjectionVftable; public static nint AbiToProjectionVftablePtr; private static volatile Dictionary s_numericScalarTypes; private static Dictionary NumericScalarTypes { get { if (s_numericScalarTypes == null) { Dictionary val = new Dictionary(); val.Add(typeof(byte), PropertyType.UInt8); val.Add(typeof(short), PropertyType.Int16); val.Add(typeof(ushort), PropertyType.UInt16); val.Add(typeof(int), PropertyType.Int32); val.Add(typeof(uint), PropertyType.UInt32); val.Add(typeof(long), PropertyType.Int64); val.Add(typeof(ulong), PropertyType.UInt64); val.Add(typeof(float), PropertyType.Single); val.Add(typeof(double), PropertyType.Double); Dictionary val2 = val; s_numericScalarTypes = val2; } return s_numericScalarTypes; } } unsafe static ManagedIPropertyValueImpl() { AbiToProjectionVftable = new IPropertyValue.Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _get_Type_0 = (delegate*)(&Do_Abi_get_Type_0), _get_IsNumericScalar_1 = (delegate*)(&Do_Abi_get_IsNumericScalar_1), _GetUInt8_2 = (delegate*)(&Do_Abi_GetUInt8_2), _GetInt16_3 = (delegate*)(&Do_Abi_GetInt16_3), _GetUInt16_4 = (delegate*)(&Do_Abi_GetUInt16_4), _GetInt32_5 = (delegate*)(&Do_Abi_GetInt32_5), _GetUInt32_6 = (delegate*)(&Do_Abi_GetUInt32_6), _GetInt64_7 = (delegate*)(&Do_Abi_GetInt64_7), _GetUInt64_8 = (delegate*)(&Do_Abi_GetUInt64_8), _GetSingle_9 = (delegate*)(&Do_Abi_GetSingle_9), _GetDouble_10 = (delegate*)(&Do_Abi_GetDouble_10), _GetChar16_11 = (delegate*)(&Do_Abi_GetChar16_11), _GetBoolean_12 = (delegate*)(&Do_Abi_GetBoolean_12), _GetString_13 = (delegate*)(&Do_Abi_GetString_13), _GetGuid_14 = (delegate*)(&Do_Abi_GetGuid_14), _GetDateTime_15 = (delegate*)(&Do_Abi_GetDateTime_15), _GetTimeSpan_16 = (delegate*)(&Do_Abi_GetTimeSpan_16), _GetPoint_17 = (delegate*)(&Do_Abi_GetPoint_17), _GetSize_18 = (delegate*)(&Do_Abi_GetSize_18), _GetRect_19 = (delegate*)(&Do_Abi_GetRect_19), _GetUInt8Array_20 = (delegate*)(&Do_Abi_GetUInt8Array_20), _GetInt16Array_21 = (delegate*)(&Do_Abi_GetInt16Array_21), _GetUInt16Array_22 = (delegate*)(&Do_Abi_GetUInt16Array_22), _GetInt32Array_23 = (delegate*)(&Do_Abi_GetInt32Array_23), _GetUInt32Array_24 = (delegate*)(&Do_Abi_GetUInt32Array_24), _GetInt64Array_25 = (delegate*)(&Do_Abi_GetInt64Array_25), _GetUInt64Array_26 = (delegate*)(&Do_Abi_GetUInt64Array_26), _GetSingleArray_27 = (delegate*)(&Do_Abi_GetSingleArray_27), _GetDoubleArray_28 = (delegate*)(&Do_Abi_GetDoubleArray_28), _GetChar16Array_29 = (delegate*)(&Do_Abi_GetChar16Array_29), _GetBooleanArray_30 = (delegate*)(&Do_Abi_GetBooleanArray_30), _GetStringArray_31 = (delegate*)(&Do_Abi_GetStringArray_31), _GetInspectableArray_32 = (delegate*)(&Do_Abi_GetInspectableArray_32), _GetGuidArray_33 = (delegate*)(&Do_Abi_GetGuidArray_33), _GetDateTimeArray_34 = (delegate*)(&Do_Abi_GetDateTimeArray_34), _GetTimeSpanArray_35 = (delegate*)(&Do_Abi_GetTimeSpanArray_35), _GetPointArray_36 = (delegate*)(&Do_Abi_GetPointArray_36), _GetSizeArray_37 = (delegate*)(&Do_Abi_GetSizeArray_37), _GetRectArray_38 = (delegate*)(&Do_Abi_GetRectArray_38) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(ManagedIPropertyValueImpl), sizeof(IInspectable.Vftbl) + sizeof(nint) * 39); *(IPropertyValue.Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } private static T UnboxValue(object value) where T : struct { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (value.GetType() == typeof(T)) { return (T)value; } throw new InvalidCastException("", -2147316576); } private static T[] UnboxArray(object value) where T : struct { //IL_0037: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (!(value is global::System.Array array)) { throw new InvalidCastException(); } T[] array2 = new T[array.Length]; for (int i = 0; i < array.Length; i++) { try { array2[i] = UnboxValue(array.GetValue(i)); } catch (InvalidCastException val) { InvalidCastException val2 = val; global::System.Exception ex = (global::System.Exception)new InvalidCastException("", ((global::System.Exception)(object)val2).HResult); throw ex; } } return array2; } private static bool IsCoercable(object value) { if (value.GetType() == typeof(string) || value.GetType() == typeof(Guid) || value.GetType() != typeof(object)) { return true; } PropertyType propertyType = default(PropertyType); return NumericScalarTypes.TryGetValue(value.GetType(), ref propertyType); } private static T CoerceValue(object value) { //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) if (value is T) { return (T)value; } if (value is global::Windows.Foundation.IPropertyValue propertyValue) { if (typeof(T) == typeof(byte)) { return (T)(object)propertyValue.GetUInt8(); } if (typeof(T) == typeof(short)) { return (T)(object)propertyValue.GetInt16(); } if (typeof(T) == typeof(ushort)) { return (T)(object)propertyValue.GetUInt16(); } if (typeof(T) == typeof(int)) { return (T)(object)propertyValue.GetInt32(); } if (typeof(T) == typeof(uint)) { return (T)(object)propertyValue.GetUInt32(); } if (typeof(T) == typeof(long)) { return (T)(object)propertyValue.GetInt64(); } if (typeof(T) == typeof(ulong)) { return (T)(object)propertyValue.GetUInt64(); } if (typeof(T) == typeof(float)) { return (T)(object)propertyValue.GetSingle(); } if (typeof(T) == typeof(double)) { return (T)(object)propertyValue.GetDouble(); } } if (!IsCoercable(value)) { throw new InvalidCastException(); } try { if (value is string text && typeof(T) == typeof(Guid)) { return (T)(object)Guid.Parse(text); } if (value is Guid val && typeof(T) == typeof(string)) { return (T)(object)((Guid)(ref val)).ToString("D", (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(byte)) { return (T)(object)Convert.ToByte(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(short)) { return (T)(object)Convert.ToInt16(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(ushort)) { return (T)(object)Convert.ToUInt16(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(int)) { return (T)(object)Convert.ToInt32(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(uint)) { return (T)(object)Convert.ToUInt32(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(long)) { return (T)(object)Convert.ToInt64(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(ulong)) { return (T)(object)Convert.ToUInt64(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(float)) { return (T)(object)Convert.ToSingle(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } if (typeof(T) == typeof(double)) { return (T)(object)Convert.ToDouble(value, (IFormatProvider)(object)CultureInfo.InvariantCulture); } throw new InvalidCastException("", -2147316576); } catch (FormatException) { throw new InvalidCastException("", -2147316576); } catch (InvalidCastException) { throw new InvalidCastException("", -2147316576); } catch (OverflowException) { throw new InvalidCastException("", -2147352566); } } private static T[] CoerceArray(object value) { //IL_0044: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (value is T[] result) { return result; } if (!(value is global::System.Array array)) { throw new InvalidCastException(); } T[] array2 = new T[array.Length]; for (int i = 0; i < array.Length; i++) { try { array2[i] = CoerceValue(array.GetValue(i)); } catch (InvalidCastException val) { InvalidCastException val2 = val; global::System.Exception ex = (global::System.Exception)new InvalidCastException("", ((global::System.Exception)(object)val2).HResult); throw ex; } } return array2; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt8_2(nint thisPtr, byte* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt16_3(nint thisPtr, short* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt16_4(nint thisPtr, ushort* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt32_5(nint thisPtr, int* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt32_6(nint thisPtr, uint* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt64_7(nint thisPtr, long* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt64_8(nint thisPtr, ulong* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetSingle_9(nint thisPtr, float* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetDouble_10(nint thisPtr, double* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetChar16_11(nint thisPtr, ushort* value) { try { *value = CoerceValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetBoolean_12(nint thisPtr, byte* value) { try { *value = (CoerceValue(ComWrappersSupport.FindObject(thisPtr)) ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetString_13(nint thisPtr, nint* value) { try { *value = MarshalString.FromManaged(CoerceValue(ComWrappersSupport.FindObject(thisPtr))); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetGuid_14(nint thisPtr, Guid* value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) try { global::System.Runtime.CompilerServices.Unsafe.Write(value, CoerceValue(ComWrappersSupport.FindObject(thisPtr))); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetDateTime_15(nint thisPtr, DateTimeOffset* value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) try { *value = DateTimeOffset.FromManaged(CoerceValue(ComWrappersSupport.FindObject(thisPtr))); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetTimeSpan_16(nint thisPtr, TimeSpan* value) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) try { *value = TimeSpan.FromManaged(CoerceValue(ComWrappersSupport.FindObject(thisPtr))); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetPoint_17(nint thisPtr, global::Windows.Foundation.Point* value) { try { *value = UnboxValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetSize_18(nint thisPtr, global::Windows.Foundation.Size* value) { try { *value = UnboxValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetRect_19(nint thisPtr, global::Windows.Foundation.Rect* value) { try { *value = UnboxValue(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt8Array_20(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) byte[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt16Array_21(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) short[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt16Array_22(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) ushort[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt32Array_23(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) int[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt32Array_24(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) uint[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt64Array_25(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) long[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt64Array_26(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) ulong[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetSingleArray_27(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) float[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetDoubleArray_28(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) double[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetChar16Array_29(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) char[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalNonBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetBooleanArray_30(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) bool[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalNonBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetStringArray_31(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) string[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalString.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInspectableArray_32(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) object[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalInspectable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetGuidArray_33(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Guid[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetDateTimeArray_34(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) DateTimeOffset[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalNonBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetTimeSpanArray_35(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) TimeSpan[] array = null; try { array = CoerceArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalNonBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetPointArray_36(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) global::Windows.Foundation.Point[] array = null; try { array = UnboxArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetSizeArray_37(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) global::Windows.Foundation.Size[] array = null; try { array = UnboxArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetRectArray_38(nint thisPtr, int* __valueSize, nint* value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) global::Windows.Foundation.Rect[] array = null; try { array = UnboxArray(ComWrappersSupport.FindObject(thisPtr)); ref nint reference = ref *value; ValueTuple val = MarshalBlittable.FromManagedArray(array); *__valueSize = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_IsNumericScalar_1(nint thisPtr, byte* value) { try { PropertyType propertyType = default(PropertyType); *value = (NumericScalarTypes.TryGetValue(ComWrappersSupport.FindObject(thisPtr).GetType(), ref propertyType) ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Type_0(nint thisPtr, PropertyType* value) { try { *value = GetPropertyTypeOfObject(ComWrappersSupport.FindObject(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static PropertyType GetPropertyTypeOfObject(object obj) { global::System.Type type = obj.GetType(); bool isArray = type.IsArray; if (isArray) { type = type.GetElementType(); } PropertyType propertyType = default(PropertyType); if (!NumericScalarTypes.TryGetValue(type, ref propertyType)) { propertyType = ((type == typeof(string)) ? PropertyType.String : ((type == typeof(char)) ? PropertyType.Char16 : ((type == typeof(bool)) ? PropertyType.Boolean : ((type == typeof(DateTimeOffset)) ? PropertyType.DateTime : ((type == typeof(TimeSpan)) ? PropertyType.TimeSpan : ((type == typeof(Guid)) ? PropertyType.Guid : ((string.CompareOrdinal(type.FullName, "Windows.Foundation.Point") == 0) ? PropertyType.Point : ((string.CompareOrdinal(type.FullName, "Windows.Foundation.Rect") == 0) ? PropertyType.Rect : ((string.CompareOrdinal(type.FullName, "Windows.Foundation.Size") == 0) ? PropertyType.Size : ((type == typeof(object)) ? PropertyType.Inspectable : (typeof(global::System.Delegate).IsAssignableFrom(type) ? PropertyType.OtherType : ((!(!type.IsValueType && type != typeof(global::System.Type) && isArray)) ? PropertyType.OtherType : PropertyType.Inspectable)))))))))))); } if (isArray) { propertyType += 1024; } return propertyType; } } [DynamicInterfaceCastableImplementation] [Guid("4BD682DD-7554-40E9-9A9B-82654EDE7E62")] internal interface IPropertyValue : global::Windows.Foundation.IPropertyValue { [Guid("4BD682DD-7554-40E9-9A9B-82654EDE7E62")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; internal unsafe void* _get_Type_0; public unsafe void* _get_IsNumericScalar_1; internal unsafe void* _GetUInt8_2; internal unsafe void* _GetInt16_3; internal unsafe void* _GetUInt16_4; internal unsafe void* _GetInt32_5; internal unsafe void* _GetUInt32_6; internal unsafe void* _GetInt64_7; internal unsafe void* _GetUInt64_8; internal unsafe void* _GetSingle_9; internal unsafe void* _GetDouble_10; internal unsafe void* _GetChar16_11; internal unsafe void* _GetBoolean_12; internal unsafe void* _GetString_13; internal unsafe void* _GetGuid_14; internal unsafe void* _GetDateTime_15; internal unsafe void* _GetTimeSpan_16; internal unsafe void* _GetPoint_17; internal unsafe void* _GetSize_18; internal unsafe void* _GetRect_19; internal unsafe void* _GetUInt8Array_20; internal unsafe void* _GetInt16Array_21; internal unsafe void* _GetUInt16Array_22; internal unsafe void* _GetInt32Array_23; internal unsafe void* _GetUInt32Array_24; internal unsafe void* _GetInt64Array_25; internal unsafe void* _GetUInt64Array_26; internal unsafe void* _GetSingleArray_27; internal unsafe void* _GetDoubleArray_28; internal unsafe void* _GetChar16Array_29; internal unsafe void* _GetBooleanArray_30; internal unsafe void* _GetStringArray_31; internal unsafe void* _GetInspectableArray_32; internal unsafe void* _GetGuidArray_33; internal unsafe void* _GetDateTimeArray_34; internal unsafe void* _GetTimeSpanArray_35; internal unsafe void* _GetPointArray_36; internal unsafe void* _GetSizeArray_37; internal unsafe void* _GetRectArray_38; public unsafe delegate* unmanaged[Stdcall] get_Type_0 { get { return (delegate* unmanaged[Stdcall])_get_Type_0; } set { _get_Type_0 = value; } } public unsafe delegate* unmanaged[Stdcall] get_IsNumericScalar_1 { get { return (delegate* unmanaged[Stdcall])_get_IsNumericScalar_1; } set { _get_IsNumericScalar_1 = value; } } public unsafe delegate* unmanaged[Stdcall] GetUInt8_2 { get { return (delegate* unmanaged[Stdcall])_GetUInt8_2; } set { _GetUInt8_2 = value; } } public unsafe delegate* unmanaged[Stdcall] GetInt16_3 { get { return (delegate* unmanaged[Stdcall])_GetInt16_3; } set { _GetInt16_3 = value; } } public unsafe delegate* unmanaged[Stdcall] GetUInt16_4 { get { return (delegate* unmanaged[Stdcall])_GetUInt16_4; } set { _GetUInt16_4 = value; } } public unsafe delegate* unmanaged[Stdcall] GetInt32_5 { get { return (delegate* unmanaged[Stdcall])_GetInt32_5; } set { _GetInt32_5 = value; } } public unsafe delegate* unmanaged[Stdcall] GetUInt32_6 { get { return (delegate* unmanaged[Stdcall])_GetUInt32_6; } set { _GetUInt32_6 = value; } } public unsafe delegate* unmanaged[Stdcall] GetInt64_7 { get { return (delegate* unmanaged[Stdcall])_GetInt64_7; } set { _GetInt64_7 = value; } } public unsafe delegate* unmanaged[Stdcall] GetUInt64_8 { get { return (delegate* unmanaged[Stdcall])_GetUInt64_8; } set { _GetUInt64_8 = value; } } public unsafe delegate* unmanaged[Stdcall] GetSingle_9 { get { return (delegate* unmanaged[Stdcall])_GetSingle_9; } set { _GetSingle_9 = value; } } public unsafe delegate* unmanaged[Stdcall] GetDouble_10 { get { return (delegate* unmanaged[Stdcall])_GetDouble_10; } set { _GetDouble_10 = value; } } public unsafe delegate* unmanaged[Stdcall] GetChar16_11 { get { return (delegate* unmanaged[Stdcall])_GetChar16_11; } set { _GetChar16_11 = value; } } public unsafe delegate* unmanaged[Stdcall] GetBoolean_12 { get { return (delegate* unmanaged[Stdcall])_GetBoolean_12; } set { _GetBoolean_12 = value; } } public unsafe delegate* unmanaged[Stdcall] GetString_13 { get { return (delegate* unmanaged[Stdcall])_GetString_13; } set { _GetString_13 = value; } } public unsafe delegate* unmanaged[Stdcall] GetGuid_14 { get { return (delegate* unmanaged[Stdcall])_GetGuid_14; } set { _GetGuid_14 = value; } } public unsafe delegate* unmanaged[Stdcall] GetDateTime_15 { get { return (delegate* unmanaged[Stdcall])_GetDateTime_15; } set { _GetDateTime_15 = value; } } public unsafe delegate* unmanaged[Stdcall] GetTimeSpan_16 { get { return (delegate* unmanaged[Stdcall])_GetTimeSpan_16; } set { _GetTimeSpan_16 = value; } } public unsafe delegate* unmanaged[Stdcall] GetPoint_17 { get { return (delegate* unmanaged[Stdcall])_GetPoint_17; } set { _GetPoint_17 = value; } } public unsafe delegate* unmanaged[Stdcall] GetSize_18 { get { return (delegate* unmanaged[Stdcall])_GetSize_18; } set { _GetSize_18 = value; } } public unsafe delegate* unmanaged[Stdcall] GetRect_19 { get { return (delegate* unmanaged[Stdcall])_GetRect_19; } set { _GetRect_19 = value; } } public unsafe delegate* unmanaged[Stdcall] GetUInt8Array_20 { get { return (delegate* unmanaged[Stdcall])_GetUInt8Array_20; } set { _GetUInt8Array_20 = value; } } public unsafe delegate* unmanaged[Stdcall] GetInt16Array_21 { get { return (delegate* unmanaged[Stdcall])_GetInt16Array_21; } set { _GetInt16Array_21 = value; } } public unsafe delegate* unmanaged[Stdcall] GetUInt16Array_22 { get { return (delegate* unmanaged[Stdcall])_GetUInt16Array_22; } set { _GetUInt16Array_22 = value; } } public unsafe delegate* unmanaged[Stdcall] GetInt32Array_23 { get { return (delegate* unmanaged[Stdcall])_GetInt32Array_23; } set { _GetInt32Array_23 = value; } } public unsafe delegate* unmanaged[Stdcall] GetUInt32Array_24 { get { return (delegate* unmanaged[Stdcall])_GetUInt32Array_24; } set { _GetUInt32Array_24 = value; } } public unsafe delegate* unmanaged[Stdcall] GetInt64Array_25 { get { return (delegate* unmanaged[Stdcall])_GetInt64Array_25; } set { _GetInt64Array_25 = value; } } public unsafe delegate* unmanaged[Stdcall] GetUInt64Array_26 { get { return (delegate* unmanaged[Stdcall])_GetUInt64Array_26; } set { _GetUInt64Array_26 = value; } } public unsafe delegate* unmanaged[Stdcall] GetSingleArray_27 { get { return (delegate* unmanaged[Stdcall])_GetSingleArray_27; } set { _GetSingleArray_27 = value; } } public unsafe delegate* unmanaged[Stdcall] GetDoubleArray_28 { get { return (delegate* unmanaged[Stdcall])_GetDoubleArray_28; } set { _GetDoubleArray_28 = value; } } public unsafe delegate* unmanaged[Stdcall] GetChar16Array_29 { get { return (delegate* unmanaged[Stdcall])_GetChar16Array_29; } set { _GetChar16Array_29 = value; } } public unsafe delegate* unmanaged[Stdcall] GetBooleanArray_30 { get { return (delegate* unmanaged[Stdcall])_GetBooleanArray_30; } set { _GetBooleanArray_30 = value; } } public unsafe delegate* unmanaged[Stdcall] GetStringArray_31 { get { return (delegate* unmanaged[Stdcall])_GetStringArray_31; } set { _GetStringArray_31 = value; } } public unsafe delegate* unmanaged[Stdcall] GetInspectableArray_32 { get { return (delegate* unmanaged[Stdcall])_GetInspectableArray_32; } set { _GetInspectableArray_32 = value; } } public unsafe delegate* unmanaged[Stdcall] GetGuidArray_33 { get { return (delegate* unmanaged[Stdcall])_GetGuidArray_33; } set { _GetGuidArray_33 = value; } } public unsafe delegate* unmanaged[Stdcall] GetDateTimeArray_34 { get { return (delegate* unmanaged[Stdcall])_GetDateTimeArray_34; } set { _GetDateTimeArray_34 = value; } } public unsafe delegate* unmanaged[Stdcall] GetTimeSpanArray_35 { get { return (delegate* unmanaged[Stdcall])_GetTimeSpanArray_35; } set { _GetTimeSpanArray_35 = value; } } public unsafe delegate* unmanaged[Stdcall] GetPointArray_36 { get { return (delegate* unmanaged[Stdcall])_GetPointArray_36; } set { _GetPointArray_36 = value; } } public unsafe delegate* unmanaged[Stdcall] GetSizeArray_37 { get { return (delegate* unmanaged[Stdcall])_GetSizeArray_37; } set { _GetSizeArray_37 = value; } } public unsafe delegate* unmanaged[Stdcall] GetRectArray_38 { get { return (delegate* unmanaged[Stdcall])_GetRectArray_38; } set { _GetRectArray_38 = value; } } } unsafe bool global::Windows.Foundation.IPropertyValue.IsNumericScalar { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.get_IsNumericScalar_1(thisPtr, &b)); GC.KeepAlive((object)objectReference); return b != 0; } } unsafe PropertyType global::Windows.Foundation.IPropertyValue.Type { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; PropertyType result = PropertyType.Empty; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.get_Type_0(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } } unsafe byte global::Windows.Foundation.IPropertyValue.GetUInt8() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; byte result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt8_2(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe short global::Windows.Foundation.IPropertyValue.GetInt16() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; short result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt16_3(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe ushort global::Windows.Foundation.IPropertyValue.GetUInt16() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; ushort result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt16_4(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe int global::Windows.Foundation.IPropertyValue.GetInt32() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt32_5(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe uint global::Windows.Foundation.IPropertyValue.GetUInt32() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; uint result = 0u; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt32_6(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe long global::Windows.Foundation.IPropertyValue.GetInt64() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; long result = 0L; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt64_7(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe ulong global::Windows.Foundation.IPropertyValue.GetUInt64() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; ulong result = 0uL; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt64_8(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe float global::Windows.Foundation.IPropertyValue.GetSingle() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; float result = 0f; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetSingle_9(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe double global::Windows.Foundation.IPropertyValue.GetDouble() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; double result = 0.0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetDouble_10(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe char global::Windows.Foundation.IPropertyValue.GetChar16() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; ushort result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetChar16_11(thisPtr, &result)); GC.KeepAlive((object)objectReference); return (char)result; } unsafe bool global::Windows.Foundation.IPropertyValue.GetBoolean() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetBoolean_12(thisPtr, &b)); GC.KeepAlive((object)objectReference); return b != 0; } unsafe string global::Windows.Foundation.IPropertyValue.GetString() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetString_13(thisPtr, &num)); GC.KeepAlive((object)objectReference); return MarshalString.FromAbi(num); } finally { MarshalString.DisposeAbi(num); } } unsafe Guid global::Windows.Foundation.IPropertyValue.GetGuid() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; Guid result = default(Guid); ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetGuid_14(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe DateTimeOffset global::Windows.Foundation.IPropertyValue.GetDateTime() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; DateTimeOffset dateTimeOffset = default(DateTimeOffset); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetDateTime_15(thisPtr, &dateTimeOffset)); GC.KeepAlive((object)objectReference); return DateTimeOffset.FromAbi(dateTimeOffset); } finally { DateTimeOffset.DisposeAbi(dateTimeOffset); } } unsafe TimeSpan global::Windows.Foundation.IPropertyValue.GetTimeSpan() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; TimeSpan timeSpan = default(TimeSpan); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetTimeSpan_16(thisPtr, &timeSpan)); GC.KeepAlive((object)objectReference); return TimeSpan.FromAbi(timeSpan); } finally { TimeSpan.DisposeAbi(timeSpan); } } unsafe global::Windows.Foundation.Point global::Windows.Foundation.IPropertyValue.GetPoint() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; global::Windows.Foundation.Point result = default(global::Windows.Foundation.Point); ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetPoint_17(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe global::Windows.Foundation.Size global::Windows.Foundation.IPropertyValue.GetSize() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; global::Windows.Foundation.Size result = default(global::Windows.Foundation.Size); ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetSize_18(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe global::Windows.Foundation.Rect global::Windows.Foundation.IPropertyValue.GetRect() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; global::Windows.Foundation.Rect result = default(global::Windows.Foundation.Rect); ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetRect_19(thisPtr, &result)); GC.KeepAlive((object)objectReference); return result; } unsafe void global::Windows.Foundation.IPropertyValue.GetUInt8Array(out byte[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt8Array_20(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetInt16Array(out short[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt16Array_21(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetUInt16Array(out ushort[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt16Array_22(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetInt32Array(out int[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt32Array_23(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetUInt32Array(out uint[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt32Array_24(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetInt64Array(out long[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt64Array_25(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetUInt64Array(out ulong[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt64Array_26(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetSingleArray(out float[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetSingleArray_27(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetDoubleArray(out double[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetDoubleArray_28(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetChar16Array(out char[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetChar16Array_29(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalNonBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalNonBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetBooleanArray(out bool[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetBooleanArray_30(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalNonBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalNonBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetStringArray(out string[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetStringArray_31(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalString.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalString.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetInspectableArray(out object[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInspectableArray_32(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalInspectable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalInspectable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetGuidArray(out Guid[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetGuidArray_33(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetDateTimeArray(out DateTimeOffset[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetDateTimeArray_34(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalNonBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalNonBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetTimeSpanArray(out TimeSpan[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetTimeSpanArray_35(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalNonBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalNonBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetPointArray(out global::Windows.Foundation.Point[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetPointArray_36(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetSizeArray(out global::Windows.Foundation.Size[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetSizeArray_37(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetRectArray(out global::Windows.Foundation.Rect[] value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) ObjectReference objectReference = (ObjectReference)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); nint thisPtr = objectReference.ThisPtr; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetRectArray_38(thisPtr, &num, &num2)); GC.KeepAlive((object)objectReference); value = MarshalBlittable.FromAbiArray(new ValueTuple(num, num2)); } finally { MarshalBlittable.DisposeAbiArray(new ValueTuple(num, num2)); } } } internal static class IPropertyValue_Delegates { public unsafe delegate int get_Type_0(nint thisPtr, PropertyType* value); public unsafe delegate int get_IsNumericScalar_1(nint thisPtr, byte* value); public unsafe delegate int GetUInt8_2(nint thisPtr, byte* value); public unsafe delegate int GetInt16_3(nint thisPtr, short* value); public unsafe delegate int GetUInt16_4(nint thisPtr, ushort* value); public unsafe delegate int GetInt32_5(nint thisPtr, int* value); public unsafe delegate int GetUInt32_6(nint thisPtr, uint* value); public unsafe delegate int GetInt64_7(nint thisPtr, long* value); public unsafe delegate int GetUInt64_8(nint thisPtr, ulong* value); public unsafe delegate int GetSingle_9(nint thisPtr, float* value); public unsafe delegate int GetDouble_10(nint thisPtr, double* value); public unsafe delegate int GetChar16_11(nint thisPtr, ushort* value); public unsafe delegate int GetBoolean_12(nint thisPtr, byte* value); public unsafe delegate int GetString_13(nint thisPtr, nint* value); public unsafe delegate int GetGuid_14(nint thisPtr, Guid* value); public unsafe delegate int GetDateTime_15(nint thisPtr, DateTimeOffset* value); public unsafe delegate int GetTimeSpan_16(nint thisPtr, TimeSpan* value); public unsafe delegate int GetPoint_17(nint thisPtr, global::Windows.Foundation.Point* value); public unsafe delegate int GetSize_18(nint thisPtr, global::Windows.Foundation.Size* value); public unsafe delegate int GetRect_19(nint thisPtr, global::Windows.Foundation.Rect* value); public unsafe delegate int GetUInt8Array_20(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetInt16Array_21(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetUInt16Array_22(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetInt32Array_23(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetUInt32Array_24(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetInt64Array_25(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetUInt64Array_26(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetSingleArray_27(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetDoubleArray_28(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetChar16Array_29(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetBooleanArray_30(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetStringArray_31(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetInspectableArray_32(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetGuidArray_33(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetDateTimeArray_34(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetTimeSpanArray_35(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetPointArray_36(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetSizeArray_37(nint thisPtr, int* __valueSize, nint* value); public unsafe delegate int GetRectArray_38(nint thisPtr, int* __valueSize, nint* value); } internal static class BoxedArrayIReferenceArrayImpl { public static readonly nint AbiToProjectionVftablePtr; private static readonly IReferenceArray_Delegates.get_Value_0 DelegateCache; unsafe static BoxedArrayIReferenceArrayImpl() { DelegateCache = Do_Abi_get_Value_0; AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(BoxedArrayIReferenceArrayImpl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(nint)) = Marshal.GetFunctionPointerForDelegate(DelegateCache); } private unsafe static int Do_Abi_get_Value_0(nint thisPtr, int* ____return_value__Size, nint* __return_value__) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) T[] array = null; *__return_value__ = 0; *____return_value__Size = 0; try { array = (T[])ComWrappersSupport.FindObject(thisPtr); ref nint reference = ref *__return_value__; ValueTuple val = ((Func>)(object)Marshaler.FromManagedArray).Invoke((T[][])(object)array); *____return_value__Size = val.Item1; reference = val.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } [Guid("61C17707-2D65-11E0-9AE8-D48564015472")] internal sealed class IReferenceArray : global::Windows.Foundation.IReferenceArray { public static readonly Guid PIID = GuidGenerator.CreateIIDUnsafe(typeof(IReferenceArray)); private readonly ObjectReference _obj; public nint ThisPtr => _obj.ThisPtr; public unsafe T[] Value { get { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)ThisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(ThisPtr, &num, &num2)); GC.KeepAlive((object)_obj); return ((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(num, num2)); } finally { Marshaler.DisposeAbiArray.Invoke((object)new ValueTuple(num, num2)); } } } public static IObjectReference CreateMarshaler(object value) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (value != null) { return ComWrappersSupport.CreateCCWForObject(value, PIID); } return null; } public static ObjectReferenceValue CreateMarshaler2(object value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ComWrappersSupport.CreateCCWForObjectForMarshaling(value, PIID); } public static nint GetAbi(IObjectReference m) { return m?.ThisPtr ?? global::System.IntPtr.Zero; } public static object FromAbi(nint ptr) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (ptr == (nint)global::System.IntPtr.Zero) { return null; } IReferenceArray referenceArray = new IReferenceArray(ObjectReference.FromAbi(ptr, PIID)); return referenceArray.Value; } public unsafe static object GetValue(IInspectable inspectable) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) nint zero = global::System.IntPtr.Zero; int num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref PIID, ref zero)); GC.KeepAlive((object)inspectable); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num, &num2)); return ((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(num, num2)); } finally { Marshaler.DisposeAbiArray.Invoke((object)new ValueTuple(num, num2)); MarshalExtensions.ReleaseIfNotNull(zero); } } public unsafe static void CopyManaged(object o, nint dest) { *(nint*)((global::System.IntPtr)dest).ToPointer() = CreateMarshaler2(o).Detach(); } public static nint FromManaged(object value) { if (value == null) { return global::System.IntPtr.Zero; } return CreateMarshaler2(value).Detach(); } public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); } public static void DisposeAbi(nint abi) { MarshalInspectable.DisposeAbi(abi); } public static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IReferenceArray)); } public IReferenceArray(ObjectReference obj) { _obj = obj; } } internal static class IReferenceArray_Delegates { public unsafe delegate int get_Value_0(nint thisPtr, int* ____return_value__Size, nint* __return_value__); } [Guid("96369F54-8EB6-48F0-ABCE-C1B211E627C3")] internal struct ManagedIStringableVftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _ToString_0; private static readonly ManagedIStringableVftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; private unsafe delegate* unmanaged[Stdcall] ToString_0 { get { return (delegate* unmanaged[Stdcall])_ToString_0; } set { _ToString_0 = value; } } unsafe static ManagedIStringableVftbl() { AbiToProjectionVftable = new ManagedIStringableVftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _ToString_0 = (delegate*)(&Do_Abi_ToString_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(ManagedIStringableVftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(ManagedIStringableVftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_ToString_0(nint thisPtr, nint* value) { try { string value2 = ComWrappersSupport.FindObject(thisPtr).ToString(); *value = MarshalString.FromManaged(value2); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } internal static class BoxedValueIReferenceImpl { private static Nullable.Vftbl AbiToProjectionVftable; public static nint AbiToProjectionVftablePtr; [UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode", Justification = "ABI types used with MakeGenericType are not reflected on.")] static unsafe BoxedValueIReferenceImpl() { AbiToProjectionVftable = new Nullable.Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, get_Value_0 = GetValueDelegateForAbi(out var nativePtr) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(BoxedValueIReferenceImpl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)ptr = AbiToProjectionVftable.IInspectableVftbl; ptr[6] = nativePtr; AbiToProjectionVftablePtr = (nint)ptr; } private unsafe static int Do_Abi_get_Value_0_Blittable(void* thisPtr, void* result) { if (result == null) { return -2147467261; } try { T val = (T)ComWrappersSupport.FindObject(new global::System.IntPtr(thisPtr)); global::System.Runtime.CompilerServices.Unsafe.WriteUnaligned(result, val); return 0; } catch (global::System.Exception ex) { global::System.Runtime.CompilerServices.Unsafe.WriteUnaligned(result, default(T)); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } } private unsafe static int Do_Abi_get_Value_0_DateTimeOffset(void* thisPtr, DateTimeOffset* result) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (result == null) { return -2147467261; } try { T val = (T)ComWrappersSupport.FindObject(new global::System.IntPtr(thisPtr)); global::System.Runtime.CompilerServices.Unsafe.WriteUnaligned((void*)result, DateTimeOffset.FromManaged(global::System.Runtime.CompilerServices.Unsafe.As(ref val))); return 0; } catch (global::System.Exception ex) { global::System.Runtime.CompilerServices.Unsafe.WriteUnaligned((void*)result, default(T)); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } } private unsafe static int Do_Abi_get_Value_0(void* thisPtr, out TAbi __return_value__) { T val = default(T); __return_value__ = default(TAbi); try { val = (T)ComWrappersSupport.FindObject(new global::System.IntPtr(thisPtr)); __return_value__ = (TAbi)Marshaler.FromManaged.Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } internal unsafe static global::System.Delegate GetValueDelegateForAbi(out nint nativePtr) { //IL_0432: Unknown result type (might be due to invalid IL or missing references) if (typeof(T) == typeof(int) || typeof(T) == typeof(byte) || typeof(T) == typeof(bool) || typeof(T) == typeof(sbyte) || typeof(T) == typeof(short) || typeof(T) == typeof(ushort) || typeof(T) == typeof(char) || typeof(T) == typeof(uint) || typeof(T) == typeof(long) || typeof(T) == typeof(ulong) || typeof(T) == typeof(float) || typeof(T) == typeof(double) || typeof(T) == typeof(Guid) || typeof(T) == typeof(TimeSpan) || typeof(T) == typeof(global::Windows.Foundation.Point) || typeof(T) == typeof(global::Windows.Foundation.Rect) || typeof(T) == typeof(global::Windows.Foundation.Size) || typeof(T) == typeof(Matrix3x2) || typeof(T) == typeof(Matrix4x4) || typeof(T) == typeof(Plane) || typeof(T) == typeof(Quaternion) || typeof(T) == typeof(Vector2) || typeof(T) == typeof(Vector3) || typeof(T) == typeof(Vector4) || (typeof(T).IsEnum && global::System.Enum.GetUnderlyingType(typeof(T)) == typeof(int)) || (typeof(T).IsEnum && global::System.Enum.GetUnderlyingType(typeof(T)) == typeof(uint))) { Nullable_Delegates.GetValueDelegateAbi getValueDelegateAbi = Do_Abi_get_Value_0_Blittable; nativePtr = Marshal.GetFunctionPointerForDelegate(getValueDelegateAbi); return getValueDelegateAbi; } if (typeof(T) == typeof(DateTimeOffset)) { Nullable_Delegates.GetValueDelegateAbiDateTimeOffset getValueDelegateAbiDateTimeOffset = Do_Abi_get_Value_0_DateTimeOffset; nativePtr = Marshal.GetFunctionPointerForDelegate(getValueDelegateAbiDateTimeOffset); return getValueDelegateAbiDateTimeOffset; } if (RuntimeFeature.IsDynamicCodeCompiled) { if (Nullable.Vftbl.get_Value_0_Type == null) { Nullable.Vftbl.get_Value_0_Type = Projections.GetAbiDelegateType(typeof(void*), Marshaler.AbiType.MakeByRefType(), typeof(int)); } global::System.Delegate @delegate = global::System.Delegate.CreateDelegate(Nullable.Vftbl.get_Value_0_Type, typeof(BoxedValueIReferenceImpl).GetMethod("Do_Abi_get_Value_0", (BindingFlags)40).MakeGenericMethod(new global::System.Type[1] { Marshaler.AbiType })); nativePtr = Marshal.GetFunctionPointerForDelegate(@delegate); return @delegate; } throw new NotSupportedException($"Failed to get the marshalling delegate for BoxedValueIReferenceImpl`1 with type '{typeof(T)}'."); } } internal static class BoxedValueIReferenceImpl where TAbi : unmanaged { public static nint AbiToProjectionVftablePtr; private static readonly Nullable_Delegates.GetValueDelegateAbi GetValue; unsafe static BoxedValueIReferenceImpl() { if (typeof(T) == typeof(TAbi)) { GetValue = Do_Abi_get_Value_0_Blittable; } else { GetValue = Do_Abi_get_Value_0; } AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(BoxedValueIReferenceImpl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(nint)) = Marshal.GetFunctionPointerForDelegate(GetValue); } private unsafe static int Do_Abi_get_Value_0(void* thisPtr, void* __return_value__) { *(TAbi*)__return_value__ = default(TAbi); try { T val = (T)ComWrappersSupport.FindObject(new global::System.IntPtr(thisPtr)); *(TAbi*)__return_value__ = (TAbi)Marshaler.FromManaged.Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_get_Value_0_Blittable(void* thisPtr, void* __return_value__) { *(TAbi*)__return_value__ = default(TAbi); try { *(TAbi*)__return_value__ = (TAbi)ComWrappersSupport.FindObject(new global::System.IntPtr(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } [Guid("9E365E57-48B2-4160-956F-C7385120BBFC")] internal struct IUriRuntimeClassVftbl { internal IInspectable.Vftbl IInspectableVftbl; public nint get_AbsoluteUri_0; public nint get_DisplayUri_1; public nint get_Domain_2; public nint get_Extension_3; public nint get_Fragment_4; public nint get_Host_5; public nint get_Password_6; public nint get_Path_7; public nint get_Query_8; public nint get_QueryParsed_9; public unsafe void* _get_RawUri_10; public nint get_SchemeName_11; public nint get_UserName_12; public nint get_Port_13; public nint get_Suspicious_14; public nint Equals_15; public nint CombineUri_16; public unsafe delegate* unmanaged[Stdcall] get_RawUri_10 => (delegate* unmanaged[Stdcall])_get_RawUri_10; } } namespace ABI.Windows.Foundation.Collections { internal static class IMapMethods { internal unsafe static volatile delegate* _Lookup; internal unsafe static volatile delegate* _HasKey; internal unsafe static volatile delegate*> _GetView; internal unsafe static volatile delegate* _Insert; internal unsafe static volatile delegate* _Remove; internal static volatile bool _RcwHelperInitialized; [MethodImpl(256)] internal static void EnsureInitialized() { if (!RuntimeFeature.IsDynamicCodeCompiled && !_RcwHelperInitialized) { ThrowNotInitialized(); } [CompilerGenerated] [DoesNotReturn] static void ThrowNotInitialized() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException($"Type '{typeof(IDictionary)}' was called without initializing the RCW methods using 'IDictionaryMethods.InitRcwHelper'. If using 'IDynamicInterfaceCastable' support to do a dynamic cast to this interface, ensure the 'InitRcwHelper' method is called."); } } public unsafe static V Lookup(IObjectReference obj, K key) { EnsureInitialized(); return _Lookup(obj, key); } public unsafe static bool HasKey(IObjectReference obj, K key) { EnsureInitialized(); return _HasKey(obj, key); } public unsafe static IReadOnlyDictionary GetView(IObjectReference obj) { if (!RuntimeFeature.IsDynamicCodeCompiled) { EnsureInitialized(); return _GetView(obj); } if (_GetView != (delegate*>)null) { return _GetView(obj); } nint thisPtr = obj.ThisPtr; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &num)); GC.KeepAlive((object)obj); return MarshalInterface>.FromAbi(num); } finally { MarshalInterface>.DisposeAbi(num); } } public unsafe static bool Insert(IObjectReference obj, K key, V value) { EnsureInitialized(); return _Insert(obj, key, value); } public unsafe static void Remove(IObjectReference obj, K key) { EnsureInitialized(); _Remove(obj, key); } public static void Clear(IObjectReference obj) { _ClearHelper(obj); } private unsafe static void _ClearHelper(IObjectReference obj) { nint thisPtr = obj.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)12 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr)); GC.KeepAlive((object)obj); } public unsafe static uint get_Size(IObjectReference obj) { nint thisPtr = obj.ThisPtr; uint result = 0u; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &result)); GC.KeepAlive((object)obj); return result; } } internal static class IIterableMethods { internal unsafe static volatile delegate*> _First; internal static volatile bool _RcwHelperInitialized; [MethodImpl(256)] internal static void EnsureInitialized() { if (!RuntimeFeature.IsDynamicCodeCompiled && !_RcwHelperInitialized) { ThrowNotInitialized(); } [CompilerGenerated] [DoesNotReturn] static void ThrowNotInitialized() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException($"Type '{typeof(global::System.Collections.Generic.IEnumerable)}' was called without initializing the RCW methods using 'IEnumerableMethods.InitRcwHelper'. If using 'IDynamicInterfaceCastable' support to do a dynamic cast to this interface, ensure the 'InitRcwHelper' method is called."); } } public unsafe static global::System.Collections.Generic.IEnumerator First(IObjectReference obj) { if (!RuntimeFeature.IsDynamicCodeCompiled) { EnsureInitialized(); return _First(obj); } if (_First != (delegate*>)null) { return _First(obj); } nint abi = 0; try { nint thisPtr = obj.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &abi)); GC.KeepAlive((object)obj); return FromAbiEnumerator.FromAbi(abi); } finally { FromAbiEnumerator.DisposeAbi(abi); } } } [DynamicInterfaceCastableImplementation] [Guid("FAA585EA-6214-4217-AFDA-7F46DE5869B3")] internal interface IIterable : IEnumerable, global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable, global::Windows.Foundation.Collections.IIterable { new static Guid PIID = IEnumerableMethods.PIID; } internal static class IMapViewMethods { internal unsafe static volatile delegate* _Lookup; internal unsafe static volatile delegate* _HasKey; internal unsafe static volatile delegate*, ref IMapView, void> _Split; internal static volatile bool _RcwHelperInitialized; [MethodImpl(256)] internal static void EnsureInitialized() { if (!RuntimeFeature.IsDynamicCodeCompiled && !_RcwHelperInitialized) { ThrowNotInitialized(); } [CompilerGenerated] [DoesNotReturn] static void ThrowNotInitialized() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException($"Type '{typeof(IReadOnlyDictionary)}' was called without initializing the RCW methods using 'IReadOnlyDictionaryMethods.InitRcwHelper'. If using 'IDynamicInterfaceCastable' support to do a dynamic cast to this interface, ensure the 'InitRcwHelper' method is called."); } } public unsafe static V Lookup(IObjectReference obj, K key) { EnsureInitialized(); return _Lookup(obj, key); } public unsafe static bool HasKey(IObjectReference obj, K key) { EnsureInitialized(); return _HasKey(obj, key); } public unsafe static void Split(IObjectReference obj, out IMapView first, out IMapView second) { if (!RuntimeFeature.IsDynamicCodeCompiled) { EnsureInitialized(); _Split(obj, ref first, ref second); return; } if (_Split != (delegate*, ref IMapView, void>)null) { _Split(obj, ref first, ref second); return; } nint thisPtr = obj.ThisPtr; nint num = 0; nint num2 = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &num, &num2)); GC.KeepAlive((object)obj); first = MarshalInterface>.FromAbi(num); second = MarshalInterface>.FromAbi(num2); } finally { MarshalInterface>.DisposeAbi(num); MarshalInterface>.DisposeAbi(num2); } } public unsafe static uint get_Size(IObjectReference obj) { nint thisPtr = obj.ThisPtr; uint result = 0u; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &result)); GC.KeepAlive((object)obj); return result; } } internal static class IVectorViewMethods { internal unsafe static volatile delegate* _GetAt; internal unsafe static volatile delegate* _IndexOf; internal unsafe static volatile delegate* _GetMany; internal static volatile bool _RcwHelperInitialized; internal static void EnsureInitialized() { if (RuntimeFeature.IsDynamicCodeCompiled) { InitRcwHelperFallbackIfNeeded(); } else if (!_RcwHelperInitialized) { ThrowNotInitialized(); } [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] static void InitRcwHelperFallbackIfNeeded() { if (!_RcwHelperInitialized) { Func val = (Func)(object)typeof(IReadOnlyListMethods<, >).MakeGenericType(new global::System.Type[2] { typeof(T), Marshaler.AbiType }).GetMethod("InitRcwHelperFallback", (BindingFlags)40).CreateDelegate(typeof(Func)); val.Invoke(); } } [CompilerGenerated] [DoesNotReturn] static void ThrowNotInitialized() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException($"Type '{typeof(global::System.Collections.Generic.IReadOnlyList)}' was called without initializing the RCW methods using 'IReadOnlyListMethods.InitRcwHelper'. If using 'IDynamicInterfaceCastable' support to do a dynamic cast to this interface, ensure the 'InitRcwHelper' method is called."); } } public unsafe static T GetAt(IObjectReference obj, uint index) { EnsureInitialized(); return _GetAt(obj, index); } public unsafe static uint get_Size(IObjectReference obj) { nint thisPtr = obj.ThisPtr; uint result = 0u; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &result)); GC.KeepAlive((object)obj); return result; } public unsafe static bool IndexOf(IObjectReference obj, T value, out uint index) { EnsureInitialized(); return _IndexOf(obj, value, ref index); } public unsafe static uint GetMany(IObjectReference obj, uint startIndex, ref T[] items) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { EnsureInitialized(); return _GetMany(obj, startIndex, items); } if (_GetMany != (delegate*)null) { return _GetMany(obj, startIndex, items); } nint thisPtr = obj.ThisPtr; object obj2 = null; int num = 0; nint num2 = 0; uint result = 0u; try { obj2 = ((Func)(object)Marshaler.CreateMarshalerArray).Invoke((T[][])(object)items); ValueTuple val = Marshaler.GetAbiArray.Invoke(obj2); num = val.Item1; num2 = val.Item2; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, startIndex, num, num2, &result)); GC.KeepAlive((object)obj); items = ((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(num, num2)); return result; } finally { Marshaler.DisposeMarshalerArray.Invoke(obj2); } } } } namespace ABI.Microsoft.UI.Xaml.Data { [Guid("D026DD64-5F26-5F15-A86A-0DEC8A431796")] internal struct IDataErrorsChangedEventArgsVftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _get_PropertyName_0; private unsafe void* _put_PropertyName_1; public unsafe delegate* unmanaged[Stdcall] get_PropertyName_0 => (delegate* unmanaged[Stdcall])_get_PropertyName_0; public unsafe delegate* unmanaged[Stdcall] put_PropertyName_1 => (delegate* unmanaged[Stdcall])_put_PropertyName_1; } [Guid("62D0BD1E-B85F-5FCC-842A-7CB0DDA37FE5")] internal sealed class WinRTDataErrorsChangedEventArgsRuntimeClassFactory { [Guid("62D0BD1E-B85F-5FCC-842A-7CB0DDA37FE5")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _CreateInstance_0; public unsafe delegate* unmanaged[Stdcall] CreateInstance_0 => (delegate* unmanaged[Stdcall])_CreateInstance_0; } private readonly ObjectReference _obj; public nint ThisPtr => _obj.ThisPtr; public static ObjectReference FromAbi(nint thisPtr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ObjectReference.FromAbi(thisPtr, IID.IID_DataErrorsChangedEventArgsRuntimeClassFactory); } public WinRTDataErrorsChangedEventArgsRuntimeClassFactory(IObjectReference obj) : this(obj.As(IID.IID_DataErrorsChangedEventArgsRuntimeClassFactory)) { }//IL_0007: Unknown result type (might be due to invalid IL or missing references) public WinRTDataErrorsChangedEventArgsRuntimeClassFactory(ObjectReference obj) { _obj = obj; } public unsafe IObjectReference CreateInstance(string name) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) nint thisPtr = 0; try { MarshalString.Pinnable p = new MarshalString.Pinnable(name); fixed (char* ptr = p) { void* ptr2 = ptr; ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.CreateInstance_0(ThisPtr, MarshalString.GetAbi(ref p), &thisPtr)); GC.KeepAlive((object)_obj); return ObjectReference.Attach(ref thisPtr, IID.IID_IUnknown); } } finally { MarshalInspectable.DisposeAbi(thisPtr); } } public unsafe ObjectReferenceValue CreateInstanceForMarshaling(string name) { nint ptr = 0; MarshalString.Pinnable p = new MarshalString.Pinnable(name); fixed (char* ptr2 = p) { void* ptr3 = ptr2; ExceptionHelpers.ThrowExceptionForHR(_obj.Vftbl.CreateInstance_0(ThisPtr, MarshalString.GetAbi(ref p), &ptr)); GC.KeepAlive((object)_obj); return new ObjectReferenceValue(ptr); } } } [Guid("30DA92C0-23E8-42A0-AE7C-734A0E5D2782")] internal interface ICustomProperty { static readonly nint AbiToProjectionVftablePtr; static Guid IID => global::WinRT.Interop.IID.IID_ICustomProperty; unsafe static ICustomProperty() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(ICustomProperty), sizeof(IInspectable.Vftbl) + sizeof(nint) * 8); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_get_Type_0); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)7 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_get_Name_1); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)8 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_GetValue_2); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)9 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_SetValue_3); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)10 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_GetIndexedValue_4); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)11 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_SetIndexedValue_5); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)12 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_get_CanWrite_6); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)13 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_get_CanRead_7); } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetValue_2(nint thisPtr, nint target, nint* result) { object obj = null; *result = 0; try { obj = ComWrappersSupport.FindObject(thisPtr).GetValue(MarshalInspectable.FromAbi(target)); *result = MarshalInspectable.FromManaged(obj); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private static int Do_Abi_SetValue_3(nint thisPtr, nint target, nint value) { try { ComWrappersSupport.FindObject(thisPtr).SetValue(MarshalInspectable.FromAbi(target), MarshalInspectable.FromAbi(value)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetIndexedValue_4(nint thisPtr, nint target, nint index, nint* result) { object obj = null; try { obj = ComWrappersSupport.FindObject(thisPtr).GetIndexedValue(MarshalInspectable.FromAbi(target), MarshalInspectable.FromAbi(index)); *result = MarshalInspectable.FromManaged(obj); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private static int Do_Abi_SetIndexedValue_5(nint thisPtr, nint target, nint value, nint index) { try { ComWrappersSupport.FindObject(thisPtr).SetIndexedValue(MarshalInspectable.FromAbi(target), MarshalInspectable.FromAbi(value), MarshalInspectable.FromAbi(index)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_CanRead_7(nint thisPtr, byte* value) { bool flag = false; try { flag = ComWrappersSupport.FindObject(thisPtr).CanRead; *value = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_CanWrite_6(nint thisPtr, byte* value) { bool flag = false; try { flag = ComWrappersSupport.FindObject(thisPtr).CanWrite; *value = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Name_1(nint thisPtr, nint* value) { string text = null; try { text = ComWrappersSupport.FindObject(thisPtr).Name; *value = MarshalString.FromManaged(text); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Type_0(nint thisPtr, Type* value) { global::System.Type type = null; try { type = ComWrappersSupport.FindObject(thisPtr).Type; *value = Type.FromManaged(type); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } internal static class ICustomProperty_Delegates { public unsafe delegate int get_Type_0(nint thisPtr, Type* value); public unsafe delegate int get_Name_1(nint thisPtr, nint* value); public unsafe delegate int GetValue_2(nint thisPtr, nint target, nint* result); public delegate int SetValue_3(nint thisPtr, nint target, nint value); public unsafe delegate int GetIndexedValue_4(nint thisPtr, nint target, nint index, nint* result); public delegate int SetIndexedValue_5(nint thisPtr, nint target, nint value, nint index); public unsafe delegate int get_CanWrite_6(nint thisPtr, byte* value); public unsafe delegate int get_CanRead_7(nint thisPtr, byte* value); } internal sealed class ManagedCustomPropertyWinRTTypeDetails : IWinRTExposedTypeDetails { public ComInterfaceEntry[] GetExposedInterfaces() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) return (ComInterfaceEntry[])(object)new ComInterfaceEntry[1] { new ComInterfaceEntry { IID = ICustomProperty.IID, Vtable = ICustomProperty.AbiToProjectionVftablePtr } }; } } [WinRTExposedType(typeof(ManagedCustomPropertyWinRTTypeDetails))] internal sealed class ManagedCustomProperty : global::Microsoft.UI.Xaml.Data.ICustomProperty { private readonly PropertyInfo _property; public bool CanRead => _property.CanRead; public bool CanWrite => _property.CanWrite; public string Name => ((MemberInfo)_property).Name; public global::System.Type Type => _property.PropertyType; public ManagedCustomProperty(PropertyInfo property) { _property = property; } public object GetIndexedValue(object target, object index) { return _property.GetValue(target, new object[1] { index }); } public object GetValue(object target) { return _property.GetValue(target); } public void SetIndexedValue(object target, object value, object index) { _property.SetValue(target, value, new object[1] { index }); } public void SetValue(object target, object value) { _property.SetValue(target, value); } } [Guid("7C925755-3E48-42B4-8677-76372267033F")] internal struct ManagedCustomPropertyProviderVftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* GetCustomProperty_0; private unsafe void* GetIndexedProperty_1; private unsafe void* GetStringRepresentation_2; private unsafe void* get_Type_3; private static readonly ManagedCustomPropertyProviderVftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; unsafe static ManagedCustomPropertyProviderVftbl() { AbiToProjectionVftable = new ManagedCustomPropertyProviderVftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, GetCustomProperty_0 = (delegate*)(&Do_Abi_GetCustomProperty_0), GetIndexedProperty_1 = (delegate*)(&Do_Abi_GetIndexedProperty_1), GetStringRepresentation_2 = (delegate*)(&Do_Abi_GetStringRepresentation_2), get_Type_3 = (delegate*)(&Do_Abi_get_Type_3) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(ManagedCustomPropertyProviderVftbl), sizeof(IInspectable.Vftbl) + sizeof(nint) * 4); *(ManagedCustomPropertyProviderVftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetCustomProperty_0(nint thisPtr, nint name, nint* result) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) global::Microsoft.UI.Xaml.Data.ICustomProperty customProperty = null; try { string text = MarshalString.FromAbi(name); object obj = ComWrappersSupport.FindObject(thisPtr); if (obj is IBindableCustomPropertyImplementation bindableCustomPropertyImplementation) { customProperty = bindableCustomPropertyImplementation.GetProperty(text); *result = MarshalInterface.FromManaged(customProperty); return 0; } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"ICustomProperty support used by XAML binding for type '{obj.GetType()}' (property '{text}') requires the type to marked with 'WinRT.GeneratedBindableCustomPropertyAttribute'. If this is a built-in type or a type that can't be marked, a wrapper type should be used around it that is marked to enable this support."); } GetCustomPropertyForJit(obj, text, result); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; [MethodImpl(8)] [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "Fallback method for JIT environments that is not trim-safe by design.")] static unsafe void GetCustomPropertyForJit(object target, string name, nint* result) { global::Microsoft.UI.Xaml.Data.ICustomProperty value = null; PropertyInfo property = target.GetType().GetProperty(name, (BindingFlags)28); if (property != null) { value = new ManagedCustomProperty(property); } *result = MarshalInterface.FromManaged(value); } } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetIndexedProperty_1(nint thisPtr, nint name, Type type, nint* result) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) global::Microsoft.UI.Xaml.Data.ICustomProperty customProperty = null; try { global::System.Type type2 = Type.FromAbi(type); object obj = ComWrappersSupport.FindObject(thisPtr); if (obj is IBindableCustomPropertyImplementation bindableCustomPropertyImplementation) { customProperty = bindableCustomPropertyImplementation.GetProperty(type2); *result = MarshalInterface.FromManaged(customProperty); return 0; } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"ICustomProperty support used by XAML binding for type '{obj.GetType()}' (indexer with parameter of type '{type2}') requires the type to marked with 'WinRT.GeneratedBindableCustomPropertyAttribute'. If this is a built-in type or a type that can't be marked, a wrapper type should be used around it that is marked to enable this support."); } string name2 = MarshalString.FromAbi(name); GetCustomPropertyForJit(obj, name2, type2, result); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; [MethodImpl(8)] [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "Fallback method for JIT environments that is not trim-safe by design.")] static unsafe void GetCustomPropertyForJit(object target, string name, global::System.Type type, nint* result) { global::Microsoft.UI.Xaml.Data.ICustomProperty value = null; PropertyInfo property = target.GetType().GetProperty(name, (BindingFlags)28, (Binder)null, (global::System.Type)null, new global::System.Type[1] { type }, (ParameterModifier[])null); if (property != null) { value = new ManagedCustomProperty(property); } *result = MarshalInterface.FromManaged(value); } } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetStringRepresentation_2(nint thisPtr, nint* result) { string text = null; try { text = ComWrappersSupport.FindObject(thisPtr).ToString(); *result = MarshalString.FromManaged(text); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Type_3(nint thisPtr, Type* value) { global::System.Type type = null; try { type = ComWrappersSupport.FindObject(thisPtr).GetType(); *value = Type.FromManaged(type); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } internal sealed class PropertyChangedEventArgsRuntimeClassFactory { private readonly IObjectReference _obj; public PropertyChangedEventArgsRuntimeClassFactory() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) _obj = (FeatureSwitches.UseWindowsUIXamlProjections ? ActivationFactory.Get("Windows.UI.Xaml.Data.PropertyChangedEventArgs", IID.IID_WUX_PropertyChangedEventArgsRuntimeClassFactory) : ActivationFactory.Get("Microsoft.UI.Xaml.Data.PropertyChangedEventArgs", IID.IID_MUX_PropertyChangedEventArgsRuntimeClassFactory)); } public unsafe IObjectReference CreateInstance(string name, object baseInterface, out IObjectReference innerInterface) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) IObjectReference objRef = null; nint num = 0; nint thisPtr = 0; try { MarshalString.Pinnable p = new MarshalString.Pinnable(name); fixed (char* ptr = p) { void* ptr2 = ptr; objRef = MarshalInspectable.CreateMarshaler(baseInterface); nint thisPtr2 = _obj.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr2) + (nint)6 * (nint)sizeof(void*))))(thisPtr2, MarshalString.GetAbi(ref p), MarshalInspectable.GetAbi(objRef), &num, &thisPtr)); GC.KeepAlive((object)_obj); innerInterface = ObjectReference.FromAbi(num, IID.IID_IUnknown); return ObjectReference.Attach(ref thisPtr, IID.IID_IUnknown); } } finally { MarshalInspectable.DisposeMarshaler(objRef); MarshalInspectable.DisposeAbi(num); MarshalInspectable.DisposeAbi(thisPtr); } } public unsafe ObjectReferenceValue CreateInstance(string name) { nint ptr = 0; nint ptr2 = 0; try { MarshalString.Pinnable p = new MarshalString.Pinnable(name); fixed (char* ptr3 = p) { void* ptr4 = ptr3; nint thisPtr = _obj.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(void*))))(thisPtr, MarshalString.GetAbi(ref p), global::System.IntPtr.Zero, &ptr, &ptr2)); GC.KeepAlive((object)_obj); return new ObjectReferenceValue(ptr2); } } finally { MarshalInspectable.DisposeAbi(ptr); } } } } namespace ABI.Microsoft.UI.Xaml.Interop { [DynamicInterfaceCastableImplementation] [Guid("036D2C08-DF29-41AF-8AA2-D774BE62BA6F")] internal interface IBindableIterable : global::Microsoft.UI.Xaml.Interop.IBindableIterable, IEnumerable, global::System.Collections.IEnumerable { } [DynamicInterfaceCastableImplementation] [Guid("6A1D6C07-076D-49F2-8314-F52C9C9A8331")] internal interface IBindableIterator : global::Microsoft.UI.Xaml.Interop.IBindableIterator { static readonly nint AbiToProjectionVftablePtr; unsafe object global::Microsoft.UI.Xaml.Interop.IBindableIterator.Current { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Microsoft.UI.Xaml.Interop.IBindableIterator).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; nint ptr = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &ptr)); GC.KeepAlive((object)objectReferenceForType); return MarshalInspectable.FromAbi(ptr); } finally { MarshalInspectable.DisposeAbi(ptr); } } } unsafe bool global::Microsoft.UI.Xaml.Interop.IBindableIterator.HasCurrent { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Microsoft.UI.Xaml.Interop.IBindableIterator).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &b)); GC.KeepAlive((object)objectReferenceForType); return b != 0; } } unsafe static IBindableIterator() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IBindableIterator), sizeof(IInspectable.Vftbl) + sizeof(nint) * 4); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_Current_0); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_HasCurrent_1); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_MoveNext_2); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_GetMany_3); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_MoveNext_2(nint thisPtr, byte* result) { bool flag = false; *result = 0; try { flag = ComWrappersSupport.FindObject(thisPtr).MoveNext(); *result = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetMany_3(nint thisPtr, int __itemsSize, nint items, uint* result) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) *result = 0u; try { throw new NotImplementedException(); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_Current_0(nint thisPtr, nint* value) { object obj = null; *value = 0; try { obj = ComWrappersSupport.FindObject(thisPtr).Current; *value = MarshalInspectable.FromManaged(obj); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_HasCurrent_1(nint thisPtr, byte* value) { bool flag = false; *value = 0; try { flag = ComWrappersSupport.FindObject(thisPtr).HasCurrent; *value = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } internal static ObjectReference FromAbi(nint thisPtr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ObjectReference.FromAbi(thisPtr, IID.IID_IUnknown); } unsafe bool global::Microsoft.UI.Xaml.Interop.IBindableIterator.MoveNext() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Microsoft.UI.Xaml.Interop.IBindableIterator).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &b)); GC.KeepAlive((object)objectReferenceForType); return b != 0; } uint global::Microsoft.UI.Xaml.Interop.IBindableIterator.GetMany(ref object[] items) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException(); } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] internal static class IBindableIterator_Delegates { public unsafe delegate int get_Current_0(nint thisPtr, nint* result); public unsafe delegate int get_HasCurrent_1(nint thisPtr, byte* result); public unsafe delegate int MoveNext_2(nint thisPtr, byte* result); public unsafe delegate int GetMany_3(nint thisPtr, int itemSize, nint items, uint* result); } [DynamicInterfaceCastableImplementation] [Guid("346DD6E7-976E-4BC3-815D-ECE243BC0F33")] internal interface IBindableVectorView : global::Microsoft.UI.Xaml.Interop.IBindableVectorView, global::System.Collections.IEnumerable { static readonly nint AbiToProjectionVftablePtr; private static readonly ConditionalWeakTable _helperTable; unsafe uint global::Microsoft.UI.Xaml.Interop.IBindableVectorView.Size { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Microsoft.UI.Xaml.Interop.IBindableIterator).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; uint result = 0u; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &result)); GC.KeepAlive((object)objectReferenceForType); return result; } } unsafe static IBindableVectorView() { _helperTable = new ConditionalWeakTable(); AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IBindableVectorView), sizeof(IInspectable.Vftbl) + sizeof(nint) * 3); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_GetAt_0); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_Size_1); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_IndexOf_2); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetAt_0(nint thisPtr, uint index, nint* result) { object obj = null; try { obj = ComWrappersSupport.FindObject(thisPtr).GetAt(index); *result = MarshalInspectable.FromManaged(obj); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_IndexOf_2(nint thisPtr, nint value, uint* index, byte* returnValue) { bool flag = false; *index = 0u; *returnValue = 0; uint index2 = 0u; try { flag = ComWrappersSupport.FindObject(thisPtr).IndexOf(MarshalInspectable.FromAbi(value), out index2); *index = index2; *returnValue = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_Size_1(nint thisPtr, uint* value) { uint num = 0u; *value = 0u; try { num = ComWrappersSupport.FindObject(thisPtr).Size; *value = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } internal static ObjectReference FromAbi(nint thisPtr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ObjectReference.FromAbi(thisPtr, IID.IID_IBindableVectorView); } unsafe object global::Microsoft.UI.Xaml.Interop.IBindableVectorView.GetAt(uint index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Microsoft.UI.Xaml.Interop.IBindableIterator).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; nint ptr = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, index, &ptr)); GC.KeepAlive((object)objectReferenceForType); return MarshalInspectable.FromAbi(ptr); } finally { MarshalInspectable.DisposeAbi(ptr); } } unsafe bool global::Microsoft.UI.Xaml.Interop.IBindableVectorView.IndexOf(object value, out uint index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Microsoft.UI.Xaml.Interop.IBindableIterator).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; ObjectReferenceValue value2 = default(ObjectReferenceValue); uint num = 0u; byte b = 0; try { value2 = MarshalInspectable.CreateMarshaler2(value); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, MarshalInspectable.GetAbi(value2), &num, &b)); GC.KeepAlive((object)objectReferenceForType); index = num; return b != 0; } finally { MarshalInspectable.DisposeMarshaler(value2); } } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return _helperTable.GetValue((IWinRTObject)this, (CreateValueCallback)((IWinRTObject enumerable) => new IEnumerable.FromAbiHelper((global::System.Collections.IEnumerable)enumerable))).GetEnumerator(); } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] internal static class IBindableVectorView_Delegates { public unsafe delegate int GetAt_0(nint thisPtr, uint index, nint* result); public unsafe delegate int get_Size_1(nint thisPtr, uint* result); public unsafe delegate int IndexOf_2(nint thisPtr, nint value, uint* index, byte* returnValue); } [Guid("5108EBA4-4892-5A20-8374-A96815E0FD27")] internal sealed class WinRTNotifyCollectionChangedEventArgsRuntimeClassFactory { private readonly IObjectReference _obj; public static readonly WinRTNotifyCollectionChangedEventArgsRuntimeClassFactory Instance = new WinRTNotifyCollectionChangedEventArgsRuntimeClassFactory(); public nint ThisPtr => _obj.ThisPtr; private WinRTNotifyCollectionChangedEventArgsRuntimeClassFactory() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) _obj = (FeatureSwitches.UseWindowsUIXamlProjections ? ActivationFactory.Get("Windows.UI.Xaml.Interop.NotifyCollectionChangedEventArgs", IID.IID_WUX_INotifyCollectionChangedEventArgsFactory) : ActivationFactory.Get("Microsoft.UI.Xaml.Interop.NotifyCollectionChangedEventArgs", IID.IID_MUX_INotifyCollectionChangedEventArgsFactory)); } public unsafe ObjectReferenceValue CreateInstanceWithAllParameters(NotifyCollectionChangedAction action, global::System.Collections.IList newItems, global::System.Collections.IList oldItems, int newIndex, int oldIndex) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) ObjectReferenceValue value = default(ObjectReferenceValue); ObjectReferenceValue value2 = default(ObjectReferenceValue); nint ptr = 0; nint ptr2 = 0; try { value = MarshalInterface.CreateMarshaler2(newItems, IListMethods.IID); value2 = MarshalInterface.CreateMarshaler2(oldItems, IListMethods.IID); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)ThisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(ThisPtr, action, MarshalInterface.GetAbi(value), MarshalInterface.GetAbi(value2), newIndex, oldIndex, global::System.IntPtr.Zero, &ptr, &ptr2)); GC.KeepAlive((object)_obj); return new ObjectReferenceValue(ptr2); } finally { value.Dispose(); value2.Dispose(); MarshalInspectable.DisposeAbi(ptr); } } } } namespace ABI.System { internal static class NonBlittableMarshallingStubs { public static readonly Action NoOpFunc = NoOp; public static object Boolean_CreateMarshaler(bool value) { return Boolean.CreateMarshaler(value); } public static object Boolean_GetAbi(object value) { return Boolean.GetAbi((bool)value); } public static bool Boolean_FromAbi(object abi) { return Boolean.FromAbi((byte)abi); } public static void Boolean_CopyAbi(object value, nint dest) { Boolean.CopyAbi((bool)value, dest); } public static object Boolean_FromManaged(bool value) { return Boolean.FromManaged(value); } public static object Char_CreateMarshaler(char value) { return Char.CreateMarshaler(value); } public static object Char_GetAbi(object value) { return Char.GetAbi((char)value); } public static char Char_FromAbi(object abi) { return Char.FromAbi((ushort)abi); } public static void Char_CopyAbi(object value, nint dest) { Char.CopyAbi((char)value, dest); } public static object Char_FromManaged(char value) { return Char.FromManaged(value); } public static object TimeSpan_CreateMarshaler(TimeSpan value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return TimeSpan.CreateMarshaler(value); } public static object TimeSpan_GetAbi(object value) { return TimeSpan.GetAbi((TimeSpan.Marshaler)value); } public static TimeSpan TimeSpan_FromAbi(object abi) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return TimeSpan.FromAbi((TimeSpan)abi); } public static void TimeSpan_CopyAbi(object value, nint dest) { TimeSpan.CopyAbi((TimeSpan.Marshaler)value, dest); } public static object TimeSpan_FromManaged(TimeSpan value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return TimeSpan.FromManaged(value); } public static object DateTimeOffset_CreateMarshaler(DateTimeOffset value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return DateTimeOffset.CreateMarshaler(value); } public static object DateTimeOffset_GetAbi(object value) { return DateTimeOffset.GetAbi((DateTimeOffset.Marshaler)value); } public static DateTimeOffset DateTimeOffset_FromAbi(object abi) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return DateTimeOffset.FromAbi((DateTimeOffset)abi); } public static void DateTimeOffset_CopyAbi(object value, nint dest) { DateTimeOffset.CopyAbi((DateTimeOffset.Marshaler)value, dest); } public static object DateTimeOffset_FromManaged(DateTimeOffset value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return DateTimeOffset.FromManaged(value); } public static object Type_CreateMarshalerArray(global::System.Type[] value) { return Type.CreateMarshalerArray(value); } public static object Exception_CreateMarshalerArray(global::System.Exception[] value) { return MarshalNonBlittable.CreateMarshalerArray(value); } private static void NoOp(object obj) { } } [StructLayout(0, Size = 1)] internal struct Boolean { public static bool CreateMarshaler(bool value) { return value; } public static byte GetAbi(bool value) { return value ? ((byte)1) : ((byte)0); } public static bool FromAbi(byte abi) { return abi != 0; } public unsafe static void CopyAbi(bool value, nint dest) { *(byte*)((global::System.IntPtr)dest).ToPointer() = GetAbi(value); } public static byte FromManaged(bool value) { return GetAbi(value); } public unsafe static void CopyManaged(bool arg, nint dest) { *(byte*)((global::System.IntPtr)dest).ToPointer() = FromManaged(arg); } public static void DisposeMarshaler(bool m) { } public static void DisposeAbi(byte abi) { } } [StructLayout(0, Size = 1)] internal struct Char { public static char CreateMarshaler(char value) { return value; } public static ushort GetAbi(char value) { return value; } public static char FromAbi(ushort abi) { return (char)abi; } public unsafe static void CopyAbi(char value, nint dest) { *(ushort*)((global::System.IntPtr)dest).ToPointer() = GetAbi(value); } public static ushort FromManaged(char value) { return GetAbi(value); } public unsafe static void CopyManaged(char arg, nint dest) { *(ushort*)((global::System.IntPtr)dest).ToPointer() = FromManaged(arg); } public static void DisposeMarshaler(char m) { } public static void DisposeAbi(ushort abi) { } } internal static class EventHandlerMethods { internal unsafe static volatile delegate* _Invoke; private static nint abiToProjectionVftablePtr; internal static nint AbiToProjectionVftablePtr => abiToProjectionVftablePtr; internal static bool TryInitCCWVtable(nint ptr) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) bool flag = Interlocked.CompareExchange(ref abiToProjectionVftablePtr, (global::System.IntPtr)ptr, global::System.IntPtr.Zero) == global::System.IntPtr.Zero; if (flag) { EventHandler.AbiToProjectionVftablePtr = abiToProjectionVftablePtr; ComWrappersSupport.RegisterComInterfaceEntries(typeof(EventHandler), DelegateTypeDetails>.GetExposedInterfaces(new ComInterfaceEntry { IID = EventHandler.PIID, Vtable = abiToProjectionVftablePtr })); } return flag; } } public static class EventHandlerMethods where TAbi : unmanaged { public unsafe static bool InitRcwHelper(delegate* invoke) { if (EventHandlerMethods._Invoke == (delegate*)null) { EventHandlerMethods._Invoke = invoke; } return true; } public unsafe static bool InitCcw(delegate* unmanaged[Stdcall] invoke) { if (EventHandlerMethods.AbiToProjectionVftablePtr != 0) { return false; } nint num = (nint)NativeMemory.AllocZeroed((global::System.UIntPtr)(nuint)(sizeof(IUnknownVftbl) + sizeof(nint))); *(IUnknownVftbl*)num = IUnknownVftbl.AbiToProjectionVftbl; *(global::System.IntPtr*)(num + (nint)3 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)invoke; if (!EventHandlerMethods.TryInitCCWVtable(num)) { NativeMemory.Free((void*)num); return false; } return true; } public static void Abi_Invoke(nint thisPtr, object sender, T args) { EventHandler val = ComWrappersSupport.FindObject>(thisPtr); val.Invoke(sender, args); } } [Guid("9DE1C535-6AE1-11E0-84E1-18A905BCC53F")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public static class EventHandler { private sealed class NativeDelegateWrapper : IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly ObjectReference _nativeDelegate; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; IObjectReference IWinRTObject.NativeObject => _nativeDelegate; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public NativeDelegateWrapper(ObjectReference nativeDelegate) { _nativeDelegate = nativeDelegate; } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public unsafe void Invoke(object sender, T args) { if (!RuntimeFeature.IsDynamicCodeCompiled) { EventHandlerMethods._Invoke(_nativeDelegate, sender, args); return; } if (EventHandlerMethods._Invoke != (delegate*)null) { EventHandlerMethods._Invoke(_nativeDelegate, sender, args); return; } if (Volatile.Read(ref EventHandler._abi_invoke_type) == null) { Interlocked.CompareExchange(ref EventHandler._abi_invoke_type, Projections.GetAbiDelegateType(typeof(void*), typeof(nint), Marshaler.AbiType, typeof(int)), (global::System.Type)null); } nint thisPtr = _nativeDelegate.ThisPtr; global::System.Delegate delegateForFunctionPointer = Marshal.GetDelegateForFunctionPointer((global::System.IntPtr)_nativeDelegate.Vftbl.Invoke, EventHandler._abi_invoke_type); ObjectReferenceValue value = default(ObjectReferenceValue); object obj = null; object[] array = new object[3] { thisPtr, null, null }; try { value = MarshalInspectable.CreateMarshaler2(sender); array[1] = MarshalInspectable.GetAbi(value); obj = Marshaler.CreateMarshaler2.Invoke(args); array[2] = Marshaler.GetAbi.Invoke(obj); delegateForFunctionPointer.DynamicInvokeAbi(array); GC.KeepAlive((object)_nativeDelegate); GC.KeepAlive((object)array); } finally { MarshalInspectable.DisposeMarshaler(value); Marshaler.DisposeMarshaler.Invoke(obj); } } } public static readonly Guid PIID; private static global::System.Type _abi_invoke_type; public static nint AbiToProjectionVftablePtr; public static Guid IID => PIID; public static global::System.Delegate AbiInvokeDelegate { [CompilerGenerated] get; } unsafe static EventHandler() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PIID = GuidGenerator.CreateIIDUnsafe(typeof(EventHandler)); ComWrappersSupport.RegisterHelperType(typeof(EventHandler), typeof(EventHandler)); ComWrappersSupport.RegisterDelegateFactory(typeof(EventHandler), CreateRcw); if (!RuntimeFeature.IsDynamicCodeCompiled) { AbiToProjectionVftablePtr = EventHandlerMethods.AbiToProjectionVftablePtr; return; } if (EventHandlerMethods.AbiToProjectionVftablePtr != 0) { AbiToProjectionVftablePtr = EventHandlerMethods.AbiToProjectionVftablePtr; return; } _abi_invoke_type = Projections.GetAbiDelegateType(typeof(void*), typeof(nint), Marshaler.AbiType, typeof(int)); AbiInvokeDelegate = global::System.Delegate.CreateDelegate(_abi_invoke_type, typeof(EventHandler).GetMethod("Do_Abi_Invoke", (BindingFlags)40).MakeGenericMethod(new global::System.Type[1] { Marshaler.AbiType })); AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(EventHandler), sizeof(IDelegateVftbl)); *(IUnknownVftbl*)AbiToProjectionVftablePtr = IUnknownVftbl.AbiToProjectionVftbl; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)3 * (nint)sizeof(nint)) = Marshal.GetFunctionPointerForDelegate(AbiInvokeDelegate); } public static IObjectReference CreateMarshaler(EventHandler managedDelegate) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (managedDelegate != null) { return MarshalDelegate.CreateMarshaler(managedDelegate, PIID); } return null; } public static ObjectReferenceValue CreateMarshaler2(EventHandler managedDelegate) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalDelegate.CreateMarshaler2(managedDelegate, PIID); } public static nint GetAbi(IObjectReference value) { if (value != null) { return MarshalInterfaceHelper>.GetAbi(value); } return global::System.IntPtr.Zero; } public static EventHandler FromAbi(nint nativeDelegate) { return MarshalDelegate.FromAbi>(nativeDelegate); } public static EventHandler CreateRcw(nint ptr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return new NativeDelegateWrapper(ComWrappersSupport.GetObjectReferenceForInterface(ptr, PIID)).Invoke; } public static nint FromManaged(EventHandler managedDelegate) { return CreateMarshaler2(managedDelegate).Detach(); } public static void DisposeMarshaler(IObjectReference value) { MarshalInterfaceHelper>.DisposeMarshaler(value); } public static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } public static MarshalInterfaceHelper>.MarshalerArray CreateMarshalerArray(EventHandler[] array) { return MarshalInterfaceHelper>.CreateMarshalerArray2(array, (Func, ObjectReferenceValue>)(object)new Func>, ObjectReferenceValue>(CreateMarshaler2)); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper>.GetAbiArray(box); } public static EventHandler[] FromAbiArray(object box) { return MarshalInterfaceHelper>.FromAbiArray(box, (Func>)(object)new Func>(FromAbi)); } public static void CopyAbiArray(EventHandler[] array, object box) { MarshalInterfaceHelper>.CopyAbiArray(array, box, (Func>)(object)new Func>(FromAbi)); } public static ValueTuple FromManagedArray(EventHandler[] array) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper>.FromManagedArray(array, (Func, nint>)(object)new Func>, nint>(FromManaged)); } public static void DisposeMarshalerArray(MarshalInterfaceHelper>.MarshalerArray array) { MarshalInterfaceHelper>.DisposeMarshalerArray(array); } public static void DisposeAbiArray(object box) { MarshalInspectable.DisposeAbiArray(box); } private unsafe static int Do_Abi_Invoke(void* thisPtr, nint sender, TAbi args) { try { EventHandler val = ComWrappersSupport.FindObject>(new global::System.IntPtr(thisPtr)); val.Invoke(MarshalInspectable.FromAbi(sender), ((Func)(object)Marshaler.FromAbi).Invoke((object)args)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } [Guid("c50898f6-c536-5f47-8583-8b2c2438a13b")] internal static class EventHandler { private sealed class NativeDelegateWrapper : IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly ObjectReference _nativeDelegate; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; IObjectReference IWinRTObject.NativeObject => _nativeDelegate; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public NativeDelegateWrapper(ObjectReference nativeDelegate) { _nativeDelegate = nativeDelegate; } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public unsafe void Invoke(object sender, EventArgs args) { nint thisPtr = _nativeDelegate.ThisPtr; delegate* unmanaged[Stdcall] delegate* = (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(void*))); ObjectReferenceValue value = default(ObjectReferenceValue); ObjectReferenceValue value2 = default(ObjectReferenceValue); try { value = MarshalInspectable.CreateMarshaler2(sender); value2 = MarshalInspectable.CreateMarshaler2(args); ExceptionHelpers.ThrowExceptionForHR(delegate*(thisPtr, MarshalInspectable.GetAbi(value), MarshalInspectable.GetAbi(value2))); GC.KeepAlive((object)_nativeDelegate); } finally { MarshalInspectable.DisposeMarshaler(value); MarshalInspectable.DisposeMarshaler(value2); } } } private static readonly IDelegateVftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public static Guid IID => global::WinRT.Interop.IID.IID_EventHandler; unsafe static EventHandler() { AbiToProjectionVftable = new IDelegateVftbl { IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl, Invoke = (nint)(delegate*)(&Do_Abi_Invoke) }; nint num = ComWrappersSupport.AllocateVtableMemory(typeof(EventHandler), sizeof(IDelegateVftbl)); *(IDelegateVftbl*)num = AbiToProjectionVftable; AbiToProjectionVftablePtr = num; ComWrappersSupport.RegisterDelegateFactory(typeof(EventHandler), CreateRcw); } public static IObjectReference CreateMarshaler(EventHandler managedDelegate) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (managedDelegate != null) { return MarshalDelegate.CreateMarshaler(managedDelegate, IID); } return null; } public static ObjectReferenceValue CreateMarshaler2(EventHandler managedDelegate) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalDelegate.CreateMarshaler2(managedDelegate, IID); } public static nint GetAbi(IObjectReference value) { if (value != null) { return MarshalInterfaceHelper>.GetAbi(value); } return global::System.IntPtr.Zero; } public static EventHandler FromAbi(nint nativeDelegate) { return MarshalDelegate.FromAbi(nativeDelegate); } public static EventHandler CreateRcw(nint ptr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return new EventHandler(new NativeDelegateWrapper(ComWrappersSupport.GetObjectReferenceForInterface(ptr, IID)).Invoke); } public static nint FromManaged(EventHandler managedDelegate) { return CreateMarshaler2(managedDelegate).Detach(); } public static void DisposeMarshaler(IObjectReference value) { MarshalInterfaceHelper>.DisposeMarshaler(value); } public static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(EventHandler[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, CreateMarshaler2); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static EventHandler[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, FromAbi); } public static void CopyAbiArray(EventHandler[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, FromAbi); } public static ValueTuple FromManagedArray(EventHandler[] array) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, FromManaged); } public static void DisposeMarshalerArray(MarshalInterfaceHelper.MarshalerArray array) { MarshalInterfaceHelper.DisposeMarshalerArray(array); } public static void DisposeAbiArray(object box) { MarshalInspectable.DisposeAbiArray(box); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_Invoke(nint thisPtr, nint sender, nint args) { try { EventHandler val = ComWrappersSupport.FindObject(thisPtr); ? val2 = val; object obj = MarshalInspectable.FromAbi(sender); object obj2 = MarshalInspectable.FromAbi(args); ((EventHandler)val2).Invoke(obj, (EventArgs)(((obj2 is EventArgs) ? obj2 : null) ?? EventArgs.Empty)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [SkipLocalsInit] internal unsafe static ComInterfaceEntry[] GetExposedInterfaces() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) global::System.Span span = new global::System.Span((void*)stackalloc ComInterfaceEntry[3], 3); global::System.Span span2 = span; int num = 0; span2[num++] = new ComInterfaceEntry { IID = IID, Vtable = AbiToProjectionVftablePtr }; if (FeatureSwitches.EnableIReferenceSupport) { span2[num++] = new ComInterfaceEntry { IID = global::WinRT.Interop.IID.IID_IPropertyValue, Vtable = ManagedIPropertyValueImpl.AbiToProjectionVftablePtr }; span2[num++] = new ComInterfaceEntry { IID = global::WinRT.Interop.IID.IID_NullableEventHandler, Vtable = Nullable_EventHandler.AbiToProjectionVftablePtr }; } return span2.Slice(0, num).ToArray(); } } public static class IDisposableMethods { public static Guid IID => global::WinRT.Interop.IID.IID_IDisposable; public static nint AbiToProjectionVftablePtr => IDisposable.AbiToProjectionVftablePtr; public unsafe static void Dispose(IObjectReference obj) { nint thisPtr = obj.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr)); GC.KeepAlive((object)obj); } } [DynamicInterfaceCastableImplementation] [EditorBrowsable(/*Could not decode attribute arguments.*/)] [Guid("30D5A829-7FA4-4026-83BB-D75BAE4EA99E")] internal interface IDisposable : global::System.IDisposable { static readonly nint AbiToProjectionVftablePtr; unsafe static IDisposable() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IDisposable), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_Close_0); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_Close_0(nint thisPtr) { try { ComWrappersSupport.FindObject(thisPtr).Dispose(); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } void global::System.IDisposable.Dispose() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.IDisposable).TypeHandle); IDisposableMethods.Dispose(objectReferenceForType); } } public static class IServiceProviderMethods { public static Guid IID => global::WinRT.Interop.IID.IID_IServiceProvider; public static nint AbiToProjectionVftablePtr => IServiceProvider.AbiToProjectionVftablePtr; public unsafe static object GetService(IObjectReference obj, global::System.Type type) { Type.Marshaler m = default(Type.Marshaler); nint ptr = 0; try { nint thisPtr = obj.ThisPtr; m = Type.CreateMarshaler(type); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, Type.GetAbi(m), &ptr)); GC.KeepAlive((object)obj); return MarshalInspectable.FromAbi(ptr); } finally { Type.DisposeMarshaler(m); MarshalInspectable.DisposeAbi(ptr); } } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [Guid("68B3A2DF-8173-539F-B524-C8A2348F5AFB")] [DynamicInterfaceCastableImplementation] internal interface IServiceProvider : IServiceProvider { static readonly nint AbiToProjectionVftablePtr; unsafe static IServiceProvider() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IServiceProvider), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_GetService_0); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetService_0(nint thisPtr, Type type, nint* result) { object obj = null; *result = 0; try { obj = ComWrappersSupport.FindObject(thisPtr).GetService(Type.FromAbi(type)); *result = MarshalInspectable.FromManaged(obj); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } object IServiceProvider.GetService(global::System.Type type) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IServiceProvider).TypeHandle); return IServiceProviderMethods.GetService(objectReferenceForType, type); } } internal static class IXamlServiceProvider_Delegates { public unsafe delegate int GetService_0(nint thisPtr, Type type, nint* result); } [Guid("61C17706-2D65-11E0-9AE8-D48564015472")] public class Nullable { [Guid("61C17706-2D65-11E0-9AE8-D48564015472")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public global::System.Delegate get_Value_0; public static readonly Guid PIID = Nullable.PIID; public static global::System.Type get_Value_0_Type; internal unsafe Vftbl(nint thisPtr) { void** ptr = *(void***)thisPtr; nint* ptr2 = (nint*)ptr; IInspectableVftbl = *(IInspectable.Vftbl*)ptr; get_Value_0 = GetValueDelegateForFunctionPointer(ptr2[6]); } internal unsafe static global::System.Delegate GetValueDelegateForFunctionPointer(nint ptr) { //IL_03e0: Unknown result type (might be due to invalid IL or missing references) if (typeof(T) == typeof(int) || typeof(T) == typeof(byte) || typeof(T) == typeof(bool) || typeof(T) == typeof(sbyte) || typeof(T) == typeof(short) || typeof(T) == typeof(ushort) || typeof(T) == typeof(char) || typeof(T) == typeof(uint) || typeof(T) == typeof(long) || typeof(T) == typeof(ulong) || typeof(T) == typeof(float) || typeof(T) == typeof(double) || typeof(T) == typeof(Guid) || typeof(T) == typeof(TimeSpan) || typeof(T) == typeof(global::Windows.Foundation.Point) || typeof(T) == typeof(global::Windows.Foundation.Rect) || typeof(T) == typeof(global::Windows.Foundation.Size) || typeof(T) == typeof(Matrix3x2) || typeof(T) == typeof(Matrix4x4) || typeof(T) == typeof(Plane) || typeof(T) == typeof(Quaternion) || typeof(T) == typeof(Vector2) || typeof(T) == typeof(Vector3) || typeof(T) == typeof(Vector4) || (typeof(T).IsEnum && global::System.Enum.GetUnderlyingType(typeof(T)) == typeof(int)) || (typeof(T).IsEnum && global::System.Enum.GetUnderlyingType(typeof(T)) == typeof(uint))) { return Marshal.GetDelegateForFunctionPointer((global::System.IntPtr)ptr); } if (typeof(T) == typeof(DateTimeOffset)) { return Marshal.GetDelegateForFunctionPointer((global::System.IntPtr)ptr); } if (RuntimeFeature.IsDynamicCodeCompiled) { if (get_Value_0_Type == null) { get_Value_0_Type = Projections.GetAbiDelegateType(typeof(void*), Marshaler.AbiType.MakeByRefType(), typeof(int)); } return Marshal.GetDelegateForFunctionPointer((global::System.IntPtr)ptr, get_Value_0_Type); } throw new NotSupportedException($"Failed to get the marshalling delegate for Nullable`1 with type '{typeof(T)}'."); } } public static readonly Guid PIID = NullableType.GetIID(); protected readonly ObjectReference _obj; public nint ThisPtr => _obj.ThisPtr; public T Value { get { T valueFromAbi = GetValueFromAbi(ThisPtr, _obj.Vftbl.get_Value_0); GC.KeepAlive((object)this); return valueFromAbi; } } public static IObjectReference CreateMarshaler(object value) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (value != null) { return ComWrappersSupport.CreateCCWForObject(value, PIID); } return null; } public static ObjectReferenceValue CreateMarshaler2(object value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ComWrappersSupport.CreateCCWForObjectForMarshaling(value, PIID); } public static nint GetAbi(IObjectReference m) { return m?.ThisPtr ?? global::System.IntPtr.Zero; } public static object FromAbi(nint ptr) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (ptr == (nint)global::System.IntPtr.Zero) { return null; } Vftbl vftblT = new Vftbl(ptr); Nullable nullable = new Nullable(ObjectReference.FromAbi(ptr, vftblT, PIID)); return nullable.Value; } public unsafe static void CopyManaged(object o, nint dest) { *(nint*)((global::System.IntPtr)dest).ToPointer() = CreateMarshaler2(o).Detach(); } public static nint FromManaged(object value) { if (value == null) { return global::System.IntPtr.Zero; } return CreateMarshaler2(value).Detach(); } public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); } public static void DisposeAbi(nint abi) { MarshalInspectable.DisposeAbi(abi); } public static string GetGuidSignature() { return CreateGuidSignature(); } private static string CreateGuidSignature() { if (typeof(T) == typeof(int)) { return Nullable_int.GetGuidSignature(); } if (typeof(T) == typeof(byte)) { return Nullable_byte.GetGuidSignature(); } if (typeof(T) == typeof(bool)) { return Nullable_bool.GetGuidSignature(); } if (typeof(T) == typeof(sbyte)) { return Nullable_sbyte.GetGuidSignature(); } if (typeof(T) == typeof(short)) { return Nullable_short.GetGuidSignature(); } if (typeof(T) == typeof(ushort)) { return Nullable_ushort.GetGuidSignature(); } if (typeof(T) == typeof(char)) { return Nullable_char.GetGuidSignature(); } if (typeof(T) == typeof(uint)) { return Nullable_uint.GetGuidSignature(); } if (typeof(T) == typeof(long)) { return Nullable_long.GetGuidSignature(); } if (typeof(T) == typeof(ulong)) { return Nullable_ulong.GetGuidSignature(); } if (typeof(T) == typeof(float)) { return Nullable_float.GetGuidSignature(); } if (typeof(T) == typeof(double)) { return Nullable_double.GetGuidSignature(); } if (typeof(T) == typeof(Guid)) { return Nullable_guid.GetGuidSignature(); } if (typeof(T) == typeof(global::System.Type)) { return Nullable_Type.GetGuidSignature(); } if (typeof(T) == typeof(TimeSpan)) { return Nullable_TimeSpan.GetGuidSignature(); } if (typeof(T) == typeof(DateTimeOffset)) { return Nullable_DateTimeOffset.GetGuidSignature(); } if (typeof(T) == typeof(global::Windows.Foundation.Point)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Point;f4;f4))"; } if (typeof(T) == typeof(global::Windows.Foundation.Size)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Size;f4;f4))"; } if (typeof(T) == typeof(global::Windows.Foundation.Rect)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Rect;f4;f4;f4;f4))"; } if (typeof(T) == typeof(Matrix3x2)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Matrix3x2;f4;f4;f4;f4;f4;f4))"; } if (typeof(T) == typeof(Matrix4x4)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Matrix4x4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4))"; } if (typeof(T) == typeof(Plane)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Plane;struct(Windows.Foundation.Numerics.Vector3;f4;f4;f4);f4))"; } if (typeof(T) == typeof(Quaternion)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Quaternion;f4;f4;f4;f4))"; } if (typeof(T) == typeof(Vector2)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Vector2;f4;f4))"; } if (typeof(T) == typeof(Vector3)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Vector3;f4;f4;f4))"; } if (typeof(T) == typeof(Vector4)) { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Vector4;f4;f4;f4;f4))"; } return GuidGenerator.GetSignature(typeof(Nullable)); } public Nullable(IObjectReference obj) : this(obj.As(Vftbl.PIID)) { }//IL_0002: Unknown result type (might be due to invalid IL or missing references) public Nullable(ObjectReference obj) { _obj = obj; } public unsafe static T GetValue(IInspectable inspectable) { nint zero = global::System.IntPtr.Zero; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref PIID), ref zero)); global::System.Delegate valueDelegateForFunctionPointer = Vftbl.GetValueDelegateForFunctionPointer(*(nint*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(nint))); return GetValueFromAbi(zero, valueDelegateForFunctionPointer); } finally { MarshalExtensions.ReleaseIfNotNull(zero); } } private unsafe static T GetValueFromAbi(nint thisPtr, global::System.Delegate marshallingDelegate) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if (((object)marshallingDelegate).GetType() == typeof(Nullable_Delegates.GetValueDelegateAbi)) { T result = default(T); Marshal.ThrowExceptionForHR(((Nullable_Delegates.GetValueDelegateAbi)marshallingDelegate)((void*)thisPtr, &result)); return result; } if (((object)marshallingDelegate).GetType() == typeof(Nullable_Delegates.GetValueDelegateAbiDateTimeOffset)) { DateTimeOffset value = default(DateTimeOffset); Marshal.ThrowExceptionForHR(((Nullable_Delegates.GetValueDelegateAbiDateTimeOffset)marshallingDelegate)((void*)thisPtr, &value)); DateTimeOffset val = DateTimeOffset.FromAbi(value); return global::System.Runtime.CompilerServices.Unsafe.As(ref val); } if (RuntimeFeature.IsDynamicCodeCompiled) { object[] array = new object[2] { thisPtr, null }; try { marshallingDelegate.DynamicInvokeAbi(array); return ((Func)(object)Marshaler.FromAbi).Invoke(array[1]); } finally { Marshaler.DisposeAbi.Invoke(array[1]); } } throw new NotSupportedException($"Cannot retrieve the value for the current Nullable`1 instance with type '{typeof(T)}'."); } } internal sealed class Nullable { [field: CompilerGenerated] public object Value { [CompilerGenerated] get; } public Nullable(object boxedObject) { Value = boxedObject; } } [Guid("548cefbd-bc8a-5fa0-8df2-957440fc8bf4")] internal static class Nullable_int { [Guid("548cefbd-bc8a-5fa0-8df2-957440fc8bf4")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, int* __return_value__) { int num = 0; *__return_value__ = 0; try { num = (int)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};i4)"; } } [Guid("fd416dfb-2a07-52eb-aae3-dfce14116c05")] internal static class Nullable_string { [Guid("fd416dfb-2a07-52eb-aae3-dfce14116c05")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, nint* __return_value__) { string text = null; *__return_value__ = 0; try { text = (string)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = MarshalString.FromManaged(text); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};string)"; } public unsafe static Nullable GetValue(IInspectable inspectable) { nint zero = global::System.IntPtr.Zero; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_NullableString), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num)); return new Nullable(MarshalString.FromAbi(num)); } finally { MarshalString.DisposeAbi(num); MarshalExtensions.ReleaseIfNotNull(zero); } } } [Guid("e5198cc8-2873-55f5-b0a1-84ff9e4aad62")] internal static class Nullable_byte { [Guid("e5198cc8-2873-55f5-b0a1-84ff9e4aad62")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, byte* __return_value__) { byte b = 0; *__return_value__ = 0; try { b = (byte)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = b; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};u1)"; } } [Guid("95500129-fbf6-5afc-89df-70642d741990")] internal static class Nullable_sbyte { [Guid("95500129-fbf6-5afc-89df-70642d741990")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, sbyte* __return_value__) { sbyte b = 0; *__return_value__ = 0; try { b = (sbyte)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = b; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};i1)"; } } [Guid("6ec9e41b-6709-5647-9918-a1270110fc4e")] internal static class Nullable_short { [Guid("6ec9e41b-6709-5647-9918-a1270110fc4e")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, short* __return_value__) { short num = 0; *__return_value__ = 0; try { num = (short)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};i2)"; } } [Guid("5ab7d2c3-6b62-5e71-a4b6-2d49c4f238fd")] internal static class Nullable_ushort { [Guid("5ab7d2c3-6b62-5e71-a4b6-2d49c4f238fd")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, ushort* __return_value__) { ushort num = 0; *__return_value__ = 0; try { num = (ushort)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};u2)"; } } [Guid("513ef3af-e784-5325-a91e-97c2b8111cf3")] internal static class Nullable_uint { [Guid("513ef3af-e784-5325-a91e-97c2b8111cf3")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, uint* __return_value__) { uint num = 0u; *__return_value__ = 0u; try { num = (uint)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};u4)"; } } [Guid("4dda9e24-e69f-5c6a-a0a6-93427365af2a")] internal static class Nullable_long { [Guid("4dda9e24-e69f-5c6a-a0a6-93427365af2a")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, long* __return_value__) { long num = 0L; *__return_value__ = 0L; try { num = (long)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};i8)"; } } [Guid("6755e376-53bb-568b-a11d-17239868309e")] internal static class Nullable_ulong { [Guid("6755e376-53bb-568b-a11d-17239868309e")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, ulong* __return_value__) { ulong num = 0uL; *__return_value__ = 0uL; try { num = (ulong)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};u8)"; } } [Guid("719cc2ba-3e76-5def-9f1a-38d85a145ea8")] internal static class Nullable_float { [Guid("719cc2ba-3e76-5def-9f1a-38d85a145ea8")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, float* __return_value__) { float num = 0f; *__return_value__ = 0f; try { num = (float)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};f4)"; } } [Guid("2f2d6c29-5473-5f3e-92e7-96572bb990e2")] internal static class Nullable_double { [Guid("2f2d6c29-5473-5f3e-92e7-96572bb990e2")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, double* __return_value__) { double num = 0.0; *__return_value__ = 0.0; try { num = (double)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};f8)"; } } [Guid("fb393ef3-bbac-5bd5-9144-84f23576f415")] internal static class Nullable_char { [Guid("fb393ef3-bbac-5bd5-9144-84f23576f415")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, char* __return_value__) { char c = '\0'; *__return_value__ = '\0'; try { c = (char)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = c; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};c2)"; } } [Guid("3c00fd60-2950-5939-a21a-2d12c5a01b8a")] internal static class Nullable_bool { [Guid("3c00fd60-2950-5939-a21a-2d12c5a01b8a")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, bool* __return_value__) { bool flag = false; *__return_value__ = false; try { flag = (bool)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = flag; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};b1)"; } } [Guid("7d50f649-632c-51f9-849a-ee49428933ea")] internal static class Nullable_guid { [Guid("7d50f649-632c-51f9-849a-ee49428933ea")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, Guid* __return_value__) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) Guid val = default(Guid); global::System.Runtime.CompilerServices.Unsafe.Write(__return_value__, default(Guid)); try { val = (Guid)ComWrappersSupport.FindObject(thisPtr); global::System.Runtime.CompilerServices.Unsafe.Write(__return_value__, val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};g16)"; } } [Guid("5541d8a7-497c-5aa4-86fc-7713adbf2a2c")] internal static class Nullable_DateTimeOffset { [Guid("5541d8a7-497c-5aa4-86fc-7713adbf2a2c")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, DateTimeOffset* __return_value__) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) DateTimeOffset val = default(DateTimeOffset); *__return_value__ = default(DateTimeOffset); try { val = (DateTimeOffset)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = DateTimeOffset.FromManaged(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.DateTime;i8))"; } public unsafe static object GetValue(IInspectable inspectable) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) nint zero = global::System.IntPtr.Zero; DateTimeOffset dateTimeOffset = default(DateTimeOffset); try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_NullableDateTimeOffset), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &dateTimeOffset)); return DateTimeOffset.FromAbi(dateTimeOffset); } finally { DateTimeOffset.DisposeAbi(dateTimeOffset); MarshalExtensions.ReleaseIfNotNull(zero); } } } [Guid("604d0c4c-91de-5c2a-935f-362f13eaf800")] internal static class Nullable_TimeSpan { [Guid("604d0c4c-91de-5c2a-935f-362f13eaf800")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, TimeSpan* __return_value__) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) TimeSpan val = default(TimeSpan); *__return_value__ = default(TimeSpan); try { val = (TimeSpan)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = TimeSpan.FromManaged(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.TimeSpan;i8))"; } public unsafe static object GetValue(IInspectable inspectable) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) nint zero = global::System.IntPtr.Zero; TimeSpan timeSpan = default(TimeSpan); try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_NullableTimeSpan), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &timeSpan)); return TimeSpan.FromAbi(timeSpan); } finally { TimeSpan.DisposeAbi(timeSpan); MarshalExtensions.ReleaseIfNotNull(zero); } } } [Guid("06dccc90-a058-5c88-87b7-6f3360a2fc16")] internal static class Nullable_Object { [Guid("06dccc90-a058-5c88-87b7-6f3360a2fc16")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, nint* __return_value__) { object obj = null; *__return_value__ = 0; try { obj = ComWrappersSupport.FindObject(thisPtr); *__return_value__ = MarshalInspectable.FromManaged(obj); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};cinterface(IInspectable))"; } } [Guid("3830ad99-d8da-53f3-989b-fc92ad222778")] internal static class Nullable_Type { [Guid("3830ad99-d8da-53f3-989b-fc92ad222778")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, Type* __return_value__) { global::System.Type type = null; *__return_value__ = default(Type); try { type = (global::System.Type)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = Type.FromManaged(type); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.UI.Xaml.Interop.TypeName;string;enum(Windows.UI.Xaml.Interop.TypeKind;i4)))"; } public unsafe static Nullable GetValue(IInspectable inspectable) { nint zero = global::System.IntPtr.Zero; Type type = default(Type); try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_NullableType), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &type)); return new Nullable(Type.FromAbi(type)); } finally { Type.DisposeAbi(type); MarshalExtensions.ReleaseIfNotNull(zero); } } } [Guid("6ff27a1e-4b6a-59b7-b2c3-d1f2ee474593")] internal static class Nullable_Exception { [Guid("6ff27a1e-4b6a-59b7-b2c3-d1f2ee474593")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _Get_Value_0; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] Get_Value_0 { get { return (delegate* unmanaged[Stdcall])_Get_Value_0; } set { _Get_Value_0 = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _Get_Value_0 = (delegate*)(&Do_Abi_get_Value_0) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, Exception* __return_value__) { global::System.Exception ex = null; *__return_value__ = default(Exception); try { ex = (global::System.Exception)ComWrappersSupport.FindObject(thisPtr); *__return_value__ = Exception.FromManaged(ex); } catch (global::System.Exception ex2) { ExceptionHelpers.SetErrorInfo(ex2); return ExceptionHelpers.GetHRForException(ex2); } return 0; } } public static string GetGuidSignature() { return "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.HResult;i4))"; } public unsafe static Nullable GetValue(IInspectable inspectable) { nint zero = global::System.IntPtr.Zero; Exception ex = default(Exception); try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref IID.IID_NullableException, ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &ex)); return new Nullable(Exception.FromAbi(ex)); } finally { Exception.DisposeAbi(ex); MarshalExtensions.ReleaseIfNotNull(zero); } } } [Guid("25230F05-B49C-57EE-8961-5373D98E1AB1")] internal static class Nullable_EventHandler { public static readonly nint AbiToProjectionVftablePtr; unsafe static Nullable_EventHandler() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Nullable_EventHandler), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_Value_0); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, nint* __return_value__) { EventHandler val = null; *__return_value__ = 0; try { val = ComWrappersSupport.FindObject(thisPtr); *__return_value__ = EventHandler.FromManaged(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } public unsafe static Nullable GetValue(IInspectable inspectable) { nint zero = global::System.IntPtr.Zero; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_NullableEventHandler), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num)); return new Nullable(EventHandler.FromAbi(num)); } finally { EventHandler.DisposeAbi(num); MarshalExtensions.ReleaseIfNotNull(zero); } } } [Guid("1eeae0cb-8f57-5c37-a087-a55d46e2fe3f")] internal static class Nullable_PropertyChangedEventHandler { public static readonly nint AbiToProjectionVftablePtr; public static Guid IID { get { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.UseWindowsUIXamlProjections) { return global::WinRT.Interop.IID.IID_MUX_NullablePropertyChangedEventHandler; } return global::WinRT.Interop.IID.IID_WUX_NullablePropertyChangedEventHandler; } } unsafe static Nullable_PropertyChangedEventHandler() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Nullable_PropertyChangedEventHandler), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_Value_0); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, nint* __return_value__) { PropertyChangedEventHandler val = null; *__return_value__ = 0; try { val = ComWrappersSupport.FindObject(thisPtr); *__return_value__ = PropertyChangedEventHandler.FromManaged(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } public unsafe static Nullable GetValue(IInspectable inspectable) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Guid iID = IID; nint zero = global::System.IntPtr.Zero; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref iID), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num)); return new Nullable(PropertyChangedEventHandler.FromAbi(num)); } finally { PropertyChangedEventHandler.DisposeAbi(num); MarshalExtensions.ReleaseIfNotNull(zero); } } } [Guid("779d5a21-0e7d-5476-bb90-27fa3b4b8de5")] internal static class Nullable_NotifyCollectionChangedEventHandler { public static readonly nint AbiToProjectionVftablePtr; public static Guid IID { get { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.UseWindowsUIXamlProjections) { return global::WinRT.Interop.IID.IID_MUX_NotifyCollectionChangedEventHandler; } return global::WinRT.Interop.IID.IID_WUX_NotifyCollectionChangedEventHandler; } } unsafe static Nullable_NotifyCollectionChangedEventHandler() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Nullable_NotifyCollectionChangedEventHandler), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_Value_0); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, nint* __return_value__) { NotifyCollectionChangedEventHandler val = null; *__return_value__ = 0; try { val = ComWrappersSupport.FindObject(thisPtr); *__return_value__ = NotifyCollectionChangedEventHandler.FromManaged(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } public unsafe static Nullable GetValue(IInspectable inspectable) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Guid iID = IID; nint zero = global::System.IntPtr.Zero; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref iID), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num)); return new Nullable(NotifyCollectionChangedEventHandler.FromAbi(num)); } finally { NotifyCollectionChangedEventHandler.DisposeAbi(num); MarshalExtensions.ReleaseIfNotNull(zero); } } } [Guid("61C17706-2D65-11E0-9AE8-D48564015472")] internal static class Nullable_Delegate where T : global::System.Delegate { public static readonly nint AbiToProjectionVftablePtr; private static readonly Nullable_Delegates.GetValueDelegate _Get_Value_0; public static readonly Guid PIID; public static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(Nullable)); } unsafe static Nullable_Delegate() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) PIID = Nullable.PIID; _Get_Value_0 = Do_Abi_get_Value_0; AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Nullable_Delegate), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(nint)) = Marshal.GetFunctionPointerForDelegate(_Get_Value_0); } private unsafe static int Do_Abi_get_Value_0(nint thisPtr, nint* __return_value__) { T val = null; *__return_value__ = 0; try { val = ComWrappersSupport.FindObject(thisPtr); *__return_value__ = (nint)Marshaler.FromManaged.Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } public unsafe static Nullable GetValue(IInspectable inspectable) { nint zero = global::System.IntPtr.Zero; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref PIID, ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num)); return new Nullable(((Func)(object)Marshaler.FromAbi).Invoke((object)num)); } finally { Marshaler.DisposeAbi.Invoke((object)num); MarshalExtensions.ReleaseIfNotNull(zero); } } } internal static class Nullable_IntEnum { public static readonly nint AbiToProjectionVftablePtr; unsafe static Nullable_IntEnum() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Nullable_IntEnum), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_Value_0); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, int* __return_value__) { *__return_value__ = 0; try { *__return_value__ = (int)ComWrappersSupport.FindObject(thisPtr); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } internal static Guid GetIID(global::System.Type enumType) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) return GuidGenerator.CreateIIDForGenericType("pinterface({61c17706-2d65-11e0-9ae8-d48564015472};enum(" + enumType.FullName + ";i4))"); } internal unsafe static object GetValue(global::System.Type enumType, IInspectable inspectable) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Guid iID = GetIID(enumType); nint zero = global::System.IntPtr.Zero; try { int num = 0; ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref iID), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num)); return global::System.Enum.ToObject(enumType, num); } finally { MarshalExtensions.ReleaseIfNotNull(zero); } } } internal static class Nullable_FlagsEnum { public static readonly nint AbiToProjectionVftablePtr; unsafe static Nullable_FlagsEnum() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Nullable_FlagsEnum), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_Value_0); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_Value_0(nint thisPtr, uint* __return_value__) { *__return_value__ = 0u; try { *__return_value__ = (uint)ComWrappersSupport.FindObject(thisPtr); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } internal static Guid GetIID(global::System.Type enumType) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) return GuidGenerator.CreateIIDForGenericType("pinterface({61c17706-2d65-11e0-9ae8-d48564015472};enum(" + enumType.FullName + ";u4))"); } internal unsafe static object GetValue(global::System.Type enumType, IInspectable inspectable) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Guid iID = GetIID(enumType); nint zero = global::System.IntPtr.Zero; try { uint num = 0u; ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref iID), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num)); return global::System.Enum.ToObject(enumType, num); } finally { MarshalExtensions.ReleaseIfNotNull(zero); } } } internal static class Nullable_Delegates { public unsafe delegate int GetValueDelegate(nint thisPtr, nint* value); public unsafe delegate int GetValueDelegateAbi(void* thisPtr, void* value); public unsafe delegate int GetValueDelegateAbiDateTimeOffset(void* ptr, DateTimeOffset* result); } internal static class NullableBlittable where T : unmanaged { private static readonly Guid IID = NullableType.GetIID(); public unsafe static object GetValue(IInspectable inspectable) { nint zero = global::System.IntPtr.Zero; try { T val = default(T); ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)inspectable.ThisPtr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref IID), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &val)); return val; } finally { MarshalExtensions.ReleaseIfNotNull(zero); } } } internal static class NullableType { internal static Guid GetIID() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) if (typeof(T) == typeof(int)) { return IID.IID_NullableInt; } if (typeof(T) == typeof(byte)) { return IID.IID_NullableByte; } if (typeof(T) == typeof(bool)) { return IID.IID_NullableBool; } if (typeof(T) == typeof(sbyte)) { return IID.IID_NullableSByte; } if (typeof(T) == typeof(short)) { return IID.IID_NullableShort; } if (typeof(T) == typeof(ushort)) { return IID.IID_NullableUShort; } if (typeof(T) == typeof(char)) { return IID.IID_NullableChar; } if (typeof(T) == typeof(uint)) { return IID.IID_NullableUInt; } if (typeof(T) == typeof(long)) { return IID.IID_NullableLong; } if (typeof(T) == typeof(ulong)) { return IID.IID_NullableULong; } if (typeof(T) == typeof(float)) { return IID.IID_NullableFloat; } if (typeof(T) == typeof(double)) { return IID.IID_NullableDouble; } if (typeof(T) == typeof(Guid)) { return IID.IID_NullableGuid; } if (typeof(T) == typeof(global::System.Type)) { return IID.IID_NullableType; } if (typeof(T) == typeof(TimeSpan)) { return IID.IID_NullableTimeSpan; } if (typeof(T) == typeof(DateTimeOffset)) { return IID.IID_NullableDateTimeOffset; } if (typeof(T) == typeof(global::Windows.Foundation.Point)) { return IID.IID_IReferenceOfPoint; } if (typeof(T) == typeof(global::Windows.Foundation.Size)) { return IID.IID_IReferenceOfSize; } if (typeof(T) == typeof(global::Windows.Foundation.Rect)) { return IID.IID_IReferenceOfRect; } if (typeof(T) == typeof(Matrix3x2)) { return IID.IID_IReferenceMatrix3x2; } if (typeof(T) == typeof(Matrix4x4)) { return IID.IID_IReferenceMatrix4x4; } if (typeof(T) == typeof(Plane)) { return IID.IID_IReferencePlane; } if (typeof(T) == typeof(Quaternion)) { return IID.IID_IReferenceQuaternion; } if (typeof(T) == typeof(Vector2)) { return IID.IID_IReferenceVector2; } if (typeof(T) == typeof(Vector3)) { return IID.IID_IReferenceVector3; } if (typeof(T) == typeof(Vector4)) { return IID.IID_IReferenceVector4; } return GuidGenerator.CreateIIDUnsafe(typeof(Nullable)); } public static Func GetValueFactory(global::System.Type type) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableIReferenceSupport) { throw new NotSupportedException("Support for 'IReference' is not enabled."); } return ComWrappersSupport.CreateReferenceCachingFactory(GetValueFactoryInternal(type)); } private static Func GetValueFactoryInternal(global::System.Type type) { //IL_0743: Unknown result type (might be due to invalid IL or missing references) if (type == typeof(string)) { return Nullable_string.GetValue; } if (type == typeof(int)) { return NullableBlittable.GetValue; } if (type == typeof(byte)) { return NullableBlittable.GetValue; } if (type == typeof(bool)) { return NullableBlittable.GetValue; } if (type == typeof(sbyte)) { return NullableBlittable.GetValue; } if (type == typeof(short)) { return NullableBlittable.GetValue; } if (type == typeof(ushort)) { return NullableBlittable.GetValue; } if (type == typeof(char)) { return NullableBlittable.GetValue; } if (type == typeof(uint)) { return NullableBlittable.GetValue; } if (type == typeof(long)) { return NullableBlittable.GetValue; } if (type == typeof(ulong)) { return NullableBlittable.GetValue; } if (type == typeof(float)) { return NullableBlittable.GetValue; } if (type == typeof(double)) { return NullableBlittable.GetValue; } if (type == typeof(Guid)) { return NullableBlittable.GetValue; } if (type == typeof(global::System.Type)) { return Nullable_Type.GetValue; } if (type == typeof(TimeSpan)) { return Nullable_TimeSpan.GetValue; } if (type == typeof(global::System.Exception)) { return Nullable_Exception.GetValue; } if (type == typeof(DateTimeOffset)) { return Nullable_DateTimeOffset.GetValue; } if (type == typeof(global::Windows.Foundation.Point)) { return NullableBlittable.GetValue; } if (type == typeof(global::Windows.Foundation.Size)) { return NullableBlittable.GetValue; } if (type == typeof(global::Windows.Foundation.Rect)) { return NullableBlittable.GetValue; } if (type == typeof(Matrix3x2)) { return NullableBlittable.GetValue; } if (type == typeof(Matrix4x4)) { return NullableBlittable.GetValue; } if (type == typeof(Plane)) { return NullableBlittable.GetValue; } if (type == typeof(Quaternion)) { return NullableBlittable.GetValue; } if (type == typeof(Vector2)) { return NullableBlittable.GetValue; } if (type == typeof(Vector3)) { return NullableBlittable.GetValue; } if (type == typeof(Vector4)) { return NullableBlittable.GetValue; } if (type == typeof(EventHandler)) { return Nullable_EventHandler.GetValue; } if (type == typeof(PropertyChangedEventHandler)) { return Nullable_PropertyChangedEventHandler.GetValue; } if (type == typeof(NotifyCollectionChangedEventHandler)) { return Nullable_NotifyCollectionChangedEventHandler.GetValue; } if (type.IsEnum && global::System.Enum.GetUnderlyingType(type) == typeof(int)) { return (IInspectable inspectable) => Nullable_IntEnum.GetValue(type, inspectable); } if (type.IsEnum && global::System.Enum.GetUnderlyingType(type) == typeof(uint)) { return (IInspectable inspectable) => Nullable_FlagsEnum.GetValue(type, inspectable); } WinRTExposedTypeAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)type, false); if (customAttribute == null) { global::System.Type authoringMetadataType = type.GetAuthoringMetadataType(); if (authoringMetadataType != (global::System.Type)null) { customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)authoringMetadataType, false); } } if (customAttribute != null && customAttribute.WinRTExposedTypeDetails != (global::System.Type)null && Activator.CreateInstance(customAttribute.WinRTExposedTypeDetails) is IWinRTNullableTypeDetails winRTNullableTypeDetails) { return winRTNullableTypeDetails.GetNullableValue; } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Failed to get the value from nullable with type '{type}'."); } if (type.IsDelegate()) { return ComWrappersSupport.CreateAbiNullableTFactory(typeof(Nullable_Delegate<>).MakeGenericType(new global::System.Type[1] { type })); } return ComWrappersSupport.CreateNullableTFactory(typeof(global::System.Nullable<>).MakeGenericType(new global::System.Type[1] { type })); } public static global::System.Type GetTypeAsNullableType(global::System.Type type) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableIReferenceSupport) { throw new NotSupportedException("Support for 'IReference' is not enabled."); } if (type == typeof(int)) { return typeof(int?); } if (type == typeof(byte)) { return typeof(byte?); } if (type == typeof(bool)) { return typeof(bool?); } if (type == typeof(sbyte)) { return typeof(sbyte?); } if (type == typeof(short)) { return typeof(short?); } if (type == typeof(ushort)) { return typeof(ushort?); } if (type == typeof(char)) { return typeof(char?); } if (type == typeof(uint)) { return typeof(uint?); } if (type == typeof(long)) { return typeof(long?); } if (type == typeof(ulong)) { return typeof(ulong?); } if (type == typeof(float)) { return typeof(float?); } if (type == typeof(double)) { return typeof(double?); } if (type == typeof(Guid)) { return typeof(Guid?); } if (type == typeof(TimeSpan)) { return typeof(TimeSpan?); } if (type == typeof(DateTimeOffset)) { return typeof(DateTimeOffset?); } if (type == typeof(global::Windows.Foundation.Point)) { return typeof(global::Windows.Foundation.Point?); } if (type == typeof(global::Windows.Foundation.Size)) { return typeof(global::Windows.Foundation.Size?); } if (type == typeof(global::Windows.Foundation.Rect)) { return typeof(global::Windows.Foundation.Rect?); } if (type == typeof(Matrix3x2)) { return typeof(Matrix3x2?); } if (type == typeof(Matrix4x4)) { return typeof(Matrix4x4?); } if (type == typeof(Plane)) { return typeof(Plane?); } if (type == typeof(Quaternion)) { return typeof(Quaternion?); } if (type == typeof(Vector2)) { return typeof(Vector2?); } if (type == typeof(Vector3)) { return typeof(Vector3?); } if (type == typeof(Vector4)) { return typeof(Vector4?); } WinRTExposedTypeAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)type, false); if (customAttribute == null) { global::System.Type authoringMetadataType = type.GetAuthoringMetadataType(); if (authoringMetadataType != (global::System.Type)null) { customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)authoringMetadataType, false); } } if (customAttribute != null && customAttribute.WinRTExposedTypeDetails != (global::System.Type)null && Activator.CreateInstance(customAttribute.WinRTExposedTypeDetails) is IWinRTNullableTypeDetails winRTNullableTypeDetails) { return winRTNullableTypeDetails.GetNullableType(); } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Failed to construct nullable with type '{type}'."); } return null; } } internal static class IReferenceSignatures { public const string Point = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Point;f4;f4))"; public const string Size = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Size;f4;f4))"; public const string Rect = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Rect;f4;f4;f4;f4))"; public const string Matrix3x2 = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Matrix3x2;f4;f4;f4;f4;f4;f4))"; public const string Matrix4x4 = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Matrix4x4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4))"; public const string Plane = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Plane;struct(Windows.Foundation.Numerics.Vector3;f4;f4;f4);f4))"; public const string Quaternion = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Quaternion;f4;f4;f4;f4))"; public const string Vector2 = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Vector2;f4;f4))"; public const string Vector3 = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Vector3;f4;f4;f4))"; public const string Vector4 = "pinterface({61c17706-2d65-11e0-9ae8-d48564015472};struct(Windows.Foundation.Numerics.Vector4;f4;f4;f4;f4))"; } public struct TimeSpan { public struct Marshaler { public TimeSpan __abi; } public long Duration; public static Marshaler CreateMarshaler(TimeSpan value) { Marshaler result = default(Marshaler); result.__abi = new TimeSpan { Duration = ((TimeSpan)(ref value)).Ticks }; return result; } public static TimeSpan GetAbi(Marshaler m) { return m.__abi; } public static TimeSpan FromAbi(TimeSpan value) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return TimeSpan.FromTicks(value.Duration); } public unsafe static void CopyAbi(Marshaler arg, nint dest) { *(TimeSpan*)((global::System.IntPtr)dest).ToPointer() = GetAbi(arg); } public static TimeSpan FromManaged(TimeSpan value) { TimeSpan result = default(TimeSpan); result.Duration = ((TimeSpan)(ref value)).Ticks; return result; } public unsafe static void CopyManaged(TimeSpan arg, nint dest) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) *(TimeSpan*)((global::System.IntPtr)dest).ToPointer() = FromManaged(arg); } public static void DisposeMarshaler(Marshaler m) { } public static void DisposeAbi(TimeSpan abi) { } public static string GetGuidSignature() { return "struct(Windows.Foundation.TimeSpan;i8)"; } } public struct DateTimeOffset { public struct Marshaler { public DateTimeOffset __abi; } public long UniversalTime; private const long ManagedUtcTicksAtNativeZero = 504911232000000000L; public static Marshaler CreateMarshaler(DateTimeOffset value) { Marshaler result = default(Marshaler); result.__abi = new DateTimeOffset { UniversalTime = ((DateTimeOffset)(ref value)).UtcTicks - 504911232000000000L }; return result; } public static DateTimeOffset GetAbi(Marshaler m) { return m.__abi; } public static DateTimeOffset FromAbi(DateTimeOffset value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) DateTimeOffset val = default(DateTimeOffset); ((DateTimeOffset)(ref val))..ctor(value.UniversalTime + 504911232000000000L, TimeSpan.Zero); TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(val); long num = ((DateTimeOffset)(ref val)).Ticks + ((TimeSpan)(ref utcOffset)).Ticks; if (num < global::System.DateTime.MinValue.Ticks || num > global::System.DateTime.MaxValue.Ticks) { throw new ArgumentOutOfRangeException(); } return ((DateTimeOffset)(ref val)).ToLocalTime(); } public unsafe static void CopyAbi(Marshaler arg, nint dest) { *(DateTimeOffset*)((global::System.IntPtr)dest).ToPointer() = GetAbi(arg); } public static DateTimeOffset FromManaged(DateTimeOffset value) { DateTimeOffset result = default(DateTimeOffset); result.UniversalTime = ((DateTimeOffset)(ref value)).UtcTicks - 504911232000000000L; return result; } public unsafe static void CopyManaged(DateTimeOffset arg, nint dest) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) *(DateTimeOffset*)((global::System.IntPtr)dest).ToPointer() = FromManaged(arg); } public static void DisposeMarshaler(Marshaler m) { } public static void DisposeAbi(DateTimeOffset abi) { } public static string GetGuidSignature() { return "struct(Windows.Foundation.DateTime;i8)"; } } public struct Exception { public struct Marshaler { public Exception __abi; } public int hr; public static Marshaler CreateMarshaler(global::System.Exception value) { Marshaler result = default(Marshaler); result.__abi = new Exception { hr = ((value != null) ? ExceptionHelpers.GetHRForException(value) : 0) }; return result; } public static Exception GetAbi(Marshaler m) { return m.__abi; } public static global::System.Exception FromAbi(Exception value) { return ExceptionHelpers.GetExceptionForHR(value.hr); } public unsafe static void CopyAbi(Marshaler arg, nint dest) { *(Exception*)((global::System.IntPtr)dest).ToPointer() = GetAbi(arg); } public static Exception FromManaged(global::System.Exception value) { Exception result = default(Exception); result.hr = ((value != null) ? ExceptionHelpers.GetHRForException(value) : 0); return result; } public unsafe static void CopyManaged(global::System.Exception arg, nint dest) { *(Exception*)((global::System.IntPtr)dest).ToPointer() = FromManaged(arg); } public static void DisposeMarshaler(Marshaler m) { } public static void DisposeAbi(Exception abi) { } public static string GetGuidSignature() { return "struct(Windows.Foundation.HResult;i4)"; } } public struct Type { internal struct MarshalerArray { public nint _array; public object[] _marshalers; public void Dispose() { if (_marshalers != null) { object[] marshalers = _marshalers; foreach (object obj in marshalers) { DisposeMarshaler((Marshaler)obj); } } if (_array != (nint)global::System.IntPtr.Zero) { Marshal.FreeCoTaskMem((global::System.IntPtr)_array); } } } public struct Marshaler { internal MarshalString Name; internal TypeKind Kind; internal void Dispose() { MarshalString.DisposeMarshaler(Name); } } [Obsolete("Types with embedded references are not supported in this version of your compiler.", true)] [CompilerFeatureRequired("RefStructs")] public ref struct Pinnable { internal MarshalString.Pinnable Name; internal TypeKind Kind; public Pinnable(global::System.Type type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) ValueTuple val = ToAbi(type); Name = new MarshalString.Pinnable(val.Item1); Kind = val.Item2; } public ref readonly char GetPinnableReference() { return ref Name.GetPinnableReference(); } } private nint Name; private TypeKind Kind; private static readonly ConcurrentDictionary typeNameCache = new ConcurrentDictionary(); internal unsafe static MarshalerArray CreateMarshalerArray(global::System.Type[] array) { MarshalerArray result = default(MarshalerArray); if (array == null) { return result; } bool flag = false; try { int num = array.Length; int num2 = sizeof(Type); int num3 = num * num2; result._array = Marshal.AllocCoTaskMem(num3); result._marshalers = new object[num]; byte* ptr = (byte*)((global::System.IntPtr)result._array).ToPointer(); for (int i = 0; i < num; i++) { result._marshalers[i] = CreateMarshaler(array[i]); CopyAbi((Marshaler)result._marshalers[i], (nint)ptr); ptr += num2; } flag = true; return result; } finally { if (!flag) { result.Dispose(); } } } internal static ValueTuple GetAbiArray(object box) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MarshalerArray marshalerArray = (MarshalerArray)box; object[] marshalers = marshalerArray._marshalers; return new ValueTuple((marshalers != null) ? marshalers.Length : 0, marshalerArray._array); } internal unsafe static global::System.Type[] FromAbiArray(object box) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (box == null) { return null; } ValueTuple val = (ValueTuple)box; if (val.Item2 == (nint)global::System.IntPtr.Zero) { return null; } global::System.Type[] array = new global::System.Type[val.Item1]; byte* ptr = (byte*)((global::System.IntPtr)val.Item2).ToPointer(); int num = sizeof(Type); for (int i = 0; i < val.Item1; i++) { Type value = global::System.Runtime.CompilerServices.Unsafe.ReadUnaligned((void*)ptr); array[i] = FromAbi(value); ptr += num; } return array; } internal unsafe static ValueTuple FromManagedArray(global::System.Type[] array) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (array == null) { return new ValueTuple(0, (nint)global::System.IntPtr.Zero); } nint num = global::System.IntPtr.Zero; int i = 0; bool flag = false; try { int num2 = array.Length; int num3 = sizeof(Type); int num4 = num2 * num3; num = Marshal.AllocCoTaskMem(num4); byte* ptr = (byte*)((global::System.IntPtr)num).ToPointer(); for (i = 0; i < num2; i++) { CopyManaged(array[i], (nint)ptr); ptr += num3; } flag = true; return new ValueTuple(i, num); } finally { if (!flag) { DisposeAbiArray(new ValueTuple(i, num)); } } } internal unsafe static void CopyManagedArray(global::System.Type[] array, nint data) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (array == null) { return; } DisposeAbiArrayElements(new ValueTuple(array.Length, data)); int i = 0; bool flag = false; try { int num = array.Length; int num2 = sizeof(Type); int num3 = num * num2; byte* ptr = (byte*)((global::System.IntPtr)data).ToPointer(); for (i = 0; i < num; i++) { CopyManaged(array[i], (nint)ptr); ptr += num2; } flag = true; } finally { if (!flag) { DisposeAbiArrayElements(new ValueTuple(i, data)); } } } internal static void DisposeMarshalerArray(object box) { ((MarshalerArray)box).Dispose(); } internal static void DisposeAbiArray(object box) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (box != null) { ValueTuple abi = (ValueTuple)box; if (abi.Item2 != (nint)global::System.IntPtr.Zero) { DisposeAbiArrayElements(abi); Marshal.FreeCoTaskMem((global::System.IntPtr)abi.Item2); } } } private unsafe static void DisposeAbiArrayElements(ValueTuple abi) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) byte* ptr = (byte*)((global::System.IntPtr)abi.Item2).ToPointer(); int num = sizeof(Type); for (int i = 0; i < abi.Item1; i++) { Type abi2 = global::System.Runtime.CompilerServices.Unsafe.ReadUnaligned((void*)ptr); DisposeAbi(abi2); ptr += num; } } private static ValueTuple ToAbi(global::System.Type value) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (value is FakeMetadataType fakeMetadataType) { return new ValueTuple(((global::System.Type)(object)fakeMetadataType).FullName, TypeKind.Metadata); } TypeKind typeKind = TypeKind.Custom; if (value != null) { if (value.IsPrimitive) { typeKind = TypeKind.Primitive; } else if (value == typeof(object) || value == typeof(string) || value == typeof(Guid) || value == typeof(global::System.Type)) { typeKind = TypeKind.Metadata; } else if (Projections.IsTypeWindowsRuntimeType(value)) { typeKind = TypeKind.Metadata; } } return new ValueTuple(GetNameForTypeCached(value, typeKind == TypeKind.Custom), typeKind); } private static string GetNameForTypeCached(global::System.Type value, bool customKind) { if (customKind) { return typeNameCache.GetOrAdd(value, (Func)((global::System.Type type) => type.AssemblyQualifiedName)); } return typeNameCache.GetOrAdd(value, (Func)((global::System.Type type) => TypeNameSupport.GetNameForType(type, TypeNameGenerationFlags.None))); } public static Marshaler CreateMarshaler(global::System.Type value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) ValueTuple val = ToAbi(value); Marshaler result = default(Marshaler); result.Name = MarshalString.CreateMarshaler(val.Item1); result.Kind = val.Item2; return result; } public static Type GetAbi(ref Pinnable p) { Type result = default(Type); result.Name = MarshalString.GetAbi(ref p.Name); result.Kind = p.Kind; return result; } public static Type GetAbi(Marshaler m) { Type result = default(Type); result.Name = MarshalString.GetAbi(m.Name); result.Kind = m.Kind; return result; } [UnconditionalSuppressMessage("Trimming", "IL2057", Justification = "Any types which are trimmed are not used by managed user code and there is fallback logic to handle that.")] public static global::System.Type FromAbi(Type value) { string text = MarshalString.FromAbi(value.Name); if (string.IsNullOrEmpty(text)) { return null; } if (value.Kind == TypeKind.Custom) { return global::System.Type.GetType(text); } global::System.Type type = TypeNameSupport.FindTypeByNameCached(text); if (type == (global::System.Type)null && value.Kind == TypeKind.Metadata) { type = (global::System.Type)(object)FakeMetadataType.GetFakeMetadataType(text); } return type; } public unsafe static void CopyAbi(Marshaler arg, nint dest) { *(Type*)((global::System.IntPtr)dest).ToPointer() = GetAbi(arg); } public static Type FromManaged(global::System.Type value) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) ValueTuple val = ToAbi(value); Type result = default(Type); result.Name = MarshalString.FromManaged(val.Item1); result.Kind = val.Item2; return result; } public unsafe static void CopyManaged(global::System.Type arg, nint dest) { *(Type*)((global::System.IntPtr)dest).ToPointer() = FromManaged(arg); } public static void DisposeMarshaler(Marshaler m) { m.Dispose(); } public static void DisposeAbi(Type abi) { MarshalString.DisposeAbi(abi.Name); } public static string GetGuidSignature() { return "struct(Windows.UI.Xaml.Interop.TypeName;string;enum(Windows.UI.Xaml.Interop.TypeKind;i4))"; } } [WindowsRuntimeType("Windows.Foundation.UniversalApiContract")] internal enum TypeKind { Primitive, Metadata, Custom } internal sealed class FakeMetadataType : TypeInfo { private static readonly ConcurrentDictionary fakeMetadataTypeCache = new ConcurrentDictionary((IEqualityComparer)(object)StringComparer.Ordinal); private readonly string fullName; public override Assembly Assembly { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } } public override string AssemblyQualifiedName { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } } public override global::System.Type BaseType { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } } public override string FullName => fullName; public override Guid GUID { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } } public override Module Module { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } } public override string Namespace { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } } public override global::System.Type UnderlyingSystemType { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } } public override string Name { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } } private FakeMetadataType(string fullName) { this.fullName = fullName; } internal static FakeMetadataType GetFakeMetadataType(string name) { return fakeMetadataTypeCache.GetOrAdd(name, (Func)((string name) => new FakeMetadataType(name))); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } public override object[] GetCustomAttributes(bool inherit) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } public override object[] GetCustomAttributes(global::System.Type attributeType, bool inherit) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } public override global::System.Type GetElementType() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override EventInfo GetEvent(string name, BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override EventInfo[] GetEvents(BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override FieldInfo GetField(string name, BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override FieldInfo[] GetFields(BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2093", Justification = "This method will always throw.")] [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override global::System.Type GetInterface(string name, bool ignoreCase) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override global::System.Type[] GetInterfaces() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override MemberInfo[] GetMembers(BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override MethodInfo[] GetMethods(BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override global::System.Type GetNestedType(string name, BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override global::System.Type[] GetNestedTypes(BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } public override bool IsDefined(global::System.Type attributeType, bool inherit) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } protected override TypeAttributes GetAttributeFlagsImpl() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, global::System.Type[] types, ParameterModifier[] modifiers) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, global::System.Type[] types, ParameterModifier[] modifiers) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } [UnconditionalSuppressMessage("Trimming", "IL2094", Justification = "This method will always throw.")] protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, global::System.Type returnType, global::System.Type[] types, ParameterModifier[] modifiers) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } protected override bool HasElementTypeImpl() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } protected override bool IsArrayImpl() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } protected override bool IsByRefImpl() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } protected override bool IsCOMObjectImpl() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } protected override bool IsPointerImpl() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } protected override bool IsPrimitiveImpl() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new InvalidOperationException(); } public override string ToString() { return fullName; } public override bool Equals(object o) { return this == o; } public override bool Equals(global::System.Type o) { return this == o; } public override int GetHashCode() { return ((object)fullName).GetHashCode(); } } [Guid("44A9796F-723E-4FDF-A218-033E75B0C084")] internal sealed class WinRTUriRuntimeClassFactory { [Guid("44A9796F-723E-4FDF-A218-033E75B0C084")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _CreateUri_0; public nint _CreateWithRelativeUri; public unsafe delegate* unmanaged[Stdcall] CreateUri_0 => (delegate* unmanaged[Stdcall])_CreateUri_0; } private readonly ObjectReference _obj; public nint ThisPtr => _obj.ThisPtr; public static ObjectReference FromAbi(nint thisPtr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ObjectReference.FromAbi(thisPtr, IID.IID_UriRuntimeClassFactory); } public WinRTUriRuntimeClassFactory(IObjectReference obj) : this(obj.As(IID.IID_UriRuntimeClassFactory)) { }//IL_0007: Unknown result type (might be due to invalid IL or missing references) public WinRTUriRuntimeClassFactory(ObjectReference obj) { _obj = obj; } public unsafe IObjectReference CreateUri(string uri) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) nint thisPtr = 0; MarshalString.Pinnable p = new MarshalString.Pinnable(uri); fixed (char* ptr = p) { void* ptr2 = ptr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)ThisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(ThisPtr, MarshalString.GetAbi(ref p), &thisPtr)); GC.KeepAlive((object)_obj); return ObjectReference.Attach(ref thisPtr, IID.IID_IUnknown); } } public unsafe ObjectReferenceValue CreateUriForMarshaling(string uri) { nint ptr = 0; MarshalString.Pinnable p = new MarshalString.Pinnable(uri); fixed (char* ptr2 = p) { void* ptr3 = ptr2; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)ThisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(ThisPtr, MarshalString.GetAbi(ref p), &ptr)); GC.KeepAlive((object)_obj); return new ObjectReferenceValue(ptr); } } } public struct Uri { private static readonly WinRTUriRuntimeClassFactory Instance = new WinRTUriRuntimeClassFactory(ActivationFactory.Get("Windows.Foundation.Uri")); public static IObjectReference CreateMarshaler(Uri value) { if (value == null) { return null; } return Instance.CreateUri(value.OriginalString); } public static ObjectReferenceValue CreateMarshaler2(Uri value) { if (value == null) { return default(ObjectReferenceValue); } return Instance.CreateUriForMarshaling(value.OriginalString); } public static nint GetAbi(IObjectReference m) { return m?.ThisPtr ?? global::System.IntPtr.Zero; } public unsafe static Uri FromAbi(nint ptr) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (ptr == (nint)global::System.IntPtr.Zero) { return null; } nint zero = global::System.IntPtr.Zero; try { ExceptionHelpers.ThrowExceptionForHR(((IUriRuntimeClassVftbl*)(*(nint*)ptr))->get_RawUri_10(ptr, &zero)); return new Uri(MarshalString.FromAbi(zero)); } finally { MarshalString.DisposeAbi(zero); } } public static Uri[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, FromAbi); } public unsafe static void CopyManaged(Uri o, nint dest) { *(nint*)((global::System.IntPtr)dest).ToPointer() = CreateMarshaler2(o).Detach(); } public static nint FromManaged(Uri value) { if (value == null) { return global::System.IntPtr.Zero; } return CreateMarshaler2(value).Detach(); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(Uri[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, (Uri o) => CreateMarshaler2(o)); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static void CopyAbiArray(Uri[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, FromAbi); } public static ValueTuple FromManagedArray(Uri[] array) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, (Uri o) => FromManaged(o)); } public static void DisposeMarshalerArray(MarshalInterfaceHelper.MarshalerArray array) { MarshalInterfaceHelper.DisposeMarshalerArray(array); } public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); } public static void DisposeAbi(nint abi) { MarshalInspectable.DisposeAbi(abi); } public static void DisposeAbiArray(object box) { MarshalInterfaceHelper.DisposeAbiArray(box); } public static string GetGuidSignature() { return "rc(Windows.Foundation.Uri;{9e365e57-48b2-4160-956f-c7385120bbfc})"; } } } namespace ABI.System.Numerics { public struct Matrix3x2 { public static string GetGuidSignature() { return "struct(Windows.Foundation.Numerics.Matrix3x2;f4;f4;f4;f4;f4;f4)"; } } public struct Matrix4x4 { public static string GetGuidSignature() { return "struct(Windows.Foundation.Numerics.Matrix4x4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4;f4)"; } } public struct Plane { public static string GetGuidSignature() { return "struct(Windows.Foundation.Numerics.Plane;struct(Windows.Foundation.Numerics.Vector3;f4;f4;f4);f4)"; } } public struct Quaternion { public static string GetGuidSignature() { return "struct(Windows.Foundation.Numerics.Quaternion;f4;f4;f4;f4)"; } } public struct Vector2 { public static string GetGuidSignature() { return "struct(Windows.Foundation.Numerics.Vector2;f4;f4)"; } } public struct Vector3 { public static string GetGuidSignature() { return "struct(Windows.Foundation.Numerics.Vector3;f4;f4;f4)"; } } public struct Vector4 { public static string GetGuidSignature() { return "struct(Windows.Foundation.Numerics.Vector4;f4;f4;f4;f4)"; } } } namespace ABI.System.Windows.Input { public static class ICommandMethods { private static volatile ConditionalWeakTable _CanExecuteChanged; public static Guid IID => global::WinRT.Interop.IID.IID_ICommand; public static nint AbiToProjectionVftablePtr => ICommand.Vftbl.AbiToProjectionVftablePtr; private static ConditionalWeakTable CanExecuteChanged => _CanExecuteChanged ?? MakeCanExecuteChangedTable(); public unsafe static bool CanExecute(IObjectReference obj, object parameter) { nint thisPtr = obj.ThisPtr; ObjectReferenceValue value = default(ObjectReferenceValue); byte b = 0; try { value = MarshalInspectable.CreateMarshaler2(parameter); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, MarshalInspectable.GetAbi(value), &b)); GC.KeepAlive((object)obj); return b != 0; } finally { MarshalInspectable.DisposeMarshaler(value); } } public unsafe static void Execute(IObjectReference obj, object parameter) { nint thisPtr = obj.ThisPtr; ObjectReferenceValue value = default(ObjectReferenceValue); try { value = MarshalInspectable.CreateMarshaler2(parameter); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, MarshalInspectable.GetAbi(value))); GC.KeepAlive((object)obj); } finally { MarshalInspectable.DisposeMarshaler(value); } } private static ConditionalWeakTable MakeCanExecuteChangedTable() { Interlocked.CompareExchange>(ref _CanExecuteChanged, new ConditionalWeakTable(), (ConditionalWeakTable)null); return _CanExecuteChanged; } public unsafe static EventHandlerEventSource Get_CanExecuteChanged2(IObjectReference obj, object thisObj) { return CanExecuteChanged.GetValue(thisObj, (CreateValueCallback)delegate { nint thisPtr = obj.ThisPtr; return new EventHandlerEventSource(obj, (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))), (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])))); }); } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [Guid("E5AF3542-CA67-4081-995B-709DD13792DF")] [DynamicInterfaceCastableImplementation] internal interface ICommand : ICommand { [Guid("E5AF3542-CA67-4081-995B-709DD13792DF")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _add_CanExecuteChanged_0; private unsafe void* _remove_CanExecuteChanged_1; private unsafe void* _CanExecute_2; private unsafe void* _Execute_3; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; private static volatile ConditionalWeakTable> _canExecuteChanged_TokenTables; public unsafe delegate* unmanaged[Stdcall] add_CanExecuteChanged_0 { get { return (delegate* unmanaged[Stdcall])_add_CanExecuteChanged_0; } set { _add_CanExecuteChanged_0 = value; } } public unsafe delegate* unmanaged[Stdcall] remove_CanExecuteChanged_1 { get { return (delegate* unmanaged[Stdcall])_remove_CanExecuteChanged_1; } set { _remove_CanExecuteChanged_1 = value; } } public unsafe delegate* unmanaged[Stdcall] CanExecute_2 { get { return (delegate* unmanaged[Stdcall])_CanExecute_2; } set { _CanExecute_2 = value; } } public unsafe delegate* unmanaged[Stdcall] Execute_3 { get { return (delegate* unmanaged[Stdcall])_Execute_3; } set { _Execute_3 = value; } } private static ConditionalWeakTable> _CanExecuteChanged_TokenTables => _canExecuteChanged_TokenTables ?? MakeConditionalWeakTable(); unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _add_CanExecuteChanged_0 = (delegate*)(&Do_Abi_add_CanExecuteChanged_0), _remove_CanExecuteChanged_1 = (delegate*)(&Do_Abi_remove_CanExecuteChanged_1), _CanExecute_2 = (delegate*)(&Do_Abi_CanExecute_2), _Execute_3 = (delegate*)(&Do_Abi_Execute_3) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint) * 4); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_CanExecute_2(nint thisPtr, nint parameter, byte* result) { bool flag = false; *result = 0; try { flag = ComWrappersSupport.FindObject(thisPtr).CanExecute(MarshalInspectable.FromAbi(parameter)); *result = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private static int Do_Abi_Execute_3(nint thisPtr, nint parameter) { try { ComWrappersSupport.FindObject(thisPtr).Execute(MarshalInspectable.FromAbi(parameter)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static ConditionalWeakTable> MakeConditionalWeakTable() { Interlocked.CompareExchange>>(ref _canExecuteChanged_TokenTables, new ConditionalWeakTable>(), (ConditionalWeakTable>)null); return _canExecuteChanged_TokenTables; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_add_CanExecuteChanged_0(nint thisPtr, nint handler, global::WinRT.EventRegistrationToken* token) { *token = default(global::WinRT.EventRegistrationToken); try { ICommand val = ComWrappersSupport.FindObject(thisPtr); EventHandler val2 = EventHandler.FromAbi(handler); *token = _CanExecuteChanged_TokenTables.GetOrCreateValue(val).AddEventHandler(val2); val.CanExecuteChanged += val2; return 0; } catch (global::System.Exception ex) { return ex.HResult; } } [UnmanagedCallersOnly] private static int Do_Abi_remove_CanExecuteChanged_1(nint thisPtr, global::WinRT.EventRegistrationToken token) { try { ICommand val = ComWrappersSupport.FindObject(thisPtr); EventRegistrationTokenTable eventRegistrationTokenTable = default(EventRegistrationTokenTable); if (val != null && _CanExecuteChanged_TokenTables.TryGetValue(val, ref eventRegistrationTokenTable) && eventRegistrationTokenTable.RemoveEventHandler(token, out EventHandler handler)) { val.CanExecuteChanged -= handler; } return 0; } catch (global::System.Exception ex) { return ex.HResult; } } } event EventHandler ICommand.CanExecuteChanged { add { _CanExecuteChanged((IWinRTObject)this).Subscribe(value); } remove { _CanExecuteChanged((IWinRTObject)this).Unsubscribe(value); } } static ObjectReference FromAbi(nint thisPtr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ObjectReference.FromAbi(thisPtr, IID.IID_ICommand); } private static EventHandlerEventSource _CanExecuteChanged(IWinRTObject _this) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = _this.GetObjectReferenceForType(typeof(ICommand).TypeHandle); return ICommandMethods.Get_CanExecuteChanged2(objectReferenceForType, _this); } bool ICommand.CanExecute(object parameter) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(ICommand).TypeHandle); return ICommandMethods.CanExecute(objectReferenceForType, parameter); } void ICommand.Execute(object parameter) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(ICommand).TypeHandle); ICommandMethods.Execute(objectReferenceForType, parameter); } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] public static class ICommand_Delegates { public unsafe delegate int add_CanExecuteChanged_0(nint thisPtr, nint handler, global::WinRT.EventRegistrationToken* token); public unsafe delegate int CanExecute_2(nint thisPtr, nint parameter, byte* result); public delegate int Execute_3(nint thisPtr, nint parameter); } } namespace ABI.System.ComponentModel { [EditorBrowsable(/*Could not decode attribute arguments.*/)] public struct DataErrorsChangedEventArgs { private static readonly WinRTDataErrorsChangedEventArgsRuntimeClassFactory Instance = new WinRTDataErrorsChangedEventArgsRuntimeClassFactory(ActivationFactory.Get("Microsoft.UI.Xaml.Data.DataErrorsChangedEventArgs")); public static IObjectReference CreateMarshaler(DataErrorsChangedEventArgs value) { if (value == null) { return null; } return Instance.CreateInstance(value.PropertyName); } public static ObjectReferenceValue CreateMarshaler2(DataErrorsChangedEventArgs value) { if (value == null) { return default(ObjectReferenceValue); } return Instance.CreateInstanceForMarshaling(value.PropertyName); } public static nint GetAbi(IObjectReference m) { return m?.ThisPtr ?? global::System.IntPtr.Zero; } public unsafe static DataErrorsChangedEventArgs FromAbi(nint ptr) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (ptr == (nint)global::System.IntPtr.Zero) { return null; } nint zero = global::System.IntPtr.Zero; try { ExceptionHelpers.ThrowExceptionForHR(((IDataErrorsChangedEventArgsVftbl*)(*(nint*)ptr))->get_PropertyName_0(ptr, &zero)); return new DataErrorsChangedEventArgs(MarshalString.FromAbi(zero)); } finally { MarshalString.DisposeAbi(zero); } } public unsafe static void CopyManaged(DataErrorsChangedEventArgs o, nint dest) { *(nint*)((global::System.IntPtr)dest).ToPointer() = CreateMarshaler2(o).Detach(); } public static nint FromManaged(DataErrorsChangedEventArgs value) { if (value == null) { return global::System.IntPtr.Zero; } return CreateMarshaler2(value).Detach(); } public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); } public static void DisposeAbi(nint abi) { MarshalInspectable.DisposeAbi(abi); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(DataErrorsChangedEventArgs[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, CreateMarshaler2); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static DataErrorsChangedEventArgs[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, FromAbi); } public static void CopyAbiArray(DataErrorsChangedEventArgs[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, FromAbi); } public static ValueTuple FromManagedArray(DataErrorsChangedEventArgs[] array) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, FromManaged); } public static void DisposeMarshalerArray(MarshalInterfaceHelper.MarshalerArray array) { MarshalInterfaceHelper.DisposeMarshalerArray(array); } public static void DisposeAbiArray(object box) { MarshalInspectable.DisposeAbiArray(box); } public static string GetGuidSignature() { return "rc(Microsoft.UI.Xaml.Data.DataErrorsChangedEventArgs;{d026dd64-5f26-5f15-a86a-0dec8a431796})"; } } public static class INotifyDataErrorInfoMethods { private static volatile ConditionalWeakTable> _ErrorsChanged; public static Guid IID => global::WinRT.Interop.IID.IID_INotifyDataErrorInfo; public static nint AbiToProjectionVftablePtr => INotifyDataErrorInfo.Vftbl.AbiToProjectionVftablePtr; private static ConditionalWeakTable> ErrorsChanged => _ErrorsChanged ?? MakeErrorsChangedTable(); public unsafe static bool get_HasErrors(IObjectReference obj) { nint thisPtr = obj.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &b)); GC.KeepAlive((object)obj); return b != 0; } public unsafe static global::System.Collections.IEnumerable GetErrors(IObjectReference obj, string propertyName) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableIDynamicInterfaceCastableSupport) { throw new NotSupportedException("'INotifyDataErrorInfo.GetErrors' relies on 'IDynamicInterfaceCastable' support, which is not currently available. Make sure the 'EnableIDynamicInterfaceCastableSupport' property is not set to 'false'."); } nint thisPtr = obj.ThisPtr; nint num = 0; try { MarshalString.Pinnable p = new MarshalString.Pinnable(propertyName); fixed (char* ptr = p) { void* ptr2 = ptr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, MarshalString.GetAbi(ref p), &num)); GC.KeepAlive((object)obj); return (IEnumerable)IInspectable.FromAbi(num); } } finally { IEnumerable.DisposeAbi(num); } } private static ConditionalWeakTable> MakeErrorsChangedTable() { Interlocked.CompareExchange>>(ref _ErrorsChanged, new ConditionalWeakTable>(), (ConditionalWeakTable>)null); return _ErrorsChanged; } public unsafe static EventHandlerEventSource Get_ErrorsChanged2(IObjectReference obj, object thisObj) { return ErrorsChanged.GetValue(thisObj, (CreateValueCallback>)delegate { nint thisPtr = obj.ThisPtr; return new EventHandlerEventSource(obj, (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))), (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall]))), 0); }); } } [DynamicInterfaceCastableImplementation] [EditorBrowsable(/*Could not decode attribute arguments.*/)] [Guid("0EE6C2CC-273E-567D-BC0A-1DD87EE51EBA")] internal interface INotifyDataErrorInfo : INotifyDataErrorInfo { [Guid("0EE6C2CC-273E-567D-BC0A-1DD87EE51EBA")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public unsafe delegate* unmanaged get_HasErrors_0; public unsafe delegate* unmanaged[Stdcall] add_ErrorsChanged_1; public unsafe delegate* unmanaged[Stdcall] remove_ErrorsChanged_2; public unsafe delegate* unmanaged GetErrors_3; public static readonly nint AbiToProjectionVftablePtr; private static volatile ConditionalWeakTable>> _ErrorsChanged_TokenTablesLazy; private static ConditionalWeakTable>> _ErrorsChanged_TokenTables => _ErrorsChanged_TokenTablesLazy ?? MakeConditionalWeakTable(); unsafe static Vftbl() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint) * 4); *(Vftbl*)AbiToProjectionVftablePtr = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, get_HasErrors_0 = (delegate* unmanaged)(delegate*)(&Do_Abi_get_HasErrors_0), add_ErrorsChanged_1 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_add_ErrorsChanged_1), remove_ErrorsChanged_2 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_remove_ErrorsChanged_2), GetErrors_3 = (delegate* unmanaged)(delegate*)(&Do_Abi_GetErrors_3) }; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetErrors_3(nint thisPtr, nint propertyName, nint* result) { global::System.Collections.Generic.IEnumerable enumerable = null; *result = 0; try { enumerable = Enumerable.OfType(ComWrappersSupport.FindObject(thisPtr).GetErrors(MarshalString.FromAbi(propertyName))); *result = IEnumerable.FromManaged(enumerable); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_HasErrors_0(nint thisPtr, byte* value) { bool flag = false; *value = 0; try { flag = ComWrappersSupport.FindObject(thisPtr).HasErrors; *value = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static ConditionalWeakTable>> MakeConditionalWeakTable() { Interlocked.CompareExchange>>>(ref _ErrorsChanged_TokenTablesLazy, new ConditionalWeakTable>>(), (ConditionalWeakTable>>)null); return _ErrorsChanged_TokenTablesLazy; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_add_ErrorsChanged_1(nint thisPtr, nint handler, global::WinRT.EventRegistrationToken* token) { *token = default(global::WinRT.EventRegistrationToken); try { INotifyDataErrorInfo val = ComWrappersSupport.FindObject(thisPtr); EventHandler val2 = EventHandler.FromAbi(handler); *token = _ErrorsChanged_TokenTables.GetOrCreateValue(val).AddEventHandler(val2); val.ErrorsChanged += val2; return 0; } catch (global::System.Exception ex) { return ex.HResult; } } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_remove_ErrorsChanged_2(nint thisPtr, global::WinRT.EventRegistrationToken token) { try { INotifyDataErrorInfo val = ComWrappersSupport.FindObject(thisPtr); EventRegistrationTokenTable> eventRegistrationTokenTable = default(EventRegistrationTokenTable>); if (val != null && _ErrorsChanged_TokenTables.TryGetValue(val, ref eventRegistrationTokenTable) && eventRegistrationTokenTable.RemoveEventHandler(token, out EventHandler handler)) { val.ErrorsChanged -= handler; } return 0; } catch (global::System.Exception ex) { return ex.HResult; } } } bool INotifyDataErrorInfo.HasErrors { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(INotifyDataErrorInfo).TypeHandle); return INotifyDataErrorInfoMethods.get_HasErrors(objectReferenceForType); } } event EventHandler INotifyDataErrorInfo.ErrorsChanged { add { _ErrorsChanged((IWinRTObject)this).Subscribe(value); } remove { _ErrorsChanged((IWinRTObject)this).Unsubscribe(value); } } internal static ObjectReference FromAbi(nint thisPtr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ObjectReference.FromAbi(thisPtr, IID.IID_INotifyDataErrorInfo); } private static EventHandlerEventSource _ErrorsChanged(IWinRTObject _this) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = _this.GetObjectReferenceForType(typeof(INotifyDataErrorInfo).TypeHandle); return INotifyDataErrorInfoMethods.Get_ErrorsChanged2(objectReferenceForType, _this); } global::System.Collections.IEnumerable INotifyDataErrorInfo.GetErrors(string propertyName) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(INotifyDataErrorInfo).TypeHandle); return INotifyDataErrorInfoMethods.GetErrors(objectReferenceForType, propertyName); } } internal static class INotifyDataErrorInfo_Delegates { public unsafe delegate int get_HasErrors_0(nint thisPtr, byte* value); public unsafe delegate int add_ErrorsChanged_1(nint thisPtr, nint handler, global::WinRT.EventRegistrationToken* token); public delegate int remove_ErrorsChanged_2(nint thisPtr, global::WinRT.EventRegistrationToken token); public unsafe delegate int GetErrors_3(nint thisPtr, nint propertyName, nint* result); } public static class INotifyPropertyChangedMethods { private static volatile ConditionalWeakTable _PropertyChanged; public static Guid IID { get { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.UseWindowsUIXamlProjections) { return global::WinRT.Interop.IID.IID_MUX_INotifyPropertyChanged; } return global::WinRT.Interop.IID.IID_WUX_INotifyPropertyChanged; } } public static nint AbiToProjectionVftablePtr => INotifyPropertyChanged.Vftbl.AbiToProjectionVftablePtr; private static ConditionalWeakTable PropertyChanged => _PropertyChanged ?? MakePropertyChangedTable(); private static ConditionalWeakTable MakePropertyChangedTable() { Interlocked.CompareExchange>(ref _PropertyChanged, new ConditionalWeakTable(), (ConditionalWeakTable)null); return _PropertyChanged; } public unsafe static EventSource Get_PropertyChanged2(IObjectReference obj, object thisObj) { return PropertyChanged.GetValue(thisObj, (CreateValueCallback)delegate { nint thisPtr = obj.ThisPtr; return new PropertyChangedEventSource(obj, (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))), (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])))); }); } } [DynamicInterfaceCastableImplementation] [Guid("90B17601-B065-586E-83D9-9ADC3A695284")] [WuxMuxProjectedType] internal interface INotifyPropertyChanged : INotifyPropertyChanged { [Guid("90B17601-B065-586E-83D9-9ADC3A695284")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe delegate* unmanaged _add_PropertyChanged_0; private unsafe delegate* unmanaged _remove_PropertyChanged_1; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; private static volatile ConditionalWeakTable> _PropertyChanged_TokenTablesLazy; public unsafe delegate* unmanaged[Stdcall] add_PropertyChanged_0 { get { return (delegate* unmanaged[Stdcall])_add_PropertyChanged_0; } set { _add_PropertyChanged_0 = (delegate* unmanaged)value; } } public unsafe delegate* unmanaged[Stdcall] remove_PropertyChanged_1 { get { return (delegate* unmanaged[Stdcall])_remove_PropertyChanged_1; } set { _remove_PropertyChanged_1 = (delegate* unmanaged)value; } } private static ConditionalWeakTable> _PropertyChanged_TokenTables => _PropertyChanged_TokenTablesLazy ?? MakeConditionalWeakTable(); unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _add_PropertyChanged_0 = (delegate* unmanaged)(delegate*)(&Do_Abi_add_PropertyChanged_0), _remove_PropertyChanged_1 = (delegate* unmanaged)(delegate*)(&Do_Abi_remove_PropertyChanged_1) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint) * 2); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } private static ConditionalWeakTable> MakeConditionalWeakTable() { Interlocked.CompareExchange>>(ref _PropertyChanged_TokenTablesLazy, new ConditionalWeakTable>(), (ConditionalWeakTable>)null); return _PropertyChanged_TokenTablesLazy; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_add_PropertyChanged_0(nint thisPtr, nint handler, global::WinRT.EventRegistrationToken* token) { *token = default(global::WinRT.EventRegistrationToken); try { INotifyPropertyChanged val = ComWrappersSupport.FindObject(thisPtr); PropertyChangedEventHandler val2 = PropertyChangedEventHandler.FromAbi(handler); *token = _PropertyChanged_TokenTables.GetOrCreateValue(val).AddEventHandler(val2); val.PropertyChanged += val2; return 0; } catch (global::System.Exception ex) { return ex.HResult; } } [UnmanagedCallersOnly] private static int Do_Abi_remove_PropertyChanged_1(nint thisPtr, global::WinRT.EventRegistrationToken token) { try { INotifyPropertyChanged val = ComWrappersSupport.FindObject(thisPtr); EventRegistrationTokenTable eventRegistrationTokenTable = default(EventRegistrationTokenTable); if (val != null && _PropertyChanged_TokenTables.TryGetValue(val, ref eventRegistrationTokenTable) && eventRegistrationTokenTable.RemoveEventHandler(token, out PropertyChangedEventHandler handler)) { val.PropertyChanged -= handler; } return 0; } catch (global::System.Exception ex) { return ex.HResult; } } } event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { add { _PropertyChanged((IWinRTObject)this).Subscribe(value); } remove { _PropertyChanged((IWinRTObject)this).Unsubscribe(value); } } private static EventSource _PropertyChanged(IWinRTObject _this) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = _this.GetObjectReferenceForType(typeof(INotifyPropertyChanged).TypeHandle); return INotifyPropertyChangedMethods.Get_PropertyChanged2(objectReferenceForType, _this); } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] public struct PropertyChangedEventArgs { private static readonly PropertyChangedEventArgsRuntimeClassFactory Instance = new PropertyChangedEventArgsRuntimeClassFactory(); public static IObjectReference CreateMarshaler(PropertyChangedEventArgs value) { if (value == null) { return null; } IObjectReference innerInterface; return Instance.CreateInstance(value.PropertyName, null, out innerInterface); } public static ObjectReferenceValue CreateMarshaler2(PropertyChangedEventArgs value) { if (value == null) { return default(ObjectReferenceValue); } return Instance.CreateInstance(value.PropertyName); } public static nint GetAbi(IObjectReference m) { return m?.ThisPtr ?? global::System.IntPtr.Zero; } public unsafe static PropertyChangedEventArgs FromAbi(nint ptr) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if (ptr == (nint)global::System.IntPtr.Zero) { return null; } nint zero = global::System.IntPtr.Zero; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)ptr) + (nint)6 * (nint)sizeof(void*))))(ptr, &zero)); return new PropertyChangedEventArgs(MarshalString.FromAbi(zero)); } finally { MarshalString.DisposeAbi(zero); } } public unsafe static void CopyManaged(PropertyChangedEventArgs o, nint dest) { *(nint*)((global::System.IntPtr)dest).ToPointer() = CreateMarshaler2(o).Detach(); } public static nint FromManaged(PropertyChangedEventArgs value) { if (value == null) { return global::System.IntPtr.Zero; } return CreateMarshaler2(value).Detach(); } public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); } public static void DisposeAbi(nint abi) { MarshalInspectable.DisposeAbi(abi); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(PropertyChangedEventArgs[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, CreateMarshaler2); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static PropertyChangedEventArgs[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, FromAbi); } public static void CopyAbiArray(PropertyChangedEventArgs[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, FromAbi); } public static ValueTuple FromManagedArray(PropertyChangedEventArgs[] array) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, FromManaged); } public static void DisposeMarshalerArray(MarshalInterfaceHelper.MarshalerArray array) { MarshalInterfaceHelper.DisposeMarshalerArray(array); } public static void DisposeAbiArray(object box) { MarshalInspectable.DisposeAbiArray(box); } public static string GetGuidSignature() { if (FeatureSwitches.UseWindowsUIXamlProjections) { return "rc(Windows.UI.Xaml.Data.PropertyChangedEventArgs;{4f33a9a0-5cf4-47a4-b16f-d7faaf17457e})"; } return "rc(Microsoft.UI.Xaml.Data.PropertyChangedEventArgs;{63d0c952-396b-54f4-af8c-ba8724a427bf})"; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [Guid("E3DE52F6-1E32-5DA6-BB2D-B5B6096C962D")] [WuxMuxProjectedType] public static class PropertyChangedEventHandler { private sealed class NativeDelegateWrapper : IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly ObjectReference _nativeDelegate; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; IObjectReference IWinRTObject.NativeObject => _nativeDelegate; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public NativeDelegateWrapper(ObjectReference nativeDelegate) { _nativeDelegate = nativeDelegate; } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public unsafe void Invoke(object sender, PropertyChangedEventArgs e) { nint thisPtr = _nativeDelegate.ThisPtr; delegate* unmanaged[Stdcall] invoke = (delegate* unmanaged[Stdcall])_nativeDelegate.Vftbl.Invoke; ObjectReferenceValue value = default(ObjectReferenceValue); ObjectReferenceValue value2 = default(ObjectReferenceValue); try { value = MarshalInspectable.CreateMarshaler2(sender); value2 = PropertyChangedEventArgs.CreateMarshaler2(e); ExceptionHelpers.ThrowExceptionForHR(invoke(thisPtr, MarshalInspectable.GetAbi(value), MarshalInspectable.GetAbi(value2))); GC.KeepAlive((object)_nativeDelegate); } finally { MarshalInspectable.DisposeMarshaler(value); MarshalInspectable.DisposeMarshaler(value2); } } } private static readonly IDelegateVftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; [field: CompilerGenerated] public static global::System.Delegate AbiInvokeDelegate { [CompilerGenerated] get; } public static Guid IID { get { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.UseWindowsUIXamlProjections) { return global::WinRT.Interop.IID.IID_MUX_PropertyChangedEventHandler; } return global::WinRT.Interop.IID.IID_WUX_PropertyChangedEventHandler; } } unsafe static PropertyChangedEventHandler() { AbiToProjectionVftable = new IDelegateVftbl { IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl, Invoke = (nint)(delegate*)(&Do_Abi_Invoke) }; nint num = ComWrappersSupport.AllocateVtableMemory(typeof(PropertyChangedEventHandler), sizeof(IDelegateVftbl)); *(IDelegateVftbl*)num = AbiToProjectionVftable; AbiToProjectionVftablePtr = num; ComWrappersSupport.RegisterDelegateFactory(typeof(PropertyChangedEventHandler), CreateRcw); } public static IObjectReference CreateMarshaler(PropertyChangedEventHandler managedDelegate) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (managedDelegate != null) { return MarshalDelegate.CreateMarshaler(managedDelegate, IID); } return null; } public static ObjectReferenceValue CreateMarshaler2(PropertyChangedEventHandler managedDelegate) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalDelegate.CreateMarshaler2(managedDelegate, IID); } public static nint GetAbi(IObjectReference value) { return MarshalInterfaceHelper.GetAbi(value); } public static PropertyChangedEventHandler FromAbi(nint nativeDelegate) { return MarshalDelegate.FromAbi(nativeDelegate); } public static PropertyChangedEventHandler CreateRcw(nint ptr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return new PropertyChangedEventHandler(new NativeDelegateWrapper(ComWrappersSupport.GetObjectReferenceForInterface(ptr, IID)).Invoke); } public static nint FromManaged(PropertyChangedEventHandler managedDelegate) { return CreateMarshaler2(managedDelegate).Detach(); } public static void DisposeMarshaler(IObjectReference value) { MarshalInterfaceHelper.DisposeMarshaler(value); } public static void DisposeAbi(nint abi) { MarshalInterfaceHelper.DisposeAbi(abi); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(PropertyChangedEventHandler[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, CreateMarshaler2); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static PropertyChangedEventHandler[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, FromAbi); } public static void CopyAbiArray(PropertyChangedEventHandler[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, FromAbi); } public static ValueTuple FromManagedArray(PropertyChangedEventHandler[] array) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, FromManaged); } public static void DisposeMarshalerArray(MarshalInterfaceHelper.MarshalerArray array) { MarshalInterfaceHelper.DisposeMarshalerArray(array); } public static void DisposeAbiArray(object box) { MarshalInspectable.DisposeAbiArray(box); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_Invoke(nint thisPtr, nint sender, nint e) { try { PropertyChangedEventHandler val = ComWrappersSupport.FindObject(thisPtr); val.Invoke(MarshalInspectable.FromAbi(sender), PropertyChangedEventArgs.FromAbi(e)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [SkipLocalsInit] internal unsafe static ComInterfaceEntry[] GetExposedInterfaces() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) global::System.Span span = new global::System.Span((void*)stackalloc ComInterfaceEntry[3], 3); global::System.Span span2 = span; int num = 0; span2[num++] = new ComInterfaceEntry { IID = IID, Vtable = AbiToProjectionVftablePtr }; if (FeatureSwitches.EnableIReferenceSupport) { span2[num++] = new ComInterfaceEntry { IID = global::WinRT.Interop.IID.IID_IPropertyValue, Vtable = ManagedIPropertyValueImpl.AbiToProjectionVftablePtr }; span2[num++] = new ComInterfaceEntry { IID = Nullable_PropertyChangedEventHandler.IID, Vtable = Nullable_PropertyChangedEventHandler.AbiToProjectionVftablePtr }; } return span2.Slice(0, num).ToArray(); } } internal sealed class PropertyChangedEventSource : EventSource { private sealed class EventState : EventSourceState { public EventState(nint obj, int index) : base(obj, index) { } protected override PropertyChangedEventHandler GetEventInvoke() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown return (PropertyChangedEventHandler)([CompilerGenerated] (object? obj, PropertyChangedEventArgs e) => { PropertyChangedEventHandler? obj2 = targetDelegate; if (obj2 != null) { obj2.Invoke(obj, e); } }); } } internal unsafe PropertyChangedEventSource(IObjectReference objectReference, delegate* unmanaged[Stdcall] addHandler, delegate* unmanaged[Stdcall] removeHandler) : base(objectReference, addHandler, removeHandler, 0) { } protected override ObjectReferenceValue CreateMarshaler(PropertyChangedEventHandler del) { return PropertyChangedEventHandler.CreateMarshaler2(del); } protected override EventSourceState CreateEventSourceState() { return new EventState(base.ObjectReference.ThisPtr, base.Index); } } } namespace ABI.System.Collections { public static class IEnumerableMethods { public static Guid IID => global::WinRT.Interop.IID.IID_IEnumerable; public static nint AbiToProjectionVftablePtr => IEnumerable.AbiToProjectionVftablePtr; } [DynamicInterfaceCastableImplementation] [Guid("036D2C08-DF29-41AF-8AA2-D774BE62BA6F")] internal interface IEnumerable : global::System.Collections.IEnumerable, global::Microsoft.UI.Xaml.Interop.IBindableIterable { public sealed class AdaptiveFromAbiHelper : FromAbiHelper, global::System.Collections.IEnumerable { private static readonly MethodInfo EnumerableOfTGetEnumerator = typeof(global::System.Collections.Generic.IEnumerable<>).GetMethod("GetEnumerator"); private readonly MethodInvoker _enumerator; public AdaptiveFromAbiHelper(global::System.Type runtimeType, IWinRTObject winRTObject) : base(winRTObject) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown MethodInfo val = (MethodInfo)(((!runtimeType.IsGenericType || !(runtimeType.GetGenericTypeDefinition() == typeof(global::System.Collections.Generic.IEnumerable<>))) ? GetEnumerableOfTInterface(runtimeType) : runtimeType)?.GetMemberWithSameMetadataDefinitionAs((MemberInfo)(object)EnumerableOfTGetEnumerator)); _enumerator = ((val == null) ? null : MethodInvoker.Create((MethodBase)(object)val)); [MethodImpl(8)] [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "'SomeType.GetInterfaces().Any(t => t.GetGenericTypeDefinition() == typeof(IEnumerable<>)' is safe,\r\nprovided you obtained someType from something like an analyzable 'Type.GetType' or 'object.GetType'\r\n(i.e. it is safe when the type you're asking about can exist on the GC heap as allocated).")] static global::System.Type GetEnumerableOfTInterface(global::System.Type runtimeType) { global::System.Type[] interfaces = runtimeType.GetInterfaces(); foreach (global::System.Type type in interfaces) { if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(global::System.Collections.Generic.IEnumerable<>)) { return type; } } return null; } } public override global::System.Collections.IEnumerator GetEnumerator() { if (_enumerator != null) { return global::System.Runtime.CompilerServices.Unsafe.As(_enumerator.Invoke((object)_winrtObject)); } return base.GetEnumerator(); } } public class FromAbiHelper : global::System.Collections.IEnumerable { private sealed class NonGenericToGenericIterator : IIterator { private readonly global::Microsoft.UI.Xaml.Interop.IBindableIterator iterator; public object _Current => iterator.Current; public bool HasCurrent => iterator.HasCurrent; public NonGenericToGenericIterator(global::Microsoft.UI.Xaml.Interop.IBindableIterator iterator) { this.iterator = iterator; } public bool _MoveNext() { return iterator.MoveNext(); } public uint GetMany(ref object[] items) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } } private readonly global::System.Collections.IEnumerable _iterable; protected readonly IWinRTObject _winrtObject; public FromAbiHelper(global::System.Collections.IEnumerable iterable) { _iterable = iterable; } protected FromAbiHelper(IWinRTObject winrtObject) { _iterable = null; _winrtObject = winrtObject; } private IWinRTObject GetIterable() { return ((IWinRTObject)_iterable) ?? _winrtObject; } public virtual global::System.Collections.IEnumerator GetEnumerator() { return new FromAbiEnumerator(new NonGenericToGenericIterator(((global::Microsoft.UI.Xaml.Interop.IBindableIterable)GetIterable()).First())); } } public sealed class ToAbiHelper : global::Microsoft.UI.Xaml.Interop.IBindableIterable { private sealed class NonGenericToGenericEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly global::System.Collections.IEnumerator enumerator; public object Current => enumerator.Current; public NonGenericToGenericEnumerator(global::System.Collections.IEnumerator enumerator) { this.enumerator = enumerator; } public bool MoveNext() { return enumerator.MoveNext(); } public void Reset() { enumerator.Reset(); } public void Dispose() { } } private readonly IEnumerable m_enumerable; internal ToAbiHelper(IEnumerable enumerable) { m_enumerable = enumerable; } global::Microsoft.UI.Xaml.Interop.IBindableIterator global::Microsoft.UI.Xaml.Interop.IBindableIterable.First() { return MakeBindableIterator(((global::System.Collections.IEnumerable)m_enumerable).GetEnumerator()); } internal static global::Microsoft.UI.Xaml.Interop.IBindableIterator MakeBindableIterator(global::System.Collections.IEnumerator enumerator) { return new IEnumerator.ToAbiHelper(new NonGenericToGenericEnumerator(enumerator)); } } static readonly nint AbiToProjectionVftablePtr; static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IEnumerable)); } unsafe static IEnumerable() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IEnumerable), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_First_0); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_First_0(nint thisPtr, nint* result) { *result = 0; try { global::System.Collections.IEnumerable enumerable = ComWrappersSupport.FindObject(thisPtr); global::Microsoft.UI.Xaml.Interop.IBindableIterator value = ToAbiHelper.MakeBindableIterator(enumerable.GetEnumerator()); *result = MarshalInterface.FromManaged(value); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } internal static ObjectReference ObjRefFromAbi(nint thisPtr) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, IID.IID_IUnknown); } private static FromAbiHelper _AbiHelper(IWinRTObject _this) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return (FromAbiHelper)_this.AdditionalTypeData.GetOrAdd(typeof(global::System.Collections.IEnumerable).TypeHandle, (Func)((RuntimeTypeHandle _, IWinRTObject _this) => new FromAbiHelper((global::System.Collections.IEnumerable)_this)), _this); } unsafe global::Microsoft.UI.Xaml.Interop.IBindableIterator global::Microsoft.UI.Xaml.Interop.IBindableIterable.First() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IEnumerable).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &num)); GC.KeepAlive((object)objectReferenceForType); return MarshalInterface.FromAbi(num); } finally { MarshalInterface.DisposeAbi(num); } } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return _AbiHelper((IWinRTObject)this).GetEnumerator(); } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] public static class IEnumerable_Delegates { public unsafe delegate int First_0(nint thisPtr, nint* result); } public static class IListMethods { public static Guid IID => global::WinRT.Interop.IID.IID_IList; public static nint AbiToProjectionVftablePtr => IList.AbiToProjectionVftablePtr; } [DynamicInterfaceCastableImplementation] [Guid("393DE7DE-6FD0-4C0D-BB71-47244A113E93")] internal interface IList : global::System.Collections.IList, global::System.Collections.ICollection, global::System.Collections.IEnumerable, IBindableVector { [DefaultMember("Item")] public sealed class FromAbiHelper : global::System.Collections.IList, global::System.Collections.ICollection, global::System.Collections.IEnumerable { private readonly IBindableVector _vector; public bool IsSynchronized => false; public object SyncRoot => this; public int Count { get { //IL_0019: Unknown result type (might be due to invalid IL or missing references) uint size = _vector.Size; if (2147483647 < size) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingListTooLarge); } return (int)size; } } public object this[int index] { get { return Indexer_Get(index); } set { Indexer_Set(index, value); } } public bool IsFixedSize => false; public bool IsReadOnly => false; public FromAbiHelper(IBindableVector vector) { _vector = vector; } public void CopyTo(global::System.Array array, int arrayIndex) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (array == null) { throw new ArgumentNullException("array"); } if (array.Rank != 1) { throw new ArgumentException(WinRTRuntimeErrorStrings.Arg_RankMultiDimNotSupported); } int lowerBound = array.GetLowerBound(0); int count = Count; int length = array.GetLength(0); if (arrayIndex < lowerBound) { throw new ArgumentOutOfRangeException("arrayIndex"); } if (count > length - (arrayIndex - lowerBound)) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_InsufficientSpaceToCopyCollection); } if (arrayIndex - lowerBound > length) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_IndexOutOfArrayBounds); } for (uint num = 0u; num < count; num++) { array.SetValue(_vector.GetAt(num), num + arrayIndex); } } internal object Indexer_Get(int index) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } return GetAt(_vector, (uint)index); } internal void Indexer_Set(int index, object value) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } SetAt(_vector, (uint)index, value); } public int Add(object value) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) _vector.Append(value); uint size = _vector.Size; if (2147483647 < size) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingListTooLarge); } return (int)(size - 1); } public bool Contains(object item) { uint index; return _vector.IndexOf(item, out index); } public void Clear() { _vector.Clear(); } public int IndexOf(object item) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!_vector.IndexOf(item, out var index)) { return -1; } if (2147483647 < index) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingListTooLarge); } return (int)index; } public void Insert(int index, object item) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } InsertAtHelper(_vector, (uint)index, item); } public void Remove(object item) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (_vector.IndexOf(item, out var index)) { if (2147483647 < index) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingListTooLarge); } RemoveAtHelper(_vector, index); } } public void RemoveAt(int index) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } RemoveAtHelper(_vector, (uint)index); } private static object GetAt(IBindableVector _this, uint index) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { return _this.GetAt(index); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } private static void SetAt(IBindableVector _this, uint index, object value) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { _this.SetAt(index, value); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } private static void InsertAtHelper(IBindableVector _this, uint index, object item) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { _this.InsertAt(index, item); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } private static void RemoveAtHelper(IBindableVector _this, uint index) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) try { _this.RemoveAt(index); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } public global::System.Collections.IEnumerator GetEnumerator() { return ((global::System.Collections.IEnumerable)(IEnumerable)(IWinRTObject)_vector).GetEnumerator(); } } public sealed class ToAbiHelper : IBindableVector, global::System.Collections.IEnumerable { internal sealed class ListToBindableVectorViewAdapterTypeDetails : IWinRTExposedTypeDetails { public ComInterfaceEntry[] GetExposedInterfaces() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) return (ComInterfaceEntry[])(object)new ComInterfaceEntry[2] { new ComInterfaceEntry { IID = IID.IID_IBindableVectorView, Vtable = ABI.Microsoft.UI.Xaml.Interop.IBindableVectorView.AbiToProjectionVftablePtr }, new ComInterfaceEntry { IID = IEnumerableMethods.IID, Vtable = IEnumerableMethods.AbiToProjectionVftablePtr } }; } } [WinRTExposedType(typeof(ListToBindableVectorViewAdapterTypeDetails))] internal sealed class ListToBindableVectorViewAdapter : global::Microsoft.UI.Xaml.Interop.IBindableVectorView, global::System.Collections.IEnumerable { private readonly global::System.Collections.IList list; public uint Size => (uint)((global::System.Collections.ICollection)list).Count; internal ListToBindableVectorViewAdapter(global::System.Collections.IList list) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (list == null) { throw new ArgumentNullException("list"); } this.list = list; } private static void EnsureIndexInt32(uint index, int listCapacity) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (2147483647 <= index || index >= (uint)listCapacity) { global::System.Exception ex = (global::System.Exception)new ArgumentOutOfRangeException("index", WinRTRuntimeErrorStrings.ArgumentOutOfRange_IndexLargerThanMaxValue); ex.SetHResult(-2147483637); throw ex; } } public global::Microsoft.UI.Xaml.Interop.IBindableIterator First() { return IEnumerable.ToAbiHelper.MakeBindableIterator(((global::System.Collections.IEnumerable)list).GetEnumerator()); } public object GetAt(uint index) { //IL_0021: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.ICollection)list).Count); try { return list[(int)index]; } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException innerException = val; throw ((global::System.Exception)(object)innerException).GetExceptionForHR(-2147483637, WinRTRuntimeErrorStrings.ArgumentOutOfRange_Index); } } public bool IndexOf(object value, out uint index) { int num = list.IndexOf(value); if (-1 == num) { index = 0u; return false; } index = (uint)num; return true; } public global::System.Collections.IEnumerator GetEnumerator() { return ((global::System.Collections.IEnumerable)list).GetEnumerator(); } } private readonly global::System.Collections.IList _list; public uint Size => (uint)((global::System.Collections.ICollection)_list).Count; public ToAbiHelper(global::System.Collections.IList list) { _list = list; } public object GetAt(uint index) { //IL_0021: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.ICollection)_list).Count); try { return _list[(int)index]; } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException innerException = val; throw ((global::System.Exception)(object)innerException).GetExceptionForHR(-2147483637, WinRTRuntimeErrorStrings.ArgumentOutOfRange_Index); } } global::Microsoft.UI.Xaml.Interop.IBindableVectorView IBindableVector.GetView() { return new ListToBindableVectorViewAdapter(_list); } public bool IndexOf(object value, out uint index) { int num = _list.IndexOf(value); if (-1 == num) { index = 0u; return false; } index = (uint)num; return true; } public void SetAt(uint index, object value) { //IL_0021: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.ICollection)_list).Count); try { _list[(int)index] = value; } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException innerException = val; throw ((global::System.Exception)(object)innerException).GetExceptionForHR(-2147483637, WinRTRuntimeErrorStrings.ArgumentOutOfRange_Index); } } public void InsertAt(uint index, object value) { //IL_0023: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.ICollection)_list).Count + 1); try { _list.Insert((int)index, value); } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException ex = val; ((global::System.Exception)(object)ex).SetHResult(-2147483637); throw; } } public void RemoveAt(uint index) { //IL_0020: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.ICollection)_list).Count); try { _list.RemoveAt((int)index); } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException ex = val; ((global::System.Exception)(object)ex).SetHResult(-2147483637); throw; } } public void Append(object value) { _list.Add(value); } public void RemoveAtEnd() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (((global::System.Collections.ICollection)_list).Count == 0) { global::System.Exception ex = (global::System.Exception)new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CannotRemoveLastFromEmptyCollection); ex.SetHResult(-2147483637); throw ex; } uint count = (uint)((global::System.Collections.ICollection)_list).Count; RemoveAt(count - 1); } public void Clear() { _list.Clear(); } private static void EnsureIndexInt32(uint index, int listCapacity) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (2147483647 <= index || index >= (uint)listCapacity) { global::System.Exception ex = (global::System.Exception)new ArgumentOutOfRangeException("index", WinRTRuntimeErrorStrings.ArgumentOutOfRange_IndexLargerThanMaxValue); ex.SetHResult(-2147483637); throw ex; } } public global::System.Collections.IEnumerator GetEnumerator() { return ((global::System.Collections.IEnumerable)_list).GetEnumerator(); } } static readonly nint AbiToProjectionVftablePtr; private static readonly ConditionalWeakTable _adapterTable; unsafe uint IBindableVector.Size { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; uint result = 0u; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &result)); GC.KeepAlive((object)objectReferenceForType); return result; } } object global::System.Collections.IList.this[int index] { get { return _VectorToList((IWinRTObject)this)[index]; } set { _VectorToList((IWinRTObject)this)[index] = value; } } bool global::System.Collections.IList.IsFixedSize => _VectorToList((IWinRTObject)this).IsFixedSize; bool global::System.Collections.IList.IsReadOnly => _VectorToList((IWinRTObject)this).IsReadOnly; int global::System.Collections.ICollection.Count => _VectorToList((IWinRTObject)this).Count; bool global::System.Collections.ICollection.IsSynchronized => _VectorToList((IWinRTObject)this).IsSynchronized; object global::System.Collections.ICollection.SyncRoot => _VectorToList((IWinRTObject)this).SyncRoot; static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IList)); } unsafe static IList() { _adapterTable = new ConditionalWeakTable(); AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IList), sizeof(IInspectable.Vftbl) + sizeof(nint) * 10); *(IInspectable.Vftbl*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_GetAt_0); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_get_Size_1); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_GetView_2); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_IndexOf_3); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)10 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_SetAt_4); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)11 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_InsertAt_5); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)12 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_RemoveAt_6); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)13 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_Append_7); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)14 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_RemoveAtEnd_8); *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)15 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_Clear_9); } private static IBindableVector FindAdapter(nint thisPtr) { global::System.Collections.IList list2 = ComWrappersSupport.FindObject(thisPtr); return _adapterTable.GetValue(list2, (CreateValueCallback)((global::System.Collections.IList list) => new ToAbiHelper(list))); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetAt_0(nint thisPtr, uint index, nint* result) { object obj = null; *result = 0; try { obj = FindAdapter(thisPtr).GetAt(index); *result = MarshalInspectable.FromManaged(obj); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetView_2(nint thisPtr, nint* result) { global::Microsoft.UI.Xaml.Interop.IBindableVectorView bindableVectorView = null; *result = 0; try { bindableVectorView = FindAdapter(thisPtr).GetView(); *result = MarshalInterface.FromManaged(bindableVectorView); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_IndexOf_3(nint thisPtr, nint value, uint* index, byte* returnValue) { bool flag = false; *index = 0u; *returnValue = 0; uint index2 = 0u; try { flag = FindAdapter(thisPtr).IndexOf(MarshalInspectable.FromAbi(value), out index2); *index = index2; *returnValue = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_SetAt_4(nint thisPtr, uint index, nint value) { try { FindAdapter(thisPtr).SetAt(index, MarshalInspectable.FromAbi(value)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_InsertAt_5(nint thisPtr, uint index, nint value) { try { FindAdapter(thisPtr).InsertAt(index, MarshalInspectable.FromAbi(value)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_RemoveAt_6(nint thisPtr, uint index) { try { FindAdapter(thisPtr).RemoveAt(index); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_Append_7(nint thisPtr, nint value) { try { FindAdapter(thisPtr).Append(MarshalInspectable.FromAbi(value)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_RemoveAtEnd_8(nint thisPtr) { try { FindAdapter(thisPtr).RemoveAtEnd(); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_Clear_9(nint thisPtr) { try { FindAdapter(thisPtr).Clear(); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_get_Size_1(nint thisPtr, uint* value) { uint num = 0u; *value = 0u; try { num = FindAdapter(thisPtr).Size; *value = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } internal static ObjectReference ObjRefFromAbi(nint thisPtr) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, IID.IID_IUnknown); } internal static FromAbiHelper _VectorToList(IWinRTObject _this) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return (FromAbiHelper)_this.AdditionalTypeData.GetOrAdd(typeof(global::System.Collections.IList).TypeHandle, (Func)((RuntimeTypeHandle _, IWinRTObject _this) => new FromAbiHelper((IBindableVector)_this)), _this); } unsafe object IBindableVector.GetAt(uint index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; nint ptr = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, index, &ptr)); GC.KeepAlive((object)objectReferenceForType); return MarshalInspectable.FromAbi(ptr); } finally { MarshalInspectable.DisposeAbi(ptr); } } unsafe global::Microsoft.UI.Xaml.Interop.IBindableVectorView IBindableVector.GetView() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &num)); GC.KeepAlive((object)objectReferenceForType); return MarshalInterface.FromAbi(num); } finally { MarshalInterface.DisposeAbi(num); } } unsafe bool IBindableVector.IndexOf(object value, out uint index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; ObjectReferenceValue value2 = default(ObjectReferenceValue); uint num = 0u; byte b = 0; try { value2 = MarshalInspectable.CreateMarshaler2(value); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, MarshalInspectable.GetAbi(value2), &num, &b)); GC.KeepAlive((object)objectReferenceForType); index = num; return b != 0; } finally { MarshalInspectable.DisposeMarshaler(value2); } } unsafe void IBindableVector.SetAt(uint index, object value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; ObjectReferenceValue value2 = default(ObjectReferenceValue); try { value2 = MarshalInspectable.CreateMarshaler2(value); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)10 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, index, MarshalInspectable.GetAbi(value2))); GC.KeepAlive((object)objectReferenceForType); } finally { MarshalInspectable.DisposeMarshaler(value2); } } unsafe void IBindableVector.InsertAt(uint index, object value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; ObjectReferenceValue value2 = default(ObjectReferenceValue); try { value2 = MarshalInspectable.CreateMarshaler2(value); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)11 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, index, MarshalInspectable.GetAbi(value2))); GC.KeepAlive((object)objectReferenceForType); } finally { MarshalInspectable.DisposeMarshaler(value2); } } unsafe void IBindableVector.RemoveAt(uint index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)12 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, index)); GC.KeepAlive((object)objectReferenceForType); } unsafe void IBindableVector.Append(object value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; ObjectReferenceValue value2 = default(ObjectReferenceValue); try { value2 = MarshalInspectable.CreateMarshaler2(value); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)13 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, MarshalInspectable.GetAbi(value2))); GC.KeepAlive((object)objectReferenceForType); } finally { MarshalInspectable.DisposeMarshaler(value2); } } unsafe void IBindableVector.RemoveAtEnd() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)14 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr)); GC.KeepAlive((object)objectReferenceForType); } unsafe void IBindableVector.Clear() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.IList).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)15 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr)); GC.KeepAlive((object)objectReferenceForType); } int global::System.Collections.IList.Add(object value) { return _VectorToList((IWinRTObject)this).Add(value); } void global::System.Collections.IList.Clear() { _VectorToList((IWinRTObject)this).Clear(); } bool global::System.Collections.IList.Contains(object value) { return _VectorToList((IWinRTObject)this).Contains(value); } int global::System.Collections.IList.IndexOf(object value) { return _VectorToList((IWinRTObject)this).IndexOf(value); } void global::System.Collections.IList.Insert(int index, object value) { _VectorToList((IWinRTObject)this).Insert(index, value); } void global::System.Collections.IList.Remove(object value) { _VectorToList((IWinRTObject)this).Remove(value); } void global::System.Collections.IList.RemoveAt(int index) { _VectorToList((IWinRTObject)this).RemoveAt(index); } void global::System.Collections.ICollection.CopyTo(global::System.Array array, int index) { _VectorToList((IWinRTObject)this).CopyTo(array, index); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return _VectorToList((IWinRTObject)this).GetEnumerator(); } } internal static class IList_Delegates { public unsafe delegate int GetAt_0(nint thisPtr, uint index, nint* result); public unsafe delegate int get_Size_1(nint thisPtr, uint* result); public unsafe delegate int GetView_2(nint thisPtr, nint* result); public unsafe delegate int IndexOf_3(nint thisPtr, nint value, uint* index, byte* returnValue); public delegate int SetAt_4(nint thisPtr, uint index, nint value); public delegate int InsertAt_5(nint thisPtr, uint index, nint value); public delegate int RemoveAt_6(nint thisPtr, uint index); public delegate int Append_7(nint thisPtr, nint value); public delegate int RemoveAtEnd_8(nint thisPtr); public delegate int Clear_9(nint thisPtr); } [DynamicInterfaceCastableImplementation] internal interface ICollection : global::System.Collections.ICollection, global::System.Collections.IEnumerable { int global::System.Collections.ICollection.Count => GetHelper((IWinRTObject)this).Count; bool global::System.Collections.ICollection.IsSynchronized => GetHelper((IWinRTObject)this).IsSynchronized; object global::System.Collections.ICollection.SyncRoot => GetHelper((IWinRTObject)this).SyncRoot; private static global::System.Collections.ICollection CreateHelper(RuntimeTypeHandle type, IWinRTObject _this) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) global::System.Type typeFromHandle = typeof(global::System.Collections.IList); if (((IDynamicInterfaceCastable)_this).IsInterfaceImplemented(typeFromHandle.TypeHandle, false)) { return IList._VectorToList(_this); } throw new InvalidOperationException("ICollection helper can not determine derived type."); } private static global::System.Collections.ICollection GetHelper(IWinRTObject _this) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return (global::System.Collections.ICollection)_this.AdditionalTypeData.GetOrAdd(typeof(global::System.Collections.ICollection).TypeHandle, (Func)CreateHelper, _this); } void global::System.Collections.ICollection.CopyTo(global::System.Array array, int arrayIndex) { GetHelper((IWinRTObject)this).CopyTo(array, arrayIndex); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return ((global::System.Collections.IEnumerable)GetHelper((IWinRTObject)this)).GetEnumerator(); } } } namespace ABI.System.Collections.Specialized { public static class INotifyCollectionChangedMethods { private static volatile ConditionalWeakTable _CollectionChanged; private static ConditionalWeakTable CollectionChanged => _CollectionChanged ?? MakeCollectionChangedTable(); public static Guid IID { get { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.UseWindowsUIXamlProjections) { return global::WinRT.Interop.IID.IID_MUX_INotifyCollectionChanged; } return global::WinRT.Interop.IID.IID_WUX_INotifyCollectionChanged; } } public static nint AbiToProjectionVftablePtr => INotifyCollectionChanged.Vftbl.AbiToProjectionVftablePtr; private static ConditionalWeakTable MakeCollectionChangedTable() { Interlocked.CompareExchange>(ref _CollectionChanged, new ConditionalWeakTable(), (ConditionalWeakTable)null); return _CollectionChanged; } public unsafe static EventSource Get_CollectionChanged2(IObjectReference obj, object thisObj) { return CollectionChanged.GetValue(thisObj, (CreateValueCallback)delegate { nint thisPtr = obj.ThisPtr; return new NotifyCollectionChangedEventHandlerEventSource(obj, (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))), (delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])))); }); } } [DynamicInterfaceCastableImplementation] [EditorBrowsable(/*Could not decode attribute arguments.*/)] [Guid("530155E1-28A5-5693-87CE-30724D95A06D")] [WuxMuxProjectedType] internal interface INotifyCollectionChanged : INotifyCollectionChanged { [Guid("530155E1-28A5-5693-87CE-30724D95A06D")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe delegate* unmanaged _add_CollectionChanged_0; private unsafe delegate* unmanaged _remove_CollectionChanged_1; private static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; private static volatile ConditionalWeakTable> _collectionChanged_TokenTables; public unsafe delegate* unmanaged[Stdcall] add_CollectionChanged_0 { get { return (delegate* unmanaged[Stdcall])_add_CollectionChanged_0; } set { _add_CollectionChanged_0 = (delegate* unmanaged)value; } } public unsafe delegate* unmanaged[Stdcall] remove_CollectionChanged_1 { get { return (delegate* unmanaged[Stdcall])_remove_CollectionChanged_1; } set { _remove_CollectionChanged_1 = (delegate* unmanaged)value; } } private static ConditionalWeakTable> _CollectionChanged_TokenTables => _collectionChanged_TokenTables ?? MakeConditionalWeakTable(); unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _add_CollectionChanged_0 = (delegate* unmanaged)(delegate*)(&Do_Abi_add_CollectionChanged_0), _remove_CollectionChanged_1 = (delegate* unmanaged)(delegate*)(&Do_Abi_remove_CollectionChanged_1) }; nint* ptr = (nint*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint) * 2); *(Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } private static ConditionalWeakTable> MakeConditionalWeakTable() { Interlocked.CompareExchange>>(ref _collectionChanged_TokenTables, new ConditionalWeakTable>(), (ConditionalWeakTable>)null); return _collectionChanged_TokenTables; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_add_CollectionChanged_0(nint thisPtr, nint handler, global::WinRT.EventRegistrationToken* token) { *token = default(global::WinRT.EventRegistrationToken); try { INotifyCollectionChanged val = ComWrappersSupport.FindObject(thisPtr); NotifyCollectionChangedEventHandler val2 = NotifyCollectionChangedEventHandler.FromAbi(handler); *token = _CollectionChanged_TokenTables.GetOrCreateValue(val).AddEventHandler(val2); val.CollectionChanged += val2; return 0; } catch (global::System.Exception ex) { return ex.HResult; } } [UnmanagedCallersOnly] private static int Do_Abi_remove_CollectionChanged_1(nint thisPtr, global::WinRT.EventRegistrationToken token) { try { INotifyCollectionChanged val = ComWrappersSupport.FindObject(thisPtr); EventRegistrationTokenTable eventRegistrationTokenTable = default(EventRegistrationTokenTable); if (val != null && _CollectionChanged_TokenTables.TryGetValue(val, ref eventRegistrationTokenTable) && eventRegistrationTokenTable.RemoveEventHandler(token, out NotifyCollectionChangedEventHandler handler)) { val.CollectionChanged -= handler; } return 0; } catch (global::System.Exception ex) { return ex.HResult; } } } event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged { add { _CollectionChanged((IWinRTObject)this).Subscribe(value); } remove { _CollectionChanged((IWinRTObject)this).Unsubscribe(value); } } private static EventSource _CollectionChanged(IWinRTObject _this) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = _this.GetObjectReferenceForType(typeof(INotifyCollectionChanged).TypeHandle); return INotifyCollectionChangedMethods.Get_CollectionChanged2(objectReferenceForType, _this); } } internal static class NotifyCollectionChangedAction { public static string GetGuidSignature() { if (!FeatureSwitches.UseWindowsUIXamlProjections) { return "enum(Microsoft.UI.Xaml.Interop.NotifyCollectionChangedAction;i4)"; } return "enum(Windows.UI.Xaml.Interop.NotifyCollectionChangedAction;i4)"; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [WuxMuxProjectedType] public struct NotifyCollectionChangedEventArgs { private static ref readonly Guid Interface_IID { get { if (!FeatureSwitches.UseWindowsUIXamlProjections) { return ref IID.IID_MUX_INotifyCollectionChangedEventArgs; } return ref IID.IID_WUX_INotifyCollectionChangedEventArgs; } } public static IObjectReference CreateMarshaler(NotifyCollectionChangedEventArgs value) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (value == null) { return null; } ObjectReferenceValue objectReferenceValue = default(ObjectReferenceValue); try { objectReferenceValue = CreateMarshaler2(value); return ObjectReference.FromAbi(objectReferenceValue.GetAbi(), IID.IID_IUnknown); } finally { objectReferenceValue.Dispose(); } } public static ObjectReferenceValue CreateMarshaler2(NotifyCollectionChangedEventArgs value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (value == null) { return default(ObjectReferenceValue); } return WinRTNotifyCollectionChangedEventArgsRuntimeClassFactory.Instance.CreateInstanceWithAllParameters(value.Action, value.NewItems, value.OldItems, value.NewStartingIndex, value.OldStartingIndex); } public static nint GetAbi(IObjectReference m) { return m?.ThisPtr ?? global::System.IntPtr.Zero; } public static NotifyCollectionChangedEventArgs FromAbi(nint ptr) { if (ptr == (nint)global::System.IntPtr.Zero) { return null; } return CreateNotifyCollectionChangedEventArgs(ptr); } private unsafe static NotifyCollectionChangedEventArgs CreateNotifyCollectionChangedEventArgs(nint ptr) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) nint num = 0; NotifyCollectionChangedAction action = (NotifyCollectionChangedAction)0; nint num2 = 0; nint num3 = 0; int newStartingIndex = 0; int oldStartingIndex = 0; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((global::System.IntPtr)ptr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref Interface_IID), ref num)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)num) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(num, &action)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)num) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(num, &num2)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)num) + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(num, &num3)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)num) + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(num, &newStartingIndex)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)num) + (nint)10 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(num, &oldStartingIndex)); return CreateNotifyCollectionChangedEventArgs(action, MarshalInterface.FromAbi(num2), MarshalInterface.FromAbi(num3), newStartingIndex, oldStartingIndex); } finally { MarshalInterface.DisposeAbi(num2); MarshalInterface.DisposeAbi(num3); MarshalExtensions.ReleaseIfNotNull(num); } } private static NotifyCollectionChangedEventArgs CreateNotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, global::System.Collections.IList newItems, global::System.Collections.IList oldItems, int newStartingIndex, int oldStartingIndex) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected I4, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) return (NotifyCollectionChangedEventArgs)((int)action switch { 0 => (object)new NotifyCollectionChangedEventArgs(action, newItems, newStartingIndex), 1 => (object)new NotifyCollectionChangedEventArgs(action, oldItems, oldStartingIndex), 2 => (object)new NotifyCollectionChangedEventArgs(action, newItems, oldItems, newStartingIndex), 3 => (object)new NotifyCollectionChangedEventArgs(action, newItems, newStartingIndex, oldStartingIndex), 4 => (object)new NotifyCollectionChangedEventArgs((NotifyCollectionChangedAction)4), _ => throw new ArgumentException(), }); } public unsafe static void CopyManaged(NotifyCollectionChangedEventArgs o, nint dest) { *(nint*)((global::System.IntPtr)dest).ToPointer() = CreateMarshaler2(o).Detach(); } public static nint FromManaged(NotifyCollectionChangedEventArgs value) { if (value == null) { return global::System.IntPtr.Zero; } return CreateMarshaler2(value).Detach(); } public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); } public static void DisposeAbi(nint abi) { MarshalInspectable.DisposeAbi(abi); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(NotifyCollectionChangedEventArgs[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, CreateMarshaler2); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static NotifyCollectionChangedEventArgs[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, FromAbi); } public static void CopyAbiArray(NotifyCollectionChangedEventArgs[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, FromAbi); } public static ValueTuple FromManagedArray(NotifyCollectionChangedEventArgs[] array) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, FromManaged); } public static void DisposeMarshalerArray(MarshalInterfaceHelper.MarshalerArray array) { MarshalInterfaceHelper.DisposeMarshalerArray(array); } public static void DisposeAbiArray(object box) { MarshalInspectable.DisposeAbiArray(box); } public static string GetGuidSignature() { if (FeatureSwitches.UseWindowsUIXamlProjections) { return "rc(Windows.UI.Xaml.Interop.NotifyCollectionChangedEventArgs;{4cf68d33-e3f2-4964-b85e-945b4f7e2f21})"; } return "rc(Microsoft.UI.Xaml.Interop.NotifyCollectionChangedEventArgs;{da049ff2-d2e0-5fe8-8c7b-f87f26060b6f})"; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [Guid("8B0909DC-2005-5D93-BF8A-725F017BAA8D")] [WuxMuxProjectedType] public static class NotifyCollectionChangedEventHandler { private sealed class NativeDelegateWrapper : IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly ObjectReference _nativeDelegate; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; IObjectReference IWinRTObject.NativeObject => _nativeDelegate; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public NativeDelegateWrapper(ObjectReference nativeDelegate) { _nativeDelegate = nativeDelegate; } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public unsafe void Invoke(object sender, NotifyCollectionChangedEventArgs e) { nint thisPtr = _nativeDelegate.ThisPtr; delegate* unmanaged[Stdcall] invoke = (delegate* unmanaged[Stdcall])_nativeDelegate.Vftbl.Invoke; ObjectReferenceValue value = default(ObjectReferenceValue); ObjectReferenceValue value2 = default(ObjectReferenceValue); try { value = MarshalInspectable.CreateMarshaler2(sender); value2 = NotifyCollectionChangedEventArgs.CreateMarshaler2(e); ExceptionHelpers.ThrowExceptionForHR(invoke(thisPtr, MarshalInspectable.GetAbi(value), MarshalInspectable.GetAbi(value2))); GC.KeepAlive((object)_nativeDelegate); } finally { MarshalInspectable.DisposeMarshaler(value); MarshalInspectable.DisposeMarshaler(value2); } } } private static readonly IDelegateVftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; [field: CompilerGenerated] public static global::System.Delegate AbiInvokeDelegate { [CompilerGenerated] get; } public static Guid IID { get { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.UseWindowsUIXamlProjections) { return global::WinRT.Interop.IID.IID_MUX_NotifyCollectionChangedEventHandler; } return global::WinRT.Interop.IID.IID_WUX_NotifyCollectionChangedEventHandler; } } unsafe static NotifyCollectionChangedEventHandler() { AbiToProjectionVftable = new IDelegateVftbl { IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl, Invoke = (nint)(delegate*)(&Do_Abi_Invoke) }; nint num = ComWrappersSupport.AllocateVtableMemory(typeof(NotifyCollectionChangedEventHandler), sizeof(IDelegateVftbl)); *(IDelegateVftbl*)num = AbiToProjectionVftable; AbiToProjectionVftablePtr = num; ComWrappersSupport.RegisterDelegateFactory(typeof(NotifyCollectionChangedEventHandler), CreateRcw); } public static IObjectReference CreateMarshaler(NotifyCollectionChangedEventHandler managedDelegate) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (managedDelegate != null) { return MarshalDelegate.CreateMarshaler(managedDelegate, IID); } return null; } public static ObjectReferenceValue CreateMarshaler2(NotifyCollectionChangedEventHandler managedDelegate) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalDelegate.CreateMarshaler2(managedDelegate, IID); } public static nint GetAbi(IObjectReference value) { return MarshalInterfaceHelper.GetAbi(value); } public static NotifyCollectionChangedEventHandler FromAbi(nint nativeDelegate) { return MarshalDelegate.FromAbi(nativeDelegate); } public static NotifyCollectionChangedEventHandler CreateRcw(nint ptr) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown return new NotifyCollectionChangedEventHandler(new NativeDelegateWrapper(ComWrappersSupport.GetObjectReferenceForInterface(ptr, IID)).Invoke); } public static nint FromManaged(NotifyCollectionChangedEventHandler managedDelegate) { return CreateMarshaler2(managedDelegate).Detach(); } public static void DisposeMarshaler(IObjectReference value) { MarshalInterfaceHelper.DisposeMarshaler(value); } public static void DisposeAbi(nint abi) { MarshalInterfaceHelper.DisposeAbi(abi); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(NotifyCollectionChangedEventHandler[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, CreateMarshaler2); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static NotifyCollectionChangedEventHandler[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, FromAbi); } public static void CopyAbiArray(NotifyCollectionChangedEventHandler[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, FromAbi); } public static ValueTuple FromManagedArray(NotifyCollectionChangedEventHandler[] array) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, FromManaged); } public static void DisposeMarshalerArray(MarshalInterfaceHelper.MarshalerArray array) { MarshalInterfaceHelper.DisposeMarshalerArray(array); } public static void DisposeAbiArray(object box) { MarshalInspectable.DisposeAbiArray(box); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_Invoke(nint thisPtr, nint sender, nint e) { try { NotifyCollectionChangedEventHandler val = ComWrappersSupport.FindObject(thisPtr); val.Invoke(MarshalInspectable.FromAbi(sender), NotifyCollectionChangedEventArgs.FromAbi(e)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [SkipLocalsInit] internal unsafe static ComInterfaceEntry[] GetExposedInterfaces() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) global::System.Span span = new global::System.Span((void*)stackalloc ComInterfaceEntry[3], 3); global::System.Span span2 = span; int num = 0; span2[num++] = new ComInterfaceEntry { IID = IID, Vtable = AbiToProjectionVftablePtr }; if (FeatureSwitches.EnableIReferenceSupport) { span2[num++] = new ComInterfaceEntry { IID = global::WinRT.Interop.IID.IID_IPropertyValue, Vtable = ManagedIPropertyValueImpl.AbiToProjectionVftablePtr }; span2[num++] = new ComInterfaceEntry { IID = Nullable_NotifyCollectionChangedEventHandler.IID, Vtable = Nullable_NotifyCollectionChangedEventHandler.AbiToProjectionVftablePtr }; } return span2.Slice(0, num).ToArray(); } } internal sealed class NotifyCollectionChangedEventHandlerEventSource : EventSource { private sealed class EventState : EventSourceState { public EventState(nint obj, int index) : base(obj, index) { } protected override NotifyCollectionChangedEventHandler GetEventInvoke() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown return (NotifyCollectionChangedEventHandler)([CompilerGenerated] (object? obj, NotifyCollectionChangedEventArgs e) => { NotifyCollectionChangedEventHandler? obj2 = targetDelegate; if (obj2 != null) { obj2.Invoke(obj, e); } }); } } internal unsafe NotifyCollectionChangedEventHandlerEventSource(IObjectReference objectReference, delegate* unmanaged[Stdcall] addHandler, delegate* unmanaged[Stdcall] removeHandler) : base(objectReference, addHandler, removeHandler, 0) { } protected override ObjectReferenceValue CreateMarshaler(NotifyCollectionChangedEventHandler del) { return NotifyCollectionChangedEventHandler.CreateMarshaler2(del); } protected override EventSourceState CreateEventSourceState() { return new EventState(base.ObjectReference.ThisPtr, base.Index); } } } namespace ABI.System.Collections.Generic { [DynamicInterfaceCastableImplementation] internal interface IReadOnlyCollection : global::System.Collections.Generic.IReadOnlyCollection, global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable { int global::System.Collections.Generic.IReadOnlyCollection.Count => GetHelper((IWinRTObject)this).Count; private static global::System.Collections.Generic.IReadOnlyCollection CreateHelper(RuntimeTypeHandle type, IWinRTObject _this) { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) global::System.Type typeFromHandle = typeof(T); if (typeFromHandle.IsGenericType && typeFromHandle.GetGenericTypeDefinition() == typeof(KeyValuePair<, >)) { if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"'IDynamicInterfaceCastable' is not supported for generic type argument '{typeof(T)}'."); } global::System.Type type2 = typeof(IReadOnlyDictionary<, >).MakeGenericType(typeFromHandle.GetGenericArguments()); if (((IDynamicInterfaceCastable)_this).IsInterfaceImplemented(type2.TypeHandle, false)) { global::System.Type type3 = typeof(IReadOnlyDictionaryImpl<, >).MakeGenericType(typeFromHandle.GetGenericArguments()); return (global::System.Collections.Generic.IReadOnlyCollection)type3.GetConstructor((BindingFlags)36, (Binder)null, new global::System.Type[1] { typeof(IObjectReference) }, (ParameterModifier[])null).Invoke(new object[1] { _this.NativeObject }); } } global::System.Type typeFromHandle2 = typeof(global::System.Collections.Generic.IReadOnlyList); if (((IDynamicInterfaceCastable)_this).IsInterfaceImplemented(typeFromHandle2.TypeHandle, false)) { return new IReadOnlyListImpl(_this.NativeObject); } throw new InvalidOperationException("IReadOnlyCollection<> helper can not determine derived type."); } private static global::System.Collections.Generic.IReadOnlyCollection GetHelper(IWinRTObject _this) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return (global::System.Collections.Generic.IReadOnlyCollection)_this.AdditionalTypeData.GetOrAdd(typeof(global::System.Collections.Generic.IReadOnlyCollection).TypeHandle, (Func)CreateHelper, _this); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable)GetHelper((IWinRTObject)this)).GetEnumerator(); } global::System.Collections.Generic.IEnumerator global::System.Collections.Generic.IEnumerable.GetEnumerator() { return ((global::System.Collections.Generic.IEnumerable)GetHelper((IWinRTObject)this)).GetEnumerator(); } } [DynamicInterfaceCastableImplementation] internal interface ICollection : global::System.Collections.Generic.ICollection, global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable { int global::System.Collections.Generic.ICollection.Count => GetHelper((IWinRTObject)this).Count; bool global::System.Collections.Generic.ICollection.IsReadOnly => GetHelper((IWinRTObject)this).IsReadOnly; private static global::System.Collections.Generic.ICollection CreateHelper(RuntimeTypeHandle type, IWinRTObject _this) { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) global::System.Type typeFromHandle = typeof(T); if (typeFromHandle.IsGenericType && typeFromHandle.GetGenericTypeDefinition() == typeof(KeyValuePair<, >)) { if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"'IDynamicInterfaceCastable' is not supported for generic type argument '{typeof(T)}'."); } global::System.Type type2 = typeof(IDictionary<, >).MakeGenericType(typeFromHandle.GetGenericArguments()); if (((IDynamicInterfaceCastable)_this).IsInterfaceImplemented(type2.TypeHandle, false)) { global::System.Type type3 = typeof(IDictionaryImpl<, >).MakeGenericType(typeFromHandle.GetGenericArguments()); return (global::System.Collections.Generic.ICollection)type3.GetConstructor((BindingFlags)36, (Binder)null, new global::System.Type[1] { typeof(IObjectReference) }, (ParameterModifier[])null).Invoke(new object[1] { _this.NativeObject }); } } global::System.Type typeFromHandle2 = typeof(global::System.Collections.Generic.IList); if (((IDynamicInterfaceCastable)_this).IsInterfaceImplemented(typeFromHandle2.TypeHandle, false)) { return new IListImpl(_this.NativeObject); } throw new InvalidOperationException("ICollection<> helper can not determine derived type."); } private static global::System.Collections.Generic.ICollection GetHelper(IWinRTObject _this) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return (global::System.Collections.Generic.ICollection)_this.AdditionalTypeData.GetOrAdd(typeof(global::System.Collections.Generic.ICollection).TypeHandle, (Func)CreateHelper, _this); } void global::System.Collections.Generic.ICollection.Add(T item) { GetHelper((IWinRTObject)this).Add(item); } void global::System.Collections.Generic.ICollection.Clear() { GetHelper((IWinRTObject)this).Clear(); } bool global::System.Collections.Generic.ICollection.Contains(T item) { return GetHelper((IWinRTObject)this).Contains(item); } void global::System.Collections.Generic.ICollection.CopyTo(T[] array, int arrayIndex) { GetHelper((IWinRTObject)this).CopyTo(array, arrayIndex); } bool global::System.Collections.Generic.ICollection.Remove(T item) { return GetHelper((IWinRTObject)this).Remove(item); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable)GetHelper((IWinRTObject)this)).GetEnumerator(); } global::System.Collections.Generic.IEnumerator global::System.Collections.Generic.IEnumerable.GetEnumerator() { return ((global::System.Collections.Generic.IEnumerable)GetHelper((IWinRTObject)this)).GetEnumerator(); } } public static class IDictionaryMethods { private sealed class DictionaryKeyCollection : global::System.Collections.Generic.ICollection, global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable { private sealed class DictionaryKeyEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly IObjectReference iEnumerableObjRef; private global::System.Collections.Generic.IEnumerator> enumeration; object global::System.Collections.IEnumerator.Current => Current; public K Current => ((global::System.Collections.Generic.IEnumerator, ?>>)enumeration).Current.Key; public DictionaryKeyEnumerator(IObjectReference iEnumerableObjRef) { this.iEnumerableObjRef = iEnumerableObjRef; enumeration = IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } public void Dispose() { ((global::System.IDisposable)enumeration).Dispose(); } public bool MoveNext() { return ((global::System.Collections.IEnumerator)enumeration).MoveNext(); } public void Reset() { enumeration = IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } } private readonly IObjectReference iDictionaryObjRef; private volatile IObjectReference __iEnumerableObjRef; private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); public int Count => IDictionaryMethods.get_Count(iDictionaryObjRef); public bool IsReadOnly => true; public DictionaryKeyCollection(IObjectReference iDictionaryObjRef) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (iDictionaryObjRef == null) { throw new ArgumentNullException("iDictionaryObjRef"); } this.iDictionaryObjRef = iDictionaryObjRef; } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)iDictionaryObjRef.As(IEnumerableMethods>.PIID), (IObjectReference)null); return __iEnumerableObjRef; } public void CopyTo(K[] array, int index) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (array == null) { throw new ArgumentNullException("array"); } if (index < 0) { throw new ArgumentOutOfRangeException("index"); } if (array.Length <= index && Count > 0) { throw new ArgumentException(WinRTRuntimeErrorStrings.Arg_IndexOutOfRangeException); } if (array.Length - index < IDictionaryMethods.get_Count(iDictionaryObjRef)) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_InsufficientSpaceToCopyCollection); } int num = index; global::System.Collections.Generic.IEnumerator> enumerator = new IEnumerableImpl>(iEnumerableObjRef).GetEnumerator(); try { while (((global::System.Collections.IEnumerator)enumerator).MoveNext()) { KeyValuePair current = ((global::System.Collections.Generic.IEnumerator, ?>>)enumerator).Current; array[num++] = current.Key; } } finally { ((global::System.IDisposable)enumerator)?.Dispose(); } } void global::System.Collections.Generic.ICollection.Add(K item) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(WinRTRuntimeErrorStrings.NotSupported_KeyCollectionSet); } void global::System.Collections.Generic.ICollection.Clear() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(WinRTRuntimeErrorStrings.NotSupported_KeyCollectionSet); } public bool Contains(K item) { return IDictionaryMethods.ContainsKey(iDictionaryObjRef, item); } bool global::System.Collections.Generic.ICollection.Remove(K item) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(WinRTRuntimeErrorStrings.NotSupported_KeyCollectionSet); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)GetEnumerator(); } public global::System.Collections.Generic.IEnumerator GetEnumerator() { return new DictionaryKeyEnumerator(iEnumerableObjRef); } } private sealed class DictionaryValueCollection : global::System.Collections.Generic.ICollection, global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable { private sealed class DictionaryValueEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly IObjectReference iEnumerableObjRef; private global::System.Collections.Generic.IEnumerator> enumeration; object global::System.Collections.IEnumerator.Current => Current; public V Current => ((global::System.Collections.Generic.IEnumerator, ?>>)enumeration).Current.Value; public DictionaryValueEnumerator(IObjectReference iEnumerableObjRef) { this.iEnumerableObjRef = iEnumerableObjRef; enumeration = IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } public void Dispose() { ((global::System.IDisposable)enumeration).Dispose(); } public bool MoveNext() { return ((global::System.Collections.IEnumerator)enumeration).MoveNext(); } public void Reset() { enumeration = IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } } private readonly IObjectReference iDictionaryObjRef; private volatile IObjectReference __iEnumerableObjRef; private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); public int Count => IDictionaryMethods.get_Count(iDictionaryObjRef); public bool IsReadOnly => true; public DictionaryValueCollection(IObjectReference iDictionaryObjRef) { this.iDictionaryObjRef = iDictionaryObjRef; } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)iDictionaryObjRef.As(IEnumerableMethods>.PIID), (IObjectReference)null); return __iEnumerableObjRef; } public void CopyTo(V[] array, int index) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (array == null) { throw new ArgumentNullException("array"); } if (index < 0) { throw new ArgumentOutOfRangeException("index"); } if (array.Length <= index && Count > 0) { throw new ArgumentException(WinRTRuntimeErrorStrings.Arg_IndexOutOfRangeException); } if (array.Length - index < IDictionaryMethods.get_Count(iDictionaryObjRef)) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_InsufficientSpaceToCopyCollection); } int num = index; global::System.Collections.Generic.IEnumerator> enumerator = new IEnumerableImpl>(iEnumerableObjRef).GetEnumerator(); try { while (((global::System.Collections.IEnumerator)enumerator).MoveNext()) { KeyValuePair current = ((global::System.Collections.Generic.IEnumerator, ?>>)enumerator).Current; array[num++] = current.Value; } } finally { ((global::System.IDisposable)enumerator)?.Dispose(); } } void global::System.Collections.Generic.ICollection.Add(V item) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(WinRTRuntimeErrorStrings.NotSupported_ValueCollectionSet); } void global::System.Collections.Generic.ICollection.Clear() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(WinRTRuntimeErrorStrings.NotSupported_ValueCollectionSet); } public bool Contains(V item) { EqualityComparer @default = EqualityComparer.Default; global::System.Collections.Generic.IEnumerator enumerator = GetEnumerator(); try { while (((global::System.Collections.IEnumerator)enumerator).MoveNext()) { V current = ((global::System.Collections.Generic.IEnumerator)enumerator).Current; if (((EqualityComparer)(object)@default).Equals(item, current)) { return true; } } } finally { ((global::System.IDisposable)enumerator)?.Dispose(); } return false; } bool global::System.Collections.Generic.ICollection.Remove(V item) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(WinRTRuntimeErrorStrings.NotSupported_ValueCollectionSet); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)GetEnumerator(); } public global::System.Collections.Generic.IEnumerator GetEnumerator() { return new DictionaryValueEnumerator(iEnumerableObjRef); } } private static nint abiToProjectionVftablePtr; internal static readonly Guid PIID; public static nint AbiToProjectionVftablePtr => abiToProjectionVftablePtr; public static Guid IID => PIID; static IDictionaryMethods() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PIID = GuidGenerator.CreateIIDUnsafe(typeof(IDictionary)); ComWrappersSupport.RegisterHelperType(typeof(IDictionary), typeof(IDictionary)); if (RuntimeFeature.IsDynamicCodeCompiled) { InitRcwHelperFallbackIfNeeded(); } [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] static void InitRcwHelperFallbackIfNeeded() { if (!IMapMethods._RcwHelperInitialized) { Func val = (Func)(object)typeof(IDictionaryMethods<, , , >).MakeGenericType(new global::System.Type[4] { typeof(K), Marshaler.AbiType, typeof(V), Marshaler.AbiType }).GetMethod("InitRcwHelperFallback", (BindingFlags)40).CreateDelegate(typeof(Func)); val.Invoke(); } } } public static int get_Count(IObjectReference obj) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) uint num = IMapMethods.get_Size(obj); if (2147483647 < num) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingDictionaryTooLarge); } return (int)num; } public static bool get_IsReadOnly(IObjectReference _) { return false; } public static void Add(IObjectReference obj, KeyValuePair item) { IMapMethods.Insert(obj, item.Key, item.Value); } public static void Clear(IObjectReference obj) { IMapMethods.Clear(obj); } public static bool Contains(IObjectReference obj, Dictionary> __lookupCache, KeyValuePair item) { if (!IMapMethods.HasKey(obj, item.Key)) { return false; } V val = IMapMethods.Lookup(obj, item.Key); return ((EqualityComparer)(object)EqualityComparer.Default).Equals(val, item.Value); } public static void CopyTo(IObjectReference obj, IObjectReference iEnumerableObjRef, KeyValuePair[] array, int arrayIndex) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (array == null) { throw new ArgumentNullException("array"); } if (arrayIndex < 0) { throw new ArgumentOutOfRangeException("arrayIndex"); } if (array.Length <= arrayIndex && get_Count(obj) > 0) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_IndexOutOfArrayBounds); } if (array.Length - arrayIndex < get_Count(obj)) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_InsufficientSpaceToCopyCollection); } global::System.Collections.Generic.IEnumerator> enumerator = new IEnumerableImpl>(iEnumerableObjRef).GetEnumerator(); try { while (((global::System.Collections.IEnumerator)enumerator).MoveNext()) { KeyValuePair current = ((global::System.Collections.Generic.IEnumerator, ?>>)enumerator).Current; array[arrayIndex++] = current; } } finally { ((global::System.IDisposable)enumerator)?.Dispose(); } } public static bool Remove(IObjectReference obj, KeyValuePair item) { IMapMethods.Remove(obj, item.Key); return true; } public static V Indexer_Get(IObjectReference obj, Dictionary> __lookupCache, K key) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } return Lookup(obj, key); } public static void Indexer_Set(IObjectReference obj, K key, V value) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } Insert(obj, key, value); } public static global::System.Collections.Generic.ICollection get_Keys(IObjectReference obj) { return new DictionaryKeyCollection(obj); } public static global::System.Collections.Generic.ICollection get_Values(IObjectReference obj) { return new DictionaryValueCollection(obj); } public static bool ContainsKey(IObjectReference obj, K key) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } return IMapMethods.HasKey(obj, key); } public static void Add(IObjectReference obj, K key, V value) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } if (ContainsKey(obj, key)) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_AddingDuplicate); } Insert(obj, key, value); } public static bool Remove(IObjectReference obj, K key) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } if (!IMapMethods.HasKey(obj, key)) { return false; } try { IMapMethods.Remove(obj, key); return true; } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { return false; } throw; } } public static bool TryGetValue(IObjectReference obj, Dictionary> __lookupCache, K key, out V value) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } if (!IMapMethods.HasKey(obj, key)) { value = default(V); return false; } try { value = Lookup(obj, key); return true; } catch (KeyNotFoundException) { value = default(V); return false; } } private static V Lookup(IObjectReference obj, K key) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { return IMapMethods.Lookup(obj, key); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new KeyNotFoundException(WinRTRuntimeErrorStrings.Arg_KeyNotFound); } throw; } } private static bool Insert(IObjectReference obj, K key, V value) { return IMapMethods.Insert(obj, key, value); } internal static bool TryInitCCWVtable(nint ptr) { return Interlocked.CompareExchange(ref abiToProjectionVftablePtr, (global::System.IntPtr)ptr, global::System.IntPtr.Zero) == global::System.IntPtr.Zero; } public static V Abi_Lookup_0(nint thisPtr, K key) { return IDictionary.FindAdapter(thisPtr).Lookup(key); } public static bool Abi_HasKey_2(nint thisPtr, K key) { return IDictionary.FindAdapter(thisPtr).HasKey(key); } public static IReadOnlyDictionary Abi_GetView_3(nint thisPtr) { return IDictionary.FindAdapter(thisPtr).GetView(); } public static bool Abi_Insert_4(nint thisPtr, K key, V value) { return IDictionary.FindAdapter(thisPtr).Insert(key, value); } public static void Abi_Remove_5(nint thisPtr, K key) { IDictionary.FindAdapter(thisPtr)._Remove(key); } public static void Abi_Clear_6(nint thisPtr) { IDictionary.FindAdapter(thisPtr).Clear(); } public static uint Abi_get_Size_1(nint thisPtr) { return IDictionary.FindAdapter(thisPtr).Size; } } public static class IDictionaryMethods where KAbi : unmanaged where VAbi : unmanaged { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private sealed class DelegateHelper { private readonly nint _ptr; private global::System.Delegate _lookupDelegate; private global::System.Delegate _hasKeyDelegate; private global::System.Delegate _insertDelegate; private global::System.Delegate _removeDelegate; public global::System.Delegate Lookup => _lookupDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _lookupDelegate, IDictionaryMethods.Lookup_0_Type, 6); public global::System.Delegate HasKey => _hasKeyDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _hasKeyDelegate, IDictionaryMethods.HasKey_2_Type, 8); public global::System.Delegate Insert => _insertDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _insertDelegate, IDictionaryMethods.Insert_4_Type, 10); public global::System.Delegate Remove => _removeDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _removeDelegate, IDictionaryMethods.Remove_5_Type, 11); private DelegateHelper(nint ptr) { _ptr = ptr; } public static DelegateHelper Get(IObjectReference obj) { return (DelegateHelper)GenericDelegateHelper.DelegateTable.GetValue(obj, (CreateValueCallback)((IObjectReference objRef) => new DelegateHelper(objRef.ThisPtr))); } } internal unsafe static delegate* _Lookup; internal unsafe static delegate* _HasKey; internal unsafe static delegate*> _GetView; internal unsafe static delegate* _Insert; internal unsafe static delegate* _Remove; private static global::System.Delegate[] DelegateCache; private static global::System.Type _lookup_0_type; private static global::System.Type _hasKey_2_type; private static global::System.Type _insert_4_type; private static global::System.Type _remove_5_type; private static global::System.Type Lookup_0_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _lookup_0_type ?? MakeLookupType(); } } private static global::System.Type HasKey_2_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _hasKey_2_type ?? MakeHasKeyType(); } } private static global::System.Type Insert_4_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _insert_4_type ?? MakeInsertType(); } } private static global::System.Type Remove_5_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _remove_5_type ?? MakeRemoveType(); } } public unsafe static bool InitRcwHelper(delegate* lookup, delegate* hasKey, delegate*> getView, delegate* insert, delegate* remove) { if (IMapMethods._RcwHelperInitialized) { return true; } IMapMethods._Lookup = lookup; IMapMethods._HasKey = hasKey; IMapMethods._GetView = getView; IMapMethods._Insert = insert; IMapMethods._Remove = remove; ComWrappersSupport.RegisterTypedRcwFactory(typeof(IDictionary), IDictionaryImpl.CreateRcw); ComWrappersSupport.RegisterHelperType(typeof(IDictionary), typeof(IDictionary)); IMapMethods._RcwHelperInitialized = true; return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool InitRcwHelperFallback() { return InitRcwHelper((delegate*)(&LookupDynamic), (delegate*)(&HasKeyDynamic), (delegate*>)null, (delegate*)(&InsertDynamic), (delegate*)(&RemoveDynamic)); } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static V LookupDynamic(IObjectReference obj, K key) { nint thisPtr = obj.ThisPtr; object obj2 = null; VAbi val = default(VAbi); object[] array = new object[3] { thisPtr, null, (nint)(&val) }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(key); array[1] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).Lookup.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); return ((Func)(object)Marshaler.FromAbi).Invoke((object)val); } finally { Marshaler.DisposeMarshaler.Invoke(obj2); Marshaler.DisposeAbi.Invoke((object)val); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool HasKeyDynamic(IObjectReference obj, K key) { nint thisPtr = obj.ThisPtr; object obj2 = null; byte b = default(byte); object[] array = new object[3] { thisPtr, null, (nint)(&b) }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(key); array[1] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).HasKey.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); return b != 0; } finally { Marshaler.DisposeMarshaler.Invoke(obj2); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool InsertDynamic(IObjectReference obj, K key, V value) { nint thisPtr = obj.ThisPtr; object obj2 = null; object obj3 = null; byte b = default(byte); object[] array = new object[4] { thisPtr, null, null, (nint)(&b) }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(key); array[1] = Marshaler.GetAbi.Invoke(obj2); obj3 = ((Func)(object)Marshaler.CreateMarshaler2).Invoke(value); array[2] = Marshaler.GetAbi.Invoke(obj3); DelegateHelper.Get(obj).Insert.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); return b != 0; } finally { Marshaler.DisposeMarshaler.Invoke(obj2); Marshaler.DisposeMarshaler.Invoke(obj3); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private static void RemoveDynamic(IObjectReference obj, K key) { nint thisPtr = obj.ThisPtr; object obj2 = null; object[] array = new object[2] { thisPtr, null }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(key); array[1] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).Remove.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); } finally { Marshaler.DisposeMarshaler.Invoke(obj2); } } public unsafe static bool InitCcw(delegate* unmanaged[Stdcall] lookup, delegate* unmanaged[Stdcall] getSize, delegate* unmanaged[Stdcall] hasKey, delegate* unmanaged[Stdcall] getView, delegate* unmanaged[Stdcall] insert, delegate* unmanaged[Stdcall] remove, delegate* unmanaged[Stdcall] clear) { if (IDictionaryMethods.AbiToProjectionVftablePtr != 0) { return false; } nint num = (nint)NativeMemory.AllocZeroed((global::System.UIntPtr)(nuint)(sizeof(IInspectable.Vftbl) + sizeof(nint) * 7)); *(IInspectable.Vftbl*)num = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(num + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)lookup; *(global::System.IntPtr*)(num + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getSize; *(global::System.IntPtr*)(num + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)hasKey; *(global::System.IntPtr*)(num + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getView; *(global::System.IntPtr*)(num + (nint)10 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)insert; *(global::System.IntPtr*)(num + (nint)11 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)remove; *(global::System.IntPtr*)(num + (nint)12 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)clear; if (!IDictionaryMethods.TryInitCCWVtable(num)) { NativeMemory.Free((void*)num); return false; } ComWrappersSupport.RegisterHelperType(typeof(IReadOnlyDictionary), typeof(IReadOnlyDictionary)); return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal unsafe static void InitFallbackCCWVtable() { DelegateCache = new global::System.Delegate[7] { global::System.Delegate.CreateDelegate(Lookup_0_Type, typeof(IDictionaryMethods).GetMethod("Do_Abi_Lookup_0", (BindingFlags)40)), new _get_PropertyAsUInt32_Abi(Do_Abi_get_Size_1), global::System.Delegate.CreateDelegate(HasKey_2_Type, typeof(IDictionaryMethods).GetMethod("Do_Abi_HasKey_2", (BindingFlags)40)), new IDictionary_Delegates.GetView_3_Abi(Do_Abi_GetView_3), global::System.Delegate.CreateDelegate(Insert_4_Type, typeof(IDictionaryMethods).GetMethod("Do_Abi_Insert_4", (BindingFlags)40)), global::System.Delegate.CreateDelegate(Remove_5_Type, typeof(IDictionaryMethods).GetMethod("Do_Abi_Remove_5", (BindingFlags)40)), new IDictionary_Delegates.Clear_6(Do_Abi_Clear_6) }; InitCcw((delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[0]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[1]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[2]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[3]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[4]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[5]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[6])); } private unsafe static int Do_Abi_Lookup_0(void* thisPtr, KAbi key, VAbi* __return_value__) { V val = default(V); *__return_value__ = default(VAbi); try { val = IDictionary.FindAdapter(new global::System.IntPtr(thisPtr)).Lookup(((Func)(object)Marshaler.FromAbi).Invoke((object)key)); *__return_value__ = (VAbi)((Func)(object)Marshaler.FromManaged).Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_HasKey_2(void* thisPtr, KAbi key, byte* __return_value__) { bool flag = false; *__return_value__ = 0; try { flag = IDictionary.FindAdapter(new global::System.IntPtr(thisPtr)).HasKey(((Func)(object)Marshaler.FromAbi).Invoke((object)key)); *__return_value__ = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_GetView_3(nint thisPtr, nint* __return_value__) { IReadOnlyDictionary val = null; *__return_value__ = 0; try { val = IDictionary.FindAdapter(thisPtr).GetView(); *__return_value__ = MarshalInterface>.FromManaged(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_Insert_4(void* thisPtr, KAbi key, VAbi value, byte* __return_value__) { bool flag = false; *__return_value__ = 0; try { flag = IDictionary.FindAdapter(new global::System.IntPtr(thisPtr)).Insert(((Func)(object)Marshaler.FromAbi).Invoke((object)key), ((Func)(object)Marshaler.FromAbi).Invoke((object)value)); *__return_value__ = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_Remove_5(void* thisPtr, KAbi key) { try { IDictionary.FindAdapter(new global::System.IntPtr(thisPtr))._Remove(((Func)(object)Marshaler.FromAbi).Invoke((object)key)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static int Do_Abi_Clear_6(nint thisPtr) { try { IDictionary.FindAdapter(thisPtr).Clear(); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_get_Size_1(nint thisPtr, uint* __return_value__) { uint num = 0u; *__return_value__ = 0u; try { num = IDictionary.FindAdapter(thisPtr).Size; *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeLookupType() { Interlocked.CompareExchange(ref _lookup_0_type, Projections.GetAbiDelegateType(typeof(void*), typeof(KAbi), typeof(VAbi*), typeof(int)), (global::System.Type)null); return _lookup_0_type; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeHasKeyType() { Interlocked.CompareExchange(ref _hasKey_2_type, Projections.GetAbiDelegateType(typeof(void*), typeof(KAbi), typeof(byte*), typeof(int)), (global::System.Type)null); return _hasKey_2_type; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeInsertType() { Interlocked.CompareExchange(ref _insert_4_type, Projections.GetAbiDelegateType(typeof(void*), typeof(KAbi), typeof(VAbi), typeof(byte*), typeof(int)), (global::System.Type)null); return _insert_4_type; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeRemoveType() { Interlocked.CompareExchange(ref _remove_5_type, Projections.GetAbiDelegateType(typeof(void*), typeof(KAbi), typeof(int)), (global::System.Type)null); return _remove_5_type; } } [DynamicInterfaceCastableImplementation] [Guid("3C2925FE-8519-45C1-AA79-197B6718C1C1")] internal interface IDictionary : IDictionary, global::System.Collections.Generic.ICollection>, global::System.Collections.Generic.IEnumerable>, global::System.Collections.IEnumerable { public sealed class ToAbiHelper : IMap, global::Windows.Foundation.Collections.IIterable> { private readonly IDictionary _dictionary; public uint Size => (uint)((global::System.Collections.Generic.ICollection, ?>>)_dictionary).Count; public ToAbiHelper(IDictionary dictionary) { _dictionary = dictionary; } global::System.Collections.Generic.IEnumerator> global::Windows.Foundation.Collections.IIterable>.First() { return new KeyValuePair.Enumerator(((global::System.Collections.Generic.IEnumerable, ?>>)_dictionary).GetEnumerator()); } public V Lookup(K key) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown V result = default(V); if (!_dictionary.TryGetValue(key, ref result)) { global::System.Exception ex = (global::System.Exception)new KeyNotFoundException(string.Format(WinRTRuntimeErrorStrings.Arg_KeyNotFoundWithKey, (object)((object)key).ToString())); ex.SetHResult(-2147483637); throw ex; } return result; } public bool HasKey(K key) { return _dictionary.ContainsKey(key); } IReadOnlyDictionary IMap.GetView() { IReadOnlyDictionary val = _dictionary as IReadOnlyDictionary; if (val == null) { val = (IReadOnlyDictionary)(object)new ReadOnlyDictionary(_dictionary); } return val; } public bool Insert(K key, V value) { bool result = _dictionary.ContainsKey(key); _dictionary[key] = value; return result; } public void _Remove(K key) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if (!_dictionary.Remove(key)) { global::System.Exception ex = (global::System.Exception)new KeyNotFoundException(string.Format(WinRTRuntimeErrorStrings.Arg_KeyNotFoundWithKey, (object)((object)key).ToString())); ex.SetHResult(-2147483637); throw ex; } } public void Clear() { ((global::System.Collections.Generic.ICollection, ?>>)_dictionary).Clear(); } } [Guid("3C2925FE-8519-45C1-AA79-197B6718C1C1")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public static readonly nint AbiToProjectionVftablePtr = IDictionary.AbiToProjectionVftablePtr; public static readonly Guid PIID = IDictionary.PIID; } static readonly nint AbiToProjectionVftablePtr; private static readonly ConditionalWeakTable, ToAbiHelper> _adapterTable; static readonly Guid PIID; global::System.Collections.Generic.ICollection IDictionary.Keys { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.get_Keys(objectReferenceForType); } } global::System.Collections.Generic.ICollection IDictionary.Values { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.get_Values(objectReferenceForType); } } int global::System.Collections.Generic.ICollection, ?>>.Count { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.get_Count(objectReferenceForType); } } bool global::System.Collections.Generic.ICollection, ?>>.IsReadOnly { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.get_IsReadOnly(objectReferenceForType); } } V IDictionary.this[K key] { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.Indexer_Get(objectReferenceForType, null, key); } set { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); IDictionaryMethods.Indexer_Set(objectReferenceForType, key, value); } } static IObjectReference CreateMarshaler(IDictionary obj) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (obj != null) { return ComWrappersSupport.CreateCCWForObject(obj, PIID); } return null; } static ObjectReferenceValue CreateMarshaler2(IDictionary obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ComWrappersSupport.CreateCCWForObjectForMarshaling(obj, PIID); } static nint GetAbi(IObjectReference objRef) { return objRef?.ThisPtr ?? global::System.IntPtr.Zero; } static IDictionary FromAbi(nint thisPtr) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } if (!FeatureSwitches.EnableIDynamicInterfaceCastableSupport) { throw new NotSupportedException("'IDictionary.FromAbi' relies on 'IDynamicInterfaceCastable' support, which is not currently available. Make sure the 'EnableIDynamicInterfaceCastableSupport' property is not set to 'false'."); } return (IDictionary)(object)new IInspectable(ObjRefFromAbi(thisPtr)); } static nint FromManaged(IDictionary value) { if (value != null) { return CreateMarshaler2(value).Detach(); } return global::System.IntPtr.Zero; } static void DisposeMarshaler(IObjectReference objRef) { objRef?.Dispose(); } static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IDictionary)); } static IDictionary() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) _adapterTable = (ConditionalWeakTable, ToAbiHelper>)(object)new ConditionalWeakTable, ToAbiHelper>, IDictionary, ToAbiHelper>.ToAbiHelper>(); PIID = IDictionaryMethods.PIID; if (RuntimeFeature.IsDynamicCodeCompiled) { InitFallbackCCWVTableIfNeeded(); } AbiToProjectionVftablePtr = IDictionaryMethods.AbiToProjectionVftablePtr; [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] internal static void InitFallbackCCWVTableIfNeeded() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (IDictionaryMethods.AbiToProjectionVftablePtr == 0) { Action val = (Action)typeof(IDictionaryMethods<, , , >).MakeGenericType(new global::System.Type[4] { typeof(K), Marshaler.AbiType, typeof(V), Marshaler.AbiType }).GetMethod("InitFallbackCCWVtable", (BindingFlags)40).CreateDelegate(typeof(Action)); val.Invoke(); } } } internal static IMap FindAdapter(nint thisPtr) { IDictionary val = ComWrappersSupport.FindObject>(thisPtr); return ((ConditionalWeakTable, ToAbiHelper>, IDictionary, ToAbiHelper>.ToAbiHelper>)(object)_adapterTable).GetValue((IDictionary, ToAbiHelper>)(object)val, (CreateValueCallback, ToAbiHelper>, IDictionary, ToAbiHelper>.ToAbiHelper>)((IDictionary dictionary) => new ToAbiHelper(dictionary))); } static ObjectReference ObjRefFromAbi(nint thisPtr) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, PIID); } void IDictionary.Add(K key, V value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); IDictionaryMethods.Add(objectReferenceForType, key, value); } bool IDictionary.ContainsKey(K key) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.ContainsKey(objectReferenceForType, key); } bool IDictionary.Remove(K key) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.Remove(objectReferenceForType, key); } bool IDictionary.TryGetValue(K key, out V value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.TryGetValue(objectReferenceForType, null, key, out value); } void global::System.Collections.Generic.ICollection, ?>>.Add(KeyValuePair item) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); IDictionaryMethods.Add(objectReferenceForType, item); } bool global::System.Collections.Generic.ICollection, ?>>.Contains(KeyValuePair item) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.Contains(objectReferenceForType, null, item); } void global::System.Collections.Generic.ICollection, ?>>.CopyTo(KeyValuePair[] array, int arrayIndex) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); ((IDynamicInterfaceCastable)(IWinRTObject)this).IsInterfaceImplemented(typeof(global::System.Collections.Generic.IEnumerable>).TypeHandle, true); IObjectReference objectReferenceForType2 = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerable>).TypeHandle); IDictionaryMethods.CopyTo(objectReferenceForType, objectReferenceForType2, array, arrayIndex); } bool global::System.Collections.Generic.ICollection, ?>>.Remove(KeyValuePair item) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); return IDictionaryMethods.Remove(objectReferenceForType, item); } void global::System.Collections.Generic.ICollection, ?>>.Clear() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IDictionary).TypeHandle); IDictionaryMethods.Clear(objectReferenceForType); } global::System.Collections.Generic.IEnumerator> global::System.Collections.Generic.IEnumerable, ?>>.GetEnumerator() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) ((IDynamicInterfaceCastable)(IWinRTObject)this).IsInterfaceImplemented(typeof(global::System.Collections.Generic.IEnumerable>).TypeHandle, true); IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerable>).TypeHandle); return IEnumerableMethods>.GetEnumerator(objectReferenceForType); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable, ?>>)this).GetEnumerator(); } } public static class IDictionary_Delegates { public delegate int GetView_3(nint thisPtr, out nint __return_value__); internal unsafe delegate int GetView_3_Abi(nint thisPtr, nint* __return_value__); public delegate int Clear_6(nint thisPtr); } public static class IEnumerableMethods { private static nint abiToProjectionVftablePtr; internal static readonly Guid PIID; public static nint AbiToProjectionVftablePtr => abiToProjectionVftablePtr; public static Guid IID => PIID; static IEnumerableMethods() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PIID = GuidGenerator.CreateIIDUnsafe(typeof(IEnumerable)); ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IEnumerable), typeof(IEnumerable)); } public static global::System.Collections.Generic.IEnumerator GetEnumerator(IObjectReference obj) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) global::System.Collections.Generic.IEnumerator enumerator = IIterableMethods.First(obj); if (enumerator is FromAbiEnumerator result) { return result; } if (enumerator is IEnumeratorImpl iterator) { return new FromAbiEnumerator(iterator); } if (enumerator is ToAbiEnumeratorAdapter toAbiEnumeratorAdapter) { return toAbiEnumeratorAdapter.m_enumerator; } if (enumerator is IWinRTObject winRTObject) { return new FromAbiEnumerator(winRTObject.NativeObject); } throw new InvalidOperationException("Unexpected type for enumerator"); } internal static bool TryInitCCWVtable(nint ptr) { return Interlocked.CompareExchange(ref abiToProjectionVftablePtr, (global::System.IntPtr)ptr, global::System.IntPtr.Zero) == global::System.IntPtr.Zero; } public static global::System.Collections.Generic.IEnumerator Abi_First_0(nint thisPtr) { global::System.Collections.Generic.IEnumerable enumerable = ComWrappersSupport.FindObject>(thisPtr); return new ToAbiEnumeratorAdapter(enumerable.GetEnumerator()); } } public static class IEnumerableMethods where TAbi : unmanaged { private static IEnumerable_Delegates.First_0_Abi DelegateCache; public unsafe static bool InitRcwHelper(delegate*> first) { if (IIterableMethods._RcwHelperInitialized) { return true; } IIterableMethods._First = first; ComWrappersSupport.RegisterTypedRcwFactory(typeof(global::System.Collections.Generic.IEnumerable), IEnumerableImpl.CreateRcw); ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IEnumerable), typeof(IEnumerable)); IIterableMethods._RcwHelperInitialized = true; return true; } public unsafe static bool InitCcw(delegate* unmanaged[Stdcall] first) { if (IEnumerableMethods.AbiToProjectionVftablePtr != 0) { return false; } nint num = (nint)NativeMemory.AllocZeroed((global::System.UIntPtr)(nuint)(sizeof(IInspectable.Vftbl) + sizeof(nint))); *(IInspectable.Vftbl*)num = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(num + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)first; if (!IEnumerableMethods.TryInitCCWVtable(num)) { NativeMemory.Free((void*)num); return false; } ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IEnumerator), typeof(IEnumerator)); return true; } internal unsafe static void InitFallbackCCWVtable() { DelegateCache = Do_Abi_First_0; InitCcw((delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache)); } private unsafe static int Do_Abi_First_0(nint thisPtr, nint* __return_value__) { *__return_value__ = 0; try { *__return_value__ = MarshalInterface>.FromManaged(IEnumerableMethods.Abi_First_0(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } [DynamicInterfaceCastableImplementation] [Guid("FAA585EA-6214-4217-AFDA-7F46DE5869B3")] internal interface IEnumerable : global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable, global::Windows.Foundation.Collections.IIterable { internal sealed class ToAbiHelper : global::Windows.Foundation.Collections.IIterable { private readonly IEnumerable m_enumerable; internal ToAbiHelper(IEnumerable enumerable) { m_enumerable = enumerable; } public global::System.Collections.Generic.IEnumerator First() { return ((global::System.Collections.Generic.IEnumerable)m_enumerable).GetEnumerator(); } } [Guid("FAA585EA-6214-4217-AFDA-7F46DE5869B3")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public static readonly nint AbiToProjectionVftablePtr = IEnumerable.AbiToProjectionVftablePtr; public static readonly Guid PIID = IEnumerable.PIID; } static readonly nint AbiToProjectionVftablePtr; static readonly Guid PIID; static IObjectReference CreateMarshaler(global::System.Collections.Generic.IEnumerable obj) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (obj != null) { return ComWrappersSupport.CreateCCWForObject(obj, PIID); } return null; } static ObjectReferenceValue CreateMarshaler2(global::System.Collections.Generic.IEnumerable obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ComWrappersSupport.CreateCCWForObjectForMarshaling(obj, PIID); } static nint GetAbi(IObjectReference objRef) { return objRef?.ThisPtr ?? global::System.IntPtr.Zero; } static nint FromManaged(global::System.Collections.Generic.IEnumerable value) { if (value != null) { return CreateMarshaler2(value).Detach(); } return global::System.IntPtr.Zero; } static void DisposeMarshaler(IObjectReference objRef) { objRef?.Dispose(); } static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IEnumerable)); } static IEnumerable() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) PIID = IEnumerableMethods.PIID; if (RuntimeFeature.IsDynamicCodeCompiled) { InitFallbackCCWVTableIfNeeded(); } AbiToProjectionVftablePtr = IEnumerableMethods.AbiToProjectionVftablePtr; [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] internal static void InitFallbackCCWVTableIfNeeded() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (IEnumerableMethods.AbiToProjectionVftablePtr == 0) { Action val = (Action)typeof(IEnumerableMethods<, >).MakeGenericType(new global::System.Type[2] { typeof(T), Marshaler.AbiType }).GetMethod("InitFallbackCCWVtable", (BindingFlags)40).CreateDelegate(typeof(Action)); val.Invoke(); } } } static ObjectReference ObjRefFromAbi(nint thisPtr) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, PIID); } global::System.Collections.Generic.IEnumerator global::System.Collections.Generic.IEnumerable.GetEnumerator() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerable).TypeHandle); return IEnumerableMethods.GetEnumerator(objectReferenceForType); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable)this).GetEnumerator(); } } public static class IEnumerable_Delegates { public delegate int First_0(nint thisPtr, out nint __return_value__); internal unsafe delegate int First_0_Abi(nint thisPtr, nint* __return_value__); } internal static class IIteratorMethods { internal unsafe static volatile delegate* _GetCurrent; internal unsafe static volatile delegate* _GetMany; internal static volatile bool _RcwHelperInitialized; [MethodImpl(256)] internal static void EnsureInitialized() { if (!RuntimeFeature.IsDynamicCodeCompiled && !_RcwHelperInitialized) { ThrowNotInitialized(); } [CompilerGenerated] [DoesNotReturn] static void ThrowNotInitialized() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException($"'{typeof(global::System.Collections.Generic.IEnumerator)}' was called without initializing the RCW methods using 'IEnumeratorMethods.InitRcwHelper'. If using IDynamicInterfaceCastable support to do a dynamic cast to this interface, ensure InitRcwHelper is called."); } } public unsafe static bool MoveNext(IObjectReference obj) { nint thisPtr = obj.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &b)); GC.KeepAlive((object)obj); return b != 0; } public unsafe static uint GetMany(IObjectReference obj, ref T[] items) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { EnsureInitialized(); return _GetMany(obj, items); } if (_GetMany != (delegate*)null) { return _GetMany(obj, items); } nint thisPtr = obj.ThisPtr; object obj2 = null; int num = 0; nint num2 = 0; uint result = 0u; try { obj2 = ((Func)(object)Marshaler.CreateMarshalerArray).Invoke((T[][])(object)items); ValueTuple val = Marshaler.GetAbiArray.Invoke(obj2); num = val.Item1; num2 = val.Item2; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, num, num2, &result)); GC.KeepAlive((object)obj); items = ((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(num, num2)); return result; } finally { Marshaler.DisposeMarshalerArray.Invoke(obj2); } } public unsafe static T get_Current(IObjectReference obj) { EnsureInitialized(); return _GetCurrent(obj); } public unsafe static bool get_HasCurrent(IObjectReference obj) { nint thisPtr = obj.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &b)); GC.KeepAlive((object)obj); return b != 0; } } public static class IEnumeratorMethods { private static nint abiToProjectionVftablePtr; internal static readonly Guid PIID; public static nint AbiToProjectionVftablePtr => abiToProjectionVftablePtr; public static Guid IID => PIID; static IEnumeratorMethods() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PIID = GuidGenerator.CreateIIDUnsafe(typeof(IEnumerator)); ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IEnumerator), typeof(IEnumerator)); if (RuntimeFeature.IsDynamicCodeCompiled) { InitRcwHelperFallbackIfNeeded(); } [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] static void InitRcwHelperFallbackIfNeeded() { if (!IIteratorMethods._RcwHelperInitialized) { Func val = (Func)(object)typeof(IEnumeratorMethods<, >).MakeGenericType(new global::System.Type[2] { typeof(T), Marshaler.AbiType }).GetMethod("InitRcwHelperFallback", (BindingFlags)40).CreateDelegate(typeof(Func)); val.Invoke(); } } } public static T get_Current(IObjectReference obj) { return IIteratorMethods.get_Current(obj); } public static bool MoveNext(IObjectReference obj) { return IIteratorMethods.MoveNext(obj); } public static void Reset(IObjectReference obj) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } public static void Dispose(IObjectReference obj) { } internal static bool TryInitCCWVtable(nint ptr) { return Interlocked.CompareExchange(ref abiToProjectionVftablePtr, (global::System.IntPtr)ptr, global::System.IntPtr.Zero) == global::System.IntPtr.Zero; } public static bool Abi_MoveNext_2(nint thisPtr) { return IEnumerator.FindAdapter(thisPtr)._MoveNext(); } public static uint Abi_GetMany_3(nint thisPtr, ref T[] items) { return IEnumerator.FindAdapter(thisPtr).GetMany(ref items); } public static T Abi_get_Current_0(nint thisPtr) { return IEnumerator.FindAdapter(thisPtr)._Current; } public static bool Abi_get_HasCurrent_1(nint thisPtr) { return IEnumerator.FindAdapter(thisPtr).HasCurrent; } } public static class IEnumeratorMethods where TAbi : unmanaged { private static global::System.Delegate[] DelegateCache; public unsafe static bool InitRcwHelper(delegate* getCurrent, delegate* getMany) { if (IIteratorMethods._RcwHelperInitialized) { return true; } IIteratorMethods._GetCurrent = getCurrent; IIteratorMethods._GetMany = getMany; ComWrappersSupport.RegisterTypedRcwFactory(typeof(global::System.Collections.Generic.IEnumerator), IEnumeratorImpl.CreateRcw); ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IEnumerator), typeof(IEnumerator)); IIteratorMethods._RcwHelperInitialized = true; return true; } private unsafe static bool InitRcwHelperFallback() { return InitRcwHelper((delegate*)(&get_Current), (delegate*)null); } private unsafe static T get_Current(IObjectReference obj) { nint thisPtr = obj.ThisPtr; TAbi val = default(TAbi); try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &val)); GC.KeepAlive((object)obj); return ((Func)(object)Marshaler.FromAbi).Invoke((object)val); } finally { Marshaler.DisposeAbi.Invoke((object)val); } } public unsafe static bool InitCcw(delegate* unmanaged[Stdcall] getCurrent, delegate* unmanaged[Stdcall] hasCurrent, delegate* unmanaged[Stdcall] moveNext, delegate* unmanaged[Stdcall] getMany) { if (IEnumeratorMethods.AbiToProjectionVftablePtr != 0) { return false; } nint num = (nint)NativeMemory.AllocZeroed((global::System.UIntPtr)(nuint)(sizeof(IInspectable.Vftbl) + sizeof(nint) * 4)); *(IInspectable.Vftbl*)num = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(num + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getCurrent; *(global::System.IntPtr*)(num + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)hasCurrent; *(global::System.IntPtr*)(num + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)moveNext; *(global::System.IntPtr*)(num + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getMany; if (!IEnumeratorMethods.TryInitCCWVtable(num)) { NativeMemory.Free((void*)num); return false; } return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal unsafe static void InitFallbackCCWVtable() { global::System.Type abiDelegateType = Projections.GetAbiDelegateType(typeof(nint), typeof(TAbi*), typeof(int)); DelegateCache = new global::System.Delegate[4] { global::System.Delegate.CreateDelegate(abiDelegateType, typeof(IEnumeratorMethods).GetMethod("Do_Abi_get_Current_0", (BindingFlags)40)), new _get_PropertyAsBoolean_Abi(Do_Abi_get_HasCurrent_1), new IEnumerator_Delegates.MoveNext_2_Abi(Do_Abi_MoveNext_2), new IEnumerator_Delegates.GetMany_3_Abi(Do_Abi_GetMany_3) }; InitCcw((delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[0]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[1]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[2]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[3])); } private unsafe static int Do_Abi_MoveNext_2(nint thisPtr, byte* __return_value__) { bool flag = false; *__return_value__ = 0; try { flag = IEnumerator.FindAdapter(thisPtr)._MoveNext(); *__return_value__ = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_GetMany_3(nint thisPtr, int __itemsSize, nint items, uint* __return_value__) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) uint num = 0u; *__return_value__ = 0u; T[] items2 = ((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(__itemsSize, items)); try { num = IEnumerator.FindAdapter(thisPtr).GetMany(ref items2); ((Action)(object)Marshaler.CopyManagedArray).Invoke((T[][])(object)items2, items); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_get_Current_0(nint thisPtr, TAbi* __return_value__) { T val = default(T); *__return_value__ = default(TAbi); try { val = IEnumerator.FindAdapter(thisPtr)._Current; *__return_value__ = (TAbi)Marshaler.FromManaged.Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_get_HasCurrent_1(nint thisPtr, byte* __return_value__) { bool flag = false; *__return_value__ = 0; try { flag = IEnumerator.FindAdapter(thisPtr).HasCurrent; *__return_value__ = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } internal sealed class FromAbiEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly IIterator _iterator; private bool m_hadCurrent = true; private T m_current; private bool m_isInitialized; public T Current { get { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!m_isInitialized) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_EnumNotStarted); } if (!m_hadCurrent) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_EnumEnded); } return m_current; } } object global::System.Collections.IEnumerator.Current { get { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (!m_isInitialized) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_EnumNotStarted); } if (!m_hadCurrent) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_EnumEnded); } return m_current; } } public FromAbiEnumerator(IObjectReference obj) : this((IIterator)new IEnumeratorImpl(obj)) { } internal FromAbiEnumerator(IIterator iterator) { _iterator = iterator; } public static global::System.Collections.Generic.IEnumerator FromAbi(nint abi) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (abi == (nint)global::System.IntPtr.Zero) { return null; } return new FromAbiEnumerator(ObjectReference.FromAbi(abi, IID.IID_IUnknown)); } public static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } public bool MoveNext() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (!m_hadCurrent) { return false; } try { if (!m_isInitialized) { m_hadCurrent = _iterator.HasCurrent; m_isInitialized = true; } else { m_hadCurrent = _iterator._MoveNext(); } if (m_hadCurrent) { m_current = _iterator._Current; } } catch (global::System.Exception ex) { if (Marshal.GetHRForException(ex) == -2147483636) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_EnumFailedVersion); } throw; } return m_hadCurrent; } public void Reset() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException(); } public void Dispose() { } } internal sealed class IBindableIteratorTypeDetails : IWinRTExposedTypeDetails { public ComInterfaceEntry[] GetExposedInterfaces() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) return (ComInterfaceEntry[])(object)new ComInterfaceEntry[2] { new ComInterfaceEntry { IID = typeof(ABI.Microsoft.UI.Xaml.Interop.IBindableIterator).GUID, Vtable = ABI.Microsoft.UI.Xaml.Interop.IBindableIterator.AbiToProjectionVftablePtr }, new ComInterfaceEntry { IID = IEnumeratorMethods.IID, Vtable = ABI.Microsoft.UI.Xaml.Interop.IBindableIterator.AbiToProjectionVftablePtr } }; } } public sealed class ToAbiEnumeratorAdapter : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { internal readonly global::System.Collections.Generic.IEnumerator m_enumerator; public T Current => m_enumerator.Current; object global::System.Collections.IEnumerator.Current => m_enumerator.Current; internal ToAbiEnumeratorAdapter(global::System.Collections.Generic.IEnumerator enumerator) { m_enumerator = enumerator; } public void Dispose() { ((global::System.IDisposable)m_enumerator).Dispose(); } public bool MoveNext() { return ((global::System.Collections.IEnumerator)m_enumerator).MoveNext(); } public void Reset() { ((global::System.Collections.IEnumerator)m_enumerator).Reset(); } } [DynamicInterfaceCastableImplementation] [Guid("6A79E863-4300-459A-9966-CBB660963EE1")] internal interface IEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable, IIterator { [WinRTExposedType(typeof(IBindableIteratorTypeDetails))] public sealed class ToAbiHelper : IIterator, global::Microsoft.UI.Xaml.Interop.IBindableIterator { private readonly global::System.Collections.Generic.IEnumerator m_enumerator; private bool m_firstItem = true; private bool m_hasCurrent; public T _Current { get { if (m_firstItem) { m_firstItem = false; _MoveNext(); } if (!m_hasCurrent) { ExceptionHelpers.ThrowExceptionForHR(-2147483637); } return m_enumerator.Current; } } public bool HasCurrent { get { if (m_firstItem) { m_firstItem = false; _MoveNext(); } return m_hasCurrent; } } public object Current => _Current; internal ToAbiHelper(global::System.Collections.Generic.IEnumerator enumerator) { m_enumerator = enumerator; } public bool _MoveNext() { try { m_hasCurrent = ((global::System.Collections.IEnumerator)m_enumerator).MoveNext(); } catch (InvalidOperationException) { ExceptionHelpers.ThrowExceptionForHR(-2147483636); } return m_hasCurrent; } public uint GetMany(ref T[] items) { if (items == null) { return 0u; } int i; for (i = 0; i < items.Length; i++) { if (!HasCurrent) { break; } items[i] = _Current; _MoveNext(); } if (typeof(T) == typeof(string)) { string[] array = items as string[]; for (int j = i; j < items.Length; j++) { array[j] = string.Empty; } } return (uint)i; } public bool MoveNext() { return _MoveNext(); } uint global::Microsoft.UI.Xaml.Interop.IBindableIterator.GetMany(ref object[] items) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException(); } } [Guid("6A79E863-4300-459A-9966-CBB660963EE1")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public static readonly nint AbiToProjectionVftablePtr = IEnumerator.AbiToProjectionVftablePtr; public static readonly Guid PIID = IEnumerator.PIID; } static readonly nint AbiToProjectionVftablePtr; private static readonly ConditionalWeakTable, ToAbiHelper> _adapterTable; static readonly Guid PIID; T global::System.Collections.Generic.IEnumerator.Current { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerator).TypeHandle); return IEnumeratorMethods.get_Current(objectReferenceForType); } } object global::System.Collections.IEnumerator.Current => ((global::System.Collections.Generic.IEnumerator)this).Current; static IObjectReference CreateMarshaler(global::System.Collections.Generic.IEnumerator obj) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (obj != null) { return ComWrappersSupport.CreateCCWForObject(obj, PIID); } return null; } static ObjectReferenceValue CreateMarshaler2(global::System.Collections.Generic.IEnumerator obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ComWrappersSupport.CreateCCWForObjectForMarshaling(obj, PIID); } static nint GetAbi(IObjectReference objRef) { return objRef?.ThisPtr ?? global::System.IntPtr.Zero; } static nint FromManaged(global::System.Collections.Generic.IEnumerator value) { if (value != null) { return CreateMarshaler2(value).Detach(); } return global::System.IntPtr.Zero; } static void DisposeMarshaler(IObjectReference objRef) { objRef?.Dispose(); } static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IEnumerator)); } static IEnumerator() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) _adapterTable = (ConditionalWeakTable, ToAbiHelper>)(object)new ConditionalWeakTable>, IEnumerator>.ToAbiHelper>(); PIID = IEnumeratorMethods.PIID; if (RuntimeFeature.IsDynamicCodeCompiled) { InitFallbackCCWVTableIfNeeded(); } AbiToProjectionVftablePtr = IEnumeratorMethods.AbiToProjectionVftablePtr; [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] internal static void InitFallbackCCWVTableIfNeeded() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (IEnumeratorMethods.AbiToProjectionVftablePtr == 0) { Action val = (Action)typeof(IEnumeratorMethods<, >).MakeGenericType(new global::System.Type[2] { typeof(T), Marshaler.AbiType }).GetMethod("InitFallbackCCWVtable", (BindingFlags)40).CreateDelegate(typeof(Action)); val.Invoke(); } } } internal static ToAbiHelper FindAdapter(nint thisPtr) { global::System.Collections.Generic.IEnumerator enumerator2 = ComWrappersSupport.FindObject>(thisPtr); return ((ConditionalWeakTable>, IEnumerator>.ToAbiHelper>)(object)_adapterTable).GetValue((global::System.Collections.Generic.IEnumerator>)enumerator2, (CreateValueCallback>, IEnumerator>.ToAbiHelper>)((global::System.Collections.Generic.IEnumerator enumerator) => new ToAbiHelper(enumerator))); } static ObjectReference ObjRefFromAbi(nint thisPtr) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, PIID); } bool global::System.Collections.IEnumerator.MoveNext() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerator).TypeHandle); return IEnumeratorMethods.MoveNext(objectReferenceForType); } void global::System.Collections.IEnumerator.Reset() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerator).TypeHandle); IEnumeratorMethods.Reset(objectReferenceForType); } void global::System.IDisposable.Dispose() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerator).TypeHandle); IEnumeratorMethods.Dispose(objectReferenceForType); } } public static class IEnumerator_Delegates { public delegate int MoveNext_2(nint thisPtr, out byte __return_value__); public delegate int GetMany_3(nint thisPtr, int __itemsSize, nint items, out uint __return_value__); internal unsafe delegate int MoveNext_2_Abi(nint thisPtr, byte* __return_value__); internal unsafe delegate int GetMany_3_Abi(nint thisPtr, int __itemsSize, nint items, uint* __return_value__); } public static class IListMethods { private static nint abiToProjectionVftablePtr; internal static readonly Guid PIID; public static nint AbiToProjectionVftablePtr => abiToProjectionVftablePtr; public static Guid IID => PIID; static IListMethods() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PIID = GuidGenerator.CreateIIDUnsafe(typeof(IList)); ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IList), typeof(IList)); if (RuntimeFeature.IsDynamicCodeCompiled) { InitRcwHelperFallbackIfNeeded(); } [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] static void InitRcwHelperFallbackIfNeeded() { if (!IVectorMethods._RcwHelperInitialized) { Func val = (Func)(object)typeof(IListMethods<, >).MakeGenericType(new global::System.Type[2] { typeof(T), Marshaler.AbiType }).GetMethod("InitRcwHelperFallback", (BindingFlags)40).CreateDelegate(typeof(Func)); val.Invoke(); } } } public static int get_Count(IObjectReference obj) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) uint num = IVectorMethods.get_Size(obj); if (2147483647 < num) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingListTooLarge); } return (int)num; } public static bool get_IsReadOnly(IObjectReference obj) { return false; } public static void Add(IObjectReference obj, T item) { IVectorMethods.Append(obj, item); } public static void Clear(IObjectReference obj) { IVectorMethods.Clear(obj); } public static bool Contains(IObjectReference obj, T item) { uint index; return IVectorMethods.IndexOf(obj, item, out index); } public static void CopyTo(IObjectReference obj, T[] array, int arrayIndex) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (array == null) { throw new ArgumentNullException("array"); } if (arrayIndex < 0) { throw new ArgumentOutOfRangeException("arrayIndex"); } if (array.Length <= arrayIndex && get_Count(obj) > 0) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_IndexOutOfArrayBounds); } if (array.Length - arrayIndex < get_Count(obj)) { throw new ArgumentException(WinRTRuntimeErrorStrings.Argument_InsufficientSpaceToCopyCollection); } int num = get_Count(obj); for (int i = 0; i < num; i++) { array[i + arrayIndex] = GetAtHelper(obj, (uint)i); } } public static bool Remove(IObjectReference obj, T item) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!IVectorMethods.IndexOf(obj, item, out var index)) { return false; } if (2147483647 < index) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingListTooLarge); } RemoveAtHelper(obj, index); return true; } public static T Indexer_Get(IObjectReference obj, int index) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } return GetAtHelper(obj, (uint)index); } public static void Indexer_Set(IObjectReference obj, int index, T value) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } SetAtHelper(obj, (uint)index, value); } public static int IndexOf(IObjectReference obj, T item) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!IVectorMethods.IndexOf(obj, item, out var index)) { return -1; } if (2147483647 < index) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingListTooLarge); } return (int)index; } public static void Insert(IObjectReference obj, int index, T item) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } InsertAtHelper(obj, (uint)index, item); } public static void RemoveAt(IObjectReference obj, int index) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } RemoveAtHelper(obj, (uint)index); } internal static T GetAtHelper(IObjectReference obj, uint index) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { return IVectorMethods.GetAt(obj, index); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } private static void SetAtHelper(IObjectReference obj, uint index, T value) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { IVectorMethods.SetAt(obj, index, value); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } private static void InsertAtHelper(IObjectReference obj, uint index, T item) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { IVectorMethods.InsertAt(obj, index, item); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } internal static void RemoveAtHelper(IObjectReference obj, uint index) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) try { IVectorMethods.RemoveAt(obj, index); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } internal static bool TryInitCCWVtable(nint ptr) { return Interlocked.CompareExchange(ref abiToProjectionVftablePtr, (global::System.IntPtr)ptr, global::System.IntPtr.Zero) == global::System.IntPtr.Zero; } public static T Abi_GetAt_0(nint thisPtr, uint index) { return IList.FindAdapter(thisPtr).GetAt(index); } public static global::System.Collections.Generic.IReadOnlyList Abi_GetView_2(nint thisPtr) { return IList.FindAdapter(thisPtr).GetView(); } public static bool Abi_IndexOf_3(nint thisPtr, T value, out uint index) { return IList.FindAdapter(thisPtr).IndexOf(value, out index); } public static void Abi_SetAt_4(nint thisPtr, uint index, T value) { IList.FindAdapter(thisPtr).SetAt(index, value); } public static void Abi_InsertAt_5(nint thisPtr, uint index, T value) { IList.FindAdapter(thisPtr).InsertAt(index, value); } public static void Abi_RemoveAt_6(nint thisPtr, uint index) { IList.FindAdapter(thisPtr).RemoveAt(index); } public static void Abi_Append_7(nint thisPtr, T value) { IList.FindAdapter(thisPtr).Append(value); } public static void Abi_RemoveAtEnd_8(nint thisPtr) { IList.FindAdapter(thisPtr).RemoveAtEnd(); } public static void Abi_Clear_9(nint thisPtr) { IList.FindAdapter(thisPtr)._Clear(); } public static uint Abi_GetMany_10(nint thisPtr, uint startIndex, ref T[] items) { return IList.FindAdapter(thisPtr).GetMany(startIndex, ref items); } public static void Abi_ReplaceAll_11(nint thisPtr, T[] items) { IList.FindAdapter(thisPtr).ReplaceAll(items); } public static uint Abi_get_Size_1(nint thisPtr) { return IList.FindAdapter(thisPtr).Size; } internal unsafe static bool EnsureEnumerableInitialized() { return IVectorMethods._EnsureEnumerableInitialized(); } } public static class IListMethods where TAbi : unmanaged { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private sealed class DelegateHelper { private readonly nint _ptr; private global::System.Delegate _indexOfDelegate; private global::System.Delegate _setAtDelegate; private global::System.Delegate _insertAtDelegate; private global::System.Delegate _appendDelegate; public global::System.Delegate IndexOf => _indexOfDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _indexOfDelegate, IListMethods.IndexOf_3_Type, 9); public global::System.Delegate SetAt => _setAtDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _setAtDelegate, IListMethods.SetAtInsertAt_Type, 10); public global::System.Delegate InsertAt => _insertAtDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _insertAtDelegate, IListMethods.SetAtInsertAt_Type, 11); public global::System.Delegate Append => _appendDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _appendDelegate, IListMethods.Append_7_Type, 13); private DelegateHelper(nint ptr) { _ptr = ptr; } public static DelegateHelper Get(IObjectReference obj) { return (DelegateHelper)GenericDelegateHelper.DelegateTable.GetValue(obj, (CreateValueCallback)((IObjectReference objRef) => new DelegateHelper(objRef.ThisPtr))); } } private static global::System.Delegate[] DelegateCache; private static global::System.Type _indexOf_3_type; private static global::System.Type _setAtInsertAt_Type; private static global::System.Type _append_7_Type; private static global::System.Type IndexOf_3_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _indexOf_3_type ?? MakeIndexOfType(); } } private static global::System.Type SetAtInsertAt_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _setAtInsertAt_Type ?? MakeSetAtInsertAtType(); } } private static global::System.Type Append_7_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _append_7_Type ?? MakeAppendType(); } } public unsafe static bool InitRcwHelper(delegate* getAt, delegate*> getView, delegate* indexOf, delegate* setAt, delegate* insertAt, delegate* append, delegate* getMany, delegate* replaceAll) { if (IVectorMethods._RcwHelperInitialized) { return true; } IVectorMethods._GetAt = getAt; IVectorMethods._GetView = getView; IVectorMethods._IndexOf = indexOf; IVectorMethods._SetAt = setAt; IVectorMethods._InsertAt = insertAt; IVectorMethods._Append = append; IVectorMethods._GetMany = getMany; IVectorMethods._ReplaceAll = replaceAll; ComWrappersSupport.RegisterTypedRcwFactory(typeof(global::System.Collections.Generic.IList), IListImpl.CreateRcw); ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IList), typeof(IList)); IVectorMethods._RcwHelperInitialized = true; return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool InitRcwHelperFallback() { return InitRcwHelper((delegate*)(&GetAtDynamic), (delegate*>)null, (delegate*)(delegate*)(&IndexOfDynamic), (delegate*)(&SetAtDynamic), (delegate*)(&InsertAtDynamic), (delegate*)(&AppendDynamic), (delegate*)null, (delegate*)null); } private unsafe static T GetAtDynamic(IObjectReference obj, uint index) { nint thisPtr = obj.ThisPtr; TAbi val = default(TAbi); try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, index, &val)); GC.KeepAlive((object)obj); return ((Func)(object)Marshaler.FromAbi).Invoke((object)val); } finally { Marshaler.DisposeAbi.Invoke((object)val); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool IndexOfDynamic(IObjectReference obj, T value, out uint index) { nint thisPtr = obj.ThisPtr; object obj2 = null; uint num = default(uint); byte b = default(byte); object[] array = new object[4] { thisPtr, null, (nint)(&num), (nint)(&b) }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(value); array[1] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).IndexOf.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); index = num; return b != 0; } finally { Marshaler.DisposeMarshaler.Invoke(obj2); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private static void SetAtDynamic(IObjectReference obj, uint index, T value) { nint thisPtr = obj.ThisPtr; object obj2 = null; object[] array = new object[3] { thisPtr, index, null }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(value); array[2] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).SetAt.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); } finally { Marshaler.DisposeMarshaler.Invoke(obj2); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private static void InsertAtDynamic(IObjectReference obj, uint index, T value) { nint thisPtr = obj.ThisPtr; object obj2 = null; object[] array = new object[3] { thisPtr, index, null }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(value); array[2] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).InsertAt.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); } finally { Marshaler.DisposeMarshaler.Invoke(obj2); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private static void AppendDynamic(IObjectReference obj, T value) { nint thisPtr = obj.ThisPtr; object obj2 = null; object[] array = new object[2] { thisPtr, null }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(value); array[1] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).Append.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); } finally { Marshaler.DisposeMarshaler.Invoke(obj2); } } public unsafe static bool InitCcw(delegate* unmanaged[Stdcall] getAt, delegate* unmanaged[Stdcall] getSize, delegate* unmanaged[Stdcall] getView, delegate* unmanaged[Stdcall] indexOf, delegate* unmanaged[Stdcall] setAt, delegate* unmanaged[Stdcall] insertAt, delegate* unmanaged[Stdcall] removeAt, delegate* unmanaged[Stdcall] append, delegate* unmanaged[Stdcall] removeAtEnd, delegate* unmanaged[Stdcall] clear, delegate* unmanaged[Stdcall] getMany, delegate* unmanaged[Stdcall] replaceAll) { if (IListMethods.AbiToProjectionVftablePtr != 0) { return false; } nint num = (nint)NativeMemory.AllocZeroed((global::System.UIntPtr)(nuint)(sizeof(IInspectable.Vftbl) + sizeof(nint) * 12)); *(IInspectable.Vftbl*)num = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(num + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getAt; *(global::System.IntPtr*)(num + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getSize; *(global::System.IntPtr*)(num + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getView; *(global::System.IntPtr*)(num + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)indexOf; *(global::System.IntPtr*)(num + (nint)10 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)setAt; *(global::System.IntPtr*)(num + (nint)11 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)insertAt; *(global::System.IntPtr*)(num + (nint)12 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)removeAt; *(global::System.IntPtr*)(num + (nint)13 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)append; *(global::System.IntPtr*)(num + (nint)14 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)removeAtEnd; *(global::System.IntPtr*)(num + (nint)15 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)clear; *(global::System.IntPtr*)(num + (nint)16 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getMany; *(global::System.IntPtr*)(num + (nint)17 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)replaceAll; if (!IListMethods.TryInitCCWVtable(num)) { NativeMemory.Free((void*)num); return false; } ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IReadOnlyList), typeof(IReadOnlyList)); return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal unsafe static void InitFallbackCCWVtable() { global::System.Type abiDelegateType = Projections.GetAbiDelegateType(typeof(void*), typeof(uint), typeof(TAbi*), typeof(int)); DelegateCache = new global::System.Delegate[12] { global::System.Delegate.CreateDelegate(abiDelegateType, typeof(IListMethods).GetMethod("Do_Abi_GetAt_0", (BindingFlags)40)), new _get_PropertyAsUInt32_Abi(Do_Abi_get_Size_1), new IList_Delegates.GetView_2_Abi(Do_Abi_GetView_2), global::System.Delegate.CreateDelegate(IndexOf_3_Type, typeof(IListMethods).GetMethod("Do_Abi_IndexOf_3", (BindingFlags)40)), global::System.Delegate.CreateDelegate(SetAtInsertAt_Type, typeof(IListMethods).GetMethod("Do_Abi_SetAt_4", (BindingFlags)40)), global::System.Delegate.CreateDelegate(SetAtInsertAt_Type, typeof(IListMethods).GetMethod("Do_Abi_InsertAt_5", (BindingFlags)40)), new IList_Delegates.RemoveAt_6(Do_Abi_RemoveAt_6), global::System.Delegate.CreateDelegate(Append_7_Type, typeof(IListMethods).GetMethod("Do_Abi_Append_7", (BindingFlags)40)), new IList_Delegates.RemoveAtEnd_8(Do_Abi_RemoveAtEnd_8), new IList_Delegates.Clear_9(Do_Abi_Clear_9), new IList_Delegates.GetMany_10_Abi(Do_Abi_GetMany_10), new IList_Delegates.ReplaceAll_11(Do_Abi_ReplaceAll_11) }; InitCcw((delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[0]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[1]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[2]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[3]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[4]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[5]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[6]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[7]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[8]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[9]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[10]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[11])); } private unsafe static int Do_Abi_GetAt_0(void* thisPtr, uint index, TAbi* __return_value__) { T val = default(T); *__return_value__ = default(TAbi); try { val = IList.FindAdapter(new global::System.IntPtr(thisPtr)).GetAt(index); *__return_value__ = (TAbi)Marshaler.FromManaged.Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_GetView_2(nint thisPtr, nint* __return_value__) { global::System.Collections.Generic.IReadOnlyList readOnlyList = null; *__return_value__ = 0; try { readOnlyList = IList.FindAdapter(thisPtr).GetView(); *__return_value__ = MarshalInterface>.FromManaged(readOnlyList); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_IndexOf_3(void* thisPtr, TAbi value, uint* index, byte* __return_value__) { bool flag = false; *index = 0u; *__return_value__ = 0; uint index2 = 0u; try { flag = IList.FindAdapter(new global::System.IntPtr(thisPtr)).IndexOf(((Func)(object)Marshaler.FromAbi).Invoke((object)value), out index2); *index = index2; *__return_value__ = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_SetAt_4(void* thisPtr, uint index, TAbi value) { try { IList.FindAdapter(new global::System.IntPtr(thisPtr)).SetAt(index, ((Func)(object)Marshaler.FromAbi).Invoke((object)value)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_InsertAt_5(void* thisPtr, uint index, TAbi value) { try { IList.FindAdapter(new global::System.IntPtr(thisPtr)).InsertAt(index, ((Func)(object)Marshaler.FromAbi).Invoke((object)value)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static int Do_Abi_RemoveAt_6(nint thisPtr, uint index) { try { IList.FindAdapter(thisPtr).RemoveAt(index); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_Append_7(void* thisPtr, TAbi value) { try { IList.FindAdapter(new global::System.IntPtr(thisPtr)).Append(((Func)(object)Marshaler.FromAbi).Invoke((object)value)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static int Do_Abi_RemoveAtEnd_8(nint thisPtr) { try { IList.FindAdapter(thisPtr).RemoveAtEnd(); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static int Do_Abi_Clear_9(nint thisPtr) { try { IList.FindAdapter(thisPtr)._Clear(); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_GetMany_10(nint thisPtr, uint startIndex, int __itemsSize, nint items, uint* __return_value__) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) uint num = 0u; *__return_value__ = 0u; T[] items2 = ((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(__itemsSize, items)); try { num = IList.FindAdapter(thisPtr).GetMany(startIndex, ref items2); ((Action)(object)Marshaler.CopyManagedArray).Invoke((T[][])(object)items2, items); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static int Do_Abi_ReplaceAll_11(nint thisPtr, int __itemsSize, nint items) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) try { IList.FindAdapter(thisPtr).ReplaceAll(((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(__itemsSize, items))); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_get_Size_1(nint thisPtr, uint* __return_value__) { uint num = 0u; *__return_value__ = 0u; try { num = IList.FindAdapter(thisPtr).Size; *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeIndexOfType() { Interlocked.CompareExchange(ref _indexOf_3_type, Projections.GetAbiDelegateType(typeof(void*), typeof(TAbi), typeof(uint*), typeof(byte*), typeof(int)), (global::System.Type)null); return _indexOf_3_type; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeSetAtInsertAtType() { Interlocked.CompareExchange(ref _setAtInsertAt_Type, Projections.GetAbiDelegateType(typeof(void*), typeof(uint), typeof(TAbi), typeof(int)), (global::System.Type)null); return _setAtInsertAt_Type; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeAppendType() { Interlocked.CompareExchange(ref _append_7_Type, Projections.GetAbiDelegateType(typeof(void*), typeof(TAbi), typeof(int)), (global::System.Type)null); return _append_7_Type; } } internal static class IVectorMethods { internal unsafe static volatile delegate* _GetAt; internal unsafe static volatile delegate*> _GetView; internal unsafe static volatile delegate* _IndexOf; internal unsafe static volatile delegate* _SetAt; internal unsafe static volatile delegate* _InsertAt; internal unsafe static volatile delegate* _Append; internal unsafe static volatile delegate* _GetMany; internal unsafe static volatile delegate* _ReplaceAll; internal static volatile bool _RcwHelperInitialized; internal unsafe static volatile delegate* _EnsureEnumerableInitialized; [MethodImpl(256)] internal static void EnsureInitialized() { if (!RuntimeFeature.IsDynamicCodeCompiled && !_RcwHelperInitialized) { ThrowNotInitialized(); } [CompilerGenerated] [DoesNotReturn] static void ThrowNotInitialized() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException($"Type '{typeof(global::System.Collections.Generic.IList)}' was called without initializing the RCW methods using 'IListMethods.InitRcwHelper'. If using 'IDynamicInterfaceCastable' support to do a dynamic cast to this interface, ensure the 'InitRcwHelper' method is called."); } } public unsafe static uint get_Size(IObjectReference obj) { nint thisPtr = obj.ThisPtr; uint result = 0u; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &result)); GC.KeepAlive((object)obj); return result; } public unsafe static T GetAt(IObjectReference obj, uint index) { EnsureInitialized(); return _GetAt(obj, index); } public unsafe static global::System.Collections.Generic.IReadOnlyList GetView(IObjectReference obj) { if (!RuntimeFeature.IsDynamicCodeCompiled) { EnsureInitialized(); return _GetView(obj); } if (_GetView != (delegate*>)null) { return _GetView(obj); } nint thisPtr = obj.ThisPtr; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &num)); GC.KeepAlive((object)obj); return MarshalInterface>.FromAbi(num); } finally { MarshalInterface>.DisposeAbi(num); } } public unsafe static bool IndexOf(IObjectReference obj, T value, out uint index) { EnsureInitialized(); return _IndexOf(obj, value, ref index); } public unsafe static void SetAt(IObjectReference obj, uint index, T value) { EnsureInitialized(); _SetAt(obj, index, value); } public unsafe static void InsertAt(IObjectReference obj, uint index, T value) { EnsureInitialized(); _InsertAt(obj, index, value); } public unsafe static void RemoveAt(IObjectReference obj, uint index) { nint thisPtr = obj.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)12 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, index)); GC.KeepAlive((object)obj); } public unsafe static void Append(IObjectReference obj, T value) { EnsureInitialized(); _Append(obj, value); } public unsafe static void RemoveAtEnd(IObjectReference obj) { nint thisPtr = obj.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)14 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr)); GC.KeepAlive((object)obj); } public unsafe static void Clear(IObjectReference obj) { nint thisPtr = obj.ThisPtr; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)15 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr)); GC.KeepAlive((object)obj); } public unsafe static uint GetMany(IObjectReference obj, uint startIndex, ref T[] items) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { EnsureInitialized(); return _GetMany(obj, startIndex, items); } if (_GetMany != (delegate*)null) { return _GetMany(obj, startIndex, items); } nint thisPtr = obj.ThisPtr; object obj2 = null; int num = 0; nint num2 = 0; uint result = 0u; try { obj2 = ((Func)(object)Marshaler.CreateMarshalerArray).Invoke((T[][])(object)items); ValueTuple val = Marshaler.GetAbiArray.Invoke(obj2); num = val.Item1; num2 = val.Item2; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)16 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, startIndex, num, num2, &result)); GC.KeepAlive((object)obj); items = ((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(num, num2)); return result; } finally { Marshaler.DisposeMarshalerArray.Invoke(obj2); } } public unsafe static void ReplaceAll(IObjectReference obj, T[] items) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { EnsureInitialized(); _ReplaceAll(obj, items); return; } if (_ReplaceAll != (delegate*)null) { _ReplaceAll(obj, items); return; } nint thisPtr = obj.ThisPtr; object obj2 = null; int num = 0; nint num2 = 0; try { obj2 = ((Func)(object)Marshaler.CreateMarshalerArray).Invoke((T[][])(object)items); ValueTuple val = Marshaler.GetAbiArray.Invoke(obj2); num = val.Item1; num2 = val.Item2; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)17 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, num, num2)); GC.KeepAlive((object)obj); } finally { Marshaler.DisposeMarshalerArray.Invoke(obj2); } } } [DynamicInterfaceCastableImplementation] [Guid("913337E9-11A1-4345-A3A2-4E7F956E222D")] internal interface IList : global::System.Collections.Generic.IList, global::System.Collections.Generic.ICollection, global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable, IVector, global::Windows.Foundation.Collections.IIterable { public sealed class ToAbiHelper : IVector, global::Windows.Foundation.Collections.IIterable { private readonly global::System.Collections.Generic.IList _list; public uint Size => (uint)((global::System.Collections.Generic.ICollection)_list).Count; public ToAbiHelper(global::System.Collections.Generic.IList list) { _list = list; } global::System.Collections.Generic.IEnumerator global::Windows.Foundation.Collections.IIterable.First() { return ((global::System.Collections.Generic.IEnumerable)_list).GetEnumerator(); } private static void EnsureIndexInt32(uint index, int limit = 2147483647) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (2147483647 <= index || index >= (uint)limit) { global::System.Exception ex = (global::System.Exception)new ArgumentOutOfRangeException("index", WinRTRuntimeErrorStrings.ArgumentOutOfRange_IndexLargerThanMaxValue); ex.SetHResult(-2147483637); throw ex; } } public T GetAt(uint index) { //IL_0021: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.Generic.ICollection)_list).Count); try { return _list[(int)index]; } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException innerException = val; throw ((global::System.Exception)(object)innerException).GetExceptionForHR(-2147483637, WinRTRuntimeErrorStrings.ArgumentOutOfRange_Index); } } global::System.Collections.Generic.IReadOnlyList IVector.GetView() { global::System.Collections.Generic.IReadOnlyList readOnlyList = _list as global::System.Collections.Generic.IReadOnlyList; if (readOnlyList == null) { readOnlyList = (global::System.Collections.Generic.IReadOnlyList)new ReadOnlyCollection(_list); } return readOnlyList; } public bool IndexOf(T value, out uint index) { int num = _list.IndexOf(value); if (-1 == num) { index = 0u; return false; } index = (uint)num; return true; } public void SetAt(uint index, T value) { //IL_0021: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.Generic.ICollection)_list).Count); try { _list[(int)index] = value; } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException innerException = val; throw ((global::System.Exception)(object)innerException).GetExceptionForHR(-2147483637, WinRTRuntimeErrorStrings.ArgumentOutOfRange_Index); } } public void InsertAt(uint index, T value) { //IL_0023: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.Generic.ICollection)_list).Count + 1); try { _list.Insert((int)index, value); } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException ex = val; ((global::System.Exception)(object)ex).SetHResult(-2147483637); throw; } } public void RemoveAt(uint index) { //IL_0020: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.Generic.ICollection)_list).Count); try { _list.RemoveAt((int)index); } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException ex = val; ((global::System.Exception)(object)ex).SetHResult(-2147483637); throw; } } public void Append(T value) { ((global::System.Collections.Generic.ICollection)_list).Add(value); } public void RemoveAtEnd() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (((global::System.Collections.Generic.ICollection)_list).Count == 0) { global::System.Exception ex = (global::System.Exception)new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CannotRemoveLastFromEmptyCollection); ex.SetHResult(-2147483637); throw ex; } uint count = (uint)((global::System.Collections.Generic.ICollection)_list).Count; RemoveAt(count - 1); } public void _Clear() { ((global::System.Collections.Generic.ICollection)_list).Clear(); } public uint GetMany(uint startIndex, ref T[] items) { return GetManyHelper(_list, startIndex, items); } public void ReplaceAll(T[] items) { ((global::System.Collections.Generic.ICollection)_list).Clear(); if (items != null) { foreach (T val in items) { ((global::System.Collections.Generic.ICollection)_list).Add(val); } } } private static uint GetManyHelper(global::System.Collections.Generic.IList sourceList, uint startIndex, T[] items) { if (startIndex == ((global::System.Collections.Generic.ICollection)sourceList).Count) { return 0u; } EnsureIndexInt32(startIndex, ((global::System.Collections.Generic.ICollection)sourceList).Count); if (items == null) { return 0u; } uint num = Math.Min((uint)items.Length, (uint)((global::System.Collections.Generic.ICollection)sourceList).Count - startIndex); for (uint num2 = 0u; num2 < num; num2++) { items[num2] = sourceList[(int)(num2 + startIndex)]; } if (typeof(T) == typeof(string)) { string[] array = items as string[]; for (uint num3 = num; num3 < items.Length; num3++) { array[num3] = string.Empty; } } return num; } } [Guid("913337E9-11A1-4345-A3A2-4E7F956E222D")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public static readonly nint AbiToProjectionVftablePtr = IList.AbiToProjectionVftablePtr; public static readonly Guid PIID = IList.PIID; } static readonly nint AbiToProjectionVftablePtr; private static readonly ConditionalWeakTable, ToAbiHelper> _adapterTable; static readonly Guid PIID; uint IVector.Size { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IVectorMethods.get_Size(objectReferenceForType); } } int global::System.Collections.Generic.ICollection.Count { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IListMethods.get_Count(objectReferenceForType); } } bool global::System.Collections.Generic.ICollection.IsReadOnly { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IListMethods.get_IsReadOnly(objectReferenceForType); } } T global::System.Collections.Generic.IList.this[int index] { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IListMethods.Indexer_Get(objectReferenceForType, index); } set { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IListMethods.Indexer_Set(objectReferenceForType, index, value); } } static IObjectReference CreateMarshaler(global::System.Collections.Generic.IList obj) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (obj != null) { return ComWrappersSupport.CreateCCWForObject(obj, PIID); } return null; } static ObjectReferenceValue CreateMarshaler2(global::System.Collections.Generic.IList obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ComWrappersSupport.CreateCCWForObjectForMarshaling(obj, PIID); } static nint GetAbi(IObjectReference objRef) { return objRef?.ThisPtr ?? global::System.IntPtr.Zero; } static nint FromManaged(global::System.Collections.Generic.IList value) { if (value != null) { return CreateMarshaler2(value).Detach(); } return global::System.IntPtr.Zero; } static void DisposeMarshaler(IObjectReference objRef) { objRef?.Dispose(); } static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IList)); } static IList() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) _adapterTable = (ConditionalWeakTable, ToAbiHelper>)(object)new ConditionalWeakTable>, IList>.ToAbiHelper>(); PIID = IListMethods.PIID; if (RuntimeFeature.IsDynamicCodeCompiled) { InitFallbackCCWVTableIfNeeded(); } AbiToProjectionVftablePtr = IListMethods.AbiToProjectionVftablePtr; [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] internal static void InitFallbackCCWVTableIfNeeded() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (IListMethods.AbiToProjectionVftablePtr == 0) { Action val = (Action)typeof(IListMethods<, >).MakeGenericType(new global::System.Type[2] { typeof(T), Marshaler.AbiType }).GetMethod("InitFallbackCCWVtable", (BindingFlags)40).CreateDelegate(typeof(Action)); val.Invoke(); } } } internal static IVector FindAdapter(nint thisPtr) { global::System.Collections.Generic.IList list2 = ComWrappersSupport.FindObject>(thisPtr); return ((ConditionalWeakTable>, IList>.ToAbiHelper>)(object)_adapterTable).GetValue((global::System.Collections.Generic.IList>)list2, (CreateValueCallback>, IList>.ToAbiHelper>)((global::System.Collections.Generic.IList list) => new ToAbiHelper(list))); } static ObjectReference ObjRefFromAbi(nint thisPtr) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, PIID); } T IVector.GetAt(uint index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IVectorMethods.GetAt(objectReferenceForType, index); } global::System.Collections.Generic.IReadOnlyList IVector.GetView() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IVectorMethods.GetView(objectReferenceForType); } bool IVector.IndexOf(T value, out uint index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IVectorMethods.IndexOf(objectReferenceForType, value, out index); } void IVector.SetAt(uint index, T value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IVectorMethods.SetAt(objectReferenceForType, index, value); } void IVector.InsertAt(uint index, T value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IVectorMethods.InsertAt(objectReferenceForType, index, value); } void IVector.RemoveAt(uint index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IVectorMethods.RemoveAt(objectReferenceForType, index); } void IVector.Append(T value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IVectorMethods.Append(objectReferenceForType, value); } void IVector.RemoveAtEnd() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IVectorMethods.RemoveAtEnd(objectReferenceForType); } void IVector._Clear() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IVectorMethods.Clear(objectReferenceForType); } uint IVector.GetMany(uint startIndex, ref T[] items) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IVectorMethods.GetMany(objectReferenceForType, startIndex, ref items); } void IVector.ReplaceAll(T[] items) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IVectorMethods.ReplaceAll(objectReferenceForType, items); } int global::System.Collections.Generic.IList.IndexOf(T item) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IListMethods.IndexOf(objectReferenceForType, item); } void global::System.Collections.Generic.IList.Insert(int index, T item) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IListMethods.Insert(objectReferenceForType, index, item); } void global::System.Collections.Generic.IList.RemoveAt(int index) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IListMethods.RemoveAt(objectReferenceForType, index); } void global::System.Collections.Generic.ICollection.Add(T item) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IListMethods.Add(objectReferenceForType, item); } void global::System.Collections.Generic.ICollection.Clear() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IListMethods.Clear(objectReferenceForType); } bool global::System.Collections.Generic.ICollection.Contains(T item) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IListMethods.Contains(objectReferenceForType, item); } void global::System.Collections.Generic.ICollection.CopyTo(T[] array, int arrayIndex) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); IListMethods.CopyTo(objectReferenceForType, array, arrayIndex); } bool global::System.Collections.Generic.ICollection.Remove(T item) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IList).TypeHandle); return IListMethods.Remove(objectReferenceForType, item); } global::System.Collections.Generic.IEnumerator global::System.Collections.Generic.IEnumerable.GetEnumerator() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) ((IDynamicInterfaceCastable)(IWinRTObject)this).IsInterfaceImplemented(typeof(global::System.Collections.Generic.IEnumerable).TypeHandle, true); IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerable).TypeHandle); return IEnumerableMethods.GetEnumerator(objectReferenceForType); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable)this).GetEnumerator(); } } public static class IList_Delegates { public delegate int GetView_2(nint thisPtr, out nint __return_value__); internal unsafe delegate int GetView_2_Abi(nint thisPtr, nint* __return_value__); public delegate int RemoveAt_6(nint thisPtr, uint index); public delegate int RemoveAtEnd_8(nint thisPtr); public delegate int Clear_9(nint thisPtr); public delegate int GetMany_10(nint thisPtr, uint startIndex, int __itemsSize, nint items, out uint __return_value__); internal unsafe delegate int GetMany_10_Abi(nint thisPtr, uint startIndex, int __itemsSize, nint items, uint* __return_value__); public delegate int ReplaceAll_11(nint thisPtr, int __itemsSize, nint items); } public static class IReadOnlyDictionaryMethods { private sealed class ReadOnlyDictionaryKeyCollection : global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable { private sealed class ReadOnlyDictionaryKeyEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly IObjectReference iEnumerableObjRef; private global::System.Collections.Generic.IEnumerator> enumeration; object global::System.Collections.IEnumerator.Current => Current; public K Current => ((global::System.Collections.Generic.IEnumerator, ?>>)enumeration).Current.Key; public ReadOnlyDictionaryKeyEnumerator(IObjectReference iEnumerableObjRef) { this.iEnumerableObjRef = iEnumerableObjRef; enumeration = IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } void global::System.IDisposable.Dispose() { ((global::System.IDisposable)enumeration).Dispose(); } public bool MoveNext() { return ((global::System.Collections.IEnumerator)enumeration).MoveNext(); } public void Reset() { enumeration = IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } } private readonly IObjectReference iReadOnlyDictionaryObjRef; private volatile IObjectReference __iEnumerableObjRef; private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); public ReadOnlyDictionaryKeyCollection(IObjectReference iReadOnlyDictionaryObjRef) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (iReadOnlyDictionaryObjRef == null) { throw new ArgumentNullException("iReadOnlyDictionaryObjRef"); } this.iReadOnlyDictionaryObjRef = iReadOnlyDictionaryObjRef; } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)iReadOnlyDictionaryObjRef.As(IEnumerableMethods>.PIID), (IObjectReference)null); return __iEnumerableObjRef; } public global::System.Collections.Generic.IEnumerator GetEnumerator() { return new ReadOnlyDictionaryKeyEnumerator(iEnumerableObjRef); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)GetEnumerator(); } } private sealed class ReadOnlyDictionaryValueCollection : global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable { private sealed class ReadOnlyDictionaryValueEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly IObjectReference iEnumerableObjRef; private global::System.Collections.Generic.IEnumerator> enumeration; object global::System.Collections.IEnumerator.Current => Current; public V Current => ((global::System.Collections.Generic.IEnumerator, ?>>)enumeration).Current.Value; public ReadOnlyDictionaryValueEnumerator(IObjectReference iEnumerableObjRef) { this.iEnumerableObjRef = iEnumerableObjRef; enumeration = IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } void global::System.IDisposable.Dispose() { ((global::System.IDisposable)enumeration).Dispose(); } public bool MoveNext() { return ((global::System.Collections.IEnumerator)enumeration).MoveNext(); } public void Reset() { enumeration = IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } } private readonly IObjectReference iDictionaryObjRef; private volatile IObjectReference __iEnumerableObjRef; private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); public ReadOnlyDictionaryValueCollection(IObjectReference iDictionaryObjRef) { this.iDictionaryObjRef = iDictionaryObjRef; } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)iDictionaryObjRef.As(IEnumerableMethods>.PIID), (IObjectReference)null); return __iEnumerableObjRef; } public global::System.Collections.Generic.IEnumerator GetEnumerator() { return new ReadOnlyDictionaryValueEnumerator(iEnumerableObjRef); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)GetEnumerator(); } } private static nint abiToProjectionVftablePtr; internal static readonly Guid PIID; public static nint AbiToProjectionVftablePtr => abiToProjectionVftablePtr; public static Guid IID => PIID; static IReadOnlyDictionaryMethods() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PIID = GuidGenerator.CreateIIDUnsafe(typeof(IReadOnlyDictionary)); ComWrappersSupport.RegisterHelperType(typeof(IReadOnlyDictionary), typeof(IReadOnlyDictionary)); ComWrappersSupport.RegisterHelperType(typeof(IMapView), typeof(IReadOnlyDictionary)); if (RuntimeFeature.IsDynamicCodeCompiled) { InitRcwHelperFallbackIfNeeded(); } [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] static void InitRcwHelperFallbackIfNeeded() { if (!IMapViewMethods._RcwHelperInitialized) { Func val = (Func)(object)typeof(IReadOnlyDictionaryMethods<, , , >).MakeGenericType(new global::System.Type[4] { typeof(K), Marshaler.AbiType, typeof(V), Marshaler.AbiType }).GetMethod("InitRcwHelperFallback", (BindingFlags)40).CreateDelegate(typeof(Func)); val.Invoke(); } } } public static int get_Count(IObjectReference obj) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) uint num = IMapViewMethods.get_Size(obj); if (2147483647 < num) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingDictionaryTooLarge); } return (int)num; } public static V Indexer_Get(IObjectReference obj, K key) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } return Lookup(obj, key); } public static global::System.Collections.Generic.IEnumerable get_Keys(IObjectReference obj) { return new ReadOnlyDictionaryKeyCollection(obj); } public static global::System.Collections.Generic.IEnumerable get_Values(IObjectReference obj) { return new ReadOnlyDictionaryValueCollection(obj); } public static bool ContainsKey(IObjectReference obj, K key) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } return IMapViewMethods.HasKey(obj, key); } public static bool TryGetValue(IObjectReference obj, K key, out V value) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (key == null) { throw new ArgumentNullException("key"); } if (!IMapViewMethods.HasKey(obj, key)) { value = default(V); return false; } try { value = IMapViewMethods.Lookup(obj, key); return true; } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { value = default(V); return false; } throw; } } public static V Lookup(IObjectReference obj, K key) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) try { return IMapViewMethods.Lookup(obj, key); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new KeyNotFoundException(string.Format(WinRTRuntimeErrorStrings.Arg_KeyNotFoundWithKey, (object)((object)key).ToString())); } throw; } } internal static bool TryInitCCWVtable(nint ptr) { return Interlocked.CompareExchange(ref abiToProjectionVftablePtr, (global::System.IntPtr)ptr, global::System.IntPtr.Zero) == global::System.IntPtr.Zero; } public static V Abi_Lookup_0(nint thisPtr, K key) { return IReadOnlyDictionary.FindAdapter(thisPtr).Lookup(key); } public static bool Abi_HasKey_2(nint thisPtr, K key) { return IReadOnlyDictionary.FindAdapter(thisPtr).HasKey(key); } public static void Abi_Split_3(nint thisPtr, out nint first, out nint second) { IReadOnlyDictionary.FindAdapter(thisPtr).Split(out var first2, out var second2); first = MarshalInterface>.FromManaged(first2); second = MarshalInterface>.FromManaged(second2); } public static uint Abi_get_Size_1(nint thisPtr) { return IReadOnlyDictionary.FindAdapter(thisPtr).Size; } } public static class IReadOnlyDictionaryMethods where KAbi : unmanaged where VAbi : unmanaged { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private sealed class DelegateHelper { private readonly nint _ptr; private global::System.Delegate _lookupDelegate; private global::System.Delegate _hasKeyDelegate; public global::System.Delegate Lookup => _lookupDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _lookupDelegate, IReadOnlyDictionaryMethods.Lookup_0_Type, 6); public global::System.Delegate HasKey => _hasKeyDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _hasKeyDelegate, IReadOnlyDictionaryMethods.HasKey_2_Type, 8); private DelegateHelper(nint ptr) { _ptr = ptr; } public static DelegateHelper Get(IObjectReference obj) { return (DelegateHelper)GenericDelegateHelper.DelegateTable.GetValue(obj, (CreateValueCallback)((IObjectReference objRef) => new DelegateHelper(objRef.ThisPtr))); } } private static global::System.Delegate[] DelegateCache; private static global::System.Type _lookup_0_type; private static global::System.Type _hasKey_2_type; private static global::System.Type Lookup_0_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _lookup_0_type ?? MakeLookupType(); } } private static global::System.Type HasKey_2_Type { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] get { return _hasKey_2_type ?? MakeHasKeyType(); } } public unsafe static bool InitRcwHelper(delegate* lookup, delegate* hasKey, delegate*, ref IReadOnlyDictionary, void> _) { if (IMapViewMethods._RcwHelperInitialized) { return true; } IMapViewMethods._Lookup = lookup; IMapViewMethods._HasKey = hasKey; ComWrappersSupport.RegisterTypedRcwFactory(typeof(IReadOnlyDictionary), IReadOnlyDictionaryImpl.CreateRcw); ComWrappersSupport.RegisterHelperType(typeof(IReadOnlyDictionary), typeof(IReadOnlyDictionary)); ComWrappersSupport.RegisterHelperType(typeof(IMapView), typeof(IReadOnlyDictionary)); IMapViewMethods._RcwHelperInitialized = true; return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool InitRcwHelperFallback() { return InitRcwHelper((delegate*)(&LookupDynamic), (delegate*)(&HasKeyDynamic), (delegate*, ref IReadOnlyDictionary, void>)null); } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static V LookupDynamic(IObjectReference obj, K key) { nint thisPtr = obj.ThisPtr; object obj2 = null; VAbi val = default(VAbi); object[] array = new object[3] { thisPtr, null, (nint)(&val) }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(key); array[1] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).Lookup.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); return ((Func)(object)Marshaler.FromAbi).Invoke((object)val); } finally { Marshaler.DisposeMarshaler.Invoke(obj2); Marshaler.DisposeAbi.Invoke((object)val); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool HasKeyDynamic(IObjectReference obj, K key) { nint thisPtr = obj.ThisPtr; object obj2 = null; byte b = default(byte); object[] array = new object[3] { thisPtr, null, (nint)(&b) }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(key); array[1] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).HasKey.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); return b != 0; } finally { Marshaler.DisposeMarshaler.Invoke(obj2); } } public unsafe static bool InitCcw(delegate* unmanaged[Stdcall] lookup, delegate* unmanaged[Stdcall] getSize, delegate* unmanaged[Stdcall] hasKey, delegate* unmanaged[Stdcall] split) { if (IReadOnlyDictionaryMethods.AbiToProjectionVftablePtr != 0) { return false; } nint num = (nint)NativeMemory.AllocZeroed((global::System.UIntPtr)(nuint)(sizeof(IInspectable.Vftbl) + sizeof(nint) * 4)); *(IInspectable.Vftbl*)num = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(num + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)lookup; *(global::System.IntPtr*)(num + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getSize; *(global::System.IntPtr*)(num + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)hasKey; *(global::System.IntPtr*)(num + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)split; if (!IReadOnlyDictionaryMethods.TryInitCCWVtable(num)) { NativeMemory.Free((void*)num); return false; } return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal unsafe static void InitFallbackCCWVtable() { DelegateCache = new global::System.Delegate[4] { global::System.Delegate.CreateDelegate(Lookup_0_Type, typeof(IReadOnlyDictionaryMethods).GetMethod("Do_Abi_Lookup_0", (BindingFlags)40)), new _get_PropertyAsUInt32_Abi(Do_Abi_get_Size_1), global::System.Delegate.CreateDelegate(HasKey_2_Type, typeof(IReadOnlyDictionaryMethods).GetMethod("Do_Abi_HasKey_2", (BindingFlags)40)), new IReadOnlyDictionary_Delegates.Split_3_Abi(Do_Abi_Split_3) }; InitCcw((delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[0]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[1]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[2]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[3])); } private unsafe static int Do_Abi_Lookup_0(nint thisPtr, KAbi key, VAbi* __return_value__) { V val = default(V); *__return_value__ = default(VAbi); try { val = IReadOnlyDictionary.FindAdapter(thisPtr).Lookup(((Func)(object)Marshaler.FromAbi).Invoke((object)key)); *__return_value__ = (VAbi)((Func)(object)Marshaler.FromManaged).Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_HasKey_2(nint thisPtr, KAbi key, byte* __return_value__) { bool flag = false; *__return_value__ = 0; try { flag = IReadOnlyDictionary.FindAdapter(thisPtr).HasKey(((Func)(object)Marshaler.FromAbi).Invoke((object)key)); *__return_value__ = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_Split_3(nint thisPtr, nint* first, nint* second) { *first = 0; *second = 0; IMapView first2 = null; IMapView second2 = null; try { IReadOnlyDictionary.FindAdapter(thisPtr).Split(out first2, out second2); *first = MarshalInterface>.FromManaged(first2); *second = MarshalInterface>.FromManaged(second2); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_get_Size_1(nint thisPtr, uint* __return_value__) { uint num = 0u; *__return_value__ = 0u; try { num = IReadOnlyDictionary.FindAdapter(thisPtr).Size; *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeLookupType() { Interlocked.CompareExchange(ref _lookup_0_type, Projections.GetAbiDelegateType(typeof(nint), typeof(KAbi), typeof(VAbi*), typeof(int)), (global::System.Type)null); return _lookup_0_type; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static global::System.Type MakeHasKeyType() { Interlocked.CompareExchange(ref _hasKey_2_type, Projections.GetAbiDelegateType(typeof(nint), typeof(KAbi), typeof(byte*), typeof(int)), (global::System.Type)null); return _hasKey_2_type; } } [DefaultMember("Item")] internal sealed class ConstantSplittableMap : IMapView, global::Windows.Foundation.Collections.IIterable>, IReadOnlyDictionary, global::System.Collections.Generic.IEnumerable>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IReadOnlyCollection> { private sealed class KeyValuePairComparator : IComparer> { private static readonly IComparer keyComparator = (IComparer)(object)Comparer.Default; public int Compare(KeyValuePair x, KeyValuePair y) { return keyComparator.Compare(x.Key, y.Key); } } private static readonly KeyValuePairComparator keyValuePairComparator = new KeyValuePairComparator(); private readonly KeyValuePair[] items; private readonly int firstItemIndex; private readonly int lastItemIndex; public uint Size => (uint)(lastItemIndex - firstItemIndex + 1); public global::System.Collections.Generic.IEnumerable Keys => new ReadOnlyDictionaryKeyCollection(this); public global::System.Collections.Generic.IEnumerable Values => new ReadOnlyDictionaryValueCollection(this); public int Count => lastItemIndex - firstItemIndex + 1; public V this[K key] => Lookup(key); internal ConstantSplittableMap(IReadOnlyDictionary data) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (data == null) { throw new ArgumentNullException("data"); } firstItemIndex = 0; lastItemIndex = ((global::System.Collections.Generic.IReadOnlyCollection, ?>>)data).Count - 1; items = CreateKeyValueArray(((global::System.Collections.Generic.IReadOnlyCollection, ?>>)data).Count, ((global::System.Collections.Generic.IEnumerable, ?>>)data).GetEnumerator()); } private ConstantSplittableMap(KeyValuePair[] items, int firstItemIndex, int lastItemIndex) { this.items = items; this.firstItemIndex = firstItemIndex; this.lastItemIndex = lastItemIndex; } private KeyValuePair[] CreateKeyValueArray(int count, global::System.Collections.Generic.IEnumerator> data) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) KeyValuePair[] array = new KeyValuePair[count]; int num = 0; while (((global::System.Collections.IEnumerator)data).MoveNext()) { array[num++] = ((global::System.Collections.Generic.IEnumerator, ?>>)data).Current; } global::System.Array.Sort>(array, (IComparer>)keyValuePairComparator); return array; } public V Lookup(K key) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (!TryGetValue(key, out var value)) { global::System.Exception ex = (global::System.Exception)new KeyNotFoundException(string.Format(WinRTRuntimeErrorStrings.Arg_KeyNotFoundWithKey, (object)((object)key).ToString())); ex.SetHResult(-2147483637); throw ex; } return value; } public bool HasKey(K key) { V value; return TryGetValue(key, out value); } public global::System.Collections.Generic.IEnumerator> First() { return GetEnumerator(); } public void Split(out IMapView firstPartition, out IMapView secondPartition) { if (Count < 2) { firstPartition = null; secondPartition = null; } else { int num = (int)(((long)firstItemIndex + (long)lastItemIndex) / 2); firstPartition = new ConstantSplittableMap(items, firstItemIndex, num); secondPartition = new ConstantSplittableMap(items, num + 1, lastItemIndex); } } public bool TryGetValue(K key, out V value) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) KeyValuePair val = default(KeyValuePair); val..ctor(key, default(V)); int num = global::System.Array.BinarySearch>(items, firstItemIndex, Count, val, (IComparer>)keyValuePairComparator); if (num < 0) { value = default(V); return false; } value = items[num].Value; return true; } public bool ContainsKey(K key) { return HasKey(key); } global::System.Collections.Generic.IEnumerator> global::Windows.Foundation.Collections.IIterable>.First() { IKeyValuePair[] array = new IKeyValuePair[items.Length]; for (int i = 0; i < items.Length; i++) { array[i] = new KeyValuePair.ToIKeyValuePair(ref items[i]); } return new ConstantSplittableMapEnumerator>(array, firstItemIndex, lastItemIndex); } public global::System.Collections.Generic.IEnumerator> GetEnumerator() { return new ConstantSplittableMapEnumerator>(items, firstItemIndex, lastItemIndex); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return new ConstantSplittableMapEnumerator>(items, firstItemIndex, lastItemIndex); } } internal struct ConstantSplittableMapEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly T[] _array; private readonly int _start; private readonly int _end; private int _current; public T Current { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (_current < _start) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_EnumNotStarted); } if (_current > _end) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_EnumEnded); } return _array[_current]; } } object global::System.Collections.IEnumerator.Current => Current; internal ConstantSplittableMapEnumerator(T[] items, int first, int end) { _array = items; _start = first; _end = end; _current = _start - 1; } public bool MoveNext() { if (_current < _end) { _current++; return true; } return false; } void global::System.Collections.IEnumerator.Reset() { _current = _start - 1; } public void Dispose() { } } internal sealed class ReadOnlyDictionaryKeyCollection : global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable { private sealed class ReadOnlyDictionaryKeyEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly IReadOnlyDictionary dictionary; private global::System.Collections.Generic.IEnumerator> enumeration; object global::System.Collections.IEnumerator.Current => Current; public K Current => ((global::System.Collections.Generic.IEnumerator, ?>>)enumeration).Current.Key; public ReadOnlyDictionaryKeyEnumerator(IReadOnlyDictionary dictionary) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.dictionary = dictionary ?? throw new ArgumentNullException("dictionary"); enumeration = ((global::System.Collections.Generic.IEnumerable, ?>>)dictionary).GetEnumerator(); } void global::System.IDisposable.Dispose() { ((global::System.IDisposable)enumeration).Dispose(); } public bool MoveNext() { return ((global::System.Collections.IEnumerator)enumeration).MoveNext(); } public void Reset() { enumeration = ((global::System.Collections.Generic.IEnumerable, ?>>)dictionary).GetEnumerator(); } } private readonly IReadOnlyDictionary dictionary; public ReadOnlyDictionaryKeyCollection(IReadOnlyDictionary dictionary) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.dictionary = dictionary ?? throw new ArgumentNullException("dictionary"); } public global::System.Collections.Generic.IEnumerator GetEnumerator() { return new ReadOnlyDictionaryKeyEnumerator(dictionary); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)GetEnumerator(); } } internal sealed class ReadOnlyDictionaryValueCollection : global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable { private sealed class ReadOnlyDictionaryValueEnumerator : global::System.Collections.Generic.IEnumerator, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly IReadOnlyDictionary dictionary; private global::System.Collections.Generic.IEnumerator> enumeration; object global::System.Collections.IEnumerator.Current => Current; public V Current => ((global::System.Collections.Generic.IEnumerator, ?>>)enumeration).Current.Value; public ReadOnlyDictionaryValueEnumerator(IReadOnlyDictionary dictionary) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.dictionary = dictionary ?? throw new ArgumentNullException("dictionary"); enumeration = ((global::System.Collections.Generic.IEnumerable, ?>>)dictionary).GetEnumerator(); } void global::System.IDisposable.Dispose() { ((global::System.IDisposable)enumeration).Dispose(); } public bool MoveNext() { return ((global::System.Collections.IEnumerator)enumeration).MoveNext(); } public void Reset() { enumeration = ((global::System.Collections.Generic.IEnumerable, ?>>)dictionary).GetEnumerator(); } } private readonly IReadOnlyDictionary dictionary; public ReadOnlyDictionaryValueCollection(IReadOnlyDictionary dictionary) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.dictionary = dictionary ?? throw new ArgumentNullException("dictionary"); } public global::System.Collections.Generic.IEnumerator GetEnumerator() { return new ReadOnlyDictionaryValueEnumerator(dictionary); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)GetEnumerator(); } } [DynamicInterfaceCastableImplementation] [Guid("E480CE40-A338-4ADA-ADCF-272272E48CB9")] internal interface IReadOnlyDictionary : IReadOnlyDictionary, global::System.Collections.Generic.IEnumerable>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IReadOnlyCollection>, IMapView, global::Windows.Foundation.Collections.IIterable> { public sealed class ToAbiHelper : IMapView, global::Windows.Foundation.Collections.IIterable> { private readonly IReadOnlyDictionary _dictionary; uint IMapView.Size => (uint)((global::System.Collections.Generic.IReadOnlyCollection, ?>>)_dictionary).Count; internal ToAbiHelper(IReadOnlyDictionary dictionary) { _dictionary = dictionary; } global::System.Collections.Generic.IEnumerator> global::Windows.Foundation.Collections.IIterable>.First() { return new KeyValuePair.Enumerator(((global::System.Collections.Generic.IEnumerable, ?>>)_dictionary).GetEnumerator()); } public V Lookup(K key) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown V result = default(V); if (!_dictionary.TryGetValue(key, ref result)) { global::System.Exception ex = (global::System.Exception)new KeyNotFoundException(string.Format(WinRTRuntimeErrorStrings.Arg_KeyNotFoundWithKey, (object)((object)key).ToString())); ex.SetHResult(-2147483637); throw ex; } return result; } public uint Size() { return (uint)((global::System.Collections.Generic.IReadOnlyCollection, ?>>)_dictionary).Count; } public bool HasKey(K key) { return _dictionary.ContainsKey(key); } void IMapView.Split(out IMapView first, out IMapView second) { if (((global::System.Collections.Generic.IReadOnlyCollection, ?>>)_dictionary).Count < 2) { first = null; second = null; return; } ConstantSplittableMap constantSplittableMap = _dictionary as ConstantSplittableMap; if (constantSplittableMap == null) { constantSplittableMap = new ConstantSplittableMap(_dictionary); } constantSplittableMap.Split(out first, out second); } } [Guid("E480CE40-A338-4ADA-ADCF-272272E48CB9")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public static readonly nint AbiToProjectionVftablePtr = IReadOnlyDictionary.AbiToProjectionVftablePtr; public static readonly Guid PIID = IReadOnlyDictionary.PIID; } static readonly nint AbiToProjectionVftablePtr; private static readonly ConditionalWeakTable, ToAbiHelper> _adapterTable; static readonly Guid PIID; global::System.Collections.Generic.IEnumerable IReadOnlyDictionary.Keys { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IReadOnlyDictionary).TypeHandle); return IReadOnlyDictionaryMethods.get_Keys(objectReferenceForType); } } global::System.Collections.Generic.IEnumerable IReadOnlyDictionary.Values { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IReadOnlyDictionary).TypeHandle); return IReadOnlyDictionaryMethods.get_Values(objectReferenceForType); } } int global::System.Collections.Generic.IReadOnlyCollection, ?>>.Count { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IReadOnlyDictionary).TypeHandle); return IReadOnlyDictionaryMethods.get_Count(objectReferenceForType); } } V IReadOnlyDictionary.this[K key] { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IReadOnlyDictionary).TypeHandle); return IReadOnlyDictionaryMethods.Indexer_Get(objectReferenceForType, key); } } static IObjectReference CreateMarshaler(IReadOnlyDictionary obj) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (obj != null) { return ComWrappersSupport.CreateCCWForObject(obj, PIID); } return null; } static ObjectReferenceValue CreateMarshaler2(IReadOnlyDictionary obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ComWrappersSupport.CreateCCWForObjectForMarshaling(obj, PIID); } static nint GetAbi(IObjectReference objRef) { return objRef?.ThisPtr ?? global::System.IntPtr.Zero; } static nint FromManaged(IReadOnlyDictionary value) { if (value != null) { return CreateMarshaler2(value).Detach(); } return global::System.IntPtr.Zero; } static void DisposeMarshaler(IObjectReference objRef) { objRef?.Dispose(); } static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IReadOnlyDictionary)); } static IReadOnlyDictionary() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) _adapterTable = (ConditionalWeakTable, ToAbiHelper>)(object)new ConditionalWeakTable, ToAbiHelper>, IReadOnlyDictionary, ToAbiHelper>.ToAbiHelper>(); PIID = IReadOnlyDictionaryMethods.PIID; if (RuntimeFeature.IsDynamicCodeCompiled) { InitFallbackCCWVTableIfNeeded(); } AbiToProjectionVftablePtr = IReadOnlyDictionaryMethods.AbiToProjectionVftablePtr; [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] internal static void InitFallbackCCWVTableIfNeeded() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (IReadOnlyDictionaryMethods.AbiToProjectionVftablePtr == 0) { Action val = (Action)typeof(IReadOnlyDictionaryMethods<, , , >).MakeGenericType(new global::System.Type[4] { typeof(K), Marshaler.AbiType, typeof(V), Marshaler.AbiType }).GetMethod("InitFallbackCCWVtable", (BindingFlags)40).CreateDelegate(typeof(Action)); val.Invoke(); } } } internal static IMapView FindAdapter(nint thisPtr) { IReadOnlyDictionary val = ComWrappersSupport.FindObject>(thisPtr); return ((ConditionalWeakTable, ToAbiHelper>, IReadOnlyDictionary, ToAbiHelper>.ToAbiHelper>)(object)_adapterTable).GetValue((IReadOnlyDictionary, ToAbiHelper>)(object)val, (CreateValueCallback, ToAbiHelper>, IReadOnlyDictionary, ToAbiHelper>.ToAbiHelper>)((IReadOnlyDictionary dictionary) => new ToAbiHelper(dictionary))); } static ObjectReference ObjRefFromAbi(nint thisPtr) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, PIID); } bool IReadOnlyDictionary.ContainsKey(K key) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IReadOnlyDictionary).TypeHandle); return IReadOnlyDictionaryMethods.ContainsKey(objectReferenceForType, key); } bool IReadOnlyDictionary.TryGetValue(K key, out V value) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(IReadOnlyDictionary).TypeHandle); return IReadOnlyDictionaryMethods.TryGetValue(objectReferenceForType, key, out value); } global::System.Collections.Generic.IEnumerator> global::System.Collections.Generic.IEnumerable, ?>>.GetEnumerator() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) ((IDynamicInterfaceCastable)(IWinRTObject)this).IsInterfaceImplemented(typeof(global::System.Collections.Generic.IEnumerable>).TypeHandle, true); IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerable>).TypeHandle); return IEnumerableMethods>.GetEnumerator(objectReferenceForType); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable, ?>>)this).GetEnumerator(); } } public static class IReadOnlyDictionary_Delegates { public delegate int Split_3(nint thisPtr, out nint first, out nint second); internal unsafe delegate int Split_3_Abi(nint thisPtr, nint* first, nint* second); } public static class IReadOnlyListMethods { private static nint abiToProjectionVftablePtr; internal static readonly Guid PIID; public static nint AbiToProjectionVftablePtr => abiToProjectionVftablePtr; public static Guid IID => PIID; static IReadOnlyListMethods() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PIID = GuidGenerator.CreateIIDUnsafe(typeof(IReadOnlyList)); ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IReadOnlyList), typeof(IReadOnlyList)); } public static int get_Count(IObjectReference obj) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) uint num = IVectorViewMethods.get_Size(obj); if (2147483647 < num) { throw new InvalidOperationException(WinRTRuntimeErrorStrings.InvalidOperation_CollectionBackingListTooLarge); } return (int)num; } public static T Indexer_Get(IObjectReference obj, int index) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (index < 0) { throw new ArgumentOutOfRangeException("index"); } try { return IVectorViewMethods.GetAt(obj, (uint)index); } catch (global::System.Exception ex) { if (-2147483637 == ex.HResult) { throw new ArgumentOutOfRangeException("index"); } throw; } } internal static bool TryInitCCWVtable(nint ptr) { return Interlocked.CompareExchange(ref abiToProjectionVftablePtr, (global::System.IntPtr)ptr, global::System.IntPtr.Zero) == global::System.IntPtr.Zero; } public static T Abi_GetAt_0(nint thisPtr, uint index) { return IReadOnlyList.FindAdapter(thisPtr).GetAt(index); } public static bool Abi_IndexOf_2(nint thisPtr, T value, out uint index) { return IReadOnlyList.FindAdapter(thisPtr).IndexOf(value, out index); } public static uint Abi_GetMany_3(nint thisPtr, uint startIndex, ref T[] items) { return IReadOnlyList.FindAdapter(thisPtr).GetMany(startIndex, ref items); } public static uint Abi_get_Size_1(nint thisPtr) { return IReadOnlyList.FindAdapter(thisPtr).Size; } } public static class IReadOnlyListMethods where TAbi : unmanaged { [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private sealed class DelegateHelper { internal unsafe static global::System.Type IndexOf_2_Type = Projections.GetAbiDelegateType(typeof(nint), typeof(TAbi), typeof(uint*), typeof(byte*), typeof(int)); private readonly nint _ptr; private global::System.Delegate _indexOfDelegate; public global::System.Delegate IndexOf => _indexOfDelegate ?? GenericDelegateHelper.CreateDelegate(_ptr, ref _indexOfDelegate, IndexOf_2_Type, 8); private DelegateHelper(nint ptr) { _ptr = ptr; } public static DelegateHelper Get(IObjectReference obj) { return (DelegateHelper)GenericDelegateHelper.DelegateTable.GetValue(obj, (CreateValueCallback)((IObjectReference objRef) => new DelegateHelper(objRef.ThisPtr))); } } private static global::System.Delegate[] DelegateCache; public unsafe static bool InitRcwHelper(delegate* getAt, delegate* indexOf, delegate* getMany) { if (IVectorViewMethods._RcwHelperInitialized) { return true; } IVectorViewMethods._GetAt = getAt; IVectorViewMethods._IndexOf = indexOf; IVectorViewMethods._GetMany = getMany; ComWrappersSupport.RegisterTypedRcwFactory(typeof(global::System.Collections.Generic.IReadOnlyList), IReadOnlyListImpl.CreateRcw); ComWrappersSupport.RegisterHelperType(typeof(global::System.Collections.Generic.IReadOnlyList), typeof(IReadOnlyList)); IVectorViewMethods._RcwHelperInitialized = true; return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool InitRcwHelperFallback() { return InitRcwHelper((delegate*)(&GetAtDynamic), (delegate*)(delegate*)(&IndexOfDynamic), (delegate*)null); } private unsafe static T GetAtDynamic(IObjectReference obj, uint index) { nint thisPtr = obj.ThisPtr; TAbi val = default(TAbi); try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, index, &val)); GC.KeepAlive((object)obj); return ((Func)(object)Marshaler.FromAbi).Invoke((object)val); } finally { Marshaler.DisposeAbi.Invoke((object)val); } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private unsafe static bool IndexOfDynamic(IObjectReference obj, T value, out uint index) { nint thisPtr = obj.ThisPtr; object obj2 = null; uint num = default(uint); byte b = default(byte); object[] array = new object[4] { thisPtr, null, (nint)(&num), (nint)(&b) }; try { obj2 = Marshaler.CreateMarshaler2.Invoke(value); array[1] = Marshaler.GetAbi.Invoke(obj2); DelegateHelper.Get(obj).IndexOf.DynamicInvokeAbi(array); GC.KeepAlive((object)obj); GC.KeepAlive((object)array); index = num; return b != 0; } finally { Marshaler.DisposeMarshaler.Invoke(obj2); } } public unsafe static bool InitCcw(delegate* unmanaged[Stdcall] getAt, delegate* unmanaged[Stdcall] getSize, delegate* unmanaged[Stdcall] indexOf, delegate* unmanaged[Stdcall] getMany) { if (IReadOnlyListMethods.AbiToProjectionVftablePtr != 0) { return false; } nint num = (nint)NativeMemory.AllocZeroed((global::System.UIntPtr)(nuint)(sizeof(IInspectable.Vftbl) + sizeof(nint) * 4)); *(IInspectable.Vftbl*)num = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(num + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getAt; *(global::System.IntPtr*)(num + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getSize; *(global::System.IntPtr*)(num + (nint)8 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)indexOf; *(global::System.IntPtr*)(num + (nint)9 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getMany; if (!IReadOnlyListMethods.TryInitCCWVtable(num)) { NativeMemory.Free((void*)num); return false; } return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal unsafe static void InitFallbackCCWVtable() { global::System.Type abiDelegateType = Projections.GetAbiDelegateType(typeof(nint), typeof(uint), typeof(TAbi*), typeof(int)); DelegateCache = new global::System.Delegate[4] { global::System.Delegate.CreateDelegate(abiDelegateType, typeof(IReadOnlyListMethods).GetMethod("Do_Abi_GetAt_0", (BindingFlags)40)), new _get_PropertyAsUInt32_Abi(Do_Abi_get_Size_1), global::System.Delegate.CreateDelegate(DelegateHelper.IndexOf_2_Type, typeof(IReadOnlyListMethods).GetMethod("Do_Abi_IndexOf_2", (BindingFlags)40)), new IReadOnlyList_Delegates.GetMany_3_Abi(Do_Abi_GetMany_3) }; InitCcw((delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[0]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[1]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[2]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[3])); } private unsafe static int Do_Abi_GetAt_0(nint thisPtr, uint index, TAbi* __return_value__) { T val = default(T); *__return_value__ = default(TAbi); try { val = IReadOnlyList.FindAdapter(thisPtr).GetAt(index); *__return_value__ = (TAbi)Marshaler.FromManaged.Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_IndexOf_2(nint thisPtr, TAbi value, uint* index, byte* __return_value__) { bool flag = false; *index = 0u; *__return_value__ = 0; uint index2 = 0u; try { flag = IReadOnlyList.FindAdapter(thisPtr).IndexOf(((Func)(object)Marshaler.FromAbi).Invoke((object)value), out index2); *index = index2; *__return_value__ = (flag ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_GetMany_3(nint thisPtr, uint startIndex, int __itemsSize, nint items, uint* __return_value__) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) uint num = 0u; *__return_value__ = 0u; T[] items2 = ((Func)(object)Marshaler.FromAbiArray).Invoke((object)new ValueTuple(__itemsSize, items)); try { num = IReadOnlyList.FindAdapter(thisPtr).GetMany(startIndex, ref items2); ((Action)(object)Marshaler.CopyManagedArray).Invoke((T[][])(object)items2, items); *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_get_Size_1(nint thisPtr, uint* __return_value__) { uint num = 0u; *__return_value__ = 0u; try { num = IReadOnlyList.FindAdapter(thisPtr).Size; *__return_value__ = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } [DynamicInterfaceCastableImplementation] [Guid("BBE1FA4C-B0E3-4583-BAEF-1F1B2E483E56")] internal interface IReadOnlyList : global::System.Collections.Generic.IReadOnlyList, global::System.Collections.Generic.IEnumerable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IReadOnlyCollection, IVectorView, global::Windows.Foundation.Collections.IIterable { public sealed class ToAbiHelper : IVectorView, global::Windows.Foundation.Collections.IIterable { private readonly global::System.Collections.Generic.IReadOnlyList _list; public uint Size => (uint)((global::System.Collections.Generic.IReadOnlyCollection)_list).Count; internal ToAbiHelper(global::System.Collections.Generic.IReadOnlyList list) { _list = list; } global::System.Collections.Generic.IEnumerator global::Windows.Foundation.Collections.IIterable.First() { return ((global::System.Collections.Generic.IEnumerable)_list).GetEnumerator(); } private static void EnsureIndexInt32(uint index, int limit = 2147483647) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (2147483647 <= index || index >= (uint)limit) { global::System.Exception ex = (global::System.Exception)new ArgumentOutOfRangeException("index", WinRTRuntimeErrorStrings.ArgumentOutOfRange_IndexLargerThanMaxValue); ex.SetHResult(-2147483637); throw ex; } } public T GetAt(uint index) { //IL_0021: Expected O, but got Unknown EnsureIndexInt32(index, ((global::System.Collections.Generic.IReadOnlyCollection)_list).Count); try { return _list[(int)index]; } catch (ArgumentOutOfRangeException val) { ArgumentOutOfRangeException ex = val; ((global::System.Exception)(object)ex).SetHResult(-2147483637); throw; } } public bool IndexOf(T value, out uint index) { int num = -1; int count = ((global::System.Collections.Generic.IReadOnlyCollection)_list).Count; for (int i = 0; i < count; i++) { if (EqualityComparer.Default.Equals(value, _list[i])) { num = i; break; } } if (-1 == num) { index = 0u; return false; } index = (uint)num; return true; } public uint GetMany(uint startIndex, ref T[] items) { if (startIndex == ((global::System.Collections.Generic.IReadOnlyCollection)_list).Count) { return 0u; } EnsureIndexInt32(startIndex, ((global::System.Collections.Generic.IReadOnlyCollection)_list).Count); if (items == null) { return 0u; } uint num = Math.Min((uint)items.Length, (uint)((global::System.Collections.Generic.IReadOnlyCollection)_list).Count - startIndex); for (uint num2 = 0u; num2 < num; num2++) { items[num2] = _list[(int)(num2 + startIndex)]; } if (typeof(T) == typeof(string)) { string[] array = items as string[]; for (uint num3 = num; num3 < items.Length; num3++) { array[num3] = string.Empty; } } return num; } } [Guid("BBE1FA4C-B0E3-4583-BAEF-1F1B2E483E56")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public static readonly nint AbiToProjectionVftablePtr = IReadOnlyList.AbiToProjectionVftablePtr; public static readonly Guid PIID = IReadOnlyList.PIID; } static readonly nint AbiToProjectionVftablePtr; private static readonly ConditionalWeakTable, ToAbiHelper> _adapterTable; static readonly Guid PIID; int global::System.Collections.Generic.IReadOnlyCollection.Count { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IReadOnlyList).TypeHandle); return IReadOnlyListMethods.get_Count(objectReferenceForType); } } T global::System.Collections.Generic.IReadOnlyList.this[int index] { get { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IReadOnlyList).TypeHandle); return IReadOnlyListMethods.Indexer_Get(objectReferenceForType, index); } } static IObjectReference CreateMarshaler(global::System.Collections.Generic.IReadOnlyList obj) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (obj != null) { return ComWrappersSupport.CreateCCWForObject(obj, PIID); } return null; } static ObjectReferenceValue CreateMarshaler2(global::System.Collections.Generic.IReadOnlyList obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ComWrappersSupport.CreateCCWForObjectForMarshaling(obj, PIID); } static nint GetAbi(IObjectReference objRef) { return objRef?.ThisPtr ?? global::System.IntPtr.Zero; } static nint FromManaged(global::System.Collections.Generic.IReadOnlyList value) { if (value != null) { return CreateMarshaler2(value).Detach(); } return global::System.IntPtr.Zero; } static void DisposeMarshaler(IObjectReference objRef) { objRef?.Dispose(); } static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IReadOnlyList)); } static IReadOnlyList() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) _adapterTable = (ConditionalWeakTable, ToAbiHelper>)(object)new ConditionalWeakTable>, IReadOnlyList>.ToAbiHelper>(); PIID = IReadOnlyListMethods.PIID; if (RuntimeFeature.IsDynamicCodeCompiled) { InitFallbackCCWVTableIfNeeded(); } AbiToProjectionVftablePtr = IReadOnlyListMethods.AbiToProjectionVftablePtr; [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] internal static void InitFallbackCCWVTableIfNeeded() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (IReadOnlyListMethods.AbiToProjectionVftablePtr == 0) { Action val = (Action)typeof(IReadOnlyListMethods<, >).MakeGenericType(new global::System.Type[2] { typeof(T), Marshaler.AbiType }).GetMethod("InitFallbackCCWVtable", (BindingFlags)40).CreateDelegate(typeof(Action)); val.Invoke(); } } } internal static ToAbiHelper FindAdapter(nint thisPtr) { global::System.Collections.Generic.IReadOnlyList readOnlyList = ComWrappersSupport.FindObject>(thisPtr); return ((ConditionalWeakTable>, IReadOnlyList>.ToAbiHelper>)(object)_adapterTable).GetValue((global::System.Collections.Generic.IReadOnlyList>)readOnlyList, (CreateValueCallback>, IReadOnlyList>.ToAbiHelper>)((global::System.Collections.Generic.IReadOnlyList list) => new ToAbiHelper(list))); } static ObjectReference ObjRefFromAbi(nint thisPtr) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, PIID); } global::System.Collections.Generic.IEnumerator global::System.Collections.Generic.IEnumerable.GetEnumerator() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) ((IDynamicInterfaceCastable)(IWinRTObject)this).IsInterfaceImplemented(typeof(global::System.Collections.Generic.IEnumerable).TypeHandle, true); IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::System.Collections.Generic.IEnumerable).TypeHandle); return IEnumerableMethods.GetEnumerator(objectReferenceForType); } global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable)this).GetEnumerator(); } } public static class IReadOnlyList_Delegates { public delegate int GetMany_3(nint thisPtr, uint startIndex, int __itemsSize, nint items, out uint __return_value__); internal unsafe delegate int GetMany_3_Abi(nint thisPtr, uint startIndex, int __itemsSize, nint items, uint* __return_value__); } public static class KeyValuePairMethods { internal unsafe static volatile delegate* _GetKey; internal unsafe static volatile delegate* _GetValue; internal static volatile bool _RcwHelperInitialized; internal static readonly Guid PIID; private static nint abiToProjectionVftablePtr; public static Guid IID => PIID; public static nint AbiToProjectionVftablePtr => abiToProjectionVftablePtr; static KeyValuePairMethods() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PIID = GuidGenerator.CreateIIDUnsafe(typeof(KeyValuePair)); ComWrappersSupport.RegisterHelperType(typeof(KeyValuePair), typeof(KeyValuePair)); } internal static void EnsureInitialized() { if (!RuntimeFeature.IsDynamicCodeCompiled) { if (!_RcwHelperInitialized) { ThrowNotInitialized(); } } else { InitRcwHelperFallbackIfNeeded(); } [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] static void InitRcwHelperFallbackIfNeeded() { if (!_RcwHelperInitialized) { Func val = (Func)(object)typeof(KeyValuePairMethods<, , , >).MakeGenericType(new global::System.Type[4] { typeof(K), Marshaler.AbiType, typeof(V), Marshaler.AbiType }).GetMethod("InitRcwHelperFallback", (BindingFlags)40).CreateDelegate(typeof(Func)); val.Invoke(); } } [CompilerGenerated] [DoesNotReturn] static void ThrowNotInitialized() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException($"Type '{typeof(KeyValuePair)}' was called without initializing the RCW methods using 'KeyValuePairMethods.InitRcwHelper'. Ensure the 'InitRcwHelper' method is called."); } } internal unsafe static K GetKey(IObjectReference obj) { EnsureInitialized(); return _GetKey(obj); } internal unsafe static V GetValue(IObjectReference obj) { EnsureInitialized(); return _GetValue(obj); } internal static bool TryInitCCWVtable(nint ptr) { return Interlocked.CompareExchange(ref abiToProjectionVftablePtr, (global::System.IntPtr)ptr, global::System.IntPtr.Zero) == global::System.IntPtr.Zero; } public static K Abi_get_Key_0(nint thisPtr) { return KeyValuePair.FindAdapter(thisPtr).Key; } public static V Abi_get_Value_1(nint thisPtr) { return KeyValuePair.FindAdapter(thisPtr).Value; } } public static class KeyValuePairMethods where KAbi : unmanaged where VAbi : unmanaged { private static global::System.Delegate[] DelegateCache; public unsafe static bool InitRcwHelper(delegate* getKey, delegate* getValue) { if (KeyValuePairMethods._RcwHelperInitialized) { return true; } KeyValuePairMethods._GetKey = getKey; KeyValuePairMethods._GetValue = getValue; ComWrappersSupport.RegisterTypedRcwFactory(typeof(KeyValuePair), KeyValuePair.CreateRcw); KeyValuePairMethods._RcwHelperInitialized = true; return true; } private unsafe static bool InitRcwHelperFallback() { return InitRcwHelper((delegate*)(&get_Key), (delegate*)(&get_Value)); } private unsafe static K get_Key(IObjectReference obj) { nint thisPtr = obj.ThisPtr; KAbi val = default(KAbi); try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &val)); GC.KeepAlive((object)obj); return ((Func)(object)Marshaler.FromAbi).Invoke((object)val); } finally { Marshaler.DisposeAbi.Invoke((object)val); } } private unsafe static V get_Value(IObjectReference obj) { nint thisPtr = obj.ThisPtr; VAbi val = default(VAbi); try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &val)); GC.KeepAlive((object)obj); return ((Func)(object)Marshaler.FromAbi).Invoke((object)val); } finally { Marshaler.DisposeAbi.Invoke((object)val); } } public unsafe static bool InitCcw(delegate* unmanaged[Stdcall] getKey, delegate* unmanaged[Stdcall] getValue) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (KeyValuePairMethods.AbiToProjectionVftablePtr != 0) { return false; } nint num = (nint)NativeMemory.AllocZeroed((global::System.UIntPtr)(nuint)(sizeof(IInspectable.Vftbl) + sizeof(nint) * 2)); *(IInspectable.Vftbl*)num = IInspectable.Vftbl.AbiToProjectionVftable; *(global::System.IntPtr*)(num + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getKey; *(global::System.IntPtr*)(num + (nint)7 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)getValue; if (!KeyValuePairMethods.TryInitCCWVtable(num)) { NativeMemory.Free((void*)num); return false; } KeyValuePairHelper.TryAddKeyValuePairCCW(typeof(KeyValuePair), KeyValuePairMethods.PIID, KeyValuePairMethods.AbiToProjectionVftablePtr); return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal unsafe static void InitFallbackCCWVtable() { InitRcwHelperFallback(); global::System.Type abiDelegateType = Projections.GetAbiDelegateType(typeof(nint), typeof(KAbi*), typeof(int)); global::System.Type abiDelegateType2 = Projections.GetAbiDelegateType(typeof(nint), typeof(VAbi*), typeof(int)); DelegateCache = new global::System.Delegate[2] { global::System.Delegate.CreateDelegate(abiDelegateType, typeof(KeyValuePairMethods).GetMethod("Do_Abi_get_Key_0", (BindingFlags)40)), global::System.Delegate.CreateDelegate(abiDelegateType2, typeof(KeyValuePairMethods).GetMethod("Do_Abi_get_Value_1", (BindingFlags)40)) }; InitCcw((delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[0]), (delegate* unmanaged[Stdcall])Marshal.GetFunctionPointerForDelegate(DelegateCache[1])); } private unsafe static int Do_Abi_get_Key_0(nint thisPtr, KAbi* __return_value__) { K val = default(K); *__return_value__ = default(KAbi); try { val = KeyValuePair.FindAdapter(thisPtr).Key; *__return_value__ = (KAbi)Marshaler.FromManaged.Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private unsafe static int Do_Abi_get_Value_1(nint thisPtr, VAbi* __return_value__) { V val = default(V); *__return_value__ = default(VAbi); try { val = KeyValuePair.FindAdapter(thisPtr).Value; *__return_value__ = (VAbi)((Func)(object)Marshaler.FromManaged).Invoke(val); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } [Guid("02B51929-C1C4-4A7E-8940-0312B5C18500")] public class KeyValuePair : IKeyValuePair { internal sealed class ToIKeyValuePair : IKeyValuePair { private readonly KeyValuePair _pair; public K Key => _pair.Key; public V Value => _pair.Value; public ToIKeyValuePair([In] ref KeyValuePair pair) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) _pair = pair; } } internal struct Enumerator : global::System.Collections.Generic.IEnumerator>, global::System.Collections.IEnumerator, global::System.IDisposable { private readonly global::System.Collections.Generic.IEnumerator> _enum; public IKeyValuePair Current { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) KeyValuePair pair = ((global::System.Collections.Generic.IEnumerator, ?>>)_enum).Current; return new ToIKeyValuePair(ref pair); } } object global::System.Collections.IEnumerator.Current => Current; internal Enumerator(global::System.Collections.Generic.IEnumerator> enumerator) { _enum = enumerator; } public bool MoveNext() { return ((global::System.Collections.IEnumerator)_enum).MoveNext(); } void global::System.Collections.IEnumerator.Reset() { ((global::System.Collections.IEnumerator)_enum).Reset(); } public void Dispose() { } } [Guid("02B51929-C1C4-4A7E-8940-0312B5C18500")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public static readonly nint AbiToProjectionVftablePtr = KeyValuePair.AbiToProjectionVftablePtr; public static readonly Guid PIID = KeyValuePair.PIID; } public static readonly nint AbiToProjectionVftablePtr; private static readonly ConditionalWeakTable _adapterTable; public static readonly Guid PIID; protected readonly ObjectReference _obj; public IObjectReference ObjRef => _obj; public nint ThisPtr => _obj.ThisPtr; public K Key => KeyValuePairMethods.GetKey(_obj); public V Value => KeyValuePairMethods.GetValue(_obj); public static IObjectReference CreateMarshaler(KeyValuePair obj) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return MarshalInterface>.CreateMarshaler(obj); } public static ObjectReferenceValue CreateMarshaler2(KeyValuePair obj) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) return MarshalInterface>.CreateMarshaler2(obj); } public static nint GetAbi(IObjectReference objRef) { return objRef?.ThisPtr ?? global::System.IntPtr.Zero; } public static object CreateRcw(IInspectable obj) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) KeyValuePair keyValuePair = new KeyValuePair(obj.ObjRef); return new KeyValuePair(keyValuePair.Key, keyValuePair.Value); } public static KeyValuePair FromAbi(nint thisPtr) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return default(KeyValuePair); } KeyValuePair keyValuePair = new KeyValuePair(_FromAbi(thisPtr)); return new KeyValuePair(keyValuePair.Key, keyValuePair.Value); } public static nint FromManaged(KeyValuePair obj) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return CreateMarshaler2(obj).Detach(); } internal unsafe static void CopyManaged(KeyValuePair o, nint dest) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) *(nint*)((global::System.IntPtr)dest).ToPointer() = CreateMarshaler2(o).Detach(); } internal static MarshalInterfaceHelper>.MarshalerArray CreateMarshalerArray(KeyValuePair[] array) { return MarshalInterfaceHelper>.CreateMarshalerArray2(array, (Func, ObjectReferenceValue>)(object)(Func, ObjectReferenceValue>, ObjectReferenceValue>)((KeyValuePair o) => CreateMarshaler2(o))); } internal static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper>.GetAbiArray(box); } internal static KeyValuePair[] FromAbiArray(object box) { return MarshalInterfaceHelper>.FromAbiArray(box, (Func>)(object)(Func>>)((nint o) => FromAbi(o))); } public static ValueTuple FromManagedArray(KeyValuePair[] array) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper>.FromManagedArray(array, (Func, nint>)(object)(Func, nint>, nint>)((KeyValuePair o) => FromManaged(o))); } internal static void CopyManagedArray(KeyValuePair[] array, nint data) { MarshalInterfaceHelper>.CopyManagedArray(array, data, (Action, nint>)(object)(Action, nint>, nint>)delegate(KeyValuePair o, nint dest) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) CopyManaged(o, dest); }); } public static void CopyAbiArray(KeyValuePair[] array, object box) { MarshalInterfaceHelper>.CopyAbiArray(array, box, (Func>)(object)new Func>>(FromAbi)); } public static void DisposeMarshaler(IObjectReference value) { MarshalInterfaceHelper>.DisposeMarshaler(value); } public static void DisposeAbi(nint abi) { MarshalInterfaceHelper>.DisposeAbi(abi); } public static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(KeyValuePair)); } static KeyValuePair() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) _adapterTable = (ConditionalWeakTable)(object)new ConditionalWeakTable.ToIKeyValuePair>(); PIID = KeyValuePairMethods.IID; if (RuntimeFeature.IsDynamicCodeCompiled) { InitFallbackCCWVTableIfNeeded(); } AbiToProjectionVftablePtr = KeyValuePairMethods.AbiToProjectionVftablePtr; [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2080", Justification = "All ABI types never have a constructor that would need to be accessed via reflection.")] static void InitFallbackCCWVTableIfNeeded() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (KeyValuePairMethods.AbiToProjectionVftablePtr == 0) { Action val = (Action)typeof(KeyValuePairMethods<, , , >).MakeGenericType(new global::System.Type[4] { typeof(K), Marshaler.AbiType, typeof(V), Marshaler.AbiType }).GetMethod("InitFallbackCCWVtable", (BindingFlags)40).CreateDelegate(typeof(Action)); val.Invoke(); } } } internal static ToIKeyValuePair FindAdapter(nint thisPtr) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) KeyValuePair __this = (KeyValuePair)ComWrappersSupport.FindObject(thisPtr); return ((ConditionalWeakTable.ToIKeyValuePair>)(object)_adapterTable).GetValue((object)__this, (CreateValueCallback.ToIKeyValuePair>)((object pair) => new ToIKeyValuePair(ref __this))); } public static ObjectReference _FromAbi(nint thisPtr) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)global::System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(thisPtr, PIID); } public KeyValuePair(IObjectReference obj) : this(obj.As(PIID)) { }//IL_0002: Unknown result type (might be due to invalid IL or missing references) public KeyValuePair(ObjectReference obj) { _obj = obj; } } } namespace ABI.WinRT { internal static class EventRegistrationToken { public static string GetGuidSignature() { return "struct(Windows.Foundation.EventRegistrationToken;i8)"; } } } namespace ABI.WinRT.Interop { [EditorBrowsable(/*Could not decode attribute arguments.*/)] public sealed class EventHandlerEventSource : EventSource { private sealed class EventState : EventSourceState { public EventState(nint obj, int index) : base(obj, index) { } protected override EventHandler GetEventInvoke() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown return (EventHandler)([CompilerGenerated] (object? obj, EventArgs e) => { EventHandler? obj2 = targetDelegate; if (obj2 != null) { obj2.Invoke(obj, e); } }); } } public unsafe EventHandlerEventSource(IObjectReference objectReference, delegate* unmanaged[Stdcall] addHandler, delegate* unmanaged[Stdcall] removeHandler) : base(objectReference, addHandler, removeHandler, 0) { } protected override ObjectReferenceValue CreateMarshaler(EventHandler del) { return EventHandler.CreateMarshaler2(del); } protected override EventSourceState CreateEventSourceState() { return new EventState(base.ObjectReference.ThisPtr, base.Index); } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] public sealed class EventHandlerEventSource : EventSource> { private sealed class EventState : EventSourceState> { public EventState(nint obj, int index) : base(obj, index) { } protected override EventHandler GetEventInvoke() { return [CompilerGenerated] (object? obj, T e) => { targetDelegate?.Invoke(obj, e); }; } } public unsafe EventHandlerEventSource(IObjectReference objectReference, delegate* unmanaged[Stdcall] addHandler, delegate* unmanaged[Stdcall] removeHandler, int index) : base(objectReference, addHandler, removeHandler, index) { } protected override ObjectReferenceValue CreateMarshaler(EventHandler del) { return EventHandler.CreateMarshaler2(del); } protected override EventSourceState> CreateEventSourceState() { return new EventState(base.ObjectReference.ThisPtr, base.Index); } } internal sealed class EventSourceCache { private static readonly ReaderWriterLockSlim cachesLock = new ReaderWriterLockSlim(); private static readonly ConcurrentDictionary caches = new ConcurrentDictionary(); private readonly ConcurrentDictionary> states = new ConcurrentDictionary>(); private global::WinRT.Interop.IWeakReference target; private EventSourceCache(global::WinRT.Interop.IWeakReference target, int index, WeakReference state) { this.target = target; SetState(index, state); } private EventSourceCache Update(global::WinRT.Interop.IWeakReference target, int index, WeakReference state) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) lock (this) { using IObjectReference objectReference = this.target.Resolve(IID.IID_IUnknown); if (objectReference == null) { this.target = target; states.Clear(); } } SetState(index, state); return this; } private WeakReference GetState(int index) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) lock (this) { using IObjectReference objectReference = target.Resolve(IID.IID_IUnknown); if (objectReference == null) { return null; } } WeakReference result = default(WeakReference); if (states.TryGetValue(index, ref result)) { return result; } return null; } private void SetState(int index, WeakReference state) { states[index] = state; } public static void Create(IObjectReference obj, int index, WeakReference state) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) global::WinRT.Interop.IWeakReference target = null; if (obj.TryAs(IID.IID_IWeakReferenceSource, out ObjectReference objRef) != 0) { return; } target = IWeakReferenceSourceMethods.GetWeakReference(objRef); cachesLock.EnterReadLock(); try { caches.AddOrUpdate(obj.ThisPtr, (Func)((nint ThisPtr) => new EventSourceCache(target, index, state)), (Func)((nint ThisPtr, EventSourceCache cache) => cache.Update(target, index, state))); } finally { cachesLock.ExitReadLock(); } } public static WeakReference GetState(IObjectReference obj, int index) { EventSourceCache eventSourceCache = default(EventSourceCache); if (caches.TryGetValue(obj.ThisPtr, ref eventSourceCache)) { return eventSourceCache.GetState(index); } return null; } public static void Remove(nint thisPtr, int index, WeakReference state) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) EventSourceCache eventSourceCache = default(EventSourceCache); if (!caches.TryGetValue(thisPtr, ref eventSourceCache)) { return; } eventSourceCache.states.TryRemove(new KeyValuePair>(index, state)); if (!eventSourceCache.states.IsEmpty) { return; } cachesLock.EnterWriteLock(); try { if (eventSourceCache.states.IsEmpty) { EventSourceCache eventSourceCache2 = default(EventSourceCache); caches.TryRemove(thisPtr, ref eventSourceCache2); } } finally { cachesLock.ExitWriteLock(); } } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] public abstract class EventSourceState : global::System.IDisposable where TDelegate : class, global::System.MulticastDelegate { private bool disposedValue; private readonly nint obj; private readonly int index; private readonly WeakReference cacheEntry; private nint eventInvokePtr; private nint referenceTrackerTargetPtr; internal global::WinRT.EventRegistrationToken token; internal TDelegate? targetDelegate; internal TDelegate eventInvoke; protected TDelegate? TargetDelegate => targetDelegate; protected EventSourceState(nint thisPtr, int index) { obj = thisPtr; this.index = index; eventInvoke = GetEventInvoke(); cacheEntry = new WeakReference((object)this); } virtual ~EventSourceState() { Dispose(disposing: false); } protected abstract TDelegate GetEventInvoke(); protected virtual void Dispose(bool disposing) { if (!disposedValue) { EventSourceCache.Remove(obj, index, cacheEntry); disposedValue = true; } } public void Dispose() { GC.SuppressFinalize((object)this); Dispose(disposing: true); } internal WeakReference GetWeakReferenceForCache() { return cacheEntry; } internal void InitalizeReferenceTracking(nint ptr) { eventInvokePtr = ptr; if (Marshal.QueryInterface((global::System.IntPtr)ptr, ref global::System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_IReferenceTrackerTarget), ref referenceTrackerTargetPtr) != 0) { referenceTrackerTargetPtr = 0; } else { Marshal.Release((global::System.IntPtr)referenceTrackerTargetPtr); } } internal unsafe bool HasComReferences() { if (eventInvokePtr != 0) { IUnknownVftbl unknownVftbl = *(*(IUnknownVftbl**)eventInvokePtr); unknownVftbl.AddRef(eventInvokePtr); if (unknownVftbl.Release(eventInvokePtr) != 0) { return true; } } if (referenceTrackerTargetPtr != 0) { void** ptr = *(void***)referenceTrackerTargetPtr; ((delegate* unmanaged[Stdcall])ptr[3])(referenceTrackerTargetPtr); if (((delegate* unmanaged[Stdcall])ptr[4])(referenceTrackerTargetPtr) != 0) { return true; } } return false; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] public abstract class EventSource where TDelegate : class, global::System.MulticastDelegate { private readonly IObjectReference _objectReference; private readonly int _index; private unsafe readonly delegate* unmanaged[Stdcall] _addHandler; private unsafe readonly delegate* unmanaged[Stdcall] _removeHandler; private WeakReference? _state; protected IObjectReference ObjectReference => _objectReference; protected int Index => _index; protected unsafe EventSource(IObjectReference objectReference, delegate* unmanaged[Stdcall] addHandler, delegate* unmanaged[Stdcall] removeHandler, int index = 0) { _objectReference = objectReference; _addHandler = addHandler; _removeHandler = removeHandler; _index = index; _state = EventSourceCache.GetState(objectReference, index); } protected abstract ObjectReferenceValue CreateMarshaler(TDelegate handler); protected abstract EventSourceState CreateEventSourceState(); public unsafe void Subscribe(TDelegate handler) { lock (this) { EventSourceState state = null; bool flag = !TryGetStateUnsafe(out state) || !state.HasComReferences(); if (flag) { state = CreateEventSourceState(); _state = state.GetWeakReferenceForCache(); EventSourceCache.Create(_objectReference, _index, _state); } state.targetDelegate = (TDelegate)global::System.Delegate.Combine((global::System.Delegate)state.targetDelegate, (global::System.Delegate)handler); if (flag) { TDelegate eventInvoke = state.eventInvoke; ObjectReferenceValue objectReferenceValue = CreateMarshaler(eventInvoke); try { nint abi = objectReferenceValue.GetAbi(); state.InitalizeReferenceTracking(abi); global::WinRT.EventRegistrationToken token = default(global::WinRT.EventRegistrationToken); ExceptionHelpers.ThrowExceptionForHR(_addHandler(_objectReference.ThisPtr, abi, &token)); GC.KeepAlive((object)_objectReference); state.token = token; return; } finally { objectReferenceValue.Dispose(); } } } } public void Unsubscribe(TDelegate handler) { if (_state == null || !TryGetStateUnsafe(out EventSourceState state)) { return; } lock (this) { TDelegate targetDelegate = state.targetDelegate; state.targetDelegate = (TDelegate)global::System.Delegate.Remove((global::System.Delegate)state.targetDelegate, (global::System.Delegate)handler); if (targetDelegate != null && state.targetDelegate == null) { UnsubscribeFromNative(state); } } } private unsafe void UnsubscribeFromNative(EventSourceState state) { ExceptionHelpers.ThrowExceptionForHR(_removeHandler(_objectReference.ThisPtr, state.token)); GC.KeepAlive((object)_objectReference); state.Dispose(); _state = null; } [MethodImpl(256)] [MemberNotNullWhen(true, "_state")] private bool TryGetStateUnsafe([NotNullWhen(true)] out EventSourceState? state) { object obj = default(object); if (_state != null && _state.TryGetTarget(ref obj)) { state = global::System.Runtime.CompilerServices.Unsafe.As>(obj); return true; } state = null; return false; } } internal static class IRestrictedErrorInfoMethods { public unsafe static void GetErrorDetails(nint thisPtr, out string description, out int error, out string restrictedDescription, out string capabilitySid) { nint zero = global::System.IntPtr.Zero; nint zero2 = global::System.IntPtr.Zero; nint zero3 = global::System.IntPtr.Zero; try { fixed (int* ptr = &error) { Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(void*))))(thisPtr, &zero, ptr, &zero2, &zero3)); } description = ((zero != (nint)global::System.IntPtr.Zero) ? Marshal.PtrToStringBSTR((global::System.IntPtr)zero) : string.Empty); restrictedDescription = ((zero2 != (nint)global::System.IntPtr.Zero) ? Marshal.PtrToStringBSTR((global::System.IntPtr)zero2) : string.Empty); capabilitySid = ((zero3 != (nint)global::System.IntPtr.Zero) ? Marshal.PtrToStringBSTR((global::System.IntPtr)zero3) : string.Empty); } finally { Marshal.FreeBSTR((global::System.IntPtr)zero); Marshal.FreeBSTR((global::System.IntPtr)zero2); Marshal.FreeBSTR((global::System.IntPtr)zero3); } } public unsafe static void GetErrorDetails(nint thisPtr, out int error) { nint zero = global::System.IntPtr.Zero; nint zero2 = global::System.IntPtr.Zero; nint zero3 = global::System.IntPtr.Zero; try { fixed (int* ptr = &error) { Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(void*))))(thisPtr, &zero, ptr, &zero2, &zero3)); } } finally { Marshal.FreeBSTR((global::System.IntPtr)zero); Marshal.FreeBSTR((global::System.IntPtr)zero2); Marshal.FreeBSTR((global::System.IntPtr)zero3); } } public unsafe static string GetReference(nint thisPtr) { nint num = 0; try { Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)4 * (nint)sizeof(void*))))(thisPtr, &num)); return (num != (nint)global::System.IntPtr.Zero) ? Marshal.PtrToStringBSTR((global::System.IntPtr)num) : string.Empty; } finally { Marshal.FreeBSTR((global::System.IntPtr)num); } } } internal static class ILanguageExceptionErrorInfoMethods { public unsafe static nint GetLanguageException(nint thisPtr) { nint zero = global::System.IntPtr.Zero; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(void*))))(thisPtr, &zero)); return zero; } } internal static class ILanguageExceptionErrorInfo2Methods { public unsafe static nint GetPreviousLanguageExceptionErrorInfo(nint thisPtr) { nint result = 0; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)4 * (nint)sizeof(void*))))(thisPtr, &result)); return result; } public unsafe static void CapturePropagationContext(nint thisPtr, global::System.Exception ex) { nint num = ComWrappersSupport.CreateCCWForObjectUnsafe(ex); try { Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)5 * (nint)sizeof(void*))))(thisPtr, num)); } finally { Marshal.Release((global::System.IntPtr)num); } } public unsafe static nint GetPropagationContextHead(nint thisPtr) { nint result = 0; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(void*))))(thisPtr, &result)); return result; } } internal struct IErrorInfoVftbl { public IUnknownVftbl IUnknownVftbl; public unsafe delegate* unmanaged[Stdcall] GetGuid_0; public unsafe delegate* unmanaged[Stdcall] GetSource_1; public unsafe delegate* unmanaged[Stdcall] GetDescription_2; public unsafe delegate* unmanaged[Stdcall] GetHelpFile_3; public unsafe delegate* unmanaged[Stdcall] GetHelpFileContent_4; public static readonly IErrorInfoVftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; unsafe static IErrorInfoVftbl() { AbiToProjectionVftable = new IErrorInfoVftbl { IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl, GetGuid_0 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_GetGuid_0), GetSource_1 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_GetSource_1), GetDescription_2 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_GetDescription_2), GetHelpFile_3 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_GetHelpFile_3), GetHelpFileContent_4 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_GetHelpFileContent_4) }; nint* ptr = (nint*)Marshal.AllocCoTaskMem(sizeof(IErrorInfoVftbl)); *(IErrorInfoVftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetGuid_0(nint thisPtr, Guid* guid) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) try { global::System.Runtime.CompilerServices.Unsafe.Write(guid, ComWrappersSupport.FindObject(thisPtr).GetGuid()); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetSource_1(nint thisPtr, nint* source) { *source = global::System.IntPtr.Zero; try { string source2 = ComWrappersSupport.FindObject(thisPtr).GetSource(); *source = Marshal.StringToBSTR(source2); } catch (global::System.Exception ex) { Marshal.FreeBSTR((global::System.IntPtr)(*source)); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetDescription_2(nint thisPtr, nint* description) { *description = global::System.IntPtr.Zero; try { string description2 = ComWrappersSupport.FindObject(thisPtr).GetDescription(); *description = Marshal.StringToBSTR(description2); } catch (global::System.Exception ex) { Marshal.FreeBSTR((global::System.IntPtr)(*description)); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetHelpFile_3(nint thisPtr, nint* helpFile) { *helpFile = global::System.IntPtr.Zero; try { string helpFile2 = ComWrappersSupport.FindObject(thisPtr).GetHelpFile(); *helpFile = Marshal.StringToBSTR(helpFile2); } catch (global::System.Exception ex) { Marshal.FreeBSTR((global::System.IntPtr)(*helpFile)); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetHelpFileContent_4(nint thisPtr, nint* helpFileContent) { *helpFileContent = global::System.IntPtr.Zero; try { string helpFileContent2 = ComWrappersSupport.FindObject(thisPtr).GetHelpFileContent(); *helpFileContent = Marshal.StringToBSTR(helpFileContent2); } catch (global::System.Exception ex) { Marshal.FreeBSTR((global::System.IntPtr)(*helpFileContent)); ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } internal struct ISupportErrorInfoVftbl { public IUnknownVftbl IUnknownVftbl; public unsafe delegate* unmanaged[Stdcall] InterfaceSupportsErrorInfo_0; public static readonly ISupportErrorInfoVftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; unsafe static ISupportErrorInfoVftbl() { AbiToProjectionVftable = new ISupportErrorInfoVftbl { IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl, InterfaceSupportsErrorInfo_0 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_InterfaceSupportsErrorInfo_0) }; nint* ptr = (nint*)Marshal.AllocCoTaskMem(sizeof(ISupportErrorInfoVftbl)); *(ISupportErrorInfoVftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (nint)ptr; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_InterfaceSupportsErrorInfo_0(nint thisPtr, Guid* guid) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) try { return (!ComWrappersSupport.FindObject(thisPtr).InterfaceSupportsErrorInfo(*guid)) ? 1 : 0; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } } } public static class IActivationFactoryMethods { public static Guid IID => global::WinRT.Interop.IID.IID_IActivationFactory; public static nint AbiToProjectionVftablePtr => IActivationFactory.Vftbl.AbiToProjectionVftablePtr; [EditorBrowsable(/*Could not decode attribute arguments.*/)] public unsafe static IObjectReference ActivateInstanceUnsafe(IObjectReference objectReference, Guid iid) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) nint thisPtr = objectReference.ThisPtr; nint num = default(nint); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &num)); GC.KeepAlive((object)objectReference); try { return ComWrappersSupport.GetObjectReferenceForInterface(num, iid, requireQI: true); } finally { MarshalInspectable.DisposeAbi(num); } } } [Guid("00000035-0000-0000-C000-000000000046")] public class IActivationFactory : global::WinRT.Interop.IActivationFactory { [Guid("00000035-0000-0000-C000-000000000046")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; public unsafe delegate* unmanaged[Stdcall] ActivateInstance_0; public static readonly nint AbiToProjectionVftablePtr; unsafe static Vftbl() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IInspectable.Vftbl) + sizeof(nint)); *(Vftbl*)AbiToProjectionVftablePtr = new Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, ActivateInstance_0 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_ActivateInstance_0) }; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_ActivateInstance_0(nint thisPtr, nint* result) { nint num = 0; *result = 0; try { num = ComWrappersSupport.FindObject(thisPtr).ActivateInstance(); *result = num; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } protected readonly ObjectReference _obj; public IObjectReference ObjRef => _obj; public nint ThisPtr => _obj.ThisPtr; public IActivationFactory(IObjectReference obj) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) _obj = obj.As(IID.IID_IActivationFactory); } public unsafe nint ActivateInstance() { nint result = 0; nint thisPtr = ThisPtr; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(void*))))(thisPtr, &result)); return result; } } internal static class IAgileReferenceMethods { public unsafe static IObjectReference Resolve(IObjectReference _obj, Guid riid) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (_obj == null) { return null; } nint thisPtr = _obj.ThisPtr; nint zero = global::System.IntPtr.Zero; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &riid, &zero)); GC.KeepAlive((object)_obj); try { return ComWrappersSupport.GetObjectReferenceForInterface(zero, riid, requireQI: false); } finally { MarshalInspectable.DisposeAbi(zero); } } public unsafe static ObjectReference Resolve(IObjectReference _obj, Guid riid) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (_obj == null) { return null; } nint thisPtr = _obj.ThisPtr; nint zero = global::System.IntPtr.Zero; ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &riid, &zero)); GC.KeepAlive((object)_obj); try { return ComWrappersSupport.GetObjectReferenceForInterface(zero, riid, requireQI: false); } finally { MarshalInspectable.DisposeAbi(zero); } } } [DynamicInterfaceCastableImplementation] [Guid("C03F6A43-65A4-9818-987E-E0B810D2A6F2")] internal interface IAgileReference : global::WinRT.Interop.IAgileReference { static nint AbiToProjectionVftablePtr; unsafe static IAgileReference() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IAgileReference), sizeof(IUnknownVftbl) + sizeof(nint)); *(IUnknownVftbl*)AbiToProjectionVftablePtr = IUnknownVftbl.AbiToProjectionVftbl; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)3 * (nint)sizeof(delegate* unmanaged)) = (nint)(delegate*)(&Do_Abi_Resolve); } [UnmanagedCallersOnly] private unsafe static int Do_Abi_Resolve(nint thisPtr, Guid* riid, nint* objectReference) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReference2 = null; *objectReference = 0; try { *objectReference = ComWrappersSupport.FindObject(thisPtr).Resolve(*riid)?.GetRef() ?? global::System.IntPtr.Zero; } catch (global::System.Exception ex) { return ex.HResult; } return 0; } IObjectReference global::WinRT.Interop.IAgileReference.Resolve(Guid riid) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::WinRT.Interop.IAgileReference).TypeHandle); return IAgileReferenceMethods.Resolve(objectReferenceForType, riid); } } [DynamicInterfaceCastableImplementation] [Guid("94ea2b94-e9cc-49e0-c0ff-ee64ca8f5b90")] internal interface IAgileObject : global::WinRT.Interop.IAgileObject { static nint AbiToProjectionVftablePtr; unsafe static IAgileObject() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IAgileObject), sizeof(IUnknownVftbl)); *(IUnknownVftbl*)AbiToProjectionVftablePtr = IUnknownVftbl.AbiToProjectionVftbl; } } [Guid("00000146-0000-0000-C000-000000000046")] internal sealed class IGlobalInterfaceTable { private readonly ObjectReference _obj; public nint ThisPtr => _obj.ThisPtr; public static ObjectReference FromAbi(nint thisPtr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return ObjectReference.FromAbi(thisPtr, IID.IID_IGlobalInterfaceTable); } public IGlobalInterfaceTable(nint thisPtr) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) _obj = ObjectReference.FromAbi(thisPtr, IID.IID_IGlobalInterfaceTable); } public unsafe nint RegisterInterfaceInGlobal(nint ptr, Guid riid) { nint thisPtr = ThisPtr; nint result = default(nint); Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(void*))))(thisPtr, ptr, &riid, &result)); GC.KeepAlive((object)_obj); return result; } public unsafe void TryRevokeInterfaceFromGlobal(nint cookie) { nint thisPtr = ThisPtr; int num = ((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)4 * (nint)sizeof(void*))))(thisPtr, cookie); GC.KeepAlive((object)_obj); if (num != -2147024809) { Marshal.ThrowExceptionForHR(num); } } public unsafe IObjectReference GetInterfaceFromGlobal(nint cookie, Guid riid) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) nint thisPtr = ThisPtr; nint num = default(nint); Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)5 * (nint)sizeof(void*))))(thisPtr, cookie, &riid, &num)); GC.KeepAlive((object)_obj); try { return ComWrappersSupport.GetObjectReferenceForInterface(num, riid, requireQI: false); } finally { MarshalInspectable.DisposeAbi(num); } } } internal struct ComCallData { public int dwDispid; public int dwReserved; public nint pUserDefined; } internal struct CallbackData { public unsafe delegate* Callback; public object State; } internal struct IContextCallbackVftbl { private IUnknownVftbl IUnknownVftbl; private unsafe delegate* unmanaged[Stdcall] ContextCallback_4; public unsafe static void ContextCallback(nint contextCallbackPtr, delegate* callback, delegate* onFailCallback, object state) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) ComCallData comCallData2 = default(ComCallData); comCallData2.dwDispid = 0; comCallData2.dwReserved = 0; CallbackData callbackData = default(CallbackData); callbackData.Callback = callback; callbackData.State = state; comCallData2.pUserDefined = (nint)(&callbackData); Guid iID_ICallbackWithNoReentrancyToApplicationSTA = IID.IID_ICallbackWithNoReentrancyToApplicationSTA; int num = (*(IContextCallbackVftbl**)contextCallbackPtr)->ContextCallback_4(contextCallbackPtr, (nint)(delegate*)(&InvokeCallback), &comCallData2, &iID_ICallbackWithNoReentrancyToApplicationSTA, 5, global::System.IntPtr.Zero); if (num < 0 && onFailCallback != (delegate*)null) { onFailCallback(state); } [CompilerGenerated] [UnmanagedCallersOnly] static unsafe int InvokeCallback(ComCallData* comCallData) { try { CallbackData* pUserDefined = (CallbackData*)comCallData->pUserDefined; pUserDefined->Callback(pUserDefined->State); return 0; } catch (global::System.Exception ex) { return ex.HResult; } } } } [Guid("00000003-0000-0000-c000-000000000046")] internal sealed class IMarshal { [Guid("00000003-0000-0000-c000-000000000046")] public struct Vftbl { internal IUnknownVftbl IUnknownVftbl; public unsafe delegate* unmanaged[Stdcall] GetUnmarshalClass_0; public unsafe delegate* unmanaged[Stdcall] GetMarshalSizeMax_1; public unsafe delegate* unmanaged[Stdcall] MarshalInterface_2; public unsafe delegate* unmanaged[Stdcall] UnmarshalInterface_3; public unsafe delegate* unmanaged[Stdcall] ReleaseMarshalData_4; public unsafe delegate* unmanaged[Stdcall] DisconnectObject_5; public static readonly nint AbiToProjectionVftablePtr; [ThreadStatic] private static IMarshal t_freeThreadedMarshaler; unsafe static Vftbl() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(IUnknownVftbl) + sizeof(nint) * 6); *(Vftbl*)AbiToProjectionVftablePtr = new Vftbl { IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl, GetUnmarshalClass_0 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_GetUnmarshalClass_0), GetMarshalSizeMax_1 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_GetMarshalSizeMax_1), MarshalInterface_2 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_MarshalInterface_2), UnmarshalInterface_3 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_UnmarshalInterface_3), ReleaseMarshalData_4 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_ReleaseMarshalData_4), DisconnectObject_5 = (delegate* unmanaged[Stdcall])(delegate*)(&Do_Abi_DisconnectObject_5) }; } private unsafe static void EnsureHasFreeThreadedMarshaler() { //IL_0049: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (t_freeThreadedMarshaler != null) { return; } try { nint thisPtr = default(nint); Marshal.ThrowExceptionForHR(Platform.CoCreateFreeThreadedMarshaler(global::System.IntPtr.Zero, &thisPtr)); using ObjectReference obj = ObjectReference.Attach(ref thisPtr, IID.IID_IUnknown); IMarshal marshal = new IMarshal(obj); t_freeThreadedMarshaler = marshal; } catch (DllNotFoundException val) { DllNotFoundException val2 = val; throw new NotImplementedException(string.Format("A native library routine was not found: {0}.", (object)"CoCreateFreeThreadedMarshaler"), (global::System.Exception)(object)val2); } } internal unsafe static Guid GetInProcFreeThreadedMarshalerIID() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) EnsureHasFreeThreadedMarshaler(); Guid iID_IUnknown = IID.IID_IUnknown; Guid result = default(Guid); t_freeThreadedMarshaler.GetUnmarshalClass(&iID_IUnknown, global::System.IntPtr.Zero, MSHCTX.InProc, global::System.IntPtr.Zero, MSHLFLAGS.Normal, &result); return result; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetUnmarshalClass_0(nint thisPtr, Guid* riid, nint pv, MSHCTX dwDestContext, nint pvDestContext, MSHLFLAGS mshlFlags, Guid* pCid) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) global::System.Runtime.CompilerServices.Unsafe.Write(pCid, default(Guid)); try { EnsureHasFreeThreadedMarshaler(); t_freeThreadedMarshaler.GetUnmarshalClass(riid, pv, dwDestContext, pvDestContext, mshlFlags, pCid); } catch (global::System.Exception ex) { return Marshal.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetMarshalSizeMax_1(nint thisPtr, Guid* riid, nint pv, MSHCTX dwDestContext, nint pvDestContext, MSHLFLAGS mshlflags, uint* pSize) { *pSize = 0u; try { EnsureHasFreeThreadedMarshaler(); t_freeThreadedMarshaler.GetMarshalSizeMax(riid, pv, dwDestContext, pvDestContext, mshlflags, pSize); } catch (global::System.Exception ex) { return Marshal.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_MarshalInterface_2(nint thisPtr, nint pStm, Guid* riid, nint pv, MSHCTX dwDestContext, nint pvDestContext, MSHLFLAGS mshlflags) { try { EnsureHasFreeThreadedMarshaler(); t_freeThreadedMarshaler.MarshalInterface(pStm, riid, pv, dwDestContext, pvDestContext, mshlflags); } catch (global::System.Exception ex) { return Marshal.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_UnmarshalInterface_3(nint thisPtr, nint pStm, Guid* riid, nint* ppv) { *ppv = 0; try { EnsureHasFreeThreadedMarshaler(); t_freeThreadedMarshaler.UnmarshalInterface(pStm, riid, ppv); } catch (global::System.Exception ex) { return Marshal.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_ReleaseMarshalData_4(nint thisPtr, nint pStm) { try { EnsureHasFreeThreadedMarshaler(); t_freeThreadedMarshaler.ReleaseMarshalData(pStm); } catch (global::System.Exception ex) { return Marshal.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private static int Do_Abi_DisconnectObject_5(nint thisPtr, uint dwReserved) { try { EnsureHasFreeThreadedMarshaler(); t_freeThreadedMarshaler.DisconnectObject(dwReserved); } catch (global::System.Exception ex) { return Marshal.GetHRForException(ex); } return 0; } } private const string NotImplemented_NativeRoutineNotFound = "A native library routine was not found: {0}."; private static readonly object _IID_InProcFreeThreadedMarshalerLock = new object(); internal static volatile object _IID_InProcFreeThreadedMarshaler; private readonly ObjectReference _obj; internal static Guid IID_InProcFreeThreadedMarshaler { get { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) object iID_InProcFreeThreadedMarshaler = _IID_InProcFreeThreadedMarshaler; if (iID_InProcFreeThreadedMarshaler != null) { return (Guid)iID_InProcFreeThreadedMarshaler; } return IID_InProcFreeThreadedMarshaler_Slow(); [MethodImpl(8)] [CompilerGenerated] static Guid IID_InProcFreeThreadedMarshaler_Slow() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) lock (_IID_InProcFreeThreadedMarshalerLock) { return (Guid)(_IID_InProcFreeThreadedMarshaler ?? (_IID_InProcFreeThreadedMarshaler = Vftbl.GetInProcFreeThreadedMarshalerIID())); } } } } public IObjectReference ObjRef => _obj; public nint ThisPtr => _obj.ThisPtr; public IMarshal(IObjectReference obj) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) _obj = obj.As(IID.IID_IMarshal); } public unsafe void GetUnmarshalClass(Guid* riid, nint pv, MSHCTX dwDestContext, nint pvDestContext, MSHLFLAGS mshlFlags, Guid* pCid) { nint thisPtr = ThisPtr; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(void*))))(thisPtr, riid, pv, dwDestContext, pvDestContext, mshlFlags, pCid)); GC.KeepAlive((object)_obj); } public unsafe void GetMarshalSizeMax(Guid* riid, nint pv, MSHCTX dwDestContext, nint pvDestContext, MSHLFLAGS mshlflags, uint* pSize) { nint thisPtr = ThisPtr; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)4 * (nint)sizeof(void*))))(thisPtr, riid, pv, dwDestContext, pvDestContext, mshlflags, pSize)); GC.KeepAlive((object)_obj); } public unsafe void MarshalInterface(nint pStm, Guid* riid, nint pv, MSHCTX dwDestContext, nint pvDestContext, MSHLFLAGS mshlflags) { nint thisPtr = ThisPtr; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)5 * (nint)sizeof(void*))))(thisPtr, pStm, riid, pv, dwDestContext, pvDestContext, mshlflags)); GC.KeepAlive((object)_obj); } public unsafe void UnmarshalInterface(nint pStm, Guid* riid, nint* ppv) { nint thisPtr = ThisPtr; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)6 * (nint)sizeof(void*))))(thisPtr, pStm, riid, ppv)); GC.KeepAlive((object)_obj); } public unsafe void ReleaseMarshalData(nint pStm) { nint thisPtr = ThisPtr; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)7 * (nint)sizeof(void*))))(thisPtr, pStm)); GC.KeepAlive((object)_obj); } public unsafe void DisconnectObject(uint dwReserved) { nint thisPtr = ThisPtr; Marshal.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)8 * (nint)sizeof(void*))))(thisPtr, dwReserved)); GC.KeepAlive((object)_obj); } } public static class IWeakReferenceSourceMethods { public unsafe static global::WinRT.Interop.IWeakReference GetWeakReference(IObjectReference _obj) { nint thisPtr = _obj.ThisPtr; nint zero = global::System.IntPtr.Zero; try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &zero)); GC.KeepAlive((object)_obj); return MarshalInterface.FromAbi(zero); } finally { MarshalInspectable.DisposeAbi(zero); } } } [DynamicInterfaceCastableImplementation] [Guid("00000038-0000-0000-C000-000000000046")] internal interface IWeakReferenceSource : global::WinRT.Interop.IWeakReferenceSource { static nint AbiToProjectionVftablePtr; unsafe static IWeakReferenceSource() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IWeakReferenceSource), sizeof(IUnknownVftbl) + sizeof(nint)); *(IUnknownVftbl*)AbiToProjectionVftablePtr = IUnknownVftbl.AbiToProjectionVftbl; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)3 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_GetWeakReference); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_GetWeakReference(nint thisPtr, nint* weakReference) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) *weakReference = 0; try { *weakReference = ComWrappersSupport.CreateCCWForObjectForABI(new ManagedWeakReference(ComWrappersSupport.FindObject(thisPtr)), IID.IID_IWeakReference); } catch (global::System.Exception ex) { return ex.HResult; } return 0; } global::WinRT.Interop.IWeakReference global::WinRT.Interop.IWeakReferenceSource.GetWeakReference() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::WinRT.Interop.IWeakReferenceSource).TypeHandle); return IWeakReferenceSourceMethods.GetWeakReference(objectReferenceForType); } } [DynamicInterfaceCastableImplementation] [Guid("00000037-0000-0000-C000-000000000046")] internal interface IWeakReference : global::WinRT.Interop.IWeakReference { static nint AbiToProjectionVftablePtr; unsafe static IWeakReference() { AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(IWeakReference), sizeof(IUnknownVftbl) + sizeof(nint)); *(IUnknownVftbl*)AbiToProjectionVftablePtr = IUnknownVftbl.AbiToProjectionVftbl; *(global::System.IntPtr*)(AbiToProjectionVftablePtr + (nint)3 * (nint)sizeof(delegate* unmanaged[Stdcall])) = (nint)(delegate*)(&Do_Abi_Resolve); } [UnmanagedCallersOnly(CallConvs = new global::System.Type[] { typeof(CallConvStdcall) })] private unsafe static int Do_Abi_Resolve(nint thisPtr, Guid* riid, nint* objectReference) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) *objectReference = 0; try { global::WinRT.Interop.IWeakReference weakReference = ComWrappersSupport.FindObject(thisPtr); if (weakReference is ManagedWeakReference managedWeakReference) { *objectReference = managedWeakReference.ResolveForABI(*riid); } else { using IObjectReference objectReference2 = weakReference.Resolve(*riid); *objectReference = objectReference2?.GetRef() ?? global::System.IntPtr.Zero; } } catch (global::System.Exception ex) { return ex.HResult; } return 0; } unsafe IObjectReference global::WinRT.Interop.IWeakReference.Resolve(Guid riid) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) IObjectReference objectReferenceForType = ((IWinRTObject)this).GetObjectReferenceForType(typeof(global::WinRT.Interop.IWeakReference).TypeHandle); nint thisPtr = objectReferenceForType.ThisPtr; nint num = default(nint); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(global::System.IntPtr*)((nint)(*(global::System.IntPtr*)thisPtr) + (nint)3 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(thisPtr, &riid, &num)); GC.KeepAlive((object)objectReferenceForType); try { return ComWrappersSupport.GetObjectReferenceForInterface(num, riid, requireQI: false); } finally { MarshalInspectable.DisposeAbi(num); } } } } namespace System.Collections.Generic { [DefaultMember("Item")] internal sealed class IDictionaryImpl : IDictionary, System.Collections.Generic.ICollection>, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable, IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly IObjectReference _inner; private volatile IObjectReference __iDictionaryObjRef; private volatile IObjectReference __iEnumerableObjRef; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; private IObjectReference iDictionaryObjRef => __iDictionaryObjRef ?? Make_IDictionaryObjRef(); private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); IObjectReference IWinRTObject.NativeObject => _inner; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public V this[K key] { get { return IDictionaryMethods.Indexer_Get(iDictionaryObjRef, null, key); } set { IDictionaryMethods.Indexer_Set(iDictionaryObjRef, key, value); } } public System.Collections.Generic.ICollection Keys => IDictionaryMethods.get_Keys(iDictionaryObjRef); public System.Collections.Generic.ICollection Values => IDictionaryMethods.get_Values(iDictionaryObjRef); public int Count => IDictionaryMethods.get_Count(iDictionaryObjRef); public bool IsReadOnly => IDictionaryMethods.get_IsReadOnly(iDictionaryObjRef); internal IDictionaryImpl(IObjectReference _inner) { this._inner = _inner; } public static IDictionaryImpl CreateRcw(IInspectable obj) { return new IDictionaryImpl(obj.ObjRef); } private IObjectReference Make_IDictionaryObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iDictionaryObjRef, (IObjectReference)_inner.As(IDictionaryMethods.PIID), (IObjectReference)null); return __iDictionaryObjRef; } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)_inner.As(IEnumerableMethods>.PIID), (IObjectReference)null); return __iEnumerableObjRef; } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public void Add(K key, V value) { IDictionaryMethods.Add(iDictionaryObjRef, key, value); } public void Add(KeyValuePair item) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) IDictionaryMethods.Add(iDictionaryObjRef, item); } public void Clear() { IDictionaryMethods.Clear(iDictionaryObjRef); } public bool Contains(KeyValuePair item) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return IDictionaryMethods.Contains(iDictionaryObjRef, null, item); } public bool ContainsKey(K key) { return IDictionaryMethods.ContainsKey(iDictionaryObjRef, key); } public void CopyTo(KeyValuePair[] array, int arrayIndex) { IDictionaryMethods.CopyTo(iDictionaryObjRef, iEnumerableObjRef, array, arrayIndex); } public System.Collections.Generic.IEnumerator> GetEnumerator() { return IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } public bool Remove(K key) { return IDictionaryMethods.Remove(iDictionaryObjRef, key); } public bool Remove(KeyValuePair item) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return IDictionaryMethods.Remove(iDictionaryObjRef, item); } public bool TryGetValue(K key, [MaybeNullWhen(false)] out V value) { return IDictionaryMethods.TryGetValue(iDictionaryObjRef, null, key, out value); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return (System.Collections.IEnumerator)GetEnumerator(); } } internal sealed class IEnumerableImpl : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly IObjectReference _inner; private volatile IObjectReference __iEnumerableObjRef; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); IObjectReference IWinRTObject.NativeObject => _inner; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); internal IEnumerableImpl(IObjectReference _inner) { this._inner = _inner; } public static IEnumerableImpl CreateRcw(IInspectable obj) { return new IEnumerableImpl(obj.ObjRef); } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)_inner.As(IEnumerableMethods.PIID), (IObjectReference)null); return __iEnumerableObjRef; } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public System.Collections.Generic.IEnumerator GetEnumerator() { return IEnumerableMethods.GetEnumerator(iEnumerableObjRef); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return (System.Collections.IEnumerator)GetEnumerator(); } } internal sealed class IEnumeratorImpl : System.Collections.Generic.IEnumerator, System.Collections.IEnumerator, System.IDisposable, IIterator, IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly IObjectReference _inner; private volatile IObjectReference __iEnumeratorObjRef; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; private IObjectReference iEnumeratorObjRef => __iEnumeratorObjRef ?? Make_IEnumeratorObjRef(); IObjectReference IWinRTObject.NativeObject => _inner; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public T Current => IEnumeratorMethods.get_Current(iEnumeratorObjRef); object System.Collections.IEnumerator.Current => Current; T IIterator._Current => IIteratorMethods.get_Current(iEnumeratorObjRef); bool IIterator.HasCurrent => IIteratorMethods.get_HasCurrent(iEnumeratorObjRef); internal IEnumeratorImpl(IObjectReference _inner) { this._inner = _inner; } public static IEnumeratorImpl CreateRcw(IInspectable obj) { return new IEnumeratorImpl(obj.ObjRef); } private IObjectReference Make_IEnumeratorObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumeratorObjRef, (IObjectReference)_inner.As(IEnumeratorMethods.PIID), (IObjectReference)null); return __iEnumeratorObjRef; } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } bool System.Collections.IEnumerator.MoveNext() { return IEnumeratorMethods.MoveNext(iEnumeratorObjRef); } void System.Collections.IEnumerator.Reset() { IEnumeratorMethods.Reset(iEnumeratorObjRef); } void System.IDisposable.Dispose() { IEnumeratorMethods.Dispose(iEnumeratorObjRef); } bool IIterator._MoveNext() { return IIteratorMethods.MoveNext(iEnumeratorObjRef); } uint IIterator.GetMany(ref T[] items) { return IIteratorMethods.GetMany(iEnumeratorObjRef, ref items); } } [DefaultMember("Item")] internal sealed class IListImpl : System.Collections.Generic.IList, System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly IObjectReference _inner; private volatile IObjectReference __iListObjRef; private volatile IObjectReference __iEnumerableObjRef; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; private IObjectReference iListObjRef => __iListObjRef ?? Make_IListObjRef(); private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); public T this[int index] { get { return IListMethods.Indexer_Get(iListObjRef, index); } set { IListMethods.Indexer_Set(iListObjRef, index, value); } } public int Count => IListMethods.get_Count(iListObjRef); public bool IsReadOnly => IListMethods.get_IsReadOnly(iListObjRef); IObjectReference IWinRTObject.NativeObject => _inner; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); private IObjectReference Make_IListObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iListObjRef, (IObjectReference)_inner.As(IListMethods.PIID), (IObjectReference)null); return __iListObjRef; } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)_inner.As(IEnumerableMethods.PIID), (IObjectReference)null); return __iEnumerableObjRef; } internal IListImpl(IObjectReference _inner) { this._inner = _inner; } public static IListImpl CreateRcw(IInspectable obj) { return new IListImpl(obj.ObjRef); } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public void Add(T item) { IListMethods.Add(iListObjRef, item); } public void Clear() { IListMethods.Clear(iListObjRef); } public bool Contains(T item) { return IListMethods.Contains(iListObjRef, item); } public void CopyTo(T[] array, int arrayIndex) { IListMethods.CopyTo(iListObjRef, array, arrayIndex); } public System.Collections.Generic.IEnumerator GetEnumerator() { return IEnumerableMethods.GetEnumerator(iEnumerableObjRef); } public int IndexOf(T item) { return IListMethods.IndexOf(iListObjRef, item); } public void Insert(int index, T item) { IListMethods.Insert(iListObjRef, index, item); } public bool Remove(T item) { return IListMethods.Remove(iListObjRef, item); } public void RemoveAt(int index) { IListMethods.RemoveAt(iListObjRef, index); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return (System.Collections.IEnumerator)GetEnumerator(); } } [DefaultMember("Item")] internal sealed class IReadOnlyDictionaryImpl : IReadOnlyDictionary, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable, System.Collections.Generic.IReadOnlyCollection>, IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly IObjectReference _inner; private volatile IObjectReference __iReadOnlyDictionaryObjRef; private volatile IObjectReference __iEnumerableObjRef; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; private IObjectReference iReadOnlyDictionaryObjRef => __iReadOnlyDictionaryObjRef ?? Make_IDictionaryObjRef(); private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); IObjectReference IWinRTObject.NativeObject => _inner; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public V this[K key] => IReadOnlyDictionaryMethods.Indexer_Get(iReadOnlyDictionaryObjRef, key); public System.Collections.Generic.IEnumerable Keys => IReadOnlyDictionaryMethods.get_Keys(iReadOnlyDictionaryObjRef); public System.Collections.Generic.IEnumerable Values => IReadOnlyDictionaryMethods.get_Values(iReadOnlyDictionaryObjRef); public int Count => IReadOnlyDictionaryMethods.get_Count(iReadOnlyDictionaryObjRef); internal IReadOnlyDictionaryImpl(IObjectReference _inner) { this._inner = _inner; } public static IReadOnlyDictionaryImpl CreateRcw(IInspectable obj) { return new IReadOnlyDictionaryImpl(obj.ObjRef); } private IObjectReference Make_IDictionaryObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iReadOnlyDictionaryObjRef, (IObjectReference)_inner.As(IReadOnlyDictionaryMethods.PIID), (IObjectReference)null); return __iReadOnlyDictionaryObjRef; } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)_inner.As(IEnumerableMethods>.PIID), (IObjectReference)null); return __iEnumerableObjRef; } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public bool ContainsKey(K key) { return IReadOnlyDictionaryMethods.ContainsKey(iReadOnlyDictionaryObjRef, key); } public System.Collections.Generic.IEnumerator> GetEnumerator() { return IEnumerableMethods>.GetEnumerator(iEnumerableObjRef); } public bool TryGetValue(K key, [MaybeNullWhen(false)] out V value) { return IReadOnlyDictionaryMethods.TryGetValue(iReadOnlyDictionaryObjRef, key, out value); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return (System.Collections.IEnumerator)GetEnumerator(); } } [DefaultMember("Item")] internal sealed class IReadOnlyListImpl : System.Collections.Generic.IReadOnlyList, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Collections.Generic.IReadOnlyCollection, IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly IObjectReference _inner; private volatile IObjectReference __iReadOnlyListObjRef; private volatile IObjectReference __iEnumerableObjRef; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; private IObjectReference iReadOnlyListObjRef => __iReadOnlyListObjRef ?? Make_IListObjRef(); private IObjectReference iEnumerableObjRef => __iEnumerableObjRef ?? Make_IEnumerableObjRef(); IObjectReference IWinRTObject.NativeObject => _inner; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public T this[int index] => IReadOnlyListMethods.Indexer_Get(iReadOnlyListObjRef, index); public int Count => IReadOnlyListMethods.get_Count(iReadOnlyListObjRef); private IObjectReference Make_IListObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iReadOnlyListObjRef, (IObjectReference)_inner.As(IReadOnlyListMethods.PIID), (IObjectReference)null); return __iReadOnlyListObjRef; } private IObjectReference Make_IEnumerableObjRef() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Interlocked.CompareExchange(ref __iEnumerableObjRef, (IObjectReference)_inner.As(IEnumerableMethods.PIID), (IObjectReference)null); return __iEnumerableObjRef; } internal IReadOnlyListImpl(IObjectReference _inner) { this._inner = _inner; } public static IReadOnlyListImpl CreateRcw(IInspectable obj) { return new IReadOnlyListImpl(obj.ObjRef); } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } public System.Collections.Generic.IEnumerator GetEnumerator() { return IEnumerableMethods.GetEnumerator(iEnumerableObjRef); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return (System.Collections.IEnumerator)GetEnumerator(); } } } namespace System.Numerics { public static class VectorExtensions { public static Windows.Foundation.Point ToPoint(this Vector2 vector) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return new Windows.Foundation.Point(vector.X, vector.Y); } public static Windows.Foundation.Size ToSize(this Vector2 vector) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return new Windows.Foundation.Size(vector.X, vector.Y); } public static Vector2 ToVector2(this Windows.Foundation.Point point) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return new Vector2((float)point.X, (float)point.Y); } public static Vector2 ToVector2(this Windows.Foundation.Size size) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return new Vector2((float)size.Width, (float)size.Height); } } } namespace System.Runtime.InteropServices.WindowsRuntime { [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class ReadOnlyArrayAttribute : System.Attribute { } [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class WriteOnlyArrayAttribute : System.Attribute { } } namespace WinRT { internal sealed class DllModule { private static readonly string _currentModuleDirectory = AppContext.BaseDirectory; private static readonly Dictionary _cache = new Dictionary((IEqualityComparer)(object)StringComparer.Ordinal); private readonly string _fileName; private readonly nint _moduleHandle; private unsafe readonly delegate* unmanaged[Stdcall] _GetActivationFactory; private unsafe readonly delegate* unmanaged[Stdcall] _CanUnloadNow; public static bool TryLoad(string fileName, out DllModule module) { lock (_cache) { if (_cache.TryGetValue(fileName, ref module)) { return true; } if (TryCreate(fileName, out module)) { _cache[fileName] = module; return true; } return false; } } private unsafe static bool TryCreate(string fileName, out DllModule module) { nint zero = System.IntPtr.Zero; zero = Platform.LoadLibraryExW(Path.Combine(_currentModuleDirectory, fileName), System.IntPtr.Zero, 8u); if (zero == (nint)System.IntPtr.Zero) { NativeLibrary.TryLoad(fileName, typeof(DllModule).Assembly, (DllImportSearchPath?)null, ref zero); } if (zero == (nint)System.IntPtr.Zero) { module = null; return false; } void* ptr = null; System.ReadOnlySpan functionName = "DllGetActivationFactory"u8; ptr = (void*)Platform.TryGetProcAddress(zero, functionName); if (ptr == null) { module = null; return false; } module = new DllModule(fileName, zero, ptr); return true; } private unsafe DllModule(string fileName, nint moduleHandle, void* getActivationFactory) { _fileName = fileName; _moduleHandle = moduleHandle; _GetActivationFactory = (delegate* unmanaged[Stdcall])getActivationFactory; void* ptr = null; System.ReadOnlySpan functionName = "DllCanUnloadNow"u8; ptr = (void*)Platform.TryGetProcAddress(_moduleHandle, functionName); if (ptr != null) { _CanUnloadNow = (delegate* unmanaged[Stdcall])ptr; } } public unsafe ValueTuple, int> GetActivationFactory(string runtimeClassId) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) nint thisPtr = System.IntPtr.Zero; try { MarshalString.Pinnable p = new MarshalString.Pinnable(runtimeClassId); fixed (char* ptr = p) { void* ptr2 = ptr; int num = _GetActivationFactory(MarshalString.GetAbi(ref p), &thisPtr); if (num == 0) { ObjectReference objectReference = ObjectReference.Attach(ref thisPtr, IID.IID_IActivationFactory); return new ValueTuple, int>(objectReference, num); } return new ValueTuple, int>((ObjectReference)null, num); } } finally { MarshalInspectable.DisposeAbi(thisPtr); } } ~DllModule() { lock (_cache) { _cache.Remove(_fileName); } if (_moduleHandle != (nint)System.IntPtr.Zero && !Platform.FreeLibrary(_moduleHandle)) { Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); } } } internal sealed class WinRTModule { private static volatile WinRTModule _instance; private readonly nint _mtaCookie; public static WinRTModule Instance => _instance ?? MakeWinRTModule(); private static WinRTModule MakeWinRTModule() { Interlocked.CompareExchange(ref _instance, new WinRTModule(), (WinRTModule)null); return _instance; } public unsafe WinRTModule() { nint mtaCookie = default(nint); Marshal.ThrowExceptionForHR(Platform.CoIncrementMTAUsage(&mtaCookie)); _mtaCookie = mtaCookie; } public unsafe static ValueTuple, int> GetActivationFactory(string runtimeClassId, Guid iid) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) WinRTModule instance = Instance; nint thisPtr = System.IntPtr.Zero; try { MarshalString.Pinnable p = new MarshalString.Pinnable(runtimeClassId); fixed (char* ptr = p) { void* ptr2 = ptr; int num = Platform.RoGetActivationFactory(MarshalString.GetAbi(ref p), &iid, &thisPtr); if (num == 0) { ObjectReference objectReference = ObjectReference.Attach(ref thisPtr, iid); return new ValueTuple, int>(objectReference, num); } return new ValueTuple, int>((ObjectReference)null, num); } } finally { MarshalInspectable.DisposeAbi(thisPtr); } } ~WinRTModule() { Marshal.ThrowExceptionForHR(Platform.CoDecrementMTAUsage(_mtaCookie)); } } public static class ActivationFactory { [field: CompilerGenerated] public static Func ActivationHandler { [CompilerGenerated] get; [CompilerGenerated] set; } public static IObjectReference Get(string typeName) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (ActivationHandler != null) { IObjectReference fromActivationHandler = GetFromActivationHandler(typeName, IID.IID_IActivationFactory); if (fromActivationHandler != null) { return fromActivationHandler; } } ValueTuple, int> activationFactory = WinRTModule.GetActivationFactory(typeName, IID.IID_IActivationFactory); ObjectReference item = activationFactory.Item1; int item2 = activationFactory.Item2; if (item != null) { return item; } string text = typeName; while (true) { int num = text.LastIndexOf(".", (StringComparison)4); if (num <= 0) { Marshal.ThrowExceptionForHR(item2); } text = text.Remove(num); DllModule module = null; if (DllModule.TryLoad(text + ".dll", out module)) { ValueTuple, int> activationFactory2 = module.GetActivationFactory(typeName); item = activationFactory2.Item1; item2 = activationFactory2.Item2; if (item != null) { break; } } } return item; } public static IObjectReference Get(string typeName, Guid iid) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (ActivationHandler != null) { IObjectReference fromActivationHandler = GetFromActivationHandler(typeName, iid); if (fromActivationHandler != null) { return fromActivationHandler; } } ValueTuple, int> activationFactory = WinRTModule.GetActivationFactory(typeName, iid); ObjectReference item = activationFactory.Item1; int item2 = activationFactory.Item2; if (item != null) { return item; } string text = typeName; ObjectReference item3; while (true) { int num = text.LastIndexOf(".", (StringComparison)4); if (num <= 0) { Marshal.ThrowExceptionForHR(item2); } text = text.Remove(num); DllModule module = null; if (DllModule.TryLoad(text + ".dll", out module)) { ValueTuple, int> activationFactory2 = module.GetActivationFactory(typeName); item3 = activationFactory2.Item1; item2 = activationFactory2.Item2; if (item3 != null) { break; } } } using (item3) { return item3.As(iid); } } private static IObjectReference GetFromActivationHandler(string typeName, Guid iid) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Func activationHandler = ActivationHandler; if (activationHandler != null) { nint thisPtr = System.IntPtr.Zero; try { thisPtr = activationHandler.Invoke(typeName, iid); if (thisPtr != (nint)System.IntPtr.Zero) { return ObjectReference.Attach(ref thisPtr, iid); } } finally { MarshalInspectable.DisposeAbi(thisPtr); } } return null; } } public class AgileReference : System.IDisposable { private static readonly Guid CLSID_StdGlobalInterfaceTable = new Guid(803, (short)0, (short)0, (byte)192, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)70); private static readonly object _lock = new object(); private static volatile IGlobalInterfaceTable _git; private readonly IObjectReference _agileReference; private readonly nint _cookie; private bool disposed; internal static IGlobalInterfaceTable Git { get { return _git ?? Git_Slow(); [MethodImpl(8)] [CompilerGenerated] static IGlobalInterfaceTable Git_Slow() { lock (_lock) { return _git ?? (_git = GetGitTable()); } } } } public AgileReference(IObjectReference instance) : this(instance?.ThisPtr ?? System.IntPtr.Zero) { } internal AgileReference(in ObjectReferenceValue instance) : this(instance.GetAbi()) { } internal unsafe AgileReference(nint thisPtr) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)System.IntPtr.Zero) { return; } nint thisPtr2 = 0; Guid iID_IUnknown = IID.IID_IUnknown; try { Marshal.ThrowExceptionForHR(Platform.RoGetAgileReference(0u, &iID_IUnknown, thisPtr, &thisPtr2)); _agileReference = ObjectReference.Attach(ref thisPtr2, IID.IID_IUnknown); } catch (TypeLoadException) { _cookie = Git.RegisterInterfaceInGlobal(thisPtr, iID_IUnknown); } finally { MarshalInterface.DisposeAbi(thisPtr2); } } public IObjectReference Get() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (_cookie != (nint)System.IntPtr.Zero) { return Git.GetInterfaceFromGlobal(_cookie, IID.IID_IUnknown); } return IAgileReferenceMethods.Resolve(_agileReference, IID.IID_IUnknown); } internal ObjectReference Get(Guid iid) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (_cookie != (nint)System.IntPtr.Zero) { return Git.GetInterfaceFromGlobal(_cookie, IID.IID_IUnknown)?.As(iid); } return IAgileReferenceMethods.Resolve(_agileReference, iid); } protected virtual void Dispose(bool disposing) { if (!disposed) { if (_cookie != (nint)System.IntPtr.Zero) { Git.TryRevokeInterfaceFromGlobal(_cookie); } disposed = true; } } private unsafe static IGlobalInterfaceTable GetGitTable() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) Guid cLSID_StdGlobalInterfaceTable = CLSID_StdGlobalInterfaceTable; Guid iID_IGlobalInterfaceTable = IID.IID_IGlobalInterfaceTable; nint num = 0; try { Marshal.ThrowExceptionForHR(Platform.CoCreateInstance(&cLSID_StdGlobalInterfaceTable, System.IntPtr.Zero, 1u, &iID_IGlobalInterfaceTable, &num)); return new IGlobalInterfaceTable(num); } finally { MarshalExtensions.ReleaseIfNotNull(num); } } virtual ~AgileReference() { Dispose(disposing: false); } public void Dispose() { Dispose(disposing: true); GC.SuppressFinalize((object)this); } } public sealed class AgileReference : AgileReference where T : class { public AgileReference(IObjectReference instance) : base(instance) { } internal AgileReference(in ObjectReferenceValue instance) : base(in instance) { } public new T Get() { using IObjectReference objectReference = base.Get(); return ComWrappersSupport.CreateRcwForComObject(objectReference?.ThisPtr ?? System.IntPtr.Zero); } } internal static class AttributeMessages { public const string GenericDeprecatedMessage = "This method is deprecated and will be removed in a future release."; public const string GenericRequiresUnreferencedCodeMessage = "This method is not trim-safe, and is only supported for use when not using trimming (or AOT)."; public const string MarshallingOrGenericInstantiationsRequiresDynamicCode = "The necessary marshalling code or generic instantiations might not be available."; public const string AbiTypesNeverHaveConstructors = "All ABI types never have a constructor that would need to be accessed via reflection."; } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class ProjectedRuntimeClassAttribute : System.Attribute { [field: CompilerGenerated] public string DefaultInterfaceProperty { [CompilerGenerated] get; } [field: CompilerGenerated] public System.Type DefaultInterface { [CompilerGenerated] get; } public ProjectedRuntimeClassAttribute(string defaultInterfaceProp) { DefaultInterfaceProperty = defaultInterfaceProp; } public ProjectedRuntimeClassAttribute(System.Type defaultInterface) { DefaultInterface = defaultInterface; } } [Obsolete("This attribute is only used for the .NET Standard 2.0 projections.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class ObjectReferenceWrapperAttribute : System.Attribute { [field: CompilerGenerated] public string ObjectReferenceField { [CompilerGenerated] get; } public ObjectReferenceWrapperAttribute(string objectReferenceField) { ObjectReferenceField = objectReferenceField; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class WindowsRuntimeTypeAttribute : System.Attribute { [field: CompilerGenerated] public string SourceMetadata { [CompilerGenerated] get; } [field: CompilerGenerated] public string GuidSignature { [CompilerGenerated] get; } public WindowsRuntimeTypeAttribute(string sourceMetadata = null) { SourceMetadata = sourceMetadata; } public WindowsRuntimeTypeAttribute(string sourceMetadata, string guidSignature) : this(sourceMetadata) { GuidSignature = guidSignature; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class WindowsRuntimeHelperTypeAttribute : System.Attribute { [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] [field: CompilerGenerated] public System.Type HelperType { [CompilerGenerated] get; } public WindowsRuntimeHelperTypeAttribute() { } public WindowsRuntimeHelperTypeAttribute([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type helperType) { HelperType = helperType; } } public interface IWinRTExposedTypeDetails { ComInterfaceEntry[] GetExposedInterfaces(); } [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class WinRTExposedTypeAttribute : System.Attribute { [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] [field: CompilerGenerated] internal System.Type WinRTExposedTypeDetails { [CompilerGenerated] get; } public WinRTExposedTypeAttribute() { } public WinRTExposedTypeAttribute([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type winrtExposedTypeDetails) { WinRTExposedTypeDetails = winrtExposedTypeDetails; } public ComInterfaceEntry[] GetExposedInterfaces() { if (WinRTExposedTypeDetails == null) { return System.Array.Empty(); } return ((IWinRTExposedTypeDetails)Activator.CreateInstance(WinRTExposedTypeDetails)).GetExposedInterfaces(); } } public sealed class WinRTManagedOnlyTypeDetails : IWinRTExposedTypeDetails { public ComInterfaceEntry[] GetExposedInterfaces() { ThrowNotSupportedException(); return System.Array.Empty(); } [DoesNotReturn] private static void ThrowNotSupportedException() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new NotSupportedException("The annotated type does not support WinRT marshalling, and can only be used by managed code. If you do intend on marshalling it, remove the '[WinRTExposedType(typeof(WinRTManagedOnlyTypeDetails))]' annotation on it, and mark the type as partial, to allow the CsWinRT AOT generator to emit the necessary marshalling code for it."); } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [AttributeUsage(/*Could not decode attribute arguments.*/)] public abstract class WinRTImplementationTypeRcwFactoryAttribute : System.Attribute { public abstract object CreateInstance(IInspectable inspectable); } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class WinRTRuntimeClassNameAttribute : System.Attribute { [field: CompilerGenerated] public string RuntimeClassName { [CompilerGenerated] get; } public WinRTRuntimeClassNameAttribute(string runtimeClassName) { RuntimeClassName = runtimeClassName; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class WinRTAssemblyExportsTypeAttribute : System.Attribute { [field: CompilerGenerated] public System.Type Type { [CompilerGenerated] get; } public WinRTAssemblyExportsTypeAttribute(System.Type type) { Type = type; } } [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class GeneratedBindableCustomPropertyAttribute : System.Attribute { [field: CompilerGenerated] internal string[] PropertyNames { [CompilerGenerated] get; } [field: CompilerGenerated] internal System.Type[] IndexerPropertyTypes { [CompilerGenerated] get; } public GeneratedBindableCustomPropertyAttribute() { } public GeneratedBindableCustomPropertyAttribute(string[] propertyNames, System.Type[] indexerPropertyTypes) { PropertyNames = propertyNames; IndexerPropertyTypes = indexerPropertyTypes; } } [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class GeneratedWinRTExposedTypeAttribute : System.Attribute { } [AttributeUsage(/*Could not decode attribute arguments.*/)] public sealed class GeneratedWinRTExposedExternalTypeAttribute : System.Attribute { [field: CompilerGenerated] internal System.Type Type { [CompilerGenerated] get; } public GeneratedWinRTExposedExternalTypeAttribute(System.Type type) { Type = type; } } public static class CastExtensions { public static TInterface As(this object value) { if (typeof(TInterface) == typeof(object) && TryGetRefForObject(value, allowComposed: false, out var reference)) { using (reference) { return ComWrappersSupport.CreateRcwForComObject(reference.ThisPtr); } } if (value is TInterface) { return (TInterface)value; } if (TryGetRefForObject(value, allowComposed: true, out reference)) { using (reference) { return reference.AsInterface(); } } throw GetArgumentExceptionForFailedCast(value); [MethodImpl(8)] [CompilerGenerated] static System.Exception GetArgumentExceptionForFailedCast(object value) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown if (value != null) { return (System.Exception)new ArgumentException($"The source object type ('{value.GetType()}') being cast to type '{typeof(TInterface)}' is not a projected type, nor does it inherit from a projected type.", "value"); } return (System.Exception)new ArgumentNullException("value", $"The source object being cast to type '{typeof(TInterface)}' is 'null'."); } } public static AgileReference AsAgile(this T value) where T : class { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (value == null) { return new AgileReference(null); } object obj = Marshaler.CreateMarshaler2.Invoke(value); try { if (obj is IObjectReference instance) { return new AgileReference(instance); } if (obj is ObjectReferenceValue) { ObjectReferenceValue instance2 = (ObjectReferenceValue)obj; return new AgileReference(in instance2); } } finally { Marshaler.DisposeMarshaler.Invoke(obj); } throw new InvalidOperationException("Object type is not a projected type: value."); } private static bool TryGetRefForObject(object value, bool allowComposed, out IObjectReference reference) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (ComWrappersSupport.TryUnwrapObject(value, out var objRef)) { reference = objRef.As(IID.IID_IUnknown); return true; } if (allowComposed && TryGetComposedRefForQI(value, out objRef)) { reference = objRef.As(IID.IID_IUnknown); return true; } reference = null; return false; } private static bool TryGetComposedRefForQI(object value, out IObjectReference objRef) { if (value is IWinRTObject winRTObject) { objRef = winRTObject.NativeObject; return true; } objRef = null; return false; } } internal static class KeyValuePairHelper { internal static readonly ConcurrentDictionary KeyValuePairCCW = new ConcurrentDictionary(); internal static void TryAddKeyValuePairCCW(System.Type keyValuePairType, Guid iid, nint abiToProjectionVftablePtr) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) KeyValuePairCCW.TryAdd(keyValuePairType, new ComInterfaceEntry { IID = iid, Vtable = abiToProjectionVftablePtr }); } } public static class ComWrappersSupport { internal sealed class InspectableInfo { private readonly System.Type _type; private volatile string _runtimeClassName; [field: CompilerGenerated] public Guid[] IIDs { [CompilerGenerated] get; } public string RuntimeClassName => _runtimeClassName ?? MakeRuntimeClassName(); private string MakeRuntimeClassName() { Interlocked.CompareExchange(ref _runtimeClassName, TypeNameSupport.GetNameForType(_type, TypeNameGenerationFlags.GenerateBoxedName | TypeNameGenerationFlags.ForGetRuntimeClassName), (string)null); return _runtimeClassName; } internal InspectableInfo(System.Type type, Guid[] iids) { _type = type; IIDs = iids; } } internal const int GC_PRESSURE_BASE = 1000; private static readonly ConcurrentDictionary> TypedObjectFactoryCacheForType = new ConcurrentDictionary>(); private static readonly ConcurrentDictionary> DelegateFactoryCache = new ConcurrentDictionary>(); internal static readonly ConditionalWeakTable BoxedValueReferenceCache = new ConditionalWeakTable(); private static DefaultComWrappers _instance; internal static readonly ConditionalWeakTable InspectableInfoTable = new ConditionalWeakTable(); [ThreadStatic] internal static System.Type CreateRCWType; private static ComWrappers _comWrappers; private static readonly object _comWrappersLock = new object(); private static readonly List> ComInterfaceEntriesLookup = new List>(); private static readonly List> RuntimeClassNameForNonWinRTTypeLookup = new List>(); private static readonly ConcurrentDictionary ComInterfaceEntriesForType = new ConcurrentDictionary(); private static ComInterfaceEntry IPropertyValueEntry { get { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableIReferenceSupport) { throw new NotSupportedException("Support for 'IPropertyValue' is not enabled (it depends on the support for 'IReference')."); } ComInterfaceEntry result = default(ComInterfaceEntry); result.IID = IID.IID_IPropertyValue; result.Vtable = ManagedIPropertyValueImpl.AbiToProjectionVftablePtr; return result; } } private static DefaultComWrappers DefaultComWrappersInstance { get { if (_instance == null) { _instance = new DefaultComWrappers(); } return _instance; } } private static ComWrappers ComWrappers { get { if (_comWrappers == null) { lock (_comWrappersLock) { if (_comWrappers == null) { DefaultComWrappers defaultComWrappersInstance = DefaultComWrappersInstance; ComWrappers.RegisterForTrackerSupport((ComWrappers)(object)defaultComWrappersInstance); _comWrappers = (ComWrappers)(object)defaultComWrappersInstance; } } } return _comWrappers; } set { lock (_comWrappersLock) { if (value != null || _comWrappers != DefaultComWrappersInstance) { ComWrappers val = (ComWrappers)(((object)value) ?? ((object)DefaultComWrappersInstance)); ComWrappers.RegisterForTrackerSupport(val); _comWrappers = val; } } } } public static IUnknownVftbl IUnknownVftbl => DefaultComWrappers.IUnknownVftbl; public static nint IUnknownVftblPtr => DefaultComWrappers.IUnknownVftblPtr; public static TReturn MarshalDelegateInvoke(nint thisPtr, Func invoke) where TDelegate : class, System.Delegate { TDelegate val = FindObject(thisPtr); if ((System.Delegate)val != (System.Delegate)null) { return invoke.Invoke(val); } return default(TReturn); } public static void MarshalDelegateInvoke(nint thisPtr, Action invoke) where T : class, System.Delegate { T val = FindObject(thisPtr); if ((System.Delegate)val != (System.Delegate)null) { invoke.Invoke(val); } } internal unsafe static bool IsFreeThreaded(nint iUnknown) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) nint num = default(nint); if (Marshal.QueryInterface((System.IntPtr)iUnknown, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_IAgileObject), ref num) >= 0) { Marshal.Release((System.IntPtr)num); return true; } nint num2 = default(nint); if (Marshal.QueryInterface((System.IntPtr)iUnknown, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_IMarshal), ref num2) >= 0) { try { Guid iID_IUnknown = IID.IID_IUnknown; Guid val = default(Guid); Marshal.ThrowExceptionForHR((*(IMarshal.Vftbl**)num2)->GetUnmarshalClass_0(num2, &iID_IUnknown, System.IntPtr.Zero, MSHCTX.InProc, System.IntPtr.Zero, MSHLFLAGS.Normal, &val)); if (val == IMarshal.IID_InProcFreeThreadedMarshaler) { return true; } } finally { Marshal.Release((System.IntPtr)num2); } } return false; } internal static bool IsFreeThreaded(IObjectReference objRef) { bool result = IsFreeThreaded(objRef.ThisPtr); GC.KeepAlive((object)objRef); return result; } public static IObjectReference GetObjectReferenceForInterface(nint externalComObject) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return GetObjectReferenceForInterface(externalComObject, IID.IID_IUnknown, requireQI: false); } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] public static ObjectReference GetObjectReferenceForInterface(nint externalComObject) { if (externalComObject == (nint)System.IntPtr.Zero) { return null; } return ObjectReference.FromAbi(externalComObject); } public static ObjectReference GetObjectReferenceForInterface(nint externalComObject, Guid iid) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return GetObjectReferenceForInterface(externalComObject, iid, requireQI: true); } public static IObjectReference GetObjectReferenceForInterface(nint externalComObject, Guid iid, bool requireQI) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return GetObjectReferenceForInterface(externalComObject, iid, requireQI); } internal static ObjectReference GetObjectReferenceForInterface(nint externalComObject, Guid iid, bool requireQI) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (externalComObject == (nint)System.IntPtr.Zero) { return null; } if (requireQI) { nint thisPtr = default(nint); Marshal.ThrowExceptionForHR(Marshal.QueryInterface((System.IntPtr)externalComObject, ref iid, ref thisPtr)); return ObjectReference.Attach(ref thisPtr, iid); } return ObjectReference.FromAbi(externalComObject, iid); } public static void RegisterProjectionAssembly(Assembly assembly) { TypeNameSupport.RegisterProjectionAssembly(assembly); } public static void RegisterProjectionTypeBaseTypeMapping(IDictionary typeNameToBaseTypeNameMapping) { TypeNameSupport.RegisterProjectionTypeBaseTypeMapping(typeNameToBaseTypeNameMapping); } public static void RegisterAuthoringMetadataTypeLookup(Func authoringMetadataTypeLookup) { TypeExtensions.RegisterAuthoringMetadataTypeLookup(authoringMetadataTypeLookup); } public static void RegisterHelperType(System.Type type, [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type helperType) { TypeExtensions.HelperTypeCache.TryAdd(type, helperType); } internal static List GetInterfaceTableEntries(System.Type type) { //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) List val = new List(); bool hasUserImplementedIMarshalInterface2 = false; bool hasUserImplementedICustomPropertyProviderInterface2 = false; bool flag = false; WinRTExposedTypeAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)type, false); if (customAttribute == null) { System.Type cCWType = type.GetCCWType(); if (cCWType != (System.Type)null) { customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)cCWType, false); } } ComInterfaceEntry[] array = default(ComInterfaceEntry[]); if (customAttribute != null) { flag = true; val.AddRange((System.Collections.Generic.IEnumerable)customAttribute.GetExposedInterfaces()); if (type.IsClass) { hasUserImplementedIMarshalInterface2 = GetHasCustomIMarshalInterface(val); hasUserImplementedICustomPropertyProviderInterface2 = GetHasICustomPropertyProviderInterface(val); } } else if (type == typeof(EventHandler)) { flag = true; val.AddRange((System.Collections.Generic.IEnumerable)Projections.GetAbiEventHandlerExposedInterfaces()); } else if (type == typeof(PropertyChangedEventHandler)) { flag = true; val.AddRange((System.Collections.Generic.IEnumerable)Projections.GetAbiPropertyChangedEventHandlerExposedInterfaces()); } else if (type == typeof(NotifyCollectionChangedEventHandler)) { flag = true; val.AddRange((System.Collections.Generic.IEnumerable)Projections.GetAbiNotifyCollectionChangedEventHandlerExposedInterfaces()); } else if (ComInterfaceEntriesForType.TryGetValue(type, ref array)) { flag = true; val.AddRange((System.Collections.Generic.IEnumerable)array); } else { if (!type.IsEnum) { ComInterfaceEntry[] comInterfaceEntriesForTypeFromLookupTable = GetComInterfaceEntriesForTypeFromLookupTable(type); if (comInterfaceEntriesForTypeFromLookupTable != null) { flag = true; val.AddRange((System.Collections.Generic.IEnumerable)comInterfaceEntriesForTypeFromLookupTable); goto IL_0119; } } if (RuntimeFeature.IsDynamicCodeCompiled) { GetInterfaceTableEntriesForJitEnvironment(type, val, ref hasUserImplementedIMarshalInterface2, ref hasUserImplementedICustomPropertyProviderInterface2); } } goto IL_0119; IL_0119: if (type.IsSZArray) { System.Type elementType = type.GetElementType(); if (elementType.ShouldProvideIReference()) { val.Add(IPropertyValueEntry); val.Add(ProvideIReferenceArray(type)); } } else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(KeyValuePair<, >)) { ComInterfaceEntry val2 = default(ComInterfaceEntry); if (KeyValuePairHelper.KeyValuePairCCW.TryGetValue(type, ref val2)) { val.Add(val2); } else { System.Type type2 = type.FindHelperType(); val.Add(new ComInterfaceEntry { IID = GuidGenerator.GetIID(type2), Vtable = type2.GetAbiToProjectionVftblPtr() }); } } else if (!flag && type.ShouldProvideIReference()) { val.Add(IPropertyValueEntry); val.Add(ProvideIReference(type)); } val.Add(new ComInterfaceEntry { IID = IID.IID_IStringable, Vtable = ManagedIStringableVftbl.AbiToProjectionVftablePtr }); if (FeatureSwitches.EnableICustomPropertyProviderSupport && !hasUserImplementedICustomPropertyProviderInterface2) { val.Add(new ComInterfaceEntry { IID = IID.IID_ICustomPropertyProvider, Vtable = ManagedCustomPropertyProviderVftbl.AbiToProjectionVftablePtr }); } val.Add(new ComInterfaceEntry { IID = IID.IID_IWeakReferenceSource, Vtable = ABI.WinRT.Interop.IWeakReferenceSource.AbiToProjectionVftablePtr }); if (!hasUserImplementedIMarshalInterface2) { val.Add(new ComInterfaceEntry { IID = IID.IID_IMarshal, Vtable = IMarshal.Vftbl.AbiToProjectionVftablePtr }); } val.Add(new ComInterfaceEntry { IID = IID.IID_IAgileObject, Vtable = IUnknownVftbl.AbiToProjectionVftblPtr }); val.Add(new ComInterfaceEntry { IID = IID.IID_IInspectable, Vtable = IInspectable.Vftbl.AbiToProjectionVftablePtr }); val.Add(new ComInterfaceEntry { IID = IID.IID_IUnknown, Vtable = IUnknownVftbl.AbiToProjectionVftblPtr }); return val; [CompilerGenerated] static void AddInterfaceToVtable(System.Type iface, List entries, ref bool hasUserImplementedIMarshalInterface, ref bool hasUserImplementedICustomPropertyProviderInterface) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) System.Type type3 = iface.FindHelperType(); Guid iID = GuidGenerator.GetIID(type3); entries.Add(new ComInterfaceEntry { IID = GuidGenerator.GetIID(type3), Vtable = type3.GetAbiToProjectionVftblPtr() }); if (!hasUserImplementedIMarshalInterface && iID == IID.IID_IMarshal) { hasUserImplementedIMarshalInterface = true; } if (!hasUserImplementedICustomPropertyProviderInterface && iID == IID.IID_ICustomPropertyProvider) { hasUserImplementedICustomPropertyProviderInterface = true; } } [CompilerGenerated] static bool GetHasCustomIMarshalInterface(List entries) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) System.Span span2 = CollectionsMarshal.AsSpan(entries); for (int k = 0; k < span2.Length; k++) { if (span2[k].IID == IID.IID_IMarshal) { return true; } } return false; } [CompilerGenerated] static bool GetHasICustomPropertyProviderInterface(List entries) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) System.Span span = CollectionsMarshal.AsSpan(entries); for (int j = 0; j < span.Length; j++) { if (span[j].IID == IID.IID_ICustomPropertyProvider) { return true; } } return false; } [MethodImpl(8)] [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Fallback method for JIT environments that is not trim-safe by design.")] [UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "Fallback method for JIT environments that is not trim-safe by design.")] [UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "Fallback method for JIT environments that is not trim-safe by design.")] [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "Fallback method for JIT environments that is not trim-safe by design.")] static void GetInterfaceTableEntriesForJitEnvironment(System.Type type, List entries, ref bool hasUserImplementedIMarshalInterface, ref bool hasUserImplementedICustomPropertyProviderInterface) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (type.IsDelegate()) { System.Type type4 = type.FindHelperType(); if (type4 != null) { entries.Add(new ComInterfaceEntry { IID = GuidGenerator.GetIID(type), Vtable = type4.GetAbiToProjectionVftblPtr() }); } if (type.ShouldProvideIReference()) { entries.Add(IPropertyValueEntry); entries.Add(ProvideIReference(type)); } } else { System.Type type5 = type.GetRuntimeClassCCWType() ?? type; System.Type[] interfaces = type5.GetInterfaces(); System.Type[] array2 = interfaces; foreach (System.Type type6 in array2) { if (Projections.IsTypeWindowsRuntimeType(type6)) { AddInterfaceToVtable(type6, entries, ref hasUserImplementedIMarshalInterface, ref hasUserImplementedICustomPropertyProviderInterface); } if (type6.IsConstructedGenericType && Projections.TryGetCompatibleWindowsRuntimeTypesForVariantType(type6, null, out var compatibleTypes)) { System.Collections.Generic.IEnumerator enumerator = compatibleTypes.GetEnumerator(); try { while (((System.Collections.IEnumerator)enumerator).MoveNext()) { System.Type current = enumerator.Current; AddInterfaceToVtable(current, entries, ref hasUserImplementedIMarshalInterface, ref hasUserImplementedICustomPropertyProviderInterface); } } finally { ((System.IDisposable)enumerator)?.Dispose(); } } } } } } [UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode", Justification = "The existence of the ABI type implies the non-ABI type exists, as in authoring scenarios the ABI type is constructed from the non-ABI type.")] internal static ValueTuple> PregenerateNativeTypeInformation(System.Type type) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) List interfaceTableEntries = GetInterfaceTableEntries(type); Guid[] array = (Guid[])(object)new Guid[interfaceTableEntries.Count]; for (int i = 0; i < interfaceTableEntries.Count; i++) { array[i] = interfaceTableEntries[i].IID; } if (type.FullName.StartsWith("ABI.", (StringComparison)4)) { type = Projections.FindCustomPublicTypeForAbiType(type) ?? type.Assembly.GetType(type.FullName.Substring("ABI.".Length)) ?? type; } return new ValueTuple>(new InspectableInfo(type, array), interfaceTableEntries); } private static Func CreateKeyValuePairFactory(System.Type type) { return (Func)(object)type.GetHelperType().GetMethod("CreateRcw", (BindingFlags)24).CreateDelegate(typeof(Func)); } internal static Func GetOrCreateDelegateFactory(System.Type type) { return DelegateFactoryCache.GetOrAdd(type, (Func>)CreateDelegateFactory); } [UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "The type is a delegate type, so 'GuidGenerator.GetIID' doesn't need to access public fields from it (it uses the helper type).")] private static Func CreateDelegateFactory(System.Type type) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) Func createRcwFunc = (Func)(object)type.GetHelperType().GetMethod("CreateRcw", (BindingFlags)24).CreateDelegate(typeof(Func)); Guid iid = GuidGenerator.GetIID(type); return delegate(nint externalComObject) { nint num = default(nint); Marshal.ThrowExceptionForHR(Marshal.QueryInterface((System.IntPtr)externalComObject, ref iid, ref num)); try { return createRcwFunc.Invoke(num); } finally { Marshal.Release((System.IntPtr)num); } }; } public static bool RegisterDelegateFactory(System.Type implementationType, Func delegateFactory) { return DelegateFactoryCache.TryAdd(implementationType, delegateFactory); } internal static Func CreateNullableTFactory(System.Type implementationType) { MethodInfo getValueMethod = implementationType.GetHelperType().GetMethod("GetValue", (BindingFlags)24); return delegate(IInspectable obj) { MethodInfo obj2 = getValueMethod; object[] array = new IInspectable[1] { obj }; return ((MethodBase)obj2).Invoke((object)null, array); }; } internal static Func CreateAbiNullableTFactory([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type implementationType) { MethodInfo method = implementationType.GetMethod("GetValue", (BindingFlags)24); return (Func)(object)method.CreateDelegate(typeof(Func)); } private static Func CreateArrayFactory(System.Type implementationType) { MethodInfo method = implementationType.GetHelperType().GetMethod("GetValue", (BindingFlags)24); return (Func)(object)method.CreateDelegate(typeof(Func)); } internal static Func CreateReferenceCachingFactory(Func internalFactory) { return DelegateExtensions.InvokeWithBoxedValueReferenceCacheInsertion; } private static Func CreateCustomTypeMappingFactory([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type customTypeHelperType) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) MethodInfo method = customTypeHelperType.GetMethod("FromAbi", (BindingFlags)24); if (method == null) { throw new MissingMethodException(); } Func fromAbiMethodFunc = (Func)(object)method.CreateDelegate(typeof(Func)); return delegate(IInspectable obj) { object result = fromAbiMethodFunc.Invoke(obj.ThisPtr); GC.KeepAlive((object)obj); return result; }; } internal static Func CreateTypedRcwFactory(System.Type implementationType) { return CreateTypedRcwFactory(implementationType, null); } internal static Func CreateTypedRcwFactory(System.Type implementationType, string runtimeClassName) { if (implementationType == (System.Type)null || implementationType == typeof(object)) { return (IInspectable obj) => obj; } if (implementationType == typeof(string) || implementationType == typeof(System.Type) || implementationType == typeof(System.Exception) || implementationType.IsDelegate()) { return NullableType.GetValueFactory(implementationType); } if (implementationType.IsValueType) { if (implementationType.IsGenericType && implementationType.GetGenericTypeDefinition() == typeof(KeyValuePair<, >)) { return CreateReferenceCachingFactory(CreateKeyValuePairFactory(implementationType)); } if (implementationType.IsNullableT()) { return NullableType.GetValueFactory(implementationType.GetGenericArguments()[0]); } return NullableType.GetValueFactory(implementationType); } System.Type type = Projections.FindCustomHelperTypeMapping(implementationType, filterToRuntimeClass: true); if (type != (System.Type)null) { return CreateReferenceCachingFactory(CreateCustomTypeMappingFactory(type)); } if (implementationType.IsIReferenceArray()) { return CreateReferenceCachingFactory(CreateArrayFactory(implementationType)); } return CreateFactoryForImplementationType(runtimeClassName, implementationType); } internal static System.Type GetRuntimeClassForTypeCreation(IInspectable inspectable, System.Type staticallyDeterminedType) { string runtimeClassName = inspectable.GetRuntimeClassName(noThrow: true); System.Type type = null; if (!string.IsNullOrEmpty(runtimeClassName)) { if (runtimeClassName.StartsWith("Windows.Foundation.IReference`1<", (StringComparison)4)) { return TypeNameSupport.FindRcwTypeByNameCached(runtimeClassName.Substring(32, runtimeClassName.Length - 33)); } type = TypeNameSupport.FindRcwTypeByNameCached(runtimeClassName); } if (staticallyDeterminedType != (System.Type)null && staticallyDeterminedType != typeof(object) && (!(type != (System.Type)null) || (!(staticallyDeterminedType == type) && !staticallyDeterminedType.IsAssignableFrom(type)))) { return staticallyDeterminedType; } if (!RuntimeFeature.IsDynamicCodeCompiled && type != (System.Type)null && type.IsInterface && type.IsGenericType && !TypedObjectFactoryCacheForType.ContainsKey(type)) { return staticallyDeterminedType; } return type; } private static ComInterfaceEntry ProvideIReference(System.Type type) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0581: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0775: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableIReferenceSupport) { throw new NotSupportedException("Support for 'IReference' is not enabled."); } ComInterfaceEntry result; if (type == typeof(int)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableInt; result.Vtable = Nullable_int.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(string)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableString; result.Vtable = Nullable_string.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(byte)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableByte; result.Vtable = Nullable_byte.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(short)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableShort; result.Vtable = Nullable_short.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(ushort)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableUShort; result.Vtable = Nullable_ushort.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(uint)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableUInt; result.Vtable = Nullable_uint.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(long)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableLong; result.Vtable = Nullable_long.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(ulong)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableULong; result.Vtable = Nullable_ulong.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(float)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableFloat; result.Vtable = Nullable_float.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(double)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableDouble; result.Vtable = Nullable_double.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(char)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableChar; result.Vtable = Nullable_char.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(bool)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableBool; result.Vtable = Nullable_bool.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(Guid)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableGuid; result.Vtable = Nullable_guid.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(DateTimeOffset)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableDateTimeOffset; result.Vtable = Nullable_DateTimeOffset.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(TimeSpan)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableTimeSpan; result.Vtable = Nullable_TimeSpan.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(object)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableObject; result.Vtable = Nullable_Object.Vftbl.AbiToProjectionVftablePtr; return result; } if (type.IsTypeOfType()) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableType; result.Vtable = Nullable_Type.Vftbl.AbiToProjectionVftablePtr; return result; } if (type == typeof(sbyte)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableSByte; result.Vtable = Nullable_sbyte.Vftbl.AbiToProjectionVftablePtr; return result; } if (type.IsEnum) { if (CustomAttributeExtensions.IsDefined((MemberInfo)(object)type, typeof(FlagsAttribute))) { result = default(ComInterfaceEntry); result.IID = Nullable_FlagsEnum.GetIID(type); result.Vtable = Nullable_FlagsEnum.AbiToProjectionVftablePtr; return result; } result = default(ComInterfaceEntry); result.IID = Nullable_IntEnum.GetIID(type); result.Vtable = Nullable_IntEnum.AbiToProjectionVftablePtr; return result; } if (type == typeof(EventHandler)) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableEventHandler; result.Vtable = Nullable_EventHandler.AbiToProjectionVftablePtr; return result; } if (type.IsDelegate()) { if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot provide IReference`1 support for delegate type '{type}'."); } System.Type type2 = typeof(Nullable_Delegate<>).MakeGenericType(new System.Type[1] { type }); result = default(ComInterfaceEntry); result.IID = GuidGenerator.GetIID(type2); result.Vtable = type2.GetAbiToProjectionVftblPtr(); return result; } if (type == typeof(Matrix3x2)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceMatrix3x2; result.Vtable = BoxedValueIReferenceImpl.AbiToProjectionVftablePtr; return result; } if (type == typeof(Matrix4x4)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceMatrix4x4; result.Vtable = BoxedValueIReferenceImpl.AbiToProjectionVftablePtr; return result; } if (type == typeof(Plane)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferencePlane; result.Vtable = BoxedValueIReferenceImpl.AbiToProjectionVftablePtr; return result; } if (type == typeof(Quaternion)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceQuaternion; result.Vtable = BoxedValueIReferenceImpl.AbiToProjectionVftablePtr; return result; } if (type == typeof(Vector2)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceVector2; result.Vtable = BoxedValueIReferenceImpl.AbiToProjectionVftablePtr; return result; } if (type == typeof(Vector3)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceVector3; result.Vtable = BoxedValueIReferenceImpl.AbiToProjectionVftablePtr; return result; } if (type == typeof(Vector4)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceVector4; result.Vtable = BoxedValueIReferenceImpl.AbiToProjectionVftablePtr; return result; } if (type.IsTypeOfException()) { result = default(ComInterfaceEntry); result.IID = IID.IID_NullableException; result.Vtable = Nullable_Exception.Vftbl.AbiToProjectionVftablePtr; return result; } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot provide IReference`1 support for type '{type}'."); } result = default(ComInterfaceEntry); result.IID = GuidGenerator.GetIID(typeof(Nullable<>).MakeGenericType(new System.Type[1] { type })); result.Vtable = typeof(BoxedValueIReferenceImpl<>).MakeGenericType(new System.Type[1] { type }).GetAbiToProjectionVftblPtr(); return result; } private static ComInterfaceEntry ProvideIReferenceArray(System.Type arrayType) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableIReferenceSupport) { throw new NotSupportedException("Support for 'IReferenceArray' is not enabled."); } System.Type elementType = arrayType.GetElementType(); ComInterfaceEntry result; if (elementType == typeof(int)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfInt32; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(string)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfString; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(byte)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfByte; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(short)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfInt16; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(ushort)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfUInt16; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(uint)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfUInt32; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(long)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfInt64; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(ulong)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfUInt64; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(float)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfSingle; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(double)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfDouble; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(char)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfChar; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(bool)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfBoolean; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(Guid)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfGuid; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(DateTimeOffset)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfDateTimeOffset; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(TimeSpan)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfTimeSpan; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(object)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfObject; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType.IsTypeOfType()) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfType; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(Matrix3x2)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfMatrix3x2; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(Matrix4x4)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfMatrix4x4; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(Plane)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfPlane; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(Quaternion)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfQuaternion; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(Vector2)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfVector2; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(Vector3)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfVector3; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType == typeof(Vector4)) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfVector4; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (elementType.IsTypeOfException()) { result = default(ComInterfaceEntry); result.IID = IID.IID_IReferenceArrayOfException; result.Vtable = BoxedArrayIReferenceArrayImpl.AbiToProjectionVftablePtr; return result; } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot provide IReferenceArray`1 support for element type '{elementType}'."); } result = default(ComInterfaceEntry); result.IID = GuidGenerator.GetIID(typeof(ABI.Windows.Foundation.IReferenceArray<>).MakeGenericType(new System.Type[1] { elementType })); result.Vtable = typeof(BoxedArrayIReferenceArrayImpl<>).MakeGenericType(new System.Type[1] { elementType }).GetAbiToProjectionVftblPtr(); return result; } internal static ObjectReference CreateCCWForObject(object obj, Guid iid) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) nint thisPtr = CreateCCWForObjectForABI(obj, iid); return ObjectReference.Attach(ref thisPtr, iid); } internal static ObjectReferenceValue CreateCCWForObjectForMarshaling(object obj, Guid iid) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) nint ptr = CreateCCWForObjectForABI(obj, iid); return new ObjectReferenceValue(ptr); } internal static InspectableInfo GetInspectableInfo(nint pThis) { object obj = FindObject(pThis); return InspectableInfoTable.GetValue(obj.GetType(), (CreateValueCallback)((System.Type o) => PregenerateNativeTypeInformation(o).Item1)); } public static T CreateRcwForComObject(nint ptr) { return CreateRcwForComObject(ptr, tryUseCache: true); } private static T CreateRcwForComObject(nint ptr, bool tryUseCache) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (ptr == (nint)System.IntPtr.Zero) { return default(T); } CreateRCWType = typeof(T); CreateObjectFlags val = (CreateObjectFlags)(tryUseCache ? 1 : 3); object orCreateObjectForComInstance = ComWrappers.GetOrCreateObjectForComInstance((System.IntPtr)ptr, val); CreateRCWType = null; object obj = orCreateObjectForComInstance; if (!(obj is Nullable nullable)) { if (obj is T result) { return result; } if (tryUseCache) { return CreateRcwForComObject(ptr, tryUseCache: false); } throw new ArgumentException($"Unable to create a wrapper object. The WinRT object {ptr} has type {orCreateObjectForComInstance.GetType()} which cannot be assigned to type {typeof(T)}"); } return (T)nullable.Value; } public static bool TryUnwrapObject(object o, out IObjectReference objRef) { if (o is System.Delegate @delegate) { return TryUnwrapObject(@delegate.Target, out objRef); } if (o is IWinRTObject winRTObject && winRTObject.HasUnwrappableNativeObject) { objRef = winRTObject.NativeObject; return true; } objRef = null; return false; } public static void RegisterObjectForInterface(object obj, nint thisPtr, CreateObjectFlags createObjectFlags) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ComWrappers.GetOrRegisterObjectForComInstance((System.IntPtr)thisPtr, createObjectFlags, obj); } internal static void RegisterObjectForInterface(object obj, nint thisPtr, nint inner, CreateObjectFlags createObjectFlags) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ComWrappers.GetOrRegisterObjectForComInstance((System.IntPtr)thisPtr, createObjectFlags, obj, (System.IntPtr)inner); } public static void RegisterObjectForInterface(object obj, nint thisPtr) { TryRegisterObjectForInterface(obj, thisPtr); } public static object TryRegisterObjectForInterface(object obj, nint thisPtr) { return ComWrappers.GetOrRegisterObjectForComInstance((System.IntPtr)thisPtr, (CreateObjectFlags)1, obj); } internal static nint CreateCCWForObjectUnsafe(object obj) { return ComWrappers.GetOrCreateComInterfaceForObject(obj, (CreateComInterfaceFlags)2); } public static IObjectReference CreateCCWForObject(object obj) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) nint thisPtr = ComWrappers.GetOrCreateComInterfaceForObject(obj, (CreateComInterfaceFlags)2); return ObjectReference.Attach(ref thisPtr, IID.IID_IUnknown); } internal static nint CreateCCWForObjectForABI(object obj, Guid iid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) nint orCreateComInterfaceForObject = ComWrappers.GetOrCreateComInterfaceForObject(obj, (CreateComInterfaceFlags)2); nint result = default(nint); int num = Marshal.QueryInterface((System.IntPtr)orCreateComInterfaceForObject, ref iid, ref result); Marshal.Release((System.IntPtr)orCreateComInterfaceForObject); if (num < 0) { ThrowException(obj, iid, num); } return result; [MethodImpl(8)] [CompilerGenerated] static void ThrowException(object obj, Guid iid, int hr) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (hr == -2147467262) { throw new InvalidCastException($"Failed to create a CCW for object of type '{obj.GetType()}' for interface with IID '{((object)(Guid)(ref iid)).ToString().ToUpperInvariant()}': the specified cast is not valid."); } ExceptionHelpers.ThrowExceptionForHR(hr); } } public unsafe static T FindObject(nint ptr) where T : class { return ComInterfaceDispatch.GetInstance((ComInterfaceDispatch*)ptr); } public static nint AllocateVtableMemory(System.Type vtableType, int size) { return RuntimeHelpers.AllocateTypeAssociatedMemory(vtableType, size); } public static void InitializeComWrappers(ComWrappers wrappers = null) { ComWrappers = wrappers; } internal static Func GetTypedRcwFactory(System.Type implementationType) { return TypedObjectFactoryCacheForType.GetOrAdd(implementationType, (Func>)CreateTypedRcwFactory); } public static bool RegisterTypedRcwFactory(System.Type implementationType, Func rcwFactory) { return TypedObjectFactoryCacheForType.TryAdd(implementationType, rcwFactory); } private static Func CreateFactoryForImplementationType(string runtimeClassName, System.Type implementationType) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) if (implementationType.IsGenericType) { if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot create an RCW factory for implementation type '{implementationType}'."); } System.Type type = GetGenericImplType(implementationType); if (type != (System.Type)null) { MethodInfo method = type.GetMethod("CreateRcw", (BindingFlags)24, (Binder)null, new System.Type[1] { typeof(IInspectable) }, (ParameterModifier[])null); return (Func)(object)method.CreateDelegate(typeof(Func)); } } if (implementationType.IsInterface) { return (IInspectable obj) => obj; } WinRTImplementationTypeRcwFactoryAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)implementationType, false); if (customAttribute != null) { return customAttribute.CreateInstance; } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot create an RCW factory for implementation type '{implementationType}', because it doesn't have " + "a [WinRTImplementationTypeRcwFactory] derived attribute on it. The fallback path for older projections is not trim-safe, and isn't supported in AOT environments. Make sure to reference updated projections."); } return CreateRcwFallback(implementationType); [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "This fallback path is not trim-safe by design (to avoid annotations).")] static Func CreateRcwFallback(System.Type implementationType) { ConstructorInfo constructor = implementationType.GetConstructor((BindingFlags)548, (Binder)null, new System.Type[1] { typeof(IObjectReference) }, (ParameterModifier[])null); return delegate(IInspectable obj) { ConstructorInfo obj2 = constructor; object[] array = new IObjectReference[1] { obj.ObjRef }; return obj2.Invoke(array); }; } [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] static System.Type GetGenericImplType(System.Type implementationType) { System.Type genericTypeDefinition = implementationType.GetGenericTypeDefinition(); System.Type type2 = null; if (genericTypeDefinition == typeof(System.Collections.Generic.IList<>)) { type2 = typeof(IListImpl<>); } else if (genericTypeDefinition == typeof(IDictionary<, >)) { type2 = typeof(IDictionaryImpl<, >); } else if (genericTypeDefinition == typeof(IReadOnlyDictionary<, >)) { type2 = typeof(IReadOnlyDictionaryImpl<, >); } else if (genericTypeDefinition == typeof(System.Collections.Generic.IReadOnlyList<>)) { type2 = typeof(IReadOnlyListImpl<>); } else if (genericTypeDefinition == typeof(System.Collections.Generic.IEnumerable<>)) { type2 = typeof(IEnumerableImpl<>); } else { if (!(genericTypeDefinition == typeof(System.Collections.Generic.IEnumerator<>))) { return null; } type2 = typeof(IEnumeratorImpl<>); } return type2.MakeGenericType(implementationType.GetGenericArguments()); } } public static void RegisterTypeComInterfaceEntriesLookup(Func comInterfaceEntriesLookup) { ComInterfaceEntriesLookup.Add(comInterfaceEntriesLookup); } internal static ComInterfaceEntry[] GetComInterfaceEntriesForTypeFromLookupTable(System.Type type) { int count = ComInterfaceEntriesLookup.Count; for (int i = 0; i < count; i++) { ComInterfaceEntry[] array = ComInterfaceEntriesLookup[i].Invoke(type); if (array != null) { return array; } } return null; } public static void RegisterTypeRuntimeClassNameLookup(Func runtimeClassNameLookup) { RuntimeClassNameForNonWinRTTypeLookup.Add(runtimeClassNameLookup); } internal static string GetRuntimeClassNameForNonWinRTTypeFromLookupTable(System.Type type) { int count = RuntimeClassNameForNonWinRTTypeLookup.Count; for (int i = 0; i < count; i++) { string text = RuntimeClassNameForNonWinRTTypeLookup[i].Invoke(type); if (!string.IsNullOrEmpty(text)) { return text; } } return null; } public static void RegisterComInterfaceEntries(System.Type implementationType, ComInterfaceEntry[] comInterfaceEntries) { ComInterfaceEntriesForType.TryAdd(implementationType, comInterfaceEntries); } } public class ComWrappersHelper { public static void Init(bool isAggregation, object thisInstance, nint newInstance, nint inner, out IObjectReference objRef) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) Init(isAggregation, thisInstance, newInstance, inner, IID.IID_IUnknown, out objRef); } public static void Init(bool isAggregation, object thisInstance, nint newInstance, nint inner, Guid iidForNewInstance, out IObjectReference objRef) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) objRef = ComWrappersSupport.GetObjectReferenceForInterface(isAggregation ? inner : newInstance, isAggregation ? IID.IID_IInspectable : iidForNewInstance, requireQI: false); nint num = default(nint); if (Marshal.QueryInterface((System.IntPtr)objRef.ThisPtr, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_IReferenceTracker), ref num) != 0) { num = 0; } CreateObjectFlags val = (CreateObjectFlags)0; if (num != 0) { val = (CreateObjectFlags)(val | 1); } if (isAggregation) { val = (CreateObjectFlags)(val | 4); if (num != 0) { Marshal.Release((System.IntPtr)num); ComWrappersSupport.RegisterObjectForInterface(thisInstance, newInstance, inner, val); } else { ComWrappersSupport.RegisterObjectForInterface(thisInstance, newInstance, val); } } else { ComWrappersSupport.RegisterObjectForInterface(thisInstance, newInstance, val); } if (isAggregation) { objRef.IsAggregated = true; objRef.PreventReleaseOnDispose = num != 0; return; } if (num != 0) { objRef.ReferenceTrackerPtr = num; objRef.PreventReleaseFromTrackerSourceOnDispose = true; Marshal.Release((System.IntPtr)num); } Marshal.Release((System.IntPtr)newInstance); } public static void Init(IObjectReference objRef, bool addRefFromTrackerSource = true) { nint num = default(nint); if (objRef.ReferenceTrackerPtr == (nint)System.IntPtr.Zero && Marshal.QueryInterface((System.IntPtr)objRef.ThisPtr, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_IReferenceTracker), ref num) == 0) { objRef.ReferenceTrackerPtr = num; if (addRefFromTrackerSource) { objRef.AddRefFromTrackerSource(); } else { objRef.PreventReleaseFromTrackerSourceOnDispose = true; } Marshal.Release((System.IntPtr)num); } } } public class DefaultComWrappers : ComWrappers { private sealed class VtableEntries { [field: CompilerGenerated] public unsafe ComInterfaceEntry* Data { [CompilerGenerated] get; } [field: CompilerGenerated] public int Count { [CompilerGenerated] get; } public unsafe VtableEntries() { Data = null; Count = 0; } public unsafe VtableEntries(List entries, System.Type type) { Data = (ComInterfaceEntry*)RuntimeHelpers.AllocateTypeAssociatedMemory(type, System.Runtime.CompilerServices.Unsafe.SizeOf() * entries.Count); CollectionsMarshal.AsSpan(entries).CopyTo(new System.Span((void*)Data, entries.Count)); Count = entries.Count; } } private static readonly ConditionalWeakTable TypeVtableEntryTable; public unsafe static IUnknownVftbl IUnknownVftbl => System.Runtime.CompilerServices.Unsafe.AsRef(((System.IntPtr)IUnknownVftblPtr).ToPointer()); [field: CompilerGenerated] internal static nint IUnknownVftblPtr { [CompilerGenerated] get; } unsafe static DefaultComWrappers() { TypeVtableEntryTable = new ConditionalWeakTable(); nint queryInterface = default(nint); nint addRef = default(nint); nint release = default(nint); ComWrappers.GetIUnknownImpl(ref queryInterface, ref addRef, ref release); IUnknownVftblPtr = RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(IUnknownVftbl), sizeof(IUnknownVftbl)); *(IUnknownVftbl*)IUnknownVftblPtr = new IUnknownVftbl { QueryInterface = (delegate* unmanaged[Stdcall])queryInterface, AddRef = (delegate* unmanaged[Stdcall])addRef, Release = (delegate* unmanaged[Stdcall])release }; } protected unsafe override ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) VtableEntries value = TypeVtableEntryTable.GetValue(obj.GetType(), (CreateValueCallback)((System.Type type) => IsRuntimeImplementedRCW(type) ? new VtableEntries() : new VtableEntries(ComWrappersSupport.GetInterfaceTableEntries(type), type))); count = value.Count; if (count != 0 && !((System.Enum)flags).HasFlag((System.Enum)(object)(CreateComInterfaceFlags)1)) { count--; } return value.Data; } private static bool IsRuntimeImplementedRCW(System.Type objType) { if (!RuntimeFeature.IsDynamicCodeCompiled) { return false; } bool result = objType.IsCOMObject; if (objType.IsGenericType) { System.Type[] genericArguments = objType.GetGenericArguments(); foreach (System.Type type in genericArguments) { if (type.IsCOMObject) { result = true; break; } } } return result; } private static object CreateObject(nint externalComObject) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) Guid iID_IInspectable = IID.IID_IInspectable; Guid iID_IWeakReference = IID.IID_IWeakReference; nint zero = System.IntPtr.Zero; try { if (ComWrappersSupport.CreateRCWType != (System.Type)null && ComWrappersSupport.CreateRCWType.IsDelegate()) { return ComWrappersSupport.GetOrCreateDelegateFactory(ComWrappersSupport.CreateRCWType).Invoke(externalComObject); } if (Marshal.QueryInterface((System.IntPtr)externalComObject, ref iID_IInspectable, ref zero) == 0) { ObjectReference objectReferenceForInterface = ComWrappersSupport.GetObjectReferenceForInterface(zero, IID.IID_IInspectable, requireQI: false); ComWrappersHelper.Init(objectReferenceForInterface); IInspectable inspectable = new IInspectable(objectReferenceForInterface); if (ComWrappersSupport.CreateRCWType != (System.Type)null && ComWrappersSupport.CreateRCWType.IsSealed) { return ComWrappersSupport.GetTypedRcwFactory(ComWrappersSupport.CreateRCWType).Invoke(inspectable); } System.Type runtimeClassForTypeCreation = ComWrappersSupport.GetRuntimeClassForTypeCreation(inspectable, ComWrappersSupport.CreateRCWType); if (runtimeClassForTypeCreation == (System.Type)null) { return inspectable; } return ComWrappersSupport.GetTypedRcwFactory(runtimeClassForTypeCreation).Invoke(inspectable); } if (Marshal.QueryInterface((System.IntPtr)externalComObject, ref iID_IWeakReference, ref zero) == 0) { ObjectReference objectReferenceForInterface2 = ComWrappersSupport.GetObjectReferenceForInterface(zero, iID_IWeakReference, requireQI: false); ComWrappersHelper.Init(objectReferenceForInterface2); return new SingleInterfaceOptimizedObject(typeof(WinRT.Interop.IWeakReference), objectReferenceForInterface2, requireQI: false); } return null; } finally { MarshalExtensions.ReleaseIfNotNull(zero); } } protected override object CreateObject(nint externalComObject, CreateObjectFlags flags) { object obj = CreateObject(externalComObject); if (obj is IWinRTObject winRTObject && winRTObject.HasUnwrappableNativeObject && winRTObject.NativeObject != null) { winRTObject.NativeObject.ReleaseFromTrackerSource(); winRTObject.NativeObject.PreventReleaseFromTrackerSourceOnDispose = true; } return obj; } protected override void ReleaseObjects(System.Collections.IEnumerable objects) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) foreach (object @object in objects) { if (ComWrappersSupport.TryUnwrapObject(@object, out var objRef)) { objRef.Dispose(); continue; } throw new InvalidOperationException("Cannot release objects that are not runtime wrappers of native WinRT objects."); } } } internal static class FeatureSwitches { private const string EnableDynamicObjectsSupportPropertyName = "CSWINRT_ENABLE_DYNAMIC_OBJECTS_SUPPORT"; private const string UseExceptionResourceKeysPropertyName = "CSWINRT_USE_EXCEPTION_RESOURCE_KEYS"; private const string EnableDefaultCustomTypeMappingsPropertyName = "CSWINRT_ENABLE_DEFAULT_CUSTOM_TYPE_MAPPINGS"; private const string EnableICustomPropertyProviderSupportPropertyName = "CSWINRT_ENABLE_ICUSTOMPROPERTYPROVIDER_SUPPORT"; private const string EnableIReferenceSupportPropertyName = "CSWINRT_ENABLE_IREFERENCE_SUPPORT"; private const string EnableIDynamicInterfaceCastableSupportPropertyName = "CSWINRT_ENABLE_IDYNAMICINTERFACECASTABLE"; private const string UseWindowsUIXamlProjectionsPropertyName = "CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS"; private static int _enableDynamicObjectsSupport; private static int _useExceptionResourceKeys; private static int _enableDefaultCustomTypeMappings; private static int _enableICustomPropertyProviderSupport; private static int _enableIReferenceSupport; private static int _enableIDynamicInterfaceCastableSupport; private static int _useWindowsUIXamlProjections; public static bool EnableDynamicObjectsSupport { [MethodImpl(256)] get { return GetConfigurationValue("CSWINRT_ENABLE_DYNAMIC_OBJECTS_SUPPORT", ref _enableDynamicObjectsSupport, defaultValue: true); } } public static bool UseExceptionResourceKeys { [MethodImpl(256)] get { return GetConfigurationValue("CSWINRT_USE_EXCEPTION_RESOURCE_KEYS", ref _useExceptionResourceKeys, defaultValue: false); } } public static bool EnableDefaultCustomTypeMappings { [MethodImpl(256)] get { return GetConfigurationValue("CSWINRT_ENABLE_DEFAULT_CUSTOM_TYPE_MAPPINGS", ref _enableDefaultCustomTypeMappings, defaultValue: true); } } public static bool EnableICustomPropertyProviderSupport { [MethodImpl(256)] get { return GetConfigurationValue("CSWINRT_ENABLE_ICUSTOMPROPERTYPROVIDER_SUPPORT", ref _enableICustomPropertyProviderSupport, defaultValue: true); } } public static bool EnableIReferenceSupport { [MethodImpl(256)] get { return GetConfigurationValue("CSWINRT_ENABLE_IREFERENCE_SUPPORT", ref _enableIReferenceSupport, defaultValue: true); } } public static bool EnableIDynamicInterfaceCastableSupport { [MethodImpl(256)] get { return GetConfigurationValue("CSWINRT_ENABLE_IDYNAMICINTERFACECASTABLE", ref _enableIDynamicInterfaceCastableSupport, defaultValue: true); } } public static bool UseWindowsUIXamlProjections { [MethodImpl(256)] get { return GetConfigurationValue("CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS", ref _useWindowsUIXamlProjections, defaultValue: false); } } private static bool GetConfigurationValue(string propertyName, ref int cachedResult, bool defaultValue) { if (cachedResult < 0) { return false; } if (cachedResult > 0) { return true; } bool flag = default(bool); if (!AppContext.TryGetSwitch(propertyName, ref flag)) { flag = defaultValue; } cachedResult = (flag ? 1 : (-1)); return flag; } } internal static class Context { public unsafe static nint GetContextToken() { nint result = default(nint); Marshal.ThrowExceptionForHR(Platform.CoGetContextToken(&result)); return result; } public unsafe static nint GetContextCallback() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) Guid iID_IContextCallback = IID.IID_IContextCallback; nint result = default(nint); Marshal.ThrowExceptionForHR(Platform.CoGetObjectContext(&iID_IContextCallback, &result)); return result; } public unsafe static void CallInContext(nint contextCallbackPtr, nint contextToken, delegate* callback, delegate* onFailCallback, object state) { if (contextCallbackPtr == (nint)System.IntPtr.Zero || GetContextToken() == contextToken) { callback(state); } else { IContextCallbackVftbl.ContextCallback(contextCallbackPtr, callback, onFailCallback, state); } } public static void DisposeContextCallback(nint contextCallbackPtr) { MarshalInspectable.DisposeAbi(contextCallbackPtr); } } internal static class DelegateExtensions { public static void DynamicInvokeAbi(this System.Delegate del, object[] invoke_params) { Marshal.ThrowExceptionForHR((int)del.DynamicInvoke(invoke_params)); } public static Func WithMarshaler2Support(this Func function) { return InvokeWithMarshaler2Support; } public static Action WithMarshaler2Support(this Action action) { return InvokeWithMarshaler2Support; } public static Action WithTypedT1(this Action action) { return InvokeWithTypedT1; } public static Func WithObjectT(this Func function) { return InvokeWithObjectT; } public static Func WithObjectTResult(this Func function) { return InvokeWithObjectTResult; } public static Action WithObjectParams(this Action action) { return InvokeWithObjectParams; } private static object InvokeWithMarshaler2Support(this Func func, object arg) { if (arg is ObjectReferenceValue objectReferenceValue) { return objectReferenceValue.GetAbi(); } return func.Invoke((IObjectReference)arg); } private static void InvokeWithMarshaler2Support(this Action action, object arg) { if (arg is ObjectReferenceValue objectReferenceValue) { objectReferenceValue.Dispose(); } else { action.Invoke((IObjectReference)arg); } } private static object InvokeWithObjectTResult(this Func func, T arg) { return func.Invoke(arg); } private static TResult InvokeWithObjectT(this Func func, object arg) { return func.Invoke((T)arg); } private static void InvokeWithObjectParams(this Action func, object arg) { func.Invoke((T)arg); } private static void InvokeWithTypedT1(this Action action, T arg1, nint arg2) { action.Invoke((object)arg1, arg2); } public static object InvokeWithBoxedValueReferenceCacheInsertion(this Func factory, IInspectable inspectable) { object obj = factory.Invoke(inspectable); ComWrappersSupport.BoxedValueReferenceCache.Add(obj, inspectable); return obj; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] public class DerivedComposed { public static readonly DerivedComposed Instance = new DerivedComposed(); private DerivedComposed() { } } [WindowsRuntimeType("Windows.Foundation.FoundationContract")] [WindowsRuntimeHelperType(typeof(ABI.WinRT.EventRegistrationToken))] [WinRTExposedType(typeof(StructTypeDetails))] public struct EventRegistrationToken : IEquatable { public long Value; public EventRegistrationToken(long _Value) { Value = _Value; } public static bool operator ==(EventRegistrationToken x, EventRegistrationToken y) { return x.Value == y.Value; } public static bool operator !=(EventRegistrationToken x, EventRegistrationToken y) { return !(x == y); } public bool Equals(EventRegistrationToken other) { return this == other; } public override bool Equals(object obj) { if (obj is EventRegistrationToken eventRegistrationToken) { return this == eventRegistrationToken; } return false; } public override int GetHashCode() { return Value.GetHashCode(); } } public sealed class EventRegistrationTokenTable where T : System.Delegate { private static readonly int TypeOfTHashCode = GetTypeOfTHashCode(); private readonly Dictionary m_tokens = new Dictionary(); private int m_low32Bits = Random.Shared.Next(-2147483648, 2147483647); private static int GetTypeOfTHashCode() { int hashCode = ((object)typeof(T)).GetHashCode(); if (hashCode == 0) { return 1606893974; } return hashCode; } public EventRegistrationToken AddEventHandler(T handler) { if (handler == null) { return default(EventRegistrationToken); } lock (m_tokens) { int num; do { num = m_low32Bits++; } while (!m_tokens.TryAdd(num, (object)handler)); EventRegistrationToken result = default(EventRegistrationToken); result.Value = (long)(((ulong)(uint)TypeOfTHashCode << 32) | (uint)num); return result; } } public bool RemoveEventHandler(EventRegistrationToken token, [NotNullWhen(true)] out T? handler) { if ((int)(token.Value >>> 32) != TypeOfTHashCode) { handler = null; return false; } lock (m_tokens) { object obj = default(object); if (m_tokens.Remove((int)token.Value, ref obj)) { handler = System.Runtime.CompilerServices.Unsafe.As(obj); return true; } } handler = null; return false; } } public static class ExceptionHelpers { private const int COR_E_OBJECTDISPOSED = -2146232798; private const int COR_E_OPERATIONCANCELED = -2146233029; private const int COR_E_ARGUMENTOUTOFRANGE = -2146233086; private const int COR_E_INDEXOUTOFRANGE = -2146233080; private const int COR_E_TIMEOUT = -2146233083; private const int RO_E_CLOSED = -2147483629; internal const int E_BOUNDS = -2147483637; internal const int E_CHANGED_STATE = -2147483636; private const int E_ILLEGAL_STATE_CHANGE = -2147483635; private const int E_ILLEGAL_METHOD_CALL = -2147483634; private const int E_ILLEGAL_DELEGATE_ASSIGNMENT = -2147483624; private const int APPMODEL_ERROR_NO_PACKAGE = -2147009196; internal const int E_XAMLPARSEFAILED = -2144665590; internal const int E_LAYOUTCYCLE = -2144665580; internal const int E_ELEMENTNOTENABLED = -2144665570; internal const int E_ELEMENTNOTAVAILABLE = -2144665569; internal const int ERROR_INVALID_WINDOW_HANDLE = -2147023496; private const int E_POINTER = -2147467261; private const int E_NOTIMPL = -2147467263; private const int E_ACCESSDENIED = -2147024891; internal const int E_INVALIDARG = -2147024809; internal const int E_NOINTERFACE = -2147467262; private const int E_OUTOFMEMORY = -2147024882; private const int ERROR_ARITHMETIC_OVERFLOW = -2147024362; private const int ERROR_FILENAME_EXCED_RANGE = -2147024690; private const int ERROR_FILE_NOT_FOUND = -2147024894; private const int ERROR_HANDLE_EOF = -2147024858; private const int ERROR_PATH_NOT_FOUND = -2147024893; private const int ERROR_STACK_OVERFLOW = -2147023895; private const int ERROR_BAD_FORMAT = -2147024885; private const int ERROR_CANCELLED = -2147023673; private const int ERROR_TIMEOUT = -2147023436; private unsafe static delegate* unmanaged[Stdcall] getRestrictedErrorInfo; private unsafe static delegate* unmanaged[Stdcall] setRestrictedErrorInfo; private unsafe static delegate* unmanaged[Stdcall] roOriginateLanguageException; private unsafe static delegate* unmanaged[Stdcall] roReportUnhandledError; private static readonly bool initialized = Initialize(); private unsafe static bool Initialize() { nint num = Platform.LoadLibraryExW("api-ms-win-core-winrt-error-l1-1-1.dll", System.IntPtr.Zero, 2048u); if (num != (nint)System.IntPtr.Zero) { System.ReadOnlySpan functionName = "RoOriginateLanguageException"u8; System.ReadOnlySpan functionName2 = "RoReportUnhandledError"u8; roOriginateLanguageException = (delegate* unmanaged[Stdcall])Platform.GetProcAddress(num, functionName); roReportUnhandledError = (delegate* unmanaged[Stdcall])Platform.GetProcAddress(num, functionName2); } else { num = Platform.LoadLibraryExW("api-ms-win-core-winrt-error-l1-1-0.dll", System.IntPtr.Zero, 2048u); } if (num != (nint)System.IntPtr.Zero) { System.ReadOnlySpan functionName3 = "GetRestrictedErrorInfo"u8; System.ReadOnlySpan functionName4 = "SetRestrictedErrorInfo"u8; getRestrictedErrorInfo = (delegate* unmanaged[Stdcall])Platform.GetProcAddress(num, functionName3); setRestrictedErrorInfo = (delegate* unmanaged[Stdcall])Platform.GetProcAddress(num, functionName4); } return true; } public static void ThrowExceptionForHR(int hr) { if (hr < 0) { Throw(hr); } [MethodImpl(8)] [CompilerGenerated] static void Throw(int hr) { bool restoredExceptionFromGlobalState; System.Exception exceptionForHR = GetExceptionForHR(hr, useGlobalErrorState: true, associateErrorInfo: true, out restoredExceptionFromGlobalState); if (restoredExceptionFromGlobalState) { ExceptionDispatchInfo.Capture(exceptionForHR).Throw(); return; } throw exceptionForHR; } } private unsafe static ObjectReferenceValue BorrowRestrictedErrorInfo() { if (getRestrictedErrorInfo == (delegate* unmanaged[Stdcall])null) { return default(ObjectReferenceValue); } nint thisPtr = System.IntPtr.Zero; Marshal.ThrowExceptionForHR(getRestrictedErrorInfo(&thisPtr)); if (thisPtr == (nint)System.IntPtr.Zero) { return default(ObjectReferenceValue); } if (setRestrictedErrorInfo != (delegate* unmanaged[Stdcall])null) { setRestrictedErrorInfo(thisPtr); } return ObjectReferenceValue.Attach(ref thisPtr); } public static System.Exception GetExceptionForHR(int hr) { bool restoredExceptionFromGlobalState; if (hr < 0) { return GetExceptionForHR(hr, useGlobalErrorState: true, associateErrorInfo: false, out restoredExceptionFromGlobalState); } return null; } private static System.Exception GetExceptionForHR(int hr, bool useGlobalErrorState, bool associateErrorInfo, out bool restoredExceptionFromGlobalState) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Expected O, but got Unknown //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown //IL_057f: Expected O, but got Unknown //IL_04bd: Expected O, but got Unknown //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Expected O, but got Unknown //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Expected O, but got Unknown //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Expected O, but got Unknown //IL_0466: Expected O, but got Unknown //IL_03f2: Expected O, but got Unknown //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Expected O, but got Unknown //IL_03d5: Expected O, but got Unknown //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Expected O, but got Unknown //IL_0449: Expected O, but got Unknown //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Expected O, but got Unknown //IL_04f7: Expected O, but got Unknown //IL_0531: Expected O, but got Unknown //IL_042c: Expected O, but got Unknown //IL_0599: Expected O, but got Unknown //IL_04da: Expected O, but got Unknown restoredExceptionFromGlobalState = false; ObjectReference restrictedErrorObject = null; string description = null; string restrictedDescription = null; string restrictedErrorReference = null; string capabilitySid = null; string text = string.Empty; System.Exception internalGetGlobalErrorStateException = null; System.Exception languageException; if (useGlobalErrorState) { ObjectReferenceValue objectReferenceValue = default(ObjectReferenceValue); try { objectReferenceValue = BorrowRestrictedErrorInfo(); nint abi = objectReferenceValue.GetAbi(); if (abi != 0) { nint num = default(nint); if (Marshal.QueryInterface((System.IntPtr)abi, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_ILanguageExceptionErrorInfo), ref num) >= 0) { try { languageException = GetLanguageException(num, hr); if (languageException != null) { restoredExceptionFromGlobalState = true; if (associateErrorInfo) { languageException.AddExceptionDataForRestrictedErrorInfo(ObjectReference.FromAbi(abi, IID.IID_IRestrictedErrorInfo), hasRestrictedLanguageErrorObject: true); } return languageException; } } finally { Marshal.Release((System.IntPtr)num); } } restrictedErrorObject = ObjectReference.FromAbi(abi, IID.IID_IRestrictedErrorInfo); IRestrictedErrorInfoMethods.GetErrorDetails(abi, out description, out var error, out restrictedDescription, out capabilitySid); restrictedErrorReference = IRestrictedErrorInfoMethods.GetReference(abi); if (hr == error) { if (!string.IsNullOrEmpty(description)) { text += description; if (!string.IsNullOrEmpty(restrictedDescription)) { text += Environment.NewLine; } } if (!string.IsNullOrEmpty(restrictedDescription)) { text += restrictedDescription; } } } } catch (System.Exception ex) { internalGetGlobalErrorStateException = ex; } finally { objectReferenceValue.Dispose(); } } switch (hr) { case -2147483636: case -2147483635: case -2147483634: case -2147483624: case -2147009196: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new InvalidOperationException(text) : new InvalidOperationException()); break; case -2144665590: languageException = ((!FeatureSwitches.UseWindowsUIXamlProjections) ? ((System.Exception)((!string.IsNullOrEmpty(text)) ? new Microsoft.UI.Xaml.Markup.XamlParseException(text) : new Microsoft.UI.Xaml.Markup.XamlParseException())) : ((System.Exception)((!string.IsNullOrEmpty(text)) ? new Windows.UI.Xaml.Markup.XamlParseException(text) : new Windows.UI.Xaml.Markup.XamlParseException()))); break; case -2144665580: languageException = ((!FeatureSwitches.UseWindowsUIXamlProjections) ? ((System.Exception)((!string.IsNullOrEmpty(text)) ? new Microsoft.UI.Xaml.LayoutCycleException(text) : new Microsoft.UI.Xaml.LayoutCycleException())) : ((System.Exception)((!string.IsNullOrEmpty(text)) ? new Windows.UI.Xaml.LayoutCycleException(text) : new Windows.UI.Xaml.LayoutCycleException()))); break; case -2144665569: languageException = ((!FeatureSwitches.UseWindowsUIXamlProjections) ? ((System.Exception)((!string.IsNullOrEmpty(text)) ? new Microsoft.UI.Xaml.Automation.ElementNotAvailableException(text) : new Microsoft.UI.Xaml.Automation.ElementNotAvailableException())) : ((System.Exception)((!string.IsNullOrEmpty(text)) ? new Windows.UI.Xaml.Automation.ElementNotAvailableException(text) : new Windows.UI.Xaml.Automation.ElementNotAvailableException()))); break; case -2144665570: languageException = ((!FeatureSwitches.UseWindowsUIXamlProjections) ? ((System.Exception)((!string.IsNullOrEmpty(text)) ? new Microsoft.UI.Xaml.Automation.ElementNotEnabledException(text) : new Microsoft.UI.Xaml.Automation.ElementNotEnabledException())) : ((System.Exception)((!string.IsNullOrEmpty(text)) ? new Windows.UI.Xaml.Automation.ElementNotEnabledException(text) : new Windows.UI.Xaml.Automation.ElementNotEnabledException()))); break; case -2147023496: languageException = (System.Exception)new COMException("Invalid window handle. (0x80070578)\r\nConsider WindowNative, InitializeWithWindow\r\nSee https://aka.ms/cswinrt/interop#windows-sdk", -2147023496); break; case -2147483629: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new ObjectDisposedException(string.Empty, text) : new ObjectDisposedException(string.Empty)); break; case -2147467261: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new NullReferenceException(text) : new NullReferenceException()); break; case -2147467263: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new NotImplementedException(text) : new NotImplementedException()); break; case -2147024891: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new UnauthorizedAccessException(text) : new UnauthorizedAccessException()); break; case -2147024809: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new ArgumentException(text) : new ArgumentException()); break; case -2147467262: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new InvalidCastException(text) : new InvalidCastException()); break; case -2147024882: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new OutOfMemoryException(text) : new OutOfMemoryException()); break; case -2147483637: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new ArgumentOutOfRangeException(text) : new ArgumentOutOfRangeException()); break; case -2147024362: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new ArithmeticException(text) : new ArithmeticException()); break; case -2147024690: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new PathTooLongException(text) : new PathTooLongException()); break; case -2147024894: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new FileNotFoundException(text) : new FileNotFoundException()); break; case -2147024858: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new EndOfStreamException(text) : new EndOfStreamException()); break; case -2147024893: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new DirectoryNotFoundException(text) : new DirectoryNotFoundException()); break; case -2147023895: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new StackOverflowException(text) : new StackOverflowException()); break; case -2147024885: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new BadImageFormatException(text) : new BadImageFormatException()); break; case -2147023673: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new OperationCanceledException(text) : new OperationCanceledException()); break; case -2147023436: languageException = (System.Exception)((!string.IsNullOrEmpty(text)) ? new TimeoutException(text) : new TimeoutException()); break; default: languageException = (System.Exception)new COMException(text, hr); break; } languageException.SetHResult(hr); if (useGlobalErrorState) { languageException.AddExceptionDataForRestrictedErrorInfo(description, restrictedDescription, restrictedErrorReference, capabilitySid, restrictedErrorObject, hasRestrictedLanguageErrorObject: false, internalGetGlobalErrorStateException); } return languageException; } private static System.Exception GetLanguageException(nint languageErrorInfoPtr, int hr) { System.Exception ex = GetLanguageExceptionInternal(languageErrorInfoPtr, hr); if (ex != null) { return ex; } nint num = default(nint); if (Marshal.QueryInterface((System.IntPtr)languageErrorInfoPtr, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_ILanguageExceptionErrorInfo2), ref num) >= 0) { nint num2 = 0; try { num2 = ILanguageExceptionErrorInfo2Methods.GetPropagationContextHead(num); while (num2 != 0) { System.Exception ex2 = GetLanguageExceptionInternal(num2, hr); if (ex2 != null) { return ex2; } nint num3 = num2; num2 = ILanguageExceptionErrorInfo2Methods.GetPreviousLanguageExceptionErrorInfo(num2); Marshal.Release((System.IntPtr)num3); } } finally { MarshalExtensions.ReleaseIfNotNull(num2); Marshal.Release((System.IntPtr)num); } } return null; [CompilerGenerated] static System.Exception GetLanguageExceptionInternal(nint languageErrorInfoPtr, int hr) { nint languageException = ILanguageExceptionErrorInfoMethods.GetLanguageException(languageErrorInfoPtr); if (languageException != 0) { try { if (IUnknownVftbl.IsReferenceToManagedObject(languageException)) { System.Exception ex3 = ComWrappersSupport.FindObject(languageException); if (GetHRForException(ex3) == hr) { return ex3; } } } finally { Marshal.Release((System.IntPtr)languageException); } } return null; } } public unsafe static void SetErrorInfo(System.Exception ex) { try { if (getRestrictedErrorInfo != (delegate* unmanaged[Stdcall])null && setRestrictedErrorInfo != (delegate* unmanaged[Stdcall])null && roOriginateLanguageException != (delegate* unmanaged[Stdcall])null) { if (ex.TryGetRestrictedLanguageErrorInfo(out var restrictedErrorObject, out var isLanguageException)) { nint num = default(nint); if (!isLanguageException && Marshal.QueryInterface((System.IntPtr)restrictedErrorObject.ThisPtr, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_ILanguageExceptionErrorInfo2), ref num) >= 0) { try { ILanguageExceptionErrorInfo2Methods.CapturePropagationContext(num, ex); } finally { Marshal.Release((System.IntPtr)num); } } else if (isLanguageException) { ex.Data.Remove((object)"__RestrictedErrorObjectReference"); ex.Data.Remove((object)"__HasRestrictedLanguageErrorObject"); } setRestrictedErrorInfo(restrictedErrorObject.ThisPtr); GC.KeepAlive((object)restrictedErrorObject); return; } string text = ex.Message; if (string.IsNullOrEmpty(text)) { text = ex.GetType().FullName; } MarshalString.HSTRING_HEADER hSTRING_HEADER = default(MarshalString.HSTRING_HEADER); nint num2 = 0; fixed (char* sourceString = text) { if (Platform.WindowsCreateStringReference((ushort*)sourceString, text.Length, (nint*)(&hSTRING_HEADER), &num2) != 0) { num2 = System.IntPtr.Zero; } nint num3 = ComWrappersSupport.CreateCCWForObjectUnsafe(ex); try { roOriginateLanguageException(GetHRForException(ex), num2, num3); return; } finally { Marshal.Release((System.IntPtr)num3); } } } using IObjectReference objectReference = ComWrappersSupport.CreateCCWForObject(new ManagedExceptionErrorInfo(ex)); Platform.SetErrorInfo(0u, objectReference.ThisPtr); } catch (System.Exception) { } } public unsafe static void ReportUnhandledError(System.Exception ex) { SetErrorInfo(ex); if (roReportUnhandledError != (delegate* unmanaged[Stdcall])null) { ObjectReferenceValue objectReferenceValue = BorrowRestrictedErrorInfo(); nint abi = objectReferenceValue.GetAbi(); if (abi != 0) { roReportUnhandledError(abi); objectReferenceValue.Dispose(); } } } public static int GetHRForException(System.Exception ex) { int error = ex.HResult; try { if (ex.TryGetRestrictedLanguageErrorInfo(out var restrictedErrorObject, out var _)) { IRestrictedErrorInfoMethods.GetErrorDetails(restrictedErrorObject.ThisPtr, out error); GC.KeepAlive((object)restrictedErrorObject); } } catch (System.Exception) { } switch (error) { case -2146232798: return -2147483629; case -2146233029: return -2147023673; case -2146233086: case -2146233080: return -2147483637; case -2146233083: return -2147023436; default: return error; } } internal static void AddExceptionDataForRestrictedErrorInfo(this System.Exception ex, string description, string restrictedError, string restrictedErrorReference, string restrictedCapabilitySid, ObjectReference restrictedErrorObject, bool hasRestrictedLanguageErrorObject = false, System.Exception internalGetGlobalErrorStateException = null) { IDictionary data = ex.Data; if (data != null) { data[(object)"Description"] = description; data[(object)"RestrictedDescription"] = restrictedError; data[(object)"RestrictedErrorReference"] = restrictedErrorReference; data[(object)"RestrictedCapabilitySid"] = restrictedCapabilitySid; data[(object)"__RestrictedErrorObjectReference"] = restrictedErrorObject; data[(object)"__HasRestrictedLanguageErrorObject"] = hasRestrictedLanguageErrorObject; if (internalGetGlobalErrorStateException != null) { data[(object)"_InternalCsWinRTException"] = internalGetGlobalErrorStateException; } } } internal static void AddExceptionDataForRestrictedErrorInfo(this System.Exception ex, ObjectReference restrictedErrorObject, bool hasRestrictedLanguageErrorObject) { IDictionary data = ex.Data; if (data != null) { data[(object)"__RestrictedErrorObjectReference"] = restrictedErrorObject; data[(object)"__HasRestrictedLanguageErrorObject"] = hasRestrictedLanguageErrorObject; } } internal static bool TryGetRestrictedLanguageErrorInfo(this System.Exception ex, out ObjectReference restrictedErrorObject, out bool isLanguageException) { restrictedErrorObject = null; isLanguageException = false; IDictionary data = ex.Data; if (data != null) { if (data.Contains((object)"__RestrictedErrorObjectReference")) { restrictedErrorObject = (ObjectReference)data[(object)"__RestrictedErrorObjectReference"]; } if (data.Contains((object)"__HasRestrictedLanguageErrorObject")) { isLanguageException = (bool)data[(object)"__HasRestrictedLanguageErrorObject"]; } return restrictedErrorObject != null; } return false; } public unsafe static System.Exception AttachRestrictedErrorInfo(System.Exception e) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (e != null) { nint thisPtr = System.IntPtr.Zero; try { Marshal.ThrowExceptionForHR(getRestrictedErrorInfo(&thisPtr)); if (thisPtr != (nint)System.IntPtr.Zero) { IRestrictedErrorInfoMethods.GetErrorDetails(thisPtr, out var description, out var error, out var restrictedDescription, out var capabilitySid); if (e.HResult == error) { string reference = IRestrictedErrorInfoMethods.GetReference(thisPtr); e.AddExceptionDataForRestrictedErrorInfo(description, restrictedDescription, reference, capabilitySid, ObjectReference.Attach(ref thisPtr, IID.IID_IRestrictedErrorInfo)); } } } catch { } finally { MarshalExtensions.ReleaseIfNotNull(thisPtr); } } return e; } } public static class ExceptionExtensions { public static void SetHResult(this System.Exception ex, int value) { ex.HResult = value; } internal static System.Exception GetExceptionForHR(this System.Exception innerException, int hresult, string messageResource) { System.Exception ex; if (innerException != null) { string text = innerException.Message ?? messageResource; ex = new System.Exception(text, innerException); } else { ex = new System.Exception(messageResource); } ex.SetHResult(hresult); return ex; } } public static class GuidGenerator { private static readonly Guid wrt_pinterface_namespace = new Guid(3581604881u, (ushort)29563, (ushort)49218, (byte)171, (byte)174, (byte)135, (byte)139, (byte)30, (byte)22, (byte)173, (byte)238); [UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "This method only accesses 'Type.GUID', no fields are ever needed.")] public static Guid GetGUID(System.Type type) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) type = type.GetGuidType(); if (FeatureSwitches.UseWindowsUIXamlProjections && TryGetWindowsUIXamlIID(type, out var iid)) { return iid; } return type.GUID; } public static Guid GetIID([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type type) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) type = type.GetGuidType(); if (FeatureSwitches.UseWindowsUIXamlProjections && TryGetWindowsUIXamlIID(type, out var iid)) { return iid; } if (!type.IsGenericType) { return type.GUID; } return (Guid)type.GetField("PIID").GetValue((object)null); } internal static bool TryGetWindowsUIXamlIID(System.Type type, out Guid iid) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (type == typeof(INotifyCollectionChanged)) { iid = IID.IID_WUX_INotifyCollectionChanged; return true; } if (type == typeof(INotifyPropertyChanged)) { iid = IID.IID_WUX_INotifyPropertyChanged; return true; } if (type == typeof(NotifyCollectionChangedEventArgs)) { iid = IID.IID_WUX_INotifyCollectionChangedEventArgs; return true; } if (type == typeof(NotifyCollectionChangedEventHandler)) { iid = IID.IID_WUX_NotifyCollectionChangedEventHandler; return true; } if (type == typeof(PropertyChangedEventHandler)) { iid = IID.IID_WUX_PropertyChangedEventHandler; return true; } iid = default(Guid); return false; } public static string GetSignature([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type type) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) if (type == typeof(object)) { return "cinterface(IInspectable)"; } if (type == typeof(string)) { return "string"; } if (type == typeof(System.Type)) { return Type.GetGuidSignature(); } Guid gUID; if (type.IsGenericType) { string[] array = SelectSignaturesForTypes(type.GetGenericArguments()); System.Type type2 = type.GetGenericTypeDefinition().FindHelperType() ?? type; string[] obj = new string[5] { "pinterface({", null, null, null, null }; gUID = type2.GUID; obj[1] = ((object)(Guid)(ref gUID)).ToString(); obj[2] = "};"; obj[3] = string.Join(";", array); obj[4] = ")"; return string.Concat(obj); } System.Type type3 = type.FindHelperType(); if (type3 != (System.Type)null) { MethodInfo method = type3.GetMethod("GetGuidSignature", (BindingFlags)24); if (method != (MethodInfo)null) { return (string)((MethodBase)method).Invoke((object)null, (object[])null); } } if (type.IsValueType) { string name = ((MemberInfo)type).Name; if (name != null) { switch (name.Length) { case 5: switch (name[3]) { case 't': if (!(name == "SByte")) { break; } return "i1"; case '1': if (!(name == "Int16")) { break; } return "i2"; case '3': if (!(name == "Int32")) { break; } return "i4"; case '6': if (!(name == "Int64")) { break; } return "i8"; } break; case 4: switch (name[0]) { case 'B': if (!(name == "Byte")) { break; } return "u1"; case 'C': if (!(name == "Char")) { break; } return "c2"; case 'G': if (!(name == "Guid")) { break; } return "g16"; } break; case 6: switch (name[4]) { case '1': if (!(name == "UInt16")) { break; } return "u2"; case '3': if (!(name == "UInt32")) { break; } return "u4"; case '6': if (!(name == "UInt64")) { break; } return "u8"; case 'l': if (!(name == "Single")) { if (!(name == "Double")) { break; } return "f8"; } return "f4"; } break; case 7: if (!(name == "Boolean")) { break; } return "b1"; } } if (type.IsEnum) { bool flag = CustomAttributeExtensions.IsDefined((MemberInfo)(object)type, typeof(FlagsAttribute)); return string.Concat(new string[5] { "enum(", type.FullName, ";", flag ? "u4" : "i4", ")" }); } if (!type.IsPrimitive) { WindowsRuntimeTypeAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)type); if (customAttribute != null && !string.IsNullOrEmpty(customAttribute.GuidSignature)) { return customAttribute.GuidSignature; } if (customAttribute == null) { System.Type authoringMetadataType = type.GetAuthoringMetadataType(); if ((customAttribute = ((authoringMetadataType != null) ? CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)authoringMetadataType) : null)) != null && !string.IsNullOrEmpty(customAttribute.GuidSignature)) { return customAttribute.GuidSignature; } } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new InvalidOperationException($"Cannot compute signature for type '{type}', as doing so requires a fallback path that is not trim/AOT compatible. Using AOT requires all referenced projections to be up to date. Make sure to only reference WinRT projections that have been generated by a version of CsWinRT supported for AOT."); } string[] array2 = SelectSignaturesForFields(type.GetFields((BindingFlags)20)); return string.Concat(new string[5] { "struct(", type.FullName, ";", string.Join(";", array2), ")" }); } throw new InvalidOperationException("Unsupported value type."); } type = (type.IsInterface ? (type3 ?? type) : type); if (type.IsDelegate()) { gUID = GetGUID(type); return "delegate({" + ((object)(Guid)(ref gUID)).ToString() + "})"; } if (TryGetSignatureFromDefaultInterfaceTypeForRuntimeClassType(type, out var signature2)) { return signature2; } gUID = type.GUID; return "{" + ((object)(Guid)(ref gUID)).ToString() + "}"; [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2072", Justification = "Fallback path for old projections, not trim-safe by design.")] static string[] SelectSignaturesForFields(FieldInfo[] fields) { string[] array3 = new string[fields.Length]; for (int i = 0; i < fields.Length; i++) { array3[i] = GetSignature(fields[i].FieldType); } return array3; } [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2062", Justification = "Fallback path for old projections, not trim-safe by design.")] static string[] SelectSignaturesForTypes(System.Type[] types) { string[] array4 = new string[types.Length]; for (int j = 0; j < types.Length; j++) { array4[j] = GetSignature(types[j]); } return array4; } [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "'GetSignature' will only actually use reflection when using old projections.")] static bool TryGetSignatureFromDefaultInterfaceTypeForRuntimeClassType(System.Type type, out string signature) { if (type.IsClass && Projections.TryGetDefaultInterfaceTypeForRuntimeClassType(type, out var defaultInterface)) { signature = string.Concat(new string[5] { "rc(", type.FullName, ";", GetSignature(defaultInterface), ")" }); return true; } signature = null; return false; } } private static Guid encode_guid(System.Span data) { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) if (BitConverter.IsLittleEndian) { byte b = data[0]; data[0] = data[3]; data[3] = b; b = data[1]; data[1] = data[2]; data[2] = b; b = data[4]; data[4] = data[5]; data[5] = b; b = data[6]; data[6] = data[7]; data[7] = (byte)((b & 0xFu) | 0x50u); data[8] = (byte)((data[8] & 0x3Fu) | 0x80u); } return new Guid(System.Span.op_Implicit(data.Slice(0, 16))); } public static Guid CreateIID([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type type) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) string signature = GetSignature(type); if (!type.IsGenericType) { return new Guid(signature); } return CreateIIDForGenericType(signature); } [UnconditionalSuppressMessage("Trimming", "IL2067", Justification = "This method is only used for types (eg. generics) where fields aren't needed.")] internal static Guid CreateIIDUnsafe(System.Type type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return CreateIID(type); } internal static Guid CreateIIDForGenericType(string signature) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) int maxByteCount = Encoding.UTF8.GetMaxByteCount(signature.Length); byte[] array = new byte[16 + maxByteCount]; System.Span span = System.Span.op_Implicit(array); ((Guid)(ref wrt_pinterface_namespace)).TryWriteBytes(span); int bytes = Encoding.UTF8.GetBytes(string.op_Implicit(signature), span.Slice(16, span.Length - 16)); array = array[..System.Index.op_Implicit(16 + bytes)]; return encode_guid(System.Span.op_Implicit(SHA1.HashData(array))); } } public enum TrustLevel { BaseTrust, PartialTrust, FullTrust } [Guid("AF86E2E0-B12D-4c6a-9C5A-D7AA65101E90")] public class IInspectable : IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { [Guid("AF86E2E0-B12D-4c6a-9C5A-D7AA65101E90")] public struct Vftbl { public IUnknownVftbl IUnknownVftbl; private unsafe void* _GetIids; private unsafe void* _GetRuntimeClassName; private unsafe void* _GetTrustLevel; public static readonly Vftbl AbiToProjectionVftable; public static readonly nint AbiToProjectionVftablePtr; public unsafe delegate* unmanaged[Stdcall] GetIids { get { return (delegate* unmanaged[Stdcall])_GetIids; } set { _GetIids = value; } } public unsafe delegate* unmanaged[Stdcall] GetRuntimeClassName { get { return (delegate* unmanaged[Stdcall])_GetRuntimeClassName; } set { _GetRuntimeClassName = value; } } public unsafe delegate* unmanaged[Stdcall] GetTrustLevel { get { return (delegate* unmanaged[Stdcall])_GetTrustLevel; } set { _GetTrustLevel = value; } } unsafe static Vftbl() { AbiToProjectionVftable = new Vftbl { IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl, _GetIids = (delegate*)(&Do_Abi_GetIids), _GetRuntimeClassName = (delegate*)(&Do_Abi_GetRuntimeClassName), _GetTrustLevel = (delegate*)(&Do_Abi_GetTrustLevel) }; AbiToProjectionVftablePtr = Marshal.AllocHGlobal(sizeof(Vftbl)); *(Vftbl*)AbiToProjectionVftablePtr = AbiToProjectionVftable; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetIids(nint pThis, int* iidCount, nint* iids) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) *iidCount = 0; *iids = System.IntPtr.Zero; try { ref nint reference = ref *iids; ValueTuple val = MarshalBlittable.FromManagedArray(ComWrappersSupport.GetInspectableInfo(pThis).IIDs); *iidCount = val.Item1; reference = val.Item2; } catch (System.Exception ex) { return ex.HResult; } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetRuntimeClassName(nint pThis, nint* className) { *className = 0; try { string runtimeClassName = ComWrappersSupport.GetInspectableInfo(pThis).RuntimeClassName; *className = MarshalString.FromManaged(runtimeClassName); } catch (System.Exception ex) { return ex.HResult; } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetTrustLevel(nint pThis, TrustLevel* trustLevel) { *trustLevel = TrustLevel.BaseTrust; return 0; } } private readonly ObjectReference _obj; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; public nint ThisPtr => _obj.ThisPtr; public IObjectReference ObjRef => _obj; IObjectReference IWinRTObject.NativeObject => _obj; bool IWinRTObject.HasUnwrappableNativeObject => true; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public static IInspectable FromAbi(nint thisPtr) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return new IInspectable(ObjectReference.FromAbi(thisPtr, IID.IID_IInspectable)); } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public ObjectReference As() { return _obj.As(); } public IInspectable(IObjectReference obj) : this(obj.As(IID.IID_IInspectable)) { }//IL_0007: Unknown result type (might be due to invalid IL or missing references) [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public IInspectable(ObjectReference obj) : this(obj.As(IID.IID_IInspectable)) { }//IL_0007: Unknown result type (might be due to invalid IL or missing references) internal IInspectable(ObjectReference obj) { _obj = obj; } public unsafe string GetRuntimeClassName(bool noThrow = false) { nint hstring = 0; try { nint thisPtr = ThisPtr; int num = ((delegate* unmanaged[Stdcall])(*(System.IntPtr*)((nint)(*(System.IntPtr*)thisPtr) + (nint)4 * (nint)sizeof(void*))))(thisPtr, &hstring); GC.KeepAlive((object)_obj); if (num != 0) { if (noThrow) { return null; } Marshal.ThrowExceptionForHR(num); } uint num2 = default(uint); char* ptr = Platform.WindowsGetStringRawBuffer(hstring, &num2); return new string(ptr, 0, (int)num2); } finally { Platform.WindowsDeleteString(hstring); } } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } } public interface IWinRTObject : IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { IObjectReference NativeObject { get; } bool HasUnwrappableNativeObject { get; } protected ConcurrentDictionary QueryInterfaceCache { get; } ConcurrentDictionary AdditionalTypeData { get; } bool IDynamicInterfaceCastable.IsInterfaceImplemented(RuntimeTypeHandle interfaceType, bool throwIfNotImplemented) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableIDynamicInterfaceCastableSupport) { return false; } return IsInterfaceImplementedFallback(interfaceType, throwIfNotImplemented); } internal sealed bool IsInterfaceImplementedFallback(RuntimeTypeHandle interfaceType, bool throwIfNotImplemented) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableIDynamicInterfaceCastableSupport) { if (!throwIfNotImplemented) { return false; } throw new NotSupportedException("Support for 'IDynamicInterfaceCastable' is disabled (make sure that the 'CsWinRTEnableIDynamicInterfaceCastableSupport' property is not set to 'false')."); } if (QueryInterfaceCache.ContainsKey(interfaceType)) { return true; } if (LookupGeneratedVTableInfo(interfaceType, out var _, out var qiResult)) { return true; } if (qiResult < 0 && throwIfNotImplemented) { ExceptionHelpers.ThrowExceptionForHR(qiResult); } System.Type type = System.Type.GetTypeFromHandle(interfaceType); if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(System.Collections.Generic.IReadOnlyCollection<>)) { if (!RuntimeFeature.IsDynamicCodeCompiled) { if (!throwIfNotImplemented) { return false; } throw new NotSupportedException($"'IDynamicInterfaceCastable' is not supported for generic type '{type}'."); } System.Type type2 = type.GetGenericArguments()[0]; if (type2.IsGenericType && type2.GetGenericTypeDefinition() == typeof(KeyValuePair<, >)) { System.Type type3 = typeof(IReadOnlyDictionary<, >).MakeGenericType(type2.GetGenericArguments()); if (((IDynamicInterfaceCastable)this).IsInterfaceImplemented(type3.TypeHandle, false)) { IObjectReference objectReference = default(IObjectReference); if (QueryInterfaceCache.TryGetValue(type3.TypeHandle, ref objectReference) && !QueryInterfaceCache.TryAdd(interfaceType, objectReference)) { objectReference.Dispose(); } return true; } } System.Type type4 = typeof(System.Collections.Generic.IReadOnlyList<>).MakeGenericType(new System.Type[1] { type2 }); if (((IDynamicInterfaceCastable)this).IsInterfaceImplemented(type4.TypeHandle, throwIfNotImplemented)) { IObjectReference objectReference2 = default(IObjectReference); if (QueryInterfaceCache.TryGetValue(type4.TypeHandle, ref objectReference2) && !QueryInterfaceCache.TryAdd(interfaceType, objectReference2)) { objectReference2.Dispose(); } return true; } return false; } if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(System.Collections.Generic.ICollection<>)) { if (!RuntimeFeature.IsDynamicCodeCompiled) { if (!throwIfNotImplemented) { return false; } throw new NotSupportedException($"'IDynamicInterfaceCastable' is not supported for generic type '{type}'."); } System.Type type5 = type.GetGenericArguments()[0]; if (type5.IsGenericType && type5.GetGenericTypeDefinition() == typeof(KeyValuePair<, >)) { System.Type type6 = typeof(IDictionary<, >).MakeGenericType(type5.GetGenericArguments()); if (((IDynamicInterfaceCastable)this).IsInterfaceImplemented(type6.TypeHandle, false)) { IObjectReference objectReference3 = default(IObjectReference); if (QueryInterfaceCache.TryGetValue(type6.TypeHandle, ref objectReference3) && !QueryInterfaceCache.TryAdd(interfaceType, objectReference3)) { objectReference3.Dispose(); } return true; } } System.Type type7 = typeof(System.Collections.Generic.IList<>).MakeGenericType(new System.Type[1] { type5 }); if (((IDynamicInterfaceCastable)this).IsInterfaceImplemented(type7.TypeHandle, throwIfNotImplemented)) { IObjectReference objectReference4 = default(IObjectReference); if (QueryInterfaceCache.TryGetValue(type7.TypeHandle, ref objectReference4) && !QueryInterfaceCache.TryAdd(interfaceType, objectReference4)) { objectReference4.Dispose(); } return true; } return false; } if (type == typeof(System.Collections.IEnumerable)) { System.Type typeFromHandle = typeof(System.Collections.Generic.IEnumerable); if (((IDynamicInterfaceCastable)this).IsInterfaceImplemented(typeFromHandle.TypeHandle, false)) { IObjectReference objectReference5 = default(IObjectReference); if (QueryInterfaceCache.TryGetValue(typeFromHandle.TypeHandle, ref objectReference5) && !QueryInterfaceCache.TryAdd(interfaceType, objectReference5)) { objectReference5.Dispose(); } return true; } } else if (type == typeof(System.Collections.ICollection)) { System.Type typeFromHandle2 = typeof(System.Collections.IList); if (((IDynamicInterfaceCastable)this).IsInterfaceImplemented(typeFromHandle2.TypeHandle, false)) { IObjectReference objectReference6 = default(IObjectReference); if (QueryInterfaceCache.TryGetValue(typeFromHandle2.TypeHandle, ref objectReference6) && !QueryInterfaceCache.TryAdd(interfaceType, objectReference6)) { objectReference6.Dispose(); } return true; } } if (!Projections.IsTypeWindowsRuntimeType(type)) { return false; } System.Type type8 = type.FindHelperType(throwIfNotImplemented); if (type8 == null || !type8.IsInterface) { return false; } ObjectReference objRef2; int num = NativeObject.TryAs(GuidGenerator.GetIID(type8), out objRef2); if (num < 0) { if (throwIfNotImplemented) { ExceptionHelpers.ThrowExceptionForHR(num); } return false; } if (typeof(System.Collections.IEnumerable).IsAssignableFrom(type)) { RuntimeTypeHandle typeHandle = typeof(System.Collections.IEnumerable).TypeHandle; AdditionalTypeData.GetOrAdd(typeHandle, (Func)((RuntimeTypeHandle _) => new IEnumerable.AdaptiveFromAbiHelper(type, this))); } bool flag = false; try { System.Type type9 = type8.FindVftblType(); if (type9 == null) { flag = QueryInterfaceCache.TryAdd(interfaceType, (IObjectReference)objRef2); return true; } if (!RuntimeFeature.IsDynamicCodeCompiled) { if (!throwIfNotImplemented) { return false; } throw new NotSupportedException($"Cannot construct an object reference for vtable type '{type9}'."); } IObjectReference objectReference7 = GetObjectReferenceViaVftbl(objRef2, type9); if (!QueryInterfaceCache.TryAdd(interfaceType, objectReference7)) { objectReference7.Dispose(); } return true; } finally { if (!flag) { objRef2.Dispose(); } } [MethodImpl(8)] [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "If the 'Vftbl' type is kept, we can assume all its metadata will also have been rooted.")] internal static IObjectReference GetObjectReferenceViaVftbl(IObjectReference objRef, System.Type vftblType) { return (IObjectReference)((MethodBase)typeof(IObjectReference).GetMethod("As", System.Type.EmptyTypes).MakeGenericMethod(new System.Type[1] { vftblType })).Invoke((object)objRef, (object[])null); } } internal unsafe sealed bool LookupGeneratedVTableInfo(RuntimeTypeHandle interfaceType, [NotNullWhen(true)] out TableInfo? result, out int qiResult) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) result = null; qiResult = 0; object obj = default(object); if (AdditionalTypeData.TryGetValue(interfaceType, ref obj)) { if (obj is TableInfo val) { result = val; return true; } return false; } IIUnknownDerivedDetails iUnknownDerivedDetails = StrategyBasedComWrappers.DefaultIUnknownInterfaceDetailsStrategy.GetIUnknownDerivedDetails(interfaceType); if (iUnknownDerivedDetails != null) { qiResult = NativeObject.TryAs(iUnknownDerivedDetails.Iid, out ObjectReference objRef); if (qiResult < 0) { return false; } void*** thisPtr = (void***)objRef.ThisPtr; TableInfo val2 = default(TableInfo); ((TableInfo)(ref val2)).set_ThisPtr((void*)thisPtr); ((TableInfo)(ref val2)).set_Table(*thisPtr); ((TableInfo)(ref val2)).set_ManagedType(iUnknownDerivedDetails.Implementation.TypeHandle); result = val2; if (!AdditionalTypeData.TryAdd(interfaceType, (object)result)) { object obj2 = default(object); bool flag = AdditionalTypeData.TryGetValue(interfaceType, ref obj2); result = (TableInfo)obj2; objRef.Dispose(); } else { QueryInterfaceCache.TryAdd(interfaceType, (IObjectReference)objRef); } return true; } return false; } RuntimeTypeHandle IDynamicInterfaceCastable.GetInterfaceImplementation(RuntimeTypeHandle interfaceType) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) object obj = default(object); if (AdditionalTypeData.TryGetValue(interfaceType, ref obj) && obj is TableInfo val) { return ((TableInfo)(ref val)).ManagedType; } System.Type typeFromHandle = System.Type.GetTypeFromHandle(interfaceType); System.Type helperType = typeFromHandle.GetHelperType(); if (helperType.IsInterface) { return helperType.TypeHandle; } return default(RuntimeTypeHandle); } unsafe VirtualMethodTableInfo IUnmanagedVirtualMethodTableProvider.GetVirtualMethodTableInfoForKey(System.Type type) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (!LookupGeneratedVTableInfo(type.TypeHandle, out var result, out var qiResult)) { Marshal.ThrowExceptionForHR(qiResult); } TableInfo value = result.Value; void* thisPtr = ((TableInfo)(ref value)).ThisPtr; value = result.Value; return new VirtualMethodTableInfo(thisPtr, ((TableInfo)(ref value)).Table); } IObjectReference GetObjectReferenceForType(RuntimeTypeHandle type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return GetObjectReferenceForTypeFallback(type); } internal sealed IObjectReference GetObjectReferenceForTypeFallback(RuntimeTypeHandle type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (((IDynamicInterfaceCastable)this).IsInterfaceImplemented(type, true)) { return QueryInterfaceCache[type]; } throw new System.Exception("Interface '" + ((object)System.Type.GetTypeFromHandle(type))?.ToString() + "' is not implemented."); } } internal static class MarshalExtensions { [MethodImpl(256)] public unsafe static void ReleaseIfNotNull(nint pUnk) { if (pUnk != (nint)0) { ((delegate* unmanaged[Stdcall])(*(System.IntPtr*)((nint)(*(System.IntPtr*)pUnk) + (nint)2 * (nint)sizeof(void*))))(pUnk); } } public static void Dispose(this GCHandle handle) { if (((GCHandle)(ref handle)).IsAllocated) { ((GCHandle)(ref handle)).Free(); } } public static MethodInvoker? TryGetMethodInvoker([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type helperType, string methodName) { MethodInfo method = helperType.GetMethod(methodName, (BindingFlags)24); if (method == null) { return null; } return MethodInvoker.Create((MethodBase)(object)method); } } public class MarshalString { internal struct HSTRING_HEADER { private nint reserved1; private int reserved2; private int reserved3; private int reserved4; private int reserved5; } [Obsolete("Types with embedded references are not supported in this version of your compiler.", true)] [CompilerFeatureRequired("RefStructs")] public ref struct Pinnable { private readonly HSTRING_HEADER _header; private readonly string _value; public Pinnable(string value) { _value = value ?? ""; _header = default(HSTRING_HEADER); } public ref readonly char GetPinnableReference() { return _value.GetPinnableReference(); } public unsafe nint GetAbi() { if (_value == "") { return System.IntPtr.Zero; } nint result = default(nint); Marshal.ThrowExceptionForHR(Platform.WindowsCreateStringReference((ushort*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref System.Runtime.CompilerServices.Unsafe.AsRef(ref GetPinnableReference())), _value.Length, (nint*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref System.Runtime.CompilerServices.Unsafe.AsRef(ref _header)), &result)); return result; } } public struct MarshalerArray { public nint _array; public MarshalString[] _marshalers; public void Dispose() { if (_marshalers != null) { MarshalString[] marshalers = _marshalers; for (int i = 0; i < marshalers.Length; i++) { marshalers[i]?.Dispose(); } } if (_array != (nint)System.IntPtr.Zero) { Marshal.FreeCoTaskMem((System.IntPtr)_array); } } } private nint _header; private GCHandle _gchandle; public static Pinnable CreatePinnable(string value) { return new Pinnable(value); } public static nint GetAbi(ref Pinnable p) { return p.GetAbi(); } public MarshalString(string value) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) _gchandle = GCHandle.Alloc((object)value, (GCHandleType)3); _header = System.IntPtr.Zero; } public void Dispose() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) _gchandle.Dispose(); _gchandle = default(GCHandle); Marshal.FreeHGlobal((System.IntPtr)_header); _header = System.IntPtr.Zero; } public static MarshalString CreateMarshaler(string value) { if (!string.IsNullOrEmpty(value)) { return new MarshalString(value); } return null; } public unsafe nint GetAbi() { string text = (string)((GCHandle)(ref _gchandle)).Target; fixed (char* sourceString = text) { _header = Marshal.AllocHGlobal(sizeof(HSTRING_HEADER)); nint result = default(nint); Marshal.ThrowExceptionForHR(Platform.WindowsCreateStringReference((ushort*)sourceString, text.Length, (nint*)_header, &result)); return result; } } public static nint GetAbi(MarshalString m) { return m?.GetAbi() ?? System.IntPtr.Zero; } public static nint GetAbi(object box) { if (box != null) { return GetAbi((MarshalString)box); } return System.IntPtr.Zero; } public static void DisposeMarshaler(MarshalString m) { m?.Dispose(); } public static void DisposeMarshaler(object box) { if (box != null) { DisposeMarshaler((MarshalString)box); } } public static void DisposeAbi(nint hstring) { if (hstring != (nint)System.IntPtr.Zero) { Platform.WindowsDeleteString(hstring); } } public static void DisposeAbi(object abi) { if (abi != null) { DisposeAbi((nint)abi); } } public unsafe static string FromAbi(nint value) { if (value == (nint)System.IntPtr.Zero) { return ""; } uint num = default(uint); char* ptr = Platform.WindowsGetStringRawBuffer(value, &num); return new string(ptr, 0, (int)num); } public unsafe static System.ReadOnlySpan FromAbiUnsafe(nint value) { if (value == (nint)System.IntPtr.Zero) { return MemoryExtensions.AsSpan(""); } uint num = default(uint); char* ptr = Platform.WindowsGetStringRawBuffer(value, &num); return new System.ReadOnlySpan((void*)ptr, (int)num); } public unsafe static nint FromManaged(string value) { if (value == null) { return System.IntPtr.Zero; } nint result = default(nint); fixed (char* sourceString = value) { Marshal.ThrowExceptionForHR(Platform.WindowsCreateString((ushort*)sourceString, value.Length, &result)); } return result; } public unsafe static MarshalerArray CreateMarshalerArray(string[] array) { MarshalerArray result = default(MarshalerArray); if (array == null) { return result; } bool flag = false; try { int num = array.Length; result._array = Marshal.AllocCoTaskMem(num * sizeof(nint)); result._marshalers = new MarshalString[num]; nint* ptr = (nint*)((System.IntPtr)result._array).ToPointer(); for (int i = 0; i < num; i++) { result._marshalers[i] = CreateMarshaler(array[i]); ptr[i] = GetAbi(result._marshalers[i]); } flag = true; return result; } finally { if (!flag) { result.Dispose(); } } } public static ValueTuple GetAbiArray(object box) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MarshalerArray marshalerArray = (MarshalerArray)box; MarshalString[] marshalers = marshalerArray._marshalers; return new ValueTuple((marshalers != null) ? marshalers.Length : 0, marshalerArray._array); } public unsafe static string[] FromAbiArray(object box) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (box == null) { return null; } ValueTuple val = (ValueTuple)box; if (val.Item2 == (nint)System.IntPtr.Zero) { return null; } string[] array = new string[val.Item1]; nint* ptr = (nint*)((System.IntPtr)val.Item2).ToPointer(); for (int i = 0; i < val.Item1; i++) { array[i] = FromAbi(ptr[i]); } return array; } public unsafe static void CopyAbiArray(string[] array, object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) ValueTuple val = (ValueTuple)box; nint* ptr = (nint*)((System.IntPtr)val.Item2).ToPointer(); for (int i = 0; i < val.Item1; i++) { array[i] = FromAbi(ptr[i]); } } public unsafe static ValueTuple FromManagedArray(string[] array) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (array == null) { return new ValueTuple(0, (nint)System.IntPtr.Zero); } nint num = System.IntPtr.Zero; int i = 0; bool flag = false; try { int num2 = array.Length; num = Marshal.AllocCoTaskMem(num2 * sizeof(nint)); nint* ptr = (nint*)num; for (i = 0; i < num2; i++) { ptr[i] = FromManaged(array[i]); } flag = true; return new ValueTuple(i, num); } finally { if (!flag) { DisposeAbiArray(new ValueTuple(i, num)); } } } public unsafe static void CopyManagedArray(string[] array, nint data) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (array == null) { return; } DisposeAbiArrayElements(new ValueTuple(array.Length, data)); int i = 0; bool flag = false; try { int num = array.Length; for (i = 0; i < num; i++) { *(nint*)(data + (nint)i * (nint)sizeof(nint)) = FromManaged(array[i]); } flag = true; } finally { if (!flag) { DisposeAbiArrayElements(new ValueTuple(i, data)); } } } public static void DisposeMarshalerArray(object box) { if (box != null) { ((MarshalerArray)box).Dispose(); } } public unsafe static void DisposeAbiArrayElements(ValueTuple abi) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) nint* item = (nint*)abi.Item2; for (int i = 0; i < abi.Item1; i++) { DisposeAbi(item[i]); } } public static void DisposeAbiArray(object box) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (box != null) { ValueTuple abi = (ValueTuple)box; DisposeAbiArrayElements(abi); Marshal.FreeCoTaskMem((System.IntPtr)abi.Item2); } } } [StructLayout(0, Size = 1)] public struct MarshalBlittable { public struct MarshalerArray { public GCHandle _gchandle; public MarshalerArray(System.Array array) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) _gchandle = (GCHandle)((array == null) ? default(GCHandle) : GCHandle.Alloc((object)array, (GCHandleType)3)); } public void Dispose() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) _gchandle.Dispose(); } } public static MarshalerArray CreateMarshalerArray(System.Array array) { return new MarshalerArray(array); } public static ValueTuple GetAbiArray(object box) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) MarshalerArray marshalerArray = (MarshalerArray)box; if (!((GCHandle)(ref marshalerArray._gchandle)).IsAllocated) { return new ValueTuple(0, (nint)System.IntPtr.Zero); } return new ValueTuple(((System.Array)((GCHandle)(ref marshalerArray._gchandle)).Target).Length, (nint)((GCHandle)(ref marshalerArray._gchandle)).AddrOfPinnedObject()); } public unsafe static T[] FromAbiArray(object box) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (box == null) { return null; } ValueTuple val = (ValueTuple)box; if (val.Item2 == (nint)System.IntPtr.Zero) { return null; } if (val.Item1 == 0) { return new T[0]; } return new System.ReadOnlySpan(((System.IntPtr)val.Item2).ToPointer(), val.Item1).ToArray(); } public static ValueTuple FromManagedArray(System.Array array) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (array == null) { return new ValueTuple(0, (nint)System.IntPtr.Zero); } int length = array.Length; int num = length * System.Runtime.CompilerServices.Unsafe.SizeOf(); nint num2 = Marshal.AllocCoTaskMem(num); CopyManagedArray(array, num2); return new ValueTuple(length, num2); } public unsafe static void CopyManagedArray(System.Array array, nint data) { if (array != null) { int length = array.Length; int num = length * System.Runtime.CompilerServices.Unsafe.SizeOf(); fixed (byte* ptr = &MemoryMarshal.GetArrayDataReference(array)) { Buffer.MemoryCopy((void*)ptr, ((System.IntPtr)data).ToPointer(), (long)num, (long)num); } } } public static void DisposeMarshalerArray(object box) { if (box != null) { ((MarshalerArray)box).Dispose(); } } public static void DisposeAbiArray(object box) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (box != null) { Marshal.FreeCoTaskMem((System.IntPtr)((ValueTuple)box).Item2); } } } public class MarshalGeneric { [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] protected static readonly System.Type HelperType; protected static readonly System.Type AbiType; protected static readonly System.Type MarshalerType; internal static readonly bool MarshalByObjectReferenceValueSupported; public static readonly Func CreateMarshaler; public static readonly Func GetAbi; public static readonly Action CopyAbi; public static readonly Func FromAbi; public static readonly Func FromManaged; public static readonly Action CopyManaged; public static readonly Action DisposeMarshaler; internal static readonly Func CreateMarshaler2; internal static readonly Action DisposeAbi; internal static readonly Func CreateMarshalerArray; internal static readonly Func> GetAbiArray; internal static readonly Func FromAbiArray; internal static readonly Func> FromManagedArray; internal static readonly Action DisposeMarshalerArray; internal static readonly Action DisposeAbiArray; static MarshalGeneric() { if (typeof(T) == typeof(Vector2)) { HelperType = typeof(Vector2); } else if (typeof(T) == typeof(Vector3)) { HelperType = typeof(Vector3); } else if (typeof(T) == typeof(Vector4)) { HelperType = typeof(Vector4); } else if (typeof(T) == typeof(Plane)) { HelperType = typeof(Plane); } else if (typeof(T) == typeof(Matrix3x2)) { HelperType = typeof(Matrix3x2); } else if (typeof(T) == typeof(Matrix4x4)) { HelperType = typeof(Matrix4x4); } else if (typeof(T) == typeof(Quaternion)) { HelperType = typeof(Quaternion); } else if (typeof(T) == typeof(Windows.Foundation.Size)) { HelperType = typeof(ABI.Windows.Foundation.Size); } else if (typeof(T) == typeof(Windows.Foundation.Point)) { HelperType = typeof(ABI.Windows.Foundation.Point); } else if (typeof(T) == typeof(Windows.Foundation.Rect)) { HelperType = typeof(ABI.Windows.Foundation.Rect); } else { if (typeof(T) == typeof(int) || typeof(T) == typeof(byte) || typeof(T) == typeof(sbyte) || typeof(T) == typeof(short) || typeof(T) == typeof(ushort) || typeof(T) == typeof(uint) || typeof(T) == typeof(long) || typeof(T) == typeof(ulong) || typeof(T) == typeof(float) || typeof(T) == typeof(double) || typeof(T) == typeof(Guid) || typeof(System.Exception).IsAssignableFrom(typeof(T))) { return; } if (typeof(T) == typeof(bool)) { HelperType = typeof(Boolean); AbiType = typeof(byte); MarshalerType = typeof(bool); CreateMarshaler = (Func)(object)new Func(NonBlittableMarshallingStubs.Boolean_CreateMarshaler); CreateMarshaler2 = CreateMarshaler; GetAbi = NonBlittableMarshallingStubs.Boolean_GetAbi; FromAbi = (Func)(object)new Func(NonBlittableMarshallingStubs.Boolean_FromAbi); CopyAbi = NonBlittableMarshallingStubs.Boolean_CopyAbi; FromManaged = (Func)(object)new Func(NonBlittableMarshallingStubs.Boolean_FromManaged); CopyManaged = (Action)(object)new Action(Boolean.CopyManaged); DisposeMarshaler = NonBlittableMarshallingStubs.NoOpFunc; DisposeAbi = NonBlittableMarshallingStubs.NoOpFunc; return; } if (typeof(T) == typeof(char)) { HelperType = typeof(Char); AbiType = typeof(ushort); MarshalerType = typeof(char); CreateMarshaler = (Func)(object)new Func(NonBlittableMarshallingStubs.Char_CreateMarshaler); CreateMarshaler2 = CreateMarshaler; GetAbi = NonBlittableMarshallingStubs.Char_GetAbi; FromAbi = (Func)(object)new Func(NonBlittableMarshallingStubs.Char_FromAbi); CopyAbi = NonBlittableMarshallingStubs.Char_CopyAbi; FromManaged = (Func)(object)new Func(NonBlittableMarshallingStubs.Char_FromManaged); CopyManaged = (Action)(object)new Action(Char.CopyManaged); DisposeMarshaler = NonBlittableMarshallingStubs.NoOpFunc; DisposeAbi = NonBlittableMarshallingStubs.NoOpFunc; return; } if (typeof(T) == typeof(TimeSpan)) { HelperType = typeof(TimeSpan); AbiType = typeof(TimeSpan); MarshalerType = typeof(TimeSpan.Marshaler); CreateMarshaler = (Func)(object)new Func(NonBlittableMarshallingStubs.TimeSpan_CreateMarshaler); CreateMarshaler2 = CreateMarshaler; GetAbi = NonBlittableMarshallingStubs.TimeSpan_GetAbi; FromAbi = (Func)(object)new Func(NonBlittableMarshallingStubs.TimeSpan_FromAbi); CopyAbi = NonBlittableMarshallingStubs.TimeSpan_CopyAbi; FromManaged = (Func)(object)new Func(NonBlittableMarshallingStubs.TimeSpan_FromManaged); CopyManaged = (Action)(object)new Action(TimeSpan.CopyManaged); DisposeMarshaler = NonBlittableMarshallingStubs.NoOpFunc; DisposeAbi = NonBlittableMarshallingStubs.NoOpFunc; return; } if (typeof(T) == typeof(DateTimeOffset)) { HelperType = typeof(DateTimeOffset); AbiType = typeof(DateTimeOffset); MarshalerType = typeof(DateTimeOffset.Marshaler); CreateMarshaler = (Func)(object)new Func(NonBlittableMarshallingStubs.DateTimeOffset_CreateMarshaler); CreateMarshaler2 = CreateMarshaler; GetAbi = NonBlittableMarshallingStubs.DateTimeOffset_GetAbi; FromAbi = (Func)(object)new Func(NonBlittableMarshallingStubs.DateTimeOffset_FromAbi); CopyAbi = NonBlittableMarshallingStubs.DateTimeOffset_CopyAbi; FromManaged = (Func)(object)new Func(NonBlittableMarshallingStubs.DateTimeOffset_FromManaged); CopyManaged = (Action)(object)new Action(DateTimeOffset.CopyManaged); DisposeMarshaler = NonBlittableMarshallingStubs.NoOpFunc; DisposeAbi = NonBlittableMarshallingStubs.NoOpFunc; return; } if (typeof(T).IsValueType) { HelperType = typeof(T).GetHelperType(); AbiType = typeof(T).GetAbiType(); MarshalerType = typeof(T).GetMarshalerType(); MarshalByObjectReferenceValueSupported = typeof(T).GetMarshaler2Type() == typeof(ObjectReferenceValue); MarshalGenericFallback marshalGenericFallback = new MarshalGenericFallback(HelperType); CreateMarshaler = marshalGenericFallback.CreateMarshaler; CreateMarshaler2 = (MarshalByObjectReferenceValueSupported ? new Func(marshalGenericFallback.CreateMarshaler2) : CreateMarshaler); GetAbi = marshalGenericFallback.GetAbi; CopyAbi = marshalGenericFallback.CopyAbi; FromAbi = (Func)(object)new Func(marshalGenericFallback.FromAbi); FromManaged = marshalGenericFallback.FromManaged; CopyManaged = marshalGenericFallback.CopyManaged; DisposeMarshaler = marshalGenericFallback.DisposeMarshaler; DisposeAbi = marshalGenericFallback.DisposeAbi; CreateMarshalerArray = (Func)(object)new Func(marshalGenericFallback.CreateMarshalerArray); GetAbiArray = marshalGenericFallback.GetAbiArray; FromAbiArray = (Func)(object)new Func(marshalGenericFallback.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(marshalGenericFallback.FromManagedArray); DisposeMarshalerArray = marshalGenericFallback.DisposeMarshalerArray; DisposeAbiArray = marshalGenericFallback.DisposeAbiArray; return; } HelperType = typeof(T).GetHelperType(); AbiType = typeof(T).GetAbiType(); MarshalerType = typeof(T).GetMarshalerType(); MarshalByObjectReferenceValueSupported = typeof(T).GetMarshaler2Type() == typeof(ObjectReferenceValue); MethodInfo method = HelperType.GetMethod("CreateMarshaler", (BindingFlags)24); CreateMarshaler = (Func)(object)((method != null) ? method.CreateDelegate>() : null); object createMarshaler; if (!MarshalByObjectReferenceValueSupported) { createMarshaler = CreateMarshaler; } else { MethodInfo method2 = HelperType.GetMethod("CreateMarshaler2", (BindingFlags)24); createMarshaler = ((method2 != null) ? method2.CreateDelegate>().WithObjectTResult() : null); } CreateMarshaler2 = (Func)createMarshaler; MethodInfo method3 = HelperType.GetMethod("GetAbi", (BindingFlags)24); GetAbi = ((method3 != null) ? method3.CreateDelegate>().WithMarshaler2Support() : null); MethodInfo method4 = HelperType.GetMethod("FromAbi", (BindingFlags)24); FromAbi = ((method4 != null) ? method4.CreateDelegate>().WithObjectT() : null); MethodInfo method5 = HelperType.GetMethod("FromManaged", (BindingFlags)24); FromManaged = ((method5 != null) ? method5.CreateDelegate>().WithObjectTResult() : null); MethodInfo method6 = HelperType.GetMethod("DisposeMarshaler", (BindingFlags)24); DisposeMarshaler = ((method6 != null) ? method6.CreateDelegate>().WithMarshaler2Support() : null); MethodInfo method7 = HelperType.GetMethod("DisposeAbi", (BindingFlags)24); DisposeAbi = ((method7 != null) ? method7.CreateDelegate>().WithObjectParams() : null); MethodInfo method8 = HelperType.GetMethod("CreateMarshalerArray", (BindingFlags)24); CreateMarshalerArray = ((method8 != null) ? method8.CreateDelegate.MarshalerArray>>().WithObjectTResult.MarshalerArray>() : null); MethodInfo method9 = HelperType.GetMethod("GetAbiArray", (BindingFlags)24); GetAbiArray = ((method9 != null) ? method9.CreateDelegate>>() : null); MethodInfo method10 = HelperType.GetMethod("FromAbiArray", (BindingFlags)24); FromAbiArray = ((method10 != null) ? method10.CreateDelegate>() : null); MethodInfo method11 = HelperType.GetMethod("FromManagedArray", (BindingFlags)24); FromManagedArray = ((method11 != null) ? method11.CreateDelegate>>() : null); MethodInfo method12 = HelperType.GetMethod("DisposeMarshalerArray", (BindingFlags)24); DisposeMarshalerArray = ((method12 != null) ? method12.CreateDelegate.MarshalerArray>>().WithObjectParams.MarshalerArray>() : null); MethodInfo method13 = HelperType.GetMethod("DisposeAbiArray", (BindingFlags)24); DisposeAbiArray = ((method13 != null) ? method13.CreateDelegate>() : null); } } } internal sealed class MarshalGenericFallback { private readonly MethodInvoker _createMarshaler; private readonly MethodInvoker _getAbi; private readonly MethodInvoker _copyAbi; private readonly MethodInvoker _fromAbi; private readonly MethodInvoker _fromManaged; private readonly MethodInvoker _copyManaged; private readonly MethodInvoker _disposeMarshaler; private readonly MethodInvoker _createMarshaler2; private readonly MethodInvoker _disposeAbi; private readonly MethodInvoker _createMarshalerArray; private readonly MethodInvoker _getAbiArray; private readonly MethodInvoker _fromAbiArray; private readonly MethodInvoker _fromManagedArray; private readonly MethodInvoker _disposeMarshalerArray; private readonly MethodInvoker _disposeAbiArray; public MarshalGenericFallback([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type helperType) { _createMarshaler = MarshalExtensions.TryGetMethodInvoker(helperType, "CreateMarshaler"); _getAbi = MarshalExtensions.TryGetMethodInvoker(helperType, "GetAbi"); _copyAbi = MarshalExtensions.TryGetMethodInvoker(helperType, "CopyAbi"); _fromAbi = MarshalExtensions.TryGetMethodInvoker(helperType, "FromAbi"); _fromManaged = MarshalExtensions.TryGetMethodInvoker(helperType, "FromManaged"); _copyManaged = MarshalExtensions.TryGetMethodInvoker(helperType, "CopyManaged"); _disposeMarshaler = MarshalExtensions.TryGetMethodInvoker(helperType, "DisposeMarshaler"); _createMarshaler2 = MarshalExtensions.TryGetMethodInvoker(helperType, "CreateMarshaler2"); _disposeAbi = MarshalExtensions.TryGetMethodInvoker(helperType, "DisposeAbi"); _createMarshalerArray = MarshalExtensions.TryGetMethodInvoker(helperType, "CreateMarshalerArray"); _getAbiArray = MarshalExtensions.TryGetMethodInvoker(helperType, "GetAbiArray"); _fromAbiArray = MarshalExtensions.TryGetMethodInvoker(helperType, "FromAbiArray"); _fromManagedArray = MarshalExtensions.TryGetMethodInvoker(helperType, "FromManagedArray"); _disposeMarshalerArray = MarshalExtensions.TryGetMethodInvoker(helperType, "DisposeMarshalerArray"); _disposeAbiArray = MarshalExtensions.TryGetMethodInvoker(helperType, "DisposeAbiArray"); } public object CreateMarshaler(T arg) { return _createMarshaler.Invoke((object)null, (object)arg); } public object CreateMarshaler2(T arg) { return _createMarshaler2.Invoke((object)null, (object)arg); } public object GetAbi(object arg) { if (arg is ObjectReferenceValue objectReferenceValue) { return objectReferenceValue.GetAbi(); } return _getAbi.Invoke((object)null, arg); } public void CopyAbi(object arg, nint dest) { _copyAbi.Invoke((object)null, arg, (object)dest); } public T FromAbi(object arg) { return (T)_fromAbi.Invoke((object)null, arg); } public object FromManaged(T arg) { return _fromManaged.Invoke((object)null, (object)arg); } public void CopyManaged(T arg, nint dest) { _copyManaged.Invoke((object)null, (object)arg, (object)dest); } public void DisposeMarshaler(object arg) { if (arg is ObjectReferenceValue objectReferenceValue) { objectReferenceValue.Dispose(); } else { _disposeMarshaler.Invoke((object)null, arg); } } public void DisposeAbi(object arg) { _disposeAbi.Invoke((object)null, arg); } public object CreateMarshalerArray(T[] arg) { return _createMarshalerArray.Invoke((object)null, (object)arg); } public ValueTuple GetAbiArray(object arg) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return (ValueTuple)_getAbiArray.Invoke((object)null, arg); } public T[] FromAbiArray(object arg) { return (T[])_fromAbiArray.Invoke((object)null, arg); } public ValueTuple FromManagedArray(T[] arg) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) return (ValueTuple)_fromManagedArray.Invoke((object)null, (object)arg); } public void DisposeMarshalerArray(object arg) { _disposeMarshalerArray.Invoke((object)null, arg); } public void DisposeAbiArray(object arg) { _disposeAbiArray.Invoke((object)null, arg); } } internal static class MarshalGenericHelper { private unsafe static void CopyManagedFallback(T value, nint dest) { if (MarshalGeneric.MarshalByObjectReferenceValueSupported) { *(System.IntPtr*)((System.IntPtr)dest).ToPointer() = ((value == null) ? System.IntPtr.Zero : ((System.IntPtr)((ObjectReferenceValue)MarshalGeneric.CreateMarshaler2.Invoke(value)).Detach())); } else { *(System.IntPtr*)((System.IntPtr)dest).ToPointer() = ((value == null) ? System.IntPtr.Zero : ((System.IntPtr)((IObjectReference)MarshalGeneric.CreateMarshaler.Invoke(value)).GetRef())); } } internal static void CopyManagedArray(T[] array, nint data) { MarshalInterfaceHelper.CopyManagedArray(array, data, MarshalGeneric.CopyManaged ?? new Action(CopyManagedFallback)); } } public class MarshalNonBlittable : MarshalGeneric { public struct MarshalerArray { public nint _array; public object[] _marshalers; public void Dispose() { if (_marshalers != null) { object[] marshalers = _marshalers; foreach (object obj in marshalers) { Marshaler.DisposeMarshaler.Invoke(obj); } } if (_array != (nint)System.IntPtr.Zero) { Marshal.FreeCoTaskMem((System.IntPtr)_array); } } } private new static readonly System.Type AbiType = GetAbiType(); private static System.Type GetAbiType() { //IL_0368: Unknown result type (might be due to invalid IL or missing references) if (typeof(T).IsEnum) { return System.Enum.GetUnderlyingType(typeof(T)); } if (typeof(T) == typeof(bool)) { return typeof(byte); } if (typeof(T) == typeof(char)) { return typeof(ushort); } if (typeof(T) == typeof(TimeSpan)) { return typeof(TimeSpan); } if (typeof(T) == typeof(DateTimeOffset)) { return typeof(DateTimeOffset); } if (typeof(T) == typeof(System.Exception)) { return typeof(Exception); } if (typeof(T) == typeof(int) || typeof(T) == typeof(byte) || typeof(T) == typeof(sbyte) || typeof(T) == typeof(short) || typeof(T) == typeof(ushort) || typeof(T) == typeof(uint) || typeof(T) == typeof(long) || typeof(T) == typeof(ulong) || typeof(T) == typeof(float) || typeof(T) == typeof(double) || typeof(T) == typeof(Guid) || typeof(T) == typeof(Windows.Foundation.Point) || typeof(T) == typeof(Windows.Foundation.Rect) || typeof(T) == typeof(Windows.Foundation.Size) || typeof(T) == typeof(Matrix3x2) || typeof(T) == typeof(Matrix4x4) || typeof(T) == typeof(Plane) || typeof(T) == typeof(Quaternion) || typeof(T) == typeof(Vector2) || typeof(T) == typeof(Vector3) || typeof(T) == typeof(Vector4)) { return null; } if (typeof(T) == typeof(System.Type)) { throw new NotSupportedException("Using 'System.Type' with MarshalNonBlittable isn't supported, use Marshaler instead."); } return typeof(T).GetAbiType(); } public new unsafe static MarshalerArray CreateMarshalerArray(T[] array) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot handle array marshalling for non blittable type '{typeof(T)}'."); } MarshalerArray result = default(MarshalerArray); if (array == null) { return result; } bool flag = false; try { int num = array.Length; int num2 = Marshal.SizeOf(AbiType); int num3 = num * num2; result._array = Marshal.AllocCoTaskMem(num3); result._marshalers = new object[num]; byte* ptr = (byte*)((System.IntPtr)result._array).ToPointer(); for (int i = 0; i < num; i++) { result._marshalers[i] = Marshaler.CreateMarshaler.Invoke(array[i]); Marshaler.CopyAbi.Invoke(result._marshalers[i], (nint)ptr); ptr += num2; } flag = true; return result; } finally { if (!flag) { result.Dispose(); } } } public new static ValueTuple GetAbiArray(object box) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MarshalerArray marshalerArray = (MarshalerArray)box; object[] marshalers = marshalerArray._marshalers; return new ValueTuple((marshalers != null) ? marshalers.Length : 0, marshalerArray._array); } public new unsafe static T[] FromAbiArray(object box) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot handle array marshalling for non blittable type '{typeof(T)}'."); } if (box == null) { return null; } ValueTuple val = (ValueTuple)box; if (val.Item2 == (nint)System.IntPtr.Zero) { return null; } T[] array = new T[val.Item1]; byte* ptr = (byte*)((System.IntPtr)val.Item2).ToPointer(); int num = Marshal.SizeOf(AbiType); for (int i = 0; i < val.Item1; i++) { object obj = Marshal.PtrToStructure((System.IntPtr)(nint)ptr, AbiType); array[i] = ((Func)(object)Marshaler.FromAbi).Invoke(obj); ptr += num; } return array; } public unsafe static void CopyAbiArray(T[] array, object box) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot handle array marshalling for non blittable type '{typeof(T)}'."); } ValueTuple val = (ValueTuple)box; if (val.Item2 != (nint)System.IntPtr.Zero) { byte* ptr = (byte*)((System.IntPtr)val.Item2).ToPointer(); int num = Marshal.SizeOf(AbiType); for (int i = 0; i < val.Item1; i++) { object obj = Marshal.PtrToStructure((System.IntPtr)(nint)ptr, AbiType); array[i] = ((Func)(object)Marshaler.FromAbi).Invoke(obj); ptr += num; } } } public new unsafe static ValueTuple FromManagedArray(T[] array) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot handle array marshalling for non blittable type '{typeof(T)}'."); } if (array == null) { return new ValueTuple(0, (nint)System.IntPtr.Zero); } nint num = System.IntPtr.Zero; int i = 0; bool flag = false; try { int num2 = array.Length; int num3 = Marshal.SizeOf(AbiType); int num4 = num2 * num3; num = Marshal.AllocCoTaskMem(num4); byte* ptr = (byte*)((System.IntPtr)num).ToPointer(); for (i = 0; i < num2; i++) { Marshaler.CopyManaged.Invoke(array[i], (nint)ptr); ptr += num3; } flag = true; return new ValueTuple(i, num); } finally { if (!flag) { DisposeAbiArray(new ValueTuple(i, num)); } } } public unsafe static void CopyManagedArray(T[] array, nint data) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot handle array marshalling for non blittable type '{typeof(T)}'."); } if (array == null) { return; } DisposeAbiArrayElements(new ValueTuple(array.Length, data)); int i = 0; bool flag = false; try { int num = array.Length; int num2 = Marshal.SizeOf(AbiType); int num3 = num * num2; byte* ptr = (byte*)((System.IntPtr)data).ToPointer(); for (i = 0; i < num; i++) { Marshaler.CopyManaged.Invoke(array[i], (nint)ptr); ptr += num2; } flag = true; } finally { if (!flag) { DisposeAbiArrayElements(new ValueTuple(i, data)); } } } public new static void DisposeMarshalerArray(object box) { ((MarshalerArray)box).Dispose(); } public unsafe static void DisposeAbiArrayElements(ValueTuple abi) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot handle array marshalling for non blittable type '{typeof(T)}'."); } byte* ptr = (byte*)((System.IntPtr)abi.Item2).ToPointer(); int num = Marshal.SizeOf(AbiType); for (int i = 0; i < abi.Item1; i++) { object obj = Marshal.PtrToStructure((System.IntPtr)(nint)ptr, AbiType); Marshaler.DisposeAbi.Invoke(obj); ptr += num; } } public new static void DisposeAbiArray(object box) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (box != null) { ValueTuple abi = (ValueTuple)box; if (abi.Item2 != (nint)System.IntPtr.Zero) { DisposeAbiArrayElements(abi); Marshal.FreeCoTaskMem((System.IntPtr)abi.Item2); } } } } public class MarshalInterfaceHelper { public struct MarshalerArray { public nint _array; public IObjectReference[] _marshalers; internal ObjectReferenceValue[] _objectReferenceValues; public void Dispose() { if (_marshalers != null) { IObjectReference[] marshalers = _marshalers; foreach (IObjectReference objRef in marshalers) { MarshalInterfaceHelper.DisposeMarshaler(objRef); } } if (_objectReferenceValues != null) { ObjectReferenceValue[] objectReferenceValues = _objectReferenceValues; foreach (ObjectReferenceValue objectReferenceValue in objectReferenceValues) { objectReferenceValue.Dispose(); } } if (_array != (nint)System.IntPtr.Zero) { Marshal.FreeCoTaskMem((System.IntPtr)_array); } } } private unsafe static MarshalerArray CreateMarshalerArray(T[] array, Func createMarshaler, Func createMarshaler2) { MarshalerArray result = default(MarshalerArray); if (array == null) { return result; } bool flag = false; try { int num = array.Length; int num2 = num * System.IntPtr.Size; result._array = Marshal.AllocCoTaskMem(num2); nint* ptr = (nint*)((System.IntPtr)result._array).ToPointer(); if (createMarshaler2 != null) { result._objectReferenceValues = new ObjectReferenceValue[num]; for (int i = 0; i < num; i++) { result._objectReferenceValues[i] = createMarshaler2.Invoke(array[i]); ptr[i] = GetAbi(result._objectReferenceValues[i]); } } else { result._marshalers = new IObjectReference[num]; for (int j = 0; j < num; j++) { result._marshalers[j] = createMarshaler.Invoke(array[j]); ptr[j] = GetAbi(result._marshalers[j]); } } flag = true; return result; } finally { if (!flag) { result.Dispose(); } } } public static MarshalerArray CreateMarshalerArray(T[] array, Func createMarshaler) { return CreateMarshalerArray(array, createMarshaler, null); } public static MarshalerArray CreateMarshalerArray2(T[] array, Func createMarshaler) { return CreateMarshalerArray(array, null, createMarshaler); } public static ValueTuple GetAbiArray(object box) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) MarshalerArray marshalerArray = (MarshalerArray)box; ObjectReferenceValue[] objectReferenceValues = marshalerArray._objectReferenceValues; int num; if (objectReferenceValues == null) { IObjectReference[] marshalers = marshalerArray._marshalers; num = ((marshalers != null) ? marshalers.Length : 0); } else { num = objectReferenceValues.Length; } return new ValueTuple(num, marshalerArray._array); } public unsafe static T[] FromAbiArray(object box, Func fromAbi) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (box == null) { return null; } ValueTuple val = (ValueTuple)box; if (val.Item2 == (nint)System.IntPtr.Zero) { return null; } T[] array = new T[val.Item1]; nint* ptr = (nint*)((System.IntPtr)val.Item2).ToPointer(); for (int i = 0; i < val.Item1; i++) { array[i] = ((Func)(object)fromAbi).Invoke(ptr[i]); } return array; } public unsafe static void CopyAbiArray(T[] array, object box, Func fromAbi) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (box != null) { ValueTuple val = (ValueTuple)box; nint* ptr = (nint*)((System.IntPtr)val.Item2).ToPointer(); for (int i = 0; i < val.Item1; i++) { array[i] = ((Func)(object)fromAbi).Invoke(ptr[i]); } } } public unsafe static ValueTuple FromManagedArray(T[] array, Func fromManaged) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (array == null) { return new ValueTuple(0, (nint)System.IntPtr.Zero); } nint num = System.IntPtr.Zero; int i = 0; bool flag = false; try { int num2 = array.Length; int num3 = num2 * System.IntPtr.Size; num = Marshal.AllocCoTaskMem(num3); nint* ptr = (nint*)((System.IntPtr)num).ToPointer(); for (i = 0; i < num2; i++) { ptr[i] = fromManaged.Invoke(array[i]); } flag = true; return new ValueTuple(i, num); } finally { if (!flag) { DisposeAbiArray(new ValueTuple(i, num)); } } } public unsafe static void CopyManagedArray(T[] array, nint data, Action copyManaged) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (array == null) { return; } DisposeAbiArrayElements(new ValueTuple(array.Length, data)); int i = 0; bool flag = false; try { int num = array.Length; int num2 = num * System.IntPtr.Size; byte* ptr = (byte*)((System.IntPtr)data).ToPointer(); for (i = 0; i < num; i++) { copyManaged.Invoke(array[i], (nint)ptr); ptr += System.IntPtr.Size; } flag = true; } finally { if (!flag) { DisposeAbiArrayElements(new ValueTuple(i, data)); } } } public static void DisposeMarshalerArray(object box) { ((MarshalerArray)box).Dispose(); } public unsafe static void DisposeAbiArrayElements(ValueTuple abi) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) nint* ptr = (nint*)((System.IntPtr)abi.Item2).ToPointer(); for (int i = 0; i < abi.Item1; i++) { DisposeAbi(ptr[i]); } } public static void DisposeAbiArray(object box) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (box != null) { ValueTuple abi = (ValueTuple)box; if (abi.Item2 != (nint)System.IntPtr.Zero) { DisposeAbiArrayElements(abi); Marshal.FreeCoTaskMem((System.IntPtr)abi.Item2); } } } public static nint GetAbi(IObjectReference objRef) { return objRef?.ThisPtr ?? System.IntPtr.Zero; } public static nint GetAbi(ObjectReferenceValue value) { return value.GetAbi(); } public static void DisposeMarshaler(IObjectReference objRef) { objRef?.Dispose(); } public static void DisposeMarshaler(ObjectReferenceValue value) { value.Dispose(); } public unsafe static void DisposeAbi(nint ptr) { if (ptr != (nint)System.IntPtr.Zero) { ((IUnknownVftbl*)(*(nint*)ptr))->Release(ptr); } } } [StructLayout(0, Size = 1)] public struct MarshalInterface { [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] private static System.Type _HelperType; private static object _CreateMarshaler; private static object _Iid; [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] private static System.Type HelperType => _HelperType ?? (_HelperType = typeof(T).GetHelperType()); private static Guid IID => (Guid)(_Iid ?? (_Iid = GetIID())); private static Guid GetIID() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (typeof(T).IsValueType && typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(System.Nullable<>)) { return GuidGenerator.CreateIIDUnsafe(typeof(T)); } return GuidGenerator.GetIID(HelperType); } public static T FromAbi(nint ptr) { if (ptr == (nint)System.IntPtr.Zero) { return (T)(object)null; } return MarshalInspectable.FromAbi(ptr); } public static IObjectReference CreateMarshaler(T value) { if (value == null) { return null; } return CreateMarshalerCore(value); } public static ObjectReferenceValue CreateMarshaler2(T value, Guid iid = default(Guid)) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (value == null) { return default(ObjectReferenceValue); } return MarshalInspectable.CreateMarshaler2(value, (iid == default(Guid)) ? IID : iid); } public static nint GetAbi(IObjectReference value) { if (value != null) { return MarshalInterfaceHelper.GetAbi(value); } return System.IntPtr.Zero; } public static nint GetAbi(ObjectReferenceValue value) { return MarshalInterfaceHelper.GetAbi(value); } public static void DisposeAbi(nint thisPtr) { MarshalInterfaceHelper.DisposeAbi(thisPtr); } public static void DisposeMarshaler(IObjectReference value) { MarshalInterfaceHelper.DisposeMarshaler(value); } public static void DisposeMarshaler(ObjectReferenceValue value) { MarshalInterfaceHelper.DisposeMarshaler(value); } internal static void DisposeMarshaler(object value) { if (value is ObjectReferenceValue value2) { DisposeMarshaler(value2); } else { DisposeMarshaler((IObjectReference)value); } } public static nint FromManaged(T value) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) return CreateMarshaler2(value).Detach(); } public unsafe static void CopyManaged(T value, nint dest) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) *(nint*)((System.IntPtr)dest).ToPointer() = CreateMarshaler2(value).Detach(); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(T[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, (T o) => CreateMarshaler2(o)); } public static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static T[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, (Func)(object)new Func(FromAbi)); } public static void CopyAbiArray(T[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, (Func)(object)new Func(FromAbi)); } public static ValueTuple FromManagedArray(T[] array) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, FromManaged); } public static void CopyManagedArray(T[] array, nint data) { MarshalInterfaceHelper.CopyManagedArray(array, data, CopyManaged); } public static void DisposeMarshalerArray(object box) { MarshalInterfaceHelper.DisposeMarshalerArray(box); } public static void DisposeAbiArray(object box) { MarshalInterfaceHelper.DisposeAbiArray(box); } private static IObjectReference CreateMarshalerCore(T value) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!RuntimeFeature.IsDynamicCodeCompiled) { return MarshalInspectable.CreateMarshaler(value, IID); } if (_CreateMarshaler == null) { _CreateMarshaler = BindCreateMarshaler(); } return ((Func)_CreateMarshaler).Invoke(value); } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] private static Func BindCreateMarshaler() { System.Type type = HelperType.FindVftblType(); if (type != null) { MethodInfo val = typeof(MarshalInspectable).GetMethod("CreateMarshaler", new System.Type[3] { typeof(T), typeof(Guid), typeof(bool) }).MakeGenericMethod(new System.Type[1] { type }); Func createMarshaler = (Func)(object)val.CreateDelegate(typeof(Func)); return (T obj) => createMarshaler.Invoke(obj, IID, true); } return (T obj) => MarshalInspectable.CreateMarshaler(obj, IID); } } public static class MarshalInspectable { public static IObjectReference CreateMarshaler(T o, Guid iid, bool unwrapObject = true) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (o == null) { return null; } if (unwrapObject && ComWrappersSupport.TryUnwrapObject(o, out var objRef)) { return objRef.As(iid); } System.Type type = ((object)o).GetType(); System.Type type2 = Projections.FindCustomHelperTypeMapping(type, filterToRuntimeClass: true); if (type2 != (System.Type)null) { MethodInfo method = type2.GetMethod("CreateMarshaler", (BindingFlags)24); return (IObjectReference)((MethodBase)method).Invoke((object)null, new object[1] { o }); } return ComWrappersSupport.CreateCCWForObject(o, iid); } public static IObjectReference CreateMarshaler(T o, bool unwrapObject = true) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return CreateMarshaler(o, IID.IID_IInspectable, unwrapObject); } public static ObjectReferenceValue CreateMarshaler2(T o, Guid iid, bool unwrapObject = true) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (o == null) { return default(ObjectReferenceValue); } if (unwrapObject && ComWrappersSupport.TryUnwrapObject(o, out var objRef)) { return objRef.AsValue(iid); } System.Type type = ((object)o).GetType(); System.Type type2 = Projections.FindCustomHelperTypeMapping(type, filterToRuntimeClass: true); if (type2 != (System.Type)null) { MethodInfo method = type2.GetMethod("CreateMarshaler2", (BindingFlags)24); return (ObjectReferenceValue)((MethodBase)method).Invoke((object)null, new object[1] { o }); } return ComWrappersSupport.CreateCCWForObjectForMarshaling(o, iid); } public static ObjectReferenceValue CreateMarshaler2(T o, bool unwrapObject = true) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return CreateMarshaler2(o, IID.IID_IInspectable, unwrapObject); } public static nint GetAbi(IObjectReference objRef) { if (objRef != null) { return MarshalInterfaceHelper.GetAbi(objRef); } return System.IntPtr.Zero; } public static nint GetAbi(ObjectReferenceValue value) { return value.GetAbi(); } public static T FromAbi(nint ptr) { if (ptr == (nint)System.IntPtr.Zero) { return default(T); } nint zero = System.IntPtr.Zero; try { Marshal.QueryInterface((System.IntPtr)ptr, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref IID.IID_IUnknown), ref zero); if (IUnknownVftbl.IsReferenceToManagedObject(zero)) { if (ComWrappersSupport.FindObject(zero) is T result) { return result; } return ComWrappersSupport.CreateRcwForComObject(ptr); } return ComWrappersSupport.CreateRcwForComObject(ptr); } finally { DisposeAbi(zero); } } public static void DisposeMarshaler(IObjectReference objRef) { MarshalInterfaceHelper.DisposeMarshaler(objRef); } public static void DisposeMarshaler(ObjectReferenceValue value) { value.Dispose(); } internal static void DisposeMarshaler(object value) { if (value is ObjectReferenceValue value2) { DisposeMarshaler(value2); } else { DisposeMarshaler((IObjectReference)value); } } public static void DisposeAbi(nint ptr) { MarshalInterfaceHelper.DisposeAbi(ptr); } public static nint FromManaged(T o, bool unwrapObject = true) { return CreateMarshaler2(o, unwrapObject).Detach(); } public unsafe static void CopyManaged(T o, nint dest, bool unwrapObject = true) { *(nint*)((System.IntPtr)dest).ToPointer() = CreateMarshaler2(o, unwrapObject).Detach(); } public static MarshalInterfaceHelper.MarshalerArray CreateMarshalerArray(T[] array) { return MarshalInterfaceHelper.CreateMarshalerArray2(array, (T o) => CreateMarshaler2(o)); } public static ValueTuple GetAbiArray(T box) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } internal static ValueTuple GetAbiArray(object box) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.GetAbiArray(box); } public static T[] FromAbiArray(T box) { return MarshalInterfaceHelper.FromAbiArray(box, (Func)(object)new Func(FromAbi)); } internal static T[] FromAbiArray(object box) { return MarshalInterfaceHelper.FromAbiArray(box, (Func)(object)new Func(FromAbi)); } public static void CopyAbiArray(T[] array, object box) { MarshalInterfaceHelper.CopyAbiArray(array, box, (Func)(object)new Func(FromAbi)); } public static ValueTuple FromManagedArray(T[] array) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) return MarshalInterfaceHelper.FromManagedArray(array, (T o) => FromManaged(o)); } public static void CopyManagedArray(T[] array, nint data) { MarshalInterfaceHelper.CopyManagedArray(array, data, delegate(T o, nint dest) { CopyManaged(o, dest); }); } public static void DisposeMarshalerArray(T box) { MarshalInterfaceHelper.DisposeMarshalerArray(box); } public static void DisposeAbiArray(T box) { MarshalInterfaceHelper.DisposeAbiArray(box); } internal static void DisposeMarshalerArray(object box) { MarshalInterfaceHelper.DisposeMarshalerArray(box); } internal static void DisposeAbiArray(object box) { MarshalInterfaceHelper.DisposeAbiArray(box); } } public static class MarshalDelegate { public static IObjectReference CreateMarshaler(object o, Guid delegateIID, bool unwrapObject = true) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (o == null) { return null; } if (unwrapObject && ComWrappersSupport.TryUnwrapObject(o, out var objRef)) { return objRef.As(delegateIID); } return ComWrappersSupport.CreateCCWForObject(o, delegateIID); } public static ObjectReferenceValue CreateMarshaler2(object o, Guid delegateIID, bool unwrapObject = true) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (o == null) { return default(ObjectReferenceValue); } if (unwrapObject && ComWrappersSupport.TryUnwrapObject(o, out var objRef)) { return objRef.AsValue(delegateIID); } return ComWrappersSupport.CreateCCWForObjectForMarshaling(o, delegateIID); } public static T FromAbi(nint nativeDelegate) where T : System.Delegate { if (nativeDelegate == (nint)System.IntPtr.Zero) { return null; } if (IUnknownVftbl.IsReferenceToManagedObject(nativeDelegate)) { if (ComWrappersSupport.FindObject(nativeDelegate) is T result) { return result; } return ComWrappersSupport.CreateRcwForComObject(nativeDelegate); } return ComWrappersSupport.CreateRcwForComObject(nativeDelegate); } } internal static class Marshaler { internal static readonly Func ReturnParameterFunc = ReturnParameter; internal static readonly Action CopyIntEnumFunc = CopyIntEnum; internal static readonly Action CopyIntEnumDirectFunc = CopyIntEnumDirect; internal static readonly Action CopyUIntEnumFunc = CopyUIntEnum; internal static readonly Action CopyUIntEnumDirectFunc = CopyUIntEnumDirect; private static object ReturnParameter(object arg) { return arg; } private unsafe static void CopyIntEnum(object value, nint dest) { *(int*)((System.IntPtr)dest).ToPointer() = Convert.ToInt32(value); } private unsafe static void CopyIntEnumDirect(object value, nint dest) { *(int*)((System.IntPtr)dest).ToPointer() = (int)value; } private unsafe static void CopyUIntEnum(object value, nint dest) { *(uint*)((System.IntPtr)dest).ToPointer() = Convert.ToUInt32(value); } private unsafe static void CopyUIntEnumDirect(object value, nint dest) { *(uint*)((System.IntPtr)dest).ToPointer() = (uint)value; } } public class Marshaler { public static readonly System.Type AbiType; [Obsolete("This method is deprecated and will be removed in a future release.")] public static readonly System.Type RefAbiType; public static readonly Func CreateMarshaler; internal static readonly Func CreateMarshaler2; public static readonly Func GetAbi; public static readonly Action CopyAbi; public static readonly Func FromAbi; public static readonly Func FromManaged; public static readonly Action CopyManaged; public static readonly Action DisposeMarshaler; public static readonly Action DisposeAbi; public static readonly Func CreateMarshalerArray; public static readonly Func> GetAbiArray; public static readonly Func FromAbiArray; public static readonly Func> FromManagedArray; public static readonly Action CopyManagedArray; public static readonly Action DisposeMarshalerArray; public static readonly Action DisposeAbiArray; static Marshaler() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (typeof(T).IsArray) { throw new InvalidOperationException("Arrays may not be marshaled generically."); } if (typeof(T) == typeof(string)) { AbiType = typeof(nint); CreateMarshaler = (Func)(object)new Func(MarshalString.CreateMarshaler); CreateMarshaler2 = CreateMarshaler; GetAbi = (object box) => MarshalString.GetAbi(box); FromAbi = (Func)(object)(Func)((object value) => (T)(object)MarshalString.FromAbi((nint)value)); FromManaged = (T value) => MarshalString.FromManaged((string)(object)value); DisposeMarshaler = MarshalString.DisposeMarshaler; DisposeAbi = MarshalString.DisposeAbi; CreateMarshalerArray = (Func)(object)(Func)((T[] array) => MarshalString.CreateMarshalerArray((string[])(object)array)); GetAbiArray = MarshalString.GetAbiArray; FromAbiArray = (Func)(object)new Func(MarshalString.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(MarshalString.FromManagedArray); CopyManagedArray = (Action)(object)new Action(MarshalString.CopyManagedArray); DisposeMarshalerArray = MarshalString.DisposeMarshalerArray; DisposeAbiArray = MarshalString.DisposeAbiArray; } else if (typeof(T) == typeof(System.Type)) { AbiType = typeof(Type); CreateMarshaler = (T value) => Type.CreateMarshaler((System.Type)(object)value); CreateMarshaler2 = CreateMarshaler; GetAbi = (object box) => Type.GetAbi((Type.Marshaler)box); FromAbi = (Func)(object)(Func)((object value) => (T)(object)Type.FromAbi((Type)value)); CopyAbi = delegate(object box, nint dest) { Type.CopyAbi((Type.Marshaler)box, dest); }; CopyManaged = (Action)(object)new Action(Type.CopyManaged); FromManaged = (T value) => Type.FromManaged((System.Type)(object)value); DisposeMarshaler = delegate(object box) { Type.DisposeMarshaler((Type.Marshaler)box); }; DisposeAbi = delegate(object box) { Type.DisposeAbi((Type)box); }; CreateMarshalerArray = (Func)(object)new Func(NonBlittableMarshallingStubs.Type_CreateMarshalerArray); GetAbiArray = Type.GetAbiArray; FromAbiArray = (Func)(object)new Func(Type.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(Type.FromManagedArray); CopyManagedArray = (Action)(object)new Action(Type.CopyManagedArray); DisposeMarshalerArray = Type.DisposeMarshalerArray; DisposeAbiArray = Type.DisposeAbiArray; } else if (typeof(System.Exception).IsAssignableFrom(typeof(T))) { AbiType = typeof(Exception); CreateMarshaler = (T value) => Exception.CreateMarshaler((System.Exception)(object)value); CreateMarshaler2 = CreateMarshaler; GetAbi = (object box) => Exception.GetAbi((Exception.Marshaler)box); FromAbi = (Func)(object)(Func)((object value) => (T)(object)Exception.FromAbi((Exception)value)); CopyAbi = delegate(object box, nint dest) { Exception.CopyAbi((Exception.Marshaler)box, dest); }; CopyManaged = (Action)(object)new Action(Exception.CopyManaged); FromManaged = (T value) => Exception.FromManaged((System.Exception)(object)value); DisposeMarshaler = delegate(object box) { Exception.DisposeMarshaler((Exception.Marshaler)box); }; DisposeAbi = delegate(object box) { Exception.DisposeAbi((Exception)box); }; CreateMarshalerArray = (Func)(object)new Func(NonBlittableMarshallingStubs.Exception_CreateMarshalerArray); GetAbiArray = MarshalNonBlittable.GetAbiArray; FromAbiArray = (Func)(object)new Func(MarshalNonBlittable.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(MarshalNonBlittable.FromManagedArray); CopyManagedArray = (Action)(object)new Action(MarshalNonBlittable.CopyManagedArray); DisposeMarshalerArray = MarshalNonBlittable.DisposeMarshalerArray; DisposeAbiArray = MarshalNonBlittable.DisposeAbiArray; } else if (typeof(T).IsValueType) { if (typeof(T) == typeof(bool)) { AbiType = typeof(byte); } else if (typeof(T) == typeof(char)) { AbiType = typeof(ushort); } else if (typeof(T) == typeof(int) || typeof(T) == typeof(byte) || typeof(T) == typeof(sbyte) || typeof(T) == typeof(short) || typeof(T) == typeof(ushort) || typeof(T) == typeof(uint) || typeof(T) == typeof(long) || typeof(T) == typeof(ulong) || typeof(T) == typeof(float) || typeof(T) == typeof(double) || typeof(T) == typeof(Guid) || typeof(T) == typeof(Windows.Foundation.Point) || typeof(T) == typeof(Windows.Foundation.Rect) || typeof(T) == typeof(Windows.Foundation.Size) || typeof(T) == typeof(Matrix3x2) || typeof(T) == typeof(Matrix4x4) || typeof(T) == typeof(Plane) || typeof(T) == typeof(Quaternion) || typeof(T) == typeof(Vector2) || typeof(T) == typeof(Vector3) || typeof(T) == typeof(Vector4)) { AbiType = null; } else if (typeof(T) == typeof(TimeSpan)) { AbiType = typeof(TimeSpan); } else if (typeof(T) == typeof(DateTimeOffset)) { AbiType = typeof(DateTimeOffset); } else { if (typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(KeyValuePair<, >)) { AbiType = typeof(nint); CreateMarshaler = MarshalGeneric.CreateMarshaler2; CreateMarshaler2 = MarshalGeneric.CreateMarshaler2; GetAbi = MarshalGeneric.GetAbi; CopyAbi = MarshalGeneric.CopyAbi; FromAbi = MarshalGeneric.FromAbi; FromManaged = MarshalGeneric.FromManaged; CopyManaged = MarshalGeneric.CopyManaged; DisposeMarshaler = MarshalGeneric.DisposeMarshaler; DisposeAbi = MarshalGeneric.DisposeAbi; CreateMarshalerArray = MarshalGeneric.CreateMarshalerArray; GetAbiArray = MarshalGeneric.GetAbiArray; FromAbiArray = MarshalGeneric.FromAbiArray; FromManagedArray = MarshalGeneric.FromManagedArray; CopyManagedArray = (Action)(object)new Action(MarshalGenericHelper.CopyManagedArray); DisposeMarshalerArray = MarshalInterface.DisposeMarshalerArray; DisposeAbiArray = MarshalInterface.DisposeAbiArray; return; } if (typeof(T).IsNullableT()) { AbiType = typeof(nint); CreateMarshaler = (T value) => MarshalInterface.CreateMarshaler2(value); CreateMarshaler2 = CreateMarshaler; GetAbi = (object objRef) => (objRef is ObjectReferenceValue value4) ? MarshalInspectable.GetAbi(value4) : MarshalInterface.GetAbi((IObjectReference)objRef); FromAbi = (Func)(object)(Func)((object value) => MarshalInterface.FromAbi((nint)value)); FromManaged = (T value) => MarshalInterface.CreateMarshaler2(value).Detach(); DisposeMarshaler = MarshalInterface.DisposeMarshaler; DisposeAbi = delegate(object box) { MarshalInterface.DisposeAbi((nint)box); }; CreateMarshalerArray = (Func)(object)(Func)((T[] array) => MarshalInterface.CreateMarshalerArray(array)); GetAbiArray = MarshalInterface.GetAbiArray; FromAbiArray = (Func)(object)new Func(MarshalInterface.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(MarshalInterface.FromManagedArray); CopyManagedArray = (Action)(object)new Action(MarshalInterface.CopyManagedArray); DisposeMarshalerArray = MarshalInterface.DisposeMarshalerArray; DisposeAbiArray = MarshalInterface.DisposeAbiArray; return; } System.Type type = typeof(T).FindHelperType(); if (type?.GetMethod("FromAbi", (BindingFlags)24) == null) { AbiType = null; } else { AbiType = type; } } if (typeof(T) == typeof(int) || typeof(T) == typeof(byte) || typeof(T) == typeof(sbyte) || typeof(T) == typeof(short) || typeof(T) == typeof(ushort) || typeof(T) == typeof(uint) || typeof(T) == typeof(long) || typeof(T) == typeof(ulong) || typeof(T) == typeof(float) || typeof(T) == typeof(double) || typeof(T) == typeof(Guid) || typeof(T) == typeof(Windows.Foundation.Point) || typeof(T) == typeof(Windows.Foundation.Rect) || typeof(T) == typeof(Windows.Foundation.Size) || typeof(T) == typeof(Matrix3x2) || typeof(T) == typeof(Matrix4x4) || typeof(T) == typeof(Plane) || typeof(T) == typeof(Quaternion) || typeof(T) == typeof(Vector2) || typeof(T) == typeof(Vector3) || typeof(T) == typeof(Vector4) || AbiType == (System.Type)null) { Func val = (T value) => value; AbiType = typeof(T); CreateMarshaler = val; CreateMarshaler2 = CreateMarshaler; GetAbi = Marshaler.ReturnParameterFunc; FromAbi = (Func)(object)(Func)((object value) => (T)value); FromManaged = val; DisposeMarshaler = NonBlittableMarshallingStubs.NoOpFunc; DisposeAbi = NonBlittableMarshallingStubs.NoOpFunc; if (typeof(T).IsEnum) { if (typeof(T).GetEnumUnderlyingType() == typeof(int)) { CopyAbi = Marshaler.CopyIntEnumFunc; CopyManaged = Marshaler.CopyIntEnumDirectFunc.WithTypedT1(); } else { CopyAbi = Marshaler.CopyUIntEnumFunc; CopyManaged = Marshaler.CopyUIntEnumDirectFunc.WithTypedT1(); } } CreateMarshalerArray = (Func)(object)(Func)((T[] array) => MarshalBlittable.CreateMarshalerArray(array)); GetAbiArray = MarshalBlittable.GetAbiArray; FromAbiArray = (Func)(object)new Func(MarshalBlittable.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(MarshalBlittable.FromManagedArray); CopyManagedArray = (Action)(object)new Action(MarshalBlittable.CopyManagedArray); DisposeMarshalerArray = MarshalBlittable.DisposeMarshalerArray; DisposeAbiArray = MarshalBlittable.DisposeAbiArray; } else { CreateMarshaler = MarshalGeneric.CreateMarshaler; CreateMarshaler2 = CreateMarshaler; GetAbi = MarshalGeneric.GetAbi; CopyAbi = MarshalGeneric.CopyAbi; FromAbi = MarshalGeneric.FromAbi; FromManaged = MarshalGeneric.FromManaged; CopyManaged = MarshalGeneric.CopyManaged; DisposeMarshaler = MarshalGeneric.DisposeMarshaler; DisposeAbi = MarshalGeneric.DisposeAbi; CreateMarshalerArray = (Func)(object)(Func)((T[] array) => MarshalNonBlittable.CreateMarshalerArray(array)); GetAbiArray = MarshalNonBlittable.GetAbiArray; FromAbiArray = (Func)(object)new Func(MarshalNonBlittable.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(MarshalNonBlittable.FromManagedArray); CopyManagedArray = (Action)(object)new Action(MarshalNonBlittable.CopyManagedArray); DisposeMarshalerArray = MarshalNonBlittable.DisposeMarshalerArray; DisposeAbiArray = MarshalNonBlittable.DisposeAbiArray; } } else if (typeof(T).IsInterface) { AbiType = typeof(nint); CreateMarshaler = (T value) => MarshalInterface.CreateMarshaler2(value); CreateMarshaler2 = CreateMarshaler; GetAbi = (object objRef) => (objRef is ObjectReferenceValue value3) ? MarshalInspectable.GetAbi(value3) : MarshalInterface.GetAbi((IObjectReference)objRef); FromAbi = (Func)(object)(Func)((object value) => MarshalInterface.FromAbi((nint)value)); FromManaged = (T value) => MarshalInterface.CreateMarshaler2(value).Detach(); DisposeMarshaler = MarshalInterface.DisposeMarshaler; DisposeAbi = delegate(object box) { MarshalInterface.DisposeAbi((nint)box); }; CreateMarshalerArray = (Func)(object)(Func)((T[] array) => MarshalInterface.CreateMarshalerArray(array)); GetAbiArray = MarshalInterface.GetAbiArray; FromAbiArray = (Func)(object)new Func(MarshalInterface.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(MarshalInterface.FromManagedArray); CopyManagedArray = (Action)(object)new Action(MarshalInterface.CopyManagedArray); DisposeMarshalerArray = MarshalInterface.DisposeMarshalerArray; DisposeAbiArray = MarshalInterface.DisposeAbiArray; } else if (typeof(T) == typeof(object)) { AbiType = typeof(nint); CreateMarshaler = (T value) => MarshalInspectable.CreateMarshaler2(value); CreateMarshaler2 = CreateMarshaler; GetAbi = (object objRef) => (objRef is ObjectReferenceValue value2) ? MarshalInspectable.GetAbi(value2) : MarshalInspectable.GetAbi((IObjectReference)objRef); FromAbi = (Func)(object)(Func)((object box) => MarshalInspectable.FromAbi((nint)box)); FromManaged = (T value) => MarshalInspectable.FromManaged(value); CopyManaged = delegate(T value, nint dest) { MarshalInspectable.CopyManaged(value, dest); }; DisposeMarshaler = MarshalInspectable.DisposeMarshaler; DisposeAbi = delegate(object box) { MarshalInspectable.DisposeAbi((nint)box); }; CreateMarshalerArray = (Func)(object)(Func)((T[] array) => MarshalInspectable.CreateMarshalerArray(array)); GetAbiArray = MarshalInspectable.GetAbiArray; FromAbiArray = (Func)(object)new Func(MarshalInspectable.FromAbiArray); FromManagedArray = (Func>)(object)new Func>(MarshalInspectable.FromManagedArray); CopyManagedArray = (Action)(object)new Action(MarshalInspectable.CopyManagedArray); DisposeMarshalerArray = MarshalInspectable.DisposeMarshalerArray; DisposeAbiArray = MarshalInspectable.DisposeAbiArray; } else { AbiType = typeof(nint); CreateMarshaler = (typeof(T).IsDelegate() ? MarshalGeneric.CreateMarshaler : MarshalGeneric.CreateMarshaler2); CreateMarshaler2 = MarshalGeneric.CreateMarshaler2; GetAbi = MarshalGeneric.GetAbi; FromAbi = MarshalGeneric.FromAbi; FromManaged = MarshalGeneric.FromManaged; CopyManaged = MarshalGeneric.CopyManaged; DisposeMarshaler = MarshalGeneric.DisposeMarshaler; DisposeAbi = MarshalGeneric.DisposeAbi; CreateMarshalerArray = MarshalGeneric.CreateMarshalerArray; GetAbiArray = MarshalGeneric.GetAbiArray; FromAbiArray = MarshalGeneric.FromAbiArray; FromManagedArray = MarshalGeneric.FromManagedArray; CopyManagedArray = (Action)(object)new Action(MarshalGenericHelper.CopyManagedArray); DisposeMarshalerArray = MarshalGeneric.DisposeMarshalerArray; DisposeAbiArray = MarshalGeneric.DisposeAbiArray; } } } internal static class Mono { private struct MonoObject { private nint vtable; private nint synchronisation; } private struct MonoThread { private MonoObject obj; public unsafe MonoInternalThread_x64* internal_thread; private nint start_obj; private nint pending_exception; } [Flags] private enum MonoThreadFlag { MONO_THREAD_FLAG_DONT_MANAGE = 1, MONO_THREAD_FLAG_NAME_SET = 2, MONO_THREAD_FLAG_APPDOMAIN_ABORT = 4 } [StructLayout(2)] private struct MonoInternalThread_x64 { [FieldOffset(208)] public MonoThreadFlag flags; } public sealed class ThreadContext : System.IDisposable { private static readonly Lazy> _foreignThreads = new Lazy>(); private readonly nint _threadPtr = System.IntPtr.Zero; public unsafe ThreadContext() { if (!_usingMono.Value) { return; } nint num = mono_thread_current(); if (mono_thread_is_foreign(num)) { if (_foreignThreads.Value.Add(num)) { mono_thread_pop_appdomain_ref(); ((MonoThread*)num)->internal_thread->flags |= MonoThreadFlag.MONO_THREAD_FLAG_DONT_MANAGE; } mono_unity_thread_fast_attach(mono_domain_get()); _threadPtr = num; } } public void Dispose() { if (_threadPtr != (nint)System.IntPtr.Zero) { mono_unity_thread_fast_detach(); } } } private static readonly Lazy _usingMono = new Lazy((Func)delegate { nint num = Platform.LoadLibraryExW("mono-2.0-bdwgc.dll", System.IntPtr.Zero, 0u); if (num == (nint)System.IntPtr.Zero) { return false; } if (!Platform.FreeLibrary(num)) { Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); } return true; }); [DllImport("mono-2.0-bdwgc.dll")] private static extern nint mono_thread_current(); [DllImport("mono-2.0-bdwgc.dll")] [return: MarshalAs(2)] private static extern bool mono_thread_is_foreign(nint threadPtr); [DllImport("mono-2.0-bdwgc.dll")] private static extern void mono_unity_thread_fast_attach(nint domainPtr); [DllImport("mono-2.0-bdwgc.dll")] private static extern void mono_unity_thread_fast_detach(); [DllImport("mono-2.0-bdwgc.dll")] private static extern void mono_thread_pop_appdomain_ref(); [DllImport("mono-2.0-bdwgc.dll")] private static extern nint mono_domain_get(); } public abstract class IObjectReference : System.IDisposable { private const int NOT_DISPOSED = 0; private const int DISPOSE_PENDING = 1; private const int DISPOSE_COMPLETED = 2; private readonly nint _thisPtr; private nint _referenceTrackerPtr; private int _disposedFlags; public nint ThisPtr { get { ThrowIfDisposed(); return GetThisPtrForCurrentContext(); } } public bool IsFreeThreaded => GetContextToken() == (nint)System.IntPtr.Zero; public bool IsInCurrentContext { get { nint contextToken = GetContextToken(); if (contextToken != (nint)System.IntPtr.Zero) { return contextToken == Context.GetContextToken(); } return true; } } private protected nint ThisPtrFromOriginalContext { get { ThrowIfDisposed(); return _thisPtr; } } [field: CompilerGenerated] internal bool IsAggregated { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] internal bool PreventReleaseOnDispose { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] internal bool PreventReleaseFromTrackerSourceOnDispose { [CompilerGenerated] get; [CompilerGenerated] set; } internal nint ReferenceTrackerPtr { get { return _referenceTrackerPtr; } set { _referenceTrackerPtr = value; if (_referenceTrackerPtr != (nint)System.IntPtr.Zero) { Marshal.AddRef((System.IntPtr)_referenceTrackerPtr); AddRefFromTrackerSource(); } } } internal unsafe IReferenceTrackerVftbl ReferenceTracker { get { ThrowIfDisposed(); return *(*(IReferenceTrackerVftbl**)ReferenceTrackerPtr); } } protected unsafe IUnknownVftbl VftblIUnknown { get { ThrowIfDisposed(); return *(*(IUnknownVftbl**)ThisPtr); } } private protected unsafe IUnknownVftbl VftblIUnknownFromOriginalContext { get { ThrowIfDisposed(); return *(*(IUnknownVftbl**)ThisPtrFromOriginalContext); } } internal bool IsReferenceToManagedObject => VftblIUnknown.Equals(IUnknownVftbl.AbiToProjectionVftbl); protected IObjectReference(nint thisPtr) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)System.IntPtr.Zero) { throw new ArgumentNullException("thisPtr"); } _thisPtr = thisPtr; if (RuntimeFeature.IsDynamicCodeCompiled) { GC.AddMemoryPressure(1000L); } } virtual ~IObjectReference() { Dispose(); } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public ObjectReference As() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return As(GuidGenerator.GetIID(typeof(T))); } public ObjectReference As(Guid iid) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Marshal.ThrowExceptionForHR(TryAs(iid, out ObjectReference objRef)); return objRef; } public TInterface AsInterface() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (CustomAttributeExtensions.IsDefined((MemberInfo)(object)typeof(TInterface), typeof(ComImportAttribute))) { Guid gUID = typeof(TInterface).GUID; nint num = default(nint); Marshal.ThrowExceptionForHR(Marshal.QueryInterface((System.IntPtr)ThisPtr, ref gUID, ref num)); try { return (TInterface)Marshal.GetObjectForIUnknown((System.IntPtr)num); } finally { Marshal.Release((System.IntPtr)num); } } if (!FeatureSwitches.EnableIDynamicInterfaceCastableSupport) { throw new NotSupportedException("Using 'AsInterface' to cast an RCW to an interface type not present in metadata relies on 'IDynamicInterfaceCastable' support, which is not currently available. Make sure the 'EnableIDynamicInterfaceCastableSupport' property is not set to 'false'."); } return (TInterface)(object)new IInspectable(this); } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public int TryAs(out ObjectReference objRef) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return TryAs(GuidGenerator.GetIID(typeof(T)), out objRef); } public int TryAs(Guid iid, out ObjectReference objRef) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (this is IObjectReferenceWithContext) { return ObjectReferenceWithContext.TryAs(this, iid, out objRef); } return ObjectReference.TryAs(this, iid, out objRef); } public virtual ObjectReference AsKnownPtr(nint ptr) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) AddRef(refFromTrackerSource: true); ObjectReference objectReference = ObjectReference.Attach(ref ptr, IID.IID_IUnknown); objectReference.IsAggregated = IsAggregated; objectReference.PreventReleaseOnDispose = IsAggregated; objectReference.ReferenceTrackerPtr = ReferenceTrackerPtr; return objectReference; } public virtual int TryAs(Guid iid, out nint ppv) { ppv = System.IntPtr.Zero; ThrowIfDisposed(); nint zero = System.IntPtr.Zero; int num = Marshal.QueryInterface((System.IntPtr)ThisPtr, ref iid, ref zero); if (num >= 0) { ppv = zero; } return num; } public IObjectReference As(Guid iid) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return As(iid); } [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public T AsType() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) ThrowIfDisposed(); WinRTImplementationTypeRcwFactoryAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)typeof(T), false); if (customAttribute != null) { return (T)customAttribute.CreateInstance(new IInspectable(this)); } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot create an RCW instance for type '{typeof(T)}', because it doesn't have a " + "[WinRTImplementationTypeRcwFactory] derived attribute on it. The fallback path for older projections is not trim-safe, and isn't supported in AOT environments. Make sure to reference updated projections."); } if (TryCreateRcwFallback(this, out var rcwInstance2)) { return (T)rcwInstance2; } throw new InvalidOperationException($"Target type '{typeof(T)}' is not a projected type."); [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2090", Justification = "This fallback path is not trim-safe by design (to avoid annotations).")] static bool TryCreateRcwFallback(IObjectReference objectReference, out object rcwInstance) { ConstructorInfo constructor = typeof(T).GetConstructor((BindingFlags)564, (Binder)null, new System.Type[1] { typeof(IObjectReference) }, (ParameterModifier[])null); if (constructor != null) { object[] array = new IObjectReference[1] { objectReference }; rcwInstance = constructor.Invoke(array); return true; } rcwInstance = null; return false; } } public nint GetRef() { ThrowIfDisposed(); AddRef(refFromTrackerSource: false); return ThisPtr; } [MethodImpl(256)] protected void ThrowIfDisposed() { if (Volatile.Read(ref _disposedFlags) == 2) { ThrowObjectDisposedException(); } [CompilerGenerated] static void ThrowObjectDisposedException() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new ObjectDisposedException("ObjectReference"); } } public void Dispose() { GC.SuppressFinalize((object)this); if (Interlocked.CompareExchange(ref _disposedFlags, 1, 0) == 0) { if (!PreventReleaseOnDispose) { Release(); } DisposeTrackerSource(); if (RuntimeFeature.IsDynamicCodeCompiled) { GC.RemoveMemoryPressure(1000L); } Volatile.Write(ref _disposedFlags, 2); } } protected virtual void AddRef(bool refFromTrackerSource) { Marshal.AddRef((System.IntPtr)ThisPtr); if (refFromTrackerSource) { AddRefFromTrackerSource(); } } protected virtual void AddRef() { AddRef(refFromTrackerSource: true); } protected virtual void Release() { ReleaseFromTrackerSource(); Marshal.Release((System.IntPtr)ThisPtr); } private protected void ReleaseWithoutContext() { ReleaseFromTrackerSource(); Marshal.Release((System.IntPtr)ThisPtrFromOriginalContext); } internal unsafe void AddRefFromTrackerSource() { if (ReferenceTrackerPtr != (nint)System.IntPtr.Zero) { ReferenceTracker.AddRefFromTrackerSource(ReferenceTrackerPtr); } } internal unsafe void ReleaseFromTrackerSource() { if (ReferenceTrackerPtr != (nint)System.IntPtr.Zero) { ReferenceTracker.ReleaseFromTrackerSource(ReferenceTrackerPtr); } } private unsafe void DisposeTrackerSource() { if (ReferenceTrackerPtr != (nint)System.IntPtr.Zero) { if (!PreventReleaseFromTrackerSourceOnDispose) { ReferenceTracker.ReleaseFromTrackerSource(ReferenceTrackerPtr); } Marshal.Release((System.IntPtr)ReferenceTrackerPtr); } } private protected virtual nint GetThisPtrForCurrentContext() { return ThisPtrFromOriginalContext; } private protected virtual nint GetContextToken() { return System.IntPtr.Zero; } public ObjectReferenceValue AsValue() { return new ObjectReferenceValue(ThisPtr, System.IntPtr.Zero, preventReleaseOnDispose: true, this); } public ObjectReferenceValue AsValue(Guid iid) { nint zero = System.IntPtr.Zero; Marshal.ThrowExceptionForHR(Marshal.QueryInterface((System.IntPtr)ThisPtr, ref iid, ref zero)); if (IsAggregated) { Marshal.Release((System.IntPtr)zero); } AddRefFromTrackerSource(); return new ObjectReferenceValue(zero, ReferenceTrackerPtr, IsAggregated, this); } } public class ObjectReference : IObjectReference { private readonly T _vftbl; public T Vftbl { get { ThrowIfDisposed(); return GetVftblForCurrentContext(); } } private protected ObjectReference(nint thisPtr, T vftblT) : base(thisPtr) { _vftbl = vftblT; } private protected ObjectReference(nint thisPtr) : this(thisPtr, GetVtable(thisPtr)) { } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public static ObjectReference Attach(ref nint thisPtr) { if (thisPtr == (nint)System.IntPtr.Zero) { return null; } if (ComWrappersSupport.IsFreeThreaded(thisPtr)) { ObjectReference result = new ObjectReference(thisPtr); thisPtr = System.IntPtr.Zero; return result; } ObjectReferenceWithContext result2 = new ObjectReferenceWithContext(thisPtr, Context.GetContextCallback(), Context.GetContextToken()); thisPtr = System.IntPtr.Zero; return result2; } public static ObjectReference Attach(ref nint thisPtr, Guid iid) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)System.IntPtr.Zero) { return null; } if (ComWrappersSupport.IsFreeThreaded(thisPtr)) { ObjectReference result = new ObjectReference(thisPtr); thisPtr = System.IntPtr.Zero; return result; } ObjectReferenceWithContext result2 = new ObjectReferenceWithContext(thisPtr, Context.GetContextCallback(), Context.GetContextToken(), iid); thisPtr = System.IntPtr.Zero; return result2; } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public static ObjectReference FromAbi(nint thisPtr, T vftblT) { if (thisPtr == (nint)System.IntPtr.Zero) { return null; } Marshal.AddRef((System.IntPtr)thisPtr); if (ComWrappersSupport.IsFreeThreaded(thisPtr)) { return new ObjectReference(thisPtr, vftblT); } return new ObjectReferenceWithContext(thisPtr, vftblT, Context.GetContextCallback(), Context.GetContextToken()); } public static ObjectReference FromAbi(nint thisPtr, T vftblT, Guid iid) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)System.IntPtr.Zero) { return null; } Marshal.AddRef((System.IntPtr)thisPtr); if (ComWrappersSupport.IsFreeThreaded(thisPtr)) { return new ObjectReference(thisPtr, vftblT); } return new ObjectReferenceWithContext(thisPtr, vftblT, Context.GetContextCallback(), Context.GetContextToken(), iid); } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] public static ObjectReference FromAbi(nint thisPtr) { if (thisPtr == (nint)System.IntPtr.Zero) { return null; } T vtable = GetVtable(thisPtr); return FromAbi(thisPtr, vtable); } public static ObjectReference FromAbi(nint thisPtr, Guid iid) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (thisPtr == (nint)System.IntPtr.Zero) { return null; } T vtable = GetVtable(thisPtr); return FromAbi(thisPtr, vtable, iid); } private unsafe static T GetVtable(nint thisPtr) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (RuntimeHelpers.IsReferenceOrContainsReferences()) { if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException("Managed vtable types (ie. containing any reference types) are not supported."); } return GetVtableForJitEnvironment(thisPtr); } return System.Runtime.CompilerServices.Unsafe.Read(*(void**)thisPtr); [MethodImpl(8)] [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2090", Justification = "Fallback method for JIT environments that is not trim-safe by design.")] static T GetVtableForJitEnvironment(nint thisPtr) { return (T)typeof(T).GetConstructor((BindingFlags)548, (Binder)null, new System.Type[1] { typeof(nint) }, (ParameterModifier[])null).Invoke(new object[1] { thisPtr }); } } private protected virtual T GetVftblForCurrentContext() { return _vftbl; } internal static int TryAs(IObjectReference sourceRef, Guid iid, out ObjectReference objRef) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) objRef = null; nint thisPtr = default(nint); int num = Marshal.QueryInterface((System.IntPtr)sourceRef.ThisPtr, ref iid, ref thisPtr); if (num >= 0) { if (sourceRef.IsAggregated) { Marshal.Release((System.IntPtr)thisPtr); } sourceRef.AddRefFromTrackerSource(); objRef = Attach(ref thisPtr, iid); objRef.IsAggregated = sourceRef.IsAggregated; objRef.PreventReleaseOnDispose = sourceRef.IsAggregated; objRef.ReferenceTrackerPtr = sourceRef.ReferenceTrackerPtr; } return num; } } internal sealed class ObjectReferenceWithContext : ObjectReference, IObjectReferenceWithContext { private static class ContextCallbackHolder { public static readonly Func Value = CreateForCurrentContext; [UnconditionalSuppressMessage("Trimming", "IL2087", Justification = "The '_iid' field is only empty when using annotated APIs not trim-safe.")] private static IObjectReference CreateForCurrentContext(nint _, IObjectReference state) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) ObjectReferenceWithContext objectReferenceWithContext = System.Runtime.CompilerServices.Unsafe.As>((object)state); AgileReference agileReference = objectReferenceWithContext.AgileReference; if (agileReference == null) { return null; } try { if (!RuntimeFeature.IsDynamicCodeCompiled) { return agileReference.Get(objectReferenceWithContext._iid); } if (objectReferenceWithContext._iid == Guid.Empty) { return agileReference.Get(GuidGenerator.GetIID(typeof(T))); } return agileReference.Get(objectReferenceWithContext._iid); } catch (System.Exception) { return null; } } } private readonly nint _contextCallbackPtr; private readonly nint _contextToken; private volatile ConcurrentDictionary __cachedContext; private volatile bool _isAgileReferenceSet; private volatile AgileReference __agileReference; private readonly Guid _iid; private ConcurrentDictionary CachedContext => __cachedContext ?? Make_CachedContext(); private AgileReference AgileReference { get { if (!_isAgileReferenceSet) { return Make_AgileReference(); } return __agileReference; } } private ConcurrentDictionary Make_CachedContext() { Interlocked.CompareExchange>(ref __cachedContext, new ConcurrentDictionary(), (ConcurrentDictionary)null); return __cachedContext; } private unsafe AgileReference Make_AgileReference() { Context.CallInContext(_contextCallbackPtr, _contextToken, (delegate*)(&InitAgileReference), (delegate*)null, (object)this); _isAgileReferenceSet = true; return __agileReference; [CompilerGenerated] static void InitAgileReference(object state) { ObjectReferenceWithContext objectReferenceWithContext = System.Runtime.CompilerServices.Unsafe.As>(state); Interlocked.CompareExchange(ref objectReferenceWithContext.__agileReference, new AgileReference(objectReferenceWithContext), (AgileReference)null); } } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] internal ObjectReferenceWithContext(nint thisPtr, nint contextCallbackPtr, nint contextToken) : base(thisPtr) { _contextCallbackPtr = contextCallbackPtr; _contextToken = contextToken; } [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This constructor is setting the '_iid' field directly.")] internal ObjectReferenceWithContext(nint thisPtr, nint contextCallbackPtr, nint contextToken, Guid iid) : this(thisPtr, contextCallbackPtr, contextToken) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (iid == default(Guid)) { ObjectReferenceWithContextHelper.ThrowArgumentExceptionForEmptyIid(); } _iid = iid; } [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] [Obsolete("This method is deprecated and will be removed in a future release.")] [EditorBrowsable(/*Could not decode attribute arguments.*/)] internal ObjectReferenceWithContext(nint thisPtr, T vftblT, nint contextCallbackPtr, nint contextToken) : base(thisPtr, vftblT) { _contextCallbackPtr = contextCallbackPtr; _contextToken = contextToken; } [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This constructor is setting the '_iid' field directly.")] internal ObjectReferenceWithContext(nint thisPtr, T vftblT, nint contextCallbackPtr, nint contextToken, Guid iid) : this(thisPtr, vftblT, contextCallbackPtr, contextToken) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (iid == default(Guid)) { ObjectReferenceWithContextHelper.ThrowArgumentExceptionForEmptyIid(); } _iid = iid; } private protected override nint GetThisPtrForCurrentContext() { return GetCurrentContext()?.ThisPtr ?? base.GetThisPtrForCurrentContext(); } private protected override nint GetContextToken() { return _contextToken; } private protected override T GetVftblForCurrentContext() { ObjectReference currentContext = GetCurrentContext(); if (currentContext == null) { return base.GetVftblForCurrentContext(); } return currentContext.Vftbl; } private ObjectReference GetCurrentContext() { nint contextToken = Context.GetContextToken(); if (_contextCallbackPtr == (nint)System.IntPtr.Zero || contextToken == _contextToken) { return null; } IObjectReference orAdd = CachedContext.GetOrAdd(contextToken, ContextCallbackHolder.Value, (IObjectReference)this); return System.Runtime.CompilerServices.Unsafe.As>((object)orAdd); } protected unsafe override void Release() { if (__cachedContext != null) { CachedContext.Clear(); } Context.CallInContext(_contextCallbackPtr, _contextToken, (delegate*)(&Release), (delegate*)(&ReleaseWithoutContext), (object)this); Context.DisposeContextCallback(_contextCallbackPtr); [CompilerGenerated] static void Release(object state) { ObjectReferenceWithContext objectReferenceWithContext2 = System.Runtime.CompilerServices.Unsafe.As>(state); objectReferenceWithContext2.ReleaseFromBase(); } [CompilerGenerated] static void ReleaseWithoutContext(object state) { ObjectReferenceWithContext objectReferenceWithContext = System.Runtime.CompilerServices.Unsafe.As>(state); objectReferenceWithContext.ReleaseWithoutContext(); } } private void ReleaseFromBase() { base.Release(); } public override ObjectReference AsKnownPtr(nint ptr) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) AddRef(refFromTrackerSource: true); return new ObjectReferenceWithContext(ptr, Context.GetContextCallback(), Context.GetContextToken(), IID.IID_IUnknown) { IsAggregated = base.IsAggregated, PreventReleaseOnDispose = base.IsAggregated, ReferenceTrackerPtr = base.ReferenceTrackerPtr }; } internal new static int TryAs(IObjectReference sourceRef, Guid iid, out ObjectReference objRef) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) objRef = null; nint num = default(nint); int num2 = Marshal.QueryInterface((System.IntPtr)sourceRef.ThisPtr, ref iid, ref num); if (num2 >= 0) { if (sourceRef.IsAggregated) { Marshal.Release((System.IntPtr)num); } sourceRef.AddRefFromTrackerSource(); objRef = new ObjectReferenceWithContext(num, Context.GetContextCallback(), Context.GetContextToken(), iid) { IsAggregated = sourceRef.IsAggregated, PreventReleaseOnDispose = sourceRef.IsAggregated, ReferenceTrackerPtr = sourceRef.ReferenceTrackerPtr }; } return num2; } } internal static class ObjectReferenceWithContextHelper { public static void ThrowArgumentExceptionForEmptyIid() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) throw new ArgumentException("The input argument 'iid' cannot be empty and must be set to a valid IID."); } } internal interface IObjectReferenceWithContext { } public readonly struct ObjectReferenceValue { internal readonly nint ptr; internal readonly nint referenceTracker; internal readonly bool preventReleaseOnDispose; internal readonly IObjectReference objRef; internal ObjectReferenceValue(nint ptr) { this = default(ObjectReferenceValue); this.ptr = ptr; } internal ObjectReferenceValue(nint ptr, nint referenceTracker, bool preventReleaseOnDispose, IObjectReference objRef) { this.ptr = ptr; this.referenceTracker = referenceTracker; this.preventReleaseOnDispose = preventReleaseOnDispose; this.objRef = objRef; } public static ObjectReferenceValue Attach(ref nint thisPtr) { ObjectReferenceValue result = new ObjectReferenceValue(thisPtr); thisPtr = System.IntPtr.Zero; return result; } public nint GetAbi() { return ptr; } public unsafe nint Detach() { if (preventReleaseOnDispose && ptr != (nint)System.IntPtr.Zero) { Marshal.AddRef((System.IntPtr)ptr); } if (referenceTracker != (nint)System.IntPtr.Zero) { ((IReferenceTrackerVftbl*)(*(nint*)referenceTracker))->ReleaseFromTrackerSource(referenceTracker); } return ptr; } public unsafe void Dispose() { if (referenceTracker != (nint)System.IntPtr.Zero) { ((IReferenceTrackerVftbl*)(*(nint*)referenceTracker))->ReleaseFromTrackerSource(referenceTracker); } if (!preventReleaseOnDispose && ptr != (nint)System.IntPtr.Zero) { Marshal.Release((System.IntPtr)ptr); } } } internal sealed class HelperTypeMetadataNotAvailableOnAot { } public static class Projections { private static readonly ReaderWriterLockSlim rwlock; private static readonly Dictionary CustomTypeToHelperTypeMappings; private static readonly Dictionary CustomAbiTypeToTypeMappings; private static readonly Dictionary CustomAbiTypeNameToTypeMappings; private static readonly Dictionary CustomTypeToAbiTypeNameMappings; private static readonly HashSet ProjectedRuntimeClassNames; private static readonly HashSet ProjectedCustomTypeRuntimeClasses; private static readonly ConcurrentDictionary IsTypeWindowsRuntimeTypeCache; private static readonly ConcurrentDictionary DefaultInterfaceTypeCache; private static int _EventHandler; private static int _NotifyCollectionChangedEventHandler; private static int _PropertyChangedEventHandler; private static ComInterfaceEntry[]? _AbiEventHandlerExposedInterfaces; private static ComInterfaceEntry[]? _AbiNotifyCollectionChangedEventHandlerExposedInterfaces; private static ComInterfaceEntry[]? _AbiPropertyChangedEventHandlerExposedInterfaces; private static int _EventRegistrationToken; private static int _Nullable__; private static int _int_; private static int _byte_; private static int _sbyte_; private static int _short_; private static int _ushort_; private static int _uint_; private static int _long_; private static int _ulong_; private static int _float_; private static int _double_; private static int _char_; private static int _bool_; private static int _Guid_; private static int _DateTimeOffset_; private static int _TimeSpan_; private static int _DateTimeOffset; private static int _Exception; private static int _TimeSpan; private static int _Uri; private static int _DataErrorsChangedEventArgs; private static int _PropertyChangedEventArgs; private static int _INotifyDataErrorInfo; private static int _INotifyPropertyChanged; private static int _ICommand; private static int _IServiceProvider; private static int _EventHandler__; private static int _KeyValuePair___; private static int _IEnumerable__; private static int _IEnumerator__; private static int _IList__; private static int _IReadOnlyList__; private static int _IDictionary___; private static int _IReadOnlyDictionary___; private static int _IDisposable; private static int _IEnumerable; private static int _IList; private static int _INotifyCollectionChanged; private static int _NotifyCollectionChangedAction; private static int _NotifyCollectionChangedEventArgs; private static int _Matrix3x2; private static int _Matrix4x4; private static int _Plane; private static int _Quaternion; private static int _Vector2; private static int _Vector3; private static int _Vector4; private static int _IMap___; private static int _IVector__; private static int _IMapView___; private static int _IVectorView__; private static int _IBindableVector; private static int _ICollection__; private static int _IReadOnlyCollection__; private static int _ICollection; static Projections() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown rwlock = new ReaderWriterLockSlim(); CustomTypeToHelperTypeMappings = new Dictionary(); CustomAbiTypeToTypeMappings = new Dictionary(); CustomAbiTypeNameToTypeMappings = new Dictionary((IEqualityComparer)(object)StringComparer.Ordinal); CustomTypeToAbiTypeNameMappings = new Dictionary(); ProjectedRuntimeClassNames = new HashSet((IEqualityComparer)(object)StringComparer.Ordinal); ProjectedCustomTypeRuntimeClasses = new HashSet(); IsTypeWindowsRuntimeTypeCache = new ConcurrentDictionary(); DefaultInterfaceTypeCache = new ConcurrentDictionary(); RegisterCustomAbiTypeMappingNoLock(typeof(bool), typeof(Boolean), "Boolean"); RegisterCustomAbiTypeMappingNoLock(typeof(char), typeof(Char), "Char"); CustomTypeToAbiTypeNameMappings.Add(typeof(System.Type), "Windows.UI.Xaml.Interop.TypeName"); CustomAbiTypeNameToTypeMappings.Add("Windows.UI.Xaml.Interop.TypeName", typeof(System.Type)); if (FeatureSwitches.EnableDefaultCustomTypeMappings) { RegisterCustomAbiTypeMappingNoLock(typeof(EventRegistrationToken), typeof(ABI.WinRT.EventRegistrationToken), "Windows.Foundation.EventRegistrationToken"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Nullable<>), typeof(Nullable<>), "Windows.Foundation.IReference`1"); RegisterCustomAbiTypeMappingNoLock(typeof(DateTimeOffset), typeof(DateTimeOffset), "Windows.Foundation.DateTime"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Exception), typeof(Exception), "Windows.Foundation.HResult"); RegisterCustomAbiTypeMappingNoLock(typeof(TimeSpan), typeof(TimeSpan), "Windows.Foundation.TimeSpan"); RegisterCustomAbiTypeMappingNoLock(typeof(Uri), typeof(Uri), "Windows.Foundation.Uri", isRuntimeClass: true); if (!FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMappingNoLock(typeof(DataErrorsChangedEventArgs), typeof(DataErrorsChangedEventArgs), "Microsoft.UI.Xaml.Data.DataErrorsChangedEventArgs", isRuntimeClass: true); RegisterCustomAbiTypeMappingNoLock(typeof(PropertyChangedEventArgs), typeof(PropertyChangedEventArgs), "Microsoft.UI.Xaml.Data.PropertyChangedEventArgs", isRuntimeClass: true); RegisterCustomAbiTypeMappingNoLock(typeof(PropertyChangedEventHandler), typeof(PropertyChangedEventHandler), "Microsoft.UI.Xaml.Data.PropertyChangedEventHandler"); RegisterCustomAbiTypeMappingNoLock(typeof(INotifyDataErrorInfo), typeof(INotifyDataErrorInfo), "Microsoft.UI.Xaml.Data.INotifyDataErrorInfo"); RegisterCustomAbiTypeMappingNoLock(typeof(INotifyPropertyChanged), typeof(INotifyPropertyChanged), "Microsoft.UI.Xaml.Data.INotifyPropertyChanged"); RegisterCustomAbiTypeMappingNoLock(typeof(ICommand), typeof(ICommand), "Microsoft.UI.Xaml.Input.ICommand"); RegisterCustomAbiTypeMappingNoLock(typeof(IServiceProvider), typeof(IServiceProvider), "Microsoft.UI.Xaml.IXamlServiceProvider"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Collections.IEnumerable), typeof(IEnumerable), "Microsoft.UI.Xaml.Interop.IBindableIterable"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Collections.IList), typeof(IList), "Microsoft.UI.Xaml.Interop.IBindableVector"); RegisterCustomAbiTypeMappingNoLock(typeof(INotifyCollectionChanged), typeof(INotifyCollectionChanged), "Microsoft.UI.Xaml.Interop.INotifyCollectionChanged"); RegisterCustomAbiTypeMappingNoLock(typeof(NotifyCollectionChangedAction), typeof(NotifyCollectionChangedAction), "Microsoft.UI.Xaml.Interop.NotifyCollectionChangedAction"); RegisterCustomAbiTypeMappingNoLock(typeof(NotifyCollectionChangedEventArgs), typeof(NotifyCollectionChangedEventArgs), "Microsoft.UI.Xaml.Interop.NotifyCollectionChangedEventArgs", isRuntimeClass: true); RegisterCustomAbiTypeMappingNoLock(typeof(NotifyCollectionChangedEventHandler), typeof(NotifyCollectionChangedEventHandler), "Microsoft.UI.Xaml.Interop.NotifyCollectionChangedEventHandler"); } else { RegisterCustomAbiTypeMappingNoLock(typeof(PropertyChangedEventArgs), typeof(PropertyChangedEventArgs), "Windows.UI.Xaml.Data.PropertyChangedEventArgs", isRuntimeClass: true); RegisterCustomAbiTypeMappingNoLock(typeof(PropertyChangedEventHandler), typeof(PropertyChangedEventHandler), "Windows.UI.Xaml.Data.PropertyChangedEventHandler"); RegisterCustomAbiTypeMappingNoLock(typeof(INotifyPropertyChanged), typeof(INotifyPropertyChanged), "Windows.UI.Xaml.Data.INotifyPropertyChanged"); RegisterCustomAbiTypeMappingNoLock(typeof(ICommand), typeof(ICommand), "Windows.UI.Xaml.Interop.ICommand"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Collections.IEnumerable), typeof(IEnumerable), "Windows.UI.Xaml.Interop.IBindableIterable"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Collections.IList), typeof(IList), "Windows.UI.Xaml.Interop.IBindableVector"); RegisterCustomAbiTypeMappingNoLock(typeof(INotifyCollectionChanged), typeof(INotifyCollectionChanged), "Windows.UI.Xaml.Interop.INotifyCollectionChanged"); RegisterCustomAbiTypeMappingNoLock(typeof(NotifyCollectionChangedAction), typeof(NotifyCollectionChangedAction), "Windows.UI.Xaml.Interop.NotifyCollectionChangedAction"); RegisterCustomAbiTypeMappingNoLock(typeof(NotifyCollectionChangedEventArgs), typeof(NotifyCollectionChangedEventArgs), "Windows.UI.Xaml.Interop.NotifyCollectionChangedEventArgs", isRuntimeClass: true); RegisterCustomAbiTypeMappingNoLock(typeof(NotifyCollectionChangedEventHandler), typeof(NotifyCollectionChangedEventHandler), "Windows.UI.Xaml.Interop.NotifyCollectionChangedEventHandler"); } RegisterCustomAbiTypeMappingNoLock(typeof(EventHandler<>), typeof(EventHandler<>), "Windows.Foundation.EventHandler`1"); RegisterCustomAbiTypeMappingNoLock(typeof(KeyValuePair<, >), typeof(KeyValuePair<, >), "Windows.Foundation.Collections.IKeyValuePair`2"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Collections.Generic.IEnumerable<>), typeof(IEnumerable<>), "Windows.Foundation.Collections.IIterable`1"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Collections.Generic.IEnumerator<>), typeof(IEnumerator<>), "Windows.Foundation.Collections.IIterator`1"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Collections.Generic.IList<>), typeof(IList<>), "Windows.Foundation.Collections.IVector`1"); RegisterCustomAbiTypeMappingNoLock(typeof(System.Collections.Generic.IReadOnlyList<>), typeof(IReadOnlyList<>), "Windows.Foundation.Collections.IVectorView`1"); RegisterCustomAbiTypeMappingNoLock(typeof(IDictionary<, >), typeof(IDictionary<, >), "Windows.Foundation.Collections.IMap`2"); RegisterCustomAbiTypeMappingNoLock(typeof(IReadOnlyDictionary<, >), typeof(IReadOnlyDictionary<, >), "Windows.Foundation.Collections.IMapView`2"); RegisterCustomAbiTypeMappingNoLock(typeof(System.IDisposable), typeof(IDisposable), "Windows.Foundation.IClosable"); RegisterCustomAbiTypeMappingNoLock(typeof(Matrix3x2), typeof(Matrix3x2), "Windows.Foundation.Numerics.Matrix3x2"); RegisterCustomAbiTypeMappingNoLock(typeof(Matrix4x4), typeof(Matrix4x4), "Windows.Foundation.Numerics.Matrix4x4"); RegisterCustomAbiTypeMappingNoLock(typeof(Plane), typeof(Plane), "Windows.Foundation.Numerics.Plane"); RegisterCustomAbiTypeMappingNoLock(typeof(Quaternion), typeof(Quaternion), "Windows.Foundation.Numerics.Quaternion"); RegisterCustomAbiTypeMappingNoLock(typeof(Vector2), typeof(Vector2), "Windows.Foundation.Numerics.Vector2"); RegisterCustomAbiTypeMappingNoLock(typeof(Vector3), typeof(Vector3), "Windows.Foundation.Numerics.Vector3"); RegisterCustomAbiTypeMappingNoLock(typeof(Vector4), typeof(Vector4), "Windows.Foundation.Numerics.Vector4"); RegisterCustomAbiTypeMappingNoLock(typeof(EventHandler), typeof(EventHandler)); RegisterCustomTypeToHelperTypeMappingNoLock(typeof(IMap<, >), typeof(IDictionary<, >)); RegisterCustomTypeToHelperTypeMappingNoLock(typeof(IVector<>), typeof(IList<>)); RegisterCustomTypeToHelperTypeMappingNoLock(typeof(IMapView<, >), typeof(IReadOnlyDictionary<, >)); RegisterCustomTypeToHelperTypeMappingNoLock(typeof(IVectorView<>), typeof(IReadOnlyList<>)); RegisterCustomTypeToHelperTypeMappingNoLock(typeof(IBindableVector), typeof(IList)); RegisterCustomTypeToHelperTypeMappingNoLock(typeof(System.Collections.Generic.ICollection<>), typeof(ICollection<>)); RegisterCustomTypeToHelperTypeMappingNoLock(typeof(System.Collections.Generic.IReadOnlyCollection<>), typeof(IReadOnlyCollection<>)); RegisterCustomTypeToHelperTypeMappingNoLock(typeof(System.Collections.ICollection), typeof(ICollection)); } } private static void RegisterCustomAbiTypeMapping(System.Type publicType, [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type abiType, string winrtTypeName, bool isRuntimeClass = false) { rwlock.EnterWriteLock(); try { RegisterCustomAbiTypeMappingNoLock(publicType, abiType, winrtTypeName, isRuntimeClass); } finally { rwlock.ExitWriteLock(); } } private static void RegisterCustomTypeToHelperTypeMapping(System.Type publicType, [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type helperType) { rwlock.EnterWriteLock(); try { CustomTypeToHelperTypeMappings.Add(publicType, helperType); } finally { rwlock.ExitWriteLock(); } } private static void RegisterCustomTypeToHelperTypeMappingNoLock(System.Type publicType, [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type helperType) { CustomTypeToHelperTypeMappings.Add(publicType, helperType); } private static void RegisterCustomAbiTypeMappingNoLock(System.Type publicType, [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type abiType, string winrtTypeName, bool isRuntimeClass = false) { CustomTypeToHelperTypeMappings.Add(publicType, abiType); CustomAbiTypeToTypeMappings.Add(abiType, publicType); CustomTypeToAbiTypeNameMappings.Add(publicType, winrtTypeName); CustomAbiTypeNameToTypeMappings.Add(winrtTypeName, publicType); if (isRuntimeClass) { ProjectedRuntimeClassNames.Add(winrtTypeName); ProjectedCustomTypeRuntimeClasses.Add(publicType); } } private static void RegisterCustomAbiTypeMapping(System.Type publicType, [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type abiType) { rwlock.EnterWriteLock(); try { RegisterCustomAbiTypeMappingNoLock(publicType, abiType); } finally { rwlock.ExitWriteLock(); } } private static void RegisterCustomAbiTypeMappingNoLock(System.Type publicType, [DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] System.Type abiType) { CustomTypeToHelperTypeMappings.Add(publicType, abiType); CustomAbiTypeToTypeMappings.Add(abiType, publicType); } [UnconditionalSuppressMessage("Trimming", "IL2055", Justification = "The type arguments are guaranteed to be valid for the generic ABI types.")] [UnconditionalSuppressMessage("Trimming", "IL2068", Justification = "All types added to 'CustomTypeToHelperTypeMappings' have metadata explicitly preserved.")] [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] public static System.Type FindCustomHelperTypeMapping(System.Type publicType, bool filterToRuntimeClass = false) { return FindCustomHelperTypeMapping(publicType, filterToRuntimeClass, returnMarkerTypeIfNotAotCompatible: false); } [UnconditionalSuppressMessage("Trimming", "IL2055", Justification = "The type arguments are guaranteed to be valid for the generic ABI types.")] [UnconditionalSuppressMessage("Trimming", "IL2068", Justification = "All types added to 'CustomTypeToHelperTypeMappings' have metadata explicitly preserved.")] [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] internal static System.Type FindCustomHelperTypeMapping(System.Type publicType, bool filterToRuntimeClass, bool returnMarkerTypeIfNotAotCompatible) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) rwlock.EnterReadLock(); try { if (filterToRuntimeClass && !ProjectedCustomTypeRuntimeClasses.Contains(publicType)) { return null; } if (publicType.IsGenericType && !publicType.IsGenericTypeDefinition) { System.Type result = default(System.Type); if (CustomTypeToHelperTypeMappings.TryGetValue(publicType, ref result)) { return result; } System.Type type = default(System.Type); if (CustomTypeToHelperTypeMappings.TryGetValue(publicType.GetGenericTypeDefinition(), ref type)) { if (!RuntimeFeature.IsDynamicCodeCompiled) { if (!returnMarkerTypeIfNotAotCompatible) { throw new NotSupportedException($"Cannot retrieve a helper type for public type '{publicType}'."); } return typeof(HelperTypeMetadataNotAvailableOnAot); } return type.MakeGenericType(publicType.GetGenericArguments()); } return null; } System.Type type2 = default(System.Type); return CustomTypeToHelperTypeMappings.TryGetValue(publicType, ref type2) ? type2 : null; } finally { rwlock.ExitReadLock(); } } [UnconditionalSuppressMessage("Trimming", "IL2055", Justification = "The type arguments are guaranteed to be valid for the generic ABI types.")] public static System.Type FindCustomPublicTypeForAbiType(System.Type abiType) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) rwlock.EnterReadLock(); try { if (abiType.IsGenericType) { System.Type result = default(System.Type); if (CustomAbiTypeToTypeMappings.TryGetValue(abiType, ref result)) { return result; } System.Type type = default(System.Type); if (CustomAbiTypeToTypeMappings.TryGetValue(abiType.GetGenericTypeDefinition(), ref type)) { if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot retrieve a public type for ABI type '{abiType}'."); } return type.MakeGenericType(abiType.GetGenericArguments()); } return null; } System.Type type2 = default(System.Type); return CustomAbiTypeToTypeMappings.TryGetValue(abiType, ref type2) ? type2 : null; } finally { rwlock.ExitReadLock(); } } public static System.Type FindCustomTypeForAbiTypeName(string abiTypeName) { rwlock.EnterReadLock(); try { System.Type type = default(System.Type); return CustomAbiTypeNameToTypeMappings.TryGetValue(abiTypeName, ref type) ? type : null; } finally { rwlock.ExitReadLock(); } } public static string FindCustomAbiTypeNameForType(System.Type type) { rwlock.EnterReadLock(); try { string text = default(string); return CustomTypeToAbiTypeNameMappings.TryGetValue(type, ref text) ? text : null; } finally { rwlock.ExitReadLock(); } } public static bool IsTypeWindowsRuntimeType(System.Type type) { return IsTypeWindowsRuntimeTypeCache.GetOrAdd(type, (Func)delegate(System.Type type) { System.Type type2 = type; if (type2.IsArray) { type2 = type2.GetElementType(); } return IsTypeWindowsRuntimeTypeNoArray(type2); }); } private static bool IsTypeWindowsRuntimeTypeNoArray(System.Type type) { if (type.IsConstructedGenericType) { if (IsTypeWindowsRuntimeTypeNoArray(type.GetGenericTypeDefinition())) { System.Type[] genericArguments = type.GetGenericArguments(); foreach (System.Type type2 in genericArguments) { if (!IsTypeWindowsRuntimeTypeNoArray(type2)) { return false; } } return true; } return false; } if (!CustomTypeToAbiTypeNameMappings.ContainsKey(type) && !type.IsPrimitive && !(type == typeof(string)) && !(type == typeof(Guid)) && !(type == typeof(object)) && !CustomAttributeExtensions.IsDefined((MemberInfo)(object)type, typeof(WindowsRuntimeTypeAttribute))) { return type.GetAuthoringMetadataType() != (System.Type)null; } return true; } [UnconditionalSuppressMessage("Trimming", "IL2055", Justification = "Calls to 'MakeGenericType' are always done with compatible types.")] public static bool TryGetCompatibleWindowsRuntimeTypeForVariantType(System.Type type, out System.Type compatibleType) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Invalid comparison between Unknown and I4 compatibleType = null; if (!type.IsConstructedGenericType) { throw new ArgumentException("type"); } System.Type genericTypeDefinition = type.GetGenericTypeDefinition(); if (!IsTypeWindowsRuntimeTypeNoArray(genericTypeDefinition)) { return false; } if (!RuntimeFeature.IsDynamicCodeCompiled) { throw new NotSupportedException($"Cannot retrieve a compatible WinRT type for variant type '{type}'."); } System.Type[] genericArguments = genericTypeDefinition.GetGenericArguments(); System.Type[] genericArguments2 = type.GetGenericArguments(); System.Type[] array = new System.Type[genericArguments2.Length]; for (int i = 0; i < genericArguments2.Length; i++) { if (!IsTypeWindowsRuntimeTypeNoArray(genericArguments2[i])) { if ((genericArguments[i].GenericParameterAttributes & 3) != 1 || genericArguments2[i].IsValueType) { return false; } array[i] = typeof(object); } else { array[i] = genericArguments2[i]; } } compatibleType = genericTypeDefinition.MakeGenericType(array); return true; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] private static HashSet GetCompatibleTypes(System.Type type, Stack typeStack) { HashSet val = new HashSet(); System.Type[] interfaces = type.GetInterfaces(); foreach (System.Type type2 in interfaces) { if (IsTypeWindowsRuntimeTypeNoArray(type2)) { val.Add(type2); } if (type2.IsConstructedGenericType && TryGetCompatibleWindowsRuntimeTypesForVariantType(type2, typeStack, out var compatibleTypes)) { val.UnionWith(compatibleTypes); } } System.Type baseType = type.BaseType; while (baseType != (System.Type)null) { if (IsTypeWindowsRuntimeTypeNoArray(baseType)) { val.Add(baseType); } baseType = baseType.BaseType; } return val; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal static System.Collections.Generic.IEnumerable GetAllPossibleTypeCombinations(System.Collections.Generic.IEnumerable> compatibleTypesPerGeneric, System.Type definition) { List val = new List(); System.Collections.Generic.IEnumerable[] array = Enumerable.ToArray>(compatibleTypesPerGeneric); if (array.Length != 0) { GetAllPossibleTypeCombinationsCore(val, new Stack(), array, array.Length - 1); } return (System.Collections.Generic.IEnumerable)val; [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "No members of the generic type are dynamically accessed other than for the attributes on it.")] [UnconditionalSuppressMessage("Trimming", "IL2055", Justification = "Calls to 'MakeGenericType' are always done with compatible types.")] void GetAllPossibleTypeCombinationsCore(List accum, Stack stack, System.Collections.Generic.IEnumerable[] compatibleTypes, int index) { System.Collections.Generic.IEnumerator enumerator = compatibleTypes[index].GetEnumerator(); try { while (((System.Collections.IEnumerator)enumerator).MoveNext()) { System.Type current = enumerator.Current; stack.Push(current); if (index == 0) { accum.Add(definition.MakeGenericType(stack.ToArray())); } else { GetAllPossibleTypeCombinationsCore(accum, stack, compatibleTypes, index - 1); } stack.Pop(); } } finally { ((System.IDisposable)enumerator)?.Dispose(); } } } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] internal static bool TryGetCompatibleWindowsRuntimeTypesForVariantType(System.Type type, Stack typeStack, out System.Collections.Generic.IEnumerable compatibleTypes) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 compatibleTypes = null; if (!type.IsConstructedGenericType) { throw new ArgumentException("type"); } System.Type genericTypeDefinition = type.GetGenericTypeDefinition(); if (!IsTypeWindowsRuntimeTypeNoArray(genericTypeDefinition)) { return false; } if (typeStack == null) { typeStack = new Stack(); } else if (typeStack.Contains(type)) { return false; } typeStack.Push(type); System.Type[] genericArguments = genericTypeDefinition.GetGenericArguments(); System.Type[] genericArguments2 = type.GetGenericArguments(); List> val = new List>(); for (int i = 0; i < genericArguments2.Length; i++) { List val2 = new List(); bool flag = (genericArguments[i].GenericParameterAttributes & 3) == 1 && !genericArguments2[i].IsValueType; if (IsTypeWindowsRuntimeTypeNoArray(genericArguments2[i])) { val2.Add(genericArguments2[i]); } else if (!flag) { typeStack.Pop(); return false; } if (flag) { val2.AddRange((System.Collections.Generic.IEnumerable)GetCompatibleTypes(genericArguments2[i], typeStack)); } val.Add(val2); } typeStack.Pop(); compatibleTypes = GetAllPossibleTypeCombinations((System.Collections.Generic.IEnumerable>)val, genericTypeDefinition); return true; } [UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "The path using reflection to retrieve the default interface property is only used with legacy projections. Applications which make use of trimming will make use of updated projections and won't hit that code path.")] internal static bool TryGetDefaultInterfaceTypeForRuntimeClassType(System.Type runtimeClass, out System.Type defaultInterface) { defaultInterface = DefaultInterfaceTypeCache.GetOrAdd(runtimeClass, (Func)delegate(System.Type runtimeClass) { runtimeClass = runtimeClass.GetRuntimeClassCCWType() ?? runtimeClass; ProjectedRuntimeClassAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)runtimeClass); if (customAttribute == null) { return null; } if (!RuntimeFeature.IsDynamicCodeCompiled) { return customAttribute.DefaultInterface; } if (customAttribute.DefaultInterface != (System.Type)null) { return customAttribute.DefaultInterface; } return (customAttribute.DefaultInterfaceProperty != null) ? runtimeClass.GetProperty(customAttribute.DefaultInterfaceProperty, (BindingFlags)54).PropertyType : null; }); return defaultInterface != (System.Type)null; } internal static System.Type GetDefaultInterfaceTypeForRuntimeClassType(System.Type runtimeClass) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!TryGetDefaultInterfaceTypeForRuntimeClassType(runtimeClass, out var defaultInterface)) { throw new ArgumentException("The provided type '" + runtimeClass.FullName + "' is not a WinRT projected runtime class.", "runtimeClass"); } return defaultInterface; } [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal static System.Type GetAbiDelegateType(params System.Type[] typeArgs) { return Expression.GetDelegateType(typeArgs); } public static void RegisterEventHandlerMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _EventHandler, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(EventHandler), typeof(EventHandler)); _AbiEventHandlerExposedInterfaces = EventHandler.GetExposedInterfaces(); } } internal static ComInterfaceEntry[] GetAbiEventHandlerExposedInterfaces() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (FeatureSwitches.EnableDefaultCustomTypeMappings) { return EventHandler.GetExposedInterfaces(); } ComInterfaceEntry[] abiEventHandlerExposedInterfaces = _AbiEventHandlerExposedInterfaces; if (abiEventHandlerExposedInterfaces == null) { throw new NotSupportedException("Support for type mapping for the 'EventHandler' type is currently disabled. To enable it, either make sure to not set the 'CsWinRTEnableCustomTypeMappings' property to 'false', or manually enable support for this specific type by calling 'Projections.RegisterEventHandlerMapping()'."); } return abiEventHandlerExposedInterfaces; } public static void RegisterNotifyCollectionChangedEventHandlerMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _NotifyCollectionChangedEventHandler, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(NotifyCollectionChangedEventHandler), typeof(NotifyCollectionChangedEventHandler), "Windows.UI.Xaml.Interop.NotifyCollectionChangedEventHandler"); } else { RegisterCustomAbiTypeMapping(typeof(NotifyCollectionChangedEventHandler), typeof(NotifyCollectionChangedEventHandler), "Microsoft.UI.Xaml.Interop.NotifyCollectionChangedEventHandler"); } _AbiNotifyCollectionChangedEventHandlerExposedInterfaces = NotifyCollectionChangedEventHandler.GetExposedInterfaces(); } } internal static ComInterfaceEntry[] GetAbiNotifyCollectionChangedEventHandlerExposedInterfaces() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (FeatureSwitches.EnableDefaultCustomTypeMappings) { return NotifyCollectionChangedEventHandler.GetExposedInterfaces(); } ComInterfaceEntry[] abiNotifyCollectionChangedEventHandlerExposedInterfaces = _AbiNotifyCollectionChangedEventHandlerExposedInterfaces; if (abiNotifyCollectionChangedEventHandlerExposedInterfaces == null) { throw new NotSupportedException("Support for type mapping for the 'NotifyCollectionChangedEventHandler' type is currently disabled. To enable it, either make sure to not set the 'CsWinRTEnableCustomTypeMappings' property to 'false', or manually enable support for this specific type by calling 'Projections.RegisterNotifyCollectionChangedEventHandlerMapping()'."); } return abiNotifyCollectionChangedEventHandlerExposedInterfaces; } public static void RegisterPropertyChangedEventHandlerMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _PropertyChangedEventHandler, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(PropertyChangedEventHandler), typeof(PropertyChangedEventHandler), "Windows.UI.Xaml.Data.PropertyChangedEventHandler"); } else { RegisterCustomAbiTypeMapping(typeof(PropertyChangedEventHandler), typeof(PropertyChangedEventHandler), "Microsoft.UI.Xaml.Data.PropertyChangedEventHandler"); } _AbiPropertyChangedEventHandlerExposedInterfaces = PropertyChangedEventHandler.GetExposedInterfaces(); } } internal static ComInterfaceEntry[] GetAbiPropertyChangedEventHandlerExposedInterfaces() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (FeatureSwitches.EnableDefaultCustomTypeMappings) { return PropertyChangedEventHandler.GetExposedInterfaces(); } ComInterfaceEntry[] abiPropertyChangedEventHandlerExposedInterfaces = _AbiPropertyChangedEventHandlerExposedInterfaces; if (abiPropertyChangedEventHandlerExposedInterfaces == null) { throw new NotSupportedException("Support for type mapping for the 'PropertyChangedEventHandler' type is currently disabled. To enable it, either make sure to not set the 'CsWinRTEnableCustomTypeMappings' property to 'false', or manually enable support for this specific type by calling 'Projections.RegisterPropertyChangedEventHandlerMapping()'."); } return abiPropertyChangedEventHandlerExposedInterfaces; } public static void RegisterEventRegistrationTokenMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _EventRegistrationToken, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(EventRegistrationToken), typeof(ABI.WinRT.EventRegistrationToken), "Windows.Foundation.EventRegistrationToken"); } } public static void RegisterNullableOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Nullable__, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(System.Nullable<>), typeof(Nullable<>), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableIntMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _int_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(int?), typeof(Nullable_int), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableByteMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _byte_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(byte?), typeof(Nullable_byte), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableSByteMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _sbyte_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(sbyte?), typeof(Nullable_sbyte), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableShortMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _short_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(short?), typeof(Nullable_short), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableUShortMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _ushort_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(ushort?), typeof(Nullable_ushort), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableUIntMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _uint_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(uint?), typeof(Nullable_uint), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableLongMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _long_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(long?), typeof(Nullable_long), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableULongMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _ulong_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(ulong?), typeof(Nullable_ulong), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableFloatMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _float_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(float?), typeof(Nullable_float), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableDoubleMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _double_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(double?), typeof(Nullable_double), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableCharMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _char_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(char?), typeof(Nullable_char), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableBoolMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _bool_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(bool?), typeof(Nullable_bool), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableGuidMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Guid_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Guid?), typeof(Nullable_guid), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableDateTimeOffsetMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _DateTimeOffset_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(DateTimeOffset?), typeof(Nullable_DateTimeOffset), "Windows.Foundation.IReference`1"); } } public static void RegisterNullableTimeSpanMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _TimeSpan_, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(TimeSpan?), typeof(Nullable_TimeSpan), "Windows.Foundation.IReference`1"); } } public static void RegisterDateTimeOffsetMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _DateTimeOffset, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(DateTimeOffset), typeof(DateTimeOffset), "Windows.Foundation.DateTime"); } } public static void RegisterExceptionMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Exception, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(System.Exception), typeof(Exception), "Windows.Foundation.HResult"); } } public static void RegisterTimeSpanMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _TimeSpan, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(TimeSpan), typeof(TimeSpan), "Windows.Foundation.TimeSpan"); } } public static void RegisterUriMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Uri, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Uri), typeof(Uri), "Windows.Foundation.Uri", isRuntimeClass: true); } } public static void RegisterDataErrorsChangedEventArgsMapping() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableDefaultCustomTypeMappings) { if (FeatureSwitches.UseWindowsUIXamlProjections) { throw new NotSupportedException("The 'DataErrorsChangedEventArgs' type is only supported for WinUI, and not when using System XAML projections (make sure the 'CsWinRTUseWindowsUIXamlProjections' property is not set to 'true')."); } if (Interlocked.CompareExchange(ref _DataErrorsChangedEventArgs, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(DataErrorsChangedEventArgs), typeof(DataErrorsChangedEventArgs), "Microsoft.UI.Xaml.Data.DataErrorsChangedEventArgs", isRuntimeClass: true); } } } public static void RegisterPropertyChangedEventArgsMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _PropertyChangedEventArgs, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(PropertyChangedEventArgs), typeof(PropertyChangedEventArgs), "Windows.UI.Xaml.Data.PropertyChangedEventArgs", isRuntimeClass: true); } else { RegisterCustomAbiTypeMapping(typeof(PropertyChangedEventArgs), typeof(PropertyChangedEventArgs), "Microsoft.UI.Xaml.Data.PropertyChangedEventArgs", isRuntimeClass: true); } } } public static void RegisterINotifyDataErrorInfoMapping() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableDefaultCustomTypeMappings) { if (FeatureSwitches.UseWindowsUIXamlProjections) { throw new NotSupportedException("The 'INotifyDataErrorInfo' type is only supported for WinUI, and not when using System XAML projections (make sure the 'CsWinRTUseWindowsUIXamlProjections' property is not set to 'true')."); } if (Interlocked.CompareExchange(ref _INotifyDataErrorInfo, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(INotifyDataErrorInfo), typeof(INotifyDataErrorInfo), "Microsoft.UI.Xaml.Data.INotifyDataErrorInfo"); } } } public static void RegisterINotifyPropertyChangedMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _INotifyPropertyChanged, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(INotifyPropertyChanged), typeof(INotifyPropertyChanged), "Windows.UI.Xaml.Data.INotifyPropertyChanged"); } else { RegisterCustomAbiTypeMapping(typeof(INotifyPropertyChanged), typeof(INotifyPropertyChanged), "Microsoft.UI.Xaml.Data.INotifyPropertyChanged"); } } } public static void RegisterICommandMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _ICommand, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(ICommand), typeof(ICommand), "Windows.UI.Xaml.Interop.ICommand"); } else { RegisterCustomAbiTypeMapping(typeof(ICommand), typeof(ICommand), "Microsoft.UI.Xaml.Interop.ICommand"); } } } public static void RegisterIServiceProviderMapping() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!FeatureSwitches.EnableDefaultCustomTypeMappings) { if (FeatureSwitches.UseWindowsUIXamlProjections) { throw new NotSupportedException("The 'IServiceProvider' type is only supported for WinUI, and not when using System XAML projections (make sure the 'CsWinRTUseWindowsUIXamlProjections' property is not set to 'true')."); } if (Interlocked.CompareExchange(ref _IServiceProvider, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(IServiceProvider), typeof(IServiceProvider), "Microsoft.UI.Xaml.IXamlServiceProvider"); } } } public static void RegisterEventHandlerOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _EventHandler__, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(EventHandler<>), typeof(EventHandler<>), "Windows.Foundation.EventHandler`1"); } } public static void RegisterKeyValuePairOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _KeyValuePair___, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(KeyValuePair<, >), typeof(KeyValuePair<, >), "Windows.Foundation.Collections.IKeyValuePair`2"); } } public static void RegisterIEnumerableOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IEnumerable__, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(System.Collections.Generic.IEnumerable<>), typeof(IEnumerable<>), "Windows.Foundation.Collections.IIterable`1"); } } public static void RegisterIEnumeratorOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IEnumerator__, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(System.Collections.Generic.IEnumerator<>), typeof(IEnumerator<>), "Windows.Foundation.Collections.IIterator`1"); } } public static void RegisterIListOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IList__, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(System.Collections.Generic.IList<>), typeof(IList<>), "Windows.Foundation.Collections.IVector`1"); } } public static void RegisterIReadOnlyListOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IReadOnlyList__, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(System.Collections.Generic.IReadOnlyList<>), typeof(IReadOnlyList<>), "Windows.Foundation.Collections.IVectorView`1"); } } public static void RegisterIDictionaryOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IDictionary___, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(IDictionary<, >), typeof(IDictionary<, >), "Windows.Foundation.Collections.IMap`2"); } } public static void RegisterIReadOnlyDictionaryOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IReadOnlyDictionary___, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(IReadOnlyDictionary<, >), typeof(IReadOnlyDictionary<, >), "Windows.Foundation.Collections.IMapView`2"); } } public static void RegisterIDisposableMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IDisposable, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(System.IDisposable), typeof(IDisposable), "Windows.Foundation.IClosable"); } } public static void RegisterIEnumerableMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IEnumerable, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(System.Collections.IEnumerable), typeof(IEnumerable), "Windows.UI.Xaml.Interop.IBindableIterable"); } else { RegisterCustomAbiTypeMapping(typeof(System.Collections.IEnumerable), typeof(IEnumerable), "Microsoft.UI.Xaml.Interop.IBindableIterable"); } } } public static void RegisterIListMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IList, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(System.Collections.IList), typeof(IList), "Windows.UI.Xaml.Interop.IBindableVector"); } else { RegisterCustomAbiTypeMapping(typeof(System.Collections.IList), typeof(IList), "Microsoft.UI.Xaml.Interop.IBindableVector"); } } } public static void RegisterINotifyCollectionChangedMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _INotifyCollectionChanged, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(INotifyCollectionChanged), typeof(INotifyCollectionChanged), "Windows.UI.Xaml.Interop.INotifyCollectionChanged"); } else { RegisterCustomAbiTypeMapping(typeof(INotifyCollectionChanged), typeof(INotifyCollectionChanged), "Microsoft.UI.Xaml.Interop.INotifyCollectionChanged"); } } } public static void RegisterNotifyCollectionChangedActionMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _NotifyCollectionChangedAction, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(NotifyCollectionChangedAction), typeof(NotifyCollectionChangedAction), "Windows.UI.Xaml.Interop.NotifyCollectionChangedAction"); } else { RegisterCustomAbiTypeMapping(typeof(NotifyCollectionChangedAction), typeof(NotifyCollectionChangedAction), "Microsoft.UI.Xaml.Interop.NotifyCollectionChangedAction"); } } } public static void RegisterNotifyCollectionChangedEventArgsMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _NotifyCollectionChangedEventArgs, 1, 0) != 1) { if (FeatureSwitches.UseWindowsUIXamlProjections) { RegisterCustomAbiTypeMapping(typeof(NotifyCollectionChangedEventArgs), typeof(NotifyCollectionChangedEventArgs), "Windows.UI.Xaml.Interop.NotifyCollectionChangedEventArgs", isRuntimeClass: true); } else { RegisterCustomAbiTypeMapping(typeof(NotifyCollectionChangedEventArgs), typeof(NotifyCollectionChangedEventArgs), "Microsoft.UI.Xaml.Interop.NotifyCollectionChangedEventArgs", isRuntimeClass: true); } } } public static void RegisterMatrix3x2Mapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Matrix3x2, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Matrix3x2), typeof(Matrix3x2), "Windows.Foundation.Numerics.Matrix3x2"); } } public static void RegisterMatrix4x4Mapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Matrix4x4, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Matrix4x4), typeof(Matrix4x4), "Windows.Foundation.Numerics.Matrix4x4"); } } public static void RegisterPlaneMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Plane, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Plane), typeof(Plane), "Windows.Foundation.Numerics.Plane"); } } public static void RegisterQuaternionMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Quaternion, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Quaternion), typeof(Quaternion), "Windows.Foundation.Numerics.Quaternion"); } } public static void RegisterVector2Mapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Vector2, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Vector2), typeof(Vector2), "Windows.Foundation.Numerics.Vector2"); } } public static void RegisterVector3Mapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Vector3, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Vector3), typeof(Vector3), "Windows.Foundation.Numerics.Vector3"); } } public static void RegisterVector4Mapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _Vector4, 1, 0) != 1) { RegisterCustomAbiTypeMapping(typeof(Vector4), typeof(Vector4), "Windows.Foundation.Numerics.Vector4"); } } public static void RegisterIMapOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IMap___, 1, 0) != 1) { RegisterCustomTypeToHelperTypeMapping(typeof(IMap<, >), typeof(IDictionary<, >)); } } public static void RegisterIVectorOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IVector__, 1, 0) != 1) { RegisterCustomTypeToHelperTypeMapping(typeof(IVector<>), typeof(IList<>)); } } public static void RegisterIMapViewOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IMapView___, 1, 0) != 1) { RegisterCustomTypeToHelperTypeMapping(typeof(IMapView<, >), typeof(IReadOnlyDictionary<, >)); } } public static void RegisterIVectorViewOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IVectorView__, 1, 0) != 1) { RegisterCustomTypeToHelperTypeMapping(typeof(IVectorView<>), typeof(IReadOnlyList<>)); } } public static void RegisterIBindableVectorMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IBindableVector, 1, 0) != 1) { RegisterCustomTypeToHelperTypeMapping(typeof(IBindableVector), typeof(IList)); } } public static void RegisterICollectionOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _ICollection__, 1, 0) != 1) { RegisterCustomTypeToHelperTypeMapping(typeof(System.Collections.Generic.ICollection<>), typeof(ICollection<>)); } } public static void RegisterIReadOnlyCollectionOpenGenericMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _IReadOnlyCollection__, 1, 0) != 1) { RegisterCustomTypeToHelperTypeMapping(typeof(System.Collections.Generic.IReadOnlyCollection<>), typeof(IReadOnlyCollection<>)); } } public static void RegisterICollectionMapping() { if (!FeatureSwitches.EnableDefaultCustomTypeMappings && Interlocked.CompareExchange(ref _ICollection, 1, 0) != 1) { RegisterCustomTypeToHelperTypeMapping(typeof(System.Collections.ICollection), typeof(ICollection)); } } } internal static class GenericDelegateHelper { internal static ConditionalWeakTable DelegateTable = new ConditionalWeakTable(); [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] internal unsafe static System.Delegate CreateDelegate(nint ptr, ref System.Delegate delegateRef, System.Type delegateType, int offset) { System.Delegate delegateForFunctionPointer = Marshal.GetDelegateForFunctionPointer(*(System.IntPtr*)((nint)(*(System.IntPtr*)ptr) + (nint)offset * (nint)sizeof(nint)), delegateType); Interlocked.CompareExchange(ref delegateRef, delegateForFunctionPointer, (System.Delegate)null); return delegateRef; } } internal interface IWinRTNullableTypeDetails { object GetNullableValue(IInspectable inspectable); System.Type GetNullableType(); } public sealed class StructTypeDetails : IWinRTExposedTypeDetails, IWinRTNullableTypeDetails where T : struct where TAbi : unmanaged { private static readonly Guid PIID = Nullable.PIID; [SkipLocalsInit] public unsafe ComInterfaceEntry[] GetExposedInterfaces() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) System.Span span = new System.Span((void*)stackalloc ComInterfaceEntry[2], 2); System.Span span2 = span; int num = 0; if (FeatureSwitches.EnableIReferenceSupport) { span2[num++] = new ComInterfaceEntry { IID = IID.IID_IPropertyValue, Vtable = ManagedIPropertyValueImpl.AbiToProjectionVftablePtr }; span2[num++] = new ComInterfaceEntry { IID = PIID, Vtable = BoxedValueIReferenceImpl.AbiToProjectionVftablePtr }; } return span2.Slice(0, num).ToArray(); } unsafe object IWinRTNullableTypeDetails.GetNullableValue(IInspectable inspectable) { nint zero = System.IntPtr.Zero; TAbi val = default(TAbi); try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((System.IntPtr)inspectable.ThisPtr, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref PIID), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(System.IntPtr*)((nint)(*(System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &val)); if (typeof(T) == typeof(TAbi)) { return val; } return ((Func)(object)Marshaler.FromAbi).Invoke((object)val); } finally { Marshaler.DisposeAbi.Invoke((object)val); MarshalExtensions.ReleaseIfNotNull(zero); } } System.Type IWinRTNullableTypeDetails.GetNullableType() { return typeof(T?); } } public abstract class DelegateTypeDetails : IWinRTExposedTypeDetails, IWinRTNullableTypeDetails where T : System.Delegate { private static readonly Guid PIID = Nullable.PIID; public ComInterfaceEntry[] GetExposedInterfaces() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return GetExposedInterfaces(GetDelegateInterface()); } public unsafe static ComInterfaceEntry[] GetExposedInterfaces(ComInterfaceEntry delegateInterface) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) System.Span span = new System.Span((void*)stackalloc ComInterfaceEntry[3], 3); System.Span span2 = span; int num = 0; span2[num++] = delegateInterface; if (FeatureSwitches.EnableIReferenceSupport) { span2[num++] = new ComInterfaceEntry { IID = IID.IID_IPropertyValue, Vtable = ManagedIPropertyValueImpl.AbiToProjectionVftablePtr }; span2[num++] = new ComInterfaceEntry { IID = PIID, Vtable = Nullable_Delegate.AbiToProjectionVftablePtr }; } return span2.Slice(0, num).ToArray(); } public abstract ComInterfaceEntry GetDelegateInterface(); unsafe object IWinRTNullableTypeDetails.GetNullableValue(IInspectable inspectable) { nint zero = System.IntPtr.Zero; nint num = 0; try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface((System.IntPtr)inspectable.ThisPtr, ref System.Runtime.CompilerServices.Unsafe.AsRef(ref PIID), ref zero)); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall])(*(System.IntPtr*)((nint)(*(System.IntPtr*)zero) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]))))(zero, &num)); return new Nullable(((Func)(object)Marshaler.FromAbi).Invoke((object)num)); } finally { Marshaler.DisposeAbi.Invoke((object)num); MarshalExtensions.ReleaseIfNotNull(zero); } } System.Type IWinRTNullableTypeDetails.GetNullableType() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException(); } } public sealed class EnumTypeDetails : IWinRTExposedTypeDetails, IWinRTNullableTypeDetails where T : unmanaged, System.Enum { [SkipLocalsInit] public unsafe ComInterfaceEntry[] GetExposedInterfaces() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) System.Span span = new System.Span((void*)stackalloc ComInterfaceEntry[2], 2); System.Span span2 = span; int num = 0; if (FeatureSwitches.EnableIReferenceSupport) { span2[num++] = new ComInterfaceEntry { IID = IID.IID_IPropertyValue, Vtable = ManagedIPropertyValueImpl.AbiToProjectionVftablePtr }; if (CustomAttributeExtensions.IsDefined((MemberInfo)(object)typeof(T), typeof(FlagsAttribute))) { span2[num++] = new ComInterfaceEntry { IID = Nullable_FlagsEnum.GetIID(typeof(T)), Vtable = Nullable_FlagsEnum.AbiToProjectionVftablePtr }; } else { span2[num++] = new ComInterfaceEntry { IID = Nullable_IntEnum.GetIID(typeof(T)), Vtable = Nullable_IntEnum.AbiToProjectionVftablePtr }; } } return span2.Slice(0, num).ToArray(); } System.Type IWinRTNullableTypeDetails.GetNullableType() { return typeof(T?); } object IWinRTNullableTypeDetails.GetNullableValue(IInspectable inspectable) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) throw new NotImplementedException(); } } public sealed class SingleInterfaceOptimizedObject : IWinRTObject, IDynamicInterfaceCastable, IUnmanagedVirtualMethodTableProvider { private readonly System.Type _type; private readonly IObjectReference _obj; private volatile ConcurrentDictionary _queryInterfaceCache; private volatile ConcurrentDictionary _additionalTypeData; IObjectReference IWinRTObject.NativeObject => _obj; bool IWinRTObject.HasUnwrappableNativeObject => false; ConcurrentDictionary IWinRTObject.QueryInterfaceCache => _queryInterfaceCache ?? MakeQueryInterfaceCache(); ConcurrentDictionary IWinRTObject.AdditionalTypeData => _additionalTypeData ?? MakeAdditionalTypeData(); public SingleInterfaceOptimizedObject(System.Type type, IObjectReference objRef) : this(type, objRef, requireQI: true) { } internal SingleInterfaceOptimizedObject(System.Type type, IObjectReference objRef, bool requireQI) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) _type = type; if (requireQI) { System.Type type2 = type.FindHelperType(); if (RuntimeFeature.IsDynamicCodeCompiled) { IObjectReference objectReference = TryGetObjectReferenceViaVftbl(objRef, type2); if (objectReference != null) { _obj = objectReference; return; } } _obj = objRef.As(GuidGenerator.GetIID(type2)); } else { _obj = objRef; } [MethodImpl(8)] [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "If the 'Vftbl' type is kept, we can assume all its metadata will also have been rooted.")] static IObjectReference TryGetObjectReferenceViaVftbl(IObjectReference objRef, System.Type helperType) { System.Type type3 = helperType.FindVftblType(); if (type3 != null) { return (IObjectReference)((MethodBase)typeof(IObjectReference).GetMethod("As", System.Type.EmptyTypes).MakeGenericMethod(new System.Type[1] { type3 })).Invoke((object)objRef, (object[])null); } return null; } } private ConcurrentDictionary MakeQueryInterfaceCache() { Interlocked.CompareExchange>(ref _queryInterfaceCache, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _queryInterfaceCache; } private ConcurrentDictionary MakeAdditionalTypeData() { Interlocked.CompareExchange>(ref _additionalTypeData, new ConcurrentDictionary(), (ConcurrentDictionary)null); return _additionalTypeData; } bool IDynamicInterfaceCastable.IsInterfaceImplemented(RuntimeTypeHandle interfaceType, bool throwIfNotImplemented) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (_type.Equals(System.Type.GetTypeFromHandle(interfaceType))) { return true; } if (!FeatureSwitches.EnableIDynamicInterfaceCastableSupport) { return false; } return ((IWinRTObject)this).IsInterfaceImplementedFallback(interfaceType, throwIfNotImplemented); } IObjectReference IWinRTObject.GetObjectReferenceForType(RuntimeTypeHandle interfaceType) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (_type.Equals(System.Type.GetTypeFromHandle(interfaceType))) { return _obj; } return ((IWinRTObject)this).GetObjectReferenceForTypeFallback(interfaceType); } } public static class TypeExtensions { internal static readonly ConcurrentDictionary HelperTypeCache = new ConcurrentDictionary(); private static readonly ConcurrentDictionary AuthoringMetadataTypeCache = new ConcurrentDictionary(); private static readonly List> AuthoringMetadaTypeLookup = new List>(); [UnconditionalSuppressMessage("Trimming", "IL2073", Justification = "Matching trimming annotations are used at all callsites registering helper types present in the cache.")] [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] public static System.Type FindHelperType(this System.Type type) { return type.FindHelperType(throwIfNotAotSupported: true); } [UnconditionalSuppressMessage("Trimming", "IL2073", Justification = "Matching trimming annotations are used at all callsites registering helper types present in the cache.")] [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] internal static System.Type FindHelperType(this System.Type type, bool throwIfNotAotSupported) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) System.Type orAdd = HelperTypeCache.GetOrAdd(type, (Func)FindHelperTypeNoCache); if (!RuntimeFeature.IsDynamicCodeCompiled && orAdd == typeof(HelperTypeMetadataNotAvailableOnAot)) { if (!throwIfNotAotSupported) { return null; } throw new NotSupportedException($"Cannot retrieve a helper type for generic public type '{type}'."); } return orAdd; [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This is a fallback for compat purposes with existing projections. Applications which make use of trimming will make use of updated projections that won't hit this code path.")] [UnconditionalSuppressMessage("Trimming", "IL2057", Justification = "This is a fallback for compat purposes with existing projections. Applications which make use of trimming will make use of updated projections that won't hit this code path.")] static System.Type FindHelperTypeFallback(System.Type type) { string text = type.FullName; string text2 = "ABI.Impl."; if (text.StartsWith(text2, (StringComparison)4)) { text = text.Substring(text2.Length); } string text3 = "ABI." + text; return type.Assembly.GetType(text3) ?? System.Type.GetType(text3); } [CompilerGenerated] [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] static System.Type FindHelperTypeNoCache(System.Type type) { if (typeof(System.Exception).IsAssignableFrom(type)) { type = typeof(System.Exception); } System.Type type2 = Projections.FindCustomHelperTypeMapping(type, filterToRuntimeClass: false, returnMarkerTypeIfNotAotCompatible: true); if (type2 != null) { return type2; } WindowsRuntimeHelperTypeAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)type); if (customAttribute != null) { return GetHelperTypeFromAttribute(customAttribute, type); } System.Type authoringMetadataType = type.GetAuthoringMetadataType(); if (authoringMetadataType != null) { customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)authoringMetadataType); if (customAttribute != null) { return GetHelperTypeFromAttribute(customAttribute, type); } } if (!RuntimeFeature.IsDynamicCodeCompiled) { return null; } return FindHelperTypeFallback(type); } [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "No members of the generic type are dynamically accessed other than for the attributes on it.")] [UnconditionalSuppressMessage("Trimming", "IL2055", Justification = "The type arguments are guaranteed to be valid for the generic ABI types.")] [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] static System.Type GetHelperTypeFromAttribute(WindowsRuntimeHelperTypeAttribute helperTypeAtribute, System.Type type) { if (type.IsGenericType && !type.IsGenericTypeDefinition) { if (!RuntimeFeature.IsDynamicCodeCompiled) { return typeof(HelperTypeMetadataNotAvailableOnAot); } return helperTypeAtribute.HelperType.MakeGenericType(type.GetGenericArguments()); } return helperTypeAtribute.HelperType; } } [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] public static System.Type GetHelperType(this System.Type type) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) System.Type type2 = type.FindHelperType(); if (type2 != null) { return type2; } throw new InvalidOperationException("Target type is not a projected type: " + type.FullName + "."); } [return: DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] public static System.Type GetGuidType([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] this System.Type type) { if (!type.IsDelegate()) { return type; } return type.GetHelperType(); } [UnconditionalSuppressMessage("AOT", "IL3050", Justification = "The fallback path is not AOT-safe by design (to avoid annotations).")] [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "The fallback path is not trim-safe by design (to avoid annotations).")] public static System.Type FindVftblType(this System.Type helperType) { if (!RuntimeFeature.IsDynamicCodeCompiled) { return null; } return FindVftblTypeFallback(helperType); [CompilerGenerated] [RequiresDynamicCode("The necessary marshalling code or generic instantiations might not be available.")] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [DynamicDependency(/*Could not decode attribute arguments.*/)] [RequiresUnreferencedCode("This method is not trim-safe, and is only supported for use when not using trimming (or AOT).")] static System.Type FindVftblTypeFallback(System.Type helperType) { System.Type type = helperType.GetNestedType("Vftbl"); if (type == null) { return null; } if (helperType.IsGenericType) { type = type.MakeGenericType(helperType.GetGenericArguments()); } return type; } } [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "The path using vtable types is a fallback and is not trim-safe by design.")] internal static nint GetAbiToProjectionVftblPtr([DynamicallyAccessedMembers(/*Could not decode attribute arguments.*/)] this System.Type helperType) { return (nint)(helperType.FindVftblType() ?? helperType).GetField("AbiToProjectionVftablePtr", (BindingFlags)24).GetValue((object)null); } public static System.Type GetAbiType(this System.Type type) { return type.GetHelperType().GetMethod("GetAbi", (BindingFlags)24).ReturnType; } public static System.Type GetMarshalerType(this System.Type type) { return type.GetHelperType().GetMethod("CreateMarshaler", (BindingFlags)24).ReturnType; } internal static System.Type GetMarshaler2Type(this System.Type type) { System.Type helperType = type.GetHelperType(); MethodInfo val = helperType.GetMethod("CreateMarshaler2", (BindingFlags)24) ?? helperType.GetMethod("CreateMarshaler", (BindingFlags)24); return val.ReturnType; } internal static System.Type GetMarshalerArrayType(this System.Type type) { MethodInfo method = type.GetHelperType().GetMethod("CreateMarshalerArray", (BindingFlags)24); if (method == null) { return null; } return method.ReturnType; } public static bool IsDelegate(this System.Type type) { return typeof(System.Delegate).IsAssignableFrom(type); } internal static bool IsNullableT(this System.Type type) { if (type.IsGenericType) { return type.GetGenericTypeDefinition() == typeof(System.Nullable<>); } return false; } internal static bool IsAbiNullableDelegate(this System.Type type) { if (type.IsGenericType) { return type.GetGenericTypeDefinition() == typeof(Nullable_Delegate<>); } return false; } internal static bool IsIReferenceArray(this System.Type type) { if (!FeatureSwitches.EnableIReferenceSupport) { return false; } if (type.IsGenericType) { return type.GetGenericTypeDefinition() == typeof(Windows.Foundation.IReferenceArray<>); } return false; } internal static bool ShouldProvideIReference(this System.Type type) { if (!FeatureSwitches.EnableIReferenceSupport) { return false; } if (!type.IsPrimitive && !(type == typeof(string)) && !(type == typeof(Guid)) && !(type == typeof(DateTimeOffset)) && !(type == typeof(TimeSpan)) && !type.IsTypeOfType() && !type.IsTypeOfException()) { if (type.IsValueType || type.IsDelegate()) { return Projections.IsTypeWindowsRuntimeType(type); } return false; } return true; } internal static bool IsTypeOfType(this System.Type type) { return typeof(System.Type).IsAssignableFrom(type); } internal static bool IsTypeOfException(this System.Type type) { return typeof(System.Exception).IsAssignableFrom(type); } public static System.Type GetRuntimeClassCCWType(this System.Type type) { if (!type.IsClass || type.IsArray) { return null; } return type.GetAuthoringMetadataType(); } internal static System.Type GetCCWType(this System.Type type) { if (type.IsArray) { return null; } return type.GetAuthoringMetadataType(); } internal static void RegisterAuthoringMetadataTypeLookup(Func authoringMetadataTypeLookup) { AuthoringMetadaTypeLookup.Add(authoringMetadataTypeLookup); } internal static System.Type GetAuthoringMetadataType(this System.Type type) { return AuthoringMetadataTypeCache.GetOrAdd(type, (Func)delegate(System.Type type) { int count = AuthoringMetadaTypeLookup.Count; for (int i = 0; i < count; i++) { System.Type type2 = AuthoringMetadaTypeLookup[i].Invoke(type); if (type2 != null) { return type2; } } return (!RuntimeFeature.IsDynamicCodeCompiled) ? null : GetAuthoringMetadataTypeFallback(type); }); } [UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode", Justification = "This is a fallback for compat purposes with existing projections. Applications making use of updated projections won't hit this code path.")] private static System.Type GetAuthoringMetadataTypeFallback(System.Type type) { string text = "ABI.Impl." + type.FullName; return type.Assembly.GetType(text, false); } } [Flags] internal enum TypeNameGenerationFlags { None = 0, GenerateBoxedName = 1, ForGetRuntimeClassName = 2 } internal static class TypeNameSupport { private struct VisitedType { [field: CompilerGenerated] public System.Type Type { [CompilerGenerated] get; [CompilerGenerated] set; } [field: CompilerGenerated] public bool Covariant { [CompilerGenerated] get; [CompilerGenerated] set; } } private static readonly List projectionAssemblies = new List(); private static readonly List> projectionTypeNameToBaseTypeNameMappings = new List>(); private static readonly ConcurrentDictionary typeNameCache = new ConcurrentDictionary((IEqualityComparer)(object)StringComparer.Ordinal) { ["TrackerCollection"] = null }; private static readonly ConcurrentDictionary baseRcwTypeCache = new ConcurrentDictionary((IEqualityComparer)(object)StringComparer.Ordinal) { ["TrackerCollection"] = null }; [ThreadStatic] private static Stack? visitedTypesInstance; [ThreadStatic] private static StringBuilder? nameForTypeBuilderInstance; public static void RegisterProjectionAssembly(Assembly assembly) { projectionAssemblies.Add(assembly); } public static void RegisterProjectionTypeBaseTypeMapping(IDictionary typeNameToBaseTypeNameMapping) { projectionTypeNameToBaseTypeNameMappings.Add(typeNameToBaseTypeNameMapping); } public static System.Type FindRcwTypeByNameCached(string runtimeClassName) { System.Type type = FindTypeByNameCached(runtimeClassName); if (type == null) { type = baseRcwTypeCache.GetOrAdd(runtimeClassName, (Func)delegate(string runtimeClassName) { int count = projectionTypeNameToBaseTypeNameMappings.Count; for (int i = 0; i < count; i++) { if (projectionTypeNameToBaseTypeNameMappings[i].ContainsKey(runtimeClassName)) { return FindRcwTypeByNameCached(projectionTypeNameToBaseTypeNameMappings[i][runtimeClassName]); } } return null; }); } return type; } public static System.Type FindTypeByNameCached(string runtimeClassName) { return typeNameCache.GetOrAdd(runtimeClassName, (Func)delegate(string runtimeClassName) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) System.Type result = null; try { result = FindTypeByName(MemoryExtensions.AsSpan(runtimeClassName)).Item1; } catch (System.Exception) { } return result; }); } [MethodImpl(8)] private static System.Exception GetExceptionForUnsupportedIReferenceType(System.ReadOnlySpan runtimeClassName) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown return (System.Exception)new NotSupportedException("The requested runtime class name is '" + ((object)runtimeClassName).ToString() + "', which maps to an 'IReference' projected type. This can only be used when support for 'IReference' types is enabled in the CsWinRT configuration. To enable it, make sure that the 'CsWinRTEnableIReferenceSupport' MSBuild property is not being set to 'false' anywhere."); } public static ValueTuple FindTypeByName(System.ReadOnlySpan runtimeClassName) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (MemoryExtensions.StartsWith(runtimeClassName, MemoryExtensions.AsSpan("<>f__AnonymousType"), (StringComparison)4)) { if (FeatureSwitches.EnableDynamicObjectsSupport) { return new ValueTuple(typeof(ExpandoObject), 0); } throw new NotSupportedException("The requested runtime class name is '" + ((object)runtimeClassName).ToString() + "', which maps to a dynamic projected type. This can only be used when support for dynamic objects is enabled in the CsWinRT configuration. To enable it, make sure that the 'CsWinRTEnableDynamicObjectsSupport' MSBuild property is not being set to 'false' anywhere."); } if (MemoryExtensions.CompareTo(runtimeClassName, MemoryExtensions.AsSpan("Windows.Foundation.IReference`1"), (StringComparison)4) == 0) { if (FeatureSwitches.EnableIReferenceSupport) { return new ValueTuple(typeof(Nullable_string), 0); } throw GetExceptionForUnsupportedIReferenceType(runtimeClassName); } if (MemoryExtensions.CompareTo(runtimeClassName, MemoryExtensions.AsSpan("Windows.Foundation.IReference`1"), (StringComparison)4) == 0) { if (FeatureSwitches.EnableIReferenceSupport) { return new ValueTuple(typeof(Nullable_Type), 0); } throw GetExceptionForUnsupportedIReferenceType(runtimeClassName); } if (MemoryExtensions.CompareTo(runtimeClassName, MemoryExtensions.AsSpan("Windows.Foundation.IReference`1"), (StringComparison)4) == 0) { if (FeatureSwitches.EnableIReferenceSupport) { return new ValueTuple(typeof(Nullable_Exception), 0); } throw GetExceptionForUnsupportedIReferenceType(runtimeClassName); } ValueTuple val = ParseGenericTypeName(runtimeClassName); string item = val.Item1; System.Type[] item2 = val.Item2; int item3 = val.Item3; if (item == null) { return new ValueTuple((System.Type)null, -1); } return new ValueTuple(FindTypeByNameCore(item, item2), item3); } [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Any types which are trimmed are not used by user code and there is fallback logic to handle that.")] private static System.Type FindTypeByNameCore(string runtimeClassName, System.Type[] genericTypes) { System.Type type = Projections.FindCustomTypeForAbiTypeName(runtimeClassName); if (type == null) { if (genericTypes == null) { System.Type type2 = ResolvePrimitiveType(runtimeClassName); if (type2 != null) { return type2; } } int count = projectionAssemblies.Count; for (int i = 0; i < count; i++) { System.Type type3 = projectionAssemblies[i].GetType(runtimeClassName); if (type3 != null) { type = type3; break; } } } if (type == null) { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly val in assemblies) { System.Type type4 = val.GetType(runtimeClassName); if (type4 != null) { type = type4; break; } } } if (type != null) { if (genericTypes != null) { return ResolveGenericType(type, genericTypes, runtimeClassName); } return type; } return null; [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2055", Justification = "The 'MakeGenericType' call is guarded by explicit checks in our code.")] [UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Calls to MakeGenericType are done with reference types.")] static System.Type ResolveGenericType(System.Type resolvedType, System.Type[] genericTypes, string runtimeClassName) { if (resolvedType == typeof(System.Nullable<>)) { if (genericTypes[0].IsDelegate()) { if (FeatureSwitches.EnableIReferenceSupport) { return typeof(Nullable_Delegate<>).MakeGenericType(genericTypes); } throw GetExceptionForUnsupportedIReferenceType(MemoryExtensions.AsSpan(runtimeClassName)); } System.Type typeAsNullableType = NullableType.GetTypeAsNullableType(genericTypes[0]); if (typeAsNullableType != null) { return typeAsNullableType; } } if (!RuntimeFeature.IsDynamicCodeCompiled) { foreach (System.Type type5 in genericTypes) { if (type5.IsValueType) { return null; } } } return resolvedType.MakeGenericType(genericTypes); } } public static System.Type ResolvePrimitiveType(string primitiveTypeName) { if (primitiveTypeName != null) { switch (primitiveTypeName.Length) { case 5: switch (primitiveTypeName[3]) { case 't': if (!(primitiveTypeName == "UInt8")) { break; } return typeof(byte); case '1': if (!(primitiveTypeName == "Int16")) { break; } return typeof(short); case '3': if (!(primitiveTypeName == "Int32")) { break; } return typeof(int); case '6': if (!(primitiveTypeName == "Int64")) { break; } return typeof(long); } break; case 4: switch (primitiveTypeName[0]) { case 'I': if (!(primitiveTypeName == "Int8")) { break; } return typeof(sbyte); case 'C': if (!(primitiveTypeName == "Char")) { break; } return typeof(char); case 'G': if (!(primitiveTypeName == "Guid")) { break; } return typeof(Guid); } break; case 6: switch (primitiveTypeName[1]) { case 'I': if (!(primitiveTypeName == "UInt16")) { if (!(primitiveTypeName == "UInt32")) { if (!(primitiveTypeName == "UInt64")) { break; } return typeof(ulong); } return typeof(uint); } return typeof(ushort); case 't': if (!(primitiveTypeName == "String")) { break; } return typeof(string); case 'h': if (!(primitiveTypeName == "Char16")) { break; } return typeof(char); case 'i': if (!(primitiveTypeName == "Single")) { break; } return typeof(float); case 'o': if (!(primitiveTypeName == "Double")) { break; } return typeof(double); case 'b': if (!(primitiveTypeName == "Object")) { break; } return typeof(object); } break; case 7: if (!(primitiveTypeName == "Boolean")) { break; } return typeof(bool); case 8: if (!(primitiveTypeName == "TimeSpan")) { break; } return typeof(TimeSpan); } } return null; } private unsafe static ValueTuple ParseGenericTypeName(System.ReadOnlySpan partialTypeName) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) int num = MemoryExtensions.IndexOfAny(partialTypeName, ',', '>'); int num2 = partialTypeName.Length; if (num != -1) { num2 = num; } System.ReadOnlySpan readOnlySpan = partialTypeName.Slice(0, num2); if (!MemoryExtensions.Contains(readOnlySpan, MemoryExtensions.AsSpan("`"), (StringComparison)4)) { return new ValueTuple(((object)readOnlySpan).ToString(), (System.Type[])null, num2); } int num3 = MemoryExtensions.IndexOf(partialTypeName, '<'); System.ReadOnlySpan readOnlySpan2 = partialTypeName.Slice(0, num3); System.ReadOnlySpan runtimeClassName = partialTypeName.Slice(num3 + 1); int num4 = num3 + 1; List val = new List(); while (true) { ValueTuple val2 = FindTypeByName(runtimeClassName); System.Type item = val2.Item1; int item2 = val2.Item2; if (item == (System.Type)null) { return new ValueTuple((string)null, (System.Type[])null, -1); } num4 += item2; val.Add(item); runtimeClassName = runtimeClassName.Slice(item2); if (*(ushort*)runtimeClassName[0] != 44) { break; } num4 += 2; runtimeClassName = runtimeClassName.Slice(2); } if (*(ushort*)runtimeClassName[0] == 62) { int num5 = ((runtimeClassName.Length <= 1 || *(ushort*)runtimeClassName[1] != 32) ? 1 : 2); num4 += num5; runtimeClassName = runtimeClassName.Slice(num5); return new ValueTuple(((object)readOnlySpan2).ToString(), val.ToArray(), partialTypeName.Length - runtimeClassName.Length); } throw new InvalidOperationException("The provided type name is invalid."); } public static string GetNameForType(System.Type? type, TypeNameGenerationFlags flags) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (type == null) { return string.Empty; } object obj = nameForTypeBuilderInstance; if (obj == null) { StringBuilder val = new StringBuilder(); nameForTypeBuilderInstance = val; obj = (object)val; } StringBuilder val2 = (StringBuilder)obj; val2.Clear(); if (TryAppendTypeName(type, val2, flags)) { return ((object)val2).ToString(); } return string.Empty; } private static bool TryAppendSimpleTypeName(System.Type type, StringBuilder builder, TypeNameGenerationFlags flags) { if (type.IsPrimitive || type == typeof(string) || type == typeof(Guid) || type == typeof(TimeSpan)) { if (type == typeof(byte)) { builder.Append("UInt8"); } else if (type == typeof(sbyte)) { builder.Append("Int8"); } else { builder.Append(((MemberInfo)type).Name); } } else if (type == typeof(object)) { builder.Append("Object"); } else if ((flags & TypeNameGenerationFlags.ForGetRuntimeClassName) != 0 && type.IsTypeOfType()) { builder.Append("Windows.UI.Xaml.Interop.TypeName"); } else { string text = Projections.FindCustomAbiTypeNameForType(type); if (text != null) { builder.Append(text); } else if (Projections.IsTypeWindowsRuntimeType(type)) { builder.Append(type.FullName); } else { if ((flags & TypeNameGenerationFlags.ForGetRuntimeClassName) != 0) { return TryAppendWinRTInterfaceNameForType(type, builder, flags); } builder.Append(type.FullName); } } return true; } private static bool TryAppendWinRTInterfaceNameForType(System.Type type, StringBuilder builder, TypeNameGenerationFlags flags) { WinRTRuntimeClassNameAttribute customAttribute = CustomAttributeExtensions.GetCustomAttribute((MemberInfo)(object)type); if (customAttribute != null) { builder.Append(customAttribute.RuntimeClassName); return true; } string runtimeClassNameForNonWinRTTypeFromLookupTable = ComWrappersSupport.GetRuntimeClassNameForNonWinRTTypeFromLookupTable(type); if (!string.IsNullOrEmpty(runtimeClassNameForNonWinRTTypeFromLookupTable)) { builder.Append(runtimeClassNameForNonWinRTTypeFromLookupTable); return true; } if (!RuntimeFeature.IsDynamicCodeCompiled) { return false; } Stack val = visitedTypesInstance ?? (visitedTypesInstance = new Stack()); if (HasAnyVisitedTypes(val, type)) { if (val.Peek().Covariant && !type.IsValueType) { builder.Append("Object"); return true; } return false; } return TryAppendWinRTInterfaceNameForTypeJit(type, builder, flags); [CompilerGenerated] static bool HasAnyVisitedTypes(Stack visitedTypes, System.Type type) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Enumerator enumerator = visitedTypes.GetEnumerator(); try { while (enumerator.MoveNext()) { if (enumerator.Current.Type == type) { return true; } } } finally { ((System.IDisposable)enumerator).Dispose(); } return false; } [CompilerGenerated] [UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "Updated binaries will have WinRTRuntimeClassNameAttribute which will be used instead.")] static bool TryAppendWinRTInterfaceNameForTypeJit(System.Type type, StringBuilder builder, TypeNameGenerationFlags flags) { Stack val2 = visitedTypesInstance; val2.Push(new VisitedType { Type = type }); System.Type type2 = null; System.Type[] interfaces = type.GetInterfaces(); foreach (System.Type type3 in interfaces) { if (Projections.IsTypeWindowsRuntimeType(type3) && (type2 == null || type2.IsAssignableFrom(type3))) { type2 = type3; } } bool result = false; if (type2 != null) { result = TryAppendTypeName(type2, builder, flags); } val2.Pop(); return result; } } private static bool TryAppendTypeName(System.Type type, StringBuilder builder, TypeNameGenerationFlags flags) { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Invalid comparison between Unknown and I4 if (type.IsSZArray) { System.Type elementType = type.GetElementType(); if (elementType.ShouldProvideIReference()) { builder.Append("Windows.Foundation.IReferenceArray`1<"); if (TryAppendTypeName(elementType, builder, flags & ~TypeNameGenerationFlags.GenerateBoxedName)) { builder.Append('>'); return true; } return false; } return false; } if ((flags & TypeNameGenerationFlags.GenerateBoxedName) != 0 && type.ShouldProvideIReference()) { builder.Append("Windows.Foundation.IReference`1<"); if (!TryAppendSimpleTypeName(type, builder, flags & ~TypeNameGenerationFlags.GenerateBoxedName)) { return false; } builder.Append('>'); return true; } if (!type.IsGenericType || type.IsGenericTypeDefinition) { return TryAppendSimpleTypeName(type, builder, flags); } if ((flags & TypeNameGenerationFlags.ForGetRuntimeClassName) != 0 && !Projections.IsTypeWindowsRuntimeType(type)) { return TryAppendWinRTInterfaceNameForType(type, builder, flags); } System.Type genericTypeDefinition = type.GetGenericTypeDefinition(); if (!TryAppendSimpleTypeName(genericTypeDefinition, builder, flags)) { return false; } builder.Append('<'); bool flag = true; System.Type[] genericArguments = type.GetGenericArguments(); System.Type[] genericArguments2 = genericTypeDefinition.GetGenericArguments(); Stack val = visitedTypesInstance ?? (visitedTypesInstance = new Stack()); for (int i = 0; i < genericArguments.Length; i++) { System.Type type2 = genericArguments[i]; if (type2.ContainsGenericParameters) { throw new ArgumentException("type"); } if (!flag) { builder.Append(", "); } flag = false; if ((flags & TypeNameGenerationFlags.ForGetRuntimeClassName) != 0) { val.Push(new VisitedType { Type = type, Covariant = ((genericArguments2[i].GenericParameterAttributes & 3) == 1) }); } bool flag2 = TryAppendTypeName(type2, builder, flags & ~TypeNameGenerationFlags.GenerateBoxedName); if ((flags & TypeNameGenerationFlags.ForGetRuntimeClassName) != 0) { val.Pop(); } if (!flag2) { return false; } } builder.Append('>'); return true; } } internal static class WinRTRuntimeErrorStrings { private static ResourceManager? s_resourceManager; private static ResourceManager ResourceManager { get { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown object obj = s_resourceManager; if (obj == null) { ResourceManager val = new ResourceManager("WinRT.WinRTRuntimeErrorStrings", typeof(WinRTRuntimeErrorStrings).Assembly); s_resourceManager = val; obj = (object)val; } return (ResourceManager)obj; } } internal static string Arg_IndexOutOfRangeException => GetResourceString("Arg_IndexOutOfRangeException"); internal static string Arg_KeyNotFound => GetResourceString("Arg_KeyNotFound"); internal static string Arg_KeyNotFoundWithKey => GetResourceString("Arg_KeyNotFoundWithKey"); internal static string Arg_RankMultiDimNotSupported => GetResourceString("Arg_RankMultiDimNotSupported"); internal static string Argument_AddingDuplicate => GetResourceString("Argument_AddingDuplicate"); internal static string Argument_AddingDuplicateWithKey => GetResourceString("Argument_AddingDuplicateWithKey"); internal static string Argument_IndexOutOfArrayBounds => GetResourceString("Argument_IndexOutOfArrayBounds"); internal static string Argument_InsufficientSpaceToCopyCollection => GetResourceString("Argument_InsufficientSpaceToCopyCollection"); internal static string ArgumentOutOfRange_Index => GetResourceString("ArgumentOutOfRange_Index"); internal static string ArgumentOutOfRange_IndexLargerThanMaxValue => GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue"); internal static string InvalidOperation_CannotRemoveLastFromEmptyCollection => GetResourceString("InvalidOperation_CannotRemoveLastFromEmptyCollection"); internal static string InvalidOperation_CollectionBackingDictionaryTooLarge => GetResourceString("InvalidOperation_CollectionBackingDictionaryTooLarge"); internal static string InvalidOperation_CollectionBackingListTooLarge => GetResourceString("InvalidOperation_CollectionBackingListTooLarge"); internal static string InvalidOperation_EnumEnded => GetResourceString("InvalidOperation_EnumEnded"); internal static string InvalidOperation_EnumFailedVersion => GetResourceString("InvalidOperation_EnumFailedVersion"); internal static string InvalidOperation_EnumNotStarted => GetResourceString("InvalidOperation_EnumNotStarted"); internal static string NotSupported_KeyCollectionSet => GetResourceString("NotSupported_KeyCollectionSet"); internal static string NotSupported_ValueCollectionSet => GetResourceString("NotSupported_ValueCollectionSet"); private static string GetResourceString([CallerMemberName] string? resourceKey = null) { if (FeatureSwitches.UseExceptionResourceKeys) { return resourceKey; } return ResourceManager.GetString(resourceKey); } } internal static class ProjectionInitializer { [ModuleInitializer] public static void InitalizeProjection() { ComWrappersSupport.RegisterProjectionAssembly(typeof(ProjectionInitializer).Assembly); } } } namespace WinRT.Interop { [WinRTExposedType(typeof(ManagedExceptionErrorInfoTypeDetails))] internal sealed class ManagedExceptionErrorInfo { private readonly System.Exception _exception; public ManagedExceptionErrorInfo(System.Exception ex) { _exception = ex; } public bool InterfaceSupportsErrorInfo(Guid riid) { return true; } public Guid GetGuid() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return default(Guid); } public string GetSource() { return _exception.Source; } public string GetDescription() { string text = _exception.Message; if (string.IsNullOrEmpty(text)) { text = _exception.GetType().FullName; } return text; } public string GetHelpFile() { return _exception.HelpLink; } public string GetHelpFileContent() { return string.Empty; } } internal sealed class ManagedExceptionErrorInfoTypeDetails : IWinRTExposedTypeDetails { public ComInterfaceEntry[] GetExposedInterfaces() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) return (ComInterfaceEntry[])(object)new ComInterfaceEntry[2] { new ComInterfaceEntry { IID = IID.IID_IErrorInfo, Vtable = IErrorInfoVftbl.AbiToProjectionVftablePtr }, new ComInterfaceEntry { IID = IID.IID_ISupportErrorInfo, Vtable = ISupportErrorInfoVftbl.AbiToProjectionVftablePtr } }; } } [WindowsRuntimeType(null)] [Guid("00000035-0000-0000-C000-000000000046")] [WindowsRuntimeHelperType(typeof(ABI.WinRT.Interop.IActivationFactory))] public interface IActivationFactory { nint ActivateInstance(); } [WindowsRuntimeType(null)] [Guid("C03F6A43-65A4-9818-987E-E0B810D2A6F2")] [WindowsRuntimeHelperType(typeof(ABI.WinRT.Interop.IAgileReference))] internal interface IAgileReference { IObjectReference Resolve(Guid riid); } [WindowsRuntimeType(null)] [Guid("94ea2b94-e9cc-49e0-c0ff-ee64ca8f5b90")] [WindowsRuntimeHelperType(typeof(ABI.WinRT.Interop.IAgileObject))] public interface IAgileObject { static readonly Guid IID = WinRT.Interop.IID.IID_IAgileObject; } internal struct IDelegateVftbl { public IUnknownVftbl IUnknownVftbl; public nint Invoke; } public static class IID { public static ref readonly Guid IID_IUnknown { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } public static ref readonly Guid IID_IInspectable { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 224, 226, 134, 175, 45, 177, 106, 76, 156, 90, 215, 170, 101, 16, 30, 144 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IWeakReference { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 55, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IWeakReferenceSource { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 56, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceTracker { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 58, 177, 211, 17, 14, 24, 137, 71, 168, 190, 119, 18, 136, 40, 147, 230 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceTrackerTarget { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 248, 67, 189, 100, 238, 191, 196, 78, 183, 235, 41, 53, 21, 141, 174, 33 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } public static ref readonly Guid IID_IActivationFactory { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 53, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } public static ref readonly Guid IID_IAgileObject { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 148, 43, 234, 148, 204, 233, 224, 73, 192, 255, 238, 100, 202, 143, 91, 144 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } public static ref readonly Guid IID_IMarshal { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 3, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } public static ref readonly Guid IID_IBuffer { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 224, 15, 90, 144, 83, 188, 223, 17, 140, 73, 0, 30, 79, 198, 134, 218 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } public static ref readonly Guid IID_IBufferByteAccess { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 239, 15, 90, 144, 83, 188, 223, 17, 140, 73, 0, 30, 79, 198, 134, 218 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } public static ref readonly Guid IID_IMemoryBufferByteAccess { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 53, 50, 13, 91, 186, 77, 68, 77, 134, 94, 143, 29, 14, 79, 208, 77 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IContextCallback { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 218, 1, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_ICallbackWithNoReentrancyToApplicationSTA { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 116, 151, 41, 10, 78, 62, 66, 252, 29, 157, 114, 206, 225, 5, 202, 87 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IErrorInfo { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 32, 177, 242, 28, 125, 84, 27, 16, 142, 101, 8, 0, 43, 43, 209, 25 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_ISupportErrorInfo { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 96, 61, 11, 223, 143, 84, 27, 16, 142, 101, 8, 0, 43, 43, 209, 25 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_ILanguageExceptionErrorInfo { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 243, 219, 162, 4, 131, 223, 108, 17, 9, 70, 8, 18, 171, 246, 224, 125 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_ILanguageExceptionErrorInfo2 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 196, 229, 70, 87, 151, 91, 76, 66, 182, 32, 40, 34, 145, 87, 52, 221 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IRestrictedErrorInfo { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 146, 112, 186, 130, 136, 76, 125, 66, 167, 188, 22, 221, 147, 254, 182, 126 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_INotifyPropertyChanged { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 1, 118, 177, 144, 101, 176, 110, 88, 131, 217, 154, 220, 58, 105, 82, 132 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_INotifyPropertyChanged { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 156, 214, 117, 207, 244, 242, 107, 72, 179, 2, 187, 76, 9, 186, 235, 250 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_INotifyCollectionChanged { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 225, 85, 1, 83, 165, 40, 147, 86, 135, 206, 48, 114, 77, 149, 160, 109 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_INotifyCollectionChanged { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 213, 103, 177, 40, 49, 26, 91, 70, 155, 37, 213, 195, 174, 104, 108, 64 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_INotifyCollectionChangedEventArgsFactory { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 164, 235, 8, 81, 146, 72, 32, 90, 131, 116, 169, 104, 21, 224, 253, 39 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_INotifyCollectionChangedEventArgsFactory { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 58, 62, 12, 179, 141, 223, 165, 68, 154, 56, 122, 192, 208, 140, 230, 61 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_INotifyCollectionChangedEventArgs { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 242, 159, 4, 218, 224, 210, 232, 95, 140, 123, 248, 127, 38, 6, 11, 111 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_INotifyCollectionChangedEventArgs { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 51, 141, 246, 76, 242, 227, 100, 73, 184, 94, 148, 91, 79, 126, 47, 33 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_NotifyCollectionChangedEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 220, 9, 9, 139, 5, 32, 147, 93, 191, 138, 114, 95, 1, 123, 170, 141 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_NotifyCollectionChangedEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 124, 179, 16, 202, 130, 243, 145, 69, 133, 87, 94, 36, 150, 82, 121, 176 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_PropertyChangedEventArgsRuntimeClassFactory { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 168, 39, 12, 124, 65, 11, 112, 80, 177, 96, 252, 154, 233, 96, 163, 108 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_PropertyChangedEventArgsRuntimeClassFactory { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 3, 156, 204, 109, 199, 224, 238, 78, 142, 169, 55, 227, 64, 110, 235, 28 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_PropertyChangedEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 246, 82, 222, 227, 50, 30, 166, 93, 187, 45, 181, 182, 9, 108, 150, 45 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_PropertyChangedEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 22, 156, 241, 80, 34, 10, 142, 77, 160, 137, 30, 169, 149, 22, 87, 210 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_DataErrorsChangedEventArgsRuntimeClassFactory { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 30, 189, 208, 98, 95, 184, 204, 95, 132, 42, 124, 176, 221, 163, 127, 229 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_UriRuntimeClassFactory { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 111, 121, 169, 68, 62, 114, 223, 79, 162, 24, 3, 62, 117, 176, 192, 132 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_INotifyDataErrorInfo { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 204, 194, 230, 14, 62, 39, 125, 86, 188, 10, 29, 216, 126, 229, 30, 186 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_ICommand { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 66, 53, 175, 229, 103, 202, 129, 64, 153, 91, 112, 157, 209, 55, 146, 223 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IGlobalInterfaceTable { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 70, 1, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_EventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 246, 152, 8, 197, 54, 197, 71, 95, 133, 131, 139, 44, 36, 56, 161, 59 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IBindableVectorView { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 231, 214, 109, 52, 110, 151, 195, 75, 129, 93, 236, 226, 67, 188, 15, 51 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IEnumerable { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 8, 44, 109, 3, 41, 223, 175, 65, 138, 162, 215, 116, 190, 98, 186, 111 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IList { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 222, 231, 61, 57, 208, 111, 13, 76, 187, 113, 71, 36, 74, 17, 62, 147 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_ICustomProperty { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 192, 146, 218, 48, 232, 35, 160, 66, 174, 124, 115, 74, 14, 93, 39, 130 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_ICustomPropertyProvider { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 85, 87, 146, 124, 72, 62, 180, 66, 134, 119, 118, 55, 34, 103, 3, 63 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IPropertyValue { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 221, 130, 214, 75, 84, 117, 233, 64, 154, 155, 130, 101, 78, 222, 126, 98 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IDisposable { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 41, 168, 213, 48, 164, 127, 38, 64, 131, 187, 215, 91, 174, 78, 169, 158 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IStringable { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 84, 159, 54, 150, 182, 142, 240, 72, 171, 206, 193, 178, 17, 230, 39, 195 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IServiceProvider { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 223, 162, 179, 104, 115, 129, 159, 83, 181, 36, 200, 162, 52, 143, 90, 251 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceOfPoint { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 34, 76, 241, 132, 10, 160, 114, 82, 141, 61, 130, 17, 46, 102, 223, 0 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceOfSize { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 134, 48, 114, 97, 83, 142, 118, 82, 159, 54, 42, 75, 185, 62, 43, 117 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceOfRect { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 17, 63, 66, 128, 79, 5, 172, 94, 175, 211, 99, 182, 206, 21, 231, 123 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceMatrix3x2 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 253, 140, 53, 118, 189, 44, 91, 82, 164, 158, 144, 238, 24, 36, 123, 113 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceMatrix4x4 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 220, 255, 203, 218, 239, 104, 208, 95, 182, 87, 120, 45, 10, 201, 128, 126 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferencePlane { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 161, 66, 213, 70, 247, 82, 231, 88, 172, 252, 154, 109, 54, 77, 160, 34 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceQuaternion { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 187, 4, 112, 178, 20, 192, 206, 93, 154, 33, 121, 156, 90, 60, 20, 97 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceVector2 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 158, 166, 246, 72, 101, 132, 174, 87, 148, 0, 151, 100, 8, 127, 101, 173 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceVector3 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 255, 112, 231, 30, 84, 201, 202, 89, 167, 84, 97, 153, 169, 190, 40, 44 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceVector4 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 201, 67, 232, 165, 32, 237, 57, 83, 143, 141, 159, 228, 4, 207, 54, 84 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfInt32 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 165, 128, 208, 166, 135, 176, 194, 91, 154, 159, 92, 214, 135, 180, 209, 247 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfString { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 142, 104, 133, 3, 199, 227, 94, 92, 163, 137, 85, 36, 237, 227, 73, 241 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfByte { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 131, 38, 242, 42, 52, 55, 208, 86, 166, 14, 104, 140, 200, 93, 22, 25 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfInt16 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 215, 143, 47, 145, 192, 173, 96, 93, 168, 150, 126, 215, 96, 137, 204, 91 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfUInt16 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 221, 162, 36, 102, 247, 131, 156, 81, 157, 85, 187, 31, 101, 96, 69, 107 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfUInt32 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 104, 75, 55, 151, 135, 235, 204, 86, 177, 142, 39, 239, 15, 156, 252, 12 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfInt64 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 113, 50, 51, 110, 42, 46, 85, 89, 135, 144, 131, 108, 118, 238, 83, 182 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfUInt64 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 52, 4, 182, 56, 124, 214, 62, 82, 157, 14, 36, 214, 67, 65, 16, 115 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfSingle { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 131, 234, 177, 106, 65, 203, 153, 95, 146, 204, 35, 189, 67, 54, 161, 251 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfDouble { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 83, 242, 1, 211, 163, 224, 43, 93, 154, 65, 164, 214, 43, 236, 70, 35 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfChar { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 171, 90, 9, 164, 125, 235, 130, 87, 143, 173, 22, 9, 222, 162, 73, 173 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfBoolean { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 102, 38, 231, 232, 204, 72, 63, 89, 186, 133, 38, 99, 73, 105, 86, 227 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfGuid { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 56, 152, 207, 238, 194, 193, 74, 91, 151, 111, 206, 194, 97, 174, 29, 85 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfDateTimeOffset { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 148, 149, 142, 27, 142, 88, 7, 90, 158, 101, 7, 49, 164, 201, 162, 219 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfTimeSpan { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 125, 25, 115, 173, 250, 44, 166, 87, 137, 147, 159, 172, 64, 254, 183, 145 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfObject { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 79, 168, 215, 156, 128, 12, 197, 89, 180, 78, 151, 120, 65, 187, 67, 217 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfType { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 167, 87, 132, 218, 235, 194, 161, 93, 128, 190, 113, 50, 162, 225, 191, 164 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfMatrix3x2 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 255, 217, 37, 165, 155, 192, 26, 80, 167, 133, 77, 30, 217, 225, 2, 184 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfMatrix4x4 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 21, 90, 13, 252, 157, 143, 143, 94, 136, 40, 174, 242, 194, 226, 91, 173 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfPlane { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 125, 127, 207, 249, 89, 84, 152, 95, 145, 185, 242, 99, 42, 158, 194, 152 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfQuaternion { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 190, 118, 186, 233, 49, 44, 29, 94, 152, 164, 235, 219, 98, 90, 238, 147 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfVector2 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 120, 33, 223, 41, 219, 255, 62, 86, 136, 219, 56, 105, 160, 7, 48, 94 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfVector3 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 250, 53, 26, 170, 78, 11, 72, 82, 189, 121, 255, 212, 124, 254, 64, 39 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfVector4 { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 80, 114, 117, 104, 73, 88, 114, 87, 144, 227, 170, 219, 76, 151, 11, 255 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_IReferenceArrayOfException { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 204, 228, 26, 64, 185, 74, 143, 90, 185, 147, 227, 39, 144, 12, 54, 77 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableByte { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 200, 140, 25, 229, 115, 40, 245, 85, 176, 161, 132, 255, 158, 74, 173, 98 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableSByte { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 41, 1, 80, 149, 246, 251, 252, 90, 137, 223, 112, 100, 45, 116, 25, 144 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableShort { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 27, 228, 201, 110, 9, 103, 71, 86, 153, 24, 161, 39, 1, 16, 252, 78 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableUShort { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 195, 210, 183, 90, 98, 107, 113, 94, 164, 182, 45, 73, 196, 242, 56, 253 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableInt { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 189, 239, 140, 84, 138, 188, 160, 95, 141, 242, 149, 116, 64, 252, 139, 244 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableUInt { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 175, 243, 62, 81, 132, 231, 37, 83, 169, 30, 151, 194, 184, 17, 28, 243 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableLong { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 36, 158, 218, 77, 159, 230, 106, 92, 160, 166, 147, 66, 115, 101, 175, 42 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableULong { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 118, 227, 85, 103, 187, 83, 139, 86, 161, 29, 23, 35, 152, 104, 48, 158 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableFloat { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 186, 194, 156, 113, 118, 62, 239, 93, 159, 26, 56, 216, 90, 20, 94, 168 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableDouble { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 41, 108, 45, 47, 115, 84, 62, 95, 146, 231, 150, 87, 43, 185, 144, 226 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableChar { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 243, 62, 57, 251, 172, 187, 213, 91, 145, 68, 132, 242, 53, 118, 244, 21 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableBool { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 96, 253, 0, 60, 80, 41, 57, 89, 162, 26, 45, 18, 197, 160, 27, 138 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableGuid { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 73, 246, 80, 125, 44, 99, 249, 81, 132, 154, 238, 73, 66, 137, 51, 234 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableDateTimeOffset { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 167, 216, 65, 85, 124, 73, 164, 90, 134, 252, 119, 19, 173, 191, 42, 44 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableTimeSpan { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 76, 12, 77, 96, 222, 145, 42, 92, 147, 95, 54, 47, 19, 234, 248, 0 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableObject { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 144, 204, 220, 6, 88, 160, 136, 92, 135, 183, 111, 51, 96, 162, 252, 22 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableType { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 153, 173, 48, 56, 218, 216, 243, 83, 152, 155, 252, 146, 173, 34, 39, 120 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableException { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 30, 122, 242, 111, 106, 75, 183, 89, 178, 195, 209, 242, 238, 71, 69, 147 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 5, 15, 35, 37, 156, 180, 238, 87, 137, 97, 83, 115, 217, 142, 26, 177 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_NullableString { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 251, 109, 65, 253, 7, 42, 235, 82, 170, 227, 223, 206, 20, 17, 108, 5 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_NullablePropertyChangedEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 203, 224, 234, 30, 87, 143, 55, 92, 160, 135, 165, 93, 70, 226, 254, 63 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_NullablePropertyChangedEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 169, 32, 169, 177, 242, 194, 83, 84, 165, 62, 102, 177, 41, 74, 139, 254 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_MUX_NullableNotifyCollectionChangedEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 33, 90, 157, 119, 125, 14, 118, 84, 187, 144, 39, 250, 59, 75, 141, 229 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } internal static ref readonly Guid IID_WUX_NullableNotifyCollectionChangedEventHandler { [MethodImpl(256)] get { System.ReadOnlySpan readOnlySpan = (System.ReadOnlySpan)new byte[16] { 110, 92, 253, 164, 73, 101, 169, 89, 134, 239, 90, 73, 10, 24, 117, 217 }; return ref System.Runtime.CompilerServices.Unsafe.As(ref MemoryMarshal.GetReference(readOnlySpan)); } } } internal enum MSHCTX { Local, NoSharedMem, DifferentMachine, InProc, CrossCtx } internal enum MSHLFLAGS { Normal = 0, TableStrong = 1, TableWeak = 2, NoPing = 4 } [Guid("11D3B13A-180E-4789-A8BE-7712882893E6")] internal struct IReferenceTrackerVftbl { public IUnknownVftbl IUnknownVftbl; private unsafe void* _ConnectFromTrackerSource_0; private unsafe void* _DisconnectFromTrackerSource_1; private unsafe void* _FindTrackerTargets_2; private unsafe void* _GetReferenceTrackerManager_3; private unsafe void* _AddRefFromTrackerSource_4; private unsafe void* _ReleaseFromTrackerSource_5; private unsafe void* _PegFromTrackerSource_6; public unsafe delegate* unmanaged[Stdcall] AddRefFromTrackerSource { get { return (delegate* unmanaged[Stdcall])_AddRefFromTrackerSource_4; } set { _AddRefFromTrackerSource_4 = value; } } public unsafe delegate* unmanaged[Stdcall] ReleaseFromTrackerSource { get { return (delegate* unmanaged[Stdcall])_ReleaseFromTrackerSource_5; } set { _ReleaseFromTrackerSource_5 = value; } } } [Guid("00000000-0000-0000-C000-000000000046")] public struct IUnknownVftbl { private unsafe void* _QueryInterface; private unsafe void* _AddRef; private unsafe void* _Release; public unsafe delegate* unmanaged[Stdcall] QueryInterface { get { return (delegate* unmanaged[Stdcall])_QueryInterface; } set { _QueryInterface = value; } } public unsafe delegate* unmanaged[Stdcall] AddRef { get { return (delegate* unmanaged[Stdcall])_AddRef; } set { _AddRef = value; } } public unsafe delegate* unmanaged[Stdcall] Release { get { return (delegate* unmanaged[Stdcall])_Release; } set { _Release = value; } } public static IUnknownVftbl AbiToProjectionVftbl => ComWrappersSupport.IUnknownVftbl; public static nint AbiToProjectionVftblPtr => ComWrappersSupport.IUnknownVftblPtr; internal unsafe bool Equals(IUnknownVftbl other) { if (_QueryInterface == other._QueryInterface && _AddRef == other._AddRef) { return _Release == other._Release; } return false; } internal unsafe static bool IsReferenceToManagedObject(nint ptr) { return ((IUnknownVftbl*)(*(nint*)ptr))->Equals(AbiToProjectionVftbl); } } [WindowsRuntimeType(null)] [Guid("00000038-0000-0000-C000-000000000046")] [WindowsRuntimeHelperType(typeof(ABI.WinRT.Interop.IWeakReferenceSource))] public interface IWeakReferenceSource { IWeakReference GetWeakReference(); } [WindowsRuntimeType(null)] [Guid("00000037-0000-0000-C000-000000000046")] [WindowsRuntimeHelperType(typeof(ABI.WinRT.Interop.IWeakReference))] public interface IWeakReference { IObjectReference Resolve(Guid riid); } [WinRTExposedType(typeof(ManagedWeakReferenceTypeDetails))] internal sealed class ManagedWeakReference : IWeakReference { private readonly WeakReference _ref; public ManagedWeakReference(object obj) { _ref = new WeakReference(obj); } public IObjectReference Resolve(Guid riid) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) object obj = default(object); if (!_ref.TryGetTarget(ref obj)) { return null; } return ComWrappersSupport.CreateCCWForObject(obj, riid); } public nint ResolveForABI(Guid riid) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) object obj = default(object); if (!_ref.TryGetTarget(ref obj)) { return System.IntPtr.Zero; } return ComWrappersSupport.CreateCCWForObjectForABI(obj, riid); } } internal sealed class ManagedWeakReferenceTypeDetails : IWinRTExposedTypeDetails { public ComInterfaceEntry[] GetExposedInterfaces() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) return (ComInterfaceEntry[])(object)new ComInterfaceEntry[1] { new ComInterfaceEntry { IID = IID.IID_IWeakReference, Vtable = ABI.WinRT.Interop.IWeakReference.AbiToProjectionVftablePtr } }; } } [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsBoolean(nint thisPtr, out byte value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] internal unsafe delegate int _get_PropertyAsBoolean_Abi(nint thisPtr, byte* value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsBoolean(nint thisPtr, byte value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsChar(nint thisPtr, out ushort value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsChar(nint thisPtr, ushort value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsSByte(nint thisPtr, out sbyte value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsSByte(nint thisPtr, sbyte value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsByte(nint thisPtr, out byte value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsByte(nint thisPtr, byte value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsInt16(nint thisPtr, out short value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsInt16(nint thisPtr, short value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsUInt16(nint thisPtr, out ushort value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsUInt16(nint thisPtr, ushort value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsInt32(nint thisPtr, out int value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsInt32(nint thisPtr, int value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsUInt32(nint thisPtr, out uint value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] internal unsafe delegate int _get_PropertyAsUInt32_Abi(nint thisPtr, uint* value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsUInt32(nint thisPtr, uint value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsInt64(nint thisPtr, out long value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsInt64(nint thisPtr, long value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsUInt64(nint thisPtr, out ulong value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsUInt64(nint thisPtr, ulong value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsFloat(nint thisPtr, out float value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsFloat(nint thisPtr, float value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsDouble(nint thisPtr, out double value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsDouble(nint thisPtr, double value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsObject(nint thisPtr, out nint value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsObject(nint thisPtr, nint value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsGuid(nint thisPtr, out Guid value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsGuid(nint thisPtr, Guid value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _get_PropertyAsString(nint thisPtr, out nint value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _put_PropertyAsString(nint thisPtr, nint value); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _add_EventHandler(nint thisPtr, nint handler, out EventRegistrationToken token); [EditorBrowsable(/*Could not decode attribute arguments.*/)] public delegate int _remove_EventHandler(nint thisPtr, EventRegistrationToken token); [AttributeUsage(/*Could not decode attribute arguments.*/)] internal sealed class WuxMuxProjectedTypeAttribute : System.Attribute { } internal static class Platform { [DllImport("api-ms-win-core-com-l1-1-0.dll")] public unsafe static extern int CoCreateInstance(Guid* clsid, nint outer, uint clsContext, Guid* iid, nint* instance); [DllImport("api-ms-win-core-com-l1-1-0.dll")] public static extern int CoDecrementMTAUsage(nint cookie); [DllImport("api-ms-win-core-com-l1-1-0.dll")] public unsafe static extern int CoIncrementMTAUsage(nint* cookie); [DllImport("api-ms-win-core-winrt-l1-1-0.dll")] public unsafe static extern int RoGetActivationFactory(nint runtimeClassId, Guid* iid, nint* factory); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = 3)] public unsafe static extern int WindowsCreateString(ushort* sourceString, int length, nint* hstring); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = 3)] public unsafe static extern int WindowsCreateStringReference(ushort* sourceString, int length, nint* hstring_header, nint* hstring); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = 3)] public static extern int WindowsDeleteString(nint hstring); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = 3)] public unsafe static extern char* WindowsGetStringRawBuffer(nint hstring, uint* length); [DllImport("api-ms-win-core-com-l1-1-1.dll", CallingConvention = 3)] public unsafe static extern int RoGetAgileReference(uint options, Guid* iid, nint unknown, nint* agileReference); [DllImport("api-ms-win-core-com-l1-1-0.dll")] public unsafe static extern int CoGetContextToken(nint* contextToken); [DllImport("api-ms-win-core-com-l1-1-0.dll")] public unsafe static extern int CoGetObjectContext(Guid* riid, nint* ppv); [DllImport("oleaut32.dll")] public static extern int SetErrorInfo(uint dwReserved, nint perrinfo); [DllImport("api-ms-win-core-com-l1-1-0.dll")] public unsafe static extern int CoCreateFreeThreadedMarshaler(nint outer, nint* marshalerPtr); public static bool FreeLibrary(nint moduleHandle) { return LibraryImportStubs.FreeLibrary(moduleHandle); } public unsafe static nint TryGetProcAddress(nint moduleHandle, System.ReadOnlySpan functionName) { fixed (byte* functionName2 = functionName.GetPinnableReference()) { return LibraryImportStubs.GetProcAddress(moduleHandle, (sbyte*)functionName2); } } public static nint GetProcAddress(nint moduleHandle, System.ReadOnlySpan functionName) { nint num = TryGetProcAddress(moduleHandle, functionName); if (num == (nint)System.IntPtr.Zero) { Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error(), (System.IntPtr)new System.IntPtr(-1)); } return num; } public unsafe static nint LoadLibraryExW(string fileName, nint fileHandle, uint flags) { fixed (char* fileName2 = fileName) { return LibraryImportStubs.LoadLibraryExW((ushort*)fileName2, fileHandle, flags); } } } internal static class LibraryImportStubs { public static bool FreeLibrary(nint moduleHandle) { Marshal.SetLastSystemError(0); int num = PInvoke(moduleHandle); int lastSystemError = Marshal.GetLastSystemError(); bool result = num != 0; Marshal.SetLastPInvokeError(lastSystemError); return result; [DllImport("kernel32.dll", EntryPoint = "FreeLibrary", ExactSpelling = true)] [CompilerGenerated] static extern int PInvoke(nint nativeModuleHandle); } public unsafe static nint GetProcAddress(nint moduleHandle, sbyte* functionName) { Marshal.SetLastSystemError(0); nint result = PInvoke(moduleHandle, functionName); int lastSystemError = Marshal.GetLastSystemError(); Marshal.SetLastPInvokeError(lastSystemError); return result; [DllImport("kernel32.dll", EntryPoint = "GetProcAddress", ExactSpelling = true)] [CompilerGenerated] static extern unsafe nint PInvoke(nint nativeModuleHandle, sbyte* nativeFunctionName); } public unsafe static nint LoadLibraryExW(ushort* fileName, nint fileHandle, uint flags) { Marshal.SetLastSystemError(0); nint result = PInvoke(fileName, fileHandle, flags); int lastSystemError = Marshal.GetLastSystemError(); Marshal.SetLastPInvokeError(lastSystemError); return result; [DllImport("kernel32.dll", EntryPoint = "LoadLibraryExW", ExactSpelling = true)] [CompilerGenerated] static extern unsafe nint PInvoke(ushort* nativeFileName, nint nativeFileHandle, uint nativeFlags); } } }