From 46fb7e0057bf51af2cc3870882c56c38fd110022 Mon Sep 17 00:00:00 2001 From: Josh DuBois Date: Wed, 17 Jan 2001 21:51:07 +0000 Subject: [PATCH] Make some noise in a few cases where the X11drv doesn't load, but used to fail silently. --- dlls/x11drv/x11drv_main.c | 13 ++++++++----- include/x11drv.h | 2 +- windows/x11drv/event.c | 15 +++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c index c8be9297cd0..789da4d4519 100644 --- a/dlls/x11drv/x11drv_main.c +++ b/dlls/x11drv/x11drv_main.c @@ -369,7 +369,12 @@ static void process_attach(void) } /* initialize GDI */ - X11DRV_GDI_Initialize(); + if(!X11DRV_GDI_Initialize()) + { + MESSAGE( "%s: X11DRV Couldn't Initialize GDI.\n", argv0 ); + ExitProcess(1); + } + /* save keyboard setup */ TSXGetKeyboardControl(display, &keyboard_state); @@ -425,15 +430,13 @@ static void process_detach(void) */ BOOL WINAPI X11DRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { - static int process_count; - switch(reason) { case DLL_PROCESS_ATTACH: - if (!process_count++) process_attach(); + process_attach(); break; case DLL_PROCESS_DETACH: - if (!--process_count) process_detach(); + process_detach(); break; } return TRUE; diff --git a/include/x11drv.h b/include/x11drv.h index 4c1f5fce8cd..5ad0d6a82c8 100644 --- a/include/x11drv.h +++ b/include/x11drv.h @@ -336,7 +336,7 @@ extern BOOL X11DRV_GetClipboardData(UINT wFormat); extern WORD X11DRV_EVENT_XStateToKeyState( int state ) ; -extern BOOL X11DRV_EVENT_Init(void); +extern void X11DRV_EVENT_Init(void); extern void X11DRV_Synchronize( void ); typedef enum { diff --git a/windows/x11drv/event.c b/windows/x11drv/event.c index 3577420f2b0..876eac56bd5 100644 --- a/windows/x11drv/event.c +++ b/windows/x11drv/event.c @@ -151,8 +151,10 @@ static BOOL in_transition = FALSE; /* This is not used as for today */ /*********************************************************************** * EVENT_Init */ -BOOL X11DRV_EVENT_Init(void) +void X11DRV_EVENT_Init(void) { + HANDLE service; + #ifdef HAVE_LIBXXSHM ShmAvailable = XShmQueryExtension( display ); if (ShmAvailable) { @@ -161,17 +163,18 @@ BOOL X11DRV_EVENT_Init(void) #endif /* Install the X event processing callback */ - SERVICE_AddObject( FILE_DupUnixHandle( ConnectionNumber(display), - GENERIC_READ | SYNCHRONIZE ), - EVENT_ProcessAllEvents, 0 ); + if (SERVICE_AddObject( FILE_DupUnixHandle( ConnectionNumber(display), GENERIC_READ|SYNCHRONIZE ), + EVENT_ProcessAllEvents, 0 ) == INVALID_HANDLE_VALUE) + { + ERR("cannot add service object\n"); + ExitProcess(1); + } /* Install the XFlush timer callback */ if ( Options.synchronous ) TSXSynchronize( display, True ); else SERVICE_AddTimer( 200, EVENT_Flush, 0 ); - - return TRUE; } /***********************************************************************