src/music/win32_m.cpp
branchnoai
changeset 9704 197cb8c6ae17
parent 9701 d1ac22c62f64
child 9189 40f723073fef
child 9826 9707ad4c9b60
--- a/src/music/win32_m.cpp	Sun Sep 23 07:37:38 2007 +0000
+++ b/src/music/win32_m.cpp	Sat Oct 06 22:30:24 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;
 }