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.
This commit is contained in:
Francois Gouget 2004-05-05 01:00:54 +00:00 committed by Alexandre Julliard
parent 319fa1c31e
commit bf75c5c163
1 changed files with 8 additions and 6 deletions

View File

@ -53,7 +53,7 @@ typedef struct tagWINE_LLTYPE {
} 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 +610,16 @@ static BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper)
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))) {