Exemplo n.º 1
0
        public int Search(string base_entry,
                          SearchScope scope,
                          string filter,
                          string[]    attrs,
                          bool attrsonly,
                          TimeSpan timeOut,
                          int sizeLimit,
                          out LDAPMessage res)
        {
            // FIXME should expose client/server ctrls
            IntPtr  serverctrls = new IntPtr();
            IntPtr  clientctrls = new IntPtr();
            TimeVal tv          = TimeVal.FromTimeSpan(timeOut);
            IntPtr  native_res;
            int     rv;

            rv = ldap_search_ext_s(ld, base_entry, (int)scope, filter,
                                   attrs, attrsonly ? 1 : 0,
                                   serverctrls, clientctrls,
                                   ref tv, sizeLimit, out native_res);

            if (native_res != IntPtr.Zero)
            {
                res = new LDAPMessage(this, native_res);
            }
            else
            {
                res = null;
            }

            return(rv);
        }