API Buffers
The RPC run time allocates the buffers required to access the Net functions.
-
For a set type function (data sent to the server) the function caller specifies a buffer containing the information structure relevant to the function level but does not specify the buffer length.
-
For a get type function (data returned from the server) the caller does not preallocate a buffer for the return information. The caller passes a LPBYTE * to the function on input. On successful return the buffer pointer will contain a pointer to a buffer containing the return information. When the caller has finished processing the returned information the NetApiBufferFree function must be called. This simplifies the calling code, because the caller does not need to guess at the size of the buffer required and will not need to resize and reissue the function.