All pastes #417231 Raw Edit

Stuff

public text v1 · immutable
#417231 ·published 2007-03-30 19:11 UTC
rendered paste body
diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c
index c921034..27af1dc 100644
--- a/dlls/winex11.drv/dib.c
+++ b/dlls/winex11.drv/dib.c
@@ -39,6 +39,7 @@
 #include "wingdi.h"
 #include "x11drv.h"
 #include "excpt.h"
+#include "wine/exception.h"
 #include "wine/debug.h"

 WINE_DEFAULT_DEBUG_CHANNEL(bitmap);
@@ -101,6 +102,13 @@ static INT X11DRV_DIB_Coerce(X_PHYSBITMAP *,INT,BOOL);
 static INT X11DRV_DIB_Lock(X_PHYSBITMAP *,INT,BOOL);
 static void X11DRV_DIB_Unlock(X_PHYSBITMAP *,BOOL);

+static WINE_EXCEPTION_FILTER(exceptionfilter)
+{
+    if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
+        ERR("exception caught with code 0x%08x = %d, app might be buggy?\n", GetExceptionCode(), GetExceptionCode());
+    return EXCEPTION_EXECUTE_HANDLER;
+}
+
 /*
   Some of the following helper functions are duplicated in
   dlls/gdi/dib.c
@@ -3507,7 +3515,7 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
     TRACE("Bmp: depth=%d/%d r=%lx g=%lx b=%lx\n",
           bmpImage->depth,bmpImage->bits_per_pixel,
           bmpImage->red_mask,bmpImage->green_mask,bmpImage->blue_mask);
-
+__TRY{
       /* Transfer the pixels */
     switch(descr->infoBpp)
     {
@@ -3586,7 +3594,9 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
         XPutImage( gdi_display, descr->drawable, descr->gc, bmpImage,
                   descr->xSrc, descr->ySrc, descr->xDest, descr->yDest,
                   descr->width, descr->height );
+}

+__EXCEPT(exceptionfilter){lines = 0;} __ENDTRY
     if (!descr->image) XDestroyImage( bmpImage );
     wine_tsx11_unlock();
     return lines;