WindowsReplaceString function Null safety winrt

int WindowsReplaceString(
  1. int string,
  2. int stringReplaced,
  3. int stringReplaceWith,
  4. Pointer<IntPtr> newString
)

Replaces all occurrences of a set of characters in the specified string with another set of characters to create a new string.

HRESULT WindowsReplaceString(
  HSTRING string,
  HSTRING stringReplaced,
  HSTRING stringReplaceWith,
  HSTRING *newString
);

Implementation

int WindowsReplaceString(int string, int stringReplaced, int stringReplaceWith,
    Pointer<IntPtr> newString) {
  final _WindowsReplaceString =
      _api_ms_win_core_winrt_string_l1_1_0.lookupFunction<
          Int32 Function(IntPtr string, IntPtr stringReplaced,
              IntPtr stringReplaceWith, Pointer<IntPtr> newString),
          int Function(int string, int stringReplaced, int stringReplaceWith,
              Pointer<IntPtr> newString)>('WindowsReplaceString');
  return _WindowsReplaceString(
      string, stringReplaced, stringReplaceWith, newString);
}