Allocates a Buf_T structure for use as a request or result buffer parameter to an eDirectory function.
#include <nwnet.h>
or
#include <nwdsbuft.h>
N_EXTERN_LIBRARY (NWDSCCODE) NWDSAllocBuf (
size_t size,
ppBuf_T buf);
uses netwin32
Function NWDSAllocBuf
(size : size_t;
buf : ppBuf_T
) : NWDSCCODE;
(IN) Specifies the number of bytes to allocate to the buffer.
(OUT) Points to Buf_T containing the memory allocated for the buffer.
|
0x0000 0000 |
SUCCESSFUL |
|
nonzero value |
Nonzero values indicate errors. See |
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.