WindowsPreallocateStringBuffer function Null safety winrt

int WindowsPreallocateStringBuffer(
  1. int length,
  2. Pointer<Pointer<Uint16>> charBuffer,
  3. Pointer<IntPtr> bufferHandle
)

Allocates a mutable character buffer for use in HSTRING creation.

HRESULT WindowsPreallocateStringBuffer(
  UINT32         length,
  WCHAR          **charBuffer,
  HSTRING_BUFFER *bufferHandle
);

Implementation

int WindowsPreallocateStringBuffer(int length,
    Pointer<Pointer<Uint16>> charBuffer, Pointer<IntPtr> bufferHandle) {
  final _WindowsPreallocateStringBuffer =
      _api_ms_win_core_winrt_string_l1_1_0.lookupFunction<
          Int32 Function(Uint32 length, Pointer<Pointer<Uint16>> charBuffer,
              Pointer<IntPtr> bufferHandle),
          int Function(int length, Pointer<Pointer<Uint16>> charBuffer,
              Pointer<IntPtr> bufferHandle)>('WindowsPreallocateStringBuffer');
  return _WindowsPreallocateStringBuffer(length, charBuffer, bufferHandle);
}