private void SetStringValueHelper(LdapOption option, string value) { if (_connection.disposed) { throw new ObjectDisposedException(GetType().Name); } IntPtr inValue = new IntPtr(0); if (value != null) { inValue = Marshal.StringToHGlobalUni(value); } try { int error = Wldap32.ldap_set_option_ptr(_connection.ldapHandle, option, ref inValue); ErrorChecking.CheckAndSetLdapError(error); } finally { if (inValue != (IntPtr)0) { Marshal.FreeHGlobal(inValue); } } }
private string GetStringValueHelper(LdapOption option, bool releasePtr) { if (_connection.disposed) { throw new ObjectDisposedException(GetType().Name); } IntPtr outValue = new IntPtr(0); int error = Wldap32.ldap_get_option_ptr(_connection.ldapHandle, option, ref outValue); ErrorChecking.CheckAndSetLdapError(error); string s = null; if (outValue != (IntPtr)0) { s = Marshal.PtrToStringUni(outValue); } if (releasePtr) { Wldap32.ldap_memfree(outValue); } return(s); }
private int GetIntValueHelper(LdapOption option) { if (this.connection.disposed) { throw new ObjectDisposedException(base.GetType().Name); } int outValue = 0; ErrorChecking.CheckAndSetLdapError(Wldap32.ldap_get_option_int(this.connection.ldapHandle, option, ref outValue)); return outValue; }
private void SetIntValueHelper(LdapOption option, int value) { if (this.connection.disposed) { throw new ObjectDisposedException(base.GetType().Name); } int inValue = value; ErrorChecking.CheckAndSetLdapError(Wldap32.ldap_set_option_int(this.connection.ldapHandle, option, ref inValue)); }
private int GetIntValueHelper(LdapOption option) { if (this.connection.disposed) { throw new ObjectDisposedException(base.GetType().Name); } int outValue = 0; ErrorChecking.CheckAndSetLdapError(Wldap32.ldap_get_option_int(this.connection.ldapHandle, option, ref outValue)); return(outValue); }
private void SetIntValueHelper(LdapOption option, int value) { if (_connection.disposed) { throw new ObjectDisposedException(GetType().Name); } int temp = value; int error = Wldap32.ldap_set_option_int(_connection.ldapHandle, option, ref temp); ErrorChecking.CheckAndSetLdapError(error); }
private void SetIntValueHelper(LdapOption option, int value) { if (!this.connection.disposed) { int num = value; int num1 = Wldap32.ldap_set_option_int(this.connection.ldapHandle, option, ref num); ErrorChecking.CheckAndSetLdapError(num1); return; } else { throw new ObjectDisposedException(this.GetType().Name); } }
private string GetStringValueHelper(LdapOption option, bool releasePtr) { if (this.connection.disposed) { throw new ObjectDisposedException(base.GetType().Name); } IntPtr outValue = new IntPtr(0); ErrorChecking.CheckAndSetLdapError(Wldap32.ldap_get_option_ptr(this.connection.ldapHandle, option, ref outValue)); string str = null; if (outValue != IntPtr.Zero) { str = Marshal.PtrToStringUni(outValue); } if (releasePtr) { Wldap32.ldap_memfree(outValue); } return str; }
private string GetStringValueHelper(LdapOption option, bool releasePtr) { if (this.connection.disposed) { throw new ObjectDisposedException(base.GetType().Name); } IntPtr outValue = new IntPtr(0); ErrorChecking.CheckAndSetLdapError(Wldap32.ldap_get_option_ptr(this.connection.ldapHandle, option, ref outValue)); string str = null; if (outValue != IntPtr.Zero) { str = Marshal.PtrToStringUni(outValue); } if (releasePtr) { Wldap32.ldap_memfree(outValue); } return(str); }
private string GetStringValueHelper(LdapOption option, bool releasePtr) { if (!this.connection.disposed) { IntPtr intPtr = new IntPtr(0); int num = Wldap32.ldap_get_option_ptr(this.connection.ldapHandle, option, ref intPtr); ErrorChecking.CheckAndSetLdapError(num); string stringUni = null; if (intPtr != (IntPtr)0) { stringUni = Marshal.PtrToStringUni(intPtr); } if (releasePtr) { Wldap32.ldap_memfree(intPtr); } return(stringUni); } else { throw new ObjectDisposedException(this.GetType().Name); } }
internal static int GetBoolOption(ConnectionHandle ldapHandle, LdapOption option, ref bool outValue) => Interop.Ldap.ldap_get_option_bool(ldapHandle, option, ref outValue);
internal static int SetReferralOption(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue) => Interop.Ldap.ldap_set_option_referral(ldapHandle, option, ref outValue);
public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
public static partial int ldap_get_option_bool(ConnectionHandle ldapHandle, LdapOption option, ref bool outValue);
public static partial int ldap_set_option_string(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.LPUTF8Str)] string inValue);
public static partial int ldap_set_option_int(ConnectionHandle ld, LdapOption option, ref int inValue);
// This option is not supported in Linux, so it would most likely throw. internal static int SetClientCertOption(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue) => Interop.Ldap.ldap_set_option_clientcert(ldapHandle, option, outValue);
private string GetStringValueHelper(LdapOption option, bool releasePtr) { if (!this.connection.disposed) { IntPtr intPtr = new IntPtr(0); int num = Wldap32.ldap_get_option_ptr(this.connection.ldapHandle, option, ref intPtr); ErrorChecking.CheckAndSetLdapError(num); string stringUni = null; if (intPtr != (IntPtr)0) { stringUni = Marshal.PtrToStringUni(intPtr); } if (releasePtr) { Wldap32.ldap_memfree(intPtr); } return stringUni; } else { throw new ObjectDisposedException(this.GetType().Name); } }
public static extern int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
public static extern int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
public static extern int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
internal static int GetPtrOption(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue) => Interop.Ldap.ldap_get_option_ptr(ldapHandle, option, ref outValue);
private void SetStringValueHelper(LdapOption option, string value) { if (!this.connection.disposed) { IntPtr intPtr = new IntPtr(0); if (value != null) { intPtr = Marshal.StringToHGlobalUni(value); } try { int num = Wldap32.ldap_set_option_ptr(this.connection.ldapHandle, option, ref intPtr); ErrorChecking.CheckAndSetLdapError(num); } finally { if (intPtr != (IntPtr)0) { Marshal.FreeHGlobal(intPtr); } } return; } else { throw new ObjectDisposedException(this.GetType().Name); } }
// This option is not supported on Linux, so it would most likely throw. internal static int GetSecInfoOption(ConnectionHandle ldapHandle, LdapOption option, SecurityPackageContextConnectionInformation outValue) => Interop.Ldap.ldap_get_option_secInfo(ldapHandle, option, outValue);
private int GetIntValueHelper(LdapOption option) { if (_connection.disposed) throw new ObjectDisposedException(GetType().Name); int outValue = 0; int error = Wldap32.ldap_get_option_int(_connection.ldapHandle, option, ref outValue); ErrorChecking.CheckAndSetLdapError(error); return outValue; }
public static extern int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
private void SetIntValueHelper(LdapOption option, int value) { if (_connection.disposed) throw new ObjectDisposedException(GetType().Name); int temp = value; int error = Wldap32.ldap_set_option_int(_connection.ldapHandle, option, ref temp); ErrorChecking.CheckAndSetLdapError(error); }
public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
private string GetStringValueHelper(LdapOption option, bool releasePtr) { if (_connection.disposed) throw new ObjectDisposedException(GetType().Name); IntPtr outValue = new IntPtr(0); int error = Wldap32.ldap_get_option_ptr(_connection.ldapHandle, option, ref outValue); ErrorChecking.CheckAndSetLdapError(error); string s = null; if (outValue != (IntPtr)0) s = Marshal.PtrToStringUni(outValue); if (releasePtr) Wldap32.ldap_memfree(outValue); return s; }
public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
private void SetStringValueHelper(LdapOption option, string value) { if (_connection.disposed) throw new ObjectDisposedException(GetType().Name); IntPtr inValue = new IntPtr(0); if (value != null) { inValue = Marshal.StringToHGlobalUni(value); } try { int error = Wldap32.ldap_set_option_ptr(_connection.ldapHandle, option, ref inValue); ErrorChecking.CheckAndSetLdapError(error); } finally { if (inValue != (IntPtr)0) Marshal.FreeHGlobal(inValue); } }
public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void *outValue);
public static extern int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, SecurityPackageContextConnectionInformation outValue);
private static partial int ldap_get_option_int(IntPtr ldapHandle, LdapOption option, ref int outValue);
internal static int SetPtrOption(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue) => Interop.Ldap.ldap_set_option_ptr(ldapHandle, option, ref inValue);
// This option is not supported in Linux, so it would most likely throw. internal static int SetServerCertOption(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue) => Interop.Ldap.ldap_set_option_servercert(ldapHandle, option, outValue);
private void SetStringValueHelper(LdapOption option, string value) { if (this.connection.disposed) { throw new ObjectDisposedException(base.GetType().Name); } IntPtr inValue = new IntPtr(0); if (value != null) { inValue = Marshal.StringToHGlobalUni(value); } try { ErrorChecking.CheckAndSetLdapError(Wldap32.ldap_set_option_ptr(this.connection.ldapHandle, option, ref inValue)); } finally { if (inValue != IntPtr.Zero) { Marshal.FreeHGlobal(inValue); } } }
internal static int GetIntOption(ConnectionHandle ldapHandle, LdapOption option, ref int outValue) => Interop.Ldap.ldap_get_option_int(ldapHandle, option, ref outValue);
public static extern int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
internal static int GetSecurityHandleOption(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue) => Interop.Ldap.ldap_get_option_sechandle(ldapHandle, option, ref outValue);
public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
internal static int SetBoolOption(ConnectionHandle ld, LdapOption option, bool value) => Interop.Ldap.ldap_set_option_bool(ld, option, value);
public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
internal static int SetIntOption(ConnectionHandle ld, LdapOption option, ref int inValue) => Interop.Ldap.ldap_set_option_int(ld, option, ref inValue);
public static extern int ldap_set_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int inValue);
internal static int SetStringOption(ConnectionHandle ldapHandle, LdapOption option, string inValue) => Interop.Ldap.ldap_set_option_string(ldapHandle, option, inValue);