internal ConnectionHandle() : base(true)
 {
     base.SetHandle(Wldap32.ldap_init(null, 0x185));
     if (base.handle == IntPtr.Zero)
     {
         int errorCode = Wldap32.LdapGetLastError();
         if (Utility.IsLdapError((LdapError)errorCode))
         {
             string message = LdapErrorMappings.MapResultCode(errorCode);
             throw new LdapException(errorCode, message);
         }
         throw new LdapException(errorCode);
     }
 }
Exemple #2
0
        internal ConnectionHandle() : base(true)
        {
            SetHandle(Wldap32.ldap_init(null, 389));

            if (handle == IntPtr.Zero)
            {
                int error = Wldap32.LdapGetLastError();
                if (Utility.IsLdapError((LdapError)error))
                {
                    string errorMessage = LdapErrorMappings.MapResultCode(error);
                    throw new LdapException(error, errorMessage);
                }
                else
                {
                    throw new LdapException(error);
                }
            }
        }
Exemple #3
0
 internal ConnectionHandle(IntPtr value, bool disposeHandle) : base(true)
 {
     _needDispose = disposeHandle;
     if (value == IntPtr.Zero)
     {
         int error = Wldap32.LdapGetLastError();
         if (Utility.IsLdapError((LdapError)error))
         {
             string errorMessage = LdapErrorMappings.MapResultCode(error);
             throw new LdapException(error, errorMessage);
         }
         else
         {
             throw new LdapException(error);
         }
     }
     else
     {
         SetHandle(value);
     }
 }
 internal ConnectionHandle() : base(true)
 {
     base.SetHandle(Wldap32.ldap_init(null, 0x185));
     if (this.handle != (IntPtr)0)
     {
         return;
     }
     else
     {
         int num = Wldap32.LdapGetLastError();
         if (!Utility.IsLdapError((LdapError)num))
         {
             throw new LdapException(num);
         }
         else
         {
             string str = LdapErrorMappings.MapResultCode(num);
             throw new LdapException(num, str);
         }
     }
 }
 internal ConnectionHandle(IntPtr value) : base(true)
 {
     if (value != (IntPtr)0)
     {
         base.SetHandle(value);
         return;
     }
     else
     {
         int num = Wldap32.LdapGetLastError();
         if (!Utility.IsLdapError((LdapError)num))
         {
             throw new LdapException(num);
         }
         else
         {
             string str = LdapErrorMappings.MapResultCode(num);
             throw new LdapException(num, str);
         }
     }
 }