ldap_escape_filter_element (Windows CE 5.0)
This function converts raw binary data in a filter element to a safe text string that can be passed safely in a search filter.
ULONG ldap_escape_filter_element(UNICODE PTCHARsourceFilterElement,ULONGsourceLength,UNICODE PTCHARdestFilterElement,ULONGdestLength);
Parameters
- sourceFilterElement
[in] Filter element to convert. - sourceLength
[in] Length of the source filter element. - destFilterElement
[out] Safe text string. - destLength
[out] Length of the safe text string.
Return Values
If this function succeeds, the return value is LDAP_SUCCESS.
If this function fails, it returns an error code. See the LDAP_RETCODE enumeration for a list of possible return values.
Remarks
This 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 this function with the sourceFilterElement parameter pointing to raw data and sourceCount 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.
Do not call this function for attribute values that are strings, as the run time does not perform any conversion from UTF-8 format. Use this function only for attribute elements that are raw binary data.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Winldap.h.
Link Library: Wldap32.lib.
See Also
Send Feedback on this topic to the authors