File: _generated\39\LibraryImports.g.cs
Web Access
Project: src\src\symreader\src\Microsoft.DiaSymReader\Microsoft.DiaSymReader.csproj (Microsoft.DiaSymReader)
// <auto-generated/>
namespace Microsoft.DiaSymReader
{
    internal static unsafe partial class SymUnmanagedFactory
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.22804")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial nint LoadLibraryW(string path)
        {
            nint __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __path_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(path))
            {
                __retVal = __PInvoke((ushort*)__path_native);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("kernel32", EntryPoint = "LoadLibraryW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe nint __PInvoke(ushort* __path_native);
        }
    }
}
namespace Microsoft.DiaSymReader
{
    internal static unsafe partial class SymUnmanagedFactory
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.22804")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial nint GetProcAddress(nint hModule, string procedureName)
        {
            byte* __procedureName_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn __procedureName_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __procedureName_native__marshaller.FromManaged(procedureName, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __procedureName_native = __procedureName_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(hModule, __procedureName_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __procedureName_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("kernel32", EntryPoint = "GetProcAddress", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __hModule_native, byte* __procedureName_native);
        }
    }
}
namespace Microsoft.DiaSymReader
{
    internal static unsafe partial class SymUnmanagedFactory
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.22804")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static unsafe partial int CoCreateInstance(in global::System.Guid rclsid, void* pUnkOuter, int dwClsContext, in global::System.Guid riid, out object ppObj)
        {
            bool __invokeSucceeded = default;
            ppObj = default;
            void* __ppObj_native = default;
            int __retVal = default;
            try
            {
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (global::System.Guid* __riid_native = &riid)
                fixed (global::System.Guid* __rclsid_native = &rclsid)
                {
                    __retVal = __PInvoke(__rclsid_native, pUnkOuter, dwClsContext, __riid_native, &__ppObj_native);
                }
 
                __invokeSucceeded = true;
                // Unmarshal - Convert native data to managed data.
                ppObj = global::System.Runtime.InteropServices.Marshalling.ComInterfaceMarshaller<object>.ConvertToManaged(__ppObj_native);
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    global::System.Runtime.InteropServices.Marshalling.ComInterfaceMarshaller<object>.Free(__ppObj_native);
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("Ole32", EntryPoint = "CoCreateInstance", ExactSpelling = true)]
            static extern unsafe int __PInvoke(global::System.Guid* __rclsid_native, void* __pUnkOuter_native, int __dwClsContext_native, global::System.Guid* __riid_native, void** __ppObj_native);
        }
    }
}