waveOutOpen function Null safety winmm

int waveOutOpen (
  1. Pointer<IntPtr> phwo,
  2. int uDeviceID,
  3. Pointer<WAVEFORMATEX> pwfx,
  4. int dwCallback,
  5. int dwInstance,
  6. int fdwOpen
)

The waveOutOpen function opens the given waveform-audio output device for playback.

MMRESULT waveOutOpen(
  LPHWAVEOUT      phwo,
  UINT            uDeviceID,
  LPCWAVEFORMATEX pwfx,
  DWORD_PTR       dwCallback,
  DWORD_PTR       dwInstance,
  DWORD           fdwOpen
);

Implementation

int waveOutOpen(Pointer<IntPtr> phwo, int uDeviceID, Pointer<WAVEFORMATEX> pwfx,
    int dwCallback, int dwInstance, int fdwOpen) {
  final _waveOutOpen = _winmm.lookupFunction<
      Uint32 Function(
          Pointer<IntPtr> phwo,
          Uint32 uDeviceID,
          Pointer<WAVEFORMATEX> pwfx,
          IntPtr dwCallback,
          IntPtr dwInstance,
          Uint32 fdwOpen),
      int Function(
          Pointer<IntPtr> phwo,
          int uDeviceID,
          Pointer<WAVEFORMATEX> pwfx,
          int dwCallback,
          int dwInstance,
          int fdwOpen)>('waveOutOpen');
  return _waveOutOpen(phwo, uDeviceID, pwfx, dwCallback, dwInstance, fdwOpen);
}