From ba41900d49ec41f617e11a1ff8d259a0803b778c Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Mon, 3 Apr 2006 22:46:35 +0900 Subject: [PATCH] user32: More informative message on failure to load x11drv. --- dlls/user/driver.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/dlls/user/driver.c b/dlls/user/driver.c index 994152b974c..4a310494d4d 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(void) 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( HWND hwnd ) 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; }