mciSendString function Null safety winmm

int mciSendString (
  1. Pointer<Utf16> lpszCommand,
  2. Pointer<Utf16> lpszReturnString,
  3. int cchReturn,
  4. int hwndCallback
)

The mciSendString function sends a command string to an MCI device. The device that the command is sent to is specified in the command string.

MCIERROR mciSendStringW(
  LPCTSTR lpszCommand,
  LPTSTR  lpszReturnString,
  UINT    cchReturn,
  HANDLE  hwndCallback
);

Implementation

int mciSendString(Pointer<Utf16> lpszCommand, Pointer<Utf16> lpszReturnString,
    int cchReturn, int hwndCallback) {
  final _mciSendString = _winmm.lookupFunction<
      Uint32 Function(
          Pointer<Utf16> lpszCommand,
          Pointer<Utf16> lpszReturnString,
          Uint32 cchReturn,
          IntPtr hwndCallback),
      int Function(Pointer<Utf16> lpszCommand, Pointer<Utf16> lpszReturnString,
          int cchReturn, int hwndCallback)>('mciSendStringW');
  return _mciSendString(lpszCommand, lpszReturnString, cchReturn, hwndCallback);
}