📄 winldap.pas
字号:
// 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.
//
{$EXTERNALSYM ldap_addA}
function ldap_addA(ld: PLDAP; dn: PAnsiChar; var attrs: PLDAPModA): ULONG; cdecl;
{$EXTERNALSYM ldap_addW}
function ldap_addW(ld: PLDAP; dn: PWideChar; var attrs: PLDAPModW): ULONG; cdecl;
{$EXTERNALSYM ldap_add}
function ldap_add(ld: PLDAP; dn: PChar; var attrs: PLDAPMod): ULONG; cdecl;
{$EXTERNALSYM ldap_add_sA}
function ldap_add_sA(ld: PLDAP; dn: PAnsiChar; var attrs: PLDAPModA): ULONG; cdecl;
{$EXTERNALSYM ldap_add_sW}
function ldap_add_sW(ld: PLDAP; dn: PWideChar; var attrs: PLDAPModW): ULONG; cdecl;
{$EXTERNALSYM ldap_add_s}
function ldap_add_s(ld: PLDAP; dn: PChar; var attrs: PLDAPMod): ULONG; cdecl;
{$EXTERNALSYM ldap_add_extA}
function ldap_add_extA(ld: PLDAP; dn: PAnsiChar; var attrs: PLDAPModA;
var ServerControls, ClientControls: PLDAPControlA;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_add_extW}
function ldap_add_extW(ld: PLDAP; dn: PWideChar; var attrs: PLDAPModW;
var ServerControls, ClientControls: PLDAPControlW;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_add_ext}
function ldap_add_ext(ld: PLDAP; dn: PChar; var attrs: PLDAPMod;
var ServerControls, ClientControls: PLDAPControl;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_add_ext_sA}
function ldap_add_ext_sA(ld: PLDAP; dn: PAnsiChar; var attrs: PLDAPModA;
var ServerControls, ClientControls: PLDAPControlA): ULONG; cdecl;
{$EXTERNALSYM ldap_add_ext_sW}
function ldap_add_ext_sW(ld: PLDAP; dn: PWideChar; var attrs: PLDAPModW;
var ServerControls, ClientControls: PLDAPControlW): ULONG; cdecl;
{$EXTERNALSYM ldap_add_ext_s}
function ldap_add_ext_s(ld: PLDAP; dn: PChar; var attrs: PLDAPMod;
var ServerControls, ClientControls: PLDAPControl): ULONG; cdecl;
//
// Compare the attribute for a given entry to a known value.
//
{$EXTERNALSYM ldap_compareA}
function ldap_compareA(ld: PLDAP; dn, attr, value: PAnsiChar): ULONG; cdecl;
{$EXTERNALSYM ldap_compareW}
function ldap_compareW(ld: PLDAP; dn, attr, value: PWideChar): ULONG; cdecl;
{$EXTERNALSYM ldap_compare}
function ldap_compare(ld: PLDAP; dn, attr, value: PChar): ULONG; cdecl;
{$EXTERNALSYM ldap_compare_sA}
function ldap_compare_sA(ld: PLDAP; dn, attr, value: PAnsiChar): ULONG; cdecl;
{$EXTERNALSYM ldap_compare_sW}
function ldap_compare_sW(ld: PLDAP; dn, attr, value: PWideChar): ULONG; cdecl;
{$EXTERNALSYM ldap_compare_s}
function ldap_compare_s(ld: PLDAP; dn, attr, value: PChar): ULONG; cdecl;
//
// 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.
//
// either value or Data is not null, not both
{$EXTERNALSYM ldap_compare_extA}
function ldap_compare_extA(ld: PLDAP; dn, Attr, Value: PAnsiChar;
Data: PLDAPBerVal; var ServerControls, ClientControls: PLDAPControlA;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_compare_extW}
function ldap_compare_extW(ld: PLDAP; dn, Attr, Value: PWideChar;
Data: PLDAPBerVal; var ServerControls, ClientControls: PLDAPControlW;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_compare_ext}
function ldap_compare_ext(ld: PLDAP; dn, Attr, Value: PChar;
Data: PLDAPBerVal; var ServerControls, ClientControls: PLDAPControl;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_compare_ext_sA}
function ldap_compare_ext_sA(ld: PLDAP;
dn, Attr, Value: PAnsiChar; Data: PLDAPBerVal;
var ServerControls, ClientControls: PLDAPControlA): ULONG; cdecl;
{$EXTERNALSYM ldap_compare_ext_sW}
function ldap_compare_ext_sW(ld: PLDAP;
dn, Attr, Value: PWideChar; Data: PLDAPBerVal;
var ServerControls, ClientControls: PLDAPControlW): ULONG; cdecl;
{$EXTERNALSYM ldap_compare_ext_s}
function ldap_compare_ext_s(ld: PLDAP;
dn, Attr, Value: PChar; Data: PLDAPBerVal;
var ServerControls, ClientControls: PLDAPControl): ULONG; cdecl;
//
// 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.
//
{$EXTERNALSYM ldap_deleteA}
function ldap_deleteA(ld: PLDAP; dn: PAnsiChar): ULONG; cdecl;
{$EXTERNALSYM ldap_deleteW}
function ldap_deleteW(ld: PLDAP; dn: PWideChar): ULONG; cdecl;
{$EXTERNALSYM ldap_delete}
function ldap_delete(ld: PLDAP; dn: PChar): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_sA}
function ldap_delete_sA(ld: PLDAP; dn: PAnsiChar): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_sW}
function ldap_delete_sW(ld: PLDAP; dn: PWideChar): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_s}
function ldap_delete_s(ld: PLDAP; dn: PChar): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_extA}
function ldap_delete_extA(ld: PLDAP; dn: PAnsiChar;
var ServerControls, ClientControls: PLDAPControlA;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_extW}
function ldap_delete_extW(ld: PLDAP; dn: PWideChar;
var ServerControls, ClientControls: PLDAPControlW;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_ext}
function ldap_delete_ext(ld: PLDAP; dn: PChar;
var ServerControls, ClientControls: PLDAPControl;
var MessageNumber: ULONG): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_ext_sA}
function ldap_delete_ext_sA(ld: PLDAP; dn: PAnsiChar;
var ServerControls, ClientControls: PLDAPControlA): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_ext_sW}
function ldap_delete_ext_sW(ld: PLDAP; dn: PWideChar;
var ServerControls, ClientControls: PLDAPControlW): ULONG; cdecl;
{$EXTERNALSYM ldap_delete_ext_s}
function ldap_delete_ext_s(ld: PLDAP; dn: PChar;
var ServerControls, ClientControls: PLDAPControl): ULONG; cdecl;
//
// Give up on a request. No guarentee that it got there as there is no
// response from the server.
//
{$EXTERNALSYM ldap_abandon}
function ldap_abandon(ld: PLDAP; msgid: ULONG): ULONG; cdecl;
//
// 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.
//
const
{$EXTERNALSYM LDAP_MSG_ONE}
LDAP_MSG_ONE = 0;
{$EXTERNALSYM LDAP_MSG_ALL}
LDAP_MSG_ALL = 1;
{$EXTERNALSYM LDAP_MSG_RECEIVED}
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.)
//
{$EXTERNALSYM ldap_result}
function ldap_result(ld: PLDAP; msgid, all: ULONG;
var timeout: LDAP_TIMEVAL; var res: PLDAPMessage): ULONG; cdecl;
{$EXTERNALSYM ldap_msgfree}
function ldap_msgfree(res: PLDAPMessage): ULONG; cdecl;
//
// 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
// freeit is boolean.. free the message?
{$EXTERNALSYM ldap_result2error}
function ldap_result2error(ld: PLDAP; res: PLDAPMessage;
freeit: ULONG): ULONG; cdecl;
//
// 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
// referrals, matchingDNs, or server controls returned.
//
// multi-thread: ldap_parse_result call is thread safe
{$EXTERNALSYM ldap_parse_resultA}
function ldap_parse_resultA (
var Connection: LDAP;
ResultMessage: PLDAPMessage;
ReturnCode: PULONG; // returned by server
MatchedDNs: PPCharA; // free with ldap_memfree
ErrorMessage: PPCharA; // free with ldap_memfree
Referrals: PPPCharA; // free with ldap_value_freeW
var ServerControls: PPLDAPControlA; // free with ldap_free_controlsW
Freeit: BOOL): ULONG; cdecl;
{$EXTERNALSYM ldap_parse_resultW}
function ldap_parse_resultW (
var Connection: LDAP;
ResultMessage: PLDAPMessage;
ReturnCode: PULONG; // returned by server
MatchedDNs: PPCharW; // free with ldap_memfree
ErrorMessage: PPCharW; // free with ldap_memfree
Referrals: PPPCharW; // free with ldap_value_freeW
var ServerControls: PPLDAPControlW; // free with ldap_free_controlsW
Freeit: BOOL): ULONG; cdecl;
{$EXTERNALSYM ldap_parse_result}
function ldap_parse_result (
var Connection: LDAP;
ResultMessage: PLDAPMessage;
ReturnCode: PULONG; // returned by server
MatchedDNs: PPChar; // free with ldap_memfree
ErrorMessage: PPChar; // free with ldap_memfree
Referrals: PPPChar; // free with ldap_value_freeW
var ServerControls: PPLDAPControl; // free with ldap_free_controlsW
Freeit: BOOL): ULONG; cdecl;
{$EXTERNALSYM ldap_controls_freeA}
function ldap_controls_freeA(var Controls: PLDAPControlA): ULONG; cdecl;
{$EXTERNALSYM ldap_controls_freeW}
function ldap_controls_freeW(var Controls: PLDAPControlW): ULONG; cdecl;
{$EXTERNALSYM ldap_controls_free}
function ldap_controls_free(var Controls: PLDAPControl): ULONG; cdecl;
{$EXTERNALSYM ldap_parse_extended_resultA}
function ldap_parse_extended_resultA(
Connection: PLDAP;
ResultMessage: PLDAPMessage; // returned by server
var ResultOID: PAnsiChar; // free with ldap_memfree
var ResultData: PBERVAL; // free with ldap_memfree
Freeit: ByteBool // Don't need the message anymore
): ULONG; cdecl;
{$EXTERNALSYM ldap_parse_extended_resultW}
function ldap_parse_extended_resultW(
Connection: PLDAP;
ResultMessage: PLDAPMessage; // returned by server
var ResultOID: PWideChar; // free with ldap_memfree
var ResultData: PBERVAL; // free with ldap_memfree
Freeit: ByteBool // Don't need the message anymore
): ULONG; cdecl;
{$EXTERNALSYM ldap_parse_extended_result}
function ldap_parse_extended_result(
Connection: PLDAP;
ResultMessage: PLDAPMessage; // returned by server
var ResultOID: PChar; // free with ldap_memfree
var ResultData: PBERVAL; // free with ldap_memfree
Freeit: ByteBool // Don't need the message anymore
): ULONG; cdecl;
{$EXTERNALSYM ldap_control_freeA}
function ldap_control_freeA(var Control: LDAPControlA): ULONG; cdecl;
{$EXTERNALSYM ldap_control_freeW}
function ldap_control_freeW(var Control: LDAPControlW): ULONG; cdecl;
{$EXTERNALSYM ldap_control_free}
function ldap_control_free(var Control: LDAPControl): ULONG; cdecl;
//
// ldap_free_controls are old, use ldap_controls_free
//
{$EXTERNALSYM ldap_free_controlsA}
function ldap_free_controlsA(var Controls: PLDAPControlA): ULONG; cdecl;
{$EXTERNALSYM ldap_free_controlsW}
function ldap_free_controlsW(var Controls: PLDAPControlW): ULONG; cdecl;
{$EXTERNALSYM ldap_free_controls}
function ldap_free_controls(var Controls: PLDAPControl): ULONG; cdecl;
//
// ldap_err2string returns a pointer to a string describing the error. This
// string should not be freed.
//
{$EXTERNALSYM ldap_err2stringA}
function ldap_err2stringA(err: ULONG): PAnsiChar; cdecl;
{$EXTERNALSYM ldap_err2stringW}
function ldap_err2stringW(err: ULONG): PWideChar; cdecl;
{$EXTERNALSYM ldap_err2string}
function ldap_err2string(err: ULONG): PChar; cdecl;
//
// ldap_perror does nothing and is here just for compatibility.
//
{$EXTERNALSYM ldap_perror}
procedure ldap_perror(ld: PLDAP; msg: PChar); cdecl;
//
// Return the first entry of a message. It is freed when the message is
// freed so should not be freed explicitly.
//
{$EXTERNALSYM ldap_first_entry}
function ldap_first_entry(ld: PLDAP; res: PLDAPMessage): PLDAPMessage; cdecl;
//
// Return the next entry of a message. It is freed when the message is
// freed so should not be freed explicitly.
//
{$EXTERNALSYM ldap_next_entry}
function ldap_next_entry(ld: PLDAP; entry: PLDAPMessage): PLDAPMessage; cdecl;
//
// Count the number of search entries returned by the server in a response
// to a server request.
//
{$EXTERNALSYM ldap_count_entries}
function ldap_count_entries(ld: PLDAP; res: PLDAPMessage): ULONG; cdecl;
//
// A BerElement really maps out to a C++ class object that does BER encoding.
// Don't mess with it as it's opaque.
//
type
PBerElement = ^Be
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -