Peter Åstrand wrote:
On Fri, 18 Apr 2008, Robert Reif wrote:
- rc=waveOutGetDevCapsA(device,&capsA,4);
- /* Final call must succeed, capsA will be used below */
- rc=waveOutGetDevCapsA(device,&capsA,sizeof(capsA)); ok(rc==MMSYSERR_NOERROR, "waveOutGetDevCapsA(%s): MMSYSERR_NOERROR expected, got %s\n", dev_name(device),wave_out_error(rc));
- rc=waveOutGetDevCapsW(device,&capsW,4);
- ok(rc==MMSYSERR_NOERROR || rc==MMSYSERR_NOTSUPPORTED,
"waveOutGetDevCapsW(%s): MMSYSERR_NOERROR or MMSYSERR_NOTSUPPORTED "
"expected, got %s\n",dev_name(device),wave_out_error(rc));
- if (rc!=MMSYSERR_NOERROR)
- return;
That's the whole point of the test, to check what happens with an invalid argument.
So what do you think *should* happen with an invalid argument? The result is different on different Windows platforms. The behaviour is not specified by MSDN.
In any case, continuing and executing code that uses "capsA" even though the waveOutGetDevCapsA call failed is definitely wrong.
Rgds,
Peter Åstrand ThinLinc Chief Developer Cendio AB http://www.cendio.se Wallenbergs gata 4 583 30 Linköping Phone: +46-13-21 46 00
This is the proper fix:
diff --git a/dlls/winmm/tests/wave.c b/dlls/winmm/tests/wave.c index 60f0622..37367c2 100644 --- a/dlls/winmm/tests/wave.c +++ b/dlls/winmm/tests/wave.c @@ -888,6 +888,13 @@ static void wave_out_test_device(int dev nameA=strdup("not supported"); }
+ rc=waveOutGetDevCapsA(device,&capsA,sizeof(capsA)); + ok(rc==MMSYSERR_NOERROR, + "waveOutGetDevCapsA(%s): MMSYSERR_NOERROR expected, got %s\n", + dev_name(device),wave_out_error(rc)); + if (rc!=MMSYSERR_NOERROR) + return; + trace(" %s: "%s" (%s) %d.%d (%d:%d)\n",dev_name(device),capsA.szPname, (nameA?nameA:"failed"),capsA.vDriverVersion >> 8, capsA.vDriverVersion & 0xff, capsA.wMid,capsA.wPid);