winmm patch
Francois Gouget
fgouget at codeweavers.com
Tue May 4 06:42:36 CDT 2004
Sorry for the subject, I lack inspiration today.
Changelog:
* dlls/winmm/lolvldrv.c
Francois Gouget <fgouget at codeweavers.com>
Taking into account wavemap and midimap there can be up to 8 output
drivers. So increase the size of the MMDrvs array accordingly.
Skip already loaded drivers before complaining (asserting) that they
don't fit in the MMDrvs array.
--
Francois Gouget
fgouget at codeweavers.com
-------------- next part --------------
Index: dlls/winmm/lolvldrv.c
===================================================================
RCS file: /var/cvs/wine/dlls/winmm/lolvldrv.c,v
retrieving revision 1.55
diff -u -r1.55 lolvldrv.c
--- a/dlls/winmm/lolvldrv.c 31 Dec 2003 23:49:45 -0000 1.55
+++ b/dlls/winmm/lolvldrv.c 4 May 2004 11:13:49 -0000
@@ -53,7 +53,7 @@
} WINE_LLTYPE;
static int MMDrvsHi /* = 0 */;
-static WINE_MM_DRIVER MMDrvs[3];
+static WINE_MM_DRIVER MMDrvs[8];
static LPWINE_MLD MM_MLDrvs[40];
#define MAX_MM_MLDRVS (sizeof(MM_MLDrvs) / sizeof(MM_MLDrvs[0]))
@@ -610,14 +615,16 @@
TRACE("('%s', '%s', mapper=%c);\n", drvRegName, drvFileName, bIsMapper ? 'Y' : 'N');
- /* be sure that size of MMDrvs matches the max number of loadable drivers !!
- * if not just increase size of MMDrvs */
- assert(MMDrvsHi <= sizeof(MMDrvs)/sizeof(MMDrvs[0]));
-
for (i = 0; i < MMDrvsHi; i++) {
- if (!strcmp(drvRegName, MMDrvs[i].drvname)) return FALSE;
+ if (!strcmp(drvRegName, MMDrvs[i].drvname)) return FALSE;
}
+ /* Be sure that size of MMDrvs matches the max number of loadable
+ * drivers !!
+ * If not just increase size of MMDrvs
+ */
+ assert(MMDrvsHi <= sizeof(MMDrvs)/sizeof(MMDrvs[0]));
+
memset(lpDrv, 0, sizeof(*lpDrv));
if (!(lpDrv->hDriver = OpenDriverA(drvFileName, 0, 0))) {
More information about the wine-patches
mailing list