WindowsCreateString function Null safety winrt

int WindowsCreateString(
  1. Pointer<Utf16> sourceString,
  2. int length,
  3. Pointer<IntPtr> string
)

Creates a new HSTRING based on the specified source string.

HRESULT WindowsCreateString(
  PCNZWCH sourceString,
  UINT32  length,
  HSTRING *string
);

Implementation

int WindowsCreateString(
    Pointer<Utf16> sourceString, int length, Pointer<IntPtr> string) {
  final _WindowsCreateString =
      _api_ms_win_core_winrt_string_l1_1_0.lookupFunction<
          Int32 Function(Pointer<Utf16> sourceString, Uint32 length,
              Pointer<IntPtr> string),
          int Function(Pointer<Utf16> sourceString, int length,
              Pointer<IntPtr> string)>('WindowsCreateString');
  return _WindowsCreateString(sourceString, length, string);
}