NWDSGetDefNameContext

Retrieves the default name context for a specified tree.

NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98, Windows 2000, Windows XP
Library:Cross-Platform NDS (NET*.*)
Service:NDS

Syntax

C

  #include <nwnet.h> 
  or 
  #include <nwdsconn.h> 
   
  N_EXTERN_LIBRARY (NWDSCCODE) NWDSGetDefNameContext  ( 
     NWDSContextHandle   context,  
     nuint               nameContextLen, 
     pnstr8              nameContext); 
  

Pascal

  uses netwin32 
   
  Function NWDSGetDefNameContext 
    (context : NWDSContextHandle; 
     nameContextLen : nuint; 
     nameContext : pnstr8 
  ) : NWDSCCODE;
  

Parameters

context

(IN) Specifies the NDS context for the request or NULL for the preferred tree.

nameContextLen

(IN) Specifies the length (in bytes) of the nameContext buffer.

nameContext

(OUT) Points to the buffer in which to place the default name context value.

Return Values

0x0000 0000

SUCCESSFUL

nonzero value

Nonzero values indicate errors. See NDS Return Values (–001 to –799).

Remarks

This function gets the default name context for the tree specified in the context (or if the tree name isn’t set, the preferred tree name). This call differs from NWGetDefaultNameContext in that this call has an added parameter, context, and operates on a per tree basis. Also, this function can return the name context in Unicode while NWGetDefaultNameContext could only return the data in local code page format.

The DCV_XLATE_STRINGS flag determines whether local code page format or Unicode strings are returned. For more information, see DCK_FLAGS Key.

The default name context for the preferred tree can be set by the DEFAULT NAME CONTEXT configuration parameter, or by calling either NWSetDefaultNameContext or NWDSSetDefNameContext. The default name context for another tree (different from the preferred tree) can be set by calling NWDSSetDefNameContext.

The default name context can be from 0 to 257 bytes long for local code page strings (including the NULL), or 0 to 514 bytes long for Unicode strings (including the 2 bytes for NULL). If the nameContext buffer is too small to contain the value, an error is returned and no data is copied.

If the tree name is not set in the context, the preferred tree will be used. For requesters that do not support multiple trees, if the tree name is specified (a NULL string is not returned to the eDirectory libraries) and if the tree name is different from the preferred tree, an error will be returned.

NCP Calls

See Also

NWGetDefaultNameContext, NWSetDefaultNameContext, NWDSSetDefNameContext