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 38608b0851c..983d0676b16 100644 --- a/dlls/winecoreaudio.drv/coremidi.c +++ b/dlls/winecoreaudio.drv/coremidi.c @@ -826,6 +826,25 @@ static DWORD midi_in_unprepare(WORD dev_id, MIDIHDR *hdr, DWORD hdr_size) return MMSYSERR_NOERROR; }
+static DWORD midi_in_get_devcaps(WORD dev_id, MIDIINCAPSW *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_srcs) + { + WARN("bad device ID : %d\n", dev_id); + return MMSYSERR_BADDEVICEID; + } + + 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; @@ -907,6 +926,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/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c index 9adf10953f9..35da144c927 100644 --- a/dlls/winecoreaudio.drv/midi.c +++ b/dlls/winecoreaudio.drv/midi.c @@ -194,23 +194,6 @@ static DWORD MIDIIn_AddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) return MMSYSERR_NOERROR; }
-static DWORD MIDIIn_GetDevCaps(WORD wDevID, LPMIDIINCAPSW 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 >= MIDIIn_NumDevs) { - WARN("bad device ID : %d\n", wDevID); - return MMSYSERR_BADDEVICEID; - } - memcpy(lpCaps, &sources[wDevID].caps, min(dwSize, sizeof(*lpCaps))); - return MMSYSERR_NOERROR; -} - static DWORD MIDIIn_GetNumDevs(void) { TRACE("\n"); @@ -437,8 +420,6 @@ DWORD WINAPI CoreAudio_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWOR switch (wMsg) { case MIDM_ADDBUFFER: return MIDIIn_AddBuffer(wDevID, (LPMIDIHDR)dwParam1, dwParam2); - case MIDM_GETDEVCAPS: - return MIDIIn_GetDevCaps(wDevID, (LPMIDIINCAPSW) dwParam1, dwParam2); case MIDM_GETNUMDEVS: return MIDIIn_GetNumDevs(); case MIDM_START:
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Mon, Nov 29, 2021 at 11:26:42AM +0000, Huw Davies wrote:
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 38608b0851c..983d0676b16 100644 --- a/dlls/winecoreaudio.drv/coremidi.c +++ b/dlls/winecoreaudio.drv/coremidi.c @@ -826,6 +826,25 @@ static DWORD midi_in_unprepare(WORD dev_id, MIDIHDR *hdr, DWORD hdr_size) return MMSYSERR_NOERROR; }
+static DWORD midi_in_get_devcaps(WORD dev_id, MIDIINCAPSW *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_srcs)
- {
WARN("bad device ID : %d\n", dev_id);
return MMSYSERR_BADDEVICEID;
- }
- 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; @@ -907,6 +926,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);
default: TRACE("Unsupported message\n"); *params->err = MMSYSERR_NOTSUPPORTED;break;
diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c index 9adf10953f9..35da144c927 100644 --- a/dlls/winecoreaudio.drv/midi.c +++ b/dlls/winecoreaudio.drv/midi.c @@ -194,23 +194,6 @@ static DWORD MIDIIn_AddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) return MMSYSERR_NOERROR; }
-static DWORD MIDIIn_GetDevCaps(WORD wDevID, LPMIDIINCAPSW 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 >= MIDIIn_NumDevs) {
WARN("bad device ID : %d\n", wDevID);
- return MMSYSERR_BADDEVICEID;
- }
- memcpy(lpCaps, &sources[wDevID].caps, min(dwSize, sizeof(*lpCaps)));
- return MMSYSERR_NOERROR;
-}
static DWORD MIDIIn_GetNumDevs(void) { TRACE("\n"); @@ -437,8 +420,6 @@ DWORD WINAPI CoreAudio_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWOR switch (wMsg) { case MIDM_ADDBUFFER: return MIDIIn_AddBuffer(wDevID, (LPMIDIHDR)dwParam1, dwParam2);
case MIDM_GETDEVCAPS:
return MIDIIn_GetDevCaps(wDevID, (LPMIDIINCAPSW) dwParam1, dwParam2); case MIDM_GETNUMDEVS: return MIDIIn_GetNumDevs(); case MIDM_START:
-- 2.23.0