WindowsPreallocateStringBuffer function winrt
void
WindowsPreallocateStringBuffer()
Allocates a mutable character buffer for use in HSTRING creation.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/winstring/nf-winstring-windowspreallocatestringbuffer.
Implementation
@pragma('vm:prefer-inline')
void WindowsPreallocateStringBuffer(
int length,
Pointer<Pointer<Uint16>> charBuffer,
Pointer<Pointer> bufferHandle,
) {
final hr$ = HRESULT(
_WindowsPreallocateStringBuffer(length, charBuffer, bufferHandle),
);
if (hr$.isError) throw WindowsException(hr$);
}