ldap_parse_page_controlW function (winldap.h)
The ldap_parse_page_control parses the results of a search into pages.
Syntax
WINLDAPAPI ULONG LDAPAPI ldap_parse_page_controlW(
[in] PLDAP ExternalHandle,
[in] PLDAPControlW *ServerControls,
[out] ULONG *TotalCount,
[out] berval **Cookie
);
Parameters
[in] ExternalHandle
The session handle.
[in] ServerControls
An array of controls that includes a page control. The page control contains the cookie and total count fields returned by the server.
[out] TotalCount
A pointer to the total count of entries returned in this page (optional).
[out] Cookie
An opaque cookie, used by the server to determine its location in the result set. Use ber_bvfree to free.
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
Use ldap_parse_page_control in conjunction with ldap_create_page_control and ldap_parse_result to implement the simple paging of results by means of controls. After calling ldap_parse_page_control to retrieve the server controls and extract the cookie from the search result, call ldap_parse_result to parse the results. Then use the cookie to call ldap_create_page_control to retrieve the next page of results.
Note
The winldap.h header defines ldap_parse_page_control as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | winldap.h |
Library | Wldap32.lib |
DLL | Wldap32.dll |