Commit e1cf94d9 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

midimap: Have GetDevCaps error out when no MIDI device is present.

parent bdea1466
......@@ -470,6 +470,7 @@ static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA* mom, LPMIDIOUTCAPSW lpMidiC
MIDICAPS_VOLUME|MIDICAPS_LRVOLUME
};
if (lpMidiCaps == NULL) return MMSYSERR_INVALPARAM;
if (!numMidiOutPorts) return MMSYSERR_BADDEVICEID;
memcpy(lpMidiCaps, &mappercaps, min(size, sizeof(*lpMidiCaps)));
return MMSYSERR_NOERROR;
......
......@@ -437,7 +437,13 @@ static void test_midi_outfns(HWND hwnd)
ok(!rc, "midiOutClose rc=%s\n", mmsys_error(rc));
}
if (!ndevs) {
MIDIOUTCAPSA capsA;
skip("Found no MIDI out device\n");
rc = midiOutGetDevCapsA(MIDIMAPPER, &capsA, sizeof(capsA));
/* GetDevCaps and Open must return compatible results */
ok(rc==MMSYSERR_BADDEVICEID || broken(rc==MMSYSERR_NODRIVER /*nt,w2k*/), "midiOutGetDevCaps MAPPER with no MIDI rc=%s\n", mmsys_error(rc));
rc = midiOutOpen(&hm, MIDIMAPPER, 0, 0, CALLBACK_NULL);
if (rc==MIDIERR_INVALIDSETUP) todo_wine /* Wine without snd-seq */
ok(rc==MMSYSERR_BADDEVICEID || broken(rc==MMSYSERR_NODRIVER /*w2k*/), "midiOutOpen MAPPER with no MIDI rc=%s\n", mmsys_error(rc));
......
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