Commit a9bd81be authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

winmm: Check waveOutGetVolume parameter.

parent 6aac4036
......@@ -640,6 +640,9 @@ static void wave_out_test_deviceOut(int device, double duration,
frag.dwFlags=0;
frag.dwLoops=0;
rc=waveOutGetVolume(wout,0);
ok(rc==MMSYSERR_INVALPARAM,"waveOutGetVolume(%s,0) expected "
"MMSYSERR_INVALPARAM, got %s\n", dev_name(device),wave_out_error(rc));
rc=waveOutGetVolume(wout,&volume);
ok(has_volume ? rc==MMSYSERR_NOERROR : rc==MMSYSERR_NOTSUPPORTED,
"waveOutGetVolume(%s): rc=%s\n",dev_name(device),wave_out_error(rc));
......
......@@ -2425,7 +2425,12 @@ UINT WINAPI waveOutGetVolume(HWAVEOUT hWaveOut, LPDWORD lpdw)
TRACE("(%p, %08lx);\n", hWaveOut, (DWORD)lpdw);
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL)
if (lpdw == NULL) {
WARN("invalid parameter\n");
return MMSYSERR_INVALPARAM;
}
if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL)
return MMSYSERR_INVALHANDLE;
return MMDRV_Message(wmld, WODM_GETVOLUME, (DWORD_PTR)lpdw, 0L, TRUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment