Module: wine Branch: refs/heads/master Commit: 2ba20dd78b7b3f08260bdb602be046eaa1c4e7bf URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=2ba20dd78b7b3f08260bdb60...
Author: Robert Reif reif@earthlink.net Date: Mon Jan 23 16:48:45 2006 +0100
winearts: Try to keep winecfg from crashing by recovering from an arts library crash.
---
dlls/winmm/winearts/Makefile.in | 2 +- dlls/winmm/winearts/audio.c | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/winmm/winearts/Makefile.in b/dlls/winmm/winearts/Makefile.in index dba0062..f277c83 100644 --- a/dlls/winmm/winearts/Makefile.in +++ b/dlls/winmm/winearts/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = winearts.drv -IMPORTS = winmm user32 kernel32 +IMPORTS = winmm user32 kernel32 ntdll EXTRAINCL = @ARTSINCL@ EXTRALIBS = @ARTSLIBS@ -ldxguid -luuid
diff --git a/dlls/winmm/winearts/audio.c b/dlls/winmm/winearts/audio.c index ea5c5ca..9b5c10b 100644 --- a/dlls/winmm/winearts/audio.c +++ b/dlls/winmm/winearts/audio.c @@ -57,6 +57,7 @@ #include "dsdriver.h" #include "arts.h" #include "wine/unicode.h" +#include "wine/exception.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wave); @@ -392,14 +393,27 @@ LONG ARTS_WaveInit(void) { int i; int errorcode; + LONG ret = 0;
TRACE("called\n");
- if ((errorcode = ARTS_Init()) < 0) + __TRY { - WARN("arts_init() failed (%d)\n", errorcode); - return -1; + if ((errorcode = ARTS_Init()) < 0) + { + WARN("arts_init() failed (%d)\n", errorcode); + ret = -1; + } } + __EXCEPT_PAGE_FAULT + { + ERR("arts_init() crashed\n"); + ret = -1; + } + __ENDTRY + + if (ret) + return ret;
/* initialize all device handles to -1 */ for (i = 0; i < MAX_WAVEOUTDRV; ++i)