File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\src\runtime\src\libraries\System.Net.NetworkInformation\src\System.Net.NetworkInformation.csproj (System.Net.NetworkInformation)
// <auto-generated/>
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_EnumerateInterfaceAddresses", ExactSpelling = true)]
        public static unsafe extern partial int EnumerateInterfaceAddresses(void* context, delegate* unmanaged<void*, byte*, global::Interop.Sys.IpAddressInfo*, void> ipv4Found, delegate* unmanaged<void*, byte*, global::Interop.Sys.IpAddressInfo*, uint*, void> ipv6Found, delegate* unmanaged<void*, byte*, global::Interop.Sys.LinkLayerAddressInfo*, void> linkLayerFound);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface", ExactSpelling = true)]
        public static unsafe extern partial int EnumerateGatewayAddressesForInterface(void* context, uint interfaceIndex, delegate* unmanaged<void*, global::Interop.Sys.IpAddressInfo*, void> onGatewayFound);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        public static unsafe partial int GetNetworkInterfaces(int* count, global::Interop.Sys.NetworkInterfaceInfo** addrs, int* addressCount, global::Interop.Sys.IpAddressInfo** aa)
        {
            int __lastError;
            int __retVal;
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke(count, addrs, addressCount, aa);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetNetworkInterfaces", ExactSpelling = true)]
            static extern unsafe int __PInvoke(int* __count_native, global::Interop.Sys.NetworkInterfaceInfo** __addrs_native, int* __addressCount_native, global::Interop.Sys.IpAddressInfo** __aa_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetDomainName", ExactSpelling = true)]
        private static unsafe extern partial int GetDomainName(byte* name, int len);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        private static unsafe partial int GetHostName(byte* name, int nameLength)
        {
            int __lastError;
            int __retVal;
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke(name, nameLength);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetHostName", ExactSpelling = true)]
            static extern unsafe int __PInvoke(byte* __name_native, int __nameLength_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_MapTcpState", ExactSpelling = true)]
        internal static extern partial global::System.Net.NetworkInformation.TcpState MapTcpState(int nativeState);
    }
}
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.27024")]
        public static unsafe partial global::Interop.Error CreateNetworkChangeListenerSocket(nint* socket)
        {
            int __lastError;
            global::Interop.Error __retVal;
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke(socket);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket", ExactSpelling = true)]
            static extern unsafe global::Interop.Error __PInvoke(nint* __socket_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Sys
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        public static unsafe partial global::Interop.Error ReadEvents(global::System.Runtime.InteropServices.SafeHandle socket, delegate* unmanaged<nint, global::Interop.Sys.NetworkChangeKind, void> onNetworkChange)
        {
            nint __socket_native = default;
            global::Interop.Error __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __socket_native__marshaller.FromManaged(socket);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __socket_native = __socket_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__socket_native, onNetworkChange);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __socket_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ReadEvents", ExactSpelling = true)]
            static extern unsafe global::Interop.Error __PInvoke(nint __socket_native, delegate* unmanaged<nint, global::Interop.Sys.NetworkChangeKind, void> __onNetworkChange_native);
        }
    }
}