📄 winldap.pas
字号:
function ldap_simple_bind_s(ld: PLDAP; dn, passwd: PChar): ULONG; cdecl;
{$EXTERNALSYM ldap_bindA}
function ldap_bindA(ld: PLDAP; dn, cred: PAnsiChar; method: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_bindW}
function ldap_bindW(ld: PLDAP; dn, cred: PWideChar; method: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_bind}
function ldap_bind(ld: PLDAP; dn, cred: PChar; method: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_bind_sA}
function ldap_bind_sA(ld: PLDAP; dn, cred: PAnsiChar; method: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_bind_sW}
function ldap_bind_sW(ld: PLDAP; dn, cred: PWideChar; method: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_bind_s}
function ldap_bind_s(ld: PLDAP; dn, cred: PChar; method: ULONG): ULONG; cdecl;
// The following functions can be used to pass in any arbitrary credentials
// to the server. The application must be ready to interpret the response
// sent back from the server.
//
{$EXTERNALSYM ldap_sasl_bindA}
function ldap_sasl_bindA(ExternalHandle: PLDAP; DistName: PAnsiChar;
AuthMechanism: PAnsiChar; cred: PBERVAL;
var ServerCtrls, ClientCtrls: PLDAPControlA;
var MessageNumber: Integer): Integer; cdecl;
{$EXTERNALSYM ldap_sasl_bindW}
function ldap_sasl_bindW(ExternalHandle: PLDAP; DistName: PWideChar;
AuthMechanism: PWideChar; cred: PBERVAL;
var ServerCtrls, ClientCtrls: PLDAPControlW;
var MessageNumber: Integer): Integer; cdecl;
{$EXTERNALSYM ldap_sasl_bind}
function ldap_sasl_bind(ExternalHandle: PLDAP; DistName: PChar;
AuthMechanism: PChar; cred: PBERVAL;
var ServerCtrls, ClientCtrls: PLDAPControl;
var MessageNumber: Integer): Integer; cdecl;
function ldap_sasl_bind_sA(ExternalHandle: PLDAP; DistName: PAnsiChar;
AuthMechanism: PAnsiChar; cred: PBERVAL;
var ServerCtrls, ClientCtrls: PLDAPControlA;
var ServerData: PBERVAL): Integer; cdecl;
function ldap_sasl_bind_sW(ExternalHandle: PLDAP; DistName: PWideChar;
AuthMechanism: PWideChar; cred: PBERVAL;
var ServerCtrls, ClientCtrls: PLDAPControlW;
var ServerData: PBERVAL): Integer; cdecl;
function ldap_sasl_bind_s(ExternalHandle: PLDAP; DistName: PChar;
AuthMechanism: PChar; cred: PBERVAL;
var ServerCtrls, ClientCtrls: PLDAPControl;
var ServerData: PBERVAL): Integer; cdecl;
//
// Synchronous and asynch search routines.
//
// filter follows RFC 1960 with the addition that '(' ')' '*' ' ' '\' and
// '\0' are all escaped with '\'
//
// Scope of search. This corresponds to the "scope" parameter on search
const
{$EXTERNALSYM LDAP_SCOPE_BASE}
LDAP_SCOPE_BASE = $00;
{$EXTERNALSYM LDAP_SCOPE_ONELEVEL}
LDAP_SCOPE_ONELEVEL = $01;
{$EXTERNALSYM LDAP_SCOPE_SUBTREE}
LDAP_SCOPE_SUBTREE = $02;
{$EXTERNALSYM ldap_searchA}
function ldap_searchA(
ld: PLDAP;
base: PAnsiChar; // distinguished name or ''
scope: ULONG; // LDAP_SCOPE_xxxx
filter: PAnsiChar;
attrs: PAnsiChar; // pointer to an array of PAnsiChar attribute names
attrsonly: ULONG // boolean on whether to only return attr names
): ULONG; cdecl;
{$EXTERNALSYM ldap_searchW}
function ldap_searchW(
ld: PLDAP;
base: PWideChar; // distinguished name or ''
scope: ULONG; // LDAP_SCOPE_xxxx
filter: PWideChar;
attrs: PWideChar; // pointer to an array of PAnsiChar attribute names
attrsonly: ULONG // boolean on whether to only return attr names
): ULONG; cdecl;
{$EXTERNALSYM ldap_search}
function ldap_search(
ld: PLDAP;
base: PChar; // distinguished name or ''
scope: ULONG; // LDAP_SCOPE_xxxx
filter: PChar;
attrs: PChar; // pointer to an array of PAnsiChar attribute names
attrsonly: ULONG // boolean on whether to only return attr names
): ULONG; cdecl;
{$EXTERNALSYM ldap_search_sA}
function ldap_search_sA(ld: PLDAP; base: PAnsiChar; scope: ULONG;
filter, attrs: PAnsiChar; attrsonly: ULONG;
var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_search_sW}
function ldap_search_sW(ld: PLDAP; base: PWideChar; scope: ULONG;
filter, attrs: PWideChar; attrsonly: ULONG;
var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_search_s}
function ldap_search_s(ld: PLDAP; base: PChar; scope: ULONG;
filter, attrs: PChar; attrsonly: ULONG;
var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_search_stA}
function ldap_search_stA(ld: PLDAP; base: PAnsiChar; scope: ULONG;
filter, attrs: PAnsiChar; attrsonly: ULONG; var timeout: TLDAPTimeVal;
var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_search_stW}
function ldap_search_stW(ld: PLDAP; base: PWideChar; scope: ULONG;
filter, attrs: PWideChar; attrsonly: ULONG; var timeout: TLDAPTimeVal;
var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_search_st}
function ldap_search_st(ld: PLDAP; base: PChar; scope: ULONG;
filter, attrs: PChar; attrsonly: ULONG; var timeout: TLDAPTimeVal;
var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_search_extA}
function ldap_search_extA(ld: PLDAP; base: PAnsiChar; scope: ULONG;
filter, attrs: PAnsiChar; attrsonly: ULONG;
var ServerControls, ClientControls: PLDAPControlA;
TimeLimit, SizeLimit: ULONG; var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_search_extW}
function ldap_search_extW(ld: PLDAP; base: PWideChar; scope: ULONG;
filter, attrs: PWideChar; attrsonly: ULONG;
var ServerControls, ClientControls: PLDAPControlW;
TimeLimit, SizeLimit: ULONG; var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_search_ext}
function ldap_search_ext(ld: PLDAP; base: PChar; scope: ULONG;
filter, attrs: PChar; attrsonly: ULONG;
var ServerControls, ClientControls: PLDAPControl;
TimeLimit, SizeLimit: ULONG; var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_search_ext_sA}
function ldap_search_ext_sA(ld: PLDAP; base: PAnsiChar; scope: ULONG;
filter, attrs: PAnsiChar; attrsonly: ULONG;
var ServerControls, ClientControls: PLDAPControlA;
var timeout: TLDAPTimeVal; SizeLimit: ULONG;
var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_search_ext_sW}
function ldap_search_ext_sW(ld: PLDAP; base: PWideChar; scope: ULONG;
filter, attrs: PWideChar; attrsonly: ULONG;
var ServerControls, ClientControls: PLDAPControlW;
var timeout: TLDAPTimeVal; SizeLimit: ULONG;
var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_search_ext_s}
function ldap_search_ext_s(ld: PLDAP; base: PChar; scope: ULONG;
filter, attrs: PChar; attrsonly: ULONG;
var ServerControls, ClientControls: PLDAPControl;
var timeout: TLDAPTimeVal; SizeLimit: ULONG;
var res: PLDAPMessage): ULONG; cdecl;
//
// Extended API to check filter syntax. Returns LDAP error code if syntax
// is invalid or LDAP_SUCCESS if it's ok.
//
{$EXTERNALSYM ldap_check_filterA}
function ldap_check_filterA(ld: PLDAP; SearchFilter: PAnsiChar): ULONG; cdecl;
{$EXTERNALSYM ldap_check_filterW}
function ldap_check_filterW(ld: PLDAP; SearchFilter: PWideChar): ULONG; cdecl;
{$EXTERNALSYM ldap_check_filter}
function ldap_check_filter(ld: PLDAP; SearchFilter: PChar): ULONG; cdecl;
//
// modify an existing entry
//
//
// multi-thread: ldap_modify calls are not safe in that the message number
// is returned rather than the return code. You have to look
// at the connection block in an error case and the return code
// may be overwritten by another thread inbetween.
//
// Use ldap_modify_ext instead, as these are thread safe.
//
// ldap_modify_s and ldap_modify_ext* calls are thread safe.
//
{$EXTERNALSYM ldap_modifyA}
function ldap_modifyA(ld: PLDAP; dn: PAnsiChar; var mods: PLDAPModA): ULONG; cdecl;
{$EXTERNALSYM ldap_modifyW}
function ldap_modifyW(ld: PLDAP; dn: PWideChar; var mods: PLDAPModW): ULONG; cdecl;
{$EXTERNALSYM ldap_modify}
function ldap_modify(ld: PLDAP; dn: PChar; var mods: PLDAPMod): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_sA}
function ldap_modify_sA(ld: PLDAP; dn: PAnsiChar; var mods: PLDAPModA): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_sW}
function ldap_modify_sW(ld: PLDAP; dn: PWideChar; var mods: PLDAPModW): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_s}
function ldap_modify_s(ld: PLDAP; dn: PChar; var mods: PLDAPMod): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_extA}
function ldap_modify_extA(ld: PLDAP; dn: PAnsiChar; var mods: PLDAPModA;
var ServerControls, ClientControls: PLDAPControlA;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_extW}
function ldap_modify_extW(ld: PLDAP; dn: PWideChar; var mods: PLDAPModW;
var ServerControls, ClientControls: PLDAPControlW;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_ext}
function ldap_modify_ext(ld: PLDAP; dn: PChar; var mods: PLDAPMod;
var ServerControls, ClientControls: PLDAPControl;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_ext_sA}
function ldap_modify_ext_sA(ld: PLDAP; dn: PAnsiChar; var mods: PLDAPModA;
var ServerControls, ClientControls: PLDAPControlA): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_ext_sW}
function ldap_modify_ext_sW(ld: PLDAP; dn: PWideChar; var mods: PLDAPModW;
var ServerControls, ClientControls: PLDAPControlW): ULONG; cdecl;
{$EXTERNALSYM ldap_modify_ext_s}
function ldap_modify_ext_s(ld: PLDAP; dn: PChar; var mods: PLDAPMod;
var ServerControls, ClientControls: PLDAPControl): ULONG; cdecl;
//
// modrdn and modrdn2 function both as RenameObject and MoveObject.
//
// Note that to LDAP v2 servers, only rename within a given container
// is supported... therefore NewDistinguishedName is actually NewRDN.
// Here are some examples :
//
// This works to both v2 and v3 servers :
//
// DN = CN=Bob,OU=FOO,O=BAR
// NewDN = CN=Joe
//
// result is: CN=Joe,OU=FOO,O=BAR
//
// This works to only v3 and above servers :
//
// DN = CN=Bob,OU=FOO,O=BAR
// NewDN = CN=Joe,OU=FOOBAR,O=BAR
//
// result is: CN=Joe,OU=FOOBAR,O=BAR
//
// If you try the second example to a v2 server, we'll send the whole
// NewDN over as the new RDN(rather than break up the parent OU and
// child). The server will then give you back some unknown error.
//
//
// multi-thread: ldap_modrdn and ldap_modrdn2 calls are not safe in that
// the message number is returned rather than the return code.
// You have to look at the connection block in an error case
// and the return code may be overwritten by another thread
// inbetween.
//
// Use ldap_rename_ext instead, as these are thread safe.
//
{$EXTERNALSYM ldap_modrdn2A}
function ldap_modrdn2A(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PAnsiChar;
DeleteOldRdn: Integer): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn2W}
function ldap_modrdn2W(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PWideChar;
DeleteOldRdn: Integer): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn2}
function ldap_modrdn2(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PChar;
DeleteOldRdn: Integer): ULONG; cdecl;
//
// ldap_modrdn simply calls ldap_modrdn2 with a value of 1 for DeleteOldRdn.
//
{$EXTERNALSYM ldap_modrdnA}
function ldap_modrdnA(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PAnsiChar): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdnW}
function ldap_modrdnW(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PWideChar): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn}
function ldap_modrdn(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PChar): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn2_sA}
function ldap_modrdn2_sA(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PAnsiChar;
DeleteOldRdn: Integer): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn2_sW}
function ldap_modrdn2_sW(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PWideChar;
DeleteOldRdn: Integer): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn2_s}
function ldap_modrdn2_s(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PChar;
DeleteOldRdn: Integer): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn_sA}
function ldap_modrdn_sA(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PAnsiChar): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn_sW}
function ldap_modrdn_sW(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PWideChar): ULONG; cdecl;
{$EXTERNALSYM ldap_modrdn_s}
function ldap_modrdn_s(var ExternalHandle: LDAP;
DistinguishedName, NewDistinguishedName: PChar): ULONG; cdecl;
//
// Extended Rename operations. These take controls and separate out the
// parent from the RDN, for clarity.
//
{$EXTERNALSYM ldap_rename_extA}
function ldap_rename_extA(ld: PLDAP; dn, NewRDN, NewParent: PAnsiChar;
DeleteOldRdn: Integer; var ServerControls, ClientControls: PLDAPControlA;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_rename_extW}
function ldap_rename_extW(ld: PLDAP; dn, NewRDN, NewParent: PWideChar;
DeleteOldRdn: Integer; var ServerControls, ClientControls: PLDAPControlW;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_rename_ext}
function ldap_rename_ext(ld: PLDAP; dn, NewRDN, NewParent: PChar;
DeleteOldRdn: Integer; var ServerControls, ClientControls: PLDAPControl;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_rename_ext_sA}
function ldap_rename_ext_sA(ld: PLDAP;
dn, NewRDN, NewParent: PAnsiChar; DeleteOldRdn: Integer;
var ServerControls, ClientControls: PLDAPControlA): ULONG; cdecl;
{$EXTERNALSYM ldap_rename_ext_sW}
function ldap_rename_ext_sW(ld: PLDAP;
dn, NewRDN, NewParent: PWideChar; DeleteOldRdn: Integer;
var ServerControls, ClientControls: PLDAPControlW): ULONG; cdecl;
{$EXTERNALSYM ldap_rename_ext_s}
function ldap_rename_ext_s(ld: PLDAP;
dn, NewRDN, NewParent: PChar; DeleteOldRdn: Integer;
var ServerControls, ClientControls: PLDAPControl): ULONG; cdecl;
//
// Add an entry to the tree
//
//
// multi-thread: ldap_add calls are not safe in that the message number
// is returned rather than the return code. You have to look
// at the connection block in an error case and the return code
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -