Skip to content

Commit

Permalink
Fix crash on windows 64bit when receiving winmme MIDI messages
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Oct 28, 2023
1 parent 73a759b commit 0d730dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 4 additions & 3 deletions windows/winmme/JackWinMMEInputPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ using Jack::JackWinMMEInputPort;

void CALLBACK
JackWinMMEInputPort::HandleMidiInputEvent(HMIDIIN handle, UINT message,
DWORD port, DWORD param1,
DWORD param2)
DWORD_PTR port,
DWORD_PTR param1,
DWORD_PTR param2)
{
((JackWinMMEInputPort *) port)->ProcessWinMME(message, param1, param2);
}
Expand Down Expand Up @@ -201,7 +202,7 @@ JackWinMMEInputPort::ProcessJack(JackMidiBuffer *port_buffer,
}

void
JackWinMMEInputPort::ProcessWinMME(UINT message, DWORD param1, DWORD param2)
JackWinMMEInputPort::ProcessWinMME(UINT message, DWORD_PTR param1, DWORD_PTR param2)
{
set_threaded_log_function();
switch (message) {
Expand Down
8 changes: 5 additions & 3 deletions windows/winmme/JackWinMMEInputPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ namespace Jack {
private:

static void CALLBACK
HandleMidiInputEvent(HMIDIIN handle, UINT message, DWORD port,
DWORD param1, DWORD param2);
HandleMidiInputEvent(HMIDIIN handle, UINT message,
DWORD_PTR port,
DWORD_PTR param1,
DWORD_PTR param2);

void
EnqueueMessage(DWORD timestamp, size_t length, jack_midi_data_t *data);
Expand All @@ -43,7 +45,7 @@ namespace Jack {
GetInErrorString(MMRESULT error, LPTSTR text);

void
ProcessWinMME(UINT message, DWORD param1, DWORD param2);
ProcessWinMME(UINT message, DWORD_PTR param1, DWORD_PTR param2);

void
WriteInError(const char *jack_func, const char *mm_func,
Expand Down
6 changes: 5 additions & 1 deletion windows/winmme/JackWinMMEPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ using Jack::JackWinMMEPort;
///////////////////////////////////////////////////////////////////////////////

JackWinMMEPort::JackWinMMEPort()
{}
{
memset(alias, 0, sizeof(alias));
memset(name, 0, sizeof(name));
memset(device_name, 0, sizeof(device_name));
}

JackWinMMEPort::~JackWinMMEPort()
{}
Expand Down

0 comments on commit 0d730dd

Please sign in to comment.