(svn r11154) -Fix [FS#1239]: MIDI failing to play under Windows 95, 98 and ME.
authorrubidium
Mon, 24 Sep 2007 19:11:26 +0000
changeset 8119 9505a65c30d5
parent 8118 644c9acc640c
child 8120 2ab4ad82fd44
(svn r11154) -Fix [FS#1239]: MIDI failing to play under Windows 95, 98 and ME.
src/music/win32_m.cpp
--- a/src/music/win32_m.cpp	Sun Sep 23 19:55:42 2007 +0000
+++ b/src/music/win32_m.cpp	Mon Sep 24 19:11:26 2007 +0000
@@ -142,7 +142,11 @@
 	}
 
 	if (NULL == (_midi.wait_obj = CreateEvent(NULL, FALSE, FALSE, NULL))) return "Failed to create event";
-	if (NULL == (_midi.thread = CreateThread(NULL, 8192, MidiThread, 0, 0, NULL))) return "Failed to create thread";
+
+	/* The lpThreadId parameter of CreateThread (the last parameter)
+	 * may NOT be NULL on Windows 95, 98 and ME. */
+	DWORD threadId;
+	if (NULL == (_midi.thread = CreateThread(NULL, 8192, MidiThread, 0, 0, &threadId))) return "Failed to create thread";
 
 	return NULL;
 }