File: Generated\361d1da7f942c932\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface4.cs
Project: Microsoft.Diagnostics.DataContractReader.Legacy.csproj (Microsoft.Diagnostics.DataContractReader.Legacy)
// <auto-generated />
#pragma warning disable CS0612, CS0618, CS0649, CS1591
 
[global::System.Runtime.InteropServices.StructLayoutAttribute(global::System.Runtime.InteropServices.LayoutKind.Sequential)]
file struct InterfaceImplementationVtable
{
    public unsafe delegate* unmanaged[MemberFunction]<void*, global::System.Guid*, void**, int> QueryInterface_0;
    public unsafe delegate* unmanaged[MemberFunction]<void*, uint> AddRef_1;
    public unsafe delegate* unmanaged[MemberFunction]<void*, uint> Release_2;
    public unsafe delegate* unmanaged[MemberFunction]<global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch*, ulong*, int, int*, int> GetClrNotification_3;
}
 
file sealed class InterfaceInformation : global::System.Runtime.InteropServices.Marshalling.IIUnknownInterfaceType
{
    public static global::System.Guid Iid { get; } = new([76, 211, 185, 116, 18, 166, 7, 75, 147, 221, 84, 98, 23, 143, 206, 17]);
    public static unsafe void** ManagedVirtualMethodTable
    {
        get
        {
            unsafe
            {
                return (void**)global::System.Runtime.CompilerServices.Unsafe.AsPointer(in InterfaceImplementation.Vtable);
            }
        }
    }
}
 
