winealsa: Move MIDM_GETDEVCAPS to the unixlib.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2022-03-22 08:56:21 -05:00 committed by Alexandre Julliard
parent 85890a0657
commit b4728827a6
2 changed files with 15 additions and 18 deletions

View File

@ -865,6 +865,18 @@ static UINT midi_in_unprepare(WORD dev_id, MIDIHDR *hdr, UINT hdr_size)
return MMSYSERR_NOERROR;
}
static UINT midi_in_get_devcaps(WORD dev_id, MIDIINCAPSW *caps, UINT size)
{
TRACE("(%04X, %p, %08X);\n", dev_id, caps, size);
if (dev_id >= num_srcs) return MMSYSERR_BADDEVICEID;
if (!caps) return MMSYSERR_INVALPARAM;
memcpy(caps, &srcs[dev_id].caps, min(size, sizeof(*caps)));
return MMSYSERR_NOERROR;
}
NTSTATUS midi_out_message(void *args)
{
struct midi_out_message_params *params = args;
@ -938,6 +950,9 @@ NTSTATUS midi_in_message(void *args)
case MIDM_UNPREPARE:
*params->err = midi_in_unprepare(params->dev_id, (MIDIHDR *)params->param_1, params->param_2);
break;
case MIDM_GETDEVCAPS:
*params->err = midi_in_get_devcaps(params->dev_id, (MIDIINCAPSW *)params->param_1, params->param_2);
break;
default:
TRACE("Unsupported message\n");
*params->err = MMSYSERR_NOTSUPPORTED;

View File

@ -332,22 +332,6 @@ static DWORD WINAPI midRecThread(void *arg)
return 0;
}
/**************************************************************************
* midGetDevCaps [internal]
*/
static DWORD midGetDevCaps(WORD wDevID, LPMIDIINCAPSW lpCaps, DWORD dwSize)
{
TRACE("(%04X, %p, %08X);\n", wDevID, lpCaps, dwSize);
if (wDevID >= MIDM_NumDevs) return MMSYSERR_BADDEVICEID;
if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
memcpy(lpCaps, &MidiInDev[wDevID].caps, min(dwSize, sizeof(*lpCaps)));
return MMSYSERR_NOERROR;
}
/**************************************************************************
* midOpen [internal]
*/
@ -610,8 +594,6 @@ DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
return midClose(wDevID);
case MIDM_ADDBUFFER:
return midAddBuffer(wDevID, (LPMIDIHDR)dwParam1, dwParam2);
case MIDM_GETDEVCAPS:
return midGetDevCaps(wDevID, (LPMIDIINCAPSW)dwParam1,dwParam2);
case MIDM_GETNUMDEVS:
return MIDM_NumDevs;
case MIDM_RESET: