Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/winecoreaudio.drv/coremidi.c | 22 ++++++++++++++++++++++ dlls/winecoreaudio.drv/midi.c | 19 ------------------- 2 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/dlls/winecoreaudio.drv/coremidi.c b/dlls/winecoreaudio.drv/coremidi.c index 3a560c21d74..dd217ea95f3 100644 --- a/dlls/winecoreaudio.drv/coremidi.c +++ b/dlls/winecoreaudio.drv/coremidi.c @@ -595,6 +595,25 @@ static DWORD midi_out_unprepare(WORD dev_id, MIDIHDR *hdr, DWORD hdr_size) return MMSYSERR_NOERROR; }
+static DWORD midi_out_get_devcaps(WORD dev_id, MIDIOUTCAPSW *caps, DWORD size) +{ + TRACE("dev_id = %d caps = %p size = %d\n", dev_id, caps, size); + + if (!caps) + { + WARN("Invalid Parameter\n"); + return MMSYSERR_INVALPARAM; + } + + if (dev_id >= num_dests) + { + WARN("bad device ID : %d\n", dev_id); + return MMSYSERR_BADDEVICEID; + } + memcpy(caps, &dests[dev_id].caps, min(size, sizeof(*caps))); + return MMSYSERR_NOERROR; +} + NTSTATUS midi_out_message(void *args) { struct midi_out_message_params *params = args; @@ -627,6 +646,9 @@ NTSTATUS midi_out_message(void *args) case MODM_UNPREPARE: *params->err = midi_out_unprepare(params->dev_id, (MIDIHDR *)params->param_1, params->param_2); break; + case MODM_GETDEVCAPS: + *params->err = midi_out_get_devcaps(params->dev_id, (MIDIOUTCAPSW *)params->param_1, params->param_2); + break; default: TRACE("Unsupported message\n"); *params->err = MMSYSERR_NOTSUPPORTED; diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c index 71bd7afebdf..675950f45d1 100644 --- a/dlls/winecoreaudio.drv/midi.c +++ b/dlls/winecoreaudio.drv/midi.c @@ -155,23 +155,6 @@ static void MIDI_NotifyClient(UINT wDevID, WORD wMsg, DWORD_PTR dwParam1, DWORD_ DriverCallback(dwCallBack, uFlags, hDev, wMsg, dwInstance, dwParam1, dwParam2); }
-static DWORD MIDIOut_GetDevCaps(WORD wDevID, LPMIDIOUTCAPSW lpCaps, DWORD dwSize) -{ - TRACE("wDevID=%d lpCaps=%p dwSize=%d\n", wDevID, lpCaps, dwSize); - - if (lpCaps == NULL) { - WARN("Invalid Parameter\n"); - return MMSYSERR_INVALPARAM; - } - - if (wDevID >= MIDIOut_NumDevs) { - WARN("bad device ID : %d\n", wDevID); - return MMSYSERR_BADDEVICEID; - } - memcpy(lpCaps, &destinations[wDevID].caps, min(dwSize, sizeof(*lpCaps))); - return MMSYSERR_NOERROR; -} - static DWORD MIDIOut_GetNumDevs(void) { TRACE("\n"); @@ -606,8 +589,6 @@ DWORD WINAPI CoreAudio_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWOR TRACE("%d %08x %08lx %08lx %08lx\n", wDevID, wMsg, dwUser, dwParam1, dwParam2);
switch (wMsg) { - case MODM_GETDEVCAPS: - return MIDIOut_GetDevCaps(wDevID, (LPMIDIOUTCAPSW) dwParam1, dwParam2); case MODM_GETNUMDEVS: return MIDIOut_GetNumDevs(); case MODM_GETVOLUME: