From: Dmitry Timoshkov Date: Mon, 6 Dec 2004 16:21:27 +0000 (+0000) Subject: Avoid crashes in ddraw.dll when loading it without x11drv, for X-Git-Tag: wine-20050111~457 X-Git-Url: http://git.etersoft.ru/projects/?a=commitdiff_plain;h=627260f89ebaf4e06047c938492bec2d5300bba6;p=wine%2Feterwine.git Avoid crashes in ddraw.dll when loading it without x11drv, for instance from wineprefixcreate in a text mode console. --- diff --git a/dlls/ddraw/d3ddevice/mesa.c b/dlls/ddraw/d3ddevice/mesa.c index d10e8b0845..d9890e4071 100644 --- a/dlls/ddraw/d3ddevice/mesa.c +++ b/dlls/ddraw/d3ddevice/mesa.c @@ -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); diff --git a/dlls/ddraw/ddraw/hal.c b/dlls/ddraw/ddraw/hal.c index 049daa15ce..447c0b608f 100644 --- a/dlls/ddraw/ddraw/hal.c +++ b/dlls/ddraw/ddraw/hal.c @@ -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;