File: Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\Microsoft.DiaSymReader.ISymNGenWriter.cs
Project: ILCompiler.Diagnostics.csproj (ILCompiler.Diagnostics)
// <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*, ushort*, ushort, ulong, int> AddSymbol_3;
    public unsafe delegate* unmanaged[MemberFunction]<global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch*, ushort, global::Microsoft.DiaSymReader.OMF, int, int, int> AddSection_4;
}
 
file sealed class InterfaceInformation : global::System.Runtime.InteropServices.Marshalling.IIUnknownInterfaceType
{
    public static global::System.Guid Iid { get; } = new([18, 253, 130, 214, 222, 67, 28, 65, 129, 27, 190, 132, 4, 206, 161, 38]);
    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.DiaSymReader.ISymNGenWriter
{
    [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.AddSymbol_3 = &ABI_AddSymbol;
            Vtable.AddSection_4 = &ABI_AddSection;
        }
    }
 
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.ComInterfaceGenerator", "12.0.14.48102")]
    [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
    void global::Microsoft.DiaSymReader.ISymNGenWriter.AddSymbol(string pSymbol, ushort iSection, ulong rva)
    {
        unsafe
        {
            var (__this, __vtable) = ((global::System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider)this).GetVirtualMethodTableInfoForKey(typeof(global::Microsoft.DiaSymReader.ISymNGenWriter));
            var __target = ((delegate* unmanaged[MemberFunction]<void*, ushort*, ushort, ulong, int>)__vtable[3]);
            {
                ushort* __pSymbol_native = default;
                int __invokeRetVal = default;
                // Setup - Perform required setup.
                scoped global::System.Runtime.InteropServices.Marshalling.BStrStringMarshaller.ManagedToUnmanagedIn __pSymbol_native__marshaller = new();
                try
                {
                    // Marshal - Convert managed data to native data.
                    __pSymbol_native__marshaller.FromManaged(pSymbol, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.BStrStringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __pSymbol_native = __pSymbol_native__marshaller.ToUnmanaged();
                        __invokeRetVal = __target(__this, __pSymbol_native, iSection, rva);
                    }
                    // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
                    global::System.GC.KeepAlive(this);
                    // Unmarshal - Convert native data to managed data.
                    global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([18, 253, 130, 214, 222, 67, 28, 65, 129, 27, 190, 132, 4, 206, 161, 38]), (nint)__this);
                }
                finally
                {
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    __pSymbol_native__marshaller.Free();
                }
            }
        }
    }
 
    [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(CallConvs = new[] { typeof(global::System.Runtime.CompilerServices.CallConvMemberFunction) })]
    internal static unsafe int ABI_AddSymbol(global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, ushort* __pSymbol_native, ushort iSection, ulong rva)
    {
        unsafe
        {
            global::Microsoft.DiaSymReader.ISymNGenWriter @this = default;
            string pSymbol = default;
            int __retVal = default;
            try
            {
                // Unmarshal - Convert native data to managed data.
                __retVal = 0; // S_OK
                pSymbol = global::System.Runtime.InteropServices.Marshalling.BStrStringMarshaller.ConvertToManaged(__pSymbol_native);
                @this = global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::Microsoft.DiaSymReader.ISymNGenWriter>(__this_native);
                @this.AddSymbol(pSymbol, iSection, rva);
            }
            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", "12.0.14.48102")]
    [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
    void global::Microsoft.DiaSymReader.ISymNGenWriter.AddSection(ushort iSection, global::Microsoft.DiaSymReader.OMF flags, int offset, int cb)
    {
        unsafe
        {
            var (__this, __vtable) = ((global::System.Runtime.InteropServices.Marshalling.IUnmanagedVirtualMethodTableProvider)this).GetVirtualMethodTableInfoForKey(typeof(global::Microsoft.DiaSymReader.ISymNGenWriter));
            var __target = ((delegate* unmanaged[MemberFunction]<void*, ushort, global::Microsoft.DiaSymReader.OMF, int, int, int>)__vtable[4]);
            {
                int __invokeRetVal;
                {
                    __invokeRetVal = __target(__this, iSection, flags, offset, cb);
                }
                // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
                global::System.GC.KeepAlive(this);
                // Unmarshal - Convert native data to managed data.
                global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([18, 253, 130, 214, 222, 67, 28, 65, 129, 27, 190, 132, 4, 206, 161, 38]), (nint)__this);
            }
        }
    }
 
    [global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(CallConvs = new[] { typeof(global::System.Runtime.CompilerServices.CallConvMemberFunction) })]
    internal static unsafe int ABI_AddSection(global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch* __this_native, ushort iSection, global::Microsoft.DiaSymReader.OMF flags, int offset, int cb)
    {
        unsafe
        {
            global::Microsoft.DiaSymReader.ISymNGenWriter @this = default;
            int __retVal = default;
            try
            {
                // Unmarshal - Convert native data to managed data.
                __retVal = 0; // S_OK
                @this = global::System.Runtime.InteropServices.ComWrappers.ComInterfaceDispatch.GetInstance<global::Microsoft.DiaSymReader.ISymNGenWriter>(__this_native);
                @this.AddSection(iSection, flags, offset, cb);
            }
            catch (global::System.Exception __exception)
            {
                __retVal = global::System.Runtime.InteropServices.Marshalling.ExceptionAsHResultMarshaller<int>.ConvertToUnmanaged(__exception);
            }
            return __retVal;
        }
    }
}
 
namespace Microsoft.DiaSymReader
{
    [global::System.Runtime.InteropServices.Marshalling.IUnknownDerivedAttribute<InterfaceInformation, InterfaceImplementation>]
    internal unsafe partial interface ISymNGenWriter
    {
    }
}