commit fee18df7912c307e1dbdb646655dfcbfe98c939f
Author: Alex Mayfield <alexmax2742@gmail.com>
AuthorDate: Thu Mar 9 20:12:21 2017 -0500
Commit: Alex Mayfield <alexmax2742@gmail.com>
CommitDate: Thu Mar 9 20:28:17 2017 -0500
WriteFile requires 4th parameter
Fixes crashes on certain versions of Windows.
---
midiproc/main.c | 3 ++-
src/i_midipipe.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/midiproc/main.c b/midiproc/main.c
index 11ec5eac..54940221 100644
--- a/midiproc/main.c
+++ b/midiproc/main.c
@@ -161,8 +161,9 @@ static boolean MidiPipe_RegisterSong(buffer_reader_t *reader)
buffer[0] = (i >> 8) & 0xff;
buffer[1] = i & 0xff;
+ DWORD bytes_written;
WriteFile(midi_process_out, buffer, sizeof(buffer),
- NULL, NULL);
+ &bytes_written, NULL);
return true;
}
diff --git a/src/i_midipipe.c b/src/i_midipipe.c
index 0d80ccfc..fd7fb2e8 100644
--- a/src/i_midipipe.c
+++ b/src/i_midipipe.c
@@ -127,8 +127,9 @@ static boolean UsingNativeMidi()
//
static boolean WritePipe(net_packet_t *packet)
{
+ DWORD bytes_written;
BOOL ok = WriteFile(midi_process_in_writer, packet->data, packet->len,
- NULL, NULL);
+ &bytes_written, NULL);
if (!ok)
{