📄 winldap.h
字号:
// Extended Rename operations. These take controls and separate out the
// parent from the RDN, for clarity.
//
WINLDAPAPI ULONG LDAPAPI ldap_rename_extW(
LDAP *ld,
PWCHAR dn,
PWCHAR NewRDN,
PWCHAR NewParent,
INT DeleteOldRdn,
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_rename_extA(
LDAP *ld,
PCHAR dn,
PCHAR NewRDN,
PCHAR NewParent,
INT DeleteOldRdn,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_rename_ext_sW(
LDAP *ld,
PWCHAR dn,
PWCHAR NewRDN,
PWCHAR NewParent,
INT DeleteOldRdn,
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls
);
WINLDAPAPI ULONG LDAPAPI ldap_rename_ext_sA(
LDAP *ld,
PCHAR dn,
PCHAR NewRDN,
PCHAR NewParent,
INT DeleteOldRdn,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#if LDAP_UNICODE
#define ldap_rename_ext ldap_rename_extW
#define ldap_rename_ext_s ldap_rename_ext_sW
#else
WINLDAPAPI ULONG LDAPAPI ldap_rename_ext(
LDAP *ld,
PCHAR dn,
PCHAR NewRDN,
PCHAR NewParent,
INT DeleteOldRdn,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_rename_ext_s(
LDAP *ld,
PCHAR dn,
PCHAR NewRDN,
PCHAR NewParent,
INT DeleteOldRdn,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#endif
//
// 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
// may be overwritten by another thread inbetween.
//
// Use ldap_add_ext instead, as these are thread safe.
//
// ldap_add_s and ldap_add_ext* calls are thread safe.
//
WINLDAPAPI ULONG LDAPAPI ldap_addW( LDAP *ld, PWCHAR dn, LDAPModW *attrs[] );
WINLDAPAPI ULONG LDAPAPI ldap_addA( LDAP *ld, PCHAR dn, LDAPModA *attrs[] );
WINLDAPAPI ULONG LDAPAPI ldap_add_sW( LDAP *ld, PWCHAR dn, LDAPModW *attrs[] );
WINLDAPAPI ULONG LDAPAPI ldap_add_sA( LDAP *ld, PCHAR dn, LDAPModA *attrs[] );
WINLDAPAPI ULONG LDAPAPI ldap_add_extW(
LDAP *ld,
PWCHAR dn,
LDAPModW *attrs[],
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_add_extA(
LDAP *ld,
PCHAR dn,
LDAPModA *attrs[],
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_add_ext_sW(
LDAP *ld,
PWCHAR dn,
LDAPModW *attrs[],
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls
);
WINLDAPAPI ULONG LDAPAPI ldap_add_ext_sA(
LDAP *ld,
PCHAR dn,
LDAPModA *attrs[],
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#if LDAP_UNICODE
#define ldap_add ldap_addW
#define ldap_add_s ldap_add_sW
#define ldap_add_ext ldap_add_extW
#define ldap_add_ext_s ldap_add_ext_sW
#else
WINLDAPAPI ULONG LDAPAPI ldap_add( LDAP *ld, PCHAR dn, LDAPMod *attrs[] );
WINLDAPAPI ULONG LDAPAPI ldap_add_s( LDAP *ld, PCHAR dn, LDAPMod *attrs[] );
WINLDAPAPI ULONG LDAPAPI ldap_add_ext(
LDAP *ld,
PCHAR dn,
LDAPModA *attrs[],
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_add_ext_s(
LDAP *ld,
PCHAR dn,
LDAPModA *attrs[],
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#endif
//
// Compare the attribute for a given entry to a known value.
//
//
// multi-thread: ldap_compare 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_compare_ext instead, as these are thread safe.
//
// ldap_compare_s and ldap_compare_ext* calls are thread safe.
//
WINLDAPAPI ULONG LDAPAPI ldap_compareW( LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHAR value );
WINLDAPAPI ULONG LDAPAPI ldap_compareA( LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value );
WINLDAPAPI ULONG LDAPAPI ldap_compare_sW( LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHAR value );
WINLDAPAPI ULONG LDAPAPI ldap_compare_sA( LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value );
#if LDAP_UNICODE
#define ldap_compare ldap_compareW
#define ldap_compare_s ldap_compare_sW
#else
WINLDAPAPI ULONG LDAPAPI ldap_compare( LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value );
WINLDAPAPI ULONG LDAPAPI ldap_compare_s( LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value );
#endif
//
// Extended Compare operations. These take controls and are thread safe.
// They also allow you to specify a bval structure for the data, so that it
// isn't translated from Unicode or ANSI to UTF8. Allows for comparison of
// raw binary data.
//
// Specify either Data or Value as not NULL. If both are not NULL, the
// berval Data will be used.
//
WINLDAPAPI ULONG LDAPAPI ldap_compare_extW(
LDAP *ld,
PWCHAR dn,
PWCHAR Attr,
PWCHAR Value, // either value or Data is not null, not both
struct berval *Data,
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_compare_extA(
LDAP *ld,
PCHAR dn,
PCHAR Attr,
PCHAR Value, // either value or Data is not null, not both
struct berval *Data,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_compare_ext_sW(
LDAP *ld,
PWCHAR dn,
PWCHAR Attr,
PWCHAR Value, // either value or Data is not null, not both
struct berval *Data,
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls
);
WINLDAPAPI ULONG LDAPAPI ldap_compare_ext_sA(
LDAP *ld,
PCHAR dn,
PCHAR Attr,
PCHAR Value, // either value or Data is not null, not both
struct berval *Data,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#if LDAP_UNICODE
#define ldap_compare_ext ldap_compare_extW
#define ldap_compare_ext_s ldap_compare_ext_sW
#else
WINLDAPAPI ULONG LDAPAPI ldap_compare_ext(
LDAP *ld,
PCHAR dn,
PCHAR Attr,
PCHAR Value, // either value or Data is not null, not both
struct berval *Data,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_compare_ext_s(
LDAP *ld,
PCHAR dn,
PCHAR Attr,
PCHAR Value, // either value or Data is not null, not both
struct berval *Data,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#endif
//
// Delete an object out of the tree
//
//
// multi-thread: ldap_delete 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_delete_ext instead, as these are thread safe.
//
// ldap_delete_s and ldap_delete_ext* calls are thread safe.
//
WINLDAPAPI ULONG LDAPAPI ldap_deleteW( LDAP *ld, PWCHAR dn );
WINLDAPAPI ULONG LDAPAPI ldap_deleteA( LDAP *ld, PCHAR dn );
WINLDAPAPI ULONG LDAPAPI ldap_delete_sW( LDAP *ld, PWCHAR dn );
WINLDAPAPI ULONG LDAPAPI ldap_delete_sA( LDAP *ld, PCHAR dn );
WINLDAPAPI ULONG LDAPAPI ldap_delete_extW(
LDAP *ld,
PWCHAR dn,
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_delete_extA(
LDAP *ld,
PCHAR dn,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_delete_ext_sW(
LDAP *ld,
PWCHAR dn,
PLDAPControlW *ServerControls,
PLDAPControlW *ClientControls
);
WINLDAPAPI ULONG LDAPAPI ldap_delete_ext_sA(
LDAP *ld,
PCHAR dn,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#if LDAP_UNICODE
#define ldap_delete ldap_deleteW
#define ldap_delete_ext ldap_delete_extW
#define ldap_delete_s ldap_delete_sW
#define ldap_delete_ext_s ldap_delete_ext_sW
#else
WINLDAPAPI ULONG LDAPAPI ldap_delete( LDAP *ld, PCHAR dn );
WINLDAPAPI ULONG LDAPAPI ldap_delete_s( LDAP *ld, PCHAR dn );
WINLDAPAPI ULONG LDAPAPI ldap_delete_ext(
LDAP *ld,
PCHAR dn,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls,
ULONG *MessageNumber
);
WINLDAPAPI ULONG LDAPAPI ldap_delete_ext_s(
LDAP *ld,
PCHAR dn,
PLDAPControlA *ServerControls,
PLDAPControlA *ClientControls
);
#endif
//
// Give up on a request. No guarentee that it got there as there is no
// response from the server.
//
// multi-thread: ldap_abandon calls are thread safe
WINLDAPAPI ULONG LDAPAPI ldap_abandon( LDAP *ld, ULONG msgid );
//
// Possible values for "all" field in ldap_result. We've enhanced it such
// that if someone passes in LDAP_MSG_RECEIVED, we'll pass all values we've
// received up to that point.
//
#define LDAP_MSG_ONE 0
#define LDAP_MSG_ALL 1
#define LDAP_MSG_RECEIVED 2
//
// Get a response from a connection. One enhancement here is that ld can
// be null, in which case we'll return responses from any server. Free
// responses here with ldap_msgfree.
//
// For connection-less LDAP, you should pass in both a LDAP connection
// handle and a msgid. This will ensure we know which request the app
// is waiting on a reply to. ( we actively resend request until we get
// a response.)
//
// multi-thread: ldap_result calls are thread safe
WINLDAPAPI ULONG LDAPAPI ldap_result(
LDAP *ld,
ULONG msgid,
ULONG all,
struct l_timeval *timeout,
LDAPMessage **res
);
WINLDAPAPI ULONG LDAPAPI ldap_msgfree( LDAPMessage *res );
//
// This parses a message and returns the error code. It optionally frees
// the message by calling ldap_msgfree.
//
// multi-thread: ldap_result2error call is thread safe
WINLDAPAPI ULONG LDAPAPI ldap_result2error(
LDAP *ld,
LDAPMessage *res,
ULONG freeit // boolean.. free the message?
);
//
// Similar to ldap_result2error, this parses responses from the server and
// returns the appropriate fields. Use this one if you want to get at the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -