Sync to Wine-20040505:

Francois Gouget <fgouget@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.
- Make static Unicode strings const.

svn path=/trunk/; revision=9331
This commit is contained in:
Gé van Geldorp 2004-05-08 14:07:55 +00:00
parent f19704b04f
commit dd3c643b4d
3 changed files with 21 additions and 19 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]))
@ -612,14 +612,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))) {

View file

@ -62,13 +62,13 @@ static HMMIO get_mmioFromProfile(UINT uFlags, LPCWSTR lpszName)
HKEY hRegSnd, hRegApp, hScheme, hSnd;
DWORD err, type, count;
static WCHAR wszSounds[] = {'S','o','u','n','d','s',0};
static WCHAR wszDefault[] = {'D','e','f','a','u','l','t',0};
static WCHAR wszKey[] = {'A','p','p','E','v','e','n','t','s','\\',
static const WCHAR wszSounds[] = {'S','o','u','n','d','s',0};
static const WCHAR wszDefault[] = {'D','e','f','a','u','l','t',0};
static const WCHAR wszKey[] = {'A','p','p','E','v','e','n','t','s','\\',
'S','c','h','e','m','e','s','\\',
'A','p','p','s',0};
static WCHAR wszDotDefault[] = {'.','D','e','f','a','u','l','t',0};
static WCHAR wszNull[] = {0};
static const WCHAR wszDotDefault[] = {'.','D','e','f','a','u','l','t',0};
static const WCHAR wszNull[] = {0};
TRACE("searching in SystemSound list for %s\n", debugstr_w(lpszName));
GetProfileStringW(wszSounds, (LPWSTR)lpszName, wszNull, str, sizeof(str)/sizeof(str[0]));
@ -257,7 +257,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
/* if resource, grab it */
if ((wps->fdwSound & SND_RESOURCE) == SND_RESOURCE) {
static WCHAR wszWave[] = {'W','A','V','E',0};
static const WCHAR wszWave[] = {'W','A','V','E',0};
HRSRC hRes;
HGLOBAL hGlob;

View file

@ -1,10 +1,10 @@
Index: lolvldrv.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/lolvldrv.c,v
retrieving revision 1.55
diff -u -r1.55 lolvldrv.c
--- lolvldrv.c 31 Dec 2003 23:49:45 -0000 1.55
+++ lolvldrv.c 12 Mar 2004 21:27:34 -0000
retrieving revision 1.56
diff -u -r1.56 lolvldrv.c
--- lolvldrv.c 5 May 2004 01:00:54 -0000 1.56
+++ lolvldrv.c 8 May 2004 14:17:20 -0000
@@ -497,10 +497,12 @@
case DRV_QUERYDEVICEINTERFACESIZE:
return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE);
@ -18,7 +18,7 @@ diff -u -r1.55 lolvldrv.c
default:
WARN("Unknown call %04x\n", uMsg);
@@ -741,11 +743,18 @@
@@ -743,11 +745,18 @@
static BOOL MMDRV_InitHardcoded(void)
{
/* first load hardware drivers */
@ -45,7 +45,7 @@ RCS file: /home/wine/wine/dlls/winmm/time.c,v
retrieving revision 1.26
diff -u -r1.26 time.c
--- time.c 12 Jan 2004 21:03:10 -0000 1.26
+++ time.c 12 Mar 2004 21:27:34 -0000
+++ time.c 8 May 2004 14:17:20 -0000
@@ -175,14 +175,19 @@
volatile HANDLE *pActive = (volatile HANDLE *)&TIME_hMMTimer;
DWORD last_time, cur_time;
@ -72,7 +72,7 @@ RCS file: /home/wine/wine/dlls/winmm/winmm.c,v
retrieving revision 1.33
diff -u -r1.33 winmm.c
--- winmm.c 27 Feb 2004 21:29:32 -0000 1.33
+++ winmm.c 12 Mar 2004 21:27:36 -0000
+++ winmm.c 8 May 2004 14:17:21 -0000
@@ -125,10 +125,12 @@
loaded = -1;
if (h)