NWSMAllocGenericString

Allocates or reallocates memory for a STRING_BUFFER structure.

Syntax

  #include <smsutapi.h> 
   
  STRING_BUFFER *NWSMAllocGenericString(
  UINT32       nameSpaceType, 
  STRING_BUFFER **string, 
  INT32    size);
  

Parameters

nameSpaceType

Specifies the name space type of the source and destination strings (see nameSpaceType Values).

string

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

size

(IN) Specifies 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

NWSMAllocGenericString is an enhanced version of NWSMAllocString and it supports strings in UTF-8 format.

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

If string is NULL, a new structure is allocated. Otherwise NWSMAllocGenericString 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