Mike McCormack : user32: More informative message on failure to load
x11drv .
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Apr 3 14:46:14 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: ba41900d49ec41f617e11a1ff8d259a0803b778c
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=ba41900d49ec41f617e11a1ff8d259a0803b778c
Author: Mike McCormack <mike at codeweavers.com>
Date: Mon Apr 3 22:46:35 2006 +0900
user32: More informative message on failure to load x11drv.
---
dlls/user/driver.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/dlls/user/driver.c b/dlls/user/driver.c
index 994152b..4a31049 100644
--- a/dlls/user/driver.c
+++ b/dlls/user/driver.c
@@ -32,6 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(user);
static const USER_DRIVER null_driver, lazy_load_driver;
const USER_DRIVER *USER_Driver = &lazy_load_driver;
+static DWORD driver_load_error;
/* load the graphics driver */
static const USER_DRIVER *load_driver(void)
@@ -62,6 +63,9 @@ static const USER_DRIVER *load_driver(vo
name = next;
}
+ if (!graphics_driver)
+ driver_load_error = GetLastError();
+
driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
memcpy( driver, &null_driver, sizeof(*driver) );
@@ -305,10 +309,22 @@ static BOOL nulldrv_CreateDesktopWindow(
static BOOL nulldrv_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
{
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;
}
More information about the wine-cvs
mailing list