File: _generated\28\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum.cs
Web Access
Project: src\src\runtime\src\native\managed\cdac\Microsoft.Diagnostics.DataContractReader.Legacy\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 unsafe struct InterfaceImplementationVtable
{
    public delegate* unmanaged[MemberFunction]<void*, global::System.Guid*, void**, int> QueryInterface_0;
    public delegate* unmanaged[MemberFunction]<void*, uint> AddRef_1;
    public delegate* unmanaged[MemberFunction]<void*, uint> Release_2;
    public delegate* unmanaged[MemberFunction]<global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch*, uint, int> Skip_3;
    public delegate* unmanaged[MemberFunction]<global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch*, int> Reset_4;
    public delegate* unmanaged[MemberFunction]<global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch*, uint*, int> GetCount_5;
    public delegate* unmanaged[MemberFunction]<global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch*, uint, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData*, uint*, int> Next_6;
    public delegate* unmanaged[MemberFunction]<global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch*, void**, int> EnumerateErrors_7;
}

file unsafe sealed class InterfaceInformation : global::System.Runtime.InteropServices.Marshalling.IIUnknownInterfaceType
{
    public static global::System.Guid Iid { get; } = new([189, 66, 166, 143, 16, 159, 153, 71, 154, 163, 81, 42, 231, 140, 119, 238]);
    public static void** ManagedVirtualMethodTable => (void**)global::System.Runtime.CompilerServices.Unsafe.AsPointer(in InterfaceImplementation.Vtable);
}

