DDRAW: recover from a crash in libGL.so

Saulius Krasuckas saulius2 at ar.fi.lt
Sun Aug 21 13:03:53 CDT 2005


Log message:
	Saulius Krasuckas <saulius.krasuckas at ieee.org>
	Try to recover from glXCreateContext() crash in libGL.so, which 
	occurs at 8 bit depth with binary (native) NVIDIA driver.


? dlls/ddraw/tests/ddraw_test.dsp
Index: dlls/ddraw/device_opengl.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/device_opengl.c,v
retrieving revision 1.7
diff -p -u -r1.7 device_opengl.c
--- dlls/ddraw/device_opengl.c	11 Aug 2005 10:57:47 -0000	1.7
+++ dlls/ddraw/device_opengl.c	21 Aug 2005 18:01:16 -0000
@@ -39,6 +39,8 @@
 #include "d3d.h"
 #include "wine/debug.h"
 #include "wine/library.h"
+#include "wine/exception.h"
+#include "excpt.h"
 
 #include "d3d_private.h"
 #include "opengl_private.h"
@@ -4297,6 +4299,13 @@ static void fill_caps(void)
     }
 }
 
+static WINE_EXCEPTION_FILTER(page_fault)
+{
+    if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
+        return EXCEPTION_EXECUTE_HANDLER;
+    return EXCEPTION_CONTINUE_SEARCH;
+}
+
 BOOL
 d3ddevice_init_at_startup(void *gl_handle)
 {
@@ -4341,7 +4350,16 @@ d3ddevice_init_at_startup(void *gl_handl
 	WARN("Error creating visual info for capabilities initialization - D3D support disabled !\n");
 	return FALSE;
     }
-    gl_context = glXCreateContext(display, vis, NULL, GL_TRUE);
+    __TRY {
+        gl_context = glXCreateContext(display, vis, NULL, GL_TRUE);
+    }
+    __EXCEPT(page_fault) {
+        /* Here we blow in from NVIDIA driver (libGL.so) 
+	 * in 8 bit mode.  Do we need some clean up? */
+        ERR("glXCreateContext() generated exception (EXCEPTION_ACCESS_VIOLATION). Trying to recover.\n");
+        gl_context = NULL;
+    }
+    __ENDTRY
 
     if (gl_context == NULL) {
 	LEAVE_GL();



More information about the wine-patches mailing list