NWDSPutAttrNameAndVal

Stores an attribute name and value in a request buffer to be used by an eDirectory function.

Local Servers:nonblocking
Remote Servers:nonblocking
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 <nwdsbuft.h> 
   
  N_EXTERN_LIBRARY (NWDSCCODE)  NWDSPutAttrNameAndVal  ( 
     NWDSContextHandle   context,  
     pBuf_T              buf,  
     pnstr8              attrName,  
     nuint32             syntaxID,  
     nptr                attrVal); 
  

Pascal

  uses netwin32 
   
  Function NWDSPutAttrNameAndVal  ( 
     context : NWDSContextHandle; 
     buf : pBuf_T; 
     attrName : pnstr8; 
     syntaxID : nuint32; 
     attrVal : nptr 
  ) : NWDSCCODE;
  

Parameters

context

(IN) Specifies the NDS context for the request.

buf

(IN) Points to the request buffer in which to store the attribute name.

attrName

(IN) Points to the attribute name to store in the request buffer.

syntaxID

(IN) Specifies the data type of the attribute value.

attrVal

(IN) Points to the attribute value to be stored in the request buffer.

Return Values

0x0000 0000

SUCCESSFUL

nonzero value

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

Remarks

NWDSPutAttrNameAndVal combines the functionality of NWDSPutAttrName and NWDSPutAttrVal and adds error checking so the buffer is always valid. The NWDSPutAttrName and NWDSPutAttrVal functions are used by object operations such as adding an object and comparing attribute values. For these operations, NWDSPutAttrNameAndVal is the preferred function.

NWDSPutAttrNameAndVal checks the return values of NWDSPutAttrName and NWDSPutAttrVal. If either function fails because the buffer was too small, NWDSPutAttrNameAndVal will not modify the buffer. Call NWDSAddObject to add the eDirectory object.

The maximum size of the attribute name 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.

The buf parameter points to a Buf_T, which is allocated by NWDSAllocBuf and initialized by NWDSInitBuf.

The syntaxID parameter tells NWDSPutAttrNameAndVal what method to use for converting the attribute value to a machine-transparent form when storing the value in the buffer. Syntax IDs (such as SYN_PATH) are enumerated in NWDSDEFS.H. Syntaxes are described in Attribute Syntax Definitions (NDK: Novell eDirectory Schema Reference).

The attrVal parameter points to the attribute value to be stored in the request buffer. The type of data pointed to by attrVal depends on the indicated attribute syntax. See Attribute Syntax Definitions to determine the data type associated with an attribute.

NCP Calls

See Also

NWDSAddObject, NWDSCompare, NWDSModifyObject, NWDSPutAttrName, NWDSPutAttrVal, NWDSRead, NWDSReadAttrDef, NWDSSearch