[global::System.Runtime.InteropServices.DynamicInterfaceCastableImplementationAttribute]
file unsafe interface InterfaceImplementation : global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum
{
    [global::System.Runtime.CompilerServices.FixedAddressValueTypeAttribute]
    public static readonly InterfaceImplementationVtable Vtable;

    static InterfaceImplementation()
    {
        global::System.Runtime.InteropServices.NativeMemory.Copy(
            global::System.Runtime.InteropServices.Marshalling.StrategyBasedComWrappers.DefaultIUnknownInterfaceDetailsStrategy.GetIUnknownDerivedDetails(typeof(global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSEnum).TypeHandle).ManagedVirtualMethodTable,
            global::System.Runtime.CompilerServices.Unsafe.AsPointer(ref Vtable),
            (nuint)(sizeof(void*) * 6));

        Vtable.Next_6 = &ABI_Next;
        Vtable.EnumerateErrors_7 = &ABI_EnumerateErrors;
    }

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "11.0.14.22804")]
    [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum.Next(uint count, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData[] refs, uint* pFetched)
    {
        var(__this, __vtable) = ((global::System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider)this).GetVirtualMethodTableInfoForKey(typeof(global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum));
        var __target = ((delegate* unmanaged[MemberFunction]<void*, uint, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData*, uint*, int> )__vtable[6]);
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __refs_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData>.ManagedToUnmanagedIn.GetPinnableReference(refs))
            {
                __retVal = __target(__this, count, (global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData*)__refs_native, pFetched);
            }
    
            // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
            global::System.GC.KeepAlive(this);
            return __retVal;
        }
    }

    [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(CallConvs = new[] { typeof(global::System.Runtime.CompilerServices.CallConvMemberFunction) })]
    internal static int ABI_Next(global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, uint count, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData* __refs_native, uint* pFetched)
    {
        global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum @this = default;
        global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData[] refs = default;
        int __retVal = default;
        // Setup - Perform required setup.
        int __refs_native__numElements;
        __refs_native__numElements = default;
        try
        {
            // Unmarshal - Convert native data to managed data.
            __refs_native__numElements = checked((int)(count));
            refs = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData>.AllocateContainerForManagedElements(__refs_native, __refs_native__numElements);
            global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData>.GetUnmanagedValuesSource(__refs_native, __refs_native__numElements).CopyTo(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData>.GetManagedValuesDestination(refs));
            @this = global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum>(__this_native);
            __retVal = @this.Next(count, refs, pFetched);
            // Marshal - Convert managed data to native data.
            global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData>.GetManagedValuesDestination(refs).CopyTo(global::System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData>.GetUnmanagedValuesSource(__refs_native, __refs_native__numElements)), global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData, global::Microsoft.Diagnostics.DataContractReader.Legacy.SOSStackRefData>.GetUnmanagedValuesSource(__refs_native, __refs_native__numElements).Length));
        }
        catch (global::System.Exception __exception)
        {
            __retVal = global::System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
        }
    
        return __retVal;
    }

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "11.0.14.22804")]
    [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum.EnumerateErrors(global::Microsoft.Diagnostics.DataContractReader.Legacy.DacComNullableByRef<global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefErrorEnum> ppEnum)
    {
        var(__this, __vtable) = ((global::System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider)this).GetVirtualMethodTableInfoForKey(typeof(global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum));
        var __target = ((delegate* unmanaged[MemberFunction]<void*, void**, int> )__vtable[7]);
        {
            void** __ppEnum_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::Microsoft.Diagnostics.DataContractReader.Legacy.DacComNullableByRefMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefErrorEnum>.ManagedToUnmanaged __ppEnum_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ppEnum_native__marshaller.FromManaged(ppEnum);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ppEnum_native = __ppEnum_native__marshaller.ToUnmanaged();
                    __retVal = __target(__this, __ppEnum_native);
                }
    
                // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
                __ppEnum_native__marshaller.OnInvoked();
                global::System.GC.KeepAlive(this);
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ppEnum_native__marshaller.Free();
            }
    
            return __retVal;
        }
    }

    [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(CallConvs = new[] { typeof(global::System.Runtime.CompilerServices.CallConvMemberFunction) })]
    internal static int ABI_EnumerateErrors(global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, void** __ppEnum_native)
    {
        global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum @this = default;
        global::Microsoft.Diagnostics.DataContractReader.Legacy.DacComNullableByRef<global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefErrorEnum> ppEnum = default;
        int __retVal = default;
        // Setup - Perform required setup.
        global::Microsoft.Diagnostics.DataContractReader.Legacy.DacComNullableByRefMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefErrorEnum>.UnmanagedToManaged __ppEnum_native__marshaller = new();
        try
        {
            // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
            __ppEnum_native__marshaller.FromUnmanaged(__ppEnum_native);
            // Unmarshal - Convert native data to managed data.
            ppEnum = __ppEnum_native__marshaller.ToManaged();
            @this = global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum>(__this_native);
            __retVal = @this.EnumerateErrors(ppEnum);
        }
        catch (global::System.Exception __exception)
        {
            __retVal = global::System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
        }
        finally
        {
            // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
            __ppEnum_native__marshaller.Free();
        }
    
        return __retVal;
    }

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "11.0.14.22804")]
    [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum.Skip(uint count)
    {
        var(__this, __vtable) = ((global::System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider)this).GetVirtualMethodTableInfoForKey(typeof(global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum));
        var __target = ((delegate* unmanaged[MemberFunction]<void*, uint, int> )__vtable[3]);
        {
            int __retVal;
            {
                __retVal = __target(__this, count);
            }
    
            // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
            global::System.GC.KeepAlive(this);
            return __retVal;
        }
    }

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "11.0.14.22804")]
    [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum.Reset()
    {
        var(__this, __vtable) = ((global::System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider)this).GetVirtualMethodTableInfoForKey(typeof(global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum));
        var __target = ((delegate* unmanaged[MemberFunction]<void*, int> )__vtable[4]);
        {
            int __retVal;
            {
                __retVal = __target(__this);
            }
    
            // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
            global::System.GC.KeepAlive(this);
            return __retVal;
        }
    }

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "11.0.14.22804")]
    [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum.GetCount(uint* pCount)
    {
        var(__this, __vtable) = ((global::System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider)this).GetVirtualMethodTableInfoForKey(typeof(global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStackRefEnum));
        var __target = ((delegate* unmanaged[MemberFunction]<void*, uint*, int> )__vtable[5]);
        {
            int __retVal;
            {
                __retVal = __target(__this, pCount);
            }
    
            // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
            global::System.GC.KeepAlive(this);
            return __retVal;
        }
    }

    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSEnum.Skip(uint count) => throw new global::System.Diagnostics.UnreachableException();

    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSEnum.Reset() => throw new global::System.Diagnostics.UnreachableException();

    int global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSEnum.GetCount(uint* pCount) => throw new global::System.Diagnostics.UnreachableException();
}

namespace Microsoft.Diagnostics.DataContractReader.Legacy
{
    [global::System.Runtime.InteropServices.Marshalling.IUnknownDerivedAttribute<InterfaceInformation, InterfaceImplementation>]
    public unsafe partial interface ISOSStackRefEnum
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "11.0.14.22804")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        [global::System.Runtime.InteropServices.PreserveSigAttribute()]
        new int Skip(uint count) => ((global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSEnum)this).Skip(count);
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "11.0.14.22804")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        [global::System.Runtime.InteropServices.PreserveSigAttribute()]
        new int Reset() => ((global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSEnum)this).Reset();
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "11.0.14.22804")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        [global::System.Runtime.InteropServices.PreserveSigAttribute()]
        new int GetCount(uint* pCount) => ((global::Microsoft.Diagnostics.DataContractReader.Legacy.ISOSEnum)this).GetCount(pCount);
    }
}