Example #1
0
 internal LdapSessionOptions(LdapConnection connection)
 {
     this.callbackRoutine          = new ReferralCallback();
     this.connection               = connection;
     this.queryDelegate            = new QUERYFORCONNECTIONInternal(this.ProcessQueryConnection);
     this.notifiyDelegate          = new NOTIFYOFNEWCONNECTIONInternal(this.ProcessNotifyConnection);
     this.dereferenceDelegate      = new DEREFERENCECONNECTIONInternal(this.ProcessDereferenceConnection);
     this.serverCertificateRoutine = new VERIFYSERVERCERT(this.ProcessServerCertificate);
 }
Example #2
0
        private void ProcessCallBackRoutine(ReferralCallback tempCallback)
        {
            LdapReferralCallback value = new LdapReferralCallback();

            value.sizeofcallback = Marshal.SizeOf(typeof(LdapReferralCallback));
            value.query          = tempCallback.QueryForConnection == null ? null : _queryDelegate;
            value.notify         = tempCallback.NotifyNewConnection == null ? null : _notifiyDelegate;
            value.dereference    = tempCallback.DereferenceConnection == null ? null : _dereferenceDelegate;

            int error = Wldap32.ldap_set_option_referral(_connection.ldapHandle, LdapOption.LDAP_OPT_REFERRAL_CALLBACK, ref value);

            ErrorChecking.CheckAndSetLdapError(error);
        }
Example #3
0
        private void ProcessCallBackRoutine(ReferralCallback tempCallback)
        {
            QUERYFORCONNECTIONInternal    qUERYFORCONNECTIONInternal;
            NOTIFYOFNEWCONNECTIONInternal nOTIFYOFNEWCONNECTIONInternal;
            DEREFERENCECONNECTIONInternal dEREFERENCECONNECTIONInternal;
            LdapReferralCallback          ldapReferralCallback = new LdapReferralCallback();

            ldapReferralCallback.sizeofcallback = Marshal.SizeOf(typeof(LdapReferralCallback));
            LdapReferralCallback ldapReferralCallbackPointer = ldapReferralCallback;

            if (tempCallback.QueryForConnection == null)
            {
                qUERYFORCONNECTIONInternal = null;
            }
            else
            {
                qUERYFORCONNECTIONInternal = this.queryDelegate;
            }
            ldapReferralCallbackPointer.query = qUERYFORCONNECTIONInternal;
            LdapReferralCallback ldapReferralCallbackPointer1 = ldapReferralCallback;

            if (tempCallback.NotifyNewConnection == null)
            {
                nOTIFYOFNEWCONNECTIONInternal = null;
            }
            else
            {
                nOTIFYOFNEWCONNECTIONInternal = this.notifiyDelegate;
            }
            ldapReferralCallbackPointer1.notify = nOTIFYOFNEWCONNECTIONInternal;
            LdapReferralCallback ldapReferralCallbackPointer2 = ldapReferralCallback;

            if (tempCallback.DereferenceConnection == null)
            {
                dEREFERENCECONNECTIONInternal = null;
            }
            else
            {
                dEREFERENCECONNECTIONInternal = this.dereferenceDelegate;
            }
            ldapReferralCallbackPointer2.dereference = dEREFERENCECONNECTIONInternal;
            int num = Wldap32.ldap_set_option_referral(this.connection.ldapHandle, LdapOption.LDAP_OPT_REFERRAL_CALLBACK, ref ldapReferralCallback);

            ErrorChecking.CheckAndSetLdapError(num);
        }
Example #4
0
        private void ProcessCallBackRoutine(ReferralCallback tempCallback)
        {
            LdapReferralCallback value = new LdapReferralCallback();
            value.sizeofcallback = Marshal.SizeOf(typeof(LdapReferralCallback));
            value.query = tempCallback.QueryForConnection == null ? null : _queryDelegate;
            value.notify = tempCallback.NotifyNewConnection == null ? null : _notifiyDelegate;
            value.dereference = tempCallback.DereferenceConnection == null ? null : _dereferenceDelegate;

            int error = Wldap32.ldap_set_option_referral(_connection.ldapHandle, LdapOption.LDAP_OPT_REFERRAL_CALLBACK, ref value);
            ErrorChecking.CheckAndSetLdapError(error);
        }
Example #5
0
		private void ProcessCallBackRoutine(ReferralCallback tempCallback)
		{
			QUERYFORCONNECTIONInternal qUERYFORCONNECTIONInternal;
			NOTIFYOFNEWCONNECTIONInternal nOTIFYOFNEWCONNECTIONInternal;
			DEREFERENCECONNECTIONInternal dEREFERENCECONNECTIONInternal;
			LdapReferralCallback ldapReferralCallback = new LdapReferralCallback();
			ldapReferralCallback.sizeofcallback = Marshal.SizeOf(typeof(LdapReferralCallback));
			LdapReferralCallback ldapReferralCallbackPointer = ldapReferralCallback;
			if (tempCallback.QueryForConnection == null)
			{
				qUERYFORCONNECTIONInternal = null;
			}
			else
			{
				qUERYFORCONNECTIONInternal = this.queryDelegate;
			}
			ldapReferralCallbackPointer.query = qUERYFORCONNECTIONInternal;
			LdapReferralCallback ldapReferralCallbackPointer1 = ldapReferralCallback;
			if (tempCallback.NotifyNewConnection == null)
			{
				nOTIFYOFNEWCONNECTIONInternal = null;
			}
			else
			{
				nOTIFYOFNEWCONNECTIONInternal = this.notifiyDelegate;
			}
			ldapReferralCallbackPointer1.notify = nOTIFYOFNEWCONNECTIONInternal;
			LdapReferralCallback ldapReferralCallbackPointer2 = ldapReferralCallback;
			if (tempCallback.DereferenceConnection == null)
			{
				dEREFERENCECONNECTIONInternal = null;
			}
			else
			{
				dEREFERENCECONNECTIONInternal = this.dereferenceDelegate;
			}
			ldapReferralCallbackPointer2.dereference = dEREFERENCECONNECTIONInternal;
			int num = Wldap32.ldap_set_option_referral(this.connection.ldapHandle, LdapOption.LDAP_OPT_REFERRAL_CALLBACK, ref ldapReferralCallback);
			ErrorChecking.CheckAndSetLdapError(num);
		}
Example #6
0
		internal LdapSessionOptions(LdapConnection connection)
		{
			this.callbackRoutine = new ReferralCallback();
			this.connection = connection;
			this.queryDelegate = new QUERYFORCONNECTIONInternal(this.ProcessQueryConnection);
			this.notifiyDelegate = new NOTIFYOFNEWCONNECTIONInternal(this.ProcessNotifyConnection);
			this.dereferenceDelegate = new DEREFERENCECONNECTIONInternal(this.ProcessDereferenceConnection);
			this.serverCertificateRoutine = new VERIFYSERVERCERT(this.ProcessServerCertificate);
		}