NWDSAllocBuf

Allocates a Buf_T structure for use as a request or result buffer parameter to an eDirectory function.

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)  NWDSAllocBuf  ( 
     size_t    size,  
     ppBuf_T   buf); 
  

Pascal

  uses netwin32 
   
  Function NWDSAllocBuf 
    (size : size_t; 
     buf : ppBuf_T 
  ) : NWDSCCODE;
  

Parameters

size

(IN) Specifies the number of bytes to allocate to the buffer.

buf

(OUT) Points to Buf_T containing the memory allocated for the buffer.

Return Values

0x0000 0000

SUCCESSFUL

nonzero value

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

Remarks

The following two message sizes are defined in NWDSDC.H:

The total bytes allocated for the buffer is size +sizeof(Buf_T)+3 which should be less than 64K bytes.

For most operations, the size of DEFAULT_MESSAGE_LEN can be used. It is up to the developer to determine by experimentation if another size optimizes an application’s performance.

When determining a buffer size, keep in mind the effects of buffer size. A smaller buffer means multiple iterations of an operation might need to be performed to retrieve all of the operation’s results. On the other hand, using a large buffer might allow the operation to be completed in one step, but cause a significant delay for the user.

If NWDSAllocBuf is successful, buf is set to point to the allocated buffer.

NCP Calls

See Also

NWDSFreeBuf, NWDSInitBuf