mciGetErrorString function Null safety winmm

int mciGetErrorString (
  1. int fdwError,
  2. Pointer<Utf16> lpszErrorText,
  3. int cchErrorText
)

The mciGetErrorString function retrieves a string that describes the specified MCI error code.

BOOL mciGetErrorStringW(
  DWORD  fdwError,
  LPTSTR lpszErrorText,
  UINT   cchErrorText
);

Implementation

int mciGetErrorString(
    int fdwError, Pointer<Utf16> lpszErrorText, int cchErrorText) {
  final _mciGetErrorString = _winmm.lookupFunction<
      Int32 Function(
          Uint32 fdwError, Pointer<Utf16> lpszErrorText, Uint32 cchErrorText),
      int Function(int fdwError, Pointer<Utf16> lpszErrorText,
          int cchErrorText)>('mciGetErrorStringW');
  return _mciGetErrorString(fdwError, lpszErrorText, cchErrorText);
}