Returns the server’s distinguished name.
#include <nwnet.h> or #include <nwdsdsa.h> N_EXTERN_LIBRARY (NWDSCCODE) NWDSGetServerDN ( NWDSContextHandle context, NWCONN_HANDLE connHandle, pnstr8 serverDN);
uses netwin32 Function NWDSGetServerDN (context : NWDSContextHandle; connHandle : NWCONN_HANDLE; serverDN : pnstr8 ) : NWDSCCODE;
(IN) Specifies the NDS context for the request.
(IN) Specifies the connection to the server to be queried.
(OUT) Points to the distinguished name of the server.
0x0000 0000 |
SUCCESSFUL |
nonzero value |
Nonzero values indicate errors. See |
The connHandle parameter is the connection handle to the server.
The caller must allocate space to hold the distinguished name of the server and set serverDN to point to it. The size of the allocated memory is (MAX_DN_CHARS+1)*sizeof(character size) where character size is 1 for single-byte characters and 2 for Unicode characters (Unicode characters are always 16 bits). One character is used for NULL termination.
Whether the server name is returned as a complete name or a partial name depends upon the setting of the context flag associated with DCV_CANONICALIZE_NAMES. For more information, see Section 1.1, Context Handles.
NWDSGetServerDN does not work on a local server with a connection 0. Call AttachToFileServer then GetCurrentConnection and pass the returned value to NWDSGetServerDN to return the server’s DN. If connection 0 is used, a ERR_NO_CONNECTION error is returned.