Commit ba41900d authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

user32: More informative message on failure to load x11drv.

parent f875d30e
...@@ -32,6 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(user); ...@@ -32,6 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(user);
static const USER_DRIVER null_driver, lazy_load_driver; static const USER_DRIVER null_driver, lazy_load_driver;
const USER_DRIVER *USER_Driver = &lazy_load_driver; const USER_DRIVER *USER_Driver = &lazy_load_driver;
static DWORD driver_load_error;
/* load the graphics driver */ /* load the graphics driver */
static const USER_DRIVER *load_driver(void) static const USER_DRIVER *load_driver(void)
...@@ -62,6 +63,9 @@ static const USER_DRIVER *load_driver(void) ...@@ -62,6 +63,9 @@ static const USER_DRIVER *load_driver(void)
name = next; name = next;
} }
if (!graphics_driver)
driver_load_error = GetLastError();
driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) ); driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
memcpy( driver, &null_driver, sizeof(*driver) ); memcpy( driver, &null_driver, sizeof(*driver) );
...@@ -305,10 +309,22 @@ static BOOL nulldrv_CreateDesktopWindow( HWND hwnd ) ...@@ -305,10 +309,22 @@ static BOOL nulldrv_CreateDesktopWindow( HWND hwnd )
static BOOL nulldrv_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) static BOOL nulldrv_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
{ {
static int warned; static int warned;
if (warned++)
return FALSE;
MESSAGE( "Application tried to create a window, but no driver could be loaded.\n");
switch (driver_load_error)
{
case ERROR_MOD_NOT_FOUND:
MESSAGE( "The X11 driver is missing. Check your build!\n" );
break;
case ERROR_DLL_INIT_FAILED:
MESSAGE( "Make sure that your X server is running and that $DISPLAY is set correctly.\n" );
break;
default:
MESSAGE( "Unknown error (%ld).\n", driver_load_error );
}
if (!warned++)
MESSAGE( "Application tries to create a window, but no driver could be loaded.\n"
"Make sure that your X server is running and that $DISPLAY is set correctly.\n" );
return FALSE; return FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment