示例#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);
                }
            }
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
     }
 }
示例#11
0
 internal static int GetBoolOption(ConnectionHandle ldapHandle, LdapOption option, ref bool outValue) => Interop.Ldap.ldap_get_option_bool(ldapHandle, option, ref outValue);
示例#12
0
 internal static int SetReferralOption(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue) => Interop.Ldap.ldap_set_option_referral(ldapHandle, option, ref outValue);
示例#13
0
 public static partial int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
示例#14
0
 public static partial int ldap_get_option_bool(ConnectionHandle ldapHandle, LdapOption option, ref bool outValue);
示例#15
0
 public static partial int ldap_set_option_string(ConnectionHandle ldapHandle, LdapOption option, [MarshalAs(UnmanagedType.LPUTF8Str)] string inValue);
示例#16
0
 public static partial int ldap_set_option_int(ConnectionHandle ld, LdapOption option, ref int inValue);
示例#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);
示例#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);
			}
		}
示例#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);
			}
		}
示例#20
0
文件: Wldap32.cs 项目: nickchal/pash
		public static extern int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
示例#21
0
文件: Wldap32.cs 项目: nickchal/pash
		public static extern int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
示例#22
0
文件: Wldap32.cs 项目: nickchal/pash
		public static extern int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
示例#23
0
 internal static int GetPtrOption(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue) => Interop.Ldap.ldap_get_option_ptr(ldapHandle, option, ref outValue);
示例#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);
			}
		}
示例#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);
示例#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;
        }
示例#27
0
文件: Wldap32.cs 项目: nickchal/pash
		public static extern int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
示例#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);
        }
示例#29
0
 public static partial int ldap_set_option_ptr(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue);
示例#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;
        }
示例#31
0
 public static partial int ldap_set_option_referral(ConnectionHandle ldapHandle, LdapOption option, ref LdapReferralCallback outValue);
示例#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);
            }
        }
示例#33
0
 public static unsafe partial int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, void *outValue);
示例#34
0
文件: Wldap32.cs 项目: nickchal/pash
		public static extern int ldap_get_option_secInfo(ConnectionHandle ldapHandle, LdapOption option, SecurityPackageContextConnectionInformation outValue);
示例#35
0
 private static partial int ldap_get_option_int(IntPtr ldapHandle, LdapOption option, ref int outValue);
示例#36
0
 internal static int SetPtrOption(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue) => Interop.Ldap.ldap_set_option_ptr(ldapHandle, option, ref inValue);
示例#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);
         }
     }
 }
示例#39
0
 internal static int GetIntOption(ConnectionHandle ldapHandle, LdapOption option, ref int outValue) => Interop.Ldap.ldap_get_option_int(ldapHandle, option, ref outValue);
示例#40
0
文件: Wldap32.cs 项目: nickchal/pash
		public static extern int ldap_get_option_sechandle(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue);
示例#41
0
 internal static int GetSecurityHandleOption(ConnectionHandle ldapHandle, LdapOption option, ref SecurityHandle outValue) => Interop.Ldap.ldap_get_option_sechandle(ldapHandle, option, ref outValue);
示例#42
0
 public static partial int ldap_set_option_clientcert(ConnectionHandle ldapHandle, LdapOption option, QUERYCLIENTCERT outValue);
示例#43
0
 internal static int SetBoolOption(ConnectionHandle ld, LdapOption option, bool value) => Interop.Ldap.ldap_set_option_bool(ld, option, value);
示例#44
0
 public static partial int ldap_set_option_servercert(ConnectionHandle ldapHandle, LdapOption option, VERIFYSERVERCERT outValue);
示例#45
0
 internal static int SetIntOption(ConnectionHandle ld, LdapOption option, ref int inValue) => Interop.Ldap.ldap_set_option_int(ld, option, ref inValue);
示例#46
0
文件: Wldap32.cs 项目: nickchal/pash
		public static extern int ldap_set_option_int(ConnectionHandle ldapHandle, LdapOption option, ref int inValue);
示例#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));
 }