winmm/tests: Pass the full size of MIDIHDR to midiOutPrepareHeader().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-09-07 11:12:58 +01:00 committed by Alexandre Julliard
parent 5562339681
commit 54f7a63845
1 changed files with 6 additions and 6 deletions

View File

@ -514,8 +514,8 @@ static void test_midiStream(UINT udev, HWND hwnd)
rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, offsetof(MIDIHDR,dwOffset)-1);
ok(rc==MMSYSERR_INVALPARAM, "midiOutPrepare tiny rc=%s\n", mmsys_error(rc));
rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, offsetof(MIDIHDR,dwOffset));
ok(!rc, "midiOutPrepare old size rc=%s\n", mmsys_error(rc));
rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutPrepare size rc=%s\n", mmsys_error(rc));
ok(mhdr.dwFlags & MHDR_PREPARED, "MHDR.dwFlags when prepared %x\n", mhdr.dwFlags);
/* The device is still in paused mode and should queue the message. */
@ -557,9 +557,9 @@ static void test_midiStream(UINT udev, HWND hwnd)
/* Native fills dwOffset regardless of the cbMidiHdr size argument to midiStreamOut */
ok(1234567890!=mhdr.dwOffset, "play left MIDIHDR.dwOffset at %u\n", mhdr.dwOffset);
rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, offsetof(MIDIHDR,dwOffset));
rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutUnprepare rc=%s\n", mmsys_error(rc));
rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, offsetof(MIDIHDR,dwOffset));
rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutUnprepare #2 rc=%s\n", mmsys_error(rc));
trace("MIDIHDR stream flags=%x when finished\n", mhdr.dwFlags);
@ -584,9 +584,9 @@ static void test_midiStream(UINT udev, HWND hwnd)
mhdr.dwFlags |= MHDR_ISSTRM;
/* Preset flags (e.g. MHDR_ISSTRM) do not disturb. */
rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, offsetof(MIDIHDR,dwOffset));
rc = midiOutPrepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutPrepare used flags %x rc=%s\n", mhdr.dwFlags, mmsys_error(rc));
rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, offsetof(MIDIHDR,dwOffset));
rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
ok(!rc, "midiOutUnprepare used flags %x rc=%s\n", mhdr.dwFlags, mmsys_error(rc));
rc = midiStreamRestart(hm);