Commit 0cd1affc authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

wineoss: Move MIDM_GETDEVCAPS to the unixlib.

parent 3d0e1a4f
......@@ -379,21 +379,6 @@ static DWORD WINAPI midRecThread(void *arg)
}
/**************************************************************************
* 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]
*/
static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
......@@ -620,8 +605,6 @@ DWORD WINAPI OSS_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:
......
......@@ -1131,6 +1131,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;
......@@ -1202,6 +1214,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;
......
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