Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/winealsa.drv/alsamidi.c | 15 +++++++++++++++ dlls/winealsa.drv/midi.c | 18 ------------------ 2 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/dlls/winealsa.drv/alsamidi.c b/dlls/winealsa.drv/alsamidi.c index 1eb5d7db33f..550362a95ce 100644 --- a/dlls/winealsa.drv/alsamidi.c +++ b/dlls/winealsa.drv/alsamidi.c @@ -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; diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index 94de37d6176..4903b46089d 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -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: