winenas: fix crash.

- return correct MM error code when no connection to server has been
  opened
- don't close the AU driver if it hasn't been opened
This commit is contained in:
Eric Pouech 2005-12-08 11:58:35 +01:00 committed by Alexandre Julliard
parent 51862d440c
commit 65a1796bc7

View file

@ -407,7 +407,7 @@ LONG NAS_WaveClose(void)
LONG NAS_WaveInit(void)
{
int i;
nas_init();
if (!nas_init()) return MMSYSERR_ERROR;
/* initialize all device handles to -1 */
for (i = 0; i < MAX_WAVEOUTDRV; ++i)
@ -1475,8 +1475,11 @@ static int nas_close(WINE_WAVEOUT* wwo)
static int nas_end(void)
{
AuCloseServer(AuServ);
AuServ = 0;
if (AuServ)
{
AuCloseServer(AuServ);
AuServ = 0;
}
return 1;
}