Skip to content

Latest commit

 

History

History
111 lines (89 loc) · 2.79 KB

nf-oleauto-sysreallocstringlen.md

File metadata and controls

111 lines (89 loc) · 2.79 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:oleauto.SysReAllocStringLen
SysReAllocStringLen function (oleauto.h)
Creates a new BSTR containing a specified number of characters from an old BSTR, and frees the old BSTR.
SysReAllocStringLen
SysReAllocStringLen function [Automation]
_oa96_SysReAllocStringLen
automat.sysreallocstringlen
oleauto/SysReAllocStringLen
automat\sysreallocstringlen.htm
automat
d134cff1-7cc8-4284-a216-3819615e3017
12/05/2018
SysReAllocStringLen, SysReAllocStringLen function [Automation], _oa96_SysReAllocStringLen, automat.sysreallocstringlen, oleauto/SysReAllocStringLen
oleauto.h
Windows
OleAut32.lib
OleAut32.dll
Windows
19H1
SysReAllocStringLen
oleauto/SysReAllocStringLen
c++
APIRef
kbSyntax
DllExport
OleAut32.dll
SysReAllocStringLen

SysReAllocStringLen function

-description

Creates a new BSTR containing a specified number of characters from an old BSTR, and frees the old BSTR.

-parameters

-param pbstr [in, out]

The previously allocated string.

-param psz [in, optional]

The string from which to copy len characters, or NULL to keep the string uninitialized.

-param len [in]

The number of characters to copy. A null character is placed afterward, allocating a total of len plus one characters.

-returns

Return code Description
TRUE
The string is reallocated successfully.
FALSE
Insufficient memory exists.

-remarks

Allocates a new string, copies len characters from the passed string into it, and then appends a null character. Frees the BSTR referenced currently by pbstr, and resets pbstr to point to the new BSTR. If psz is null, a string of length len is allocated but not initialized.

The psz string can contain embedded null characters and does not need to end with a null.

If this function is passed a NULL pointer, there will be an access violation and the program will crash. It is your responsibility to protect this function against NULL pointers.

-see-also

String Manipulation Functions