LDAP search functions null base

asked 2020-08-24T17:45:24.833+00:00
Andrei Nacu 1 Reputation point

Hello!

The documentation (https://learn.microsoft.com/en-us/windows/win32/api/winldap/nf-winldap-ldap_search_s) states that the base parameter is Pointer to a null-terminated string that contains the distinguished name of the entry at which to start the search.. However, roaming through winldap.h I've seen that the parameter is declared _In_opt_ PSTR base. Now, from another piece of documentation (https://learn.microsoft.com/en-us/cpp/code-quality/annotating-function-parameters-and-return-values?view=vs-2019) I've seen that if the annotation includes _opt_, then the parameter may be null. So... what happens exactly when the base is null? Should the documentation be updated or is the header wrong in its annotations? Of course various scenarios could be tested, but I am looking for an official response here.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
1,888 questions
{count} votes