File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\runtime\src\libraries\System.DirectoryServices.Protocols\src\System.DirectoryServices.Protocols.csproj (System.DirectoryServices.Protocols)
// <auto-generated/>
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_initialize(out nint ld, string uri)
        {
            int __lastError;
            ld = default;
            byte* __uri_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __uri_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __uri_native__marshaller.FromManaged(uri, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __ld_native = &ld)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __uri_native = __uri_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__ld_native, __uri_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __uri_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_initialize", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint* __ld_native, byte* __uri_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_unbind_ext_s(nint ld, ref nint serverctrls, ref nint clientctrls)
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (nint* __clientctrls_native = &clientctrls)
            fixed (nint* __serverctrls_native = &serverctrls)
            {
                __retVal = __PInvoke(ld, __serverctrls_native, __clientctrls_native);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_unbind_ext_s", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ld_native, nint* __serverctrls_native, nint* __clientctrls_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ldap_get_dn(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result)
        {
            nint __ldapHandle_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_get_dn", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ldapHandle_native, nint __result_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_get_option_bool(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, ref bool outValue)
        {
            nint __ldapHandle_native = default;
            int __outValue_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __outValue_native = (int)(outValue ? 1 : 0);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, &__outValue_native);
                }
 
                // Unmarshal - Convert native data to managed data.
                outValue = __outValue_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_get_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, int* __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static unsafe partial int ldap_get_option_secInfo(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, void* outValue)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, outValue);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_get_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, void* __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_get_option_sechandle(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, ref global::System.DirectoryServices.Protocols.SecurityHandle outValue)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (global::System.DirectoryServices.Protocols.SecurityHandle* __outValue_native = &outValue)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, __outValue_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_get_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, global::System.DirectoryServices.Protocols.SecurityHandle* __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ldap_get_option_int(nint ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, ref int outValue)
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (int* __outValue_native = &outValue)
            {
                __retVal = __PInvoke(ldapHandle, option, __outValue_native);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_get_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, int* __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_get_option_int(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, ref int outValue)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __outValue_native = &outValue)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, __outValue_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_get_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, int* __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_get_option_ptr(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, ref nint outValue)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __outValue_native = &outValue)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, __outValue_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_get_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, nint* __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ldap_get_values_len(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result, string name)
        {
            nint __ldapHandle_native = default;
            byte* __name_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __name_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __name_native__marshaller.FromManaged(name, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __name_native = __name_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result, __name_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __name_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_get_values_len", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ldapHandle_native, nint __result_native, byte* __name_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_result(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, int messageId, int all, in global::System.DirectoryServices.Protocols.LDAP_TIMEVAL timeout, ref nint Mesage)
        {
            int __lastError;
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __Mesage_native = &Mesage)
                fixed (global::System.DirectoryServices.Protocols.LDAP_TIMEVAL* __timeout_native = &timeout)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__ldapHandle_native, messageId, all, __timeout_native, __Mesage_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_result", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, int __messageId_native, int __all_native, global::System.DirectoryServices.Protocols.LDAP_TIMEVAL* __timeout_native, nint* __Mesage_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_result2error(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result, int freeIt)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result, freeIt);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_result2error", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, nint __result_native, int __freeIt_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_search(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, string dn, int scope, string filter, nint attributes, bool attributeOnly, nint servercontrol, nint clientcontrol, in global::System.DirectoryServices.Protocols.LDAP_TIMEVAL timelimit, int sizelimit, ref int messageNumber)
        {
            nint __ldapHandle_native = default;
            byte* __dn_native = default;
            byte* __filter_native = default;
            int __attributeOnly_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __filter_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __dn_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __attributeOnly_native = (int)(attributeOnly ? 1 : 0);
                __filter_native__marshaller.FromManaged(filter, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __dn_native__marshaller.FromManaged(dn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __messageNumber_native = &messageNumber)
                fixed (global::System.DirectoryServices.Protocols.LDAP_TIMEVAL* __timelimit_native = &timelimit)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __filter_native = __filter_native__marshaller.ToUnmanaged();
                    __dn_native = __dn_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, __dn_native, scope, __filter_native, attributes, __attributeOnly_native, servercontrol, clientcontrol, __timelimit_native, sizelimit, __messageNumber_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __filter_native__marshaller.Free();
                __dn_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_search_ext", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, byte* __dn_native, int __scope_native, byte* __filter_native, nint __attributes_native, int __attributeOnly_native, nint __servercontrol_native, nint __clientcontrol_native, global::System.DirectoryServices.Protocols.LDAP_TIMEVAL* __timelimit_native, int __sizelimit_native, int* __messageNumber_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_set_option_bool(global::System.DirectoryServices.Protocols.ConnectionHandle ld, global::System.DirectoryServices.Protocols.LdapOption option, bool value)
        {
            int __lastError;
            nint __ld_native = default;
            int __value_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ld_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __value_native = (int)(value ? 1 : 0);
                __ld_native__marshaller.FromManaged(ld);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ld_native = __ld_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__ld_native, option, __value_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ld_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_set_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ld_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, int __value_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_set_option_clientcert(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, global::System.DirectoryServices.Protocols.QUERYCLIENTCERT outValue)
        {
            nint __ldapHandle_native = default;
            nint __outValue_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __outValue_native = outValue != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(outValue) : default;
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, __outValue_native);
                }
 
                // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
                global::System.GC.KeepAlive(outValue);
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_set_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, nint __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_set_option_servercert(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, global::System.DirectoryServices.Protocols.VERIFYSERVERCERT outValue)
        {
            nint __ldapHandle_native = default;
            nint __outValue_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __outValue_native = outValue != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(outValue) : default;
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, __outValue_native);
                }
 
                // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
                global::System.GC.KeepAlive(outValue);
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_set_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, nint __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_set_option_int(global::System.DirectoryServices.Protocols.ConnectionHandle ld, global::System.DirectoryServices.Protocols.LdapOption option, ref int inValue)
        {
            int __lastError;
            nint __ld_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ld_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ld_native__marshaller.FromManaged(ld);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __inValue_native = &inValue)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ld_native = __ld_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__ld_native, option, __inValue_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ld_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_set_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ld_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, int* __inValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_set_option_ptr(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, ref nint inValue)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __inValue_native = &inValue)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, __inValue_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_set_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, nint* __inValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_set_option_string(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, string inValue)
        {
            nint __ldapHandle_native = default;
            byte* __inValue_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __inValue_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __inValue_native__marshaller.FromManaged(inValue, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __inValue_native = __inValue_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, __inValue_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __inValue_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_set_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, byte* __inValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_set_option_referral(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, ref global::System.DirectoryServices.Protocols.LdapReferralCallback outValue)
        {
            nint __ldapHandle_native = default;
            global::System.DirectoryServices.Protocols.LdapReferralCallback.Marshaller.MarshalValue.Native __outValue_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.DirectoryServices.Protocols.LdapReferralCallback.Marshaller.MarshalValue __outValue_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __outValue_native__marshaller.FromManaged(outValue);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __outValue_native = __outValue_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, &__outValue_native);
                }
 
                // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
                __outValue_native__marshaller.OnInvoked();
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __outValue_native__marshaller.FromUnmanaged(__outValue_native);
                // Unmarshal - Convert native data to managed data.
                outValue = __outValue_native__marshaller.ToManaged();
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __outValue_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_set_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, global::System.DirectoryServices.Protocols.LdapReferralCallback.Marshaller.MarshalValue.Native* __outValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_set_option_timeval(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, global::System.DirectoryServices.Protocols.LdapOption option, ref global::System.DirectoryServices.Protocols.LDAP_TIMEVAL inValue)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (global::System.DirectoryServices.Protocols.LDAP_TIMEVAL* __inValue_native = &inValue)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, option, __inValue_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_set_option", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, global::System.DirectoryServices.Protocols.LdapOption __option_native, global::System.DirectoryServices.Protocols.LDAP_TIMEVAL* __inValue_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_start_tls(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint serverControls, nint clientControls)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, serverControls, clientControls);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_start_tls_s", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, nint __serverControls_native, nint __clientControls_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_parse_result(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result, ref int serverError, ref nint dn, ref nint message, ref nint referral, ref nint control, byte freeIt)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __control_native = &control)
                fixed (nint* __referral_native = &referral)
                fixed (nint* __message_native = &message)
                fixed (nint* __dn_native = &dn)
                fixed (int* __serverError_native = &serverError)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result, __serverError_native, __dn_native, __message_native, __referral_native, __control_native, freeIt);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_parse_result", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, nint __result_native, int* __serverError_native, nint* __dn_native, nint* __message_native, nint* __referral_native, nint* __control_native, byte __freeIt_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_parse_result_referral(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result, nint serverError, nint dn, nint message, ref nint referral, nint control, byte freeIt)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __referral_native = &referral)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result, serverError, dn, message, __referral_native, control, freeIt);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_parse_result", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, nint __result_native, nint __serverError_native, nint __dn_native, nint __message_native, nint* __referral_native, nint __control_native, byte __freeIt_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_parse_extended_result(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result, ref nint oid, ref nint data, byte freeIt)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __data_native = &data)
                fixed (nint* __oid_native = &oid)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result, __oid_native, __data_native, freeIt);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_parse_extended_result", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, nint __result_native, nint* __oid_native, nint* __data_native, byte __freeIt_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_parse_reference(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result, ref nint referrals, nint ServerControls, byte freeIt)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __referrals_native = &referrals)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result, __referrals_native, ServerControls, freeIt);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_parse_reference", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, nint __result_native, nint* __referrals_native, nint __ServerControls_native, byte __freeIt_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial int ldap_sasl_bind(global::System.DirectoryServices.Protocols.ConnectionHandle ld, string dn, string mechanism, global::System.DirectoryServices.Protocols.BerVal cred, nint serverctrls, nint clientctrls, nint servercredp)
        {
            nint __ld_native = default;
            byte* __dn_native = default;
            byte* __mechanism_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __mechanism_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __dn_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ld_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __mechanism_native__marshaller.FromManaged(mechanism, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __dn_native__marshaller.FromManaged(dn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ld_native__marshaller.FromManaged(ld);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __cred_native = &global::System.DirectoryServices.Protocols.BerVal.PinningMarshaller.GetPinnableReference(cred))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __mechanism_native = __mechanism_native__marshaller.ToUnmanaged();
                    __dn_native = __dn_native__marshaller.ToUnmanaged();
                    __ld_native = __ld_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ld_native, __dn_native, __mechanism_native, (int*)__cred_native, serverctrls, clientctrls, servercredp);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __mechanism_native__marshaller.Free();
                __dn_native__marshaller.Free();
                __ld_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_sasl_bind_s", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ld_native, byte* __dn_native, byte* __mechanism_native, int* __cred_native, nint __serverctrls_native, nint __clientctrls_native, nint __servercredp_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial int ldap_sasl_interactive_bind(global::System.DirectoryServices.Protocols.ConnectionHandle ld, string dn, string mechanism, nint serverctrls, nint clientctrls, uint flags, global::LDAP_SASL_INTERACT_PROC proc, nint defaults)
        {
            nint __ld_native = default;
            byte* __dn_native = default;
            byte* __mechanism_native = default;
            nint __proc_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __mechanism_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __dn_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ld_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __proc_native = proc != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(proc) : default;
                __mechanism_native__marshaller.FromManaged(mechanism, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __dn_native__marshaller.FromManaged(dn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ld_native__marshaller.FromManaged(ld);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __mechanism_native = __mechanism_native__marshaller.ToUnmanaged();
                    __dn_native = __dn_native__marshaller.ToUnmanaged();
                    __ld_native = __ld_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ld_native, __dn_native, __mechanism_native, serverctrls, clientctrls, flags, __proc_native, defaults);
                }
 
                // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
                global::System.GC.KeepAlive(proc);
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __mechanism_native__marshaller.Free();
                __dn_native__marshaller.Free();
                __ld_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_sasl_interactive_bind_s", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ld_native, byte* __dn_native, byte* __mechanism_native, nint __serverctrls_native, nint __clientctrls_native, uint __flags_native, nint __proc_native, nint __defaults_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_err2string", ExactSpelling = true)]
        public static extern partial nint ldap_err2string(int err);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_extended_operation(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, string oid, global::System.DirectoryServices.Protocols.BerVal data, nint servercontrol, nint clientcontrol, ref int messageNumber)
        {
            nint __ldapHandle_native = default;
            byte* __oid_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __oid_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __oid_native__marshaller.FromManaged(oid, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __messageNumber_native = &messageNumber)
                fixed (void* __data_native = &global::System.DirectoryServices.Protocols.BerVal.PinningMarshaller.GetPinnableReference(data))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __oid_native = __oid_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, __oid_native, (int*)__data_native, servercontrol, clientcontrol, __messageNumber_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __oid_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_extended_operation", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, byte* __oid_native, int* __data_native, nint __servercontrol_native, nint __clientcontrol_native, int* __messageNumber_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ldap_first_attribute(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result, ref nint address)
        {
            nint __ldapHandle_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __address_native = &address)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result, __address_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_first_attribute", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ldapHandle_native, nint __result_native, nint* __address_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ldap_first_entry(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result)
        {
            nint __ldapHandle_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_first_entry", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ldapHandle_native, nint __result_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ldap_first_reference(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result)
        {
            nint __ldapHandle_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_first_reference", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ldapHandle_native, nint __result_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_control_free", ExactSpelling = true)]
        public static extern partial int ldap_control_free(nint control);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_controls_free", ExactSpelling = true)]
        public static extern partial int ldap_controls_free(nint value);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_value_free", ExactSpelling = true)]
        public static extern partial int ldap_value_free(nint value);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_value_free_len", ExactSpelling = true)]
        public static extern partial nint ldap_value_free_len(nint berelement);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_memfree", ExactSpelling = true)]
        public static extern partial void ldap_memfree(nint value);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_msgfree", ExactSpelling = true)]
        public static extern partial void ldap_msgfree(nint value);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_modify(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, string dn, nint attrs, nint servercontrol, nint clientcontrol, ref int messageNumber)
        {
            nint __ldapHandle_native = default;
            byte* __dn_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __dn_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __dn_native__marshaller.FromManaged(dn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __messageNumber_native = &messageNumber)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __dn_native = __dn_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, __dn_native, attrs, servercontrol, clientcontrol, __messageNumber_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __dn_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_modify_ext", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, byte* __dn_native, nint __attrs_native, nint __servercontrol_native, nint __clientcontrol_native, int* __messageNumber_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ldap_next_attribute(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result, nint address)
        {
            nint __ldapHandle_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result, address);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_next_attribute", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ldapHandle_native, nint __result_native, nint __address_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ldap_next_entry(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result)
        {
            nint __ldapHandle_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_next_entry", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ldapHandle_native, nint __result_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ldap_next_reference(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, nint result)
        {
            nint __ldapHandle_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, result);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_next_reference", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __ldapHandle_native, nint __result_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_abandon(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, int messagId)
        {
            nint __ldapHandle_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, messagId);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_abandon", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, int __messagId_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_add(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, string dn, nint attrs, nint servercontrol, nint clientcontrol, ref int messageNumber)
        {
            nint __ldapHandle_native = default;
            byte* __dn_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __dn_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __dn_native__marshaller.FromManaged(dn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __messageNumber_native = &messageNumber)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __dn_native = __dn_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, __dn_native, attrs, servercontrol, clientcontrol, __messageNumber_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __dn_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_add_ext", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, byte* __dn_native, nint __attrs_native, nint __servercontrol_native, nint __clientcontrol_native, int* __messageNumber_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_delete_ext(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, string dn, nint servercontrol, nint clientcontrol, ref int messageNumber)
        {
            nint __ldapHandle_native = default;
            byte* __dn_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __dn_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __dn_native__marshaller.FromManaged(dn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __messageNumber_native = &messageNumber)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __dn_native = __dn_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, __dn_native, servercontrol, clientcontrol, __messageNumber_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __dn_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_delete_ext", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, byte* __dn_native, nint __servercontrol_native, nint __clientcontrol_native, int* __messageNumber_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_rename(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, string dn, string newRdn, string newParentDn, int deleteOldRdn, nint servercontrol, nint clientcontrol, ref int messageNumber)
        {
            nint __ldapHandle_native = default;
            byte* __dn_native = default;
            byte* __newRdn_native = default;
            byte* __newParentDn_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __newParentDn_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __newRdn_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __dn_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __newParentDn_native__marshaller.FromManaged(newParentDn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __newRdn_native__marshaller.FromManaged(newRdn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __dn_native__marshaller.FromManaged(dn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __messageNumber_native = &messageNumber)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __newParentDn_native = __newParentDn_native__marshaller.ToUnmanaged();
                    __newRdn_native = __newRdn_native__marshaller.ToUnmanaged();
                    __dn_native = __dn_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, __dn_native, __newRdn_native, __newParentDn_native, deleteOldRdn, servercontrol, clientcontrol, __messageNumber_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __newParentDn_native__marshaller.Free();
                __newRdn_native__marshaller.Free();
                __dn_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_rename", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, byte* __dn_native, byte* __newRdn_native, byte* __newParentDn_native, int __deleteOldRdn_native, nint __servercontrol_native, nint __clientcontrol_native, int* __messageNumber_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ldap_compare(global::System.DirectoryServices.Protocols.ConnectionHandle ldapHandle, string dn, string attributeName, global::System.DirectoryServices.Protocols.BerVal binaryValue, nint servercontrol, nint clientcontrol, ref int messageNumber)
        {
            nint __ldapHandle_native = default;
            byte* __dn_native = default;
            byte* __attributeName_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __attributeName_native__marshaller = new();
            scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __dn_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.ConnectionHandle>.ManagedToUnmanagedIn __ldapHandle_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __attributeName_native__marshaller.FromManaged(attributeName, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __dn_native__marshaller.FromManaged(dn, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __ldapHandle_native__marshaller.FromManaged(ldapHandle);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __messageNumber_native = &messageNumber)
                fixed (void* __binaryValue_native = &global::System.DirectoryServices.Protocols.BerVal.PinningMarshaller.GetPinnableReference(binaryValue))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __attributeName_native = __attributeName_native__marshaller.ToUnmanaged();
                    __dn_native = __dn_native__marshaller.ToUnmanaged();
                    __ldapHandle_native = __ldapHandle_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__ldapHandle_native, __dn_native, __attributeName_native, (int*)__binaryValue_native, servercontrol, clientcontrol, __messageNumber_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __attributeName_native__marshaller.Free();
                __dn_native__marshaller.Free();
                __ldapHandle_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ldap_compare_ext", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __ldapHandle_native, byte* __dn_native, byte* __attributeName_native, int* __binaryValue_native, nint __servercontrol_native, nint __clientcontrol_native, int* __messageNumber_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_alloc_t", ExactSpelling = true)]
        public static extern partial nint ber_alloc(int option);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint ber_init(global::System.DirectoryServices.Protocols.BerVal value)
        {
            nint __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __value_native = &global::System.DirectoryServices.Protocols.BerVal.PinningMarshaller.GetPinnableReference(value))
            {
                __retVal = __PInvoke((int*)__value_native);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_init", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(int* __value_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_free", ExactSpelling = true)]
        public static extern partial nint ber_free(nint berelement, int option);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_start_seq(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, nuint tag)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_start_seq", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_start_set(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, nuint tag)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_start_set", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_put_seq(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, nuint tag)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_seq", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_put_set(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, nuint tag)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_set", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_put_null(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, nuint tag)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_null", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_put_int(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, int value, nuint tag)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, value, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_int", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, int __value_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_put_enum(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, int value, nuint tag)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, value, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_enum", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, int __value_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_put_boolean(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, int value, nuint tag)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, value, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_boolean", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, int __value_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_put_ostring(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, global::System.DirectoryServices.Protocols.HGlobalMemHandle value, nuint length, nuint tag)
        {
            nint __berElement_native = default;
            nint __value_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.HGlobalMemHandle>.ManagedToUnmanagedIn __value_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __value_native__marshaller.FromManaged(value);
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __value_native = __value_native__marshaller.ToUnmanaged();
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native, length, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __value_native__marshaller.Free();
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_ostring", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nint __value_native, nuint __length_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_put_string(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, global::System.DirectoryServices.Protocols.HGlobalMemHandle value, nuint tag)
        {
            nint __berElement_native = default;
            nint __value_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.HGlobalMemHandle>.ManagedToUnmanagedIn __value_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __value_native__marshaller.FromManaged(value);
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __value_native = __value_native__marshaller.ToUnmanaged();
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __value_native__marshaller.Free();
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_string", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nint __value_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_put_bitstring(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, global::System.DirectoryServices.Protocols.HGlobalMemHandle value, nuint length, nuint tag)
        {
            nint __berElement_native = default;
            nint __value_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.HGlobalMemHandle>.ManagedToUnmanagedIn __value_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __value_native__marshaller.FromManaged(value);
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __value_native = __value_native__marshaller.ToUnmanaged();
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native, length, tag);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __value_native__marshaller.Free();
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_put_bitstring", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nint __value_native, nuint __length_native, nuint __tag_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int ber_flatten(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, ref nint value)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __value_native = &value)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_flatten", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nint* __value_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_bvfree", ExactSpelling = true)]
        public static extern partial int ber_bvfree(nint value);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_bvecfree", ExactSpelling = true)]
        public static extern partial int ber_bvecfree(nint value);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_skip_tag(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, ref nuint len)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nuint* __len_native = &len)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __len_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_skip_tag", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nuint* __len_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_get_null(global::System.DirectoryServices.Protocols.SafeBerHandle berElement)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_get_null", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_get_int(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, ref int value)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __value_native = &value)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_get_int", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, int* __value_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_get_enum(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, ref int value)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __value_native = &value)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_get_enum", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, int* __value_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_get_boolean(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, ref int value)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __value_native = &value)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_get_boolean", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, int* __value_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_get_stringb(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, ref nint value, ref nuint bitLength)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nuint* __bitLength_native = &bitLength)
                fixed (nint* __value_native = &value)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native, __bitLength_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_get_stringb", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nint* __value_native, nuint* __bitLength_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Ldap
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27601")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static partial int ber_get_stringal(global::System.DirectoryServices.Protocols.SafeBerHandle berElement, ref nint value)
        {
            nint __berElement_native = default;
            int __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.DirectoryServices.Protocols.SafeBerHandle>.ManagedToUnmanagedIn __berElement_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __berElement_native__marshaller.FromManaged(berElement);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (nint* __value_native = &value)
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __berElement_native = __berElement_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__berElement_native, __value_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __berElement_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("libldap.so.2", EntryPoint = "ber_get_stringal", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __berElement_native, nint* __value_native);
        }
    }
}