📄 winldap.h
字号:
// referrals, matchingDNs, or server controls returned.
//
// multi-thread: ldap_parse_result call is thread safe
WINLDAPAPI ULONG LDAPAPI ldap_parse_resultW (
LDAP *Connection,
LDAPMessage *ResultMessage,
ULONG *ReturnCode OPTIONAL, // returned by server
PWCHAR *MatchedDNs OPTIONAL, // free with ldap_memfree
PWCHAR *ErrorMessage OPTIONAL, // free with ldap_memfree
PWCHAR **Referrals OPTIONAL, // free with ldap_value_freeW
PLDAPControlW **ServerControls OPTIONAL, // free with ldap_free_controlsW
BOOLEAN Freeit
);
WINLDAPAPI ULONG LDAPAPI ldap_parse_resultA (
LDAP *Connection,
LDAPMessage *ResultMessage,
ULONG *ReturnCode OPTIONAL, // returned by server
PCHAR *MatchedDNs OPTIONAL, // free with ldap_memfree
PCHAR *ErrorMessage OPTIONAL, // free with ldap_memfree
PCHAR **Referrals OPTIONAL, // free with ldap_value_freeA
PLDAPControlA **ServerControls OPTIONAL, // free with ldap_free_controlsA
BOOLEAN Freeit
);
WINLDAPAPI ULONG LDAPAPI ldap_controls_freeA (
LDAPControlA **Controls
);
WINLDAPAPI ULONG LDAPAPI ldap_control_freeA (
LDAPControlA *Controls
);
WINLDAPAPI ULONG LDAPAPI ldap_controls_freeW (
LDAPControlW **Control
);
WINLDAPAPI ULONG LDAPAPI ldap_control_freeW (
LDAPControlW *Control
);
//
// ldap_free_controls are old, use ldap_controls_free
//
WINLDAPAPI ULONG LDAPAPI ldap_free_controlsW (
LDAPControlW **Controls
);
WINLDAPAPI ULONG LDAPAPI ldap_free_controlsA (
LDAPControlA **Controls
);
#if LDAP_UNICODE
#define ldap_parse_result ldap_parse_resultW
#define ldap_controls_free ldap_controls_freeW
#define ldap_control_free ldap_control_freeW
#define ldap_free_controls ldap_free_controlsW
#else
WINLDAPAPI ULONG LDAPAPI ldap_parse_result (
LDAP *Connection,
LDAPMessage *ResultMessage,
ULONG *ReturnCode OPTIONAL, // returned by server
PCHAR *MatchedDNs OPTIONAL, // free with ldap_memfree
PCHAR *ErrorMessage OPTIONAL, // free with ldap_memfree
PCHAR **Referrals OPTIONAL, // free with ldap_value_free
PLDAPControlA **ServerControls OPTIONAL, // free with ldap_free_controls
BOOLEAN Freeit
);
WINLDAPAPI ULONG LDAPAPI ldap_controls_free (
LDAPControlA **Controls
);
WINLDAPAPI ULONG LDAPAPI ldap_control_free (
LDAPControlA *Control
);
WINLDAPAPI ULONG LDAPAPI ldap_free_controls (
LDAPControlA **Controls
);
#endif
//
// ldap_err2string returns a pointer to a string describing the error. This
// string should not be freed.
//
WINLDAPAPI PWCHAR LDAPAPI ldap_err2stringW( ULONG err );
WINLDAPAPI PCHAR LDAPAPI ldap_err2stringA( ULONG err );
#if LDAP_UNICODE
#define ldap_err2string ldap_err2stringW
#else
WINLDAPAPI PCHAR LDAPAPI ldap_err2string( ULONG err );
#endif
//
// ldap_perror does nothing and is here just for compatibility.
//
WINLDAPAPI void LDAPAPI ldap_perror( LDAP *ld, PCHAR msg );
//
// Return the first entry of a message. It is freed when the message is
// freed so should not be freed explicitly.
//
WINLDAPAPI LDAPMessage *LDAPAPI ldap_first_entry( LDAP *ld, LDAPMessage *res );
//
// Return the next entry of a message. It is freed when the message is
// freed so should not be freed explicitly.
//
WINLDAPAPI LDAPMessage *LDAPAPI ldap_next_entry( LDAP *ld, LDAPMessage *entry );
//
// Count the number of search entries returned by the server in a response
// to a server request.
//
WINLDAPAPI ULONG LDAPAPI ldap_count_entries( LDAP *ld, LDAPMessage *res );
//
// A BerElement really maps out to a C++ class object that does BER encoding.
// Don't mess with it as it's opaque.
//
typedef struct berelement {
PCHAR opaque; // this is an opaque structure used just for
// compatibility with reference implementation
} BerElement;
#define NULLBER ((BerElement *) 0)
//
// For a given entry, return the first attribute. The pointer returned is
// actually a buffer in the connection block (with allowances for
// multi-threaded apps) so it should not be freed.
//
WINLDAPAPI PWCHAR LDAPAPI ldap_first_attributeW(
LDAP *ld,
LDAPMessage *entry,
BerElement **ptr
);
WINLDAPAPI PCHAR LDAPAPI ldap_first_attributeA(
LDAP *ld,
LDAPMessage *entry,
BerElement **ptr
);
#if LDAP_UNICODE
#define ldap_first_attribute ldap_first_attributeW
#else
WINLDAPAPI PCHAR LDAPAPI ldap_first_attribute(
LDAP *ld,
LDAPMessage *entry,
BerElement **ptr
);
#endif
//
// Return the next attribute... again, the attribute pointer should not be
// freed.
//
WINLDAPAPI PWCHAR LDAPAPI ldap_next_attributeW(
LDAP *ld,
LDAPMessage *entry,
BerElement *ptr
);
WINLDAPAPI PCHAR LDAPAPI ldap_next_attributeA(
LDAP *ld,
LDAPMessage *entry,
BerElement *ptr
);
#if LDAP_UNICODE
#define ldap_next_attribute ldap_next_attributeW
#else
WINLDAPAPI PCHAR LDAPAPI ldap_next_attribute(
LDAP *ld,
LDAPMessage *entry,
BerElement *ptr
);
#endif
//
// Get a given attribute's list of values. This is used during parsing of
// a search response. It returns a list of pointers to values, the list is
// null terminated.
//
// If the values are generic octet strings and not null terminated strings,
// use ldap_get_values_len instead.
//
// The returned value should be freed when your done with it by calling
// ldap_value_free.
//
WINLDAPAPI PWCHAR *LDAPAPI ldap_get_valuesW(
LDAP *ld,
LDAPMessage *entry,
PWCHAR attr
);
WINLDAPAPI PCHAR *LDAPAPI ldap_get_valuesA(
LDAP *ld,
LDAPMessage *entry,
PCHAR attr
);
#if LDAP_UNICODE
#define ldap_get_values ldap_get_valuesW
#else
WINLDAPAPI PCHAR *LDAPAPI ldap_get_values(
LDAP *ld,
LDAPMessage *entry,
PCHAR attr
);
#endif
//
// Get a given attribute's list of values. This is used during parsing of
// a search response. It returns a list of berval structures to values,
// the list is null terminated.
//
// If the values are null terminated strings, it may be easier to process them
// by calling ldap_get_values instead.
//
// The returned value should be freed when your done with it by calling
// ldap_value_free_len.
//
WINLDAPAPI struct berval **LDAPAPI ldap_get_values_lenW (
LDAP *ExternalHandle,
LDAPMessage *Message,
PWCHAR attr
);
WINLDAPAPI struct berval **LDAPAPI ldap_get_values_lenA (
LDAP *ExternalHandle,
LDAPMessage *Message,
PCHAR attr
);
#if LDAP_UNICODE
#define ldap_get_values_len ldap_get_values_lenW
#else
WINLDAPAPI struct berval **LDAPAPI ldap_get_values_len (
LDAP *ExternalHandle,
LDAPMessage *Message,
PCHAR attr
);
#endif
//
// Return the number of values in a list returned by ldap_get_values.
//
WINLDAPAPI ULONG LDAPAPI ldap_count_valuesW( PWCHAR *vals );
WINLDAPAPI ULONG LDAPAPI ldap_count_valuesA( PCHAR *vals );
#if LDAP_UNICODE
#define ldap_count_values ldap_count_valuesW
#else
WINLDAPAPI ULONG LDAPAPI ldap_count_values( PCHAR *vals );
#endif
//
// Return the number of values in a list returned by ldap_get_values_len.
//
WINLDAPAPI ULONG LDAPAPI ldap_count_values_len( struct berval **vals );
//
// Free structures returned by ldap_get_values.
//
WINLDAPAPI ULONG LDAPAPI ldap_value_freeW( PWCHAR *vals );
WINLDAPAPI ULONG LDAPAPI ldap_value_freeA( PCHAR *vals );
#if LDAP_UNICODE
#define ldap_value_free ldap_value_freeW
#else
WINLDAPAPI ULONG LDAPAPI ldap_value_free( PCHAR *vals );
#endif
//
// Free structures returned by ldap_get_values_len.
//
WINLDAPAPI ULONG LDAPAPI ldap_value_free_len( struct berval **vals );
//
// Get the distinguished name for a given search entry. It should be freed
// by calling ldap_memfree.
//
WINLDAPAPI PWCHAR LDAPAPI ldap_get_dnW( LDAP *ld, LDAPMessage *entry );
WINLDAPAPI PCHAR LDAPAPI ldap_get_dnA( LDAP *ld, LDAPMessage *entry );
#if LDAP_UNICODE
#define ldap_get_dn ldap_get_dnW
#else
WINLDAPAPI PCHAR LDAPAPI ldap_get_dn( LDAP *ld, LDAPMessage *entry );
#endif
//
// When using ldap_explode_dn, you should free the returned string by
// calling ldap_value_free.
//
WINLDAPAPI PWCHAR *LDAPAPI ldap_explode_dnW( PWCHAR dn, ULONG notypes );
WINLDAPAPI PCHAR *LDAPAPI ldap_explode_dnA( PCHAR dn, ULONG notypes );
#if LDAP_UNICODE
#define ldap_explode_dn ldap_explode_dnW
#else
WINLDAPAPI PCHAR *LDAPAPI ldap_explode_dn( PCHAR dn, ULONG notypes );
#endif
//
// When calling ldap_dn2ufn, you should free the returned string by calling
// ldap_memfree.
//
WINLDAPAPI PWCHAR LDAPAPI ldap_dn2ufnW( PWCHAR dn );
WINLDAPAPI PCHAR LDAPAPI ldap_dn2ufnA( PCHAR dn );
#if LDAP_UNICODE
#define ldap_dn2ufn ldap_dn2ufnW
#else
WINLDAPAPI PCHAR LDAPAPI ldap_dn2ufn( PCHAR dn );
#endif
//
// This is used to free strings back to the LDAP API heap. Don't pass in
// values that you've gotten from ldap_open, ldap_get_values, etc.
//
WINLDAPAPI VOID LDAPAPI ldap_memfreeW( PWCHAR Block );
WINLDAPAPI VOID LDAPAPI ldap_memfreeA( PCHAR Block );
WINLDAPAPI VOID LDAPAPI ber_bvfree( struct berval *bv );
#if LDAP_UNICODE
#define ldap_memfree ldap_memfreeW
#else
WINLDAPAPI VOID LDAPAPI ldap_memfree( PCHAR Block );
#endif
//
// The function ldap_ufn2dn attempts to "normalize" a user specified DN
// to make it "proper". It follows RFC 1781 (add CN= if not present,
// add OU= if none present, etc). If it runs into any problems at all
// while normalizing, it simply returns a copy of what was passed in.
//
// It allocates the output string from the LDAP memory pool. If the pDn
// comes back as non-NULL, you should free it whe
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -