Commit d368aefd authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

winmm: Clean up MMDRV_Init.

parent 3a96c85c
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
WINE_DEFAULT_DEBUG_CHANNEL(winmm); WINE_DEFAULT_DEBUG_CHANNEL(winmm);
/* Default set of drivers to be loaded */
#define WINE_DEFAULT_WINMM_DRIVER "alsa,oss,coreaudio,esd"
/* each known type of driver has an instance of this structure */ /* each known type of driver has an instance of this structure */
typedef struct tagWINE_LLTYPE { typedef struct tagWINE_LLTYPE {
/* those attributes depend on the specification of the type */ /* those attributes depend on the specification of the type */
...@@ -535,38 +538,32 @@ static void MMDRV_Init(void) ...@@ -535,38 +538,32 @@ static void MMDRV_Init(void)
{ {
HKEY hKey; HKEY hKey;
char driver_buffer[256]; char driver_buffer[256];
char mapper_buffer[256]; char *p, *next;
char midi_buffer[256];
char* p;
DWORD type, size;
BOOL ret = FALSE;
TRACE("()\n"); TRACE("()\n");
strcpy(driver_buffer, WINE_DEFAULT_WINMM_DRIVER); strcpy(driver_buffer, WINE_DEFAULT_WINMM_DRIVER);
strcpy(mapper_buffer, WINE_DEFAULT_WINMM_MAPPER);
strcpy(midi_buffer, WINE_DEFAULT_WINMM_MIDI);
/* @@ Wine registry key: HKCU\Software\Wine\Drivers */ /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hKey)) if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hKey))
{ {
size = sizeof(driver_buffer); DWORD size = sizeof(driver_buffer);
if (RegQueryValueExA(hKey, "Audio", 0, &type, (LPVOID)driver_buffer, &size)) if (RegQueryValueExA(hKey, "Audio", 0, NULL, (BYTE*)driver_buffer, &size))
strcpy(driver_buffer, WINE_DEFAULT_WINMM_DRIVER); strcpy(driver_buffer, WINE_DEFAULT_WINMM_DRIVER);
} }
p = driver_buffer; for (p = driver_buffer; p; p = next)
while (p)
{ {
char filename[sizeof(driver_buffer)+10]; char filename[sizeof(driver_buffer)+10];
char *next = strchr(p, ','); next = strchr(p, ',');
if (next) *next++ = 0; if (next) *next++ = 0;
sprintf( filename, "wine%s.drv", p ); sprintf( filename, "wine%s.drv", p );
if ((ret = MMDRV_Install( filename, filename, FALSE ))) break; if (MMDRV_Install(filename, filename, FALSE))
break;
p = next; p = next;
} }
ret |= MMDRV_Install("wavemapper", WINE_DEFAULT_WINMM_MAPPER, TRUE); MMDRV_Install("wavemapper", "msacm32.drv", TRUE);
ret |= MMDRV_Install("midimapper", WINE_DEFAULT_WINMM_MIDI, TRUE); MMDRV_Install("midimapper", "midimap.dll", TRUE);
} }
/****************************************************************** /******************************************************************
......
...@@ -25,10 +25,6 @@ ...@@ -25,10 +25,6 @@
#include "winbase.h" #include "winbase.h"
#include "mmddk.h" #include "mmddk.h"
#define WINE_DEFAULT_WINMM_DRIVER "alsa,oss,coreaudio,esd"
#define WINE_DEFAULT_WINMM_MAPPER "msacm32.drv"
#define WINE_DEFAULT_WINMM_MIDI "midimap.dll"
/* Who said goofy boy ? */ /* Who said goofy boy ? */
#define WINE_DI_MAGIC 0x900F1B01 #define WINE_DI_MAGIC 0x900F1B01
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment