📄 winldap.h
字号:
WINLDAPAPI INT LDAPAPI ldap_sasl_bindA(
LDAP *ExternalHandle,
const PCHAR DistName,
const PCHAR AuthMechanism,
const BERVAL *cred,
PLDAPControlA *ServerCtrls,
PLDAPControlA *ClientCtrls,
int *MessageNumber
);
WINLDAPAPI INT LDAPAPI ldap_sasl_bindW(
LDAP *ExternalHandle,
const PWCHAR DistName,
const PWCHAR AuthMechanism,
const BERVAL *cred,
PLDAPControlW *ServerCtrls,
PLDAPControlW *ClientCtrls,
int *MessageNumber
);
WINLDAPAPI INT LDAPAPI ldap_sasl_bind_sA(
LDAP *ExternalHandle,
const PCHAR DistName,
const PCHAR AuthMechanism,
const BERVAL *cred,
PLDAPControlA *ServerCtrls,
PLDAPControlA *ClientCtrls,
PBERVAL *ServerData
);
WINLDAPAPI INT LDAPAPI ldap_sasl_bind_sW(
LDAP *ExternalHandle,
const PWCHAR DistName,
const PWCHAR AuthMechanism,
const BERVAL *cred,
PLDAPControlW *ServerCtrls,
PLDAPControlW *ClientCtrls,
PBERVAL *ServerData
);
#if LDAP_UNICODE
#define ldap_simple_bind ldap_simple_bindW
#define ldap_simple_bind_s ldap_simple_bind_sW
#define ldap_bind ldap_bindW
#define ldap_bind_s ldap_bind_sW
#define ldap_sasl_bind ldap_sasl_bindW
#define ldap_sasl_bind_s ldap_sasl_bind_sW
#else
WINLDAPAPI ULONG LDAPAPI ldap_simple_bind( LDAP *ld, const PCHAR dn, const PCHAR passwd );
WINLDAPAPI ULONG LDAPAPI ldap_simple_bind_s( LDAP *ld, const PCHAR dn, const PCHAR passwd );
WINLDAPAPI ULONG LDAPAPI ldap_bind( LDAP *ld, const PCHAR dn, const PCHAR cred, ULONG method );
WINLDAPAPI ULONG LDAPAPI ldap_bind_s( LDAP *ld, const PCHAR dn, const PCHAR cred, ULONG method );
#define ldap_sasl_bind ldap_sasl_bindA
#define ldap_sasl_bind_s ldap_sasl_bind_sA
#endif
//
// 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
#define LDAP_SCOPE_BASE 0x00
#define LDAP_SCOPE_ONELEVEL 0x01
#define LDAP_SCOPE_SUBTREE 0x02
//
// multi-thread: ldap_search 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_search_ext instead, as these are thread safe.
//
// ldap_search_s and ldap_search_ext* calls are thread safe.
//
WINLDAPAPI ULONG LDAPAPI ldap_searchW(
LDAP *ld,
const PWCHAR base, // distinguished name or ""
ULONG scope, // LDAP_SCOPE_xxxx
const PWCHAR filter,
PWCHAR attrs[], // pointer to an array of PCHAR attribute names
ULONG attrsonly // boolean on whether to only return attr names
);
WINLDAPAPI ULONG LDAPAPI ldap_searchA(
LDAP *ld,
const PCHAR base, // distinguished name or ""
ULONG scope, // LDAP_SCOPE_xxxx
const PCHAR filter,
PCHAR attrs[], // pointer to an array of PCHAR attribute names
ULONG attrsonly // boolean on whether to only return attr names
);
WINLDAPAPI ULONG LDAPAPI ldap_search_sW(
LDAP *ld,
const PWCHAR base,
ULONG scope,
const PWCHAR filter,
PWCHAR attrs[],
ULONG attrsonly,
LDAPMessage **res
);
WINLDAPAPI ULONG LDAPAPI ldap_search_sA(
LDAP *ld,
const PCHAR base,
ULONG scope,
const PCHAR filter,
PCHAR attrs[],
ULONG attrsonly,
LDAPMessage **res
);
WINLDAPAPI ULONG LDAPAPI ldap_search_stW(
LDAP *ld,
const PWCHAR base,
ULONG scope,
const PWCHAR filter,
PWCHAR attrs[],
ULONG attrsonly,
struct l_timeval *timeout,
LDAPMessage **res
);
WINLDAPAPI ULONG LDAPAPI ldap_search_stA(
LDAP *ld,
const PCHAR base,
ULONG scope,
const PCHAR filter,
PCHAR attrs[],
ULONG attrsonly,
struct l_timeval *timeout,
LDAPMessage **res
);
WINLDAPAPI ULONG LDAPAPI ldap_search_extW(
LDAP *ld,
const PWCHAR base,
ULONG scope,
const PWCHAR filter,
PWCHAR attrs[],
ULONG attrsonly,
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls,
ULONG TimeLimit,
ULONG SizeLimit,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_search_extA(
LDAP *ld,
const PCHAR base,
ULONG scope,
const PCHAR filter,
PCHAR attrs[],
ULONG attrsonly,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG TimeLimit,
ULONG SizeLimit,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_search_ext_sW(
LDAP *ld,
const PWCHAR base,
ULONG scope,
const PWCHAR filter,
PWCHAR attrs[],
ULONG attrsonly,
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls,
struct l_timeval *timeout,
ULONG SizeLimit,
LDAPMessage **res
);
WINLDAPAPI ULONG LDAPAPI ldap_search_ext_sA(
LDAP *ld,
const PCHAR base,
ULONG scope,
const PCHAR filter,
PCHAR attrs[],
ULONG attrsonly,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
struct l_timeval *timeout,
ULONG SizeLimit,
LDAPMessage **res
);
#if LDAP_UNICODE
#define ldap_search ldap_searchW
#define ldap_search_s ldap_search_sW
#define ldap_search_st ldap_search_stW
#define ldap_search_ext ldap_search_extW
#define ldap_search_ext_s ldap_search_ext_sW
#else
WINLDAPAPI ULONG LDAPAPI ldap_search(
LDAP *ld,
PCHAR base, // distinguished name or ""
ULONG scope, // LDAP_SCOPE_xxxx
PCHAR filter,
PCHAR attrs[], // pointer to an array of PCHAR attribute names
ULONG attrsonly // boolean on whether to only return attr names
);
WINLDAPAPI ULONG LDAPAPI ldap_search_s(
LDAP *ld,
PCHAR base,
ULONG scope,
PCHAR filter,
PCHAR attrs[],
ULONG attrsonly,
LDAPMessage **res
);
WINLDAPAPI ULONG LDAPAPI ldap_search_st(
LDAP *ld,
PCHAR base,
ULONG scope,
PCHAR filter,
PCHAR attrs[],
ULONG attrsonly,
struct l_timeval *timeout,
LDAPMessage **res
);
WINLDAPAPI ULONG LDAPAPI ldap_search_ext(
LDAP *ld,
PCHAR base,
ULONG scope,
PCHAR filter,
PCHAR attrs[],
ULONG attrsonly,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG TimeLimit,
ULONG SizeLimit,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_search_ext_s(
LDAP *ld,
PCHAR base,
ULONG scope,
PCHAR filter,
PCHAR attrs[],
ULONG attrsonly,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
struct l_timeval *timeout,
ULONG SizeLimit,
LDAPMessage **res
);
#endif
//
// Extended API to check filter syntax. Returns LDAP error code if syntax
// is invalid or LDAP_SUCCESS if it's ok.
//
WINLDAPAPI ULONG LDAPAPI
ldap_check_filterW(
LDAP *ld,
PWCHAR SearchFilter
);
WINLDAPAPI ULONG LDAPAPI
ldap_check_filterA(
LDAP *ld,
PCHAR SearchFilter
);
#if LDAP_UNICODE
#define ldap_check_filter ldap_check_filterW
#else
#define ldap_check_filter ldap_check_filterA
#endif
//
// 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.
//
WINLDAPAPI ULONG LDAPAPI ldap_modifyW( LDAP *ld, PWCHAR dn, LDAPModW *mods[] );
WINLDAPAPI ULONG LDAPAPI ldap_modifyA( LDAP *ld, PCHAR dn, LDAPModA *mods[] );
WINLDAPAPI ULONG LDAPAPI ldap_modify_sW( LDAP *ld, PWCHAR dn, LDAPModW *mods[] );
WINLDAPAPI ULONG LDAPAPI ldap_modify_sA( LDAP *ld, PCHAR dn, LDAPModA *mods[] );
WINLDAPAPI ULONG LDAPAPI ldap_modify_extW(
LDAP *ld,
const PWCHAR dn,
LDAPModW *mods[],
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_modify_extA(
LDAP *ld,
const PCHAR dn,
LDAPModA *mods[],
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_modify_ext_sW(
LDAP *ld,
const PWCHAR dn,
LDAPModW *mods[],
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls
);
WINLDAPAPI ULONG LDAPAPI ldap_modify_ext_sA(
LDAP *ld,
const PCHAR dn,
LDAPModA *mods[],
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#if LDAP_UNICODE
#define ldap_modify ldap_modifyW
#define ldap_modify_s ldap_modify_sW
#define ldap_modify_ext ldap_modify_extW
#define ldap_modify_ext_s ldap_modify_ext_sW
#else
WINLDAPAPI ULONG LDAPAPI ldap_modify( LDAP *ld, PCHAR dn, LDAPModA *mods[] );
WINLDAPAPI ULONG LDAPAPI ldap_modify_s( LDAP *ld, PCHAR dn, LDAPModA *mods[] );
WINLDAPAPI ULONG LDAPAPI ldap_modify_ext(
LDAP *ld,
const PCHAR dn,
LDAPModA *mods[],
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_modify_ext_s(
LDAP *ld,
const PCHAR dn,
LDAPModA *mods[],
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#endif
//
// 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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -