Commit ce4fdfdb authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

winmm: Allow sound card drivers to be opened more than once.

parent 1f9fd44c
...@@ -32,18 +32,11 @@ ...@@ -32,18 +32,11 @@
#ifdef HAVE_ALSA #ifdef HAVE_ALSA
static struct WINE_ALSA* alsa = NULL;
/************************************************************************** /**************************************************************************
* ALSA_drvOpen [internal] * ALSA_drvOpen [internal]
*/ */
static LRESULT ALSA_drvOpen(LPSTR str) static LRESULT ALSA_drvOpen(LPSTR str)
{ {
if (alsa)
return 0;
/* I know, this is ugly, but who cares... */
alsa = (struct WINE_ALSA*)1;
return 1; return 1;
} }
...@@ -52,11 +45,7 @@ static LRESULT ALSA_drvOpen(LPSTR str) ...@@ -52,11 +45,7 @@ static LRESULT ALSA_drvOpen(LPSTR str)
*/ */
static LRESULT ALSA_drvClose(DWORD_PTR dwDevID) static LRESULT ALSA_drvClose(DWORD_PTR dwDevID)
{ {
if (alsa) {
alsa = NULL;
return 1; return 1;
}
return 0;
} }
#endif #endif
......
...@@ -33,18 +33,12 @@ ...@@ -33,18 +33,12 @@
#include "arts.h" #include "arts.h"
#ifdef HAVE_ARTS #ifdef HAVE_ARTS
static int arts = 0;
/************************************************************************** /**************************************************************************
* ARTS_drvOpen [internal] * ARTS_drvOpen [internal]
*/ */
static LRESULT ARTS_drvOpen(LPSTR str) static LRESULT ARTS_drvOpen(LPSTR str)
{ {
if (arts)
return 0;
/* I know, this is ugly, but who cares... */
arts = 1;
return 1; return 1;
} }
...@@ -53,11 +47,7 @@ static LRESULT ARTS_drvOpen(LPSTR str) ...@@ -53,11 +47,7 @@ static LRESULT ARTS_drvOpen(LPSTR str)
*/ */
static LRESULT ARTS_drvClose(DWORD_PTR dwDevID) static LRESULT ARTS_drvClose(DWORD_PTR dwDevID)
{ {
if (arts) {
arts = 0;
return 1; return 1;
}
return 0;
} }
#endif /* #ifdef HAVE_ARTS */ #endif /* #ifdef HAVE_ARTS */
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#ifdef HAVE_LIBAUDIOIO #ifdef HAVE_LIBAUDIOIO
static struct WINE_LIBAUDIOIO* audioio = NULL;
extern LONG LIBAUDIOIO_WaveInit(void); extern LONG LIBAUDIOIO_WaveInit(void);
/************************************************************************** /**************************************************************************
...@@ -41,11 +39,6 @@ extern LONG LIBAUDIOIO_WaveInit(void); ...@@ -41,11 +39,6 @@ extern LONG LIBAUDIOIO_WaveInit(void);
*/ */
static LRESULT LIBAUDIOIO_drvOpen(LPSTR str) static LRESULT LIBAUDIOIO_drvOpen(LPSTR str)
{ {
if (audioio)
return 0;
/* I know, this is ugly, but who cares... */
audioio = (struct WINE_LIBAUDIOIO*)1;
return 1; return 1;
} }
...@@ -54,11 +47,7 @@ static LRESULT LIBAUDIOIO_drvOpen(LPSTR str) ...@@ -54,11 +47,7 @@ static LRESULT LIBAUDIOIO_drvOpen(LPSTR str)
*/ */
static LRESULT LIBAUDIOIO_drvClose(DWORD_PTR dwDevID) static LRESULT LIBAUDIOIO_drvClose(DWORD_PTR dwDevID)
{ {
if (audioio) {
audioio = NULL;
return 1; return 1;
}
return 0;
} }
#endif #endif
......
...@@ -34,18 +34,12 @@ ...@@ -34,18 +34,12 @@
#include "esound.h" #include "esound.h"
#ifdef HAVE_ESD #ifdef HAVE_ESD
static int esd = 0;
/************************************************************************** /**************************************************************************
* ESD_drvOpen [internal] * ESD_drvOpen [internal]
*/ */
static LRESULT ESD_drvOpen(LPSTR str) static LRESULT ESD_drvOpen(LPSTR str)
{ {
if (esd)
return 0;
/* I know, this is ugly, but who cares... */
esd = 1;
return 1; return 1;
} }
...@@ -54,11 +48,7 @@ static LRESULT ESD_drvOpen(LPSTR str) ...@@ -54,11 +48,7 @@ static LRESULT ESD_drvOpen(LPSTR str)
*/ */
static LRESULT ESD_drvClose(DWORD_PTR dwDevID) static LRESULT ESD_drvClose(DWORD_PTR dwDevID)
{ {
if (esd) {
esd = 0;
return 1; return 1;
}
return 0;
} }
#endif /* #ifdef HAVE_ESD */ #endif /* #ifdef HAVE_ESD */
......
...@@ -36,18 +36,12 @@ ...@@ -36,18 +36,12 @@
#include "nas.h" #include "nas.h"
#ifdef HAVE_NAS #ifdef HAVE_NAS
static int nas = 0;
/************************************************************************** /**************************************************************************
* NAS_drvOpen [internal] * NAS_drvOpen [internal]
*/ */
static LRESULT NAS_drvOpen(LPSTR str) static LRESULT NAS_drvOpen(LPSTR str)
{ {
if (nas)
return 0;
/* I know, this is ugly, but who cares... */
nas = 1;
return 1; return 1;
} }
...@@ -56,11 +50,7 @@ static LRESULT NAS_drvOpen(LPSTR str) ...@@ -56,11 +50,7 @@ static LRESULT NAS_drvOpen(LPSTR str)
*/ */
static LRESULT NAS_drvClose(DWORD_PTR dwDevID) static LRESULT NAS_drvClose(DWORD_PTR dwDevID)
{ {
if (nas) {
nas = 0;
return 1; return 1;
}
return 0;
} }
#endif /* #ifdef HAVE_NAS */ #endif /* #ifdef HAVE_NAS */
......
...@@ -32,18 +32,11 @@ ...@@ -32,18 +32,11 @@
#ifdef HAVE_OSS #ifdef HAVE_OSS
static struct WINE_OSS* oss = NULL;
/************************************************************************** /**************************************************************************
* OSS_drvOpen [internal] * OSS_drvOpen [internal]
*/ */
static LRESULT OSS_drvOpen(LPSTR str) static LRESULT OSS_drvOpen(LPSTR str)
{ {
if (oss)
return 0;
/* I know, this is ugly, but who cares... */
oss = (struct WINE_OSS*)1;
return 1; return 1;
} }
...@@ -52,11 +45,7 @@ static LRESULT OSS_drvOpen(LPSTR str) ...@@ -52,11 +45,7 @@ static LRESULT OSS_drvOpen(LPSTR str)
*/ */
static LRESULT OSS_drvClose(DWORD_PTR dwDevID) static LRESULT OSS_drvClose(DWORD_PTR dwDevID)
{ {
if (oss) {
oss = NULL;
return 1; return 1;
}
return 0;
} }
#endif #endif
......
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