[global::System.Runtime.InteropServices.DynamicInterfaceCastableImplementationAttribute]
file unsafe interface InterfaceImplementation : global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface4
{
    [global::System.Runtime.CompilerServices.FixedAddressValueTypeAttribute]
    public static readonly InterfaceImplementationVtable Vtable;
 
    static InterfaceImplementation()
    {
        unsafe
        {
            global::System.Runtime.InteropServices.ComWrappers.GetIUnknownImpl(
                out *(nint*)&((InterfaceImplementationVtable*)global::System.Runtime.CompilerServices.Unsafe.AsPointer(ref Vtable))->QueryInterface_0,
                out *(nint*)&((InterfaceImplementationVtable*)global::System.Runtime.CompilerServices.Unsafe.AsPointer(ref Vtable))->AddRef_1,
                out *(nint*)&((InterfaceImplementationVtable*)global::System.Runtime.CompilerServices.Unsafe.AsPointer(ref Vtable))->Release_2);
 
            Vtable.GetClrNotification_3 = &ABI_GetClrNotification;
        }
    }
 
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "12.0.14.48102")]
    [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface4.GetClrNotification(global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress[] arguments, int count, int* pNeeded)
    {
        unsafe
        {
            var (__this, __vtable) = ((global::System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider)this).GetVirtualMethodTableInfoForKey(typeof(global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface4));
            var __target = ((delegate* unmanaged[MemberFunction]<void*, ulong*, int, int*, int>)__vtable[3]);
            {
                bool __invokeSucceeded = default;
                ulong* __arguments_native = default;
                int __retVal = default;
                // Setup - Perform required setup.
                scoped global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.ManagedToUnmanagedIn __arguments_native__marshaller = new();
                int __arguments_native__numElements;
                global::System.Runtime.CompilerServices.Unsafe.SkipInit(out __arguments_native__numElements);
                int __arguments_native__lastIndexMarshalled = 0;
                try
                {
                    // Marshal - Convert managed data to native data.
                    __arguments_native__marshaller.FromManaged(arguments, stackalloc ulong[global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.ManagedToUnmanagedIn.BufferSize]);
                    {
                        global::System.ReadOnlySpan<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __arguments_native__managedSpan = __arguments_native__marshaller.GetManagedValuesSource();
                        global::System.Span<ulong> __arguments_native__nativeSpan = __arguments_native__marshaller.GetUnmanagedValuesDestination();
                        for (int __i0 = 0; __i0 < __arguments_native__managedSpan.Length; ++__i0, ++__arguments_native__lastIndexMarshalled)
                        {
                            __arguments_native__nativeSpan[__i0] = global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddressMarshaller.ConvertToUnmanaged(__arguments_native__managedSpan[__i0]);
                        }
                    }
                    // Pin - Pin data in preparation for calling the P/Invoke.
                    fixed (void* __arguments_native__unused = __arguments_native__marshaller)
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __arguments_native = __arguments_native__marshaller.ToUnmanaged();
                        __retVal = __target(__this, __arguments_native, count, pNeeded);
                    }
                    // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
                    global::System.GC.KeepAlive(this);
                    __invokeSucceeded = true;
                    // Unmarshal - Convert native data to managed data.
                    {
                        __arguments_native__numElements = __arguments_native__marshaller.GetManagedValuesSource().Length;
                        global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __arguments_native__managedSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in __arguments_native__marshaller.GetManagedValuesSource().GetPinnableReference()), __arguments_native__numElements);
                        global::System.Span<ulong> __arguments_native__nativeSpan = __arguments_native__marshaller.GetUnmanagedValuesDestination();
                        for (int __i0 = 0; __i0 < __arguments_native__managedSpan.Length; ++__i0)
                        {
                            __arguments_native__managedSpan[__i0] = global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddressMarshaller.ConvertToManaged(__arguments_native__nativeSpan[__i0]);
                        }
                    }
                }
                finally
                {
                    if (__invokeSucceeded)
                    {
                        // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                        _ = __arguments_native__lastIndexMarshalled;
                    }
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    _ = __arguments_native__lastIndexMarshalled;
                    __arguments_native__marshaller.Free();
                }
                return __retVal;
            }
        }
    }
 
    [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(CallConvs = new[] { typeof(global::System.Runtime.CompilerServices.CallConvMemberFunction) })]
    internal static unsafe int ABI_GetClrNotification(global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, ulong* __arguments_native, int count, int* pNeeded)
    {
        unsafe
        {
            global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface4 @this = default;
            global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress[] arguments = default;
            int __retVal = default;
            // Setup - Perform required setup.
            int __arguments_native__numElements;
            __arguments_native__numElements = default;
            try
            {
                // Unmarshal - Convert native data to managed data.
                __arguments_native__numElements = count;
                arguments = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.AllocateContainerForManagedElements(__arguments_native, __arguments_native__numElements);
                {
                    global::System.ReadOnlySpan<ulong> __arguments_native__nativeSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__arguments_native, __arguments_native__numElements);
                    global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __arguments_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(arguments);
                    for (int __i0 = 0; __i0 < __arguments_native__nativeSpan.Length; ++__i0)
                    {
                        __arguments_native__managedSpan[__i0] = global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddressMarshaller.ConvertToManaged(__arguments_native__nativeSpan[__i0]);
                    }
                }
                @this = global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface4>(__this_native);
                __retVal = @this.GetClrNotification(arguments, count, pNeeded);
                // Marshal - Convert managed data to native data.
                {
                    __arguments_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(arguments).Length;
                    global::System.Span<ulong> __arguments_native__nativeSpan = global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.CompilerServices.Unsafe.AsRef(in global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetUnmanagedValuesSource(__arguments_native, __arguments_native__numElements).GetPinnableReference()), __arguments_native__numElements);
                    global::System.Span<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress> __arguments_native__managedSpan = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(arguments);
                    for (int __i0 = 0; __i0 < __arguments_native__nativeSpan.Length; ++__i0)
                    {
                        ulong __arguments_native__nativeSpan____i0__original = __arguments_native__nativeSpan[__i0];
                        __arguments_native__nativeSpan[__i0] = global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddressMarshaller.ConvertToUnmanaged(__arguments_native__managedSpan[__i0]);
                    }
                }
            }
            catch (global::System.Exception __exception)
            {
                __retVal = global::System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
            }
            return __retVal;
        }
    }
}
 
namespace Microsoft.Diagnostics.DataContractReader.Legacy
{
    [global::System.Runtime.InteropServices.Marshalling.IUnknownDerivedAttribute<InterfaceInformation, InterfaceImplementation>]
    public unsafe partial interface ISOSDacInterface4
    {
    }
}