SysAllocStringLen function oleaut32

BSTR SysAllocStringLen(
  1. PCWSTR? strIn,
  2. int ui
)

Allocates a new string, copies the specified number of characters from the passed string, and appends a null-terminating character.

To learn more, see learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-sysallocstringlen.

Implementation

@pragma('vm:prefer-inline')
BSTR SysAllocStringLen(PCWSTR? strIn, int ui) =>
    BSTR(_SysAllocStringLen(strIn ?? nullptr, ui));