Commit 78b2fd83 authored by Qian Hong's avatar Qian Hong Committed by Alexandre Julliard

winmm: Fixed mixerGetControlDetails with null paDetails.

parent 5e81bad2
......@@ -197,10 +197,17 @@ static void mixer_test_controlA(HMIXER mix, LPMIXERCONTROLA control)
details.dwControlID = control->dwControlID;
details.cChannels = 1;
U(details).cMultipleItems = 0;
details.paDetails = &value;
details.cbDetails = sizeof(value);
/* test NULL paDetails */
details.paDetails = NULL;
rc=mixerGetControlDetails((HMIXEROBJ)mix,&details,MIXER_GETCONTROLDETAILSF_VALUE);
ok(rc==MMSYSERR_INVALPARAM,
"mixerGetDevCapsA: MMSYSERR_INVALPARAM expected, got %s\n",
mmsys_error(rc));
/* read the current control value */
details.paDetails = &value;
rc=mixerGetControlDetails((HMIXEROBJ)mix,&details,MIXER_GETCONTROLDETAILSF_VALUE);
ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
"MMSYSERR_NOERROR expected, got %s\n",
......
......@@ -3849,7 +3849,7 @@ UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW
if(FAILED(hr))
return MMSYSERR_NODRIVER;
if(!lpmcdW)
if(!lpmcdW || !lpmcdW->paDetails)
return MMSYSERR_INVALPARAM;
TRACE("dwControlID: %u\n", lpmcdW->dwControlID);
......
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