コード例 #1
0
ファイル: LdapSessionOptions.cs プロジェクト: davzucky/corefx
        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
ファイル: LdapSessionOptions.cs プロジェクト: davzucky/corefx
        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;
 }
コード例 #4
0
        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));
        }
コード例 #5
0
        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;
 }
コード例 #9
0
        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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 internal static int GetBoolOption(ConnectionHandle ldapHandle, LdapOption option, ref bool outValue) => Interop.Ldap.ldap_get_option_bool(ldapHandle, option, ref outValue);
コード例 #12
0
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 // 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
ファイル: LdapSessionOptions.cs プロジェクト: nickchal/pash
		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
ファイル: LdapSessionOptions.cs プロジェクト: nickchal/pash
		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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 internal static int GetPtrOption(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr outValue) => Interop.Ldap.ldap_get_option_ptr(ldapHandle, option, ref outValue);
コード例 #24
0
ファイル: LdapSessionOptions.cs プロジェクト: nickchal/pash
		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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 // 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
ファイル: LdapSessionOptions.cs プロジェクト: chcosta/corefx
        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
ファイル: LdapSessionOptions.cs プロジェクト: chcosta/corefx
        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
ファイル: LdapSessionOptions.cs プロジェクト: chcosta/corefx
        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
ファイル: LdapSessionOptions.cs プロジェクト: chcosta/corefx
        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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 internal static int SetPtrOption(ConnectionHandle ldapHandle, LdapOption option, ref IntPtr inValue) => Interop.Ldap.ldap_set_option_ptr(ldapHandle, option, ref inValue);
コード例 #37
0
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 // 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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 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
ファイル: LdapPal.Linux.cs プロジェクト: wilfriedb/runtime
 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));
 }