NWSMAllocString

Allocates or reallocates memory for a STRING_BUFFER structure.

Syntax

  #include <smsutapi.h>
  
  STRING_BUFFER *NWSMAllocString  ( 
  STRING_BUFFER **string,    INT16    size);
  

Parameters

string

(IN/OUT) Points to the new or reallocated buffer.

size

(IN) Points to the size of the new or reallocated structure.

Return Values

The following table lists the return values associated with the function.

NULL

Cannot reallocate memory.

Nonzero

Reallocation is successful and the pointer points to string.

Remarks

NOTE:This function is supported only for backward compatibility, the NWSMAllocGenericString function can be used instead of this, as it provides the same functionality.

You must free the memory allocated to buffer by calling NWSMFreeString.

If string is NULL, a new structure is allocated. Otherwise NWSMAllocString assumes that it is a valid pointer and reallocates more memory for string.

If string is not NULL, and size is less than or equal to zero, a standard increment size is added to the structure's existing size or string is reallocated to the number of bytes specified by size.

The standard size is currently 256 bytes.

See Also

NWSMFreeString