Release 980215

Sun Feb 15 12:02:59 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [graphics/x11drv/*.c] [objects/*.c]
	A few X11 critical section optimizations, mostly with XGet/PutPixel.

	* [scheduler/sysdeps.c] [misc/main.c]
	Make sure X11 critical section is available before any Xlib call.

	* [if1632/relay.c] [tools/build.c]
	Yet another attempt at fixing Catch/Throw.

	* [loader/pe_image.c]
	Fixed broken PE DLL loading.

	* [include/winnt.h] [scheduler/handle.c] [scheduler/*.c]
	Implemented handle access rights.
	Added Get/SetHandleInformation.

Sun Feb 15 09:45:23 1997  Andreas Mohr <100.30936@germany.net>

	* [misc/winsock.c]
	Fixed bug in WSACleanup which lead to crashes in WINSOCK_HandleIO.

	* [graphics/fontengine.c] [include/font.h]
	Minor improvements.

	* [memory/global.c]
	Implemented GlobalEntryHandle.

	* [misc/toolhelp.c]
	Fixed a memory bug in Notify*register.

	* [misc/w32scomb.c]
	Improved Get16DLLAddress.

	* [objects/gdiobj.c]
	Implemented GdiSeeGdiDo.


Sat Feb 14 14:57:39 1998  John Richardson <jrichard@zko.dec.com>

	* [win32/console.c]
	Added the console implementation, AllocConsole, FreeConsole,
	CONSOLE_InheritConsole.

	* [documentation/console]
	Some documentation on the console.

	* [include/winerror.h]
	Added some error defines.

	* [scheduler/k32obj.c]
	Registered the scheduler ops.

Fri Feb 13 19:35:35 1998  James Moody  <013263m@dragon.acadiau.ca>

	* [ole/ole2nls.c]
	Some English language fixes for missing values.

	* [controls/listbox.c]
	Fix to allow an empty listbox to deselect all items.

	* [relay32/user32.spec] [windows/keyboard.c]
	CreateAcceleratorTableA stub method.

	* [windows/sysmetrics.c]
	Added missing SM_CXCURSOR & SM_CYCURSOR initializers.

	* [windows/message.c]
	PostThreadMessage32A stub method.

Fri Feb 13 17:12:24 1998  Jim Peterson <jspeter@roanoke.infi.net>

	* [libtest/hello3res.rc] [libtest/hello3.c] [libtest/Makefile.in]
	Updated the 'hello3' test so that it functions properly again.

Fri Feb 13 14:08:07 1998  Martin Boehme  <boehme@informatik.mu-luebeck.de>
	
	* [graphics/mapping.c]
	Fixed the embarrassing bugs I introduced into DPtoLP and
	LPtoDP.

	* [windows/scroll.c]
	Prevent ScrollWindow32 from sending WM_ERASEBKGND.

Thu Feb 12 22:46:53 1998  Huw D M Davies <h.davies1@physics.oxford.ac.uk>

	* [objects/metafile] [include/ldt.h]
	Fix to cope with records longer than 64K.

	* [windows/clipboard.c]
	Clean up bitmaps and metapicts properly.

Mon Feb  3 21:52:18 1998  Karl Backström <karl_b@geocities.com>

	* [programs/winhelp/Sw.rc] [resources/sysres_Sw.rc]
	Minor update of Swedish language support.
diff --git a/objects/bitmap.c b/objects/bitmap.c
index fc59250..7d8a36d 100644
--- a/objects/bitmap.c
+++ b/objects/bitmap.c
@@ -42,7 +42,7 @@
 
 static int XPutImage_wrapper( const struct XPutImage_descr *descr )
 {
-    return TSXPutImage( display, descr->bmp->pixmap, BITMAP_GC(descr->bmp),
+    return XPutImage( display, descr->bmp->pixmap, BITMAP_GC(descr->bmp),
                       descr->image, 0, 0, 0, 0, descr->width, descr->height );
 }
 
@@ -235,7 +235,7 @@
  */
 XImage *BITMAP_GetXImage( const BITMAPOBJ *bmp )
 {
-    return TSXGetImage( display, bmp->pixmap, 0, 0, bmp->bitmap.bmWidth,
+    return XGetImage( display, bmp->pixmap, 0, 0, bmp->bitmap.bmWidth,
                       bmp->bitmap.bmHeight, AllPlanes, ZPixmap );
 }
 
@@ -284,6 +284,8 @@
       return 0;
     }
 
+    EnterCriticalSection( &X11DRV_CritSection );
+
     /* Hack: change the bitmap height temporarily to avoid */
     /*       getting unnecessary bitmap rows. */
     old_height = bmp->bitmap.bmHeight;
@@ -304,7 +306,7 @@
             {
                 if ((w%8) == 0)
                     *tbuf = 0;
-                *tbuf |= TSXGetPixel(image,w,h)<<(7-(w&7));
+                *tbuf |= XGetPixel(image,w,h)<<(7-(w&7));
                 if ((w&7) == 7) ++tbuf;
             }
             tbuf += pad;
@@ -315,8 +317,8 @@
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
             {
-                if (!(w & 1)) *tbuf = TSXGetPixel( image, w, h) << 4;
-	    	else *tbuf++ |= TSXGetPixel( image, w, h) & 0x0f;
+                if (!(w & 1)) *tbuf = XGetPixel( image, w, h) << 4;
+	    	else *tbuf++ |= XGetPixel( image, w, h) & 0x0f;
             }
             tbuf += pad;
         }
