File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\src\runtime\src\libraries\System.IO.Compression.Brotli\src\System.IO.Compression.Brotli.csproj (System.IO.Compression.Brotli)
// <auto-generated/>
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeBrotliDecoderHandle BrotliDecoderCreateInstance(nint allocFunc, nint freeFunc, nint opaque)
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeBrotliDecoderHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBrotliDecoderHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke(allocFunc, freeFunc, opaque);
                }
 
                __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();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliDecoderCreateInstance", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __allocFunc_native, nint __freeFunc_native, nint __opaque_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        internal static unsafe partial int BrotliDecoderDecompressStream(global::Microsoft.Win32.SafeHandles.SafeBrotliDecoderHandle state, ref nuint availableIn, byte** nextIn, ref nuint availableOut, byte** nextOut, out nuint totalOut)
        {
            totalOut = default;
            nint __state_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBrotliDecoderHandle>.ManagedToUnmanagedIn __state_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __state_native__marshaller.FromManaged(state);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nuint* __totalOut_native = &totalOut)
                fixed (nuint* __availableOut_native = &availableOut)
                fixed (nuint* __availableIn_native = &availableIn)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __state_native = __state_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__state_native, __availableIn_native, nextIn, __availableOut_native, nextOut, __totalOut_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __state_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliDecoderDecompressStream", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __state_native, nuint* __availableIn_native, byte** __nextIn_native, nuint* __availableOut_native, byte** __nextOut_native, nuint* __totalOut_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliDecoderDecompress", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.BOOL BrotliDecoderDecompress(nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliDecoderDestroyInstance", ExactSpelling = true)]
        internal static extern partial void BrotliDecoderDestroyInstance(nint state);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        internal static partial global::Interop.BOOL BrotliDecoderIsFinished(global::Microsoft.Win32.SafeHandles.SafeBrotliDecoderHandle state)
        {
            nint __state_native = default;
            global::Interop.BOOL __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBrotliDecoderHandle>.ManagedToUnmanagedIn __state_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __state_native__marshaller.FromManaged(state);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __state_native = __state_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__state_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __state_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliDecoderIsFinished", ExactSpelling = true)]
            static extern unsafe global::Interop.BOOL __PInvoke(nint __state_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle BrotliEncoderCreateInstance(nint allocFunc, nint freeFunc, nint opaque)
        {
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    __retVal_native = __PInvoke(allocFunc, freeFunc, opaque);
                }
 
                __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();
                }
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliEncoderCreateInstance", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __allocFunc_native, nint __freeFunc_native, nint __opaque_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        internal static partial global::Interop.BOOL BrotliEncoderSetParameter(global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle state, global::System.IO.Compression.BrotliEncoderParameter parameter, uint value)
        {
            nint __state_native = default;
            global::Interop.BOOL __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle>.ManagedToUnmanagedIn __state_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __state_native__marshaller.FromManaged(state);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __state_native = __state_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__state_native, parameter, value);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __state_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliEncoderSetParameter", ExactSpelling = true)]
            static extern unsafe global::Interop.BOOL __PInvoke(nint __state_native, global::System.IO.Compression.BrotliEncoderParameter __parameter_native, uint __value_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        internal static unsafe partial global::Interop.BOOL BrotliEncoderCompressStream(global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle state, global::System.IO.Compression.BrotliEncoderOperation op, ref nuint availableIn, byte** nextIn, ref nuint availableOut, byte** nextOut, out nuint totalOut)
        {
            totalOut = default;
            nint __state_native = default;
            global::Interop.BOOL __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle>.ManagedToUnmanagedIn __state_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __state_native__marshaller.FromManaged(state);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nuint* __totalOut_native = &totalOut)
                fixed (nuint* __availableOut_native = &availableOut)
                fixed (nuint* __availableIn_native = &availableIn)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __state_native = __state_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__state_native, op, __availableIn_native, nextIn, __availableOut_native, nextOut, __totalOut_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __state_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliEncoderCompressStream", ExactSpelling = true)]
            static extern unsafe global::Interop.BOOL __PInvoke(nint __state_native, global::System.IO.Compression.BrotliEncoderOperation __op_native, nuint* __availableIn_native, byte** __nextIn_native, nuint* __availableOut_native, byte** __nextOut_native, nuint* __totalOut_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        internal static partial global::Interop.BOOL BrotliEncoderHasMoreOutput(global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle state)
        {
            nint __state_native = default;
            global::Interop.BOOL __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeBrotliEncoderHandle>.ManagedToUnmanagedIn __state_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __state_native__marshaller.FromManaged(state);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __state_native = __state_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__state_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __state_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliEncoderHasMoreOutput", ExactSpelling = true)]
            static extern unsafe global::Interop.BOOL __PInvoke(nint __state_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliEncoderMaxCompressedSize", ExactSpelling = true)]
        internal static extern partial nuint BrotliEncoderMaxCompressedSize(nuint inputSize);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliEncoderDestroyInstance", ExactSpelling = true)]
        internal static extern partial void BrotliEncoderDestroyInstance(nint state);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Brotli
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.IO.Compression.Native", EntryPoint = "BrotliEncoderCompress", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.BOOL BrotliEncoderCompress(int quality, int window, int v, nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes);
    }
}