Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 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);
        }
Ejemplo n.º 10
0
 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);
     }
 }
Ejemplo n.º 11
0
 internal static int GetBoolOption(ConnectionHandle ldapHandle, LdapOption option, ref bool outValue) => Interop.Ldap.ldap_get_option_bool(ldapHandle, option, ref outValue);
Ejemplo n.º 12
0
 internal static int SetReferralOption(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue) => Interop.Ldap.ldap_set_option_referral(ldapHandle, option, ref outValue);
Ejemplo n.º 13
0
 public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
Ejemplo n.º 14
0
 public static partial int ldap_get_option_bool(ConnectionHandle ldapHandle, LdapOption option, ref bool outValue);
Ejemplo n.º 15
0
 public static partial int ldap_set_option_string(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.LPUTF8Str)] string inValue);
Ejemplo n.º 16
0
 public static partial int ldap_set_option_int(ConnectionHandle ld, LdapOption option, ref int inValue);
Ejemplo n.º 17
0
 // 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);
Ejemplo n.º 18
0
		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);
			}
		}
Ejemplo n.º 19
0
		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);
			}
		}
Ejemplo n.º 20
0
		public static extern int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
Ejemplo n.º 21
0
		public static extern int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
Ejemplo n.º 22
0
		public static extern int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
Ejemplo n.º 23
0
 internal static int GetPtrOption(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue) => Interop.Ldap.ldap_get_option_ptr(ldapHandle, option, ref outValue);
Ejemplo n.º 24
0
		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);
			}
		}
Ejemplo n.º 25
0
 // 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);
Ejemplo n.º 26
0
        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;
        }
Ejemplo n.º 27
0
		public static extern int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
Ejemplo n.º 28
0
        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);
        }
Ejemplo n.º 29
0
 public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
Ejemplo n.º 30
0
        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;
        }
Ejemplo n.º 31
0
 public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
Ejemplo n.º 32
0
        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);
            }
        }
Ejemplo n.º 33
0
 public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void *outValue);
Ejemplo n.º 34
0
		public static extern int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, SecurityPackageContextConnectionInformation outValue);
Ejemplo n.º 35
0
 private static partial int ldap_get_option_int(IntPtr ldapHandle, LdapOption option, ref int outValue);
Ejemplo n.º 36
0
 internal static int SetPtrOption(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue) => Interop.Ldap.ldap_set_option_ptr(ldapHandle, option, ref inValue);
Ejemplo n.º 37
0
 // 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);
         }
     }
 }
Ejemplo n.º 39
0
 internal static int GetIntOption(ConnectionHandle ldapHandle, LdapOption option, ref int outValue) => Interop.Ldap.ldap_get_option_int(ldapHandle, option, ref outValue);
Ejemplo n.º 40
0
		public static extern int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
Ejemplo n.º 41
0
 internal static int GetSecurityHandleOption(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue) => Interop.Ldap.ldap_get_option_sechandle(ldapHandle, option, ref outValue);
Ejemplo n.º 42
0
 public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
Ejemplo n.º 43
0
 internal static int SetBoolOption(ConnectionHandle ld, LdapOption option, bool value) => Interop.Ldap.ldap_set_option_bool(ld, option, value);
Ejemplo n.º 44
0
 public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
Ejemplo n.º 45
0
 internal static int SetIntOption(ConnectionHandle ld, LdapOption option, ref int inValue) => Interop.Ldap.ldap_set_option_int(ld, option, ref inValue);
Ejemplo n.º 46
0
		public static extern int ldap_set_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int inValue);
Ejemplo n.º 47
0
 internal static int SetStringOption(ConnectionHandle ldapHandle, LdapOption option, string inValue) => Interop.Ldap.ldap_set_option_string(ldapHandle, option, inValue);
 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));
 }