winmm: Check waveOutGetVolume parameter.

This commit is contained in:
Robert Reif 2006-05-08 20:51:23 -04:00 committed by Alexandre Julliard
parent 6aac40364b
commit a9bd81be63
2 changed files with 9 additions and 1 deletions

View File

@ -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));

View File

@ -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);