midi mapper fix
eric pouech
eric.pouech at wanadoo.fr
Sun Jun 17 09:23:54 CDT 2001
Andi pointed out that the midi mapper was crashing when no midi out
devices were present
this patch fixes it
A+
--
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle
-------------- next part --------------
Name: midimap
ChangeLog: fails mapper opening when no midi out devices are present
GenDate: 2001/06/17 14:22:22 UTC
ModifiedFiles: dlls/winmm/midimap/midimap.c
AddedFiles:
===================================================================
RCS file: /usr/share/cvs/cvsroot/wine/wine/dlls/winmm/midimap/midimap.c,v
retrieving revision 1.8
diff -u -u -r1.8 midimap.c
--- dlls/winmm/midimap/midimap.c 2001/05/22 19:20:53 1.8
+++ dlls/winmm/midimap/midimap.c 2001/06/17 14:20:40
@@ -117,7 +117,10 @@
ERR("Registry glitch: couldn't find midi out (%s)\n", port);
dev = 0;
}
-
+
+ /* this is necessary when no midi out ports are present */
+ if (dev >= numMidiOutPorts)
+ return FALSE;
/* sets default */
for (i = 0; i < 16; i++) mom->ChannelMap[i] = &midiOutPorts[dev];
@@ -220,7 +223,7 @@
}
RegCloseKey(hKey);
- if (TRACE_ON(msacm))
+ if (ret && TRACE_ON(msacm))
{
unsigned i;
More information about the wine-patches
mailing list