ldap_escape_filter_element function
The ldap_escape_filter_element function converts a filter element to a null-terminated character string that can be passed safely in a search filter.
Syntax
ULONG ldap_escape_filter_element( _In_ PCHAR sourceFilterElement, _In_ ULONG sourceLength, _Out_ PCHAR destFilterElement, _In_ ULONG destLength );
Parameters
- sourceFilterElement [in]
-
A pointer to a null-terminated string that contains the filter element to convert.
- sourceLength [in]
-
The length, in bytes, of the source filter element.
- destFilterElement [out]
-
A pointer to a null-terminated character string.
- destLength [in]
-
The length, in bytes, of the destFilterElement buffer.
Return value
If the function succeeds, the return value is LDAP_SUCCESS.
If the function fails, it returns an error code. See Return Values for more information.
Remarks
The ldap_escape_filter_element function allows you to use raw binary data in search filters. For example, you can use this function to specify a certificate or a JPEG image as the attribute to match.
Call ldap_escape_filter_element with the sourceFilterElement parameter pointing to raw data and sourceLength set appropriately to the length of data. If the destFilterElement parameter is NULL, then the return value is the length required for the output buffer. If destFilterElement is not NULL, then the function copies the source into the destination buffer and ensures that it is of a safe format. Then insert the destination buffer into your search filter after the "attributetype=" filter element.
Requirements
|
Minimum supported client |
Windows Vista |
|---|---|
|
Minimum supported server |
Windows Server 2008 |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
ldap_escape_filter_elementW (Unicode) and ldap_escape_filter_elementA (ANSI) |
See also