@@ -325,7 +327,7 @@
         for (h=0;h<height;h++)
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
-                *tbuf++ = TSXGetPixel(image,w,h);
+                *tbuf++ = XGetPixel(image,w,h);
             tbuf += pad;
         }
         break;
@@ -335,7 +337,7 @@
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
             {
-	    	long pixel = TSXGetPixel(image,w,h);
+	    	long pixel = XGetPixel(image,w,h);
 
 		*tbuf++ = pixel & 0xff;
 		*tbuf++ = (pixel>>8) & 0xff;
@@ -347,7 +349,7 @@
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
             {
-	    	long pixel = TSXGetPixel(image,w,h);
+	    	long pixel = XGetPixel(image,w,h);
 
 		*tbuf++ = pixel & 0xff;
 		*tbuf++ = (pixel>> 8) & 0xff;
@@ -356,7 +358,9 @@
             tbuf += pad;
 	}
     }
-    TSXDestroyImage( image );
+    XDestroyImage( image );
+    LeaveCriticalSection( &X11DRV_CritSection );
+
     GDI_HEAP_UNLOCK( hbitmap );
     return height * bmp->bitmap.bmWidthBytes;
 }
@@ -411,10 +415,11 @@
 
     widthbytes	= DIB_GetXImageWidthBytes(bmp->bitmap.bmWidth,bmp->bitmap.bmBitsPixel);
     tmpbuffer	= (LPBYTE)xmalloc(widthbytes*height);
-    image = TSXCreateImage( display, DefaultVisualOfScreen(screen),
-		  bmp->bitmap.bmBitsPixel, ZPixmap, 0, tmpbuffer,
-		  bmp->bitmap.bmWidth,height,32,widthbytes
-    );
+
+    EnterCriticalSection( &X11DRV_CritSection );
+    image = XCreateImage( display, DefaultVisualOfScreen(screen),
+                          bmp->bitmap.bmBitsPixel, ZPixmap, 0, tmpbuffer,
+                          bmp->bitmap.bmWidth,height,32,widthbytes );
     
     /* copy 16 bit padded image buffer with real bitsperpixel to XImage */
     sbuf = (LPBYTE)buffer;
@@ -425,7 +430,7 @@
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
             {
-                TSXPutPixel(image,w,h,(sbuf[0]>>(7-(w&7))) & 1);
+                XPutPixel(image,w,h,(sbuf[0]>>(7-(w&7))) & 1);
                 if ((w&7) == 7)
                     sbuf++;
             }
@@ -437,8 +442,8 @@
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
             {
-                if (!(w & 1)) TSXPutPixel( image, w, h, *sbuf >> 4 );
-                else TSXPutPixel( image, w, h, *sbuf++ & 0xf );
+                if (!(w & 1)) XPutPixel( image, w, h, *sbuf >> 4 );
+                else XPutPixel( image, w, h, *sbuf++ & 0xf );
             }
             sbuf += pad;
         }
@@ -447,7 +452,7 @@
         for (h=0;h<height;h++)
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
-                TSXPutPixel(image,w,h,*sbuf++);
+                XPutPixel(image,w,h,*sbuf++);
             sbuf += pad;
         }
         break;
@@ -457,7 +462,7 @@
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
             {
-                TSXPutPixel(image,w,h,sbuf[1]*256+sbuf[0]);
+                XPutPixel(image,w,h,sbuf[1]*256+sbuf[0]);
                 sbuf+=2;
             }
         }
@@ -467,7 +472,7 @@
         {
             for (w=0;w<bmp->bitmap.bmWidth;w++)
             {
-                TSXPutPixel(image,w,h,(sbuf[2]<<16)+(sbuf[1]<<8)+sbuf[0]);
+                XPutPixel(image,w,h,(sbuf[2]<<16)+(sbuf[1]<<8)+sbuf[0]);
                 sbuf += 3;
             }
             sbuf += pad;
@@ -480,8 +485,9 @@
     descr.width  = bmp->bitmap.bmWidth;
     descr.height = height;
     CALL_LARGE_STACK( XPutImage_wrapper, &descr );
-
-    TSXDestroyImage( image ); /* frees tmpbuffer too */
+    XDestroyImage( image ); /* frees tmpbuffer too */
+    LeaveCriticalSection( &X11DRV_CritSection );
+    
     GDI_HEAP_UNLOCK( hbitmap );
     return height * bmp->bitmap.bmWidthBytes;
 }