CHString::ReleaseBuffer method

[The CHString class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The ReleaseBuffer method ends the use of a buffer allocated by GetBuffer.

Syntax

void  throw(CHeap_Exception) ReleaseBuffer(
  int nNewLength
);

Parameters

nNewLength

The new length of the string in characters, not counting a terminating null character.

If the string is NULL-terminated, the –1 default value sets the CHString string size to the current length of the string.

Return Value

This method does not return a value.

Remarks

If you know that the string in the buffer is NULL-terminated, you can omit the nNewLength parameter. If your string is not NULL-terminated, then use nNewLength to specify its length. The address returned by GetBuffer is not valid after the call to ReleaseBuffer or any other CHString operation.

Requirements

   
Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header chstring.h (include FwCommon.h)
Library FrameDyn.lib
DLL FrameDynOS.dll; FrameDyn.dll

See Also

CHString

CHString::GetBuffer