Commit 062bbb91 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

winmm: Initialize reserved fields of data returned by waveOutGetDevCapsA and…

winmm: Initialize reserved fields of data returned by waveOutGetDevCapsA and waveInGetDevCapsA (Coverity). Signed-off-by: 's avatarNikolay Sivov <nsivov@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bcefe114
......@@ -316,6 +316,7 @@ static void wave_in_test_device(UINT_PTR device)
GetSystemInfo(&sSysInfo);
dwPageSize = sSysInfo.dwPageSize;
memset(&capsA, 0xff, sizeof(capsA));
rc=waveInGetDevCapsA(device,&capsA,sizeof(capsA));
ok(rc==MMSYSERR_NOERROR || rc==MMSYSERR_BADDEVICEID ||
rc==MMSYSERR_NODRIVER,
......@@ -323,11 +324,14 @@ static void wave_in_test_device(UINT_PTR device)
dev_name(device),wave_in_error(rc));
if (rc==MMSYSERR_BADDEVICEID || rc==MMSYSERR_NODRIVER)
return;
ok(capsA.wReserved1 != 0xffff, "got %u\n", capsA.wReserved1);
memset(&capsW, 0xcc, sizeof(capsW));
rc=waveInGetDevCapsW(device,&capsW,sizeof(capsW));
ok(rc==MMSYSERR_NOERROR || rc==MMSYSERR_NOTSUPPORTED,
"waveInGetDevCapsW(%s): MMSYSERR_NOERROR or MMSYSERR_NOTSUPPORTED "
"expected, got %s\n",dev_name(device),wave_in_error(rc));
ok(capsW.wReserved1 == 0, "got %u\n", capsW.wReserved1);
rc=waveInGetDevCapsA(device,NULL,sizeof(capsA));
ok(rc==MMSYSERR_INVALPARAM,
......
......@@ -893,6 +893,7 @@ static void wave_out_test_device(UINT_PTR device)
GetSystemInfo(&sSysInfo);
dwPageSize = sSysInfo.dwPageSize;
memset(&capsA, 0xcc, sizeof(capsA));
rc=waveOutGetDevCapsA(device,&capsA,sizeof(capsA));
ok(rc==MMSYSERR_NOERROR || rc==MMSYSERR_BADDEVICEID ||
rc==MMSYSERR_NODRIVER,
......@@ -900,11 +901,14 @@ static void wave_out_test_device(UINT_PTR device)
dev_name(device),wave_out_error(rc));
if (rc==MMSYSERR_BADDEVICEID || rc==MMSYSERR_NODRIVER)
return;
ok(capsA.wReserved1 == 0, "got %u\n", capsA.wReserved1);
memset(&capsW, 0xcc, sizeof(capsW));
rc=waveOutGetDevCapsW(device,&capsW,sizeof(capsW));
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));
ok(capsW.wReserved1 == 0, "got %u\n", capsW.wReserved1);
rc=waveOutGetDevCapsA(device,0,sizeof(capsA));
ok(rc==MMSYSERR_INVALPARAM,
......
......@@ -2629,6 +2629,7 @@ UINT WINAPI waveOutGetDevCapsA(UINT_PTR uDeviceID, LPWAVEOUTCAPSA lpCaps,
wocA.dwFormats = wocW.dwFormats;
wocA.wChannels = wocW.wChannels;
wocA.dwSupport = wocW.dwSupport;
wocA.wReserved1 = 0;
memcpy(lpCaps, &wocA, min(uSize, sizeof(wocA)));
}
return ret;
......@@ -3354,6 +3355,7 @@ UINT WINAPI waveInGetDevCapsA(UINT_PTR uDeviceID, LPWAVEINCAPSA lpCaps, UINT uSi
sizeof(wicA.szPname), NULL, NULL );
wicA.dwFormats = wicW.dwFormats;
wicA.wChannels = wicW.wChannels;
wicA.wReserved1 = 0;
memcpy(lpCaps, &wicA, min(uSize, sizeof(wicA)));
}
return ret;
......
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