File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\runtime\src\libraries\System.IO.FileSystem.Watcher\src\System.IO.FileSystem.Watcher.csproj (System.IO.FileSystem.Watcher)
// <auto-generated/>
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        internal static unsafe partial int Read(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count)
        {
            int __lastError;
            nint __fd_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __fd_native__marshaller.FromManaged(fd);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __fd_native = __fd_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__fd_native, buffer, count);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __fd_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_Read", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __fd_native, byte* __buffer_native, int __count_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        internal static unsafe partial int ReadFromNonblocking(global::System.Runtime.InteropServices.SafeHandle fd, byte* buffer, int count)
        {
            int __lastError;
            nint __fd_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __fd_native__marshaller.FromManaged(fd);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __fd_native = __fd_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__fd_native, buffer, count);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __fd_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ReadFromNonblocking", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __fd_native, byte* __buffer_native, int __count_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ConvertErrorPlatformToPal", ExactSpelling = true)]
        internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ConvertErrorPalToPlatform", ExactSpelling = true)]
        internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_StrErrorR", ExactSpelling = true)]
        private static unsafe extern partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        private static partial int PathConf(string path, global::Interop.Sys.PathConfName name)
        {
            int __lastError;
            byte* __path_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __path_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __path_native__marshaller.FromManaged(path, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __path_native = __path_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__path_native, name);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __path_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_PathConf", ExactSpelling = true)]
            static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.PathConfName __name_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeFileHandle INotifyInit()
        {
            int __lastError;
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeFileHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke();
                    __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("libSystem.Native", EntryPoint = "SystemNative_INotifyInit", ExactSpelling = true)]
            static extern unsafe nint __PInvoke();
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        internal static partial int INotifyAddWatch(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, string pathName, uint mask)
        {
            int __lastError;
            nint __fd_native = default;
            byte* __pathName_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __pathName_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __pathName_native__marshaller.FromManaged(pathName, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __fd_native__marshaller.FromManaged(fd);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __pathName_native = __pathName_native__marshaller.ToUnmanaged();
                    __fd_native = __fd_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__fd_native, __pathName_native, mask);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __pathName_native__marshaller.Free();
                __fd_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_INotifyAddWatch", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __fd_native, byte* __pathName_native, uint __mask_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        private static partial int INotifyRemoveWatch_private(global::Microsoft.Win32.SafeHandles.SafeFileHandle fd, int wd)
        {
            int __lastError;
            nint __fd_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __fd_native__marshaller.FromManaged(fd);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __fd_native = __fd_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__fd_native, wd);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __fd_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_INotifyRemoveWatch", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __fd_native, int __wd_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_Poll", ExactSpelling = true)]
        internal static unsafe extern partial global::Interop.Error Poll(global::Interop.PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output)
        {
            int __lastError;
            output = default;
            nint __fd_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __fd_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __fd_native__marshaller.FromManaged(fd);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (global::Interop.Sys.FileStatus* __output_native = &output)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __fd_native = __fd_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__fd_native, __output_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __fd_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_FStat", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.FileStatus* __output_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        internal static partial int Stat(string path, out global::Interop.Sys.FileStatus output)
        {
            int __lastError;
            output = default;
            byte* __path_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __path_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __path_native__marshaller.FromManaged(path, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (global::Interop.Sys.FileStatus* __output_native = &output)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __path_native = __path_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__path_native, __output_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __path_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_Stat", ExactSpelling = true)]
            static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.28005")]
        internal static partial int LStat(string path, out global::Interop.Sys.FileStatus output)
        {
            int __lastError;
            output = default;
            byte* __path_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __path_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __path_native__marshaller.FromManaged(path, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (global::Interop.Sys.FileStatus* __output_native = &output)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __path_native = __path_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__path_native, __output_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __path_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_LStat", ExactSpelling = true)]
            static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
        }
    }
}