Avoid crashes in ddraw.dll when loading it without x11drv, for
authorDmitry Timoshkov <dmitry@codeweavers.com>
Mon, 6 Dec 2004 16:21:27 +0000 (16:21 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 6 Dec 2004 16:21:27 +0000 (16:21 +0000)
instance from wineprefixcreate in a text mode console.

dlls/ddraw/d3ddevice/mesa.c
dlls/ddraw/ddraw/hal.c

index d10e8b08459de59052f850a90d089cc1fd04dbf0..d9890e4071ac84d73298d13f78192c0c72cfe8b3 100644 (file)
@@ -4212,6 +4212,12 @@ d3ddevice_init_at_startup(void *gl_handle)
     int major, minor, patch, num_parsed;
     
     TRACE("Initializing GL...\n");
+
+    if (!drawable)
+    {
+        WARN("x11drv not loaded - D3D support disabled!\n");
+        return FALSE;
+    }
     
     /* Get a default rendering context to have the 'caps' function query some info from GL */    
     device_context = GetDC(0);
index 049daa15ce67ce3998e4d311772413ad09d6f8fe..447c0b608f344bf88b84ea23e8f9f8d81d601b43 100644 (file)
@@ -213,6 +213,9 @@ static BOOL initialize(void)
 static void cleanup(void)
 {
     DDHAL_DESTROYDRIVERDATA data;
+
+    if (!dd_cbs.HALDD.DestroyDriver) return;
+
     data.lpDD = NULL;
     data.ddRVal = 0;
     data.DestroyDriver = dd_cbs.HALDD.DestroyDriver;