Avoid crashes in ddraw.dll when loading it without x11drv, for

instance from wineprefixcreate in a text mode console.
This commit is contained in:
Dmitry Timoshkov 2004-12-06 16:21:27 +00:00 committed by Alexandre Julliard
parent d921d161c4
commit 627260f89e
2 changed files with 9 additions and 0 deletions

View 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);

View 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;