File: _generated\93\LibraryImports.g.cs
Web Access
Project: src\aspnetcore\src\Servers\HttpSys\src\Microsoft.AspNetCore.Server.HttpSys.csproj (Microsoft.AspNetCore.Server.HttpSys)
// <auto-generated/>
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal static partial class HttpApi
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial uint HttpReceiveRequestEntityBody(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong requestId, uint flags, nint pEntityBuffer, uint entityBufferLength, out uint bytesReturned, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped pOverlapped)
        {
            unsafe
            {
                int __lastError;
                bytesReturned = default;
                nint __requestQueueHandle_native = default;
                nint __pOverlapped_native = default;
                uint __retVal = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped>.ManagedToUnmanagedIn __pOverlapped_native__marshaller = new();
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new();
                try
                {
                    // Marshal - Convert managed data to native data.
                    __pOverlapped_native__marshaller.FromManaged(pOverlapped);
                    __requestQueueHandle_native__marshaller.FromManaged(requestQueueHandle);
                    // Pin - Pin data in preparation for calling the P/Invoke.
                    fixed (uint* __bytesReturned_native = &bytesReturned)
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __pOverlapped_native = __pOverlapped_native__marshaller.ToUnmanaged();
                        __requestQueueHandle_native = __requestQueueHandle_native__marshaller.ToUnmanaged();
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal = __PInvoke(__requestQueueHandle_native, requestId, flags, pEntityBuffer, entityBufferLength, __bytesReturned_native, __pOverlapped_native);
                        __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                    }
                }
                finally
                {
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    __pOverlapped_native__marshaller.Free();
                    __requestQueueHandle_native__marshaller.Free();
                }
 
                global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                return __retVal;
                // Local P/Invoke
                [global::System.Runtime.InteropServices.DllImportAttribute("httpapi.dll", EntryPoint = "HttpReceiveRequestEntityBody", ExactSpelling = true)]
                static extern unsafe uint __PInvoke(nint __requestQueueHandle_native, ulong __requestId_native, uint __flags_native, nint __pEntityBuffer_native, uint __entityBufferLength_native, uint* __bytesReturned_native, nint __pOverlapped_native);
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal static partial class HttpApi
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static unsafe partial uint HttpReceiveClientCertificate(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong connectionId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_SSL_CLIENT_CERT_INFO* pSslClientCertInfo, uint sslClientCertInfoSize, uint* pBytesReceived, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped pOverlapped)
        {
            unsafe
            {
                int __lastError;
                nint __requestQueueHandle_native = default;
                nint __pOverlapped_native = default;
                uint __retVal = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped>.ManagedToUnmanagedIn __pOverlapped_native__marshaller = new();
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new();
                try
                {
                    // Marshal - Convert managed data to native data.
                    __pOverlapped_native__marshaller.FromManaged(pOverlapped);
                    __requestQueueHandle_native__marshaller.FromManaged(requestQueueHandle);
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __pOverlapped_native = __pOverlapped_native__marshaller.ToUnmanaged();
                        __requestQueueHandle_native = __requestQueueHandle_native__marshaller.ToUnmanaged();
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal = __PInvoke(__requestQueueHandle_native, connectionId, flags, pSslClientCertInfo, sslClientCertInfoSize, pBytesReceived, __pOverlapped_native);
                        __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                    }
                }
                finally
                {
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    __pOverlapped_native__marshaller.Free();
                    __requestQueueHandle_native__marshaller.Free();
                }
 
                global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                return __retVal;
                // Local P/Invoke
                [global::System.Runtime.InteropServices.DllImportAttribute("httpapi.dll", EntryPoint = "HttpReceiveClientCertificate", ExactSpelling = true)]
                static extern unsafe uint __PInvoke(nint __requestQueueHandle_native, ulong __connectionId_native, uint __flags_native, Windows.Win32.Networking.HttpServer.HTTP_SSL_CLIENT_CERT_INFO* __pSslClientCertInfo_native, uint __sslClientCertInfoSize_native, uint* __pBytesReceived_native, nint __pOverlapped_native);
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal static partial class HttpApi
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static unsafe partial uint HttpReceiveHttpRequest(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong requestId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_REQUEST_V1* pRequestBuffer, uint requestBufferLength, uint* pBytesReturned, global::System.Threading.NativeOverlapped* pOverlapped)
        {
            unsafe
            {
                int __lastError;
                nint __requestQueueHandle_native = default;
                uint __retVal = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new();
                try
                {
                    // Marshal - Convert managed data to native data.
                    __requestQueueHandle_native__marshaller.FromManaged(requestQueueHandle);
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __requestQueueHandle_native = __requestQueueHandle_native__marshaller.ToUnmanaged();
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal = __PInvoke(__requestQueueHandle_native, requestId, flags, pRequestBuffer, requestBufferLength, pBytesReturned, pOverlapped);
                        __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                    }
                }
                finally
                {
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    __requestQueueHandle_native__marshaller.Free();
                }
 
                global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                return __retVal;
                // Local P/Invoke
                [global::System.Runtime.InteropServices.DllImportAttribute("httpapi.dll", EntryPoint = "HttpReceiveHttpRequest", ExactSpelling = true)]
                static extern unsafe uint __PInvoke(nint __requestQueueHandle_native, ulong __requestId_native, uint __flags_native, Windows.Win32.Networking.HttpServer.HTTP_REQUEST_V1* __pRequestBuffer_native, uint __requestBufferLength_native, uint* __pBytesReturned_native, global::System.Threading.NativeOverlapped* __pOverlapped_native);
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal static partial class HttpApi
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static unsafe partial uint HttpSendHttpResponse(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong requestId, uint flags, Windows.Win32.Networking.HttpServer.HTTP_RESPONSE_V2* pHttpResponse, Windows.Win32.Networking.HttpServer.HTTP_CACHE_POLICY* pCachePolicy, uint* pBytesSent, nint pReserved1, uint Reserved2, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped pOverlapped, nint pLogData)
        {
            unsafe
            {
                int __lastError;
                nint __requestQueueHandle_native = default;
                nint __pOverlapped_native = default;
                uint __retVal = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped>.ManagedToUnmanagedIn __pOverlapped_native__marshaller = new();
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new();
                try
                {
                    // Marshal - Convert managed data to native data.
                    __pOverlapped_native__marshaller.FromManaged(pOverlapped);
                    __requestQueueHandle_native__marshaller.FromManaged(requestQueueHandle);
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __pOverlapped_native = __pOverlapped_native__marshaller.ToUnmanaged();
                        __requestQueueHandle_native = __requestQueueHandle_native__marshaller.ToUnmanaged();
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal = __PInvoke(__requestQueueHandle_native, requestId, flags, pHttpResponse, pCachePolicy, pBytesSent, pReserved1, Reserved2, __pOverlapped_native, pLogData);
                        __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                    }
                }
                finally
                {
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    __pOverlapped_native__marshaller.Free();
                    __requestQueueHandle_native__marshaller.Free();
                }
 
                global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                return __retVal;
                // Local P/Invoke
                [global::System.Runtime.InteropServices.DllImportAttribute("httpapi.dll", EntryPoint = "HttpSendHttpResponse", ExactSpelling = true)]
                static extern unsafe uint __PInvoke(nint __requestQueueHandle_native, ulong __requestId_native, uint __flags_native, Windows.Win32.Networking.HttpServer.HTTP_RESPONSE_V2* __pHttpResponse_native, Windows.Win32.Networking.HttpServer.HTTP_CACHE_POLICY* __pCachePolicy_native, uint* __pBytesSent_native, nint __pReserved1_native, uint __Reserved2_native, nint __pOverlapped_native, nint __pLogData_native);
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal static partial class HttpApi
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static unsafe partial uint HttpWaitForDisconnectEx(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong connectionId, uint reserved, global::System.Threading.NativeOverlapped* overlapped)
        {
            unsafe
            {
                int __lastError;
                nint __requestQueueHandle_native = default;
                uint __retVal = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new();
                try
                {
                    // Marshal - Convert managed data to native data.
                    __requestQueueHandle_native__marshaller.FromManaged(requestQueueHandle);
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __requestQueueHandle_native = __requestQueueHandle_native__marshaller.ToUnmanaged();
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal = __PInvoke(__requestQueueHandle_native, connectionId, reserved, overlapped);
                        __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                    }
                }
                finally
                {
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    __requestQueueHandle_native__marshaller.Free();
                }
 
                global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                return __retVal;
                // Local P/Invoke
                [global::System.Runtime.InteropServices.DllImportAttribute("httpapi.dll", EntryPoint = "HttpWaitForDisconnectEx", ExactSpelling = true)]
                static extern unsafe uint __PInvoke(nint __requestQueueHandle_native, ulong __connectionId_native, uint __reserved_native, global::System.Threading.NativeOverlapped* __overlapped_native);
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal static partial class HttpApi
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static unsafe partial uint HttpSendResponseEntityBody(global::System.Runtime.InteropServices.SafeHandle requestQueueHandle, ulong requestId, uint flags, ushort entityChunkCount, Windows.Win32.Networking.HttpServer.HTTP_DATA_CHUNK* pEntityChunks, uint* pBytesSent, nint pReserved1, uint Reserved2, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped pOverlapped, nint pLogData)
        {
            unsafe
            {
                int __lastError;
                nint __requestQueueHandle_native = default;
                nint __pOverlapped_native = default;
                uint __retVal = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped>.ManagedToUnmanagedIn __pOverlapped_native__marshaller = new();
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __requestQueueHandle_native__marshaller = new();
                try
                {
                    // Marshal - Convert managed data to native data.
                    __pOverlapped_native__marshaller.FromManaged(pOverlapped);
                    __requestQueueHandle_native__marshaller.FromManaged(requestQueueHandle);
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __pOverlapped_native = __pOverlapped_native__marshaller.ToUnmanaged();
                        __requestQueueHandle_native = __requestQueueHandle_native__marshaller.ToUnmanaged();
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal = __PInvoke(__requestQueueHandle_native, requestId, flags, entityChunkCount, pEntityChunks, pBytesSent, pReserved1, Reserved2, __pOverlapped_native, pLogData);
                        __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                    }
                }
                finally
                {
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    __pOverlapped_native__marshaller.Free();
                    __requestQueueHandle_native__marshaller.Free();
                }
 
                global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                return __retVal;
                // Local P/Invoke
                [global::System.Runtime.InteropServices.DllImportAttribute("httpapi.dll", EntryPoint = "HttpSendResponseEntityBody", ExactSpelling = true)]
                static extern unsafe uint __PInvoke(nint __requestQueueHandle_native, ulong __requestId_native, uint __flags_native, ushort __entityChunkCount_native, Windows.Win32.Networking.HttpServer.HTTP_DATA_CHUNK* __pEntityChunks_native, uint* __pBytesSent_native, nint __pReserved1_native, uint __Reserved2_native, nint __pOverlapped_native, nint __pLogData_native);
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal static partial class HttpApi
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial uint CancelIoEx(global::System.Runtime.InteropServices.SafeHandle handle, global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped overlapped)
        {
            unsafe
            {
                int __lastError;
                nint __handle_native = default;
                nint __overlapped_native = default;
                uint __retVal = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Server.HttpSys.SafeNativeOverlapped>.ManagedToUnmanagedIn __overlapped_native__marshaller = new();
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __handle_native__marshaller = new();
                try
                {
                    // Marshal - Convert managed data to native data.
                    __overlapped_native__marshaller.FromManaged(overlapped);
                    __handle_native__marshaller.FromManaged(handle);
                    {
                        // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                        __overlapped_native = __overlapped_native__marshaller.ToUnmanaged();
                        __handle_native = __handle_native__marshaller.ToUnmanaged();
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal = __PInvoke(__handle_native, __overlapped_native);
                        __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                    }
                }
                finally
                {
                    // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                    __overlapped_native__marshaller.Free();
                    __handle_native__marshaller.Free();
                }
 
                global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                return __retVal;
                // Local P/Invoke
                [global::System.Runtime.InteropServices.DllImportAttribute("api-ms-win-core-io-l1-1-0.dll", EntryPoint = "CancelIoEx", ExactSpelling = true)]
                static extern unsafe uint __PInvoke(nint __handle_native, nint __overlapped_native);
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal sealed unsafe partial class SafeLibraryHandle
    {
        private static partial class UnsafeNativeMethods
        {
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
            [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
            internal static partial bool FreeLibrary(nint hModule)
            {
                unsafe
                {
                    bool __retVal;
                    int __retVal_native;
                    {
                        __retVal_native = __PInvoke(hModule);
                    }
 
                    // Unmarshal - Convert native data to managed data.
                    __retVal = __retVal_native != 0;
                    return __retVal;
                    // Local P/Invoke
                    [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "FreeLibrary", ExactSpelling = true)]
                    static extern unsafe int __PInvoke(nint __hModule_native);
                }
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal sealed unsafe partial class SafeLibraryHandle
    {
        private static partial class UnsafeNativeMethods
        {
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
            [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
            internal static partial nint GetProcAddress(global::Microsoft.AspNetCore.Server.HttpSys.SafeLibraryHandle hModule, string lpProcName)
            {
                unsafe
                {
                    int __lastError;
                    nint __hModule_native = default;
                    byte* __lpProcName_native = default;
                    nint __retVal = default;
                    // Setup - Perform required setup.
                    scoped global::System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn __lpProcName_native__marshaller = new();
                    global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Server.HttpSys.SafeLibraryHandle>.ManagedToUnmanagedIn __hModule_native__marshaller = new();
                    try
                    {
                        // Marshal - Convert managed data to native data.
                        __lpProcName_native__marshaller.FromManaged(lpProcName, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                        __hModule_native__marshaller.FromManaged(hModule);
                        {
                            // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                            __lpProcName_native = __lpProcName_native__marshaller.ToUnmanaged();
                            __hModule_native = __hModule_native__marshaller.ToUnmanaged();
                            global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                            __retVal = __PInvoke(__hModule_native, __lpProcName_native);
                            __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                        }
                    }
                    finally
                    {
                        // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                        __lpProcName_native__marshaller.Free();
                        __hModule_native__marshaller.Free();
                    }
 
                    global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                    return __retVal;
                    // Local P/Invoke
                    [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetProcAddress", ExactSpelling = true)]
                    static extern unsafe nint __PInvoke(nint __hModule_native, byte* __lpProcName_native);
                }
            }
        }
    }
}
namespace Microsoft.AspNetCore.Server.HttpSys
{
    internal sealed unsafe partial class SafeLibraryHandle
    {
        private static partial class UnsafeNativeMethods
        {
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41109")]
            [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
            internal static partial global::Microsoft.AspNetCore.Server.HttpSys.SafeLibraryHandle LoadLibraryEx(string lpFileName, nint hFile, uint dwFlags)
            {
                unsafe
                {
                    int __lastError;
                    bool __invokeSucceeded = default;
                    global::Microsoft.AspNetCore.Server.HttpSys.SafeLibraryHandle __retVal = default;
                    nint __retVal_native = default;
                    // Setup - Perform required setup.
                    global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.AspNetCore.Server.HttpSys.SafeLibraryHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
                    try
                    {
                        // Pin - Pin data in preparation for calling the P/Invoke.
                        fixed (void* __lpFileName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(lpFileName))
                        {
                            global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                            __retVal_native = __PInvoke((ushort*)__lpFileName_native, hFile, dwFlags);
                            __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                        }
 
                        __invokeSucceeded = true;
                        // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                        __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                        // Unmarshal - Convert native data to managed data.
                        __retVal = __retVal_native__marshaller.ToManaged();
                    }
                    finally
                    {
                        if (__invokeSucceeded)
                        {
                            // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                            __retVal_native__marshaller.Free();
                        }
                    }
 
                    global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
                    return __retVal;
                    // Local P/Invoke
                    [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "LoadLibraryExW", ExactSpelling = true)]
                    static extern unsafe nint __PInvoke(ushort* __lpFileName_native, nint __hFile_native, uint __dwFlags_native);
                }
            }
        }
    